CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoLISP 开发指南

设计 gp:命令结束回调函数

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

编辑器反应器回调函数是大多数操作发生的地方。在调用此函数之前,花园路径边框折线处于“开放修改状态”,也就是说,用户可能仍在 AutoCAD 中操作边框。在反应器序列中,您必须等到 AutoCAD 完成其部分工作,然后才能自由地执行所需的操作。gp:command-ended

以下伪代码说明了函数的逻辑:gp:command-ended

Determine the condition of the polyline.
  CONDITION 1 - POLYLINE ERASED (Erase command)
    Erase the tiles.
  CONDITION 2 - LOST ASSOCIATIVITY (Move, Rotate, etc.)
    Erase the tiles.
  CONDITION 3 - GRIP_STRETCH - REDRAW AND RE-TILE
    Erase the tiles.
    Get the current boundary data from the polyline.
    If it is a lightweight polyline,
       Process boundary data as 2D
    Else
       Process boundary data as 3D
    End if
  Redefine the polyline border (pass in parameters of the current
         boundary configuration, as well as the old).
  Get the new boundary information and put it into the format
         required for setting back into the polyline entity.
  Regenerate the polyline.
  Redraw the tiles (force ActiveX drawing).
  Put the revised boundary information back into the reactor
         named in *reactorsToChange*.
End function

伪代码相对简单,但伪代码中隐藏着几个重要的细节,它们是您目前不会知道的事情。


路过

雷人

握手

鲜花

鸡蛋

最新评论

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

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

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部