• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Set BindKey to get Area of selected path or a polygon

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 15300
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Set BindKey to get Area of selected path or a polygon

Guruprasad S
Guruprasad S over 10 years ago

Hi , 

I am trying to write Skill code to get area of any selected metal of type Path or a Polygon ,

Please can anyone find solution for me , . 

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    I see you've appended the post that I was going to point you at:

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Guruprasad S
    Guruprasad S over 10 years ago
    Thank you Andrew , ya i found your post for area :-)
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Guruprasad S
    Guruprasad S over 10 years ago
    /*** Skill For Area of an Object With Popup Results ***/


    procedure(LAYareaSize()
    let(
    (object objType
    )

    object = geGetSelectedSet()
    objT = car(object~>objType)
    println("s1")
    printf("objT is %s.\n" objT)

    if( objT == "polygon"
    then
    LAYpolyarea(object)
    else
    if( objT == "rect"
    then
    LAYrectarea(object)
    else
    printf("wrong shape.\n")

    hiDisplayAppDBox(
    ?name 'EMdbox
    ?dboxBanner "AREA"
    ?dialogType hicWarningDialog
    ?dialogStyle 'modeless
    ?buttonLayout 'Close
    ?dboxText sprintf(nil "Wrong shape Selected")
    )
    );;;**if**
    );;;**polygon**

    );;;

    );;;**procedure**



    procedure(LAYpolyarea(object)
    let(
    (object crdList sum firstPt lastPt dx sum
    )
    object=geGetSelectedSet()
    crdList = object~>points
    printf("the crdList is %L." crdList)
    sum = 0
    firstPt = lastPt = caar(crdList)
    crdList = cdar(crdList)
    printf("the firstPt is %L \n." firstPt)
    printf("the crdList is %L.\n" crdList)

    (foreach crd crdList
    dx = difference((xCoord crd) (xCoord lastPt))
    sum = (plus sum (times dx (plus (yCoord crd)(yCoord lastPt))))
    lastPt = crd
    );;;**foreach**

    sum = (plus sum (times (difference (xCoord firstPt) (xCoord lastPt))(plus (yCoord firstPt)(yCoord lastPt))))
    area = (times 0.5 (abs sum))/1000000
    printf("Area in mmSq is %f.\n" area)
    i=area
    hiDisplayAppDBox(
    ?name 'EMdbox
    ?dboxBanner "AREA"
    ?dialogType hicWarningDialog
    ?dialogStyle 'modeless
    ?buttonLayout 'Close
    ?dboxText sprintf(nil "Area of Polygon = %L mmSq" i)

    )

    );;;*let*
    );;;*procedure(LAYpolyarea)**



    procedure(LAYrectarea(object)
    let(
    (object ll ur dx corners
    )
    object=geGetSelectedSet()
    corners = object~>bBox
    ll = caar(corners)
    ur = car(cdar(corners))
    dx = (difference (xCoord ll) (xCoord ur))
    dy = (difference (yCoord ll) (yCoord ur))
    area = (abs (times dx dy))/1000000
    printf("Area in mmSq is %f.\n" area)

    i=area

    hiDisplayAppDBox(
    ?name 'EMdbox
    ?dboxBanner "AREA"
    ?dialogType hicWarningDialog
    ?dialogStyle 'modeless
    ?buttonLayout 'Close
    ?dboxText sprintf(nil "Area Of Rectangle = %L mmSq" i)

    )
    )
    );;;**procedure(LAYrectarea)**
    hiSetBindKey("Layout" "shift<key>a" "LAYareaSize()")
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information