• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

redefine a command

  • Thread starter Thread starter x11start
  • Start date Start date

x11start

Guest
I would like to create a new version of the command "_bedit" (modifbloc) that allows me, when the blocks with the same name are more than 1 in the design, to warn that the change will affect the change of all the blocks.
to do so I created a command, also called "bedit", but obviously the original command is always called.

if I on the command wrinkle type:
(command "_undefine" "bedit")

... then I load my version of the command .. then everything works.

the problem is that I should launch "_undefine" every time I open the cad ... and do not need to put it in acad.lsp etc.

si-no.zip contains the lisp and its dcl
 

Attachments

it will imply -> will imply ... moreover the command does not have the "rughe" but only the "righe" .... obviously I was not so "lucid" yesterday!
 
your problem is that acad.lsp is loaded only once at the opening of the first drawing.
changes the value of the variable acadlspasdoc a 1 in order to upload it to every dwg file opening
 
I created a small lisp (redef.lsp) composed only by the command:

(command "_undefine" "bedit")

this because the undefine command is only launched once, otherwise by mistake, so I can't enter it in the lisp bedit!

... then through the _appload command, I uploaded redef.lsp and bedit.lsp into the start group.

as you predicted, the thing worked... but only for the 1' file opened: so your suggestion was helpful to change the acadolspasdoc variable.

Thank you.

Let's say that now there is only one small thing: while with the original command it was enough 2 clicks on a block to enter the editor, now it takes 3: I should change bedit to take me as soon as selected, but I would like to keep it compatible with the possibility to launch the command alone... without double-clicking on a block.
 
to delete an input I recommend this replacement:
.... ;(setq :bb) (car (entsel "\nselect the block to be changed"))))(if (setq :bb)
(Sectq :bb)
(setq :bb (car (entsel "\nselect the block to change")))
)
...

for loading in each file do not forget also the existence and operation of acaddoc.lsp file
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top