0

Inventor API プログラミングは初めてです。アクティブなドキュメントのプロパティを取得したいです。コーディングに vb.net を使用しています。いくつかのコードを試しましたが、助けがありませんでした。ここでは、発明者のドキュメントを開くためにいくつかのコードを使用していますが、正常に動作しています

Public Sub OpenDoc()
    Dim oDoc As Document
    oDoc = _InvApplication.Documents.Open _
                             ("C:\Temp\Part1.ipt")
End Sub

part1.ipt ドキュメントのプロパティを取得する方法を知っている人はいますか?

4

2 に答える 2

2

まずオブジェクトモデルを理解しよう

Application
   |
   -------- Documents
               |
               ---------- Document
                              |
                              ------------- PropertySet
                                                |
                                                ------------ Property

これで、必要な情報にアクセスできます...

Public Sub ShowDocuments()
     ' Get the Documents collection object.
     Dim invDocs As Documents
     Set invDocs = ThisApplication.Documents
     ' Iterate through the contents of the Documents collection.
     Dim i As Integer
     For i = 1 To invDocs.Count
         ' Get a specific item from the Documents collection.
         Dim invDocument As Document
         Set invDocument = invDocs.Item(i)
         ' Display the full filename of the document in the Immediate window.
         Debug.Print invDocument.FullFileName
     Next
End Sub
于 2013-06-28T07:14:24.020 に答える