Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations SSS148 on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get distance between two points using C++ CAA?

Status
Not open for further replies.

yashodeep15

Automotive
Jul 12, 2016
13
Hello,

I have created a point and projected it on a body by writing code in CAA. Now my next task is to get distance between those points. How can I get it?
I have used GSM Factory- CreatePoint point method for creating point and CreateProject for projecting it on body.

Please find the code I have written:

//creating point
double dPointCoord[3] = {pointList.GetX(), pointList.GetY(), pointList.GetZ()};
double* pPointCoord = new double[3];
pPointCoord = dPointCoord;
oPoint = spGsmFact->CreatePoint(pPointCoord);
spDescendants->Append(oPoint);
spiSpecOnGSMTool->Update();

//projecting the point
CATISpecObject_var iToProject = oPoint;
CATISpecObject_var iSupport = spCurrentTool;
CATIGSMDirection_var iDirection = NULL_var;
CATBoolean BoolNormal = TRUE;
CATGSMProjectSolutionType SolutionType = CATGSMNearestSolution;

oProjectPoint = spGsmFact->CreateProject(iToProject, iSupport, iDirection, BoolNormal, SolutionType);
spDescendants->Append(oProjectPoint);
spiSpecOnGSMTool->Update();


Thanks in Advance!
Regards,
Yashodeep Patil
 
Replies continue below

Recommended for you

Hello,

Measure it using SPA Workbench. Here is an extras from CAA V5 help to point you to the right area:

Func GetMeasurable( Reference iMeasuredItem) As Measurable

Returns the Measurable object.
Example:
This example get the Measurable from the SPAWorkBench.
Dim referenceObject As referenceObject
Set referenceObject = "GetReference"
Dim TheSPAWorkbench As Workbench
Set TheSPAWorkbench = CATIA.ActiveDocument.GetWorkbench ( "SPAWorkbench" )
Dim TheMeasurable As Measurable
Set TheMeasurable = TheSPAWorkbench.GetMeasurable(referenceObject)


cilici
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor