You need to use the Part Editor interface, which is documented in the Library Manager and Library Editors automation manual.
The Part Editor interface includes a symbolreference object that lists the pins, and a pinmapping object that keeps track of gates and slots.
Thank you john for your answer,
I know this object and I used it, but it doesn't give me all the information I need.
I can see the pin names but not the numbers.
I'm also trying to read the data I see in the symbol editor - pcb properties: parts number (=number of gates), ref designator and the pin number.
Also I first need to find the symbol in the library before creating the part. This is a preliminary request for the operation.
When trying to access the symbol partition, I only succeeded in going throw the different partition but not the symbol object.
For example, in this code, the application doesn't enter the first IF clauses (sym is null)
For Each symPartition In appObj.ActiveLibrary.Partitions(MGCLMObjectType.kSYMBOL)
For iSym = 1 To symPartition.Count
Dim sym = symPartition.Item(iSym)
If sym IsNot Nothing Then
If sym.AssociatedParts.Count = 0 Then
Debug.WriteLine("Symbol " & sym.PartitionName & ":" & sym.Name & " has no associated parts")
I used the example given in the automation manuale "Part pin mapping definition". It's almost all I have to do, but it should be based on existing symbols. So I need to be able to find them and extract all the data I need for the mapping.
Please refer to Creating PDB’s for Dx Symbol library from DxDatabook
There is no automation interface to read symbols directly, you need to choose one of the following approaches:
- read the ascii file
- place a symbol onto a schematic then use DxDesigner methods to loop over attributes and connections
- use TCL script in Symbol Editor
The script referenced above parses the ascii file, but I would recommend approach number 2 instead.
Not sure why symPartition.Item is returning null, do you have any empty symbol partitions?
Thank you John,
I tried to run the script you gave me throw that link and it crashes all the time (see picture attached).
I tried to follow the code and understand what it does.
From what I understand, it collects the attributes each part has according to the associate library. Then it deletes all parts existing in the LM and create everything from scratch. Is it right?
Unfortunately, since I can't get it running, I can't test it to see if it helps me.
Does option 1 - read the ascii file of the symbol could be something I can based my application?
Is there some documentation of the ascii format?
Is it something that is going to last over the expedition upgrades?
untitled.JPG 38.8 KB
We use the scripts John gave you.
We use the scripts to create a PDB in EE7.9 - we modified the scripts from Mentor to our needs.
Like creating LOG files for each DxDatabook section - adding verbose logging in case of trouble shooting .....
I also modified the script in a second stage just to add new parts or to recreate incomplete parts.
What this script cannot do are attributes like PINSWAP !!!
I did some experimental things for common mode chokes - it worked.
The Script original script uses attributes from EE2005.3 (REFDES, VALUE, PKG_TYPE) these values are comming out from an Access Database.
It take the values an builds a PDB in EE7.9
Make sure the dxdb.vbs and DxDesignerSymbol.vbs are saved to a directory in your WDIR, and make sure every library has the appropriate primary key for the Part Number.
As I mentioned, I would recommend option #2, place the symbol in a schematic to read the properties and connection. The ascii file format is not documented and could become obsolete with any future release.
The PINSWAP attribute is interpreted by the symbol parsing code, see the SymbolBlock.SetSwapGroups function.
The PDB builder uses the swap identifier that is calculated by the SetSwapGroups, namely the SymbolPin.SwapIdentifier property.
It is possible that the some complex PINSWAP expressions may not be supported, but the typical swap expressions should work fine.
Sorry - that I wrote PINSWAP do not work - yes it supports the typical settings. More complex swaps are not supported like [(A,B),(C,D)].
The scripts work pretty fine.