Hi @SECOJOSE. I'm still using Inventor Pro 2024.3, and there is nothing within the standard iLogic 'snippets' that suggests a way to specify a specific ModelState for this code to focus on yet. I know that in 2025 some advancements were made to give us more control over how those 'simplistic' iLogic shortcut snippets access documents with multiple ModelStates in them, but I thing that additional control is mainly focussed on whether your 'edits' will effect only the 'active' ModelState or 'all' ModelStates in the target document. I am not sure if they added a way to say which specific ModelState you want it to read from / write to with that code tool. There are also multiple other uncertainties (not well documented anywhere) about how that simplistic code tool will work in different situations.
You could try replacing the regular file name, with extension with "22240287.iam (Model State1)", where the name of the ModelState is included at the end, after a single space, and within ( & ) symbols, like how it appears in the Document.DisplayName value, when representing a ModelState member.
However, then the whole issue of factory vs member thing comes into play. We can usually read or write to the 'factory' version of a model document, but can only read from member versions of the document. There is only a 'factory' when there are 2 or more ModelStates present, and the factory is simply the document associated with whichever ModelState happens to be 'active' at that time.
Wesley Crihfield

(Not an Autodesk Employee)