while I used this function, I constructed the parameters "loftpath" by two ways. one is start a tool of ElementSetTool, as the code below:
bool BaseLine::OnModifyComplete(MstnButtonEventCP ev) { MSElementDescrP pathEdP; EditElemHandleP start = GetElemAgendaP()->GetFirstP(); pathEdP = start->GetElemDescrP(); if (NULL != pathEdP) { pathID = elementRef_getElemID(pathEdP->h.elementRef); } mdlElmdscr_freeAll(&pathEdP); //start another command mdlInput_sendKeyin("ROADWAY PLACECOMPLETE", 0, 0, NULL); ExitTool(); return true; }
in the code above, i get the ElementID of the path, then , i construct MSElementDescr of the path by its ElementID;
void BaseLine::TransformBathLine(MSElementDescrP *pathEdPP, Transform *pTrans) { if (NULL == pathEdPP) return; mdlAssoc_getElementDescr(pathEdPP, NULL, pathID, ACTIVEMODEL, false); if (NULL != pTrans) mdlElmdscr_transform(*pathEdPP, pTrans); }
then, my program nearly stop at the function mdlBspline_oneRailTwoSectionSweep(thought it worked right, but too slowly to stand)
In another way, i construct path by the code below:
MSElement el; DPoint3d pts[3] = { { 0.0, 100000000, 0.0 },{ 0.0, 0.0, 0.0 },{ 0.0, -1000000000, 0.0 } }; mdlArc_createByCenter(&el, NULL, pts, 0, 0, 2); mdlElmdscr_new(&pathEdP, NULL, &el);
my program works well:
the differece between two methods is just how i get descriptor of path;(the path is the same form)
i do not know why? and i would appreciate it if you are so kind to help me.
Hi z,
in the first case you read something, that already exist, in the second case you create something new. I guess you should compare the two elements on CAD level to find an explanation.
Mit freundlichen Grüßen / Best regards Volker Hüfner
| AB_DATE Engineering Software | ab-date.de |