Jump to content

Simple LISP routine to invoke "copy" command not operating properly


cwize

Recommended Posts

I have a .lsp file that mostly creates keyboard shortcuts for basic commands. My copy mode is set to default to "multiple" - and if I type "copy", it is indeed multiple. However, if I use my shortcut (just the "c" key), it is not. Here's the code:

(defun c:c() (command "copy"))

I don't think it gets much simpler than that... why would it not operate the same way as "copy"? Confused.

Link to comment
Share on other sites

You can use the initcommandversion function to force the later version of the command:

(defun c:c ( )
   (initcommandversion)
   (command "_.copy")
)

However, why not just change the alias for the copy command in the acad.pgp file?

[Tools > Customise > Edit Program Parameters (acad.pgp)]

Link to comment
Share on other sites

I'm with Lee. Make these type of changes at the acad.pgp level. Much less headache. Also, to make things easier and more organized, instead of editing what's already there, just place everything you want after the follow bit of text, placed at the bottom of all acad.pgp files.

 

;  -- User Defined Command Aliases --
;  Make any changes or additions to the default AutoCAD command aliases in 
;  this section to ensure successful migration of these settings when you
;  upgrade to the next version of AutoCAD.  If a command alias appears more
;  than once in this file, items in the User Defined Command Alias take
;  precedence over duplicates that appear earlier in the file.
;  **********----------**********  ; No xlate ; DO NOT REMOVE

Link to comment
Share on other sites

Thanks to both of you for the answers - I'd not heard of "initcommandversion". The command was part of of a long Lisp routine that shortened a ton of commands and was created by a coworker many years ago. It's how I learned AutoCad, so the familiarity is why I haven't gone into the .pgp stuff (I did, somewhat, when I was stuck with LT for a while). Also, big thanks for this text block to avoid editing the default pgp.

Link to comment
Share on other sites

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