Remove camera rotation after journaling NX Open

159 views Asked by At

What functions in the journal are responsible for moving the camera? I i removed lines of code like this. After that, the camera rotations became less, but the camera continues to rotate and is centered at the beginning of the coordinate system.

        NXOpen.Point3d scaleAboutPoint1 = new NXOpen.Point3d(-16.215898023039518, 10.575585667199768, 0.0);
        NXOpen.Point3d viewCenter1 = new NXOpen.Point3d(16.215898023039664, -10.575585667199684, 0.0);
        workPart.ModelingViews.WorkView.ZoomAboutPoint(1.25, scaleAboutPoint1, viewCenter1);

        NXOpen.Point3d scaleAboutPoint2 = new NXOpen.Point3d(-12.972718418431583, 8.4604685337598333, 0.0);
        NXOpen.Point3d viewCenter2 = new NXOpen.Point3d(12.972718418431734, -8.460468533759741, 0.0);
        workPart.ModelingViews.WorkView.ZoomAboutPoint(1.25, scaleAboutPoint2, viewCenter2);

        NXOpen.Point3d scaleAboutPoint3 = new NXOpen.Point3d(-10.378174734745263, 6.7683748270078716, 0.0);
        NXOpen.Point3d viewCenter3 = new NXOpen.Point3d(10.378174734745398, -6.7683748270077837, 0.0);
        workPart.ModelingViews.WorkView.ZoomAboutPoint(1.25, scaleAboutPoint3, viewCenter3);

        NXOpen.Point3d scaleAboutPoint4 = new NXOpen.Point3d(-8.3025397877962099, 5.4146998616063069, 0.0);
        NXOpen.Point3d viewCenter4 = new NXOpen.Point3d(8.3025397877963183, -5.4146998616062154, 0.0);
        workPart.ModelingViews.WorkView.ZoomAboutPoint(1.25, scaleAboutPoint4, viewCenter4);

        NXOpen.Point3d scaleAboutPoint5 = new NXOpen.Point3d(-6.6420318302369541, 4.3317598892850535, 0.0);
        NXOpen.Point3d viewCenter5 = new NXOpen.Point3d(6.642031830237066, -4.3317598892849629, 0.0);
        workPart.ModelingViews.WorkView.ZoomAboutPoint(1.25, scaleAboutPoint5, viewCenter5);

        NXOpen.Point3d scaleAboutPoint6 = new NXOpen.Point3d(-5.3136254641895464, 3.4654079114280498, 0.0);
        NXOpen.Point3d viewCenter6 = new NXOpen.Point3d(5.3136254641896699, -3.4654079114279637, 0.0);
        workPart.ModelingViews.WorkView.ZoomAboutPoint(1.25, scaleAboutPoint6, viewCenter6); 

        NXOpen.Matrix3x3 rotMatrix1 = new NXOpen.Matrix3x3();
        rotMatrix1.Xx = 0.96533429702299545;
        rotMatrix1.Xy = 0.081373321601911852;
        rotMatrix1.Xz = -0.24800822067542638;
        rotMatrix1.Yx = 0.037268825544830277;
        rotMatrix1.Yy = 0.8974566731012108;
        rotMatrix1.Yz = 0.43952537418062437;
        rotMatrix1.Zx = 0.258342272254519;
        rotMatrix1.Zy = -0.43353189321845947;
        rotMatrix1.Zz = 0.86331301850996822;
        NXOpen.Point3d translation1 = new NXOpen.Point3d(-77.49478481461793, -30.874519473708904, -11.259821185011582);
        workPart.ModelingViews.WorkView.SetRotationTranslationScale(rotMatrix1, translation1, 7.8735770643394423); 
1

There are 1 answers

0
Essigwurst On

Basically every input action (zoom, center, rotate) is responsible for this lines of code. This is affected by mouse, space mouse and keyboard input actions - but it is safe to remove them.

Unfortunately there is no option to turn off the "recording" of this actions - for my part, i try to avoid rotating and zooming around while recording a macro (or at least pause macro recording while doing so).