Since my first request went so well (Thanks again!!!) I'm going to ask for a second, and hope someone helps me again.
I need to change the Assembly Ref Des on every cell in the the library. I want to control the font, the height and stroke width. (I'll need to do the Silkscreen too, but I can run the script twice, second time with different settings, or get a second set of settings???)
Can someone throw something like this together???? Sure would help.
I made easy sample script.
Please check it.
This script changes the font name, height, and pen width of RefDes(Silk&Assy) in Cell.
Dim fabTxts, fabTxt
'Create CellEditorDlg Object
Set celEditor = CreateObject("CellEditorAddin.CellEditorDlg")
Set celDB = celEditor.OpenDatabase(lmcPath, False)
For Each ptin In celDB.Partitions("*")
ScriptHelper.Echo "Partition: " & ptin.Name
For Each cel in ptin.Cells(ecelldbCellTypeAll, ecelldbPackageGroupAll)
flag = False
ScriptHelper.Echo " Cell: " & cel.Name
'Start Cell Editor(Layout) & Get Cell Document Object
Set celDoc = cel.Edit
'Get CellEditor Application Object
Set celApp = celDoc.Application
'celApp.Visible = True
'Get FabricationLayerGfxs Object
Set fabTxts = celDoc.FabricationLayerTexts(epcbFabAssembly + epcbFabSilkscreen, epcbSelectPlaced, epcbSideTopOrBottom, True)
For Each fabTxt In fabTxts
'Check RefDes Text
If fabTxt.TextType = epcbTextRefDes Then
fabTxt.Format.Font = newFont
fabTxt.Format.Height = newHeight
fabTxt.Format.PenWidth = newWidth
flag = True
'CellEditor Save & Close
If flag = True Then
ScriptHelper.Echo " --> Edit"
'Un Lock CellEditor
Thanks for the quick response.
I think you made a mistake. Ran the script, and it didn't change anything, and it reported it only changed when I'd already changed it?????
I'm out until Monday, so can't do any more checking until then.
I don't know a rule.
Therefore, a script will be changed if there is RefDes of Silk or Assy.
A rule like a Width change script is required.
Oops, I'm using a batch file to run the script, and didn't retype part of the script when I did a cut and paste. (was trying to leave for vacation, and was in a hurry) So I was running the wrong script!
But, I'm getting a:
Error:0x80040209 'Font not found. This font may not be loaded.'
about the time I run out of physical memory. Will try and decrease library (I'm using a copy anyway) size, and rerun, when I have a few minutes.
I get more and more angry about Mentor Graphics´ underhand Licensing Methods.
First they kill ASCII-Options and the self-written software that did all I needed is now trash.
And they canted about the better working with Automation Tools.
What I see now is, that this replacement is mostly associated with automation pro license.
My assembly and silkscreen manipulation software (Java) was very time-saving (local changing in Layout),
now I have to change the customer-specific graphical parameters by hand again.
And I am not open for paying a Fablink license only to use a lost functionality.
Is there any way to run your script with automation basic?
Greetings from Germany, Guenni
I would write each cell partition out to ASCII and change them using a text editor or a script. You may have to use DataConvert depending upon the version you're using.
Sorry, should have posted, the script above worked fine. I did modify it a bit to do just silkscreen, and then copied it to just do the assembly, but over all, it was fine.
I did have to do 1/2 the cells at a time, but that was because I only have 2G on my machine, and with all the crap running in the back ground, I ran out of RAM. I think if I'd had 3G, I could do all of it at once.