Blog   Store   GoToMeeting  

Creating Custom Symbols in SOLIDWORKS

(2 votes)

When thinking of symbols in SOLIDWORKS, your first thought may be blocks, or it may be symbols attached to a string of text. This blog will focus on symbols associated with text, inserted as a note. Specifically, we will discuss how to create your very own custom symbols.

Let’s start off easy with basic symbol insertion. We will assume you know how to insert a note into a SOLIDWORKS document. Once you have clicked the Note command and clicked somewhere to position the text box and are ready to start typing, you will gain access to the Add Symbol command, shown in Figure 1.

Figure 1: The Add Symbol command.

Clicking Add Symbol opens a pane with some Geometric Tolerancing symbols available for quick access. You may see something other than Geometric Tolerancing symbols as SOLIDWORKS remembers the category used previously. If these do not meet your needs, click the More Symbols… link at the bottom of the pane to gain access to a wide variety of symbols and flags, otherwise known as the Symbol Library, shown in Figure 2.

Figure 2: The Symbol Library.

Notice the “File location” text near the bottom of the Symbol Library window. This is the path to the Symbol Library file. Your path may be slightly different depending on where you installed SOLIDWORKS. The name of the Symbol Library file is “gtol.sym”. It is a standard text file and can be opened in Windows Notepad.

WARNING: Make sure to save a copy of the gtol.sym file for safe keeping. Rename the original (to something like gtol-original.sym, for example) and save the copy with the name gtol.sym. The file must have this name to be recognized by SOLIDWORKS.

If you were to open the gtol.sym file in Notepad, you will notice instructions which indicate the formatting options for defining symbols, along with information on units and something called the symbol “grid space”. The instructions are fairly vague, but thankfully there are plenty of existing symbols that can be helpful in learning the code, or adapted to creating custom symbols.
Think of the grid space as a 1 x 1 block using a typical Cartesian coordinate system. The x,y coordinate 0,0 would be at the bottom left corner, and the x,y coordinate 1,1 would be at the top right, as shown in Figure 3.

Figure 3: A symbol's "grid space".

Now imagine you wanted to create a symbol that looked like a giant X with a circle in the middle, such as that shown in Figure 4.

Figure 4: Creating a symbol.

The formatting directions in the gtol.sym file tell us the following:
;;        #<Name of library>,<Description of library>
;;        *<Name of symbol>,<Description of symbol>
;;        A,LINE xStart,yStart,xEnd,yEnd
;;        A,CIRCLE xCenter,yCenter,radius
;;        A,ARC xCenter,yCenter,radius,startAngle,endAngle
;;        A,SARC xCenter,yCenter,radius,startAngle,endAngle
;;        A,TEXT xLowerLeft,yLowerLeft,<letter(s)>
;;        A,POLY x1,y1,x2,y2,x3,y3
;;        A,BOUND x1,x2

The semi-colons are there to “remark out” the notes. In other words, any lines with semi-colons in front are considered comments and are there for your reference only. They do not actually contribute to the symbol library.
First, we need to create a place in our library file for our own custom symbol. Navigate (scroll) to the bottom of the file and add some semi-colons and comments for your own reference. Perhaps something like this:
;;            My very own Custom Symbols!

Next, we need to give this category of the library a unique name and description. In the following line, “DC” is the category name and “Dave’s Custom Symbols” is this category’s description. The category name must be unique when compared to other categories in this same library file. If there’s any question of whether another category with that name already exists, use Notepad’s “Find Command” to see if that category name already exists.
#DC,Dave’s  Custom  Symbols

The next line must be the name of the symbol, followed by a description. The name must be unique within this particular category. In the following line, “1” is the symbol name and “X with a circle” is the symbol’s description.
*1,X with a circle

Now we get to the fun part. We need to draw two lines and a circle. Look back at the formatting directions for a line and pretend you’re drawing in the 1 x 1 grid space. The x,y coordinates represent the endpoints of the line being drawn. The code for both lines will look like this:
A,LINE 0.1,0.1,0.9,0.9
A,LINE 0.9,0.1,0.1,0.9

Finally, we need to draw the circle. Reviewing the formatting directions for a circle, we find it is necessary to define the center and radius. Therefore:
A,CIRCLE .5,.5,.3

When we enter it all in at the bottom of our gtol.sym file, it should look like this:
;;            My very own Custom Symbols!
#DC,Dave’s  Custom  Symbols
*1,X with a circle
A,LINE 0.1,0.1,0.9,0.9
A,LINE 0.9,0.1,0.1,0.9
A,CIRCLE .5,.5,.3

Save the gtol.sym file to the proper location which we discovered earlier and whose path was shown in Figure 2. Remember to save a backup copy of this file in its original state just in case! Then, restart SOLIDWORKS.
Go right ahead and insert a note and test out your custom symbol. If you were following along with this example, you should see something similar to what’s in Figure 5.

Figure 5: Our newly created custom symbol.

Notice the new category has taken on whatever name you gave it. Likewise, so has the symbol. You will see its name if you mouse over it. The symbol description “X with a circle” appears, along with the full symbol name of DC-1, which we now understand is the category name followed by the symbol name and is this symbol’s unique identifier.

Some of the formatting options can be a bit difficult to decipher. In those cases, try to find an existing symbol that is already close to what you want, and adapt the lines of code to fit your own needs. Also, be forewarned that some symbols extend beyond the 1 x 1 grid space. This is typical of some flags that are meant to surround text, rather than exist in a line of text.
Have fun creating your own symbols, and most importantly, Happy Modeling!

Last modified on Wednesday, 28 June 2017 09:20

Training Schedule

Seminars & Events

Available Training Courses

CADimensions offers a wide range of SOLIDWORKS Course Training

Register for CADimension's Newsletter:


CADimensions, Inc.