How to visually display plane object?

How to visually display plane object?

abdullah_elq
Advocate Advocate
448 Views
4 Replies
Message 1 of 5

How to visually display plane object?

abdullah_elq
Advocate
Advocate

Hi,

 

I have defined a plane object using a point and normal. I want to display the plane visually for testing purposes to ensure that it is in the correct location.

 

Is there any way to promote a plane to a visible workplane? 

 

I tried using AddByPlaneAndOffset, but it didn't accept having a plane as an argument.

 

 

0 Likes
Accepted solutions (2)
449 Views
4 Replies
Replies (4)
Message 2 of 5

WCrihfield
Mentor
Mentor
Accepted solution

You could possibly use the very similar WorkPlanes.AddFixed() method, but you would have to create a couple of transient UnitVector's to represent the X & Y axis, rather than just specify a 'Normal'.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 5

abdullah_elq
Advocate
Advocate
Thank you very much.

Could you help me out with calculating the first of those two transient vectors?

I know that once I have two vectors, I can get the third by cross multiplication.
0 Likes
Message 4 of 5

WCrihfield
Mentor
Mentor
Accepted solution

This is a very simple and crude example of creating a fixed work plane from scratch in a part document.

A UnitVector is simply used for 'direction', and is basically a Vector with a magnitude of one unit in length.  In the simplest of terms, you can just use the digit 1 in the direction of the axis you want to specify, while leaving the rest at zero, to specify a simple direction.

Dim oPDoc As PartDocument = ThisDoc.Document
oTG = ThisApplication.TransientGeometry
oPoint = oTG.CreatePoint(2, 4, 6)
oXAxis = oTG.CreateUnitVector(1, 0, 0)
oYAxis = oTG.CreateUnitVector(0, 1, 0)
oWPlanes = oPDoc.ComponentDefinition.WorkPlanes
oWPlane = oWPlanes.AddFixed(oPoint, oXAxis, oYAxis)
oWPlane.Visible = True
oWPlane.AutoResize = True
oWPlane.Name = "MyWorkPlane1"

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 5 of 5

abdullah_elq
Advocate
Advocate

Thank you very much!

0 Likes