Jump to content

How to explain...Shortcut to LISP to act like built in autocad commands


Recommended Posts

Posted

when you type "L" in the command line, the next line reads "LINE", then before the user input prompt "LINE" is displayed in bold. See image for a better explanation. Is it possible to get autolisps to behave the same way? If I have a program called by the function "MyLISP", and then I use the shortcut via my pgp file "ML", it does not behave like a native ACAD command.

 

j5MwJTD.png

 

When I use the shorcut "L" autocad reminds me the full command is "LINE"

5TKMm2T.png

 

My command prompt is not prefixed with AutoLisp name.

kOwa0N7.png

 

When I use the shortcut ACAD just reprints the shortcut before going to the user input.

oXvXc07.png

 

It's a small thing, but it bugs me

Posted

Many things are possible but I don't quite understand why you begin with a ssget call when you want to draw lines

Start with something like this.. e.g. my ongoing single line routine.

 

 

(defun msl (/ CMDECHO CMDDIA FRAD E1 UCSE1 E2 UCSE2 osmo)
   (princ "\nMultiple single lines")
   (setq laynu (getvar "clayer"))
   (command "-layer" "on" laynu "")              ;(setq osmo (getvar "Osmode")) 
                                                 ;(setvar "Osmode" 0) 
   (setvar "Cmdecho" 0)
   (setq ERR     *ERROR*
         *ERROR* LISP-ERR
         CMDECHO 0
         CMDDIA  0
         E1      nil
         E2      nil
   )
   (setq E1 (getpoint "\nfrom point"))
   (SETQ UCSE1 (TRANS E1 1 0))
   (while (/= E1 nil)
       (setq E2 (getpoint E1 "\tsecond point: "))
       (SETQ UCSE2 (TRANS E2 1 0))
       (entmake (list '(0 . "LINE")
                      (cons 10 UCSE1)            ;start 
                      (cons 11 UCSE2)            ;end
                )
       )
       (princ "\nMultiple single lines")
       (setq E1 (getpoint "\nfirst: "))
       (SETQ UCSE1 (TRANS E1 1 0))
   ) ;_end of while 
   (setvar "Cmdecho" 1)                          ;(setvar "Osmode" osmo) 
   (princ)
)

(defun C:n () (msl))
;|«Visual LISP© Format Options»
(80 4 50 2 nil "end of " 80 50 0 0 2 nil nil nil T)
;*** DO NOT add text below the comment! ***|;

Posted
Many things are possible but I don't quite understand why you begin with a ssget call when you want to draw lines

 

I was just using "LINE" as an example. It could be erase, move, circle, any native ACAD command.

 

With a native ACAD command, when you type the Shortcut ("L" in my example), the next line iterates the full name of the command

The next line after starts with an Icon, then the Full name in Bold, followed by whatever prompts come next.

 

Autolisps do not behave the same way.

Posted

Just use something like this (princ "\nMSL")

 

Where I want the end user to read something rather than rely on the command line prompt I use (alert "message")

Posted
I was just using "LINE" as an example. It could be erase, move, circle, any native ACAD command.

 

With a native ACAD command, when you type the Shortcut ("L" in my example), the next line iterates the full name of the command

The next line after starts with an Icon, then the Full name in Bold, followed by whatever prompts come next.

 

Autolisps do not behave the same way.

 

Works fine for me, have you scrolled down the list to look for your lisp command name? The lisp would have to be loaded for Autocomplete to find it. You can set it to either "Alphabetically" or "According to frequency of useage".

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