• 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. how do you toggle between enterPoint() and enterBox()

Stats

  • Locked Locked
  • Replies 15
  • Subscribers 143
  • Views 19079
  • 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

how do you toggle between enterPoint() and enterBox()

Adhil
Adhil over 13 years ago

Hi

I am trying to create this align function that functions similarly to that of icstation.

the following describes how the macro is used

1. you select the object that you want to move to align

2. invoke the align function via a bindkey

3. the function prompts you to enter a point which it then uses to select the reference object.

4. complete the action by moving the initially object and aligning it to the reference object.

 how can i make the selection of the reference object be versatile so that i can click to select a reference object or draw a box to select multiple reference objects. i was thinking of a function  that can toggle between enterpoint() or enterbox(), but i dont know how to do this. please help.

thanks

Adhil

  • Cancel
  • dmay
    dmay over 13 years ago

    Take a closer look at the code.

    1. In the drawThru1Bk code, the "case" command will run CreateAlignSet if either "xAlign" or "yAlign" is running. It doesn't matter which command is running since CreateAlignSet simply selects some items. As I suggested in my last post, this should be made more generic since there are not two separate enter functions. Setting the cmdName to "myAlign" and checking only for that command would be a cleaner way to do it.

    2. No, you cannot make bindkeys be function specific. That is why I implemented it like I did. This drawThru1Bk procedure could be expanded to do many different functions for many different commands. It is similar to cmdOption() or lxCmdOptions() bindkey functions that you might find on your right or middle mouse buttons (depends on your Cadence version). These functions do different things depending on the command you run. For example, if you are moving a via, and use one of these bindkeys, your via will rotate. However, if you use the same bindkey during a split command it will toggle how an item will be split.

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Adhil
    Adhil over 13 years ago

    in a similar note i tried to impliment the flip command to my right mouse key while a object is moving. here is the code.


    hiSetBindKey("Layout" "<Btn3Down>EF" "adhFlip()")

    procedure(adhFlip()
    let(((changeFlag 0) (object car(geGetSelSet())))

    if(hiGetCurrentCmd(hiGetCurrentWindow()) == "Move" then  

     when(object~>orient == "R0" && changeFlag == 0
      object~>orient = "MX" changeFlag = 1)
     when(object~>orient == "MX" && changeFlag == 0
      object~>orient = "MY" changeFlag = 1)
            when(object~>orient == "MY" && changeFlag == 0
      object~>orient = "R0" changeFlag = 1)

    )
    )
    )

    this function does not work at all, when i replaced it with the following

    hiSetBindKey("Layout" "<Btn3Down>EF" "adhFlip()")

    procedure(adhFlip()
    let(((changeFlag 0) (object car(geGetSelSet())))

    if(hiGetCurrentCmd(hiGetCurrentWindow()) == "Move" then

     leHiFlip()

    )
    )
    )

    the object flips and gets placed, as opposed to being in the "move" mode.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Adhil
    Adhil over 13 years ago

    Hi

    I did the following alterations to the code, so i can align partially selected paths to given objects. it does work, but it does not align. it is because it is hard to retrieve the points of the partially selected part. how can i find these coordinates, here is the code.

    procedure(myAlign(dir)
    let((objects obj shift sourceBox refObjects refBox pt (parSelectFlag 0))
        objects = geGetSelSet() ; selects objects to be moved to align
        if(length(objects) == 1 && geIsFigPartiallySelected(car(objects))
             then parSelectFlag = 1)
        pt = enterPoint(                   ; prompts the user to enter a point which will be used to select the reference object
          ?prompts list("Select the ref object")
          ?addPointProc "myAddPointProc"
          ?initProc "setSelectionMode"
          ?cmdName "myAlign"
        )
        sourceBox = trBBoxUnion(objects~>bBox)
        if(refObjects = setof(x geGetSelSet() !memq(x objects))
            refBox = trBBoxUnion(refObjects~>bBox)
            refBox = list(pt pt)
        )
        if(dir == "X"
            shift = list(getXshift(sourceBox refBox) 0)
            shift = list(0 getYshift(sourceBox refBox))
        )
        if(dir == "center" then
         Xshift =   getXshift(sourceBox refBox)
            Yshift =   getYshift(sourceBox refBox)
            shift = list(Xshift Yshift)
               )


        foreach(obj objects
         if(parSelectFlag == 1 then leStretchShape(obj shift geGetSelSetFigPoint(obj) t ) else
          dbMoveFig(obj geGetEditCellView() list(shift "R0"))

        ))
        geDeselectAll()
        mapcar('geSelectObject objects)
     
     )
    )
    procedure(myAddPointProc(win pt)

    Adhil

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dmay
    dmay over 13 years ago

    The first function works a little. However, it is flipping the object that is placed while you are in the middle of a move command. The "ghost" that is displaying on the screen as you do your move will not show the flip, but the placed object will and when your move is complete it will be flipped. I found that the second command worked even worse.

    If you want to flip something during a move, use the lxCmdShiftOptions() bindkey. You should find this on either shift<Btn3Down> or shift<Btn2Down>.

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dmay
    dmay over 13 years ago

    If you are using the code I sent you then you'll need to adjust the getYshift and getXshift commands since they use the centerBox for determining the offset. Your original request was to work from the center axis, now you are aligning edges. Again, may I suggest the Quick Align which does edges perfectly. Otherwise, you need to modify your code for determining your offset so that it can handle edge alignments as well as center alignments. Sounds like you might need to create an options form for this enter function.

     Derek

    • 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