undefine \ redefine AutoCAD standard commands

undefine \ redefine AutoCAD standard commands

Moshe-A
Mentor Mentor
1,374 Views
9 Replies
Message 1 of 10

undefine \ redefine AutoCAD standard commands

Moshe-A
Mentor
Mentor

Hi Guys,

 

Many of us here knows that one can undefine\redefine an AutoCAD standard commands but still can be invokes by using the dot prefix. lately i encounterd some applications that disbales standard AutoCAD commands totally

i mean even trying to invoke it with dot prefix. maybe it's an objectarx \ net application?

 

can someone here elaborate on this, can it be done with VisualLISP\ActiveX?

can a user temporary override this? (if he wants to invoke the native command)

 

thanks in advance

Moshe

 

 

0 Likes
1,375 Views
9 Replies
Replies (9)
Message 2 of 10

scot-65
Advisor
Advisor
Perhaps check using ATOMS-FAMILY
then REDEFINE if not present in the
returned list of strings (using MEMBER)

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 3 of 10

john.uhden
Mentor
Mentor

Are you sure that they are AutoCAD commands, or maybe just command functions?

Otherwise, I don't get it.

Is the command DDATTE?

John F. Uhden

0 Likes
Message 4 of 10

Moshe-A
Mentor
Mentor

yes i very sure

the commands are purge, textedit, ddedit

 

 

 

0 Likes
Message 5 of 10

dgorsman
Consultant
Consultant

I believe it's possible in managed dotNET, where you monitor the CommandWillStart event, and veto the command.  While there is a similar reactor for LISP, I'm not certain you can actually stop the command from there.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


0 Likes
Message 6 of 10

Moshe-A
Mentor
Mentor

 

thank you, can a user temporary override this, if he wants to invoke the native command.

0 Likes
Message 7 of 10

pbejse
Mentor
Mentor

 


@Moshe-A wrote:

... lately i encounterd some applications that disbales standard AutoCAD commands totally..

 

 

*Off-topic* [ related to ]

During these past two weeks, our office experience a weird behavior with Autocad 2017 [ and only in 2017 ],  native commands like Opensheetset does not work and even ctrl+4 won't even bring up the Shee Set Manager panel. and to top it off, drawing files won't even open at all.

 

We ended up using "Reset Settings to Default" any ideas? 

 

BTW: It all started when one of the users started using Autocad 2018

 

Appreciate any help

 

 

 

0 Likes
Message 8 of 10

dgorsman
Consultant
Consultant

@pbejse - bundles would be my first thought.  While they may install from a specific version, they can be set to load in multiple versions.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


0 Likes
Message 9 of 10

doaiena
Collaborator
Collaborator

The "CommandWillStart" reactor in lisp can intercept a command and execute your own custom code before it, but it can't redefine/veto the command within the same event.

 

The AutoLisp reactor works like this:
(command "._LINE")

(Place your code here:)
(Continue execution of "._LINE")

You can also exit the current command within your code and execute another one in its place:

(defun ReactorFun (Reactor lst)

 (if (= (car lst) "LINE")
 (progn
 (vla-SendCommand (vla-get-activedocument (vlax-get-acad-object)) "(command) ")
 (alert "Execute custom command here")
 ))
)

(if (not CommandReactor)
 (setq CommandReactor (vlr-command-reactor nil '((:vlr-commandWillStart . ReactorFun))))
)

 

0 Likes
Message 10 of 10

pbejse
Mentor
Mentor

@dgorsman wrote:

- bundles would be my first thought.  


Thank you dgorsman, I will look into that.

0 Likes