Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

UGNX 5.0 Exception

  • Thread starter Thread starter virat_gangurde
  • Start date Start date
V

virat_gangurde

Guest
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.
 

Part and Inventory Search

Sponsor

Back
Top