yadvdinesh
Aerospace
- Apr 13, 2015
- 31
Hi, I want to move DATUM coordinates to a specified layer. Below is the journal which I am getting on recording:
Session::UndoMarkId markId1;
markId1 = theSession->SetUndoMark(Session::MarkVisibilityVisible, "Edit Object Display");
DisplayModification *displayModification1;
displayModification1 = theSession->DisplayManager()->NewDisplayModification();
displayModification1->SetApplyToAllFaces(false);
displayModification1->SetApplyToOwningParts(false);
displayModification1->SetNewLayer(123);
std::vector<DisplayableObject *> objects1(8);
CartesianCoordinateSystem *cartesianCoordinateSystem1(dynamic_cast<CartesianCoordinateSystem *>(workPart->FindObject("HANDLE R-4725")));
objects1[0] = cartesianCoordinateSystem1;
DatumAxis *datumAxis1(dynamic_cast<DatumAxis *>(workPart->Datums()->FindObject("DATUM_CSYS(0) Y axis")));
objects1[1] = datumAxis1;
DatumPlane *datumPlane1(dynamic_cast<DatumPlane *>(workPart->Datums()->FindObject("DATUM_CSYS(0) XY plane")));
objects1[2] = datumPlane1;
DatumPlane *datumPlane2(dynamic_cast<DatumPlane *>(workPart->Datums()->FindObject("DATUM_CSYS(0) YZ plane")));
objects1[3] = datumPlane2;
DatumAxis *datumAxis2(dynamic_cast<DatumAxis *>(workPart->Datums()->FindObject("DATUM_CSYS(0) Z axis")));
objects1[4] = datumAxis2;
DatumAxis *datumAxis3(dynamic_cast<DatumAxis *>(workPart->Datums()->FindObject("DATUM_CSYS(0) X axis")));
objects1[5] = datumAxis3;
DatumPlane *datumPlane3(dynamic_cast<DatumPlane *>(workPart->Datums()->FindObject("DATUM_CSYS(0) XZ plane")));
objects1[6] = datumPlane3;
Features:atumCsys *datumCsys1(dynamic_cast<Features:atumCsys *>(workPart->Features()->FindObject("DATUM_CSYS(0)")));
Point *point1(dynamic_cast<Point *>(datumCsys1->FindObject("HANDLE R-4726")));
objects1[7] = point1;
displayModification1->Apply(objects1);
delete displayModification1;
In the above code, "HANDLE R-4726" & "HANDLE R-4725" for point1 & cartesianCoordinateSystem1 are specific to a part. To make the code generic I want to get these names using journalidentifier() method. Can someone plz tell with which class/object journal identifier to be used for Point1 & cartesianCoordinateSystem1.
Session::UndoMarkId markId1;
markId1 = theSession->SetUndoMark(Session::MarkVisibilityVisible, "Edit Object Display");
DisplayModification *displayModification1;
displayModification1 = theSession->DisplayManager()->NewDisplayModification();
displayModification1->SetApplyToAllFaces(false);
displayModification1->SetApplyToOwningParts(false);
displayModification1->SetNewLayer(123);
std::vector<DisplayableObject *> objects1(8);
CartesianCoordinateSystem *cartesianCoordinateSystem1(dynamic_cast<CartesianCoordinateSystem *>(workPart->FindObject("HANDLE R-4725")));
objects1[0] = cartesianCoordinateSystem1;
DatumAxis *datumAxis1(dynamic_cast<DatumAxis *>(workPart->Datums()->FindObject("DATUM_CSYS(0) Y axis")));
objects1[1] = datumAxis1;
DatumPlane *datumPlane1(dynamic_cast<DatumPlane *>(workPart->Datums()->FindObject("DATUM_CSYS(0) XY plane")));
objects1[2] = datumPlane1;
DatumPlane *datumPlane2(dynamic_cast<DatumPlane *>(workPart->Datums()->FindObject("DATUM_CSYS(0) YZ plane")));
objects1[3] = datumPlane2;
DatumAxis *datumAxis2(dynamic_cast<DatumAxis *>(workPart->Datums()->FindObject("DATUM_CSYS(0) Z axis")));
objects1[4] = datumAxis2;
DatumAxis *datumAxis3(dynamic_cast<DatumAxis *>(workPart->Datums()->FindObject("DATUM_CSYS(0) X axis")));
objects1[5] = datumAxis3;
DatumPlane *datumPlane3(dynamic_cast<DatumPlane *>(workPart->Datums()->FindObject("DATUM_CSYS(0) XZ plane")));
objects1[6] = datumPlane3;
Features:atumCsys *datumCsys1(dynamic_cast<Features:atumCsys *>(workPart->Features()->FindObject("DATUM_CSYS(0)")));
Point *point1(dynamic_cast<Point *>(datumCsys1->FindObject("HANDLE R-4726")));
objects1[7] = point1;
displayModification1->Apply(objects1);
delete displayModification1;
In the above code, "HANDLE R-4726" & "HANDLE R-4725" for point1 & cartesianCoordinateSystem1 are specific to a part. To make the code generic I want to get these names using journalidentifier() method. Can someone plz tell with which class/object journal identifier to be used for Point1 & cartesianCoordinateSystem1.