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: 

it is possible to get a list of model states and be able to select them in a form?

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Miguel.CarvajalS34Q6
671 Views, 1 Reply

it is possible to get a list of model states and be able to select them in a form?

I don't know if it is possible to generate several model states, and be able to select the one that is needed from a drop-down list in a form and thus be able to give values ​​to other text-type variables depending on the state of the model and thus be able to incorporate properties to each state of model faster.

 

In short, it is necessary that from a form they define different variables for each model state, but from a form.

thank you so much

1 REPLY 1
Message 2 of 2

Hi @Miguel.CarvajalS34Q6.  I think something like this has already been asked, but the other forum thread may have been slightly different.  The only way to get a list of all the ModelStates present in a document into an iLogic Form for you to be able to choose one with a drop-down list would be to create a multi-value UserParameter, then add the names of all of the ModelStates to that list.  But simply selecting a name from that list, would not automatically change which ModelState you would be editing with the iLogic Form.  When an iLogic Form is first launched, it sets its focus on whichever document was active at that time.  And even if you leave that form open while you switch to a different document, the focus of that form will not change to that other document, it will still be pointing to the first document.  I believe it is the same for ModelStates, because each ModelState represents a different Document, even if they are all stored within the same file on disk.  Plus, if there were multiple ModelStates, and they each had different values for some parameters or iProperties, the form would only be able to show the current value of the one ModelState that was active when the form was first launched, not any of the other values for that one parameter or iProperty.

 

Your best bet is likely to just edit the ModelStates in the Excel Worksheet, by right-clicking on the Model States folder in your model browser tree, then choosing 'Edit via Spreadsheet...' option.  We can also access the ModelStatesTable or the Excel Worksheet of the ModelStates by code, but I do not know of a good way to show all of that custom data for all of the ModelStates in one place using a Form, and allow the user to change anything they want yet.  Maybe if you had a custom Windows Form that included some sort of data grid control that was interactive, bit I have not gone that route before yet myself.

WCrihfield_0-1690997406150.png

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

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

Post to forums  

Autodesk Design & Make Report