PDA

View Full Version : Program to Find start and end points of an edge


VINIT
11-25-2005, 01:47 AM
Friends,
This is a sample program I wrote to find out start and end points for any given selected edge. I don't understand why this program is not working. what has gone wrong? When I load this program using (Load "<filename.lsp>"), It gives me an error saying that "MyEdge1 is unbound" This may be due to:..........etc"

(use-package :OLI)
(sd-defdialog 'edgelength
:dialog-title "Edge length"
:variables
'(
(MyEdge1 :value-type :edge
:title "Edge-1"
:all
:prompt-text "Select an Edge"
);close MyEdge1
);variables

:ok-action
(progn
(setq a (sd-edge-start-pnt (sd-inq-edge-geo MyEdge1)))
(setq b (sd-edge-end-pnt (sd-inq-edge-geo MyEdge1)))
(print (format nil "Start & Endpoints list ~A" '(a b)))
);progn
);sd-defdialog

Regards
Vinit

clausb
11-25-2005, 09:43 AM
You forgot to quote the form after :ok-action:


:ok-action '(progn
(setq a (sd-edge-start-pnt (sd-inq-edge-geo MyEdge1)))
...


After this fix, you will still run into an error when loading the file, but this time a different one which is due to using an unbalanced keyword :all in the definition for MyEdge1.

Hope this helps,

Claus

John Scheffel
11-28-2005, 09:06 AM
A couple of tips on posting LISP code. You might want to enclose the code in CODE tags (see the # button at the top of the Message: window). This will preserve indentation and formatting. It is also a good idea to check the Disable Smilies in text box at the bottom, since many LISP tags begin with a colon and are interpretted as a smilie. If you forget to do this when you first post, you can always edit your post and change it later. I edited your post to remove the smilies in the code so it won't confuse others, but did not add the code tags.