Execution of command AppIsometricViewCmd does not work with opened form

Execution of command AppIsometricViewCmd does not work with opened form

MaciejWojda
Enthusiast Enthusiast
330 Views
3 Replies
Message 1 of 4

Execution of command AppIsometricViewCmd does not work with opened form

MaciejWojda
Enthusiast
Enthusiast

Hi,

 

I am writting addin for Inventor in VB.Net. There is a form available in assemblies which on loading opens all components inside and takes a picture. Before taking a picture I try to make the isometric view but for some reason it does not work. I use below lines:

 

'setting isometric view
Dim oCtrlDef As Inventor.ControlDefinition
oCtrlDef = g_inventorApplication.CommandManager.ControlDefinitions.Item("AppIsometricViewCmd")
oCtrlDef.Execute()

 

I suppose that it does not work because of already opened form window. 

 

How can I make it work?

0 Likes
331 Views
3 Replies
Replies (3)
Message 2 of 4

Curtis_Waguespack
Consultant
Consultant

Hi @MaciejWojda 

 

This might work:

 

oCtrlDef.Execute2(True)

 

oCtrlDef.Execute2(False)

 

see link:

https://adndevblog.typepad.com/manufacturing/2015/02/execute-vs-execute2-of-controldefinition.html

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

EESignature

0 Likes
Message 3 of 4

MaciejWojda
Enthusiast
Enthusiast

Thank you @Curtis_Waguespack, but it does not help. I tried all variants, but effect is the same

0 Likes
Message 4 of 4

A.Acheson
Mentor
Mentor

Can you give some more context of what is happening the form opens. Please include the code before this command runs. It sounds like you don't have focus on the document to run the command. 

Maybe an alternate method is to drive the camera directly. See link here

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes