Main assembly activation via vba

Main assembly activation via vba

k14348
Advocate Advocate
482 Views
3 Replies
Message 1 of 4

Main assembly activation via vba

k14348
Advocate
Advocate

Hi,

   i have one main assembly with 200 nos. of sub assemblies. In my browser i will roll down (by 10 rotation of mouse wheel) and edit one of my sub assembly. once i complete my work in sub assembly now i want to activate main assembly by running a macro.

 

-karthikeyan M

0 Likes
Accepted solutions (1)
483 Views
3 Replies
Replies (3)
Message 2 of 4

HermJan.Otterman
Advisor
Advisor

hello K14348,

 

you should be able to do that with this code:

 

' Get the CommandManager object.

Dim oCommandMgr As CommandManager

set oCommandMgr = _inventorApplication.CommandManager

' Get control definition for the line command.

Dim oControlDef As ControlDefinition

Set oControlDef = oCommandMgr.ControlDefinitions.Item("AppReturnTopCmd")

' Execute the command.

Call oControlDef.Execute()

 

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


0 Likes
Message 3 of 4

k14348
Advocate
Advocate

Hi,

 Thanks for your reply.  Its showing some error. Detail attached in this mail.

 

Thanq,

karthikeyan M

+91-9894814348

0 Likes
Message 4 of 4

HermJan.Otterman
Advisor
Advisor
Accepted solution

in the yellow line, replace oDoc with Thisapplication, and than it should work.

 

so

set oCommandMgr = Thisapplication.CommandManager

 

the command manager does not belong to the document, but to the application

 

 

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan