Jump to content

Recommended Posts

Posted

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!

Posted

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")

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...