Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to assign values to a variable from a multivalue parameter - using iLogic

1 REPLY 1
Reply
Message 1 of 2
RWickrama
289 Views, 1 Reply

How to assign values to a variable from a multivalue parameter - using iLogic

In my iLogic routine of work, I need help on the following:

Having created multivalue variable(s), I need to retrieve all or selectively retrieve some of data from the list(s) to assign to another variable(s). For example, suppose the list is xList = (23, 56, 76 92).How can I assign value of 56 (2nd value of xList) to another variable, say x. (x wil have have value of 56).

 

Pl. help.

1 REPLY 1
Message 2 of 2

One way of doing this is shown below: Imports Inventor.UnitsTypeEnum If ThisDoc.Document.DocumentType = kPartDocumentObject Then Try oChecker = ThisDoc.Document.ComponentDefinition.Parameters.UserParameters.Item("TWL") MultiValue.SetList("TWL", 12, 75, 900) TWL=12 Catch ' oTWL=ThisDoc.Document.ComponentDefinition.Parameters.UserParameters.AddByValue("oTWL", 1, kcentimeterLengthUnits) oTWL=ThisDoc.Document.ComponentDefinition.Parameters.UserParameters.AddByValue("TWL", 1/10, kmillimeterLengthUnits) MultiValue.SetList("TWL", 22, 75, 900) TWL=12 End Try End If i = 0 For Each valueTWL In MultiValue.List("TWL") i = i+1 If i = 1 Then Thickness = valueTWL If i = 2 Then Width = valueTWL If i = 3 Then Length = valueTWL Next MessageBox.Show("Thickness: " & Thickness & vbCrLf & "Width: " & Width & vbCrLf & "Length: " & Length, "TWL") iProperties.Value("Project", "Description")= "PL." & " " & Thickness & " X " & Width & " X " & Length MessageBox.Show("DESCRIPTION: " & iProperties.Value("Project", "Description"), "Title") This is one of the methods. Many could have better solutions. I request post, if so. Thanks.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report