Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Drawing View Orientation of Base View Programatically

Andrew_Burnett
Enthusiast

Drawing View Orientation of Base View Programatically

Andrew_Burnett
Enthusiast
Enthusiast

We have legs that are on a cylindrical tank.  The legs are at different angles and I want to place a view on the drawing with the cut portion shown for dimensioning.  I have everything working but I need to get the view correct for the dimension to hold.  Example.  If the leg is at 45 degrees from the XY plane it would be in the front / Right orientation.  I have not been able to find a way to have it select that orientation to get the view correct on the drawing.

 

0 Likes
Reply
Accepted solutions (1)
1,170 Views
4 Replies
Replies (4)

JelteDeJong
Mentor
Mentor

Have you seen this blog post "Creating a drawing from scratch with the Inventor API".

https://adndevblog.typepad.com/manufacturing/2012/06/creating-a-drawing-from-scratch-with-the-invent... 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes

Andrew_Burnett
Enthusiast
Enthusiast

I reviewed that and have seen it before but can't find in the link where you can show the view angle that I want for the detail view.  The image that was attached to it will show the view I am looking to get.

0 Likes

WCrihfield
Mentor
Mentor
Accepted solution

Sounds like you would have to use lines similar to these when setting up your view.

 

oViewOrientation = ViewOrientationTypeEnum.kCurrentViewOrientation
'Or
oViewOrientation = ViewOrientationTypeEnum.kSavedCameraViewOrientation
'Or if you already have another view to project from, you could try the
oViewOrientation = ViewOrientationTypeEnum.kArbitraryViewOrientation
'Other than that you would probably have to do a two view set-up using
oViewRotation = Pi/4
'Then turn the first view off

 

I hope this helps.
If this solves your problem, or answers your questions, please click 'Accept As Solution".
Or, if this helps you reach your goal, please click 'LIKES" 👍.

 

Also, if you're interested, here are a few of the 'Ideas' I'd like to get implemented.
If you agree with any of them, please vote for them.

  • Add more capabilities to the 'Customize' dialog box (exe. Add Tab & Add Panel) Click Here
  • MessageBox, InputBox, and InputListBox Size & Format Options Click Here
  • Constrain & Dimension Images In Assembly Sketches & Drawing Sketches (TitleBlocks & SketchedSymbols) Click Here
  • Save Section View Status In DesignViewRepresentation (So It Can Be Used In The Drawing) Click Here
  • Add SolidBodies Folder In iLogic Rule Editor Model Tab Click Here
  • Convert All Views To Raster Before Autosave Stores To 'OldVersions' Folder Click Here
  • SetDesignViewRepresentation - Fix limitations for DrawingView of a Part Click Here

Inventor 2020 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Andrew_Burnett
Enthusiast
Enthusiast

I used the arbitrary view orientation .  Needed to add the line of code to use the camera.  Thank you for all your help and quick response.

 

Dim oCamera As Camera = LegDesignView.Camera

View4 = Sheet1.DrawingViews.AddBaseView(aAssemblyDoc, oPoint4, 1, ViewOrientationTypeEnum.kArbitraryViewOrientation,
DrawingViewStyleEnum.kHiddenLineDrawingViewStyle, , oCamera)

 

Thank you and Code on!!

0 Likes