Home > Community > Forums > PCB SKILL > Find and Replace Text Utility

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Find and Replace Text Utility 

Last post Fri, Sep 20 2013 10:06 AM by TommyBrunet. 7 replies.
Started by vramanan 30 Dec 2009 09:38 PM. Topic has 7 replies and 5820 views
Page 1 of 1 (8 items)
Sort Posts:
  • Wed, Dec 30 2009 9:38 PM

    • vramanan
    • Top 100 Contributor
    • Joined on Fri, Oct 10 2008
    • sunnyvale, CA
    • Posts 66
    • Points 1,110
    Find and Replace Text Utility Reply

    Hi

    Warning: This is a partial code but does the work

    after loading type "te" on the allegro command  window, when you choose a class/subclass, the grid will show all the available text in those layers(go up and down on the subclass to refresh the text)

    The color button next to subclass will turn on/off that particular layer(thanks to dave elder's code)

    When you click on a text in the gird, it will show up in actual text, you can change it there and press tab and it will be updated on the grid as well as the actual text

     For now I kept minium characters to be searched as 3, type it in the find box and press find button, this will only list those has the find pattern

     (find in all layers is not yet implemented, plan to show the layers in the second column)

    type the new pattern on the Replace text and press Replace All, this will replace

    (this funtion is incomplete because I am stuck at not able to refresh the grid, I know what's happening but I am little lazy to code it now

    the dbids gets removed after replace function, I got to refind them and update)

     

    Many Many thanks to Dave Elder since I am just improvising lot of his functions

    I appreciate any feedback and comments, I welcome anyone willing to code further, I only wish me being indicated of the changes and willingness to share some code

     

    regards

    Venkata

    • Post Points: 5
  • Fri, Jan 1 2010 10:02 AM

    • vramanan
    • Top 100 Contributor
    • Joined on Fri, Oct 10 2008
    • sunnyvale, CA
    • Posts 66
    • Points 1,110
    Re: Find and Replace Text Utility Reply

     There was a bug, which I corrected it

     

    Here is the updated code

     

    I will update the code again with all the features later

     

    regards

     

    • Post Points: 5
  • Sat, Jan 2 2010 2:04 PM

    • vramanan
    • Top 100 Contributor
    • Joined on Fri, Oct 10 2008
    • sunnyvale, CA
    • Posts 66
    • Points 1,110
    Re: Find and Replace Text Utility Reply

     Hi Guys

    This is working now, I fixed all the issues and here is the completed tool

    skill load "te.il"
    then type
    te

    Scenario 1: Find All text in a given layer
            a. Select the Active class from the top left pull Down
            b. Select the Subclass you want the texts to be found
    After that the Grid will update the rows with all the found text on the 1st column and their layer on the 2nd column

    You can click on any found text on the grid which will be editable on the "Active Text" box below the grid

    After you edit it the GRID will update the values on that particular text as well as grid display

    Scenario 2: Find and Replace a Specific Text in a given layer
            a. Select the Active Class/Sub Class from pull-downs
            b. Type the key you want to be found in the find box (minium 3 characters)
            c. Press "find"
            d. Type the Term you want to be replaced with on Replace box
            e. Press "Replace All"
            p.s. selecting a found text and editing in the active text will not update the grid properly
            I am lazy to think all the possibilities
           
    Scenario 3: Find and Replace a Specific Text in All Layers
            a. Type the key you want to be found in the find box (minium 3 characters)
            b. Press "find"
            c. Type the Term you want to be replaced with on Replace box
            d. Press "Replace in All Layers"
            p.s. selecting a found text and editing in the active text will not update the grid properly I am lazy to think all the possibilities
    ####### Usage ########

    I created the initial GUI with the help of KODA form designer and my XML2BNF(xml to skill) translator
    search for xml2bnf in the cadence community forum

    Lots of Thanks to Dave Elder for his functions and examples

    This code scores 95 marks with sklint

    Any comments and suggestions are welcome and contact me at vramanan at infinera.com

     

    regards

    Venkata

    Filed under: , , ,
    • Post Points: 20
  • Thu, Dec 6 2012 11:03 AM

    Re: Find and Replace Text Utility Reply

     Venkat,

     

    Tried skill today and it found all but one instance, board Geometry/Tooling_Corners.  It is buggy, and the instance-per-layer is not working.  Overall a good time saver though!

     

    Tommy

    • Post Points: 20
  • Tue, Dec 11 2012 11:54 AM

    • vramananx
    • Top 500 Contributor
    • Joined on Tue, Jun 7 2011
    • Posts 23
    • Points 385
    Re: Find and Replace Text Utility Reply

    Hi Tommy

    That was the initial release 2 years ago, I have fixed the bugs and updated the code 

    here is the updated code

    regards

    Venkata 

    • Post Points: 20
  • Mon, Aug 19 2013 10:24 AM

    Re: Find and Replace Text Utility Reply
    Venkata,

    I have been happily using your text editor with great success when suddenly, about a week ago, the find in all layers function stopped working.  The only clue is the following error message:

    E- *Error* upperCase: argument #1 should be either a string or a symbol (type template = "S") - nil

    Do you have any insighte here?

    Thanks!

    Tommy
    • Post Points: 20
  • Fri, Aug 23 2013 10:25 AM

    • vramananx
    • Top 500 Contributor
    • Joined on Tue, Jun 7 2011
    • Posts 23
    • Points 385
    Re: Find and Replace Text Utility Reply
    Hi Tommy I haven't been using that code for a while May be i should include a check for if the found text editable in 16.6 the dimension texts are not editable When I am free i will look into it regards
    • Post Points: 20
  • Fri, Sep 20 2013 10:06 AM

    Re: Find and Replace Text Utility Reply

     Actually, the code is working now;  I think I had a database environment issue as I edited a file originated in Allegro with my OrCAD tool.  Thanks for the response!

    • Post Points: 5
Page 1 of 1 (8 items)
Sort Posts:
Started by vramanan at 30 Dec 2009 09:38 PM. Topic has 7 replies.