Set 3D view to section view through XY plane

Set 3D view to section view through XY plane

ktucker86UDQ
Participant Participant
525 Views
5 Replies
Message 1 of 6

Set 3D view to section view through XY plane

ktucker86UDQ
Participant
Participant

I'm struggling to find the right object to use for setting a 3d view to a half-section view through the origin XY plane. Does anyone have advice for how to achieve? Coding in C#, but any VB.net sample could would help a bunch!

 

Thanks

0 Likes
Accepted solutions (1)
526 Views
5 Replies
Replies (5)
Message 2 of 6

A.Acheson
Mentor
Mentor

Hi @ktucker86UDQ 

 

From the API help see link for  the DesignViewRepresentation object.

Syntax

DesignViewRepresentation.SetSectionViewSectionViewType As SectionViewTypeEnum, [FirstSectionPlane] As Variant, [SecondSectionPlane] As Variant )

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 6

ktucker86UDQ
Participant
Participant

Thanks, this helped a lot. Now I am struggling to find a reference to the XY plane of the origin. Ive tried using WorkPlanes, but this seems to only include user-defined workplanes.

 

Thanks

0 Likes
Message 4 of 6

WCrihfield
Mentor
Mentor
Accepted solution

Hi @ktucker86UDQ.  Just so you are aware, the first 3 WorkPlanes, and the first 3 WorkAxes, and the first 1 WorkPoint in every model type document (parts & assemblies) are the ones that belong to the origin of that model.  They will be in the same order as you see them in the model tree.  The ones after that will be user defined ones.  There is a property you can check too (IsCoordinateSystemElement).

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 6

ktucker86UDQ
Participant
Participant

Unfortunately, I am getting errors when I try to do a half section view across workplanes using the following code snippet:

 

Screenshot 2023-07-17 110601.png

0 Likes
Message 6 of 6

ktucker86UDQ
Participant
Participant

Resolved! I needed to put plane.Plane to grab the Plane object from the WorkPlane object.

0 Likes