Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I recently found this great class called standardobjectfactory and was under the impression I can create a new "document" object and then use ilogic function as if that was the active document.
So I tried something like this:
Dim bomTable As PartsList
If (ThisDrawing.Document.Sheets.Item(1).PartsLists.Count > 0) Then
bomTable = ThisDrawing.Document.Sheets.Item(1).PartsLists.Item(1)
End If
' check each row if the document belonging to this row has a property called settings.propertyToCheck and the value is y
Dim row As PartsListRow
For Each row In bomTable.PartsListRows
If (row.ReferencedFiles.Count > 0) Then ' if count = 0 = virtual
docObj = StandardObjectFactory.Create(row.ReferencedFiles.Item(1).DocumentDescriptor.ReferencedDocument)
Logger.Debug(docObj.ThisDrawing.Name )
Logger.Debug(docObj.ThisDocument.FileName)
End If
Next
To test this code. Create a drawing from an assembly and place a partslist.
Both logger function throw an error of Name / FileName is not a public member, but they show up in intellisense just fine. Am I understanding something wrong? Is that something that should work? For what is StandardObjectFactory if not for something like this. In the end I would like to access the properties as usual.
regards
Tobias
Solved! Go to Solution.