Discussion forum
CAD discussion |
Please abide by the rules of this forum.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
running a function in autocad |
Post Reply |
Author | |
Frank98
Newbie Joined: 15.Feb.2017 Location: Bahamas Using: autocad 2015 Status: Offline Points: 4 |
Topic: running a function in autocad Posted: 18.Feb.2017 at 10:53 |
Hello, i have tried to save the code bellow as a lisp, the i loaeded it and in the vommand line i wrote the name of the lisp file and nohing happened,if you could help me understand how run function in outocad ,i have attache my cad menu in the photo bellow thanks (defun curve () (prompt "Routine to draw the basic sinuous curve ") (terpri) (setq start (getpoint "Pick the start point ")) (terpri) (setq rl (getreal "Enter the minimum radius ")) (terpri) (setq r2 (getreal "Enter the maximum radius ")) (terpri) (setq s (getreal "Enter the incremental step ")) (terpri) (setq tau (getreal "Enter the value of tau ")) (terpri) (while (< rl (- r2 s)) (setq fl (* (/ pi 4) (sin (* pi (/ (log (/ rl r2)) (log tau)))))) (setq x 1 (+ (* rl (cos fl)) (car start))) (setq yl (+ (* rl (sin fl)) (cadr start))) (setq rl (+ rl s)) (setq f2 (* (/ pi 4) (sin (* pi (/ (log (I r 1 r2)) (log tau)))))) (setq x2 (+ (* rl (cos f2)) (car start))) (setq y2 (+ (* rl (sin f2)) (cadr start))) (command "line" (setq p (list xl y1)) (setq p (list x2 y2)) "" ) ) ) |
|
Vladimir Michl
Moderator Group Arkance Systems CZ Joined: 26.Jul.2007 Location: Czech Republic Using: Autodesk software Status: Offline Points: 2015 |
Posted: 18.Feb.2017 at 16:55 |
The name of the LISP function is "curve" so you can invoke it by typing the "(curve)" command - note the parenthesis.
If you want to make it a custom command (invoked by name), defun it as "C:Curve" - i.e.: (defun C:Curve ( ....
|
|
Vladimir Michl (moderator)
Arkance Systems - arkance-systems.cz - Autodesk reseller |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
This page was generated in 0,344 seconds.