Message 1 of 19
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a larger program that needs the user to pick path of a polyline between to block points and so far this is what I was able to hack together for what I wanted. The problem I am still having a hard time with the basics of the logic (I believe its the logic). Could someone point me in the right direction of where I might be going wrong?
;---------------------------------------------------------------------------------
; Polyling place function
;---------------------------------------------------------------------------------
; Polyline place - ALFEZ
; Create new layer if it dosen't exist.
; Polyline starts at blk1 point.
; Prompts user to pick points
; If point is not good user can undo (up to blk1 point)
; when user hits enter polyline completes at blk2
;---------------------------------------------------------------------------------
(defun :pickpoly (blk1 blk2 / done out ens ben)
; blk1 - block one data
; blk2 - block two data
; -
; -
; -
; make new layer if it doesnt exist
(vl-cmdf "_.LAYER" "_Thaw" "HIDDEN" "_Make" "HIDDEN" "")
(setvar 'attdia 0)
(setvar 'attreq 0)
; start polyline with red colour
(setvar 'cecolor "1")
(setvar 'cmdecho 0)
(vl-cmdf "_PLINE" "_non" (if (= (car blk1) "COMBINER") (setq pnt (last blk1)) (setq pnt (caddr blk1))))
(progn ; pick route for polyline (user input to the destination block)
(setq pnt (getpoint "\nNext point: " pnt))
(command "_non" pnt)
(while (progn
(initget "Undo")
(setq pnt
(getpoint "\nNext point [Undo] <exit>: ")
);setq
);progn
(cond ((= pnt "Undo")
(command "erase" "last" ""))
((command "_non" pnt))
);cond
);while
(T
(command "_non" (caddr blk2) "")
);T
T) ; progn
(setq pen (entlast)) ; get pline entity name
(vl-cmdf "_.CHPROP" pen "" "_Color" 3 "")
(setvar 'attdia 0)
(setvar 'attreq 0)
out
); defunFeel free to point me to other posts or resorcese that will help me.
Solved! Go to Solution.