Home > Community > Forums > Custom IC SKILL > Script to make visible dummy layer of those metal layers visible in LSW selection

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

 Script to make visible dummy layer of those metal layers visible in LSW selection 

Last post Mon, Feb 25 2013 9:39 AM by Andrew Beckett. 6 replies.
Started by Neeraj Vardhan 21 Feb 2013 02:30 AM. Topic has 6 replies and 1417 views
Page 1 of 1 (7 items)
Sort Posts:
  • Thu, Feb 21 2013 2:30 AM

    Script to make visible dummy layer of those metal layers visible in LSW selection Reply

    Hi can any one show some light on how to perform the solution. For example if i have "M1 drawing layer" visible in LSW , then if i press some bindkey the M1 dummy layer should get vissible. I have tried some code but it isnt working. Copied for reference below

     

    procedure(showDummySet()

    for(i 1 10

    z="M"

    layer=(concat(z,i))

    x=leIsLayerVisible( list("layer" "drawing") )

    if( x == "t" then (

    leSetAllLayerVisible(nil) 

    leSetEntryLayer(list(\"layer\" \"drawing\")) 

    leSetEntryLayer(list(\"layer\" \"dummy\")) 

    hiRedraw()

    )

    )

    )

    )

    hiSetBindKey("Layout" "Ctrl<Key>8" "showDummySet() ") 

    • Post Points: 20
  • Thu, Feb 21 2013 3:43 PM

    • chianga
    • Not Ranked
    • Joined on Thu, Dec 13 2012
    • Posts 8
    • Points 230
    Re: Script to make visible dummy layer of those metal layers visible in LSW selection Reply

    Hi Neeraj

     

    I think you need to use leSetLayerVisible instead of leSetEntryLayer, you might want to give that a try.

     

    Cheers,

    Andy 

    • Post Points: 20
  • Thu, Feb 21 2013 8:07 PM

    Re: Script to make visible dummy layer of those metal layers visible in LSW selection Reply

    Hi Andy,

     I was getting this error for both   leSetLayerVisible & leSetEntryLayer as 

     *WARNING* (TECH-2000192): leIsLayerVisible: Invalid layer/purpose - ("layer" "drawing").

    I am not able to set the layer as per my wish. So either i have to use a "when" and make the code huge or any other option to sort this out.  

     

     

     

    • Post Points: 20
  • Thu, Feb 21 2013 8:21 PM

    • skillUser
    • Top 10 Contributor
    • Joined on Fri, Sep 19 2008
    • Austin, TX
    • Posts 2,593
    • Points 16,035
    Re: Script to make visible dummy layer of those metal layers visible in LSW selection Reply

    Neeraj,

    You have quotes around "layer" which means it will be treated as a literal string, rather than the variable you intended. Take these quotes away and you may get it working. (I have not looked in detail at this code, I just noticied this bit).

    Regards,

    Lawrence.

    • Post Points: 35
  • Thu, Feb 21 2013 8:48 PM

    Re: Script to make visible dummy layer of those metal layers visible in LSW selection Reply

    Thanks a lot Lawrence, the code is working fine .

    Regards

    Neeraj 

     

    • Post Points: 5
  • Sun, Feb 24 2013 8:28 PM

    Re: Script to make visible dummy layer of those metal layers visible in LSW selection Reply
    Hi lawrence, i was facing this error while running the code
    "t
    M1t
    *Error* eval: not a function - leSetLayerVisible(layer t)" 
     
    Can you assist me, why this error is comming. 
     
     
    Code :
     
    procedure(showDummySet()
    for(i 1 10
    z="M"
    layer=concat(z,i)
    print(layer)
    x=leIsLayerVisible(list(layer "drawing") 
    print(x)
    if( x == t then (
    leSetLayerVisible(list(layer "drawing") t)
    leSetLayerVisible(list(layer "dummy") t)
    )
    )
    )
    )
    )
     
    Thanks & Regards
    Neeraj  
    • Post Points: 20
  • Mon, Feb 25 2013 9:39 AM

    Re: Script to make visible dummy layer of those metal layers visible in LSW selection Reply

    I didn't get the error you did - because there's a missing close parenthesis on the first leIsLayerVisible. If I add that, then I get the error you got, because there's an erroneous open parenthesis on the if line. For good measure I declared all the variables in the code as local too - and it now works fine (it did without adding the let, but I though it was a good idea to add):

    procedure(showDummySet()
        let((z layer x)
            for(i 1 9
                z="M"
                layer=concat(z,i)
                print(layer)
                x=leIsLayerVisible(list(layer "drawing"))
                print(x)
                if( x == t then
                    leSetLayerVisible(list(layer "drawing") t)
                    leSetLayerVisible(list(layer "slot") t)
                )
            )
        )
    )

    Note that we would recommend that you use a prefix for your function to avoid clashing with anyone else's function called "showDummySet".

    Regards,

    Andrew.

    • Post Points: 5
Page 1 of 1 (7 items)
Sort Posts:
Started by Neeraj Vardhan at 21 Feb 2013 02:30 AM. Topic has 6 replies.