Do a "Add Numeric" Parameter to an .ipt.

b_ruijter
Advocate
Advocate

Do a "Add Numeric" Parameter to an .ipt.

b_ruijter
Advocate
Advocate

I would like to know if it's possible to create a parameter via ilogic. 

0 Likes
Reply
Accepted solutions (1)
399 Views
2 Replies
Replies (2)

TomaszDabrowski
Autodesk
Autodesk

Hi.

You can use the AddByValue method. Few examples below:

Dim oDoc As PartDocument = ThisDoc.Document
oDoc.ComponentDefinition.Parameters.UserParameters.AddByValue("myParam", 15, UnitsTypeEnum.kMillimeterLengthUnits)
oDoc.ComponentDefinition.Parameters.UserParameters.AddByValue("myParam2", 15, "mm")
oDoc.ComponentDefinition.Parameters.UserParameters.AddByValue("myParam3", 15, "ul")

The rule will create 3 numeric user parameters. Keep in mind that the length parameters are initially defined in "cm", so you will probably need to divide your value

video 

Tomasz Dąbrowski
Technical Support Specialist
Customer Technical Success
0 Likes

vpeuvion
Advocate
Advocate
Accepted solution

Hi, can you try this : 

Thisdoc.document.ComponentDefinition.Parameters.UserParameters.AddByExpression("AddNumeric", "2000", "mm")

Vincent.