Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

NX9 NXOpen: Adjust camera settings - such thing as an "active" camera? And if so, how do I

Status
Not open for further replies.

js1498

Computer
Dec 4, 2014
10
I'm trying to automate changing camera properties in NXOpen c++. This is for benchmarking purposes to be used on several different prt files.
Manually, I am able to do this in NX via Menu->View->Camera->Capture and Edit, and then adjust the settings there.
The relevant journal code generated by this looks like this:

Code:
Layout *layout1(dynamic_cast<Layout *>(workPart->Layouts()->FindObject("L1")));
Display::Camera *camera1(dynamic_cast<Display::Camera *>(workPart->Cameras()->FindObject("Trimetric")));
Display::CameraBuilder *cameraBuilder1;
cameraBuilder1 = workPart->Cameras()->CreateCameraBuilder(workPart->ModelingViews()->WorkView(), layout1, camera1);
    
NXObject *nXObject1;
nXObject1 = cameraBuilder1->Commit();
    
cameraBuilder1->Destroy();

Those FindObject function calls are causing problems when I try to perform actions on different prt files.
It looks like FindObject("Trimetric") grabs the current camera by name, but I have looked all over the NXOpen reference and have
found no universal way of doing this. Any suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor