Curtis W. has this macro for writing the sheetmetal Extents width and length to the custom properties. I need to get these values into the part parameters so that they can be used in the BOM.
I can get this to work if I manually create the "SM_Length" user parameter, but how do I make the iLogic CREATE the parameters if they do not already exist? I think it would be something added below the "Catch..." just cant seem to figure out what it needs to be.
'look for custom iproperty and try to set it
Try
iProperties.Value("Custom", sExtLength)=Round(SheetMetal.FlatExtentsLength, iRoundValue)
Parameter("SM_Length")=Round(SheetMetal.FlatExtentsLength,4)
Catch
' assume error means not found and create it
customPropertySet.Add(Round(SheetMetal.FlatExtentsLength,iRoundValue), sExtLength)
EndTry
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
Thanks this rule works but I need it to create it a metric parameter
Imports Inventor.UnitsTypeEnum Dim oParams As Parameters oParams=ThisDoc.Document.ComponentDefinition.Parameters Dim oUserParams As UserParameters oUserParams=oParams.UserParameters 'look for user parameter and try to set it Try oUserParams("widthExtents").Value = SheetMetal.FlatExtentsLength *2.54 Catch ' assume error means not found and create itoUserParams.AddByValue("widthExtents", SheetMetal.FlatExtentsLength *2.54, kInchLengthUnits) End Try
Can't find what you're looking for? Ask the community or share your knowledge.