Jump to content
K Baden

LISP to add predefined Suffix to dimension

Recommended Posts

K Baden

Good morning!

I have not had any luck in finding much that my novice LISP skills can fix up to suit my needs. Perhaps someone here has something laying around?


I am looking to have a LISP that does the following:

allows the user to select one or more dimensions

Allows user to pick from 3-4 options with the underlined letter being what the command needs: (XHM), (THR), (YJM), and (CPA)

Then add the user selected string as a dimension suffix to the selected dimension.


We add suffixes to dimensions often, and there are several different ones we use daily. Just looking to save time by having a command that will add the selected string to the suffix.


Does anyone have anything similar? I am able to do some editing to suit my needs, but I don't even know where to start with editing a dimension suffix via LISP.


Thanks in advance!

Share this post

Link to post
Share on other sites

Few ideas at: http://forums.augi.com/showthread.php?129908-Text-Override-in-Dimension&p=1127451&viewfull=1#post1127451

I use Alan's DQE.lsp, you just have to modify the values in the line

(setq lst '("<>" "± VIF" "EQ." "± VERIFY"))

Mine is set to

(setq lst '("" "Easement" "<> R.O.W." "Varies" "<>\\XVaries" "<> Varies" "<>±"))

" R.O.W." adds the suffix R.O.W. to the dimension.

Share this post

Link to post
Share on other sites

Here's a function you can use. Wrap it into your code with the options you want.

(defun _putsuffix (e suf / o)
 (if (and (= 'ename (type e))
   (vlax-property-available-p (setq o (vlax-ename->vla-object e)) 'textsuffix)
   (vlax-write-enabled-p o)
   (vla-put-textsuffix o suf)
(_putsuffix (car (entsel)) "CPA")

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now