Create a workplane tangent to a curved surface with API

Create a workplane tangent to a curved surface with API

lian_xie
Contributor Contributor
673 Views
2 Replies
Message 1 of 3

Create a workplane tangent to a curved surface with API

lian_xie
Contributor
Contributor

After selecting a cylindrical surface and an edge, I would like to create a workplane tangent to the cylindrical surface and perpendicular to the edge with API.

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

JarFu
Autodesk
Autodesk

Hi Lian,

 

Could you try AddByPlaneAndTangent method to workaround? It creates a new work plane that is parallel to the input plane and tangent to the input surface.
   



Jar Fu
SW Engineer
Inventor QA
Autodesk, Inc.
0 Likes
Message 3 of 3

JaneFan
Autodesk
Autodesk
Accepted solution

Hi Lian, 

 

As the behavior of "Tangent to surface and parallel to plane"in UI, you need select the planar face or another work plane as the reference work plane, but not an edge. 

Here is the code. To implement it, please choose cylindrical face first, then choose a planar face: 

aa.png

Sub Test()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oWPs As WorkPlanes
Set oWPs = oDoc.ComponentDefinition.WorkPlanes

Dim oClindFace As Face
Set oClindFace = oDoc.SelectSet(1)

Dim oFace1 As Face
Set oFace1 = oDoc.SelectSet(2)

Dim oWP As WorkPlane
Set oWP = oWPs.AddByPlaneAndTangent(oFace1, oClindFace, ThisApplication.TransientGeometry.CreatePoint(0, 0, 0))
End Sub

 




Jane Fan
Inventor/Fusion QA Engineer
0 Likes