- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello community!
I was trying to create a new custom parameter without having it in the parameter list.
I would like to set the area as a unit with mm^2, but I only found Circular_mill.
I found this logic, but it sets text as a unit because of ‘UnitsTypeEnum.kTextUnits’.
Can anyone help me to set mm^2 as a unit within ilogic?
Thanks in advance.
Regards
Dim oParams As Parameters Dim oPartDoc As PartDocument = ThisDoc.Document Dim oPartCompDef As PartComponentDefinition = oPartDoc.ComponentDefinition oParams = oPartCompDef.Parameters Dim oUserParams As UserParameters = oParams.UserParameters Try p = Parameter("PAINTED_AREA") Catch oUserParams.AddByValue("PAINTED_AREA","MyValue", UnitsTypeEnum.kTextUnits) End Try
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This is how you add squared units:
oUserParams.AddByValue("PAINTED_AREA", 1, "mm^2")
Are you using inventor 2024+? It added the "Finish" functionality that automatically makes a parameter for the painted area
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @daltonNYAW9 , thanks for the reply.
Yes, we are using the 2024, but we have created a rule that works differently to the finishing functionality, working with the multi-body it is quite difficult to detect the perimeter painted area, so we worked to detect the interference between the bodies and so on.
Thanks again for your help.
Best regards
Stefano