CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoLISP 开发指南

规划多个反应堆

2023-1-5 06:57| 发布者: admin| 查看: 270| 评论: 0|来自: AutoCAD

用户屏幕上可能有几条花园路径,并且可能会擦除多个花园路径。您需要为这种可能性做好计划。

与实体关联的反应器是对象反应器。如果图形中有多个图元,则可能还会有多个对象反应器,每个图元一个。特定的编辑事件(如命令)可以触发许多回调,具体取决于附加了反应器的选定实体的数量。另一方面,编辑器反应堆本质上是单一的。应用程序应仅附加单个事件反应器。erase:vlr-commandEnded

这两种修改(更改顶点位置和擦除折线)的事件序列最终都会产生需要在函数内执行的操作。确定要为每个条件执行的一组操作。以下伪代码概述了逻辑:gp:command-ended

Defun gp:command-ended (2nd version)
  Retrieve the pointer to the polyline (from a global variable)
      Conditional:
        If the polyline has been modified then:
           Erase the tiles
           Get information on the previous polyline vertex locations
           Get information on the new polyline vertex locations
           Redefine the polyline (straighten it up)
           Redraw the tiles
        End conditional expression
        If the polyline has been erased then:
           Erase the tiles
        End conditional expression
      End Conditional
End function

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-19 13:59

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部