kArbitraryViewOrientation Broken

kArbitraryViewOrientation Broken

Anonymous
Not applicable
334 Views
3 Replies
Message 1 of 4

kArbitraryViewOrientation Broken

Anonymous
Not applicable

I am trying to create a view in a drawing that is set to an arbitrary view orientation, but for some reason, the "kArbitraryViewOrientation" value is not working?

oView = oSheet.DrawingViews.AddBaseView(oPartDoc, oPoint, oScale, kFrontViewOrientation, kShadedDrawingViewStyle)
oView = oSheet.DrawingViews.AddBaseView(oPartDoc, oPoint, oScale, kArbitraryViewOrientation, kShadedDrawingViewStyle)

The first line of code works fine; the second fails. Trying to hardcode them in (10764 and 10763) also fails for kArbitraryViewOrientation, but works fine for kFrontViewOrientation (and top, and back, and ... all other view orientations). I get an error "Parameter is incorrect" whenever I try with arbitrary.
Did this get changed recently? Inventor 2020 documentation still shows this as a value of ViewOrientationTypeEnum.
https://help.autodesk.com/view/INVNTOR/2020/ENU/?guid=GUID-147686F2-00B0-42AB-A4F8-A970309066DC

 

Thanks!

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

Anonymous
Not applicable

Specifically, the code I am trying to run is:

		oView = oSheet.DrawingViews.AddBaseView(oPartDoc, oPoint, oScale, kIsoTopRightViewOrientation, kShadedDrawingViewStyle)
		oCamera = oView.Camera
		oCamera.UpVector.Z = oCamera.UpVector.Z * -1
		oCamera.Eye.Z = oCamera.Eye.Z * -1
		oCamera.ViewOrientationType = kArbitraryViewOrientation
		oView.Camera.Apply

 I'm trying to generate a REAR isometric top-right view - but it fails at "oCamera.ViewOrientationType = kArbitraryViewOrientation", and if I don't include that line, it won't move off of the front isometric view, because the orientation is not set to arbitrary.

0 Likes
Message 3 of 4

dutt.thakar
Collaborator
Collaborator

@Anonymous 

If you check the API Document, it states that if you are trying to specify a view as kArbitraryViewOrientation, you have to input ArbitraryCamera Input. I can see in your line of code where you are trying to add the view you are not specifying this argument, It is only applicable if you are specifying Arbitrary  view.

 

See below link for the API Document to this particular section.

 

http://help.autodesk.com/view/INVNTOR/2021/ENU/?guid=GUID-043D03A2-5E89-456E-A80B-4A780EA7C54D

 

Hope this will helpl you.

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes
Message 4 of 4

Anonymous
Not applicable

Dutt,

 

Thanks for the advice, but I figured that out already. The problem is, since I am trying to create a rear isometric view, I don't know what the camera object should look like initially - since every assembly has different sizes, the camera would have to be at different locations for the eye. Therefore, what my workflow looked like was:

Create a view with kIsoTopLeftViewOrientation.
Get the camera object for that view.
Change the orientation to kArbitraryViewOrientation.
Set the camera eye to have Z-Coord = Z-Coord * -1.
Apply the camera.

However, this is what was failing - despite changing the camera eye coordinates, the view didn't change location to reflect the new eye. As best I could tell through debugging, the orientation wasn't accepting the change from kIsoTopLeftViewOrientation to kArbitraryViewOrientation.

Thanks!

0 Likes