I am having what is probably a very elementary issue with creating a Parts List in Inventor
I need Surface Area, Mass, Thickness and Material for each part in the Parts list.
I also need to multiply the above by a Total_Quantity parameter in the assembly to give Total_Surface_Area, Total_Mass, etc etc
I also
The only way I have been able to get these is by creating a user parameter in the assembly for Total_Quantity, and then adding all the six / seven parameters to each part and sub-assembly manually.
Additionally, the EXPORT PARAMETER checkbox must be checked for each one, which is often forgotten, meaning someone (me) has to go back in and check each and every part).
This can take a long long time.
Is there a simple iLogic rule that can be used to insert the parameters into all parts and sub-assembies related to an assembly automatically that will also check the Export Parameter box so it can be used in a Parts List?
Many thanks in advance...
use this sample to create parameters.
if you want to make it work from a assembly you need to loop thru the componentoccurences.
Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 6739 StartFragment: 314 EndFragment: 6707 StartSelection: 314 EndSelection: 314SyntaxEditor Code Snippet
'Dim oDoc As AssemblyDocument Dim oDoc As PartDocument = ThisDoc.Document 'of : oDoc as AssemblyDocumment = ThisDoc.Document 'nummerieke parameter Try prop = oDoc.ComponentDefinition.Parameters.UserParameters.item ("G_L") Catch newprop = oDoc.ComponentDefinition.Parameters.UserParameters.AddByExpression("G_L", "100", "mm") End Try param =Parameter.Param("G_L") param.ExposedAsProperty = True 'param.CustomPropertyFormat.Precision = kThreeDecimalPlacesPrecision param.CustomPropertyFormat.ShowTrailingZeros = False param.CustomPropertyFormat.ShowLeadingZeros = False param.CustomPropertyFormat.ShowUnitsString = False 'param.CustomPropertyFormat.Units = "in"
Thanks theo.bot
Sorry to be so ignorant, but how do I get it to loop through component occurences?
Also, what if I want to add a text parameter?
Ben
If you need to set parameters and iProperties you may avoid looping through component occurences because really you need in the documents (not component occurrences).
So it would be enough to iterate
or