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 cowski 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
Joined
Dec 4, 2014
Messages
10
Location
US
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

Back
Top