CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2022 开发者帮助

设计 gp:command-ended 回调函数

2024-5-18 18:42| 发布者: admin| 查看: 11| 评论: 0|原作者: admin|来自: AutoCAD

设计 gp:command-ended 回调函数

编辑器反应器回调函数是大多数操作发生的地方。在调用此函数之前,花园路径边框多段线处于“开放修改”状态,也就是说,用户可能仍在 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-6-27 16:16

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部