Community
PowerShape and PowerMill API Forum
Welcome to Autodesk’s PowerShape and PowerMill API Forums. Share your knowledge, ask questions, and explore popular API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

create an aligned workplane to a fitted arc

1 REPLY 1
SOLVED
Reply
Message 1 of 2
luc_ponsaerts
451 Views, 1 Reply

create an aligned workplane to a fitted arc

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 ?

1 REPLY 1
Message 2 of 2

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums