marting 发表于 2025-4-3 21:14:43

XD::Curve:BreakAtPoints



;;; 函数名称: XD::Curve:BreakAtPoints
;;; 功能: 在指定点对 (pt1, pt2) 处打断指定实体 (ssn)。
;;;      如果仅提供 pt1,则使用 AutoCAD 的 "@" 选项进行打断。
;;; 参数:
;;;   - ssn (选择集/实体): 需要打断的对象。
;;;   - pt1 (点坐标): 第一个打断点。
;;;   - pt2 (可选, 点坐标): 第二个打断点。如果未提供,则使用 "@" 自动打断。
;;; 返回值:
;;;   - 无返回值,直接执行 AutoCAD 的 `break` 命令。
(defun XD::Curve:BreakAtPoints (ssn pt1 pt2)
(if pt2
    (progn
      (command "break")
      (command ssn)
      (command "non") ;; 使用非正交方式选择点
      (command pt1)
      (command "non")
      (command pt2)
    )
    (progn
      (command "break")
      (command ssn)
      (command "non")
      (command pt1)
      (command "@") ;; 使用 "@" 选项在 pt1 处打断
    )
)
)

bghyu 发表于 2026-1-9 14:03:13

:kiss::$:handshake
页: [1]
查看完整版本: XD::Curve:BreakAtPoints