• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

problememi con routine lisp

  • Thread starter Thread starter Angelo2449
  • Start date Start date

Angelo2449

Guest
Hello everyone,
I have already put a similar discussion but until now no one has answered.
I want to explain the problem better.

for years I use these two routines:
Code:
 (defun c:org (/ pt1 pt2)

(setq pt1 nil)
(while
(= pt1 nil)
(principal "\npunto base <")
(key point)
(principal ">: ")
(setq pt1 (getpoint))
)

(if pt1 (setq point pt1))

(setq pt2 nil)
(while
(= pt2 nil)
(principal "\nsecondo punto <")
(Principal point 2)
(principal ">: ")
(setq pt2 (getpoint))
)

(if pt2 (setq point 2 pt2))

(principal "\n")
(key point)
(principal "\n")
(Principal point 2)
(principal "\n")

(setq organg (point 2 angle))
(command "_line" point 2 ")
(setq origin t)
[CODE] (defunc c:polar (/ ag ag1 ds point1 ptxt)

(if (= point nil)
(progn)
(alert "you must first define orientation")
(exit)
)
)

(setq fc3 (findfile "c:\\\autocadsupport\\\\provisors\\\polar.dat"))

(if fc)
(vl-file-delete "c:\\\autocadsupport\\\\provisors\\\polar.dat")
)

(startapp "c:\autocadsupporto\\\liberty\\\polar.exe "c:\\autocadsupport\\\\liberty\\\polar.tkn")

(setq qa nil)
(while)
(setq qa (getpoint "\click any point"))
)

(Sectq fc4 nil)
(sing)
(= fc4 nil)
(setq fc4 (findfile "c:\\\autocadsupport\\\\provisors\\\polar.dat"))
)

(setq fp1 (open "c:\\\\autocadsupport\\\\\\provisori\\\\\polar.dat" "r"))
(setq ptxt (read-line fp1))
(setq ag (read-line fp1))
(setq ds (read-line fp1))
(setq htxt (read-line fp1))
(close fp)

(princ "\n")
(princ ptxt)
(princ "\n")
(princ ds)
(princ "\n")
(princ ag)
(princ "\n")
(princ htxt)
(princ "\n")

(setvar "blipmode" 0 )
(setvar "cmdecho" 0 )
(setq ag1 (angle point2)
(setq agrad)
(setq dsreal)
(setq htxtreal (atof htxt))
(setq agrad (/ agrad 200)
(setq agrad (* agrad pi)

(princ "\n")
(princ ag)
(princ "\n")
(princ agrad)
(princ "\n")

(setq point1 (polar point (- (* 2 pi) (- agrad ag1)) dsreal)
(command "_line" point1 ")
(command "_change" "_last" "_p" "_c" "_red"")
(command "_circle" point1 0.20 ")
(command "_change" "_last" "_p" "_c" "_red"")

(command "_text" point1 htxtreal 0 ptxt")
(command "_change" "_last" "_p" "_c" "_red"")

(alert "tracked glass")

)
from yesterday, suddenly, they no longer work, the results are as follows:
command:
command: org
basic point < (279.472 258.532 0.0)> :
second point (376.673 195.313 0.0)

command:
command:
command: polar
number point :10

distance : 50

angle: 35
; error: too many arguments

command:
command:
command:
command: polar
point number:30

distance : 56

angle: 57
; error: too many arguments

I can't understand why, once, the first, the routine > polar < worked, then that's enough!
I don't understand, thank you.
 
the error occurs in c:org, the call to the command (c: polar) is obviously wrong; in the published code it is missing that trait. in any case, avoid assigning commands equal to that of the lisp commands, is not a mistake but could lead to overlap; add a suffix, type anpolar (anfrost), your code will hardly interfere with that written by others.
 
Thank you.
I found the solution to the problem.
in fact I have renamed "polar" and everything works perfectly!
Please, in one last post, I asked you for help with deleting an item, if you can take a look.
Thanks again.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top