Home > Community > Forums > Custom IC SKILL > dbCreateVia() questions: default versus override params

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

 dbCreateVia() questions: default versus override params 

Last post Fri, Nov 4 2011 1:35 AM by frogconsultant. 2 replies.
Started by frogconsultant 03 Nov 2011 03:55 AM. Topic has 2 replies and 2712 views
Page 1 of 1 (3 items)
Sort Posts:
  • Thu, Nov 3 2011 3:55 AM

    • frogconsultant
    • Top 200 Contributor
    • Joined on Wed, Feb 17 2010
    • Bourron Marlotte, Seine-et-Marne
    • Posts 40
    • Points 605
    dbCreateVia() questions: default versus override params Reply

    I am building a procedure using the parameters of the object Via. I am changing the overrideParams of concern in order to increase or decrease the parameter value. The issue I have and I am not understanding is that when I am arriving to the default value of the parameter after decrease the value with the overrideParams, I can not get out i.e. increase or decrease this parameter anymore as describe in my little procedure.

    Does someone have the same issue?

    How could I get out of this default value lock?

    procedure( viasColumnsDown()
        viewLyId = geGetEditCellView()
        Selecedtset = geGetSelectedSet()
        foreach( Obj Selecedtset
            if( (Obj~>objType == "stdVia" ) then
                paramNames='("cutLayer" "cutWidth" "cutHeight" "cutRows" "cutColumns"
                    "cutSpacing" "layer1Enc" "layer2Enc" "layer1Offset" "layer2Offset"
                    "originOffset" "imp1Enc" "imp2Enc" )
                default = mapcar('list paramNames Obj->viaHeader->viaDef->params)
                override = Obj->viaHeader->overrideParams

               v1 = dbCreateVia(viewLyId via12Id Obj->xy "R0"
                    list(list("cutColumns" cadr(assoc("cutColumns" override))-1)  ))
                dbDeleteObject( Obj )
            ) ;if
            if( (v1 != nil) then
                geSelectObject( v1 )
            ) ;if
        );foreach
    );procedure

    This post could be a complement of similar post but as it is a new question I have posted as a brand new post.

    Thanks in advance for your help,

    Fabian

    • Post Points: 20
  • Thu, Nov 3 2011 12:04 PM

    Re: dbCreateVia() questions: default versus override params Reply

    Fabian,

    Try this:

    procedure( viasColumnsDown()
      let((selectedSet paramNames default override newColumns)
        paramNames='("cutLayer" "cutWidth" "cutHeight" "cutRows" "cutColumns"
            "cutSpacing" "layer1Enc" "layer2Enc" "layer1Offset" "layer2Offset"
            "originOffset" "imp1Enc" "imp2Enc" )
        selectedSet = geGetSelectedSet()
        foreach( Obj selectedSet
            when( Obj~>objType == "stdVia"
                ;------------------------------------------------------------
                ; Convert defaults to an assoc list 
                ;------------------------------------------------------------
                default = mapcar('list paramNames Obj->viaHeader->viaDef->params)
                override = Obj->viaHeader->overrideParams
                newColumns=
                    ;--------------------------------------------------------
                    ; Constrain the value to be greater or equal to 1
                    ;--------------------------------------------------------
                    max(1
                        cadr(
                            ;------------------------------------------------
                            ; If there's a value in the overrideParams, use that,
                            ; otherwise take the default
                            ;------------------------------------------------
                            assoc("cutColumns" override) ||
                            assoc("cutColumns" default)
                        )-1
                    )
                ;------------------------------------------------------------
                ; Replace the property, rather than deleting the via and re-adding
                ;------------------------------------------------------------
                dbReplaceProp(Obj "cutColumns" 'int newColumns)
            ) ; when
        );foreach
        t
      )
    );procedure

     

    Regards,

    Andrew.

    • Post Points: 20
  • Fri, Nov 4 2011 1:35 AM

    • frogconsultant
    • Top 200 Contributor
    • Joined on Wed, Feb 17 2010
    • Bourron Marlotte, Seine-et-Marne
    • Posts 40
    • Points 605
    Re: dbCreateVia() questions: default versus override params Reply

     Dear Andrew,

    I like you approach better than mine :-)

    procedure( viasColumnsDown()
        viewLyId = geGetEditCellView()
        Selecedtset = geGetSelectedSet()
    ;    println("CDown")
        foreach( Obj Selecedtset
            if( (Obj~>objType == "stdVia" ) then
                paramNames='("cutLayer" "cutWidth" "cutHeight" "cutRows" "cutColumns"
                    "cutSpacing" "layer1Enc" "layer2Enc" "layer1Offset" "layer2Offset"
                    "originOffset" "imp1Enc" "imp2Enc" )
                default = mapcar('list paramNames Obj->viaHeader->viaDef->params)
                override = Obj->viaHeader->overrideParams
    ;                println(cadr(assoc("cutColumns" override)))

                tfId = techGetTechFile(ddGetObj("lbc7"))
                   via12Id = techFindViaDefByName(tfId "via12_OA")
                if( (cadr(assoc("cutColumns" override)) == nil) then
                    v1 = dbCreateVia(viewLyId via12Id Obj->xy "R0" list(
                        list("cutRows" if(cadr(assoc("cutRows" override))!=nil then cadr(assoc("cutRows" override)) else
                        cadr(assoc("cutRows" default))))
                        list("cutColumns" 1.0)
                        list("layer1Enc" '(0.1 0.1)) ))
                else
                    v1 = dbCreateVia(viewLyId via12Id Obj->xy "R0" list(
                        list("cutRows" if(cadr(assoc("cutRows" override))!=nil then cadr(assoc("cutRows" override)) else
                        cadr(assoc("cutRows" default))))
                        list("cutColumns" cadr(assoc("cutColumns" override))-1)
                        list("layer1Enc" '(0.1 0.1)) ))
                ) ;if
                dbDeleteObject( Obj )
            ) ;if
            if( (v1 != nil) then
                geSelectObject( v1 )
            ) ;if
        );foreach
    );procedure

    A bit more complex. Thanks for the simplify code.

    Fabian

    • Post Points: 5
Page 1 of 1 (3 items)
Sort Posts:
Started by frogconsultant at 03 Nov 2011 03:55 AM. Topic has 2 replies.