Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski 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
Joined
Jul 12, 2016
Messages
13
Location
US
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
 
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

Back
Top