I use the following ilogic code to calculate mass of a part or assembly and display it without the "lbs" or "kgs" label. I am wondering what else I need to add to export the parameter as a custom iproperty. Please excuse me if this is a dumb question; I am just learning iLogic.
SyntaxEditor Code Snippet
Dim openDoc As Document openDoc = ThisDoc.Document 'KG If openDoc.unitsofmeasure.massunits = 11283 Then conversion_factor_lbs = 2.20462 conversion_factor_kgs = 1.0 End If 'grams If openDoc.unitsofmeasure.massunits = 11284 Then conversion_factor_lbs = 0.0022046 conversion_factor_kgs = 0.001 End If 'slugs If openDoc.unitsofmeasure.massunits = 11285 Then conversion_factor_lbs = 32.1740486 conversion_factor_kgs = 14.5939029 End If 'lbs If openDoc.unitsofmeasure.massunits = 11286 Then conversion_factor_lbs = 1.0 conversion_factor_kgs = 0.4535924 End If Mass_lbs = iProperties.Mass * conversion_factor_lbs Mass_kgs = iProperties.Mass * conversion_factor_kgs If Mass_lbs < 1 Then Weight_lbs = Round(Mass_lbs,2) Else If Mass_lbs >= 1 Then Weight_lbs = Round(Mass_lbs) End If If Mass_kgs < 1 Then Weight_kgs = Round(Mass_lbs,2) Else If Mass_kgs >= 1 Then Weight_kgs = Round(Mass_kgs) End If
Hi,
inside the Ilogics editor you will find this piece of code which can be used to add/change a custom Iproperty.
iProperties.Value("Custom", "PropertyName") = 100
I know it's an old post but still....
If you try to set a non-existent custom iproperty IV will automaticaly add that property?
How does it define the property? As text? Because there are several types to choose from when adding a custom field from the iproperty window.
Hi,
the follow link give you a well explained answer
https://modthemachine.typepad.com/my_weblog/2010/02/custom-iproperties.html
Bregs
Rossano Praderi