maybe small LISP interpretation bug ??
Posted: Mon Sep 06, 2004 9:29 am
Hello,
I found IntelliCAD an excellent solution for reusing my very very old collection of LISP routines. Now I found, that a very simple one didn't work correct:
I called it (mee), simply a shortcut for middle between two endpoints). The plan was, that you can type at every coordiante input just (mee), click to two endpoints end the (mee) returns the middle between these two endpoints.
It works fine with the PLINE command, but not with the MOVE command, so the return coordinate will not accepted at the second input for the MOVE command:
: move
Select entities to move:
Entities in set: 1 Select
entities to move:
Vector/<Base point>: (mee)
Enter first [end]point :
Enter second [end]point :
Vector/<Base point>: (63.5000 27.5000)
Displacement point: (mee)
Enter first [end]point :
Enter second [end]point :
Displacement point: ()
Displacement point:
I just add the code, its very short for (mee). Maybe somebody could check it again - in the past, it works fine with hte very old one ACAD R12 releases in DOS environment.
(PROMPT "\nLoading int. LISP-C. (MEE)......")
(defun mee ( / osstore p1 p2)
(setq osstore (getvar "OSMODE"))
(setvar "OSMODE" 1)
(setq p1 (getpoint "\nEnter first [end]point : "))
(setq p2 (getpoint P1 "\nEnter second [end]point : "))
(setvar "OSMODE" osstore)
; polar <pt> <angle in rad> <distance>
(polar p1 (angle p1 p2) (* 0.5 (distance p1 p2)) )
(list (+
(car p1)
(/ (- (car p2) (car p1)) 2.0 ) )
(+ (cadr p1) (/ (- (cadr p2) (cadr p1)) 2.0 ) )
)
)
(prompt "loaded. (KH. ABT 11/93)")(prin1)
best regards Karlheinz
I found IntelliCAD an excellent solution for reusing my very very old collection of LISP routines. Now I found, that a very simple one didn't work correct:
I called it (mee), simply a shortcut for middle between two endpoints). The plan was, that you can type at every coordiante input just (mee), click to two endpoints end the (mee) returns the middle between these two endpoints.
It works fine with the PLINE command, but not with the MOVE command, so the return coordinate will not accepted at the second input for the MOVE command:
: move
Select entities to move:
Entities in set: 1 Select
entities to move:
Vector/<Base point>: (mee)
Enter first [end]point :
Enter second [end]point :
Vector/<Base point>: (63.5000 27.5000)
Displacement point: (mee)
Enter first [end]point :
Enter second [end]point :
Displacement point: ()
Displacement point:
I just add the code, its very short for (mee). Maybe somebody could check it again - in the past, it works fine with hte very old one ACAD R12 releases in DOS environment.
(PROMPT "\nLoading int. LISP-C. (MEE)......")
(defun mee ( / osstore p1 p2)
(setq osstore (getvar "OSMODE"))
(setvar "OSMODE" 1)
(setq p1 (getpoint "\nEnter first [end]point : "))
(setq p2 (getpoint P1 "\nEnter second [end]point : "))
(setvar "OSMODE" osstore)
; polar <pt> <angle in rad> <distance>
(polar p1 (angle p1 p2) (* 0.5 (distance p1 p2)) )
(list (+
(car p1)
(/ (- (car p2) (car p1)) 2.0 ) )
(+ (cadr p1) (/ (- (cadr p2) (cadr p1)) 2.0 ) )
)
)
(prompt "loaded. (KH. ABT 11/93)")(prin1)
best regards Karlheinz