Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
error in a lisp routine
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: error in a lisp routine (Read 1635 times)
0 Members and 1 Guest are viewing this topic.
squareknees
Guest
error in a lisp routine
«
on:
July 10, 2015, 08:27:48 AM »
I am new to this site but have been working in AutoCAD for 15 years. Never got the hang of creating a lisp routine. So I find good lisp routines online and use them.
I found one that is great but I have an issue when I auto load into the program. I get a weird start up error.
I have found which lisp routine it is that does it but I would like to have it accessible all time.
Code - Auto/Visual Lisp:
[Select]
(
defun
c:ist
(
/
e i j k
)
(
vl-load-com
)
;(setq i (/ pi 6.) j -1.)
(
setq
i
0
k
(
/
pi
6
.
)
j
-
1
.
)
;; © Lee Mac 2011
(
if
(
and
(
setq
e
(
car
(
entsel
"
\n
Select Text: "
)
)
)
(
eq
(
vla-get-Objectname
(
setq
e
(
vlax
-
ename
->
vla-object
e
)
)
)
"AcDbText"
)
(
princ
"
\n
Press [Tab] to Change Projection "
)
)
(
while
(
=
9
(
cadr
(
grread
nil
14
0
)
)
)
;(vla-put-rotation e i)
(
vla-put-rotation
e
(
*
k
(
1-
(
*
2
(
setq
i
(
rem
(
+
i
(
max
0
(
setq
j
(
-
j
)
)
)
)
3
)
)
)
)
)
)
;(vla-put-obliqueangle e (setq i (* i (setq j (- j)))))
(
vla-put-obliqueangle
e
(
*
j k
)
)
)
)
(
princ
)
)
(
c:ist
)
when I start AutoCAD with this auto loaded into the drawing it has a startup error.
s::startup-load
I have to escape a few times to get going in the drawing
Thanks for any help
Edit: I added code tags to the code in this post to make it more readable.
REF:
https://www.theswamp.org/index.php?topic=48309.0
«
Last Edit: July 10, 2015, 09:21:47 AM by John Kaul (Se7en)
»
Logged
ChrisCarlson
Guest
Re: error in a lisp routine
«
Reply #1 on:
July 10, 2015, 09:06:23 AM »
I loaded it up fine and it works? I'd just remove that bottom (c:ist), it's annoying when a routine attempts to start automatically.
Logged
ChrisCarlson
Guest
Re: error in a lisp routine
«
Reply #2 on:
July 10, 2015, 09:07:56 AM »
Lee did revise that code to error when mtext is selected, I'm sure the routine could be modified to include mtext as well.
http://www.theswamp.org/index.php?topic=37429.0
Logged
hmspe
Bull Frog
Posts: 362
Re: error in a lisp routine
«
Reply #3 on:
July 10, 2015, 09:18:17 AM »
The original thread is here:
http://www.theswamp.org/index.php?topic=37429.0
I suspect that all that is needed is to remove the (c:ist) at the end of the routine. That line runs the function automatically when the routine is loaded. If you are loading a function when needed that makes some sense, but if you area loading a function when you start your CAD program a function like this generally should not automatically run.
You might find it easier to use the formatting that Stefan used in the last post of page 1 of
http://www.theswamp.org/index.php?topic=37429.0
instead of the formatting at
https://lispbox.wordpress.com/2015/02/17/creates-isometric-text/
. I find indenting makes it much easier to follow the code. Stefan's code is also a modification of Lee's code, so Stefan commented out several lines and inserted modified lines just below the lines he commented out. I would delete the three lines starting with ;( . I would also change the copyright to:
;; original © Lee Mac 2011, from
http://www.theswamp.org/index.php?topic=37429.0
Logged
"Science is the belief in the ignorance of experts." - Richard Feynman
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
error in a lisp routine