I am creating an dimension element. The inserted points associate with start and end point of the line element in the reference file. When I use mdlAssoc_createLinear to create an assocPoint,it fails. I have tested if the line element is in the activemodel,it always successes. The code is as follows:
EditElemHandle eeh(edP,true,false);
DPoint3d startPt;
DPoint3d endPt;
mdlElmdscr_extractEndPoints(&startPt,NULL,&endPt,NULL,edP,eeh.GetModelRef());
DisplayPathP path = mdlDisplayPath_new(eeh.GetElemRef(),eeh.GetModelRef());
AssocPoint point1;
if (SUCCESS == mdlAssoc_createLinear(&point1,&startPt,0,0,0,path,0))
{
printf("SUCCESS\n");
}
else
{
printf("UNSUCCESS\n");
}