Skip navigation

This Question is Answered (go to answer)

82,070 Views 6 Replies Last post: Apr 11, 2012 5:31 PM by nick_hong RSS
patrick.w.johnson Lurker 3 posts since
Dec 20, 2011
Currently Being Moderated

Mar 20, 2012 8:03 AM

Renaming Padstack Names via Script in Library Manager

I am writing a script that renames the padstacks in my library according to the IPC-7351 naming convention.  The script only runs with the padstack editor dialog box open.  It successfully renames the padstacks, but when I close the padstack editor dialog box, the cells no longer are associated with any of the renamed padstacks (cells are missing padstacks).  I tried the same script by opening the padstack editor dialog box in a Expedition design and running the script.  When I close the dialog box, an right-click on any padstack on the design, there is no name on the padstack.  If I open the Cell Editor dialog box in the Expedition design, I get a dialog "Replace Missing Padstacks" where I can associate the new padstack names with the old padstack names.

 

Is there a way to keep this from happening from within the script?  If I manually change the name of a padstack in the padstack editor dialog, the new padstack name is updated in the cell.  But this is not what happens when a script changes the padstack name.

 

Thanks!

jeremy_parker Active 46 posts since
Mar 4, 2009
Currently Being Moderated
Mar 20, 2012 8:06 AM in response to: patrick.w.johnson
Re: Renaming Padstack Names via Script in Library Manager

I had this same problem in the Advance Library Edtior's padstack modificaiton. I had an option to go through and rename padstacks based on the objects that made up the padstack (Pad, hole, ect).

 

Long story short, I couldn't figure out a way around it either...but know you are not the only one.

 

-J

nick_hong Active 20 posts since
Aug 25, 2008
Currently Being Moderated
Mar 28, 2012 7:47 PM in response to: patrick.w.johnson
Re: Renaming Padstack Names via Script in Library Manager

You need to write a routine to scan all cells to assign correct padstack names after renaming the padstack names. I once wrote an Automation script to rename pads(http://communities.mentor.com/mgcx/docs/DOC-2584); the script also have codes to fix pad names assigned to padstacks after changing pad names.

 

Nick

nick_hong Active 20 posts since
Aug 25, 2008
Currently Being Moderated
Apr 5, 2012 6:42 PM in response to: patrick.w.johnson
Re: Renaming Padstack Names via Script in Library Manager

Hi Patrick,

 

Library Manager does not have direct access to each pins of specific cell. Instead, you can modify the pins by steps below.

 

1. Get associated cells using Library Manager Automation -> Use 'Padstack.AssociatedCells'

2. For Each cells found in step 1, open Cell Editor using Cell Editor Automation - Use 'Cell.Edit'

3. In Cell Editor application, replace padstack using PCB Automation - Use 'Document.PutPadstack' & 'Pin.CurrentPadstack = ...'

 

To make it clear, I am attaching two samples, one is for step 1 above and another for step 3.

 

*** Backup your library database before running any script for the first time ***

 

. Pstk2Cell.vbs is to get associated cells. It includes codes to run Library Manager application and open "C:\SampleLib2007\SampleLib.lms"(line 17). So please close all Library application, modify line 17 to indicate your LMC path, and run command as below

   mgcscript ...\...\Pstk2Cell.vbs

A prompt for padstack name will pop up. Just entering any padstack name will start searching associated partition:cells and write to the file at "C:\WDIR\Cell_Pstk.txt" (line 18)

 

. EditPstk.vbs is to replace padstacks in active Cell Editor. It does not have code to invoke Cell Editor, so you should open Cell Editor before testing the code.

Running EditPstk.vbs as internal client will replace padstack "RND0_7" with "RND1_4" (line 47). You will be able to notice the padstack is changing graphically on the fly.

 

The codes are very simple, since I am just trying to share ideas to replace padstacks. You will need to complement the code to check various situation in order to secure your library database safely.

 

Hope this could help...

Regards,

Nick

Attachments:
nick_hong Active 20 posts since
Aug 25, 2008
Currently Being Moderated
Apr 11, 2012 5:31 PM in response to: patrick.w.johnson
Re: Renaming Padstack Names via Script in Library Manager

Hi Patrick,

 

Is the error with the example script Pstk2Cell.vbs? I tested it with EE7.9.2 and don't have any issue.

 

AssociatedCells is a property that is attached to Padstack Object in "Library Manager". If you tried Padstack.AssociatedCells for Padstack Object in PadstackEditor, you will get the error you mentioned since the object does not have AssociatedCells property.

 

If this is the case, please refer to 'Library Manager and Library Editors Automation Reference'(library_editors_auto.pdf) and find difference between below two objects

  . Library Manager Objects - MGCLMPadstack Object

  . Padstack Editor Objects - Padstack Object

 

- Nick

More Like This

  • Retrieving data ...

Bookmarked By (0)