Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

rkmcswain
en respuesta a: Anonymous

communitysciences wrote:
The elevations are text. I do not need to move them i need to minus out 1.55 from each. For example if the elevation is 10.6 it will change to 9.05

Give this a shot.

 

;;;
(defun c:addval ( / inc ss ent obj str num i)
  (setq inc (getreal "\n Enter increment: "))
  (setq ss (ssget '((0 . "MTEXT,TEXT"))) i 0)
  (repeat (sslength ss)
    (setq ent (ssname ss i))
    (setq obj (vlax-ename->vla-object ent))
    (setq str (vla-get-TextString obj))
    (setq num (distof str))
    (vla-put-TextString obj (rtos (+ num inc) 2 2))
    (setq i (1+ i))
  )
  (princ)
)  
;;;

It will accept a negative value for the increment.

 

If you are not sure what to do with lisp code, see this.

 

R.K. McSwain     | CADpanacea | on twitter