SlalomeVr 发表于 2022-7-5 18:01:05

将数字添加到多段线

大家好,
 
 
 
 
我尝试向选定多段线的长度中添加一个数字,并将其粘贴到属性中。
我试图改变这一习惯,但我做不到
你能帮帮我吗
 

(vl-load-com)
(defun c:ALE (/ atent attobj ent leng obj mou tot)
   (while
(setq ent
       (entsel "\nSelect Polyline (or press eEnter to Exit): "))
(setq obj (vlax-ename->vla-object (car ent)))
(setq mou (getreal "\nEnter the extra length : "))
(setq leng (rtos
       (vlax-get-property obj "Length")
       2
       0      ; <--precison 1 decimals
       )
      )
(if
   (setq atent
   (nentsel "\nSelect Attribute: "))
    (progn
      (setq tot '(+ leng mou))) ; problem with this
      (setq attobj (vlax-ename->vla-object (car atent)))
      (vlax-put-property attobj "TextString" tot)
      )
    )
)
(princ)
)
(prompt "\nStart command with ALE")
(prin1)

Tharwat 发表于 2022-7-5 18:28:22

谢谢!

SlalomeVr 发表于 2022-7-5 18:45:37

不客气。

Tharwat 发表于 2022-7-5 19:01:54

页: [1]
查看完整版本: 将数字添加到多段线