Home > Community > Forums > PCB SKILL > Text search and Text edit

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: *

 Text search and Text edit 

Last post Mon, Apr 1 2013 11:53 PM by serpens. 5 replies.
Started by serpens 19 Mar 2013 06:40 AM. Topic has 5 replies and 978 views
Page 1 of 1 (6 items)
Sort Posts:
  • Tue, Mar 19 2013 6:40 AM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Text search and Text edit Reply

    Hi,

    I want to create a simple SKILL utility for find and replace texts in the DB (for the project number in template, e.g.) and I want to ask if is there some easy way how to get all the dbid of the text in whole DB?

    Thanks.

    Miro

    Edit: This is the best I can think of.

     

    axlSetFindFilter( ?enabled list( "noall" "text") ?onButtons list( "noall" "text"))
    axlAddSelectAll()
    moAllTexts = axlGetSelSet()

    • Post Points: 5
  • Tue, Mar 19 2013 8:03 AM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Re: Text search and Text edit Reply

    I've done this small routine, however it change the text only in the curently displayed layer. Is this normal behavior? 

    Regards,

    Miro

     

    axlSetFindFilter( ?enabled list( "noall" "text") ?onButtons list( "noall" "text"))

    axlAddSelectAll()
    moAllTexts = axlGetSelSet()

    foreach( moAllTexts axlGetSelSet()
    if( moAllTexts->text == "TEST"
    axlDBChangeText( moAllTexts "CHANGED!")
      println( "DONE!")
    )
    )

    axlClearSelSet()
    • Post Points: 20
  • Tue, Mar 19 2013 10:55 PM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 551
    • Points 9,710
    Re: Text search and Text edit Reply

    Hi

    The best way to go around this is to use the invisible parameter, so that it searches and selects both on visible and invisible subclasses.

    axlSetFindFilter(?enabled list("noall", "text", "invisible"), ?onButtons list("noall", "text"))

    Best regards

    Ole

    Best regards Ole
    • Post Points: 20
  • Wed, Mar 20 2013 3:26 AM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Re: Text search and Text edit Reply

    Thanks, this solve it nice. 

    Now I finding how to replace my texts and I found this:

    moTmp = pcreReplace( pcreCompile( moFindText) moAllTexts->text moReplaceText 0)

    • Post Points: 20
  • Mon, Apr 1 2013 1:24 PM

    • vramananx
    • Top 500 Contributor
    • Joined on Tue, Jun 7 2011
    • Posts 20
    • Points 325
    Re: Text search and Text edit Reply
    • Post Points: 20
  • Mon, Apr 1 2013 11:53 PM

    • serpens
    • Top 500 Contributor
    • Joined on Thu, Feb 4 2010
    • Dubnica nad Vahom, Slovakia
    • Posts 23
    • Points 310
    Re: Text search and Text edit Reply

    Thank vramanax,

    I will look trough you code. But I think you have similar issue with your code as I describe in here http://www.cadence.com/Community/forums/p/25683/1322038.aspx#1322038

    Miro

     

    • Post Points: 5
Page 1 of 1 (6 items)
Sort Posts:
Started by serpens at 19 Mar 2013 06:40 AM. Topic has 5 replies.