#1
|
|||
|
|||
My first Lisp
I've tried to go through the "intergration kit" and get a few pionters on creating a lisp routine, but have had no luck.
I would like to create a lisp routine that creates geometery from specfied variables in the "sd-defdialog" command, and call modeling commands with "sd-call-cmds" but all the commands from the "sd_avail_cmds.cmd" require a user input to activate, and I cannot get it to work. so in a nut shell I would like to be able to: 1) specify a diameter-1 2) specify a diameter-2 3) create geometery of diameter-1 4) revolve the geometery around an axis (defalut Y-axis) of diamter-2 5) the resulting part center location determined by user input if possible, otherwise 0,0,0 I am ready to get a 6er of SPATEN to corress my iner german lisp lovin alter ego. ps anyone who helps me gets an invite to the "octoberfest" party |
#2
|
|||
|
|||
Re: My first Lisp
Hi,
It's not exactly clear to me what you're trying to do, but I'll give it a try... One good place to start is to use the recorder. To do this type the following in your Modeling command line and press return: Code:
(load "recorder") When calling a command using sd-call-cmds, you can't have any user input during the call to that command (as you found out!). The way to do it is to determine the correct parameters for the command, and then request those parameters from the user as part of your dialog. Then, you pass those parameters to the command as part of sd-call-cmds. Here's a simple example that might help to get you started. It's a simple dialog to let you rename a part or assembly. Code:
;; tell the lisp reader which package should contain these functions (in-package :my-package) ;; tell the lisp reader you want to use the standard Modeling ;; Integration Kit functions (use-package :oli) ;; now define a test dialog (sd-defdialog 'ren_test ;; define the title of the dialog :dialog-title "Simple Rename" ;; define the variables to be used in this dialog :variables '((mypart :value-type :part-assembly :title "Object") (newname :value-type :string :title "New Name") (next :push-action (doit)) ) ;; define local functions for this dialog :local-functions '((doit () (sd-call-cmds (change_name_pa :part_asmb mypart :name newname))) ) ;; define what happens when the user clicks "OK" :ok-action '(doit) ) If you record the commands to change the name of a part, you'll see that the command is change_name_pa and its parameters are :part_asmb and :name. We use that information to create the part of the dialog that actually does the work -- the function doit (which could be called something else, of course). This function uses sd-call-cmds to call the change_name_pa function, with arguments :part_asmb mypart and :name newname. I hope this helps get you started -- if you have further questions, just ask! 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! |
#3
|
|||
|
|||
Re: My first Lisp
Thanks for the help,
But I still cannot get the user input to create geometery and objects Here is what I have so far: see attachment,( how do you disable the smiles?) When I run the recoder function at home, there is a lot less in the file, the option to include motion is not checked, i've included the recorder file of what i would like to do, but I do not know how to use the varables defined in the dialog in the sd-call-cmds thanks for the assistance |
#4
|
|||
|
|||
Re: My first Lisp
the recorder file from the above post,
|
#5
|
||||
|
||||
Re: My first Lisp
When you are in the full editor you should see a check box under Additional Options titled Disable smilies in text (see GIF). This will prevent display of smilies in your LISP code. If you are using the simple editor you have to click Go Advanced to get this option. You can also check this box when editing an existing post to remove the smilies if you forgot.
__________________
John Scheffel |
#6
|
||||
|
||||
Re: My first Lisp
Quote:
BTW, there are several sample dialogs in the IKIT docs which you can build upon.
__________________
CoCreate Modeling FAQ: http://www.clausbrod.de/CoCreateModeling/ |
Tags |
intergration kit sucks, lsip, spaten |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|