CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 08-03-2007, 11:35 AM
bobwing bobwing is offline
Registered User
 
Join Date: Oct 2002
Location: Southeastern Mass.
Posts: 45
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
Reply With Quote
  #2  
Old 08-03-2007, 02:54 PM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
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
Reply With Quote
  #3  
Old 08-03-2007, 09:00 PM
Andy Poulsen Andy Poulsen is offline
Administrator
 
Join Date: Apr 2003
Location: Fort Collins, Colorado
Posts: 273
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 ....
   )))
If you want to have the Next button do the same thing as the OK button, you can modify the above code by using the same function as part of your :ok-action i.e. 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 ....
     ))
  :ok-action '(my-action-func)
  )
Does something like this do what you need, or give you some ideas? Or are you looking for something else?

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!
Reply With Quote
  #4  
Old 08-07-2007, 05:17 AM
bobwing bobwing is offline
Registered User
 
Join Date: Oct 2002
Location: Southeastern Mass.
Posts: 45
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
Reply With Quote
  #5  
Old 08-07-2007, 06:44 AM
Andy Poulsen Andy Poulsen is offline
Administrator
 
Join Date: Apr 2003
Location: Fort Collins, Colorado
Posts: 273
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)
  )
This should get it doing what you need.

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!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 01:41 AM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.