TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Peter2 on February 07, 2014, 11:15:52 AM
-
Hi
I have this simple code,
(setq startpunkt (getpoint "\nClick startpoint: ")
endpunkt (getpoint startpunkt "\nClick endpoint: "))
where I create a "rubber band line" (sorry, I don't know the correct English word) between startpoint and cursor.
How can I set the color (and the lineweight??) of this line?
-
Here's for color:
(and (setq startpunkt (getpoint "\nClick startpoint: "))
(setq endpunkt (getpoint startpunkt "\nClick endpoint: "))
;; start end color
(grdraw startpunkt endpunkt 5)
)
-
Hi ronjonp
thanks, but you misunderstood (or I described it wrong ..). I don't need a grdraw after clicking the endpoint, I need it before clicking the endpoint (as grdraw or as modification of the getpoint line).
-
Here is a quick example:
(defun c:foo (/ p p1 p2)
(if (setq p1 (getpoint "\nPick a point: "))
(while (and (setq p2 (grread 5)) (= (car p2) 5)) (redraw) (grdraw p1 (setq p2 (cadr p2)) 1))
)
(list p1 p2)
)
And here are a few examples of GRREAD
http://www.theswamp.org/index.php?topic=12813.msg156555#msg156555
-
Thanks. Now I see that there must be a full grdraw-function and no modification of getpoint.
-
Thanks. Now I see that there must be a full grdraw-function and no modification of getpoint.
This is pretty much the only modification of the rubber-band you can make with getpoint:
(defun c:test ( / p )
(if (setq p (getpoint "\nStart: "))
(progn
(initget 32)
(getpoint p "\nEnd: ")
)
)
(princ)
)
Otherwise, a grread/grdraw/grvecs combination must be used (as Ron has demonstrated), however, the use of grread sacrifices all standard drawing aids (such as Object Snap / Orthomode / Tracking etc).
-
Thanks to all
I'm on my way now.