# Generate Specific Labels

Navigation: Appendix > Advanced Topics > Advanced Tool Topics >

# Generate Specific Labels

Show/Hide Hidden Text

Normally when you use a custom tool, the results are assigned labels just the way they would be if they were constructed in any other way. But sometimes you may want to control the labels that are used for the results of a custom tool. There are two types of labels you can specify when you make the tool: constant labels and variable labels.

| Set a Constant Label

A result with a constant label is assigned the same label every time the custom tool is used. For example, a particular line produced by a tool might always be labeled Mirror. To set a constant label for an object before you make the tool, use the Label panel of the Properties dialog box for the sketch object that should have the constant label. Enter the desired label and check Use label in custom tools.

To set a constant label for a tool object after you make the tool, use the Custom Tools menu to show the tool’s script view. Double-click the step corresponding to the resulting object that you want to have a constant label. On that object’s Label panel, enter the desired label and check Use label in sketches.

| Set a Variable Label

When a tool has a result with a variable label, the label of the resulting object in the sketch is set based on the labels of other objects — objects that correspond to givens or other results of the tool. For instance, you can create a centroid tool that labels the centroid of a triangle based on the labels of the vertices of the triangle.

A variable label specifies how the labels of the givens and other results of the tool should be used in constructing the desired label. To specify that a particular label should be used, start the label with an equal sign (=) and enclose in curly brackets the numeric index of the object whose label should be used. The number of an object is its position in the tool’s script view, starting with 1 for the first given. If a tool has three givens, the givens are numbered from 1 to 3 and the number of the first step is 4.

For example, the following variable label combines the labels of the first and second given objects of the tool:

={1}{2}

As a second example, if you create a tool to construct the centroid of a triangle, you can set the resulting centroid’s label so that, if the tool is used on points A, B, and C, the centroid is labeled G ABC. To accomplish this, set the centroid label in the tool to

=G[{1}{2}{3}]

Square brackets in a label indicate that the portion of the label within square brackets should appear as a subscript.

To set a variable label for a tool object, show the tool’s script view using the Custom Tools menu. Double-click the step that should have the variable label to show its Properties. On the Label panel, enter the desired label and check Use label in sketches.

When you create a variable label for a resulting object, be sure to specify in the curly brackets only objects on which the labeled object depends. Otherwise it’s possible that the labeled object will be produced before one of the objects that determines its label, and the variable label will not be created correctly.