Wire Numbers

January 2021

In the previous chapter we created a simple circuit and applied the use of automatic wiring.

In this chapter we'll now add Texts with a special attribute of $wire, and introduce how wire numbers can be automatically numbered through-out an entire project.

Here is how we left our simple circuit...

Adding $wire Texts

Now select the Text tool... 

Then click down somewhere 1 grid step above the top horizontal wire, around midway.

With the Text dialogue that appears, click on the "text" row and enter a "?" (however, if no value is given, "?" will be entered by default after you press [Apply] to complete)...

Then click on the "gene" row...

And with the options dialogue, scroll to and select "$wire"...

Press [Apply] as required to complete... you should now have a "?" located roughly as shown...

Now single-click to select that Text object, then copy and paste it 2 more times to the positions as shown...

These Text objects are placed at your discretion to indicate that the adjacent line is in fact a wire and has a unique reference. 

The Text object does not associate with the line representing the adjacent wire, meaning Circuit does not look for wires then attach numbers, there is no connection between the two types of objects.

So you can place Text objects of the $wire type with any size of font in any position near enough to the line to ensure clarity to your viewer.

Automatic Wire Numbering

The automatic wiring algorithm works from Top > Bottom, and then Left > Right across a sheet, so precise placement of Texts with a gene of $wire horizontally and vertically is critical to the outcome of the automatic wire numbering function.

To get started, choose the menu item of Circuit > Number Wires...

The Wire Numbering dialogue will present itself (also, if there are any errors, these will be shown first)...

To number, simply press the [Number] button...

If happy with the results, press [Commit] to write these values into the Text Database. If not, then just press [Close] and no changes will have been made.

Text Location Paths

From the above image of the Numbering dialogue you can see Paths referenced, and as mentioned, this is how the algorithm figures out the numbering sequence.

As an example using "000103000040", the path is comprised of Sheet 0001, X 0300 and Y 0040 - so from this you can determine whether a certain Text object is out of position relative to another - if the visual clue from the sheet is not sufficient.

Numbering Start Point

The sequence we just saw started @ 1 and went through 3. What determines this starting number is a value stored in the Manifest File of the project.

To adjust this, first select the "manifest" node in the project explorer... 

Then right-click and choose "Properties"...

With the dialogue that presents, scroll if required to, and select the $counter variable row...

Quite literally $counter sets the start point of the numbering algorithm, so set a preferred value here.

For an example, change the value to 30 and then press [Apply] to finish. Run Number Wires again and the result will be as follows...

Advanced Wire Numbering

As mentioned, this feature will run through every Sheet in your project and number up any Text object with a gene of $wire.

Of course, it's common for a wire number to carry through over many sheets, for example common 24VDC and 0VDC wires.

To achieve this, Circuit includes certain settings you can configure, and these revolve around "groups".

For an example, let's say we want to have a common + wire from the battery... the steps are as follows...

Ok, let's see how that works in practise... first of all, set an element of main for the primary text object in your design...

Then click on "group" and assign a meaningful alias, for example "+V"...

For every subsequent Text object that is a wire type, through-out the project, assign a group reference to the one you created (and leave the element row blank)...

Note: Ensure that no child Text objects in the same group have any element of main, there can be only one main element!

After a Number Wires run, all Text objects of $wire type and of the same group will have the same number through-out the project - across every Sheet.

Pre-seed A Wire Group Number

Regardless of the $counter value, if you would prefer to assign and pre-seed a particular wire number, for example all +V wires are #200 and all -V wires are #100, then this is possible.

From the main Text object of the group in question, within the Info attribute, use the convention of "*number", for example... click on info...

Then enter a constant using * (asterisk) and then a number, for example...

Press [Apply] to complete. All subsequent Number Wires runs will now enforce any Text object with the same group reference to embed that number through-out the project.

Should the $counter value hit any pre-seeded number it will skip over it and go to the next available free number.

That's all for Automatic Wire numbering for now.