Difference between demoted assembly and new assembly

Difference between demoted assembly and new assembly

andrewiv
Advisor Advisor
406 Views
2 Replies
Message 1 of 3

Difference between demoted assembly and new assembly

andrewiv
Advisor
Advisor

Is there any difference between an assembly created using the new command and one created by demoting parts into it?  I have an ilogic code that will not run on an assembly that was created using the demote command, but it runs fine on an assembly that was created using the new command.  Both were created using the same template.  When I try to run the code on the demoted assembly I get this error.

 

ilogic error.PNG

 

I have narrowed it down to this area of the code

 

'define Assembly Component Definition
Dim AsmCompDef As AssemblyComponentDefinition
AsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

If I comment out the last line then I do not get the error so I think that the error comes from the ComponentDefinition object.

 

Andrew In’t Veld
Designer / CAD Administrator

0 Likes
407 Views
2 Replies
Replies (2)
Message 2 of 3

mslosar
Advisor
Advisor
When is the code being run?

Is it possible it's not the active document when run?
0 Likes
Message 3 of 3

andrewiv
Advisor
Advisor

Nevermind, I restarted Inventor and now the code works as expected.

Andrew In’t Veld
Designer / CAD Administrator

0 Likes