cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Dimension is Created on wrong witness line.

SC_11019750
6-Contributor

Dimension is Created on wrong witness line.

I am using Creo Parametric Release 4.0 and DatecodeM140

we are trying to create a ordinate dimension but the problem is the dimension is not created from the actual witness line, is there any possible way to move the witness line using Protoolkit.

2 REPLIES 2
AndrewK
Community Manager
(To:SC_11019750)

Hi @SC_11019750 

Thank you for your question. 


I’d like to recommend bringing more details and context to your initial inquiry. It also helps to have screenshots to better understand what you are trying to do in your process. This will increase your chances to receive meaningful help from other Community members. 

SC_11019750
6-Contributor
(To:AndrewK)

Hi Andrew

Regarding the issue we are facing for dimension witness line attaching point movement.

We are providing below code snippet which we used to move the dimension witness line attachment point to the provided location.

But the below code is not giving any error while executing, and the witness line attachment point also not moving to input location.

 

Please suggest us why this code is not working?

 

Or suggest us any better option to do this using pro toolkit api.

 

Waiting for your response.

 

ProMdl mdl = NULL;
status = ProMdlCurrentGet((ProMdl*)&mdl);

ProGtolAttach attach;
ProAnnotationPlane plane;
Pro3dPnt textPnt;
ProPath valueStr;
ProSelection* sels = NULL;int nSels = 0;
ProGtolleader leader1, * leaders = NULL;

status = ProGtolAttachAlloc(mdl, &attach);
//Set desired annoation plane( from Annotation Plane Manager)plane.id = 1; plane.owner = mdl; plane.type = PRO_ANNOT_PLANE;
//location of gtol text in model co-ordinates as per the requirementtextPnt[0] = 150.00; textPnt[1] = 500.00; textPnt[2] = -200.00;
//dimension for attaching ProDimension dim;
ProSelection p_sel;
status = ProModelitemInit(mdl, 6, PRO_DIMENSION, (ProModelitem*)&dim);

ProPoint3d loc;
loc[0] = 10;
loc[1] = -20;
loc[2] = 30;
status = ProSelectionDimWitnessLineSet(&dim, 2, loc, &p_sel);
status = ProGtolleaderAlloc(PROLEADERTYPE_LEFTHALF, p_sel, &leader1);
status = ProArrayAlloc(1, sizeof(ProGtolleader), 1, (ProArray*)&leaders);
leaders[0] = leader1;

status = ProGtolAttachLeadersSet(attach, &plane, PRO_GTOL_LEADER, leaders, textPnt);

Announcements


Top Tags