Inventor Customization

Posts: 18
Registered: ‎08-10-2011
Message 1 of 2 (192 Views)

iLogic mass "varies"

192 Views, 1 Replies
11-16-2012 09:15 AM

In assembly file - BOM - mass property, parts with the same name (part number) i get "VARIES"

Parts have a little bit different mass - 0,167kg and 0,168kg. I do not want to have different part number.


So, i'm going to do something like this in iLogic :




it works but is there any way to do it for all parts (hundreds) automagically in the loop (iLogic or VB) ?

beacuse i don't want to waste my time to do it manually.

ADN Support Specialist
Posts: 1,271
Registered: ‎06-12-2011
Message 2 of 2 (118 Views)

Re: iLogic mass "varies"

12-17-2012 11:57 PM in reply to: projektant



Hope the code below is what you need:


Dim oOcc 
For Each oOcc in   ThisDoc.Document.ComponentDefinition.Occurrences 
   If TypeOf oOcc.Definition Is PartComponentDefinition Then
           iProperties.MassOfComponent(oOcc.Name) = Round(iProperties.MassOfComponent(oOcc.Name),1)
   End If

Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.