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:
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?
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?