CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic Closedkeyboard shortcut code

 Post Reply Post Reply
Author
SONGS View Drop Down
Newbie
Newbie


Joined: 18.Apr.2008
Status: Offline
Points: 16
Direct Link To This Post Topic: keyboard shortcut code
    Posted: 02.May.2008 at 18:06
Hi again. If the help files were more helpful I wouldn't keep asking you nice folks so many questions.
 
I'm using AutoCAD 2007. I would like to Record a macro but there doesn't seem to be that option. (I see I can write my own however.)
 
So in lieu of that Id like to create a couple of keyboard shortcuts.
 
One, I'd like to set Ctrl+W to do the following menu choices:
 
go to Tools\Named UCS... then select World, choose Set Current, click OK. Then go to menu View\3D Views\Plan View\Current UCS
 
And 2, I'd like Ctrl+Shift+W to go to:
 
Tools\Named UCS... select Called North View, choose Set Current, click OK. Then go to menu View\3D Views\Plan View\Current UCS
 
Problem is that I don't know how to write the code properly in the Tools\Customize\Interface box to make it work.
Any suggestions?
Thanks.
Back to Top
Vladimir Michl View Drop Down
Moderator Group
Moderator Group

Arkance Systems CZ

Joined: 26.Jul.2007
Location: Czech Republic
Using: Autodesk software
Status: Offline
Points: 2124
Direct Link To This Post Posted: 02.May.2008 at 21:17

The "macro recorder" function was introduced in AutoCAD 2009.

You can assign almost any keyboard shortcut to a user macro. The macro can be defined exactly the same way as you type the command and its options on the commandline - e.g. _UCS _World

Vladimir Michl (moderator)
ARKANCE - https://arkance.world - Autodesk Platinum Partner
Back to Top
SONGS View Drop Down
Newbie
Newbie


Joined: 18.Apr.2008
Status: Offline
Points: 16
Direct Link To This Post Posted: 02.May.2008 at 21:27
I've tried that. It tells me it's an unknown command in the macro mode. On the command line it works but only shifts the X-Y axis lines, it doesn't change the view of the map.
 
The way I wrote the steps in the first note is what I normally have to do to change views. It's a bit cumbersome hence my reason for wanting a shortcut.
Back to Top
SONGS View Drop Down
Newbie
Newbie


Joined: 18.Apr.2008
Status: Offline
Points: 16
Direct Link To This Post Posted: 02.May.2008 at 22:03
Is there somewhere in the help files where it tells the syntax of writing a macro? And the allowed codes and commands used in a macro?
Back to Top
Vladimir Michl View Drop Down
Moderator Group
Moderator Group

Arkance Systems CZ

Joined: 26.Jul.2007
Location: Czech Republic
Using: Autodesk software
Status: Offline
Points: 2124
Direct Link To This Post Posted: 02.May.2008 at 23:38
A macro is just a plain string of the same characters you would type in the command line. No special codes, no special commands.
Vladimir Michl (moderator)
ARKANCE - https://arkance.world - Autodesk Platinum Partner
Back to Top
RichardBlank View Drop Down
Newbie
Newbie


Joined: 02.May.2008
Location: United States
Status: Offline
Points: 2
Direct Link To This Post Posted: 03.May.2008 at 16:52
Originally posted by Vladimir Michl Vladimir Michl wrote:

The "macro recorder" function was introduced in AutoCAD 2009.

You can assign almost any keyboard shortcut to a user macro. The macro can be defined exactly the same way as you type the command and its options on the commandline - e.g. _UCS _World

 
Thank you for the helpful information Vladimir . I was having issues as well.
 
 
Richard
 
 
.
Richard Blank
CEO
Costa Rica’s Call Center
ceo@costaricascallcenter.com
www.costaricascallcenter.com
888-271-6750
Back to Top
SONGS View Drop Down
Newbie
Newbie


Joined: 18.Apr.2008
Status: Offline
Points: 16
Direct Link To This Post Posted: 05.May.2008 at 15:13
Ok, but I've seen that things like semicolons mean the code does one thing while a backslash does another and a colon does yet another. So it seems there might be more than just "a plain string of the same characters you would type in the command line. No special codes, no special commands" that one must know. There are things that you can do that I can't find in the help files. (I know, it's silly of me to think the help files are there to actually help. Smile )
 
And some things I can do from the keyboard don't seem to work all the way in a macro. For example, here's a bit of code that works part-way:
 
^C^C_ucsman 0;alt+V;alt+3;alt+P;alt+C;
 
It seems to work ok until it gets to alt+C, then it says alt+C is an unknown command. Alt+V is the View menu, alt+3 is the 3D Views option, alt+P is the Plan View option and alt+C is the Current UCS option. It all works from the keyboard but not the macro. And I'm assuming the ";" means Enter?
 
And while the above code is shorter than doing it all manually, I'd still like to find a way to automate the input from the _ucsman 0 box also. I do a lot of switching between 'World view' and our 'Called Plant North' view. So if I could do it all from one keyboard shortcut, like Ctrl+Shift+W, it would save a lot of time.
 
Thanks again for any input.
Back to Top
Vladimir Michl View Drop Down
Moderator Group
Moderator Group

Arkance Systems CZ

Joined: 26.Jul.2007
Location: Czech Republic
Using: Autodesk software
Status: Offline
Points: 2124
Direct Link To This Post Posted: 05.May.2008 at 15:21
For plain command sequences it is like that - no special commands, no special codes. As an added value, you might replace <ENTER> by ";" and you can break the macro execution with "\" to wait for user input. And yes - in those rare situations where you would use a Ctrl-key combination in AutoCAD, you type "^" in macros (e.g. ^C).
 
Plus there is a macro language called Diesel where you can use conditional statements, simple string and arithmetic operations, etc.
Vladimir Michl (moderator)
ARKANCE - https://arkance.world - Autodesk Platinum Partner
Back to Top
SONGS View Drop Down
Newbie
Newbie


Joined: 18.Apr.2008
Status: Offline
Points: 16
Direct Link To This Post Posted: 05.May.2008 at 16:24

Ah, I see. I guess the only other thing then is, can you tell me why, in the code

 

^C^C_ucsman 0;alt+V;alt+3;alt+P;alt+C;

the alt+C doesn't work? The rest seems to work but not that. TIA
Back to Top
Vladimir Michl View Drop Down
Moderator Group
Moderator Group

Arkance Systems CZ

Joined: 26.Jul.2007
Location: Czech Republic
Using: Autodesk software
Status: Offline
Points: 2124
Direct Link To This Post Posted: 05.May.2008 at 21:48

"alt+C" is nothing more than "a", "l", "t", "+" and "C" keys as typed...

You cannot control dialogs from menu macros.

Vladimir Michl (moderator)
ARKANCE - https://arkance.world - Autodesk Platinum Partner
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,305 seconds.