Advanced Drawing Tools

A few weeks ago, I hosted a live stream taking a closer look at the drawing tools. Making this the perfect time to talk a bit more about the more advanced aspects of the drawing tools and how to utilize them properly and explaining a few things in more detail than appropriate for a stream.

Examples of advanced use of drawing tools is to draw aligned fills, drawing a path and have symbols placed along it or drawing a polygon and having it filled with randomly placed symbols. Basically, a lot of the things you can do using multiple steps with regular CC3+ commands can be automated and streamlined by making a drawing tool for it.

For this article, I am going to skip the basics. I am going to assume that you already know how to make new drawing tools and modify existing ones, and are aware of the standard settings you can do with a drawing tool, such as fill, color, sheet, layer and outline. I’ll add the usual word of warning though; don’t modify the official drawing tools, make copies and modify these. Each tool is stored in each own file, and when you make changes and save them, that file is updated. These are advanced tools, not simple settings, and as such, there aren’t a “reset to default” button you can click if you mess up.

Macro Drawing Tools basics

Creating an advanced drawing tool does include making a macro for the tool, but most of these macros are very simple boilerplate code that can just be pasted in and subtly changed, so don’t be afraid just because the word macro is mentioned. I’ll show you these basic macros here in this article.

There are a few minor issues when making tools with macros you need to be aware of, so let us just get these out of the way. All of these are related to the fact that the macro is stored in a separate file, and changes to this file isn’t properly detected by the dialog box:

  • You won’t be asked to save the changes if you have only changed the macro. So remember to manually hit that Save button in the drawing tools dialog after editing the macro.
  • When creating a new tool, it may still show the old macro from the previous tool. To make sure you are editing the right file, this is my recommend procedure when creating a new macro tool: Start by hitting the New button in the drawing tool dialog, give the tool a name, and hit OK. Now, start by clicking on a different tool, the click back to your new tool. This ensures things are loaded correctly. You can now hit the command to execute button, and if there is already some text in there, you can safely erase it and replace it with your new macro. Once you close the macro editor, remember to click save. If you’re the kind of double-checking person like I am, you can check that your new tool contains the appropriate macro by clicking on another tool in the list, and then back to yours, and then just look at the macro. It will be the right one, as long as you remembered to hit that Save button earlier. I know some people have been confused and feeling CC3+ didn’t save their macro properly, but if you follow these steps, everything should work perfectly.
  • When going back in to edit an existing macro tool, if this is the tool selected by default in the dialog, select another tool first, then click back to the tool. As above, this ensures that the correct macro is loaded into the editing box. You should do this even if you are not going to edit the macro text, for example if you wish to edit one of the default properties like color.
  • Drawing tools with a macro won’t have a preview. To fix this, make a regular CC3+ map to be used for the preview (it should be a very simple drawing just showing the result of the tool, don’t include things like borders or background), name this file the same as your drawing tool, and place it in the same directory as the tool. The tools are all stored in @system\drawtools\styleName\. Of if you are making a new tool for the standard CC3+ Mike Schley overland tool called “Black Cat”, the tool will be stored as @System\Drawtools\Overland Mike Schley\Black Cat.dto, the accompanying macro file would be called @System\Drawtools\Overland Mike Schley\Black Cat.dtm, and your preview drawing should then be @System\Drawtools\Overland Mike Schley\Black Cat.fcw.
  • When writing the macro, always make sure there is exactly one blank line below the macro, not more, not less. If there isn’t a newline after the last command, it won’t be run, only shown on the command line waiting for the user to hit enter to start it, and if there are more than one, then CC3+ treats a blank line as an instruction to repeat the previous command, and this means the previous command in the macro box, not starting the entire tool over from the beginning. The only reason to have more than one blank line at the end is if the very last command is a command that needs a blank line of input to terminate. For example, the polygon command continue asking for points until you give it a blank input which tells the command that you’re done. So for these special cases, you would have the first blank line to terminate the command, and then the second for the last line in the macro. (And for the record, when I say one blank line at the end, it means you can move the text cursor down to the line beneath the text, but not any further.)

When to apply the macro

To enable a macro command, just check the Use Macro Command checkbox. This enables the Command to execute button to allow you to edit the macro, and completely replaces the rest of the drawing tool. In other words, with this option enabled, you don’t get to draw anything using the regular features of the drawing tool, only the macro is executed.

But, if you also check the Apply macro after drawing checkbox, the macro is instead applied AFTER you have drawn with the drawing tool the regular way. This allow you to draw a shape, and have the macro do something with it. This is the most common use of macros in drawing tools, and are used for example for the forest drawing tool, where you first draw the area the forest should occupy, and then the macro fills it with trees.

Creating the advanced tools

So, let us look at several advanced tools. We’ll be quickly looking at how you can do this in CC3+ without the use of a drawing tool, and then how to set up a tool to use it.

Drawing a forest

CC3+ comes with the Fill With Symbols command [FOREST], and while it can technically fill an area with any symbol, it is best suited for forests due to the fact that it is primarily designed to pack symbols together tightly.

To draw a forest in CC3+ manually, you need to start by drawing a polygon (for example by using Smooth Poly ). Then you can start the tool from Draw -> Fill With Symbols. This bring up the configuration dialog where you can set you options, and when you click Run now, CC3+ will ask you to pick a polygon to be filled, and that’s it. However, for use with a drawing tool, we don’t want to see that configuration dialog every time. And this is where the Load and Save buttons in the dialog comes into play. Using this dialog, you can create your own forest setting, and save it to a file, which we can easily load in the drawing tool macro later. I won’t explain how to use the dialog here, that is a bit out of scope for this article, but if you own the Tome of Ultimate Mapping, it is explained more in depth there, along with the dialog from the other commands in this article. But, the general idea with these dialogs is that you can spend the time to try out different settings, and when you have found the setting you want to use for your drawing tool, save the setting to a file. This way you can experiment with the command and get things right first.

Now, once you have saved the setting you like to use to a file, you can create a new drawing tool.

When you create a new drawing tool for use with the forest, you’ll want these basic settings:

Draw Method: Path/Polygon
Options: Smooth
Closure: Closed
Properties: Whatever you want the background behind the trees to be, but ‘Solid 20’ is a nice fill style to just darken the area a bit. Remember to set width to 0 to make a filled poly, and set a proper layer and sheet for your needs
Macro: Both Use Macro Command and Apply Macro after drawing checked

Now, the interesting thing here is of course the macro itself. As I said early, these macros are just boilerplate code that can be copied and pasted. The macro for using the forest drawing tool is simply

FORESTLOAD @system\fillers\CC3_MikeSchley_Jungle.FIL
SELBYP
FOREST

The first line is the line that loads the forest fill. This is the only line in the macro you have to change to point to the fill setting you made. Just change the path, and that’s it.
The second line in the macro, SELBYP, tells CC3+ that when requested to select entities, it should simply pick the last one used instead of asking the user. And that last entity will be the polygon we draw when we use this tool.

The final line is the command itself. This is the macro version of the command, and will just use the current settings instead of showing the dialog. And the current settings, well, they were set on the first line by loading that file. Furthermore, this command requires you to select an entity, but the SELBYP line above has just put CC3+ into prior selection mode, so instead of asking, it will just select the poly the command drew.

You might have seen macro commands also containing the commands SELSAVE and SELREST. These used to be necessary to be able to set the selection method back to what it was before, users tends to be confused if they use a command such as erase, and suddenly the last ting they drew was erased instead of CC3+ asking for you to select something. However, in the latest versions of CC3+, this is now automatic at the end of the macro, so there aren’t a need to manually include these anymore. They won’t hurt anything though. Note that if your selection method is ever off like that, simply typing SELBYD on the CC3+ command line and hitting enter will reset it to the default one.

And, that’s all there is to it.

Filling an area with symbols

This is very similar to the forest command above. The difference here is that we use the Symbols in Area [SYMFILL] command which is suited to fill an area in various ways with symbols. As with the Fill With Symbols, you can find Symbols in Area on the draw menu. Just draw a polygon in your map first to be filled, and then start the command, set the settings you’d like in the dialog, and hit OK. It will prompt you to select an area to be filled. Just as with the Fill With Symbols, you can experiment by changing the config in the dialog and try out various settings until you are happy with them, and when so, just save it to a file to be used with our tool.

The setup of the tool is identical to the Fill With Symbols command, the only real difference is the macro, which is

SYMFILLLOAD @system\fillers\CC3MS_Deadwood.symfill
SELBYP
SYMFILLM

Not much difference from the forest tool here, the commands are different, but the functionality is the same, first line loads the settings, third line runs the command.

Symbols along a path

CC3+ also have the Symbols Along [ESC] command that will draw symbols along a path. This is extremely similar to the symbols in area command, but it has some different options. You’ll find this command in the Draw menu with the others. As with the previous two commands, you can use the dialog to try out different settings, until you find something you are happy with, and then just save it to file. Remember to draw a path before starting the command, because it will ask for one once you exit the dialog.

Again, we see a very similar macro:

ESCLOAD @System\Fillers\CC3MS_Mountains.esc
SELBYP
ESCM

I don’t think this needs further explanations.

Aligned Fills

A completely different approach is used for aligned fills. You have probably already noticed that when you draw a polygon in CC3+ with a bitmap fill, the fill is always aligned the same way no matter if you rotate the polygon or not. But, you can also create aligned fills in CC3+ by using the shaded polygon command. To do this, follow these steps.

  1. Draw a polygon using a bitmap fill style. Make sure the width is 0 so it becomes a filled polygon and not a hollow outline.
  2. Right click the Polygon button, and pick the Shaded Polygon (Angle by Edge) command. Now, click on one of the edges of your polygon to align the fill to that edge. You should see the fill rotate to the new alignment. Right click to finish using the command.
  3. You’ll probably noticing a color change in the fill, this is due to shading being applied. To fix this, use the Numeric Edit command on your poly, and check the Shade only Copy option. All done.

Now, can we make a drawing tool that does the same automatically?

That’s quite easy. start by creating a new drawing tool that draws with the fill you desire. Set any properties you need like sheet, layer, etc. Note that this doesn’t work with outlines, the outline will just seem to disappear.

Now, just check both macro options as before, and add the following macro:

SELBYP
SHADEPOLY 0 0
SETFSFLAGS 192

This macro is even simpler than the previous one, because there is nothing to edit, it will always look like this.

First line should be familiar here, we are using select by prior to select the entity the tool drew whenever a selection is required.

The second line runs the shaded polygon command. The two zeros here sets the angle and the pitch. The angle determines the rotation of the fill, but our next line will change that, so we set it to zero. The pitch is for angled surfaces, like roofs, and determine how they will be lighted, but this isn’t appropriate when we just need a rotation, so we leave it at 0. The SHADEPOLY command expects a selection, but thanks to SELBYP, this will automatically be the shape we drew.

The third line sets the properties for the shaded polygon. 192 is basically a magic number that means that the options for angle it by the first edge, and shade only copy should be enabled. This means that the fill will be rotated using the first edge of your polygon as the base (so it does matter how you draw it). Setting the Shade Only Copy flag means it will only be rotated, not shaded, so it will keep the original coloration like we did manually above.

Macro-only tools

Sometimes, you don’t want to draw anything to be affected, you just want to run a macro to do something for you. And having the macro stored in a drawing tool, which you can then put in the symbol catalog window is a great way of having certain macros easily available. I have several of these ready for processing maps for the community atlas, macros that runs various clean-up commands and things like that in the map. This is a great way to activate a macro.

When the Use Macro Command checkbox is checked, and the Apply Macro After Drawing is unchecked, CC3+ will disregard the drawing step of the tool. It will still respect the set properties, like fill, color, width, layer (but not Sheet; Sheet isn’t really a property on entities, but rather a container for entities), unless overridden in the macro itself.

What you can to with the tools in this configuration is only limited to what you can do with a macro, so I’ll just leave you with the black cat macro I ended the live stream with. This is a very simple macro that first sets up some basic properties (fill, color, line width), and then just call the smooth poly command (SPOLY)  with a LOT of nodes to draw the cat. You’ll notice that I’ve broken the command down over multiple lines. With commands that require multiple inputs, you can separate each input with EITHER a semicolon (;) OR a line break (don’t use both, you can mix and match within a single command, but only one of them between each input, this is why in my macro below you can see that each line is multiple points separated with semicolon, but there is no semicolon at the end of the line, because there I am using a line break).

You’ll also notice that the first argument to the smooth poly command is ^D followed by some text.  All the coordinates in the smooth poly are relative coordinates, i.e. the change in location from the previous node as opposed to absolute coordinates. This is needed to place the cat where you want it instead of a fixed position on screen. This first ^D is a way to actually ask the user for the first node in the polygon. Whenever you need a user to provide input in the middle of a macro, this is done by specifying ^D immediately followed by some explanatory text which is shown to the user on the command line, instead of just providing a value like the rest of the coordinates. So what we end up with here is that we ask the user to place the first node wherever they wish, and then draw the rest of the cat relative to that.

Note that you can easily drop the first few lines that sets up the properties if you just set them up in the drawing tool the normal way instead. I just wanted to illustrate how to do this from the macro here.

LWIDTH 0
FSTYLE Solid
COLOR 0
SPOLY
^DPick starting point
@-0.55094,0.05149;@-0.41707,0.08238;@-0.2523,0.06694
@-0.4943,0.19051;@-0.31408,0.16477;@-0.37588,0.26774
@-0.19566,0.18537;@-0.14932,0.16991;@-0.21111,0.32953
@-0.12872,0.31409;@-0.06178,0.2523;@-0.02575,0.21111
@0,0.31923;@0.02575,0.22656;@0.06178,0.27804
@0.10813,0.32439;@0.19051,0.41191;@0.06179,0.09783
@0.06179,0.53034;@-0.0103,0.35013;@-0.09268,0.47886
@-0.08754,0.77749;@-0.06178,1.06068;@0,0.53549
@0.0103,0.00515;@0.01029,0.40677;@0.04119,0.38102
@0.06694,0.37073;@0.10298,0.31924;@0.12872,0.27804
@0.33984,0.67451;@0.19051,0.33983;@0.40161,0.63333
@0.40162,0.50459;@0.38618,0.36558;@0.35013,0.2317
@0.242,0.10813;@0.30378,0.07208;@0.27805,0.08754
@0.31409,0.14417;@0.19051,0.10813;@0.29349,0.20595
@0.2317,0.19567;@0.33983,0.36042;@0.2523,0.33983
@0.09268,0.16477;@-0.02059,0.14417;@-0.00515,0.2626
@0.01029,0.15961;@0.06179,0.33469;@0.14932,0.45826
@0.2317,0.44795;@0.21111,0.29349;@0.21626,0.21626
@0.24715,0.16991;@0.39647,0.19567;@0.12872,0.10812
@0.07724,0.10298;@0.11842,0.2729;@0.12873,0.24715
@0.26774,0.40161;@0.17507,0.18022;@0.07723,0.05664
@0.09783,0.04634;@0.13902,0;@0.07209,-0.05149
@0.05149,-0.07723;@0.06693,-0.21626;@0.04119,-0.29864
@0.02575,-0.80839;@0.00515,-0.09268;@0.0206,-0.03604
@0.06178,-0.04119;@0.11843,-0.04119;@0.43766,-0.11328
@0.19566,-0.08753;@0.10298,-0.06694;@0.08753,-0.08239
@0.15962,-0.24714;@0.16992,-0.19052;@0.2111,-0.14417
@0.32439,-0.11842;@0.08753,-0.08753;@0.03089,-0.09269
@0,-0.23685;@-0.03089,-0.14417;@-0.08239,-0.20596
@-0.16476,-0.25745;@-0.10813,-0.11327;@-0.15447,-0.12358
@-0.38617,-0.23685;@-0.21111,-0.15447;@-0.06693,-0.08238
@-0.0412,-0.08238;@-0.01029,-0.05664;@0.01029,-0.21111
@0.13903,-0.84958;@0.06693,-0.63847;@0.01545,-0.4943
@-0.0206,-0.37072;@-0.04119,-0.29349;@-0.10813,-0.41707
@-0.16476,-0.36043;@-0.17507,-0.25229;@-0.15447,-0.18537
@-0.2317,-0.33983;@-0.23685,-0.44281;@-0.12358,-0.31923
@-0.08753,-0.40162;@-0.0103,-0.90107;@-0.01029,-0.00515
@0,-1.7455;@0.01029,-0.00514;@0.0103,-0.65392
@0.0206,-0.18536;@0.04119,-0.08239;@0.10298,-0.06693
@0.14932,-0.04119;@0.35013,-0.0515;@0.16476,-0.06178
@0.05664,-0.05149;@0.02575,-0.05664;@-0.0103,-0.18536
@-0.06179,-0.12358;@-0.07209,-0.07208;@-0.10297,-0.05664
@-0.05664,-0.0103;@0.06179,-0.14417;@0,-0.15962
@-0.04634,-0.09268;@-0.09784,-0.08238;@-0.20081,-0.08239
@-0.27804,-0.06178;@-0.30893,0;@-0.24201,0.06178
@-0.15961,0.08239;@-0.22141,0.16991;@-0.17506,0.19566
@-0.08753,0.12358;@-0.14418,0.23685;@-0.14932,0.29349
@-0.29864,0.68481;@-0.02574,-0.20081;@-0.12873,-0.31408
@-0.16991,-0.242;@-0.14417,-0.13903;@-0.10298,-0.06693
@0.41192,-0.02575;@0.33983,-0.06179;@0.21111,-0.08238
@0.10812,-0.07723;@0.06694,-0.07209;@0.04119,-0.07208
@0.02575,-0.09783;@0,-0.13903;@-0.02575,-0.11842
@-0.05664,-0.13902;@-0.11842,-0.06694;@-0.2626,-0.06179
@-0.36558,-0.04119;@-0.35527,-0.0206;@-0.90622,-0.00514
@-1.35933,0.04634;@-1.05038,0;@-0.72601,0.04119
@-0.42736,0.06179;@-0.09268,-0.31924;@-0.0103,-0.31923
@0.05149,-0.24715;@0.07724,-0.16477;@0.15447,-0.21111
@0.08753,-0.08753;@0.18536,-0.14417;@0.25745,-0.14932
@0.38102,-0.15447;@0.2523,-0.07723;@0.40162,-0.08754
@0.43766,-0.06178;@0.33983,-0.02575;@0.88562,0.00515
@0.52519,0.06179;@0.11328,0.03089;@0.42222,0.06694
@0.4634,0.04119;@0.26775,0;@0.18021,-0.0206
@0.13902,-0.04119;@0.04119,-0.02574;@0.0309,-0.04634
@0,-0.03605;@-0.02575,-0.05149;@-0.07723,-0.07208
@-0.28834,-0.16477;@-0.37588,-0.14932;@-0.76719,-0.2317
@-0.40162,-0.08753;@-0.54579,-0.08239;@-0.42221,-0.03089;

 

If you have questions regarding the content of this article, please use the ProFantasy forums. It can take a long time before comments on the blog gets noticed, especially for older articles. The forums on the other hand, I frequent daily.

 

Leave a Reply