Author Topic: Why (command "copy") can't act as the same as "real" copy?  (Read 1430 times)

0 Members and 1 Guest are viewing this topic.

litss

  • Guest
Why (command "copy") can't act as the same as "real" copy?
« on: June 30, 2010, 08:31:06 AM »
Why (command "copy") can't act as the same as "real" copy?

Typing the "copy" in the CAD, I can do Muti-copy. While typing (command "copy") or (vl-cmdf "copy") or (command "copy" "pause")...ect. I can do copy only one time, then it'll stop automatically. Does anyone know why?

Actually, I want to create a lisp to rename some frequently-used command in stead of editing the PGP file. But it seems that (command ...) or (vl-cmdf ...) could not act right as the "real" one. Confusing...

And, the (command "copy") will prompt like this:

Quote
Command: (command "copy")
copy nil

Select objects: 1 found

How can I kill the showing of "nil"?
 

kpblc

  • Bull Frog
  • Posts: 322
Re: Why (command "copy") can't act as the same as "real" copy?
« Reply #1 on: June 30, 2010, 08:39:47 AM »
Perhaps this:
Code: [Select]
(defun c:test-copy ()
  (command "_.cop" "_m")
  (while (/= (getvar "cmdactive") 1)
    (command pause)
    ) ;_ end of while
  (princ)
  ) ;_ end of defun
Sorry for my English.

jitupnair

  • Guest
Re: Why (command "copy") can't act as the same as "real" copy?
« Reply #2 on: June 30, 2010, 09:18:52 AM »
Another method

(command "copy" (ssget) "" "M")

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16721
  • Superior Stupidity at its best
Re: Why (command "copy") can't act as the same as "real" copy?
« Reply #3 on: June 30, 2010, 09:34:12 AM »
How can I kill the showing of "nil"?

Code: [Select]
(setvar "nomutt" 1)

Explanation and C# usage can be found here
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

litss

  • Guest
Re: Why (command "copy") can't act as the same as "real" copy?
« Reply #4 on: July 01, 2010, 12:40:06 AM »
thx all u guys.

"nomutt" couldn't work
Quote
Command: (setvar "NOMUTT" 1)
1
(command "copy")
copy nil
*Cancel*

Code: [Select]
(command "copy" (ssget) "" "M") works. But still showing the "nil".
Quote
(command "copy" (ssget) "" "M")
copy    M nil
*Cancel*

Code: [Select]
(command "_.cop" "_m") couldn't work. Maybe it should be _.copy.




LE3

  • Guest
Re: Why (command "copy") can't act as the same as "real" copy?
« Reply #5 on: July 01, 2010, 12:49:24 AM »
Code: [Select]
;;; copy multiple
(defun C:CM  (/ ss)
  (if (setq ss (ssget))
    (vl-cmdf "_.copy" ss "" "_m"))
  (princ))

litss

  • Guest
Re: Why (command "copy") can't act as the same as "real" copy?
« Reply #6 on: July 01, 2010, 12:55:02 AM »
Actually I don't mean to find a way to deal with "copy" only, I need a common way to deal with all commands. Just don't want to revise the PGP file.
Here's the frame of my routine:
Code: [Select]
(defun c:test ()
(setq cnamlst (list '("copy" "c") '("move" "v") '("find" "ff") ...));setq
(setq n 0)
(repeat (length cnamlst)
(setq Fname (car (nth n cnamlst)))
(setq Sname (last (nth n cnamlst)))
(eval (list 'defun (read (strcat "c:" Sname)) '() (list 'command Fname)));eval
(setq n (1+ n))
);repeat
);end of defun

Apparently, the (command ...) couldn't work right as the real command. I just don't know how the "PGP" file do the renaming.
« Last Edit: July 01, 2010, 12:58:05 AM by litss »

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Why (command "copy") can't act as the same as "real" copy?
« Reply #7 on: July 01, 2010, 01:31:09 AM »

It will be quicker and safer to add the alias's to the end of your pgp file ..
believe me.

Simply have your personal alias's in a file that you can paste onto the end of the default PGP, you DON"T need to edit the pgp entrys.


and further ;
if this is for sharing, keep your users happy by NOT overriding their accustomed shortcuts
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

alanjt

  • Needs a day job
  • Posts: 5327
  • Standby for witty remark...
Re: Why (command "copy") can't act as the same as "real" copy?
« Reply #8 on: July 01, 2010, 08:50:31 AM »
I just have short LISP routine that keeps all my pgp aliases and appends them to the end of my acad.pgp. This way I can run it once and never fuss again.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

litss

  • Guest
Re: Why (command "copy") can't act as the same as "real" copy?
« Reply #9 on: July 01, 2010, 09:38:50 PM »
Well, Kerry, alanjt, U r right. I should make some small revision.

It's easy to add aliases to the PGP file by a short routine, but it's hard to automatically delete them while shutting down the AUTOCAD. Maybe I have to manually run another routine to do the delete.

I make this routine just for some one who may use others' computers temperately and don't wanna change the owner's accustomed shortcuts. When it is needed, just drag the lsp file into the CAD. While closing, nothing changed.