Message 1 of 5

Not applicable
07-10-2018
03:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi , I'm new with ilogic code. I'm recently working on a code to automatic sort the Partslist inside a IDW.
The Partslist doesn't have a mass column. but in order to sort it i need the weight for each row. so i write following code.
SyntaxEditor Code Snippet
On Error Resume Next
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
Dim oPartsList1 As PartsList
oPartsList1 = oDrawDoc.ActiveSheet.PartsLists.Item(1)
Dim oRow As PartsListRow
Dim oAssyDoc As AssemblyDocument
Dim Mass As Double
For Each oRow In oPartsList1.PartsListRows
MessageBox.Show(oRow.ReferencedFiles.Item(1).DocumentType)
oAssyDoc = oRow.ReferencedFiles.Item(1)
oAssyDoc.ComponentDefinition.MassProperties.Accuracy = k_Medium
Mass = oAssyDoc.ComponentDefinition.MassProperties.Mass
MessageBox.Show(Mass)
Next
I can see the referenced file type 12290 (ipt) and 12291 (iam). but the weight is always 0.
can anyone help me with that ?
Thanks
Solved! Go to Solution.