jerisonfang 发表于 2023-7-21 19:15:25

铝板展开折减系数换算快捷lisp

本帖最后由 jerisonfang 于 2023-7-21 19:17 编辑

使用方法简述:


cad命令输入zj,空格确认,提示输入折减系数(即铝板折弯90度时候的折减数值,比如3mm铝板单边折减是2.5),输入确认以后提示输入角度,输入确认以后提示点击插入点,点击完即出现折减换算图形

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAioAAAFLCAYAAAD4cKfRAAAYGklEQVR4nO3dT4yUZb7o8d+gcMxd6c7FpRsQoyY3tt2zMkTSaPwzMXGD4YbODSNMZpgFu4nJGCXGoHFOPLM6LGTMgENumlwii0tijjgZ6WDIrA4dzoZjZIBuNu50afTo3AW3aqqaqu7699b7q/f9fBKSomm6nn5TVH953ud93p9sf/SJvwcjtWXzffHd99+WPYzKcnyL5fgWy/Et1gP3Pxhff/NV2cOotHG/hjeN7ZkAAPokVACAtIQKAJCWUAEA0hIqAEBaQgUASEuoAABpCRUAIC2hAgCkJVQAgLSECgCQllABANISKgBAWkIFAEhLqAAAaQkVACAtoQIApCVUAIC0hAoAkJZQAQDSEioAQFpCBQBIS6gAAGkJFQAgLaECAKQlVACAtIQKAJCWUAEA0hIqAEBaQgUASEuoAABpCRUAIC2hAgCkJVQAgLSECgCQllABANISKgBAWkIFAEhLqAAAaQkVACAtoQIApCVUAKAkN64tx41ry2UPI7V7yx4AANRNI052PDZb8kjyEyoAMAatMycCpXdCBQAKIk6GJ1QAYMSc2hkdi2kBYEQai2MFyugIFQAYkR2PzbZFiit6hidUAKAPLikeL2tUAGADgyyK3fHYrFNBIyBUAKALi2LLJ1QAoEURlxSbVRmcUAGg9ux3kpdQAaCWxh0nZlUGI1QAqBXrTiaLUAGg8rKc2jGr0j+hAkAlZYiTxiXKDE6oAFAZ//7Xf2s+zjpzYValP0IFgInXmLX46ZM/i6+/+ark0TBKQgWAidTp1M4D9z9Y1nD6Ylald0IFgImRYd1JJ64kKo5QASC17HESMdi4zKr0RqgAkE7WOIkwezJuQgWAN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ffPf9t6WMZyNlHqtRyXx8q8DxLZbjW6wH7n8wvv7mq7KHMVLZ3rfH/Rqu3RqVUZue2tp2JREA1TE3O1PIbVRu3loxm94joTKExqXFrVcSAVAdjzy8s/DbqLC+2q5RGdbc7Exs3zYVLy+84modgIo6c/acPa5KZkZlQFeWr7o/A0ANHDp8JI6+9mpzW4uV1dvxm98eHepr+g9u74RKF61b35exiKns5wfgHxrrSQ4eWIjpqa3x4gvPWWMyJrUPlV7uxVO2bmMUMADjc+zd92L7tumY370rDh5YiI8/+dTMyBjUJlQmIUj61el7Ei8AxTl0+Ejzvff3vztmCcAYVC5Uqhgk/TD7AlCs1998O955642Yntoa+/ft7XibFUanMqFSZKBUIX6q8D0AZHDm7Ll49pk9ZQ+jNioTKq0zBqP+odzvbMQodu0b5fdQ5LEBqKNR3GKF3lQmVFptFBZV+2HttA4AVVXJUNnIJIaMGAGgjmoZKhvJEAUZxgAAZbOFPgCQllABgMTqPsMuVACAtIQKAJCWUAEA0hIqAEBaQgUASKsSoVL3FdH9cKwAmCSVCBUAoJqECgCQllABANISKgBAWkIFAEhLqAAAaQkVACAtoQIApCVUAIC0hAoAkJZQAQDSEioAQFpCBQBIS6gAAGkJFQAgLaECAKQlVACAtIQKAJCWUAEA0hIqAEBaQgUASEuoAABpCRUAIC2hAgCkJVQAgLSECgCQllABANISKgBAWkIFAEhLqAAAaf0/SSPYQw1sGRcAAAAASUVORK5CYII=

(defun c:zj ()
(setvar "cmdecho" 0)
(setvar "blipmode" 0)
(setvar "OSMODE" 18103)
(vl-load-com)
(progn
    (command "_DIMSTYLE" "r" "AVA-01")
    (setq str (getreal "请输入折减系数:"))
    (if (= str nil) (setq str 2.5))
    (setq ang (getreal "\n请输入角度:"))
    (setq ppp (getpoint "\n请输入插入点:"))
    (setq xs str)
    (setq pp1 (mapcar '+ ppp '(50 0 0)))
    (setq pp2 (mapcar '+ ppp '(50 10 0)))
    (setq pp3 (mapcar '+ ppp '(0.0 -10 0.0)))
    (setq pp4 (mapcar '+ ppp '(10 0 0)))
    (command "PLINE" pp1 ppp "")
    (setq ss (entlast))
    (command "copy" ss "" "0,0,0" "0,0,0")
    (setq ss1 (ssget "P"))
    (command "rotate" ss1 "" ppp ang)
    (setq ss2 (entlast))
    (setq ss3 (ssname ss1 0))
    (setq obj1 (vlax-ename->vla-object ss3))
    (setq pt1 (vla-get-Coordinates obj1))
    (setq p01 (vlax-variant-value pt1))
    (setqp01 (vlax-safearray->list p01))
    (setq p11 (list (car p01) (cadr p01) 0.0))
    (command "peditaccept" 1)
    (command "_pedit" "m" ss2 ss3 "" "j" "0.0" "")   
    (command "offset" xs (entlast) pp2 "")
    (setq a1 (entlast))
    (setq obj (vlax-ename->vla-object a1))
    (setq pt (vla-get-Coordinates obj))
    (setq p0 (vlax-variant-value pt))
    (setqp0 (vlax-safearray->list p0))
    (setq p1 (list (caddr p0) (cadddr p0) 0.0))
    (setq p2 (list (car p1) (- (cadr p1) xs) 0.0))
    (command "DIMLINEAR" ppp p1pp3 "")
    (command "DIMLINEAR" p1 p2 pp1 "")
    (command "_DIMANGULAR" "" ppp pp1 p11 pp2)   
)
(setvar "OSMODE" 1719)
)

lxl217114 发表于 2023-7-22 10:53:38

感谢分享源码

sowin 发表于 2023-7-25 10:29:09

非专业,看不懂了
页: [1]
查看完整版本: 铝板展开折减系数换算快捷lisp