Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

cannot unsuppress a component in a sub-assembly in model state by running a rule in the sub-assembly from upper main assembly

2 REPLIES 2
Reply
Message 1 of 3
junGQMXK
547 Views, 2 Replies

cannot unsuppress a component in a sub-assembly in model state by running a rule in the sub-assembly from upper main assembly

junGQMXK
Enthusiast
Enthusiast

hi, every one,

recently, I began to use inventor 2022. obviously, all my old programs using LOD must be transferred to use model state.

 

I was trying to write some simple programs to imitate what I did when I was using LOD.

 

unfortunately, I found that I could not unsuppress a component(if this component is already in suppressed state) in a sub-assembly by running a rule in the sub-assembly from the upper main assembly.

 

the rule in my sub-assembly is very simple:

 

 

 

Dim doc As Document = ThisDoc.Document
Dim FacDoc As Document = doc.ComponentDefinition.FactoryDocument

If FacDoc.RequiresUpdate
	FacDoc.Update
	FacDoc.Save
End If

Try 
	FacDoc.ComponentDefinition.ModelStates.Item("Ilogic").Activate
Catch
	FacDoc.ComponentDefinition.ModelStates.Add("Ilogic")
Finally
	FacDoc.ComponentDefinition.ModelStates.Item("Ilogic").Activate
End Try
'----set "Ilogic" as the active model state




'I want to unsuppress the following component and then update it.
Component.IsActive("DP10-2054:1") = True
RuleParametersOutput()
InventorVb.DocumentUpdate()

'after update, this component is useless, I must suppress it.
Component.IsActive("DP10-2054:1") = False

 

 

 

if I opened this sub-assembly to run this rule, it was ok, there was no problem.

 

if I put this sub-assembly under my upper main assembly, and in the rule in my upper main assembly, I run this

rule in the following way, the error occurred---that is , the component could not be "unsuppressed":

 

 

iLogicVb.RunRule("sub assy for test:1", "part suppress rule")

 

 

 

 

 

I have tried to think over this issue and done different tests for 8 days, and still cannot find a solution.

 

my questions are:

 

1. is this because I was using model state?

2. model state does not allow us to run rules in this way?

3. how can I make my rule run in my sub-assembly from the upper main assembly?

4. I just want to imitate my old ways in LOD using model state, just to try to modify all my old programs to make them

    able to run under inventor 2022. Is there a more direct and simpler method? any special aspects that I must pay          attention to when I use model state?

 

 

 

any ideas?

 

thanks in advance.

 

 

0 Likes

cannot unsuppress a component in a sub-assembly in model state by running a rule in the sub-assembly from upper main assembly

hi, every one,

recently, I began to use inventor 2022. obviously, all my old programs using LOD must be transferred to use model state.

 

I was trying to write some simple programs to imitate what I did when I was using LOD.

 

unfortunately, I found that I could not unsuppress a component(if this component is already in suppressed state) in a sub-assembly by running a rule in the sub-assembly from the upper main assembly.

 

the rule in my sub-assembly is very simple:

 

 

 

Dim doc As Document = ThisDoc.Document
Dim FacDoc As Document = doc.ComponentDefinition.FactoryDocument

If FacDoc.RequiresUpdate
	FacDoc.Update
	FacDoc.Save
End If

Try 
	FacDoc.ComponentDefinition.ModelStates.Item("Ilogic").Activate
Catch
	FacDoc.ComponentDefinition.ModelStates.Add("Ilogic")
Finally
	FacDoc.ComponentDefinition.ModelStates.Item("Ilogic").Activate
End Try
'----set "Ilogic" as the active model state




'I want to unsuppress the following component and then update it.
Component.IsActive("DP10-2054:1") = True
RuleParametersOutput()
InventorVb.DocumentUpdate()

'after update, this component is useless, I must suppress it.
Component.IsActive("DP10-2054:1") = False

 

 

 

if I opened this sub-assembly to run this rule, it was ok, there was no problem.

 

if I put this sub-assembly under my upper main assembly, and in the rule in my upper main assembly, I run this

rule in the following way, the error occurred---that is , the component could not be "unsuppressed":

 

 

iLogicVb.RunRule("sub assy for test:1", "part suppress rule")

 

 

 

 

 

I have tried to think over this issue and done different tests for 8 days, and still cannot find a solution.

 

my questions are:

 

1. is this because I was using model state?

2. model state does not allow us to run rules in this way?

3. how can I make my rule run in my sub-assembly from the upper main assembly?

4. I just want to imitate my old ways in LOD using model state, just to try to modify all my old programs to make them

    able to run under inventor 2022. Is there a more direct and simpler method? any special aspects that I must pay          attention to when I use model state?

 

 

 

any ideas?

 

thanks in advance.

 

 

2 REPLIES 2
Message 2 of 3
JelteDeJong
in reply to: junGQMXK

JelteDeJong
Mentor
Mentor

I was a bit disappointed when I was trying to do something similar. You might want to have a look at this post:

https://forums.autodesk.com/t5/inventor-forum/can-t-suppress-sub-parts-in-model-states/m-p/10383812/...

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

I was a bit disappointed when I was trying to do something similar. You might want to have a look at this post:

https://forums.autodesk.com/t5/inventor-forum/can-t-suppress-sub-parts-in-model-states/m-p/10383812/...

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 3
junGQMXK
in reply to: JelteDeJong

junGQMXK
Enthusiast
Enthusiast

hi, Jelte,

 

thank you for your reply.

 

yes, I read the post you sent to me. I really learned something.

 

since we have all met such an issue about suppress and unsuppress, can we say that it was the new concept of "model state" that cause such trouble?

 

if yes, then what is the solution?

obviously, we should not be forced to rewrite all our old programs or to reorganize all our 3D models. Some local modifications are acceptable, but complete rewriting is absolutely unacceptable.

 

do any other people have any idea about such an issue?

 

thanks in advance.

 

 

0 Likes

hi, Jelte,

 

thank you for your reply.

 

yes, I read the post you sent to me. I really learned something.

 

since we have all met such an issue about suppress and unsuppress, can we say that it was the new concept of "model state" that cause such trouble?

 

if yes, then what is the solution?

obviously, we should not be forced to rewrite all our old programs or to reorganize all our 3D models. Some local modifications are acceptable, but complete rewriting is absolutely unacceptable.

 

do any other people have any idea about such an issue?

 

thanks in advance.

 

 

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

Post to forums  

Autodesk Design & Make Report