以下代码由网友Wakki提供

axlCmdRegister("Origin" 'set_origin)
defun( set_origin ()
   popup = axlUIPopupDefine(nil (list
     (list "Done" `axlFinishEnterFun)
         (list "Cancel" `axlcancelEnterFun)))
         axlUIPopupSet(popup)
   axlClearSelSet()
   axlSetFindFilter( ?enabled list("noall" "LINESEGS") ?onButtons list("noall" "LINESEGS"))
   axlSingleSelectPoint()
        line1 = car(axlGetSelSet())
        axlClearSelSet()
        axlHighlightObject(line1)
        when(line1
                axlSetFindFilter( ?enabled list("noall" "LINESEGS") ?onButtons list("noall" "LINESEGS"))
                axlSingleSelectPoint()
                line2 = car(axlGetSelSet())
                axlClearSelSet()
                axlDehighlightObject(line1)
        )
        when(line1 && line2 && line1->layer == line2->layer
                point = axl_ol_ol2(line1->startEnd line2->startEnd)
              axlDBChangeDesignOrigin(list(minus(xCoord(car(point))) minus(yCoord(cadr(point)))))
         )
 )
最后修改日期: 2022-06-11

作者

留言

撰写回覆或留言

发布留言必须填写的电子邮件地址不会公开。

Captcha Code