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: 

change default viewcube orientation through API

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
870 Views, 4 Replies

change default viewcube orientation through API

Greetings,

 

I am trying to do what I describe in the title but with no luck.

I am building an assembly from scratch and I want the orientation to be different than the default because when creating drawings using topview the result is as if I used frontview.

 

I can change the orientation permanently from tools->application options-->display-->viewcube-->default view cube orientation but I would rather do it through the API so that I wouldn't have concerns of what each user has as a preference in his/her PC and after finishing with the assembly I could restore the user's options.

 

Is there a way?

 

Thanks in advance!

4 REPLIES 4
Message 2 of 5
YuhanZhang
in reply to: Anonymous

Unfortunately the APIs for view cube orientation options have not been exposed yet. But I am curiouse about what you said "when creating drawings using topview the result is as if I used frontview.", when you create a drawing view you are able to specify the orientation of model so seems you need not to change the view cube options at all. Can you explain more about what you want to do when create a drawing view? 



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

Message 3 of 5
Anonymous
in reply to: YuhanZhang

Thanks for the quick reply!

 

Well, after creating the assembly I add baseviews in a drawing and when placing the baseviews I use the following function:

 

DrawingViews.AddBaseView Method DrawingViews.AddBaseView( Model As Document, Position As Point2d, Scale As Double, ViewOrientation As ViewOrientationTypeEnum, ViewStyle As DrawingViewStyleEnum, [ModelViewName] As String, [ArbitraryCamera] As Variant, [AdditionalOptions] As Variant )

 

So, If I want the baseview to be displayd as if someone is looking at the assembly from above I use kTopViewOrientation.

 

I hope I clarified what I want to do and where the problem is.

Message 4 of 5
YuhanZhang
in reply to: Anonymous

As you said "when creating drawings using topview the result is as if I used frontview",so seems you want to create a base view with model's "Top" orientation but you expect model's "Top" is not currently the model's top defined by the view cube, right? If so, you can choose one of below three methods:

 

1. To specify a different ViewOrientation value for AddBaseview which can make the view displays the model's "Top" as you expected, but the value maybe  kBackViewOrientation or  kBottomViewOrientation etc., but need you to check it first.

2. Use custom camera to specify the view orientation for AddBaseview. You need to input kArbitraryViewOrientation for the ViewOrientation argument, and then provide a value for the ArbitraryCamera argument which specify a custom model view orientation as you expected.

3. In the model you can rotate the model to be the orientation you think it should be "Top", and then call the View.SetCurrentAsTop and save the model document. Then in drawing you call the AddBaseview and specify the ViewOrientation argument the  kTopViewOrientation.

 

Hope above suggestions help.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

Message 5 of 5
Anonymous
in reply to: YuhanZhang


@YuhanZhang wrote:

As you said "when creating drawings using topview the result is as if I used frontview",so seems you want to create a base view with model's "Top" orientation but you expect model's "Top" is not currently the model's top defined by the view cube, right?


exactly right!

@YuhanZhang wrote:

you can choose one of below three methods:

 

1. To specify a different ViewOrientation value for AddBaseview which can make the view displays the model's "Top" as you expected, but the value maybe  kBackViewOrientation or  kBottomViewOrientation etc., but need you to check it first.

2. Use custom camera to specify the view orientation for AddBaseview. You need to input kArbitraryViewOrientation for the ViewOrientation argument, and then provide a value for the ArbitraryCamera argument which specify a custom model view orientation as you expected.

3. In the model you can rotate the model to be the orientation you think it should be "Top", and then call the View.SetCurrentAsTop and save the model document. Then in drawing you call the AddBaseview and specify the ViewOrientation argument the  kTopViewOrientation.

 

Hope above suggestions help.


The first method is something I also thought of but is counterintuitive and so, I would only use it if there was no other option.
The second is very promising and I will test it right now
The third is something I tried but I couldn't see the rotation I was hoping. In fact There was no rotation. Obviously I did something wrong. What I did, was to create a Matrix instance and set its properties to the desired values and then, use that matrix to place the first part in to an empty assembly. But whatever I tried I was always getting the same result....

 

 

 

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

Post to forums  

Autodesk Design & Make Report