- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @Michael.Navara. In your previous response you mentioned "In my approach I can obtain only list of ModelState names." Just in case you would prefer to get the actual ModelStates collection object, instead of a String array of their names, below is single line of iLogic code that can be used to retrieve that directly from a Document object.
Dim oMSs As ModelStates = ModelStateUtils.GetModelStates(oDoc)
I don't know if that would be more preferable than the:
Dim modelStates As String() = inventor.FileManager.GetModelStates(fileName)
line or not in this situation though. Once you have the ModelStates collection object, you could access its ModelStateTable though, I guess. The ModelStateUtils Class is defined under the Autodesk.iLogic.Runtime Namespace, which is already being referenced in our iLogic rules for us, but they do not include most of these types of tools in their online help documentation, so you can only explore them in the rule editor screen.
As far as a possible alternative to the:
Dim lastModelState As String = inventor.FileManager.GetLastActiveModelState(fileName)
line of code, which could be used with a Document object, instead of a file name String, maybe the Document.ModelStateName property could return the same result, not sure. There are several other methods under the ModelStateUtils Class, and several other ModelState related Classes under the Autodesk.iLogic.Runtime Namespace, but not sure if any of them would be helpful here.
Wesley Crihfield
(Not an Autodesk Employee)