Jump to content

Recommended Posts

Posted

Hey Guys,

 

Im still very limited to what i can do with lisp; recently i've been experimenting with shorting command lengths. I thought i'd make on for the tcase function but you have to click to specify what case you want to make the selected text. Is there a varible for each one of them? (UPPER, lower, Sentance, Title.. ect)

 

Thanks in advance

Posted

Take a look at the tcase.lsp in the Express folder.

 

The mode is stored as a variable, and can be retrieved using:

(acet-getvar '("ACET-TCASE-MODE"))

Posted

couldn't get this to work for upper case, I'm obviously well out of my league :oops::roll:

 

(defun c:tc ( / lst )
(defun acet-tcase-ui-cmd ( / ans def lst )

(setq def (acet-getvar '("ACET-TCASE-MODE")))
(if (not def)
    (setq def "Upper")
);if
(initget "Sentence Lower Upper Title toGgle")
(setq ans (getkword 
           (acet-str-format "\nSelect case [sentence/Lower/Upper/Title/toGgle] <%1>: "
                            def
           )
          );getkword
);setq
(if (not ans)
    (setq ans def)
);if
(acet-setvar (list "ACET-TCASE-MODE" ans 3)) ;; store it in the drawing and in the profile

(list ans)
);defun acet-tcase-ui-cmd
(princ / )

Posted

How are you trying to shorten it - at the moment I thought it is just a dialog and a selection - I don't see where it could be shortened, unless you created a function for each setting in the dialog :)

 

Lee

Posted

tcase has a commandline version of what you are working towards:

tcase.PNG

  • 14 years later...
Posted (edited)

Hi All,
Reviving an old thread
Any reason why this stopped working in AutoCAD 2025?

Worked in 2024 and prior.

(acet-getvar '("ACET-TCASE-MODE"))

Get the following error:
; error: no function definition: ACET-AUTOLOAD2

 

Edited by Zakwaan
Posted

Nevermind :)
Brain was tired

  • Like 1

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...