How to migrate an assembly with substitute model state in Inventor 2022?

How to migrate an assembly with substitute model state in Inventor 2022?

CattabianiI
Collaborator Collaborator
822 Views
6 Replies
Message 1 of 7

How to migrate an assembly with substitute model state in Inventor 2022?

CattabianiI
Collaborator
Collaborator

Is there a guideline or something? Because I'm finding strange behaviour* if I migrate the file with substitute model state active.

*I'll show you the strange behaviour in a few hours when I easily reproduce the issue


0 Likes
Accepted solutions (1)
823 Views
6 Replies
Replies (6)
Message 2 of 7

johnsonshiue
Community Manager
Community Manager

Hi! Please share an example that exhibits the behavior here or with me directly johnson.shiue@autodesk.com. I would like to understand the strange behavior better.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 3 of 7

CattabianiI
Collaborator
Collaborator

Hi @johnsonshiue,
here's the screencast with the steps to reproduce the issue, the video starts after decompressing the attached pack&go and project activation: https://autode.sk/3EpcMQo

I know it's quite subtle the way I recognise the issue (asking for Document.ComponentDefinition.ModelStates.ActiveModelState.ModelStateType) but this API is important to me.
I posted here because the migration behaviour is beyond the API usage and because just saving again in master model state fix the problem as you can see in the video.
Just to be clear I have the 2022.2 RC.

Let me launch into an analysis of a possible cause you can totally ignore: it's like it was a factory document with substitute model state active, but the factory document does not exist if the document has just substitute model states; or in other words: it's like some section of the file are filled with substitute document data because that's the only document which is migrated until I migrate the master model state document.

0 Likes
Message 4 of 7

johnsonshiue
Community Manager
Community Manager

Hi! This does look like a bug. I personally think the substitute status should be shown correctly in the iLogic rule. I will need to work with the project team to understand it better.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 5 of 7

CattabianiI
Collaborator
Collaborator

Thank you @johnsonshiue 
if you'll have an INVGEN, please post it here

 

0 Likes
Message 6 of 7

JaneFan
Autodesk
Autodesk
Accepted solution

Hello @CattabianiI , 

 

ComponentOccurrence.Definition.Document is member document whose ActiveModelState is not certainly the one consumed in assembly. Would you please try whether the following code meets your need? 

Dim oSS As SelectSet
oSS = ThisApplication.ActiveDocument.SelectSet

Dim occ As ComponentOccurrence = oSS.Item(1)
Dim doc As Document = occ.Definition.Document

Dim isSubstitute As Boolean = doc.ComponentDefinition.ModelStates.item(occ.ActiveModelState).ModelStateType = ModelStateTypeEnum.kSubstituteModelStateType
MsgBox("isSubstitute: " & isSubstitute)



Jane Fan
Inventor/Fusion QA Engineer
Message 7 of 7

CattabianiI
Collaborator
Collaborator

@JaneFan thank you.
I don't really have needs but deeply understand model states and substitute in Inv2022.
That code clearly works well, and I can confirm there's no migration issue depending on which model state is active when you're migrating the file.

So what is the purpose of ModelStates.ActiveModelState? It's not the ModelState in which the factory is active because here the factory does not even exist.