Create Workplane (Normal to Axis Through Point)

Create Workplane (Normal to Axis Through Point)

Genicee
Advocate Advocate
761 Views
2 Replies
Message 1 of 3

Create Workplane (Normal to Axis Through Point)

Genicee
Advocate
Advocate

You can create a Workplane Normal to and Axis through a point using the UI, but I can't not see where that is available in the API. I have tried WorkPlanes.AddByNormalToCurve, but an Axis does not qulify as CurveEntity.

0 Likes
Accepted solutions (1)
762 Views
2 Replies
Replies (2)
Message 2 of 3

dano0310
Advocate
Advocate
Accepted solution

Hi Genicee

 

Try this code as a starting point.  Currently it is using the x axis and the centre point to creat a workplane.

 

Dim oPartCompDef As PartComponentDefinition
Set oPartCompDef = ThisApplication.ActiveDocument.ComponentDefinition
        
Dim oAxis As WorkAxis
Set oAxis = oPartCompDef.WorkAxes(1)

Dim oPoint As WorkPoint
Set oPoint = oPartCompDef.WorkPoints(1)

Dim oPlane As WorkPlane
Set oPlane = oPartCompDef.WorkPlanes.AddByNormalToCurve(oAxis, oPoint, False)

Hope this helps.

 

Dan

0 Likes
Message 3 of 3

Genicee
Advocate
Advocate

That was basically what I was trying. What found out to be the problem is AddByNormalToCurve does not accept "Point" as a parameter. "WorkPoint" does work. 

Thanks for the help!

0 Likes