iLogic Multi-Value list from Materials

iLogic Multi-Value list from Materials

Anonymous
Not applicable
5,677 Views
4 Replies
Message 1 of 5

iLogic Multi-Value list from Materials

Anonymous
Not applicable

I am trying to populate a multi-value user parameter with a list composed of the various materials available from the iProperties "Physical" tab. So far I have this:

 

For Each material In iProperties.Materials        

Bracket_Material.Items.Add(material)        

Next

 

iProperties.Material=Bracket_Material

 

Running the Rule gets this error message:

 

Rule Compile Errors in Material_Rule, in _Mounting_bracket.ipt

Error on Line 2 : 'Bracket_Material' is not declared. It may be inaccessible due to its protection level.

 

I think I am doing the "Bracket_Material.Items.Add(material) " line wrong, but I don't know enough VB to fix it. It seems to me it IS declared in the Parameters table - isn't adding the parameter to the parameter table sufficient to declare it?

 

Eventually I want to add the Bracket_Material Parameter to a form so the user can select material from drop down list and assign it to part.
I have also attached the file.

Any help appreciated!

Accepted solutions (1)
5,678 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

Never mind - I solved it (as I so often do 30 seconds after I hit the "Post" button....)

 

MultiValue.List("Bracket_Material") = iProperties.Materials

iProperties.Material=Bracket_Material

 

and remember to declare the Bracket_Material parameter as a Key so it will show up in the User Paramters list in the iLogic editor Model...User Parameters tab.

I also added a form to show that it works as a dropdown list just for that rule.("Material_Rule")

See attached.

 

 

 

Message 3 of 5

Anonymous
Not applicable

well thats great. i cant open that for some reason i get this error.

 

0 Likes
Message 4 of 5

Anonymous
Not applicable
Accepted solution

Try this - done in Inventor 2012, previous was 2013.

There should be no need to have a separatre rule to "suck the material list in". Just define the user parameter "Bracket_Material" as a text multivalue list in the Parameters dialogue and the first time you run the rule it will populate the list automatically. Depending what other rules you have and in what order they are executed, you may have to assign material manually first time through the parameters dialogue (click on the multivalue list dropdown) to set the material to something available in your material style library or Inventor won't like the selection. It may also default to no value at all first time - again just assign manually the first time.Thereafter you should be ok.

Message 5 of 5

Anonymous
Not applicable

Thanks Brother, You solved one of the Issues I was figuring out how to solve!

0 Likes