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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Correct way to define Pro2dPolylinedef

AA_9746437
4-Participant

Correct way to define Pro2dPolylinedef

Has anyone played with Pro2dPolylinedef. I wanted to create a closed polyline loop and create a nice extrusion out of it. It did indeed work but when I tried to grab the polyline from the section plane with the correct id it sadly returns me just a line, type 2 instead of type 7. I have tried with malloc and using the ProArrays. Nothing it refuses to return me a polyline. From the code I provide am I doing something wrong? I am a new guy in Creo Toolkit programming but the code seems logical. What I am doing wrong and ent->type = 2 instead of 7?

 

 

Pro2dPolylinedef Lshape;
Lshape.type = PRO_2D_POLYLINE;
ProArrayAlloc(0, sizeof(Pro2dPnt), 1, (ProArray*)&Lshape.point_arr);
Pro2dPnt pnt;
pnt[0] = center.pnt[0];
pnt[1] = center.pnt[1];
ProArrayObjectAdd((ProArray*)&Lshape.point_arr, -1, 1, &pnt);
pnt[0] = center.pnt[0];
pnt[1] = center.pnt[1] + VerticalLength;
ProArrayObjectAdd((ProArray*)&Lshape.point_arr, -1, 1, &pnt);
pnt[0] = center.pnt[0] + Thickness;
pnt[1] = center.pnt[1] + VerticalLength;
ProArrayObjectAdd((ProArray*)&Lshape.point_arr, -1, 1, &pnt);
pnt[0] = center.pnt[0] + Thickness;
pnt[1] = center.pnt[1] + Thickness;
ProArrayObjectAdd((ProArray*)&Lshape.point_arr, -1, 1, &pnt);
pnt[0] = center.pnt[0] + BaseLength;
pnt[1] = center.pnt[1] + Thickness;
ProArrayObjectAdd((ProArray*)&Lshape.point_arr, -1, 1, &pnt);
pnt[0] = center.pnt[0] + BaseLength;
pnt[1] = center.pnt[1];
ProArrayObjectAdd((ProArray*)&Lshape.point_arr, -1, 1, &pnt);
pnt[0] = center.pnt[0];
pnt[1] = center.pnt[1];
ProArrayObjectAdd((ProArray*)&Lshape.point_arr, -1, 1, &pnt);
Lshape.n_points = 7;
int* pLid;		
ProError err = ProSectionEntityAdd(section, (Pro2dEntdef*)&Lshape, pLid);
Pro2dEntdef* ent;
ProError status = ProSectionEntityGet(section, *pLid, &ent);

 

 

 

2 REPLIES 2

You posted this to a group of people who use the software, not people who *write* software. You are highly unlikely to get any responses let alone solutions.

 

You would do much better if you moved this to the Customization area.

AA_9746437
4-Participant
(To:KenFarley)

Yes it seems so. I will post it to the suggested group.

Thanks.

Top Tags