#1
|
|||
|
|||
Add "next" to a menu
I would like to add a "next" option to my menu to supplement the "ok" button.
SM 14 THX
__________________
Bob Wing CAD Manager |
#2
|
||||
|
||||
Re: Add "next" to a menu
You might want to supply some more details, it is not clear to me what you are asking. I assume this refers to a custom Modeling dialog that you have written?
__________________
John Scheffel |
#3
|
|||
|
|||
Re: Add "next" to a menu
Hi Bob,
To add a "Next" button to your dialog, all you need to do is create a variable (which can be called "Next") and attach some code to the "push-action" of that variable. Perhaps something like this: Code:
(sd-defdialog 'my-dialog :variables '((var1 :value-type :boolean) (next :title "Next" :push-action (my-action-func))) :local-functions '((my-action-func () ;; .... do some processing .... ))) Code:
(sd-defdialog 'my-dialog :variables '((var1 :value-type :boolean) (next :title "Next" :push-action (my-action-func))) :local-functions '((my-action-func () ;; .... do some processing .... )) :ok-action '(my-action-func) ) I hope this helps! andy
__________________
Andy Poulsen AI MAXTools: Dream. Design. Done. It's that easy! Add-ins bringing new functionality and speed to Creo Elements/Direct and CoCreate products. Now available for v17-v20+! See them in action at www.ai-maxtools.com and then try them for yourself -- FREE! |
#4
|
|||
|
|||
Re: Add "next" to a menu
To supplement my original post and hopefully make my question a bit clearer, I am a lisp newbie, but I have created dozens of ME10 macros. I have been assigned the task of populating BOM's with MM attributes (if possible) or by entering them in by hand. I was lucky enough to find a sample lisp file to populate attributes and attach them to a selected part.
It can be found in the SD help under, "create drawings from models (annotator) --> Advanced topics --> Customization for advanced users --> bom functions. This program works great and I was successful in adding additional attributes to it. one of the drawbacks is I would like it to have a next button so i could select the next part to modify instead of starting the macro again by way of the toolbox. Andy, I was able to add the next button to show in the meny but i'm not sure of the function I should add to get the above result. any thoughts? Also is there a way to display the attached attributes of a selected part? Thanks.
__________________
Bob Wing CAD Manager |
#5
|
|||
|
|||
Re: Add "next" to a menu
Hi Bob,
I'm glad this is starting to work for you. I believe what you will want to do is something like this: since the :ok-action of the dialog defines the action in-place (i.e., it doesn't call a separate function), move that definition to a function. Then this function can be called by either the :ok-action or your "next" button. In other words, create a :local-functions section (as I showed in my previous example), and create a function (could be called do-it or whatever you want) that contains the code after the (progn...) statement. Then, assuming you used do-it as the function name, you just call that function from both the :ok-action and the "next" button. Your code could then look (abbreviated) like this: Code:
(sd-defdialog 'my-dialog :variables '(;; other variable definitions go up here... ;; now create a "next" button (next :title "Next" :push-action (do-it))) :local-functions '((do-it () (sd-attach-item-attribute object "MY_SPECIAL_BOM_ATTR" ;; rest of parameters for this function .... )) :ok-action '(do-it) ) Does this work for you? Good luck! andy
__________________
Andy Poulsen AI MAXTools: Dream. Design. Done. It's that easy! Add-ins bringing new functionality and speed to Creo Elements/Direct and CoCreate products. Now available for v17-v20+! See them in action at www.ai-maxtools.com and then try them for yourself -- FREE! |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|