CAD制图时,如何演示实时柱形旋转动态观察?

我们之前有讨论过三维立体图形的约束、自由、连续等动态观察,可是你是否了解,我们在绘制三维立体图形之初,常用的实际上是基于X轴Y轴Z轴的实时柱形旋转动态观察。这一类型的三维动态观察对于我们精 确地制图工作非 常有帮助。小编今天就和大家分享一下,CAD制图时,如何演示实时柱形旋转动态观察。演示操作如下:

三维立体图形的CAD图纸
我们先运行CAD编辑器,点 击“文件-打开”选项或是直接在命令行输入“OPEN”命令字符,任意打开一张三维立体图形的CAD图纸。
在这里插入图片描述
三维动态观察-实时X
1.我们在命令行输入“RTROTX”命令字符,调用实时柱形X旋转动态观察命令;
2.或是直接点 击工具选项版中的“三维动态观察-实时X”选项图标,调用实时柱形X旋转动态观察命令。
在这里插入图片描述
三维动态观察-实时X:实时柱形X旋转动态观察GIF演示:
在这里插入图片描述
三维动态观察-实时Y
1.我们在命令行输入“RTROTY”命令字符,调用实时柱形Y旋转动态观察命令;
2.或是直接点 击工具选项版中的“三维动态观察-实时Y”选项图标,调用实时柱形Y旋转动态观察命令。
在这里插入图片描述
三维动态观察-实时Y:实时柱形Y旋转动态观察GIF演示:
在这里插入图片描述
三维动态观察-实时Z
1.我们在命令行输入“RTROTZ”命令字符,调用实时柱形Z旋转动态观察命令;
2.或是直接点 击工具选项版中的“三维动态观察-实时Z”选项图标,调用实时柱形Z旋转动态观察命令。
在这里插入图片描述
三维动态观察-实时Z:实时柱形Z旋转动态观察GIF演示:
在这里插入图片描述
以上就是CAD编辑器里演示,CAD制图时,基于X轴Y轴Z轴的实时柱形旋转动态观察的操作步骤。非 常实 用方便,对于我们日常的CAD制图工作很有帮助,小伙伴们可以自己尝试一下操作。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
可以使用C#中的DrawJig类来实现动态移动和旋转。DrawJig类是用于绘制交互图形的基类,它提供了许多方法来实现交互式绘图。 以下是使用DrawJig类实现动态移动和旋转的示例代码: ```csharp using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.Geometry; using Autodesk.AutoCAD.Runtime; using Autodesk.AutoCAD.GraphicsInterface; namespace DynamicMoveRotate { public class MyDrawJig : DrawJig { private Point3d _basePoint; private Vector3d _normal; private double _angle; private bool _move; public MyDrawJig(Point3d basePoint, Vector3d normal) { _basePoint = basePoint; _normal = normal; _angle = 0.0; _move = true; } protected override SamplerStatus Sampler(JigPrompts prompts) { if (_move) { JigPromptPointOptions jppo = new JigPromptPointOptions("\n指定移动点: "); PromptPointResult ppr = prompts.AcquirePoint(jppo); if (ppr.Status == PromptStatus.Cancel) return SamplerStatus.Cancel; if (_basePoint.DistanceTo(ppr.Value) > Tolerance.Global.EqualPoint) { _move = false; _angle = _normal.GetAngleTo(ppr.Value - _basePoint); } } else { JigPromptAngleOptions jpa = new JigPromptAngleOptions("\n指定旋转角度: "); jpa.BasePoint = _basePoint; jpa.UseBasePoint = true; PromptDoubleResult pdr = prompts.AcquireAngle(jpa); if (pdr.Status == PromptStatus.Cancel) return SamplerStatus.Cancel; _angle = pdr.Value; } return SamplerStatus.OK; } protected override bool WorldDraw(WorldDraw draw) { Vector3d axis = _normal.GetPerpendicularVector(); Matrix3d mat = Matrix3d.Rotation(_angle, axis, _basePoint); draw.Geometry.Draw(new Line(_basePoint, _basePoint.TransformBy(mat))); return true; } public ResultBuffer Run() { Document doc = Application.DocumentManager.MdiActiveDocument; Editor ed = doc.Editor; PromptEntityOptions peo = new PromptEntityOptions("\n选择实体: "); peo.SetRejectMessage("\n只能选择直线或圆弧!"); peo.AddAllowedClass(typeof(Line), true); peo.AddAllowedClass(typeof(Circle), true); PromptEntityResult per = ed.GetEntity(peo); if (per.Status != PromptStatus.OK) return null; using (Transaction tr = doc.TransactionManager.StartTransaction()) { Entity ent = tr.GetObject(per.ObjectId, OpenMode.ForWrite) as Entity; if (ent == null) return null; _basePoint = ent.GeometricExtents.MinPoint; _normal = ent.GetPlane().Normal; MyDrawJig jig = new MyDrawJig(_basePoint, _normal); PromptResult pr = ed.Drag(jig); if (pr.Status != PromptStatus.OK) return null; Matrix3d mat = Matrix3d.Rotation(jig.Angle, _normal, _basePoint); ent.TransformBy(mat); tr.Commit(); } return new ResultBuffer(new TypedValue[] { new TypedValue((int)DxfCode.Start, per.ObjectId) }); } } public class Commands { [CommandMethod("DYNMOVE")] public void DynamicMove() { MyDrawJig jig = new MyDrawJig(Point3d.Origin, Vector3d.ZAxis); jig.Run(); } } } ``` 在这个示例中,我们创建了一个名为MyDrawJig的派生类来实现DrawJig。在Sampler方法中,我们首先采集移动点,然后在旋转点上采集旋转角度。在WorldDraw方法中,我们绘制了一个直线来表示移动和旋转的效果。最后,在Run方法中,我们选择实体,然后调用Drag方法来启动交互式绘图操作。 要使用此命令,请打开AutoCAD并输入"DYNMOVE"命令。然后,选择要移动和旋转的实体,按照提示来指定移动点和旋转角度即可。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值