Customizing Toolbars Index:
– Two types of toolbar buttons: Standard vs. Drop Down.
– Understanding the five types of toolbar codes. LABPCM

Two types of toolbar buttons: Standard vs. Drop Down.
There are basically two types of toolbar buttons that we can create as users, Standard buttons and Drop Down buttons. I think these are pretty self explanatory as to what they are, but to create each of them there are some differences.

Standard Toolbars:
Standard toolbars have four parts. See the example below. Green denotes standard parts of the button code. Orange denotes parts of the button code you would customize for each button.

[Frame] Name for this icon shortcut (for the programmer) I’d keep this unique.
Hint=Frame It The hint that will be displayed when the cursor hovers over the icon.
Icon=Frame Name of the bitmap located in Support Files\Toolbars that you want to use for the icon.
M=Frame It What type of Action Code (see section below) is to be used The M= tells Datacad that you want a macro to be activated.

Drop Down Toolbars:
Drop down toolbars are very similar to standard toolbars, with two main differences. First is that drop down toolbars have a drop down count in the first section of the code. The second difference is that it has the drop down sections and that those sections have numbers added to the ends of Hints, Icons, and Action Codes. You can add as many drop downs to your button as you want (I think). Below is the code for the image above.

[MOVE] Name for this icon shortcut (for the programmer) I’d keep this unique.
DropDownCount=5 This tells Datacad how many icons total will be loaded (includes main icon).
Hint=Move drawing entities The hint that will be displayed when the cursor hovers over main icon.
Icon=Move Back Name of bitmap that you want to use for the main icon.

Hint00=Move to front The hint that will be displayed for the first dropped icon.
Icon00=Move Front Name of bitmap that you want to use for the first dropped icon.
A00=^;^F1^S3^ The Action Code for the first dropped icon.

Hint01=Move to back The hint that will be displayed for the second dropped icon.
Icon01=Move Back Name of bitmap that you want to use for the second dropped icon.
A01=^;^F1^S4^ The Action Code for the second dropped icon.

Hint02=Move in front of another The hint that will be displayed for the third dropped icon.
Icon02=Move Front Name of bitmap that you want to use for the third dropped icon.
A02=^;^F1^F0^ The Action Code for the third dropped icon.

Hint03=Move behind another The hint that will be displayed for the forth dropped icon.
Icon03=Move Back Name of bitmap that you want to use for the forth dropped icon.
A03=^;^F1^S1^ The Action Code for the forth dropped icon.

Understanding the 7 types of Action Codes. LABPCMV
There are seven types of Action Codes LABPCMV. Below is a cheap trick for remembering the what each Action Code does, descriptions of each type and where to find the codes that apply to that type.

L = (Little): I call these little because they are the simplest toolbar buttons to create and it starts with a L
A = (Active): Active codes simulate user clicks and keystrokes.
B = (Browser): Open the Symbol Browser, and directs it to display a specific folder or template.
P = (Programs): Open any Windows program. Supports command line commands.
C = (Call Toolbar): This is a handy one it allows you to replace the current toolbar with a new one.
M = (Macro): Opens a specific macro directly.
V = (Variables): Variable toggles.

L = (Little):
[3D_Explode]
Hint=Explode Menu
Icon=NH-2D Explode
L=105

These just use one number to access internal Datacad codes. Usually these will take you directly to a specific Datacad menu. For example, say you are in the middle of fencing a large complicated area to Copy and you realize need to explode a symbol so you can include a part of it. You can just click the icon of the Explode example I have shown above, and Datacad will take to the Explode menu where you can do a symbol explode. Then when you right click out of the Explode menu, you are returned to the fence command, with all of your previous fence points remembered and you can continue on with the selection.

Get the function codes here-> Datacad Function Numbers

A = (Active):
[Solid Linetype]
Hint=Linetype 2 Solid
Icon=LT Solid
A=^;^S7^F1^S0^

Now these are the big boys (or girls). Active codes allow you to perform complex keyboard sequences. There are a few characters that are very handy and used repetitively so we are going to look at those first.

^ = (Carrot: Shift+6) Each command in a sequence is separated by a ^.
; = (Semi-Colon) This symbol sets the Datacad menu to the Edit Menu.
: = (Colon) This symbol set the Datacad menu to the Utility Menu.
$ = (Dollar Sign) This acts just like you hit the Enter key. Used when prompted for a name.

For active codes, there are different methods to create these sequences. Here’s how I figure out what my code needs to be. I Start Datacad up, and have toolbar setup ready for the code. Say you want a button for Move, Drag by Area.

Move Drag Area code: A=^;^F1^F1^F3^

Steps to create the code.
1. You must always start the code with a ^
2. Next use the ; to make sure Datacad goes to the Edit menu to start the sequence. The ^ is to separate the commands.
3. Now in Datacad Edit Menu, F1 is Move. I add F1^ to my line of code and Hit F1 in Datacad.
4. If you look at the Datacad Menu F1 is now Drag, so I add F1^ to my line of code, and hit F1 in Datacad.
5. If you look at the Datacad Menu F3 is Area, so now we add a F3^.

That’s it. Hopefully you can see the main thing to keep in mind is that you are just writing down what F# keys you are hitting to get where you want Datacad to take you, and separating them with a ^.

During any sequence in an action code, you can call on extended characters to take you directly to specific commands. get a list of the commands here -> Datacad Extended Character Codes Usually these codes will toggle a setting or value. Check out the list and see how you can use them to change user input settings, and other handy tasks.

The next five types of Action Codes are pretty easy to create. Symbol Browser, Program, Macro & Variable action codes basically just point to a path or code. See the examples below.

B = (Browser):
Browse by Folder
[Symbols Keynotes]
Hint=Keynotes
Icon=Keys
B=S:\Symbols\Keynotes

Browse by Template
[Templates Keynotes]
Hint=Keynotes
Icon=Keys
B=T:\Templates\Keynotes.tpl

P = (Programs):
[Program Launch]
Hint=Simpson Catalog
Icon=Simpson
P=
C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe
or with program specific switches
P=C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe /A page=4 C:\My Documents\Datacad\Help\Simpson.pdf

M = (Macro):
[ClipIt]
Hint=Clip It
Icon=Clipit
M=ClipIt

C = (Call Toolbar):
[2D Toolbar]
Hint=Load 2D Toolbar
Icon=2DTB
C=2DToolbar

V = (Variable):
[Symbol Browser On]
Hint=Turn Symbol Browser On
Icon=SB
V=1010

Get values for variables here -> Datacad Extended Character Codes

« »