Tharwat 发表于 2022-7-5 17:45:56

 
太好了,不客气
 
我每天都在浏览AutoLISP论坛,特别是CADTutor
 
 
 
我认为不,如果与修改后的线条相关联的维度是相关维度,则应该根据线条上的新变化来更改这些维度。
对代码进行一些修改,以避免尺寸颠倒
 

(defun c:Test (/ ss d i e 1p 2p a)
;;    Tharwat 14.Aug.2014      ;;
(if (and (setq d (getdist "\n Specify distance to add :")) (setq ss (ssget "_:L" '((0 . "LINE")))))
   (repeat (setq i (sslength ss))
   (setq e(entget (ssname ss (setq i (1- i))))
         1p (cdr (assoc 10 e))
         2p (cdr (assoc 11 e))
         a(angle 1p 2p)
   )
   (setq e (subst (cons 10 (polar 2p a d)) (assoc 10 e) e)
         e (subst (cons 11 (polar 1p (+ a pi) d)) (assoc 11 e) e)
   )
   (entmod e)
   )
)
(princ)
)

marko_ribar 发表于 2022-7-5 17:50:23

 
是的,这是正常的-您修改了维度,所以它现在没有有效的关联实体来获取关联。。。

hanhphuc 发表于 2022-7-5 17:53:58

 
我想。。
内部子功能

(defun c:Test (/ ss d i e 1p 2p a)
;;    Tharwat 14.Aug.2014      ;;
(if (and (setq d (getdist "\n Specify distance to add :")) (setq ss (ssget "_:L" '((0 . "LINE")))))
   (repeat (setq i (sslength ss))
   (setq e(entget (ssname ss (setq i (1- i))))
         1p (cdr (assoc 10 e))
         2p (cdr (assoc 11 e))
         a(angle 1p 2p)
   )
   (setq e (subst (cons 10 (polar 1p (+ a pi) d)) (assoc 10 e) e)
         e (subst (cons 11 (polar 2p a d)) (assoc 11 e) e)
   )
   (entmod e)
   )
)
(princ)
)

 
谢谢:-)

highflybird 发表于 2022-7-5 17:58:49

 
谢谢韩,也一样。

hanhphuc 发表于 2022-7-5 18:00:25

感谢marko提供的信息。
对于线来说,它应该是关联的,它为什么不被其他人使用呢?
 

mgrenier25 发表于 2022-7-5 18:06:31

非常感谢你们,Lisp程序让我的生活轻松多了
页: 1 [2]
查看完整版本: 延伸两端的线