Skip navigation
5,861 Views 7 Replies Last post: Nov 24, 2010 10:01 AM by hgk-layout RSS
David_S Active 61 posts since
Jul 9, 2009
Currently Being Moderated

Aug 3, 2010 8:04 AM

Request Expedition Cell Editor: Assembly font settings on every cell in library?

All,

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.

Satoru Aficionado 130 posts since
Jan 26, 2009
Currently Being Moderated
Aug 3, 2010 8:56 AM in response to: David_S
Re: Request Expedition Cell Editor: Assembly font settings on every cell in library?

Hi David-san,

 

I made easy sample script.

Please check it.

 

This script changes the font name, height, and pen width of RefDes(Silk&Assy) in Cell.

===============================================================

Sub edit_Cell()
    Dim celEditor
    Dim celDB
    Dim ptin
    Dim cel
   
    Dim celApp
    Dim celDoc
    Dim fabTxts, fabTxt
    Dim flag

    'Create CellEditorDlg Object
    Set celEditor = CreateObject("CellEditorAddin.CellEditorDlg")
    Scripting.AddTypeLibrary("CellEditorAddin.CellEditorDlg")

    'Open CellDB
    Set celDB = celEditor.OpenDatabase(lmcPath, False)

    'Lock CellEditor
    Call celEditor.LockServer

    'Loop Patitions
    For Each ptin In celDB.Partitions("*")
        ScriptHelper.Echo "Partition: " & ptin.Name
        'Loop Cell
        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
            Scripting.AddTypeLibrary("MGCPCB.CellEditorApplication")

            'Visible CellEditor
            '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
                End If
            Next
            'CellEditor Save & Close
            If flag = True Then
                Call celDoc.Close(True)
                ScriptHelper.Echo "      --> Edit"
            Else
                Call celDoc.Close(False)
            End If
        Next
    Next

    'Un Lock CellEditor
    Call celEditor.UnlockServer
    Call celEditor.CloseActiveDatabase(True)

End Sub

===============================================================

 

Regards,

Satoru

Attachments:
Satoru Aficionado 130 posts since
Jan 26, 2009
Currently Being Moderated
Aug 3, 2010 5:24 PM in response to: David_S
Re: Request Expedition Cell Editor: Assembly font settings on every cell in library?

David-san,

 

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.

 

Regards,

Satoru

hgk-layout Contributor 30 posts since
Jan 5, 2009
Currently Being Moderated
Nov 24, 2010 10:01 AM in response to: Satoru
Re: Request Expedition Cell Editor: Assembly font settings on every cell in library?

Hi Satoru-San,

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

MikeD Contributor 33 posts since
Aug 13, 2009
Currently Being Moderated
Nov 16, 2010 11:54 AM in response to: David_S
Re: Request Expedition Cell Editor: Assembly font settings on every cell in library?

David,

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.

More Like This

  • Retrieving data ...

Bookmarked By (1)