create an aligned workplane to a fitted arc

create an aligned workplane to a fitted arc

luc_ponsaerts
Advocate Advocate
980 Views
1 Reply
Message 1 of 2

create an aligned workplane to a fitted arc

luc_ponsaerts
Advocate
Advocate

The created workplane is not aligned to the fitted arc. (see attachment)

 

foreach (PSMesh m in meshes)
{
   string mName = m.Name;

   // create arcs around each model(at largest diameter)
    PSArc psArc = psModel.Arcs.SketchArcThroughThreePoints();

   // align workplane in center of each arc
   PSWorkplane psWorkplane = psModel.Workplanes.CreateWorkplaneAlignedToEntity(psArc, psArc.Centre);
   psWorkplane.Name = mName;
   psModel.ActiveWorkplane = null;
}

 

The workplanes are created in the arc center, but are not aligned to the arc.

What am I missing here ?

0 Likes
Accepted solutions (1)
981 Views
1 Reply
Reply (1)
Message 2 of 2

luc_ponsaerts
Advocate
Advocate
Accepted solution

Found the solution. I was mistaken by the name of the command : .CreateWorkplaneAlignedToEntity thinking that the workplane created would be aligned to the entity (first parameter of the command). 

The solution is to use :the command CreateWorkplaneFromZAxis :

 

// align workplane in center of each arc
Vector vector = new Vector();
vector = psArc.CentreNormal;
PSWorkplane psWorkplane = psModel.Workplanes.CreateWorkplaneFromZAxis(psArc.Centre, vector);

 

Works fine.

0 Likes