Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Once again, let me ask you a question.
line 0,0 to 100,0
offset 2 Y+.
If I create two lines, and then execute the following Lisp with the created lines almost filling the screen
It works normally.
Next, if I run the Lisp with the line zoomed out to about half of the screen, it will write on the second line.
However, the command line display is the same for both
Start= (0.0 1.0 0.0) End= (100.0 1.0 0.0)
Is this a problem with Lisp?
;;;*************************************************
(defun c:CTest
(
/ en1 en2 p1s p1e p2s p2e p3s p3e
ip dv1 dv2 tmp ed1 ed2 ed3
; ss nn i count
)
(if (setq en1 (car (entsel "\nSelect first line")))
(progn
(redraw en1 3)
(if (setq en2 (car (entsel "\nSelect second line")))
(redraw en2 3)
(progn (redraw en1 4) (quit))
)
)
(quit)
)
;直線の開始点、終了点を取得
(setq p1s (cdr (assoc 10 (entget en1)))) ;Start point of first line
(setq p1e (cdr (assoc 11 (entget en1)))) ;End point of first line
(setq p2s (cdr (assoc 10 (entget en2)))) ;Start point of second line
(setq p2e (cdr (assoc 11 (entget en2)))) ;End point of second line
;Align direction of the line
; (setq dv1 (mapcar '- p1e p1s))
; (setq dv2 (mapcar '- p2e p2s))
; (setq ip (apply '+ (mapcar '* dv1 dv2)))
; (if (< ip 0.0) (setq tmp p2s p2s p2e p2e tmp));Swap start and end points
;Get start and end points of center line
(setq p3s (mapcar '+ p1s p2s))
(setq p3s (mapcar '/ p3s '(2.0 2.0 2.0)))
(setq p3e (mapcar '+ p1e p2e))
(setq p3e (mapcar '/ p3e '(2.0 2.0 2.0)))
(command "LINE" p3s p3e "")
(princ "Start= ") (princ p3s)
(princ " End= ") (princ p3e)
(princ)
)
Saitoib
Solved! Go to Solution.