本帖最后由 184235521 于 2021-8-22 13:58 编辑
因为平时工作需要插入图块种类比较多,同时需要调整插入块(图形+文字)的方向。因为块种类接近50种,再加上四个方向差不多有200个图块,下面就用一种类型的四个方向,求大神帮简化下代码。如果有更好的调整块方向思路指点,万分感谢。- (defun c:T1 ()
- (setvar "cmdecho" 0)
- (setq pt1 (getpoint "插入点:"))
- (command "insert" "*T1.dwg" pt1 1 0 k0)
- (setvar "CMDECHO" 1)
- (princ)
- )
- (defun c:T2 ()
- (setvar "cmdecho" 0)
- (setq pt1 (getpoint "插入点:"))
- (command "insert" "*T2.dwg" pt1 1 0 k0)
- (setvar "CMDECHO" 1)
- (princ)
- )
- (defun c:T3 ()
- (setvar "cmdecho" 0)
- (setq pt1 (getpoint "插入点:"))
- (command "insert" "*T3.dwg" pt1 1 0 k0)
- (setvar "CMDECHO" 1)
- (princ)
- )
- (defun c:T4 ()
- (setvar "cmdecho" 0)
- (setq pt1 (getpoint "插入点:"))
- (command "insert" "*T4.dwg" pt1 1 0 k0)
- (setvar "CMDECHO" 1)
- (princ)
- )
上面就是图块T 它有四个方向分别对应T1 T2 T3 T4 如下图(意思就是这个一个块,为了调整方向用了四个命令代码就比较长。有没有更简洁的代码去实现)
|