Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I am trying to run a loop on all components in assembly and save part extent details to its iproperties. But ilogic function "Measure" doesn't work as it's capturing details of open assembly instead of part that I've opened. Also when I save iproperties, it's getting saved in assembly file instead of opened part doc. I think I am missing something major about how iLogic scope works.
Any solution?
Dim oRefDocs As DocumentsEnumerator oRefDocs = oAsmDoc.AllReferencedDocuments Dim oRefDoc As Document 'work the the drawing files for the referenced models 'this expects that the model has been saved For Each oRefDoc In oRefDocs iptPathName = Left(oRefDoc.FullDocumentName, Len(oRefDoc.FullDocumentName) - 3) & "ipt" 'check that model is saved If(System.IO.File.Exists(iptPathName)) Then Dim oDrawDoc As PartDocument oDrawDoc = ThisApplication.Documents.Open(iptPathName, True) Try ' TODO: measure dimensions of opened part Dim x = Measure.ExtentsLength Dim y = Measure.ExtentsWidth Dim z = Measure.ExtentsHeight Dim Thick = MinOfMany (x, y, z) Dim Length = MaxOfMany (x, y, z) Dim Width = x + y + z - Thick - Length ' TODO: Write to open document iProperties.Value("Custom", "THICKNESS")= Thick iProperties.Value("Custom", "WIDTH")= Width iProperties.Value("Custom", "LENGTH")= Length iProperties.Value("Custom", "RM Type") = "Plate" oDrawDoc.Save Catch End Try oDrawDoc.Close Else End If Next
Solved! Go to Solution.