AddViewOrientation

Creates a new orientation using a script. Input parameters can be either vector components or angles. Local view orientation specific to a design can be saved in project by calling Save() on the project object.

Note:

You cannot use the name of an existing view. Default views include: top, bottom, right, left, front, back, trimetric, dimetric, and isometric.

UI Access

View > Modify Attributes > Orientation List. Enter parameters and click Add.

Parameters
Name Type Description
<orientationName> String Name of the new orientation.
<isGlobalOrientation> Long 1 to save global; else 0.

<OrientationVectorComponents>

Array

Structured array. Use either <OrientationVectorComponents> or <OrientationAnglesArray>.

Array("NAME:OrientationVectorComponents",

Array("NAME:Direction",

<float>,

<float>,

<float>,

Array("NAME:Up",

<float>,

<float>,

<float>))

<OrientationAnglesArray>

Array

Structured array. Use either <OrientationVectorComponents> or <OrientationAnglesArray>.

Array("NAME:OrientationAngles",

"Psi:=" , <float>,

"Theta:=" , <float>,

"Phi:=" , <float>)

<ProjectionParams>

Array

Optional. Structured array containing arrays of four optional parameters: Scaling, Translation, Projection Type, and Projection Limits.

Array("NAME:ProjectionParams",

Array("NAME:Scaling",

<float>,

<float>,

<float>

),

Array("NAME:Translation",

<float>,

<float>,

<float>

),

"ProjectionType:=" , <string "Orthographic" or "Perspective">,

Array("NAME:ProjectionLimits",

<float>,

<float>,

<float>,

<float>,

<float>,

<float>

)

)

Return Value None.

 

Python Syntax AddViewOrientation(<orientationName>, <isGlobalOrientation>, <OrientationVectorComponents or OrientationAnglesArray>, <ProjectionParams>)
Python Example

Example Using Angles and Projection Parameters:

oEditor.AddViewOrientation("orientation3", 0,

["NAME:OrientationAngles",

"Psi:=" , -161.565002441406,

"Theta:=" , 32.3115005493164,

"Phi:=" , 0 ],

["NAME:ProjectionParams",

["NAME:Scaling",

     0.591607987880707,

     0.591607987880707,

     0.591607928276062

],

["NAME:Translation",

     0,

     2.38418579101563E-07,

     -5.7486834526062

],

"ProjectionType:=" , "Orthographic",

["NAME:ProjectionLimits",

     -2.44362282752991,

     2.44362282752991,

     -1,

     1,

     0.625207424163818,

     10.8721580505371

]

]

)

Example Using Vector without Projection Parameters:

oEditor.AddViewOrientation("orientation6", 0,

["NAME:OrientationVectorComponents",

["NAME:Direction",

-0.801783978939056,

-0.267262011766434,

-0.534521996974945

],

["NAME:Up",

-0.507091999053955,

-0.169030994176865,

0.845155000686646

]

])