Continue to Site

Welcome to 3DCADForums

Join our CAD community forums where over 25,000 users interact to solve day to day problems and share ideas. We encourage you to visit, invite you to participate and look forward to your input and opinions. Acrobat 3D, AutoCAD, Catia, Inventor, IronCAD, Creo, Pro/ENGINEER, Solid Edge, SolidWorks, and others.

UGNX 5.0 Exception

virat_gangurde

New member
Here i am exploring geometry using user function in UGNX 5.0 as
follows.

We have written the following code for creating an empty part file.

_gbl_UGSession = Session::GetSession();

PartLoadStatus *pls;

PartCollection *pc = _gbl_UGSession->Parts();

SaveOptions *sp = pc->SaveOptions();

sp->SetVisualizationData(TRUE);

try{

printf("mnxnode_DSO_INIT -------------- created basepart\n
\n");

_gbl_UGBasePart = pc->NewBaseDisplay("C:\TEMP\part1.prt",
NXOpen::BasePart::UnitsMillimeters);

}

catch(const NXException &ex){

_gbl_UGBasePart = pc->OpenBaseDisplay("C:\TEMP\part1.prt",
&pls);

}





After creating the empty part file we create a 3d Cartesian point with
the following code
try{
Part *workPart(_gbl_UGSession->Parts()->Work());
Part *displayPart(_gbl_UGSession->Parts()->Display());
Point *point1;
point1 = workPart->Points()->CreatePoint(Point3d(x, y,
z));
//ret = new MNXNode(point1);
Feature *nullFeatures_Feature(NULL);
PointFeatureBuilder *pointFeatureBuilder1;
pointFeatureBuilder1 =workPart->BaseFeatures()-
>CreatePointFeatureBuilder(nullFeatures_Feature);
pointFeatureBuilder1->SetPoint(point1);
NXObject *nXObject1;
nXObject1 = pointFeatureBuilder1->Commit();
pointFeatureBuilder1->Destroy();
}

catch (const NXException &ex)
{
printf("Exception is '%s'\n", ex.Message());

}





But we are getting a runtime exception on the commit command
( exception : Unable to reference associative basic curve ). Can you
pls suggest to overcome the exception


Thanks in advanced.
 

Articles From 3DCAD World

Sponsor

Back
Top