Home > Community > Forums > Custom IC SKILL > Extracting name of instance in Layout XL

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

 Extracting name of instance in Layout XL 

Last post Sun, Apr 28 2013 11:02 PM by hwxu. 3 replies.
Started by Neeraj Vardhan 08 Apr 2013 11:48 PM. Topic has 3 replies and 801 views
Page 1 of 1 (4 items)
Sort Posts:
  • Mon, Apr 8 2013 11:48 PM

    Extracting name of instance in Layout XL Reply

    Hi Andrew,

    I had a question, which is not related to the topic.

    I was trying to extract name of instance from layout XL, and every instnace has a " | " in starting eg. "|M1". Now when i was trying to save the name as inst~>name, it saves as " "|M1" ", i.e with quotation. Is there a way to convert this string to symbol. i need just |M1.

    i had a case where the inst name was " "|M1.1" " also.

    Regards

    Neeraj 

    • Post Points: 50
  • Wed, Apr 10 2013 3:39 AM

    Re: Extracting name of instance in Layout XL Reply

    Neeraj,

    If it is not related to the topic, you should really create a new thread (as the Forum Guidelines tell you to do). So I split it into a new thread to avoid confusion.

    I don't understand - are you saying that the instance names have embedded quotation marks? That sounds very odd, and I've not seen that before.

    You can of course convert a string to a symbol (e.g. with stringToSymbol() ), but I somehow doubt you really want to do that.

    Regards,

    Andrew.

     

    • Post Points: 5
  • Sun, Apr 28 2013 10:29 PM

    • hwxu
    • Not Ranked
    • Joined on Sun, Apr 28 2013
    • Posts 2
    • Points 10
    Re: Extracting name of instance in Layout XL Reply

    I think the "ParseString()" would be helpful.

    • Post Points: 5
  • Sun, Apr 28 2013 11:02 PM

    • hwxu
    • Not Ranked
    • Joined on Sun, Apr 28 2013
    • Posts 2
    • Points 10
    Re: Extracting name of instance in Layout XL Reply

    here is a skill code ,maybe it will help you. 

    /*Synopsis : CreateXL_Label()
    Version : 1.0
    Create Date : 2007-09-13
    Author : Justin Wang
    E-Mail : justin727@gmail.com
    */
    hiSetBindKey("Layout" "Ctrl<Key>l" "CreateXL_Label()")
    procedure(CreateXL_Label()
    prog((winId cvId Shapes Layer shp Box llx lly urx ury Text)
    winId = hiGetCurrentWindow()
    cvId = getEditRep(winId)
    Shapes = geGetSelSet(cvId)
    Layer = list("TEXT" "drawing")
    foreach(shp Shapes
    if((shp~>objType == "inst" ) then
    Box = shp~>bBox
    llx = car(car(Box))
    lly = cadr(car(Box))
    urx = car(cadr(Box))
    ury = cadr(cadr(Box))
    Text = car(parseString(shp~>name))
    ; example:   |M36.1 ---> |M36.1

    ;Text = car(parseString(shp~>name "|"))
    ; example:   |M36.1 ---> |M36.1

    ;Text = car(parseString(shp~>name "|."))
    ; example:  |M36.1 ---> M36
    if((urx-llx < ury-lly)
    then
    dbCreateLabel(cvId Layer (llx+urx)/2:(lly+ury)/2
    Text "centerCenter" "R90" "stick"  (ury-11y)/10 )
    else
    dbCreateLabel(cvId Layer (llx+urx)/2:(lly+ury)/2
    Text "centerCenter" "R0" "stick"   (urx-llx)/10 )
    );if
    );if
    );foreach
    );prog
    );procedure

    • Post Points: 5
Page 1 of 1 (4 items)
Sort Posts:
Started by Neeraj Vardhan at 08 Apr 2013 11:48 PM. Topic has 3 replies.