Blog · Inventor · 1 Oct 2026 · 3 min read
How to choose the base view orientation for STEP parts in Inventor drawings
Bodies from a STEP file sit at any angle, and the obvious view mappings fail. Two methods that work in Inventor 2025, measuring three trial views and straightening the body with a matrix, plus the camera trick that gives wrong but plausible dimensions.
Short answer: for plates sitting along the model axes, create the Front, Top and Right base views at a trial scale, keep the one with the largest area and delete the others. For bodies at an angle, straighten the body first: build a rotation matrix from its largest flat face, transform the transient copy, then use kTopViewOrientation. Never rotate the view camera.
Why guessing fails
We first mapped view orientations to model planes (kTopViewOrientation = XY and so on). It did not match how Inventor renders STEP parts. Measured on four cases: kTopViewOrientation projects the XZ plane, not XY.
Method 1: three trial views, keep the largest
oris(0) = kFrontViewOrientation
oris(1) = kTopViewOrientation
oris(2) = kRightViewOrientation
For kOri = 0 To 2
Dim vtmp As DrawingView = oSheet.DrawingViews.AddBaseView(oPart, _
oTG.CreatePoint2d(oSheet.Width / 2, oSheet.Height / 2), trialScale, _
oris(kOri), kHiddenLineDrawingViewStyle)
Dim area As Double = vtmp.Width * vtmp.Height
If area > bestArea Then
If Not (oBest Is Nothing) Then oBest.Delete()
oBest = vtmp
bestArea = area
Else
vtmp.Delete()
End If
Next
The largest view of a plate is its flat face. This was approved at first sight. It is also the right fallback for round bars, tubes and rolled parts, whose largest face is a circle.
Method 2: straighten bodies that sit at an angle
On one 225-body model, 84 bodies (37%) were not aligned with any axis. Too many to fix by hand. The recipe that passed 15 of 15 test parts, then 3 of 3 historic problem bodies:
- Find the largest planar face.
- Compute its normal from the vertices: the triple that maximises the cross product, signed outward.
- Take the in-plane direction from the minimum bounding rectangle of the face.
- Write the matrix by hand with
Matrix.Cell: rows u, n, w = u × n, so the normal goes onto Y. TransientBRep.Transformthe transient copy of the body.- Base view with
kTopViewOrientation(which looks along Y).
Mirror trap: flipping only the normal makes the determinant -1 and mirrors the part. Flip both n and u and the determinant stays +1.
Matrix.SetToRotateTo is not broken, although our first log said it was. It wants two Vector objects (not UnitVector) and an explicit Nothing as the third argument.
What does not work
| Attempt | Result |
|---|---|
DrawingView.Camera + ApplyWithoutTransition |
The base view turns, projected views stay rotated: a 12 mm plate measured 7.86 and 10.73. Wrong but plausible |
A camera built from scratch (CreateCamera) |
4 of 4 failed |
Plane.Normal from Face.Geometry |
3 rounds, 3 different errors |
The camera result is the dangerous one: dimensions look reasonable and are wrong.
Layout and scale
What our rule does after the base view:
- Grid 2×2: base top left, side view top right, plan bottom left, iso bottom right.
- Base view rotated 90° if it is taller than wide:
oBase.RotateByAngle(Math.PI / 2, True). - One scale for orthographic views and the flat pattern: the minimum of cell width / view width and cell height / view height, capped at 2:1. The iso view keeps its own scale, or it shrinks the whole sheet.
- Gap between views relative to the scale, not fixed on the sheet: fixed centimetres gave gaps from 10 to 377 mm once drawings were placed together.
- A dimension that enters the gap moves the side view: read the dimensions'
Text.RangeBox.
Not implemented: snapping to standard scales (1:2, 1:5, 1:10). Our scale is the raw ratio.
Do and don't
Do
- Measure trial views instead of mapping axes.
- Straighten the body before the view, on the transient copy.
- Check the determinant of your matrix.
Don't
- Don't rotate the camera to fix orientation.
- Don't assume
kTopViewOrientationlooks at XY. - Don't trust a log that says an API call is broken until you check the signature.
Questions people ask
Does code that runs without errors mean the views are right? No. Our log has a line for this: solving the error in code does not mean the result is visually correct. Look at the drawing.
Can an AI agent choose the views on parts it has never seen? With these two methods, yes, and it checks the result by measuring the view sizes. For plate thickness read from the side view, see plate thickness from a STEP file.