cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Link derived model states to part

Link derived model states to part

When creating a derived part I want to be able to create model states that can linked to the model states of the derived base part.

 

The root cause is that the derive option of model state can't be captured in part's model state, so the derived part won't be updated when switch model states.

 

See attachment for reference. 

 

My base part has different lengths. And I want my derived part to be able to change the model state of the base part. That way, I can make my derived part change length as well. Direct edit doesn't work unfornunatly as it may have been a workable workaround. So either this should be come availble from the edit derived part envoirment directly or it should be made possible with some iLogic code.

 

 

23 Comments
Yijiang.Cai
Autodesk

@m.verbunt , many thanks for you providing this idea to us! I am using iLogic to create one sample for you, and could take a look. When switching model state, and you will find the model state using for model state is switched based on the model state selection. 

I did not get the way to attach the dataset here. If you are interested, please share the email with me or ping me at [email protected]. I could share the dataset with you.

    Dim oDoc As PartDocument
    oDoc = ThisDoc.Document
    
    Dim oDef As PartComponentDefinition
    oDef = oDoc.ComponentDefinition
    
    Dim oDeriveDef As DerivedPartDefinition
    oDeriveDef = oDef.ReferenceComponents.DerivedPartComponents(1).Definition
    
    oDeriveDef.ActiveModelState = oDef.ModelStates.ActiveModelState.Name
 
    oDef.ReferenceComponents.DerivedPartComponents(1).Definition = oDeriveDef

 

 

Hope it useful for you!

 

Thanks,
River

Yijiang.Cai
Autodesk

@m.verbunt , many thanks for you providing the idea to us! I am using iLogic to create the sample to drive the model state in derive feature using model state in part document. You could take a look here. If you are interested, please ping me at [email protected], and I could share the dataset with you.

    Dim oDoc As PartDocument
    oDoc = ThisDoc.Document
    
    Dim oDef As PartComponentDefinition
    oDef = oDoc.ComponentDefinition
    
    Dim oDeriveDef As DerivedPartDefinition
    oDeriveDef = oDef.ReferenceComponents.DerivedPartComponents(1).Definition
    
    oDeriveDef.ActiveModelState = oDef.ModelStates.ActiveModelState.Name
 
    oDef.ReferenceComponents.DerivedPartComponents(1).Definition = oDeriveDef

Thanks,

River

niki
Contributor

Yes....  this is a huge missing in the new Model State environment and should be implemented from Autodesk as fast as possible. Really missing this possibility when doing skeletal modeling and automated assemblies.

niki
Contributor

@Yijiang.Cai 

You suggestion of using the iLocig code is not perfectly working through the top Assembly change in Model State. And what about dirtying files when released in Vault?  I think this is a huge missing in the Model State environment.

Anonymous
Not applicable

Hi,

I too am finding Derived parts and Model States do not work well together. We do not want to have to use Ilogic to make this work. Hopefully in the next update this problem can be solved.

Thanks.

BDCollett
Advisor

I just came across this, yet another feature with model states that has not been considered. The ilogic is a workaround but far from a complete one and as others have mentioned will cause problems with Vault.

Lets hope this one can be implemented!

KGehrelsUNHWD
Enthusiast

@Yijiang.Cai

How would you modify this rule to go through all of the parts of an assembly so that their model states are all updated whenever the assembly model state is activated?

 

What is going on is that the part model states are controlled by the assembly model states but the derived model state within the parts do not update.

 

What I have is:

Assembly:

   Assembly Model State 1

      Part 1 Model State 1

         Skeleton Model State 1

      Part 2 Model State 1

         Skeleton Model State 1

 

   Assembly Model State 2

      Part 1 Model State 2

         Skeleton Model State 2

      Part 2 Model State 2

         Skeleton Model State 2

 

   Assembly Model State 3

      Part 1 Model State 3

         Skeleton Model State 3

      Part 2 Model State 3

         Skeleton Model State 3

 

Thanks

KGehrelsUNHWD
Enthusiast

I was able to write the below code for changing derived parts or assembly components.

The only issue is that it can take a while to run since Inventor wants to save all files before changing to another model state.  

 

Is there a way for Inventor not to have to save a part file when the derived part has changed its model state?

 

Sub Main
	Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveEditDocument
	Dim oAsmCompDef As AssemblyComponentDefinition = oAsmDoc.ComponentDefinition
	Dim oDoc As Document
	Dim oAsmState As ModelState = oAsmCompDef.ModelStates.ActiveModelState
	
	For Each oDoc In oAsmDoc.AllReferencedDocuments
		On Error Resume Next
		Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition
		Dim oDeriveDef As DerivedPartDefinition = oDef.ReferenceComponents.DerivedPartComponents(1).Definition
		
		oDeriveDef.ActiveModelState = oAsmState.Name
		oDef.ReferenceComponents.DerivedPartComponents(1).Definition = oDeriveDef
		oDoc.Save
		oDoc.Close
	Next
End Sub	

Of course, they could never have come up with that at Autodesk. They haven't been doing anything in the engineering field for very long. Pretending to be crazy, also an art.
How is this in IV2023?

KGehrelsUNHWD
Enthusiast

An update on the iLogic that I developed above.  While it will update an assembly, terribly slowly, Inventor is unable to handle if there is a subassembly and will freeze or crash.

+1 to Inventor creating an internal tool that will select the model state of derived parts, like it allows the model state of a part in an assembly to be selected.

dougnano
Participant

@m.verbunt I agree, this seems to be a huge hole in Model States Functionality.  I was pretty excited about how well thought-out Model States seemed to be, until I ran across this.  Given how much I rely on skeleton modeling, this one omission makes Model States less than half as useful for me than it would otherwise be.  I use Vault, so based on other posts in this thread, I'm not even tempted to go down the rabbit hole of an iLogic workaround.

 

This almost seems like a bug rather than an omission, since within the derived part you can choose the model state of the part it's derived from via the "Edit Derived Part" command (you're not stuck with the master model state); it just doesn't update when changing model states in the derived part.  I hope this gets fixed soon!

fpanther
Explorer

Yes dougnano, 100% agree, this is a big topic, Autodesk please jump in and take action.

Why no update on this since August '22? Keep up the good work, the rest of the model state concept is genious.

michael_ilewiczKKL3H
Participant

Yes, please implement this! This should be a matter of a few lines of code on Autodesks end!

BDCollett
Advisor

Fingers crossed for 2024.1 or 2025?

StewartFuchs
Participant

I haven't reviewed IV 2024 yet. Has this been resolved?

BDCollett
Advisor

@StewartFuchs as per my post above, no. 2024.1 is out now and still no, unfortunately.

 

 

fpanther
Explorer

Thanks for the update, BDCollett!

dougnano
Participant

Yes BDCollett, thanks for the update.  I keep hoping to see this addressed on the next update.

BeKirra
Advisor

Inventor 2023 Pro.

 

I was going to submit the same idea but find this existing thread.

Yes, it is definitely one of useful functions that users are looking for.

Hope it will be available in the next update.

Yijiang.Cai
Autodesk
Status changed to: Future Consideration

Many thanks for posting the idea to us, and tracked as [INVGEN-76096]

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

Submit Idea