记录NX打开后卸下相机旋转
期刊中哪些功能负责移动相机?我删除了这样的代码行。之后,相机旋转变得较少,但是相机继续旋转并以坐标系的开头为中心。
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);
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);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
基本上,每个输入操作(Zoom,Center,Rotate)负责此代码行。这受到鼠标,太空鼠标和键盘输入操作的影响 - 但可以安全地删除它们。
不幸的是,没有任何选项可以关闭此操作的“记录” - 就我而言,我尝试避免在记录宏(或在执行此操作时至少暂停宏记录)时旋转和放大。
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).