Home > Community > Forums > Custom IC SKILL > How to change from one layer to other layer

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

 How to change from one layer to other layer 

Last post Tue, Jan 12 2010 12:51 AM by skillUser. 7 replies.
Started by sailesh 11 Jan 2010 01:24 PM. Topic has 7 replies and 2541 views
Page 1 of 1 (8 items)
Sort Posts:
  • Mon, Jan 11 2010 1:24 PM

    • sailesh
    • Not Ranked
    • Joined on Mon, Jan 11 2010
    • banglore, Karnataka
    • Posts 5
    • Points 130
    How to change from one layer to other layer Reply

     HI ,

          i need the code to change the metal layers in layout, EX: when the code is loaded all the M1 layers in layout should be replaced by M2 automatically. iam able to do till gettin the available layers..but iam not able to replace them 

    • Post Points: 35
  • Mon, Jan 11 2010 1:36 PM

    • kbhow
    • Top 50 Contributor
    • Joined on Thu, May 7 2009
    • Penang, Pulau Pinang
    • Posts 120
    • Points 2,045
    Re: How to change from one layer to other layer Reply

    Hi Sailesh,

    Since you managed to get the layer. it will be easy for you to replace the metal layers.

    Example of changing a selected shapes from M1 to M2 on current cell view:

    selected_obj = geGetSelectedSet()

    foreach( obj selected_obj

        when( obj_id~>layerName == "M1"

            obj_id~>lpp = list("M2" "drawing")

        );when

    );foreach

     This is just an example to show you a simple way in changing the layer. You may write a routine for this. Happy coding.

    Regards,

    How

    • Post Points: 5
  • Mon, Jan 11 2010 4:41 PM

    • babji
    • Top 500 Contributor
    • Joined on Thu, Apr 23 2009
    • hyderabad, Andhra Pradesh
    • Posts 24
    • Points 360
    Re: How to change from one layer to other layer Reply

    if you want to replace all the M1 layers in the current cellview (Selected or unselected) then do this. 

    ;---------------------------------------------------------------------------------------------------------------------------------- 

     prog( ()

    when(  geGetEditCellView()->mode == "r" println( "Need write access" ) return() );when

     foreach( shape geGetEditCellView()->shapes

        when( shape->layerName == "M1"   ; or shape->lpp == list( "M1" "drawing" )

            shape->lpp = list( "M2" "drawing" )  ; or shape->layerName = "M2"

            

        );when

    );fch 

     

    );prog 

    • Post Points: 20
  • Mon, Jan 11 2010 8:14 PM

    Re: How to change from one layer to other layer Reply
    It's even easier than this. You could just do:

    geGetSelSet()~>layerName="M2"

    This avoids the need for the foreach loop. You can use a list of objects with the "squiggle" operator.

    Regards,

    Andrew
    • Post Points: 20
  • Mon, Jan 11 2010 9:46 PM

    • babji
    • Top 500 Contributor
    • Joined on Thu, Apr 23 2009
    • hyderabad, Andhra Pradesh
    • Posts 24
    • Points 360
    Re: How to change from one layer to other layer Reply

     How about if we want to change all M1 shapes (Selected or not, level 0) can we do this.

     

    setof(  X geGetEditCellView( )~>shapes  X~>lpp == list(  "M1"  "drawing" )  )~>lpp = list(  "M2"  "drawing"  )

    • Post Points: 35
  • Mon, Jan 11 2010 9:55 PM

    • skillUser
    • Top 10 Contributor
    • Joined on Fri, Sep 19 2008
    • Austin, TX
    • Posts 2,567
    • Points 15,575
    Re: How to change from one layer to other layer Reply

    You could, though it would be more efficient to find the matching lpp object first and then find its shapes, then iterate over those shapes to change the layer and purpose.  I don't have an example to hand, but it would be something like the following:

    m1lpp = car(setof(lpp geGetEditCellView()~>lpps lpp~>layerName=="M1" && lpp~>purpose=="drawing"))

    foreach(shape m1lpp~>shapes shape~>lpp=list("M2" "drawing"))

    Typically the number of shapes to process is an order of magnitude or more greater than the number of distinct layer-purpose pairs, hence the probable efficiency gain. YMMV depending on the design of course.

    Regards,

    Lawrence.

    • Post Points: 5
  • Mon, Jan 11 2010 10:00 PM

    Re: How to change from one layer to other layer Reply
    Yes, although generally you'll be better off doing:

    car(exists(lpp cv~>lpps lpp~>layerName=="M1" && lpp~>purpose=="drawing"))~>shapes~>lpp=list("M2" "drawing")

    For big cellViews, there will be fewer LPP objects than shapes, so you end up traversing a smaller list. For small cellViews, it makes no difference, so it's safer to use the LP-based approach.

    Regards,

    Andrew
    • Post Points: 5
  • Tue, Jan 12 2010 12:51 AM

    • skillUser
    • Top 10 Contributor
    • Joined on Fri, Sep 19 2008
    • Austin, TX
    • Posts 2,567
    • Points 15,575
    Re: How to change from one layer to other layer Reply

    I should point out that Andrew's response is even more efficient since my example shows the use of foreach to iterate over the shapes to change their lpp, where really you can have a list on the left-hand side of the = when using the ~> operator and update the lpp for all items in the list in one hit (as babji also showed in their post).

    Regards,
    Lawrence.

    • Post Points: 5
Page 1 of 1 (8 items)
Sort Posts:
Started by sailesh at 11 Jan 2010 01:24 PM. Topic has 7 replies.