Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
STECORO
174 Views, 2 Replies

Create custom parameters with mm^2 as a unit

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