Hi @C_Haines_ENG. We can place views of multiple different ModelState versions of the same model file into the same drawing, and even on the same sheet within the drawing. So, the drawing itself does not really have an active ModelState. Each view within the drawing can be set to one of the specific ModelState objects that are available within the model file that the view is referencing. It is possible for the view to be set to one ModelState, while the actual model document that may be open in another file tab, may have a different ModelState currently active.
DrawingView.ActiveModelState (ReadOnly property with String type value)
DrawingView.SetActiveModelState (Method used to 'set' which ModelState the view should be referencing)
So, if starting from a drawing, then the code must access one specific drawing view, check which ModelState that view is currently set to, then after you access the file that the view is referencing, you would then need to ensure that you will be working with the same ModelState that the drawing view was set to, one way or another. The 'factory' document is simply the document that is associated with whichever ModelState happens to be 'active' at that time in that model file. There will only be a factory document if the file has 2 or more ModelStates in it. Any document associated with a ModelState that is not active, is known as a ModelState member document, and will act like it is ReadOnly. The ModelState object has a 'method' (Sub routine) called Activate, which can be used to set that ModelState object to be the active one. Or, there is also the ModelStateTable object, which can be used to access the table containing the data for all existing ModelStates, where you can change the values of individual table cells. There is also the MemberEditScope that needs to be kept in mind. That is used for iParts, iAssemblies, and for ModelStates, to control whether changes should only effect the 'active member' or all members, with a value from the MemberEditScopeEnum.
Wesley Crihfield

(Not an Autodesk Employee)