Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

About macros and what is printed on command line

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
tuomas.einamoV2MEV
528 Views, 4 Replies

About macros and what is printed on command line

I have a macro to toggle UCSDETECT system variable on and off. 

(if (= (getvar "ucsdetect") 0)(setvar "ucsdetect" 1)(setvar "ucsdetect" 0))

 

When I press the button that has the macro assigned into it, what I see on the command line is:

Command:
Command:
Command: (if (= (getvar "ucsdetect") 0)(setvar "ucsdetect" 1)(setvar "ucsdetect" 0)) 1

 

I would like it to be so, that it only says UCSDETECT ->0 or ->1 in the command line, depending on what was the case. 

How could I achieve this? 

I tried to play with (setvar "CMDECHO" 0) but was unable to make it work as I wanted. 

4 REPLIES 4
Message 2 of 5
cadffm
in reply to: tuomas.einamoV2MEV

May i ask why you need that button and [F6] isn't good enough - incl. the information about ON or OFF,

  also the UCSDETECT button in your statusbar, what displays the ON/OFF state too.

 

 

 

Sebastian

Message 3 of 5

Hi @tuomas.einamoV2MEV 

 

I agree with @cadffm. There is already a shortcut key "F6" to turn on/off dynamic UCS. There is also another keyboard shortcut "ctrl+D" to turn on/off dynamic UCS. But if you are not used to keyboard shortcuts then you can copy the macro code from the CUI and create a new command and use that🙂

vinodkl_0-1606296899740.png

 

--------------------------------------------------------------------------------------------------------------------------
ವಿನೋದ್ ಕೆ ಎಲ್( System Design Engineer)



Likes is much appreciated if the information I have shared is helpful to you and/or others.

Please mark "Accept as Solution" if my reply resolves the issue or answers your question, to help others in the community.
--------------------------------------------------------------------------------------------------------------------------
Message 4 of 5

Thanks, didn't remember there is a built-in shortcut for it. 

 

Nevertheless, if there is someone who has information on how to alter the things that are shown on command line when executing a macro, I would much appreciate it. I bet I will come up with a function that doesn't have a built-in shortcut and my ocd kicks in if the command line shows this and that instead of what I want it to show. 

Message 5 of 5
cadffm
in reply to: cadffm

 

This is near by your tried way: Edit the red part

^P(terpri)(princ (strcat "UCSDETECT -> " (itoa(setvar 'UCSDETECT (- 1 (getvar 'UCSDETECT))))))(princ)

 

 

If you really need "your own print out",

you have to start with programming and create your own userdefined commands.

This way you can hide and print out whatever you want (ok, 99.9%)

 

You have one or more folders with you CAD Standard, Tools and so on

You set up your AutoCAD/Profil to load the files&tools you need (search4 ss:startup autoload acaddoc.lsp or Appload Start Suite)

 

one of your codes is

(defun c:USELESSUCSDETECTtoggle nil
(princ(strcat "\nUCSDETECT -> " (itoa(setvar 'UCSDETECT (- 1 (getvar 'UCSDETECT))))))
(princ)
)

 

and your button macro is just:

'USELESSUCSDETECTtoggle

 

Sebastian

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report