Lines and blocks/attributes are used to construct “smart” schematic diagrams in AutoCAD Electrical. This raw information automatically finds its way into the WDATA table in the active project’s scratch database file. Further processing and formatting (i.e. time consuming) eventually pushes this data into the finished WFRM2ALL and WNETLST tables. But, with care, this intermediate WDATA table data can be parsed to obtain complete wire network data without the overhead of the additional processing. The format of the WDATA table’s data is briefly outlined here with examples. It may provide benefit in creating custom AutoCAD Electrical applications that have a need for speed.
WDATA table in the overall scheme of things
The project’s wire connection information is pulled into various tables in the project scratch database, processed, and then presented in several forms as separate tables in the project scratch database.
Wire network processing takes place with the scratch database serving as temp storage for raw wire and component connection data (includes WIREFRM2, WIRESEG, WIRENET tables). This is processed into an intermediate wire network result (the WDATA table). Finally, a full from/to version of the data is formatted in a separate operation (table WFRM2ALL and an alternate format WNETLST tables).
The first two levels of processing (pulling in the raw wire and component connection data and then creating the intermediate wire network results) are done automatically by the “running in the background” project database service (i.e. “PDS”). When a drawing in a project is changed, even without QSAVING the drawing, PDS will eventually recalculate all wire networks and update through to the WDATA table.
The “final”, full form of the wire from/to data in tables WFRM2ALL and WNETLST is derived from this WDATA table’s data. These two new tables only update if user does a full rebuild with wire connection option checked or invokes some ACADE command that requires full from/to wire data (ex: panel footprint annotation with schematic wire connection data or a project-wide wire from/to report).
This WFRM2ALL/WNETLST table update can be a bit time consuming whereas the data in WDATA is always being updated, behind the scenes, by PDS. With care, complete or nearly comple wire network information can be derived directly from this WDATA table.
WDATA table format
The WDATA table’s data is in a format that is a bit confusing. Some examples will illustrate how to decode it.
Example 1 – simple, single wire connection between two components, all on same drawing, no source/destination arrows involved, no gap/loop involved.
The handle numbers for the entities are hand-drawn in RED.
The entry in the project scratch database file’s WDATA table for this wire network, is reproduced below:
Example 2 – more complex network with two source arrows going to three split-off continuation pieces of the network.
The handle numbers for the entities are hand-drawn in RED and the source/destination arrow SIGCODE values are shown in BLUE.
The entry in the project scratch database file’s WDATA table for this wire network, a bit more complex, is reproduced below. Since there are four distinct pieces of the network tied together with source/destination arrows, there are four records in the database for this overall network.
One record shows two “Source arrow” SIGCODE values. There are three other records in the WDATA table that have matching “Destination arrow” SIGCODE values. This means that these three records tie into the first record, forming one big wire network.
The breakdown of each of these four records for wire number “1” is the same as described in the first example.
So, to build up this split-up network stored in four separate records, here is what needs to happen.
Program processes all networks that have neither Source nor Destination codes. What is left will be networks that are split.
Begin with first split network record. Gather up list of Source/Destination codes. Scan all remaining records for others that reference either one of these Source or Destination codes. For each found, add to the list of records that are to be combined into one big network. If other Source/Destination codes are found in these added records, add to the running list and make a second pass to collect any additional network pieces. When no more to add to the list, process the multi-piece list as one big network ( ! )