Knowledge Base

Knowledge Base
Subject: Auto populate equipment attributes in project equipment database.
Status Resolved
Product WireCAD v8
Product Level PRO
Database Type SQL Server
Build Number (last 4 digits of version) 1381
Upload No file!

Message

Customer
Would it be possible to auto populate the user columns in an projects equipment database?

An example being to populate data for a power schedule:
Maybe by using any Sysname Prefixes set to "PWR" or "UPS" or "PSU" and anything connected to those equipment blocks could populate "User1" Then using the cable destinations from the cable database you could populate "User2"?
26-August-2016 (04:23 PM)
I am not sure that the term "Auto-populate" works here. That is not to say that a function could not be created to do this but there are many rules that would have to be adhered to in order to make this feasible.

The timing of the arrival of the data does not lend itself to automatic creation. Consider that the SysName is always created before the cable data. So in order to pull cable data into user2 we would have to make it part of the cable number process and not the SysName process.

So, to the questions:
1. What SysName prefixes would be used to trigger data in User1 and would the User1 data increment by location or some other condition?
2. What cable port data would be used to populate the User2 field? Are you connecting to a port with the signal type of power or some other distinguishing characteristic?

If you create a truth table that shows what data conditions will be transformed we can talk about setting up a script to do this.
26-August-2016 (07:17 PM)
Support
Customer
It wouldn't need to be all automatic, maybe if it was a function similar to "slup cables" where it was done after the equipment data is layed out and connections made in the project file.

1. The sysname prefixes would be: UPS, PWR, PST. I don't think it would need to increment by anything.
2. The port name would be used to populate User2. Being dependent on the signal type of: PWR.

Is this good enough feedback to move forward? Or would you need a truth table to define the operation request further?
29-August-2016 (11:23 AM)
So we create a function that parses the SysName and if one of the three listed prefixes is found we do what? And once we have done that thing we query the cables database for a cable with the matching SysName and a destination signal type of PWR and put the DestPin data in User2?

What I am missing is how we assign names of some sort to the found UPS, PWR, PST items. In other words what happens when there is more than one UPS what is its plug count capacity? how do we know we have reached capacity and how do we increment the count accordingly? Hence the truth table.
29-August-2016 (01:46 PM)
Support
Customer
Ok I see the problem with what I described above if there is more than one of each UPS / PWR or PST. Pulling sysname prefixes may not be the way to go about this.

Maybe this operations should be done from the project cables database instead:

-filter for cables with "PWR" signal type.
-populate User1 with SrcSys
-populate User2 with SRCPort

29-August-2016 (02:16 PM)
Try this.
1. Create the project with the PWR signal types described above.
2. Copy the attached file to the c:\users\public\WireCAD\WireCAD8\Scripts folder
3. With WireCAD8 open and the project loaded click Plugins>Script Editor/Runner ....
4. Click File>Open and browse to the script file you just placed in the scripts folder.
5. Click the run button |> on the toolbar.

This should find all PWR cables in the cables table and populate User1 and User2 as described above.
29-August-2016 (07:16 PM)
Support
Customer
I think this will work! Thanks.
30-August-2016 (02:30 PM)
Try it for a bit and make sure that the logic is correct.
If it is we can turn it into a plugin which loads automatically and creates a button with a commandline shortcut to launch the function.
The fee for that would be $999.
Here is a link to purchase.

https://www.wirecad.com/index.php?route=product/product&path=72_78&product_id=122
30-August-2016 (03:43 PM)
Support