The view module

Also see :

Quick Notes

PR 34775 In the python view module, fixed ViewFactory so that it creates the correct clipping bounds when passed 'height' or 'width' keyword arguments. (v2015)

PR 43628 The Python API view.ViewFactory will now throw a RuntimeError when passed in an 'up' vector that isn't perpendicular to the 'looking' vector. If the two vectors are perpendicular then the resulting view will have a valid and clean view matrix. (v2017)


Preset views

A Python script that adds a top end view to a column:

# Adds a top end view to the selected column.
from view import View
from member import MemberLocate
from param import ClearSelection
# view begin
vw1 = View()
vw1.Member = MemberLocate("Select a column")
vw1.DepthCheckIn = 5.0
vw1.DepthCheckOut = 10.0
vw1.Add("TOP END VIEW")
# view end
ClearSelection()

vw1 = View() begins the adding of the preset view. Also used for user views.

vw1.Member or vw1.member = the member object that the user view is to be added to. Example 1 : vw1.Member = MemberLocate("Select a member") . Example 2: vw1.Member = mem1 , where mem1 is previously defined.

vw1.Add("preset_string") adds the preset view. "TOP END VIEW" is substituted as the "preset_string" in the above example. Allowable preset view strings are:

"MAIN VIEW" ( beam, column, brace, misc )
"TOP FLANGE VIEW" ( beam, brace )
"BOTTOM FLANGE VIEW" ( beam, brace )
"FACE A VIEW" ( column )
"FACE C VIEW" ( column )
"MAIN VIEW, CROSS SECTION" ( beam, column, brace, misc )
"LEFT END VIEW" ( beam, brace, misc )
"BOTTOM END VIEW" ( column )
"RIGHT END VIEW" ( beam, brace, misc )
"TOP END VIEW" ( column )
"MAIN VIEW, CENTER CROSS SECTION, RIGHT TO LEFT" ( beam, brace, misc )
"MAIN VIEW, CENTER CROSS SECTION, LEFT TO RIGHT" ( beam, brace, misc )
"MAIN VIEW, CENTER CROSS SECTION, BOTTOM TO TOP" ( column )
"MAIN VIEW, CENTER CROSS SECTION, TOP TO BOTTOM" ( column )
"BOTTOM VIEW" ( misc )
"TOP VIEW" ( misc )

vw1.DepthCheckIn and vw1.DepthCheckOut -- click here . This is also used for user views.

Note: You can use these preset view strings for any member type. However, you may get unexpected results if you use them for a member type other than the type marked ( in parentheses ).

Also see: " Preset " in member isolation, examples of preset views .

Warning : Preset and user views can only be added to members. They cannot be added to materials. A user view can be added with respect to any material that is a part of the member (as described here ).


User views

A Python script that adds a user view:

# Adds a user view to the selected member.
from view import View
from member import MemberLocate
from point import PointLocate
from param import ClearSelection
# view begin
vw1 = View()
vw1.Member = MemberLocate("Select member")
vw1.Point1 = PointLocate("Locate 1st point")
vw1.Point2 = PointLocate("Locate 2nd point")
vw1.Face = "Web NS"
vw1.DepthCheckIn = "36.0"
vw1.DepthCheckOut = "12.0"
vw1.Add()
# view end
ClearSelection()

vw1 = View() begins the adding of the user view. It is also used for preset views.

vw1.Member or vw1.Material = the member or material object to add the user view to. In the example above, the Python script prompts the user to select a member in the model. The code could have, instead, defined the member or material that receives the view to be a member or material object previously defined in the code. If vw1.Member is used then the main material will be used for face information. If vw1.Material is used then that material's member will be used and any face information will come from the material. If both vw1.Member and vw1.Material are used, vw1.Material will override vw1.Member. Warning : Preset and user views can only be added to members. They cannot be added to materials. A user view can be added with respect to any material that is a part of the member.

vw1.Point1 or vw1.pt1 = PointLocate("Locate 1st point") or a point object. This sets the global X, Y, Z coordinates for the point at one end of the user view. Example 1 : vw1.Point1 = PointLocate( "Locate 1st point") . Example 2 : vw1.Point1 = (X, Y, Z) , where X, Y and Z are coordinates.

vw1.Point2 or vw1.pt2 = PointLocate("Locate 1st point") or a point object. This sets the global X, Y, Z coordinates for the point at the end of the user view opposite to point 1. Example 1 : vw1.Point1 = PointLocate( "Locate 1st point") . Example 2: vw1.Point1 = (X, Y, Z) , where X, Y and Z are coordinates.

vw1.Face or vw1.face = "Top Face" or "Web NS" or "Bottom Face" or "Web FS" or "NS Face (for plates only) or "FS Face" (for plates only). The face names for different materials are illustrated below.

vw1.DepthCheckIn or vw1.depth_check_in = the distance into the user or preset view. The distance can be in dimension form ("3-0") or a floating point number (3.0) or integer (3). This controls depth checking into the plane of the view.

vw1.DepthCheckOut or vw1.depth_check_out = the distance out of the user or preset view. Same as vw1.DepthCheckIn, except that this controls depth checking out from the plane of the view.

vw1.Add() adds the user view.