CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 10-28-2004, 03:04 AM
CF_Lum CF_Lum is offline
Registered User
 
Join Date: Aug 2004
Location: Penang, Malaysia
Posts: 16
Question Lisp - create spline

Is it possible to create spline using lisp code? Actually, later i will be reading in the point from a text file & draw the spline.
I create the following code but it isn't work!

Code:
(sd-defdialog 'draw_spline
	:dialog-title "Draw Spline"
	:variables

   '((POINT_LIST)          ;internal non displayed variable
     (NEW_POINT            ;internal input variable
        :value-type :point-2d
        :toggle-type :invisible
        :prompt-text "Pick a point"
        :after-input (push-point new_point))
        )
  :local-functions
    '((PUSH-POINT (a-new-point)
       (setq POINT_LIST (cons a-new-point POINT_LIST))
       ))
  :prompt-variable 'new_point
  :ok-action
	  '(progn
	  (print POINT_LIST)
	  (sd-call-cmds (BSPLINE_INT POINT_LIST complete))
	  )
); sd-defdialog
Anyone can help?
__________________
Lum
Reply With Quote
  #2  
Old 10-28-2004, 09:56 PM
dorothea dorothea is offline
Registered User
 
Join Date: Nov 2002
Location: Nufringen near Stuttgart
Posts: 157
Hello Lum,

There are two things you have to change.
First: remove the 'complete' from the command sequence. sd-call-cmds implies that you want positive termination of the action.
Second: the way you pass the parameter to bspline_int is wrong. Type into command line
Code:
(trace bspline_int)
and call your dialog. Look at the output in the console window. You'll see that the dialog bspline_int gets a list of points as input. But it expects single points. For this purpose there exists the function 'apply' in LISP. Your code should look like this:
Code:
(sd-call-cmds (apply 'BSPLINE_INT POINT_LIST))
Now check again the output in the console window. You'll see that the points are passed point by point.

Dorothea
Reply With Quote
  #3  
Old 10-28-2004, 11:04 PM
CF_Lum CF_Lum is offline
Registered User
 
Join Date: Aug 2004
Location: Penang, Malaysia
Posts: 16
Thumbs up

Hi Dorothea,

Thanks a lot!
__________________
Lum
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 02:15 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.