#1
|
|||
|
|||
Continue Dialog after action
Thanks for the help on my first lisp routine. Today a coworker of mine asked me "boy it would be great if there was a tool that had all of our material codes in a drop down list, so you could pick one and then assign the density for that material code, so that everyone would be using the same density, I replied, I programm lisp sehr gut und kann das, dass. An hour later, my second lisp program. My questions are:
1) How do I have the sd-defdialog continue after the O.K. button is pressed, deleting the set variables, but not terminating (grab my hand! ; arhhh ; I’ll be back) the command. 2) How do I set the units prior to the function, so that my density values in cubic inches are not applied to a model in mm/kg |
#2
|
||||
|
||||
Re: Continue Dialog after action
Maybe a construction with: ok-action-next-variable & sd-return-from-ok-action helps? Like this:
Code:
(oli::sd-defdialog 'test_ok_action :variables '( (ok-action-done :initial-value nil) (Num1 :value-type :number) (Num2 :value-type :number :toggle-type :invisible :next-variable (when ok-action-done (sd-accept-dialog)) ) ) :ok-action-next-variable 'Num2 :ok-action '(progn (print (list Num1 Num2)) (unless Num2 (setq ok-action-done T) (oli::sd-return-from-ok-action) ) ) ) Last edited by Michael Kahle; 08-11-2009 at 10:53 PM. |
#3
|
||||
|
||||
Re: Continue Dialog after action
Does oli::sd-user-to-sys-units help? See ikit-documentation...
:length {NUMBER} :area {NUMBER} :volume {NUMBER} :angle {NUMBER} :mass {NUMBER} :density {NUMBER} |
#4
|
||||
|
||||
Re: Continue Dialog after action
Hi Michael,
don't you know about the BB code called [ code ] to post code? - edit your code posting and make it more readable, please! BTW: you should not use oli::, with 2 : , and s_docu... is not supported! Code:
(in-package :my-tools) (use-package :oli) (sd-defdialog 'test_ok_action :variables '( (ok-action-done :initial-value nil) (test1 :selection *sd-anno-view-seltype*)....
__________________
|
#5
|
|||
|
|||
Re: Continue Dialog after action
Quote:
Code:
(in-package :my-tools) (use-package :oli) (sd-defdialog 'next-test :variables '( (mypart :value-type :part) (myvar1 :value-type :number) (myvar2 :value-type :number) ("-") ;; separator to make dialog look nice! (next :push-action (progn (function-to-process-vars) (setq myvar1 nil) (setq myvar2 nil)) :next-variable mypart ) ) ;; end of variables section :local-functions '( (function-to-process-vars () .... ) ) ;; end of local-functions section ) ;; end of sd-defdialog :ok-action '(function-to-process-vars) A different approach, but might work well 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! |
#6
|
|||
|
|||
Re: Continue Dialog after action
I still cannot get it to work, the next button would be perfect, but it just ends the action.
here is what I have so far: (in-package :my-package) (use-package :oli) (sd-defdialog 'JAD2-MATERIAL-DIALOG :dialog-title "ASSIGN DENSITY" :variables '( ("SET UNITS TO INCH & LB") ("PART") (vpart :value-type :part :prompt-text "SELECT PART TO ASSIGN DENSITY" :title "PART") ("MATERIAL") (vmat :range ( ;; update with spreadsheet (0.264 :label "100 CAST IRON") ;; Engr Std ;; list continues with other values ) :title "MATERIAL" ) ("-") ;; separator to make dialog look nice! (next :push-action (progn (JAD2-MATERIAL-ACTION) (setq vmat nil) :next-variable vpart )) ) ;; end of variables section :local-functions '((JAD2-MATERIAL-ACTION) () (part_prop :the_part :start vpart :select_done :display_ui :the_part :base_density vmat ) ) ;; end of local-functions section :ok-action '( JAD2-MATERIAL-ACTION) ) |
#7
|
|||
|
|||
Re: Continue Dialog after action
Just hint -- to make your code easier to read, wrap code tags around it...
Quote:
Code:
:local-functions '((JAD2-MATERIAL-ACTION) () (sd-call-cmds (part_prop :the_part vpart :display_ui :the_part :base_density vmat )) ) ;; end of local-functions section Code:
:local-functions '((JAD2-MATERIAL-ACTION) () (sd-call-cmds (set_part_base_density :parts vpart :dens (sd-user-to-sys-units :density vmat )))) ) ;; end of local-functions section 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! |
#8
|
|||
|
|||
Re: Continue Dialog after action
Thanks for the help, everything works just like it should.......
and now my next question.......which will start in a new thread, thanks again. |
#9
|
|||
|
|||
Re: Continue Dialog after action
I was a little premature in saying that my lisp works, in fact it doesent. I have two version, one I made with the recorder works fine V1, the other made with assistance from this forum, it runs, but does not change the part density. I could use some help debuging the lisp. I've included both of them for any assistance you can offer, thanks.
|
#10
|
|||
|
|||
Re: Continue Dialog after action
here is a dialog that does what you are looking for plus a little more. I've used it for years, does density, color (base or instance), and transparency. It doesn't have a next button but that would be nice, if you add it and get it working post it back please. Also if you have a bigger list of materials, please share.
|
Tags |
sd-defdialog |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|