• 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. Allegro X PCB Editor
  3. build a popup of "Temp Group"

Stats

  • Replies 7
  • Subscribers 160
  • Views 4476
  • Members are here 0
More Content

build a popup of "Temp Group"

SkilSiao
SkilSiao over 13 years ago

Hi all, I want to make an item of "Temp Group" in Right-click popup (which is same as "copy" "move" command)

so that user can make continuous selection.

my function look like this:

mypopup = axlUIPopupDefine(nil '(
    ("Done" "axlDBTransactionCommit(mark), axlFinishEnterFun()")
    ("Oops" "axlDBTransactionOops(mark), when(zerop(--oopsNum), printf(\"Nothing Selected!\\n\")")
    ("Cancel" "axlDBTransactionRollback(mark), axlCancelEnterFun()")
    ("MENU_SEPARATOR", nil)
 ("Temp Group" "axlUIPopupSet(mypopup1) ... "))) ; end define the popup
 axlUICmdPopupSet(mypopup)

 mypopup1 =  axlUIPopupDefine(nil '(
    ("Done" "axlDBTransactionCommit(mark), axlFinishEnterFun()")
    ("Oops" "axlDBTransactionOops(mark), when(zerop(--oopsNum), printf(\"Nothing Selected!\\n\")")
    ("Cancel" "axlDBTransactionRollback(mark), axlCancelEnterFun()")
    ("MENU_SEPARATOR", nil)
 ("Complete" " ... "))) ; end define the popup
 axlUIPopupSet(mypopup1)

 axlSetFindFilter(?enabled ... ?onButtons ...)

 while( axlSelect(?prompt sprintf(nil "Select object(s) to continue.\n"))

temp_list = axlGetSelSet()

caseq(length(temp_list)  (0 ...) (1 ...) (t ...)

) ; end caseq

) ; end while

I have been thinking of how to write function for the "Temp Group" and "Complete" so that the selection done by user

can be stored in temp_list, because in the while loop, the temp_list = axlGetSelSet() to allow a single selection.

 anyone can help. thanks in advance.

  • Sign in to reply
  • Cancel
  • Silver John
    Silver John over 13 years ago

     I do not quite understand your starting position, and ultimate goal.
    Look at how I done a similar functionality (pay attention: used standard TempGroup, "from box"). Maybe this will help you.
    In my program, you can select one or more objects, you can use a temporary group.

    Align Tool

    See "popupA", "_alnSelectedObjects" and main loop "while( _alnFinish == nil ... )"

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • SkilSiao
    SkilSiao over 13 years ago
    Hi Silver, thanks for the suggestion. i am going through the code... actually my problem is like this: I want to write a two-stage prompting selection by user... Just like "copy" command, first prompt user to select object(s), then followed by prompting user for a point of copy origin (User Pick), and Oops is available during the command for user to reselect object(s) or origin. my coding looks something like this, (i skip certain portion as it will be too long to read...) the Oops/ Cancel/ Done popup are standard, linking to DBTransactionOops/ RollBack/ Commit. mark = axlDBTransactionStart() not_done = t while( not_done axlSelect(?prompt "Select object(s) to continue.") axlDBTransactionMark(mark) selected_obj = axlGetSelSet() axlClearSelSet() axlHighlightObject(selected_obj nil) one_point = axlEnterPoint(?prompts "Select a point.") printf("the point selected is %L.\n" one_point) );end while The problem is, after selecting the objects (1st stage), if Right click->Oops is entered, the while loop will continue to 2nd stage (select a Point). even I add in another TransactionMark after the axlEnterPoint. Is there a way to achieve the two select prompting with the Oops? Thanks in advance.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • SkilSiao
    SkilSiao over 13 years ago
    Re-post.
    Hi Silver, thanks for the suggestion. i am going through the code...
    actually my problem is like this:
    I want to write a two-stage prompting selection by user...
    Just like "copy" command, first prompt user to select object(s), then followed by prompting user for a point of copy origin (User Pick), and Oops is available during the command for user to reselect object(s) or origin. my coding looks something like this, (i skip certain portion as it will be too long to read...) the Oops/ Cancel/ Done popup are standard, linking to DBTransactionOops/ RollBack/ Commit.
    mark = axlDBTransactionStart() not_done = t
     while( not_done axlSelect(?prompt "Select object(s) to continue.")
    axlDBTransactionMark(mark) selected_obj = axlGetSelSet() axlClearSelSet()
    axlHighlightObject(selected_obj nil)
    one_point = axlEnterPoint(?prompts "Select a point.")
    printf("the point selected is %L.\n" one_point) );end while
    The problem is, after selecting the objects (1st stage),
    if Right click->Oops is entered, the while loop will continue to 2nd stage (select a Point).
    even I add in another TransactionMark after the axlEnterPoint.
    Is there a way to achieve the two select prompting with the Oops? Thanks in advance.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Silver John
    Silver John over 13 years ago
    Use the special condition (dirty fix, finally).
    This is only a problem of algorithmic and you have to solve it itself.
    For example see the line in my code: "if (_alnHandler then axlFinishEnterFun ()); for exit from 'doPickH or' doPickV".
    In doPickH() function I wait while user pick.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • SkilSiao
    SkilSiao over 13 years ago

    Hi Silver, Many thanks.

    Yes, it is a two-stage prompt in aln command, From Select Object(s) to Choose Action.

    I find that the doPickH() is called from the callback function (correct me if i am mistaken)  and not

    initiated from the while loop which resides in the main function. It is a good idea as it does offer

    another approach (from form button) to capture users' one-by-one input.

     

    refer to the following coding (Sorry abt my previous posts as i was with google Chrome), i want to

    prompt user for two inputs, first is object and the second is a point :

     not_done = t

    mark = axlDBTransactionStart()  

    while( not_done axlSelect(?prompt "Select object(s) to continue.")

    selected_obj = axlGetSelSet()

    axlDBTransactionMark(mark)  axlClearSelSet()
    axlHighlightObject(selected_obj nil)
    one_point = axlEnterPoint(?prompts "Select a point.")
    printf("the point selected is %L.\n" one_point)
    );end while

    I am wondering whether it is possible to "oops" from the "Select a point" back to "Select

    object(s)". Everytime when I "oops" (axlDBTransactionOops)  it will just continue the while loop

    (select a point) instead of going back to top...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
>
Cadence Guidelines

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