I cant find the solution ussing getkword and getpoint at once. What about ussing grread. Do you know how grread must be used?.
|
I cant find the solution ussing getkword and getpoint at once. What about ussing grread. Do you know how grread must be used?.
Last edited by jordigort; 2012-08-19 at 06:13 AM.
Hi,
I can't say that i found the solution but i'm satisfied with what I have got.
In my case rarely the user will need to point a point in a free place of the screen with the mouse because he will know the exact measure. So, he will introduce the distance with a "direct distance". What i have solved is the common situation in which the user has to point a point in the screen in the reduction angle and in a " final point " "mid point" ... of an entity. In this situation I'm already able to reduce the distance.
if you are so kind to look at the application and give me your opinion I appreciate it
The new command "da" loads the angles of a "din5 perspective" whith a reduccion of 0.66.
The new command "xx" allows you to draw in the proper angles and reduction.
If you don't understand how the aplication runs I can show you.
Thanks
------------------------------------------------------------------------------------------
;; da Dibuix de perspectives axonomètriques.
(defun c:da ()
(setq ;; exemple d'una perspectiva Din5 amb reducció a de l'esquerre de 0.666
c_red 0.666
ang1 90
ang2 270
ang3 172.819
ang4 352.819
ang5 41.41 dred1 ang5
ang6 221.41 dred2 ang6
)
(setvar "auprec" 3)
(setvar "polarmode" 6)
(setvar "autosnap" 63)
(setvar "polaraddang" (strcat (rtos ang1 2 3) ";"
(rtos ang2 2 3) ";"
(rtos ang3 2 3) ";"
(rtos ang4 2 3) ";"
(rtos ang5 2 3) ";"
(rtos ang6 2 3)
)
)
)
(defun cx()
(setvar "aperture" 15)
(terpri)
(setq p1 (getpoint "punt d'inici"))
(terpri)
(setq ctr t)
(while ctr
(setq p2 (getpoint p1 "punt següent"))
(setq ang_1_2 (/ (* (angle p1 p2) 180)PI) )
(if (or (<= (abs (- ang_1_2 dred1)) 0.01)
(<= (abs (- ang_1_2 dred2)) 0.01))
(progn
(terpri)
(setq x1 (car p1) y1 (cadr p1))
(setq x2 (car p2) y2 (cadr p2))
(setq x3 (+ (* (- x2 x1) c_red) x1))
(setq y3 (+ (* (- y2 y1) c_red) y1))
(setq x4 (+ x2 (/(- x2 x1 )10000)))
(setq y4 (+ y2 (/(- y2 y1 )10000)))
(setq p3 (list x3 y3))
(setq p4 (list x4 y4))
(command "punto" p4)
(setq p5 (cdr (assoc 10 (entget (entlast)))))
(entdel (entlast))
(setq dist_2_5 (distance p2 p5))
(if (= 0 dist_2_5)()
(setq p2 p3)
)
)
)
(setq v_aperture (getvar "aperture"))
(setvar "aperture" 1)
(command "linea" p1 p2 "")
(setvar "aperture" v_aperture)
(setq p1 p2)
)
)