The via object has a method called IsPadstackModified that checks if the padstack for the via was modified compared to the original padstack. It also has a CurrentPadstack and OriginalPadstack property that if not equal would tell you that the via padstack was changed. However, I think this would be relative to the local cell library and would not tell you if the user changed the local cell. I think what you would need to do is to examine the Cell via the Central Library (not local library) and compare it with the instance of the cell on the board.
I think you misunderstood something.
The package cell is not change din the local cell database. Al we dis was to run padstack processor, wich changed the vias in the design.
Those vias were part of the package befor the padstack processor run and also afterwards.
The IsPadstackModiefied does not help, because the padstack was replaced but not modified.
What I would need is a IsCellModified (compared to local/central library). SO you are right, I have to compare the cell vias in the design with the local library.
But we have no clue yet. How can we access the local cell database by automation, open the cell here and have a look into it by automation ( no GUI please!)?
Do you have any idea?
Here is a script that gets the cell document from the local database, and compares the via padstack names:
Set pcbDoc = ActiveDocument
Set celled = pcbDoc.CellEditor
Set celldb = celled.ActiveDatabase
For Each comp In pcbDoc.Components(epcbSelectSelected)
For Each cellpart In celldb.Partitions
For Each cell In cellpart.Cells
If cell.Name = comp.CellName Then
Set celldoc = cell.Edit
For I = 1 To celldoc.Vias.Count
Set cellvia = celldoc.Vias.Item(I)
Set compvia = comp.Vias.Item(I)
If Not compvia.CurrentPadstack.Name = cellvia.OriginalPadstack.Name Then
MsgBox "On component " & comp.Name & ", cell via " & cellvia.OriginalPadstack.Name _
& " differs from component via padstack " & compvia.CurrentPadstack.Name
Set celldb = Nothing
Set celled = Nothing
You can see that the local cell database is accessible from the PCB Document object through the CellEditor property. From there, get the active database, and iterate over the partitions and cells to find the right cell object, then call the Edit method to open the cell document. I'm sure this will need work to meet your requirements, but I think it gives some clues on how to get there.
Looks like John was able to get you a sample. FYI: in your MentorGraphics Install directory under release (eg 2007.8EE\docs\pdfdocs\) there is a PDF - "library_editors_auto.pdf" - that should help you with automation for library manager and it's Editors (Cell, Padstack and Part Editor).
We already have an prototype wich works quite good.
The hardest piec of work now will be to test it a little bit more intelligent than John described.
Instead of yust counting the vias we will have to do a comparison of coordinates (local library cell vias and design cell vias)
relative to the cell origin / side /rotation.
This will take quite a while to implement.