Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic mass "varies"

1 REPLY 1
Reply
Message 1 of 2
projektant
393 Views, 1 Reply

iLogic mass "varies"

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 :

 

iProperties.MassOfComponent("fi_N1:1")=Round(iProperties.MassOfComponent("fi_N1:1"),1)

 

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.

1 REPLY 1
Message 2 of 2
xiaodong_liang
in reply to: projektant

Hi,

 

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
Next

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report