LISP for Pattern Dimension
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an old LISP that I need to update it to format my dimension text correctly. I have not used LISP in a long time so I am lost. Using the LISP below, I need to finished dimension value to read in the following format:
12 EQ. SP. @ 1" = <<>>
(defun c:@Dims (/ dist ss n eo)
(if (and (setq dist (getdist "\nSpecify increment distance: "))
(setq ss (ssget '((0 . "DIMENSION"))))
)
(progn
(setq n (sslength ss))
(while (> (setq n (1- n)) -1)
(setq eo (vlax-ename->vla-object (ssname ss n)))
(vla-put-AltUnitsScale eo dist)
(vla-put-LinearScaleFactor eo (/ 1.0 dist))
(vla-put-TextOverride
eo
(strcat "[%<\\AcExpr (1+%<\\AcObjProp Object(%<\\_ObjId "
(itoa (vla-get-ObjectID eo))
">%).Measurement \\f \"%lu2%pr0\">%) \\f \"%lu2%pr0\">%]\\X@ %<\\AcObjProp Object(%<\\_ObjId "
(itoa (vla-get-ObjectID eo))
">%).AltUnitsScale \\f \"%lu2%pr0\">% C/C"
)
)
(vla-Update eo)
)
)
)
(command "._UpdateField" ss "")
(princ)
)