AddBy3Points for RefPlane creation in space

Dear Developer,


I want to create the Ref plane in 3D space with following three point co-ordinates P1 (0,0,0.1). P2(0.8,0.1,0.6). P3(0.2,0.4,0.9) in Part Modeling.


I am trying to use the method AddBy3Points.

It needs following data:

Public Function AddBy3Points( _
   ByVal NumEdges As Long, _
   ByRef EdgeSet() As Object, _
   ByRef KeyPointTypeConstants() As KeyPointType, _
   Optional ByVal Local As Variant _
) As RefPlane

Can any one help me with some sample code and explain the meaning of EdgeSet()  As object.

Information written in the help is as follows:


EdgeSetContains the edges from the three points will be selected. EdgeSet(1) defines the origin of the plane, EdgeSet(2) defines the x-axis of the plane, and EdgeSet(3) defines the orientation of the plane.


I tried with various options.

1) EdgeSet(0) = RootPoint of the Plane ( System Array of 3)

2) EdgeSet(1) = Line between p1 & p2

3) EdgeSet(2) = RefDirection ( System Array of 3)


Can any one help me with some sample code ?



Amar Phatak


Re: AddBy3Points for RefPlane creation in space

Please view the following code:


objP1 = objProfile.Points2d.Add(0, 0)
objP2 = objProfile.Points2d.Add(0.01, 0)
objP3 = objProfile.Points2d.Add(0, 0.01)


objEdgeSet(0) = objP1
objEdgeSet(1) = objP2
objEdgeSet(2) = objP3

objkeyPoints(0) = SolidEdgeConstants.KeyPointType.igKeyPointStart
objkeyPoints(1) = SolidEdgeConstants.KeyPointType.igKeyPointMiddle
objkeyPoints(2) = SolidEdgeConstants.KeyPointType.igKeyPointEnd


objNumEdges = 3

objRPNTC = objPartDocument.RefPlanes.AddBy3Points(objNumEdges, objEdgeSet, objkeyPoints)
objRPNTC.Visible = True

Reference plan is not getting generated.

Can someone help ??