Is there a net attached to the power symbol? Are you adding the net through automation also, or is the user connecting the net interactively?
I am adding the net programmatically.
This came about as a result of the need to create schematics for 2 old backplanes that were netlist driven BS designs. They both have approximately 2800 connector pins. I did not want to have to type in 5600 net names, so I am working on a script that will do this. I add the connector pin, then the net, then either an offpage, voltage global, or ground global. So I have the net name, and a separate list of power and ground nets. For each net I place, I cycle through the power and ground net lists to see if the given net is a match for any power or ground net, then place the symbol accordingly.
See the attached image for an example.
So with the netname, I place the user global, then try to change it's 'Global Signal Name'. That's where I'm running into trouble.
Thanks for the quick reply and any help you can give,
place_nets.jpg 69.4 KB
Try doing things in the same order interactively, and you will see that the net will be renamed to the Global Signal Name property value.
Instead, you could add the net after setting the Global Signal Name property.
If that is not possible, add a label to the net (or set the label's TextString property) after you set the Global Signal Name property.
The problem is not that the net name changes. I want to make the global signal name the same as the net name, because I already know that that pin needs to be attached to that net from my existing netlist. I could just leave the global symbol off entirely, and the new netlist would be fine, but visually it would not be correct.
I already know what I want the global signal name to be, I just can't make it so. It actually looks right; if I select the symbol after doing this, it will show the correct net name next to the 'Global Signal Name' property. But something is still wrong because the new netlist I generate from this schematic still shows some of these pins tied to USER_GND or USER_V.
So my question really is: How do you change the value of 'Global Signal Name' on a user global symbol programmatically?
In my experience, nothing special was needed for setting the Global Signal Name property value.
The only difference is that I supply both the name and value when calling the AddAttribute method:
Set dxdProp = dxdComp.AddAttribute("Global Signal Name=" & net_name, 0, 0, VDVALUEVISIBLE)
Ladies and Gentlemen, we have a winner:
AddAttribute Method (Block Object)
String in the form NAME=VALUE.John, your post correctly shows the syntax of the AddAttribute function, per the documentation snippet above:"Global Signal Name=" & net_name, 0, 0, VDVALUEVISIBLEI mistakenly thought the first item in the command syntax was just the attribute name, not NAME=VALUE. Somewhere along the line I didn't read the instructions carefully enough - probably the first time I used AddAttribute. And then I just kept doing it that way.I'm surprised it worked at all, but in a lot of cases, it did.I'll work this into the script and let you know how it turns out.Thanks very much for the correction.-Patrickps I pasted some HTML code into this post so the formatting is goofy.
It turns out that the syntax of the command doesn't matter. The problem I was having did not go away when I changed that.
But I did get it figured out. What made the difference is that the symbol was made with the Global Signal Name property already attached, and that is not the best way to do it. To get around the problem, I made another global symbol without the property attached. Then in the script, at the schematic level, I add the property. The result of this is that there is only one case of the property on the symbol, and it is selectable and editable.
There is some interesting interaction between the global symbol and the net segment, which I don't quite understand. What ends up happening is that the symbol gets its Name property populated with the global signal name, and this property is then visible near the symbol. And it adds a label to the net segment with the same value. So I have to take a couple more steps to select and hide these. Here is the code:
(this one is for a power net, the symbol is called script_v)
'the following adds the net segment
net = app.ActiveView.Block.AddNet(x, y, x + 175, y, null_pin , null_pin , 0)
'the following adds the net name ( same as the global signal name) to the net then hides it
seg = net.GetSegments.Item(1)
lbl = net.AddLabel(seg, net_name, x + 10, y + 5)
lbl = net.GetLabel(seg) ' the net label I add
lbl.Visible = 0
lbl.Origin = 9
lbl = net.GetConnectedLabel(seg) ' the net label the connector pin (placed before this code) creates on the net when they are attached
lbl.Visible = 0
lbl.Origin = 9
'the following adds the global symbol, gives it the global signal name property, and then hides the extra labels
comp = app.ActiveView.Block.AddComponent("globals:script_v.1", x + 175, y)
attr = comp.AddAttribute("Global Signal Name=" & net_name, x + 175, y + 20, 3)
attr.Origin = 6
comp.Label.Visible = 0 'the Name property of the symbol
lbl = net.GetConnectedLabel(seg) ' the label added to the net by the global when they are attached to each other
lbl.Visible = 0
Thanks to John and Ken at Mentor for their help with this problem.
With this problem out of the way I am able to draw a my entire schematic (nearly 2900 pins, 14 sheets) with just a few mouse clicks. This is a great way to end the week.