Sweety Posted October 12, 2010 Posted October 12, 2010 Hello GUYS. How can I draw line using one Entmakex for multiple points ? ... Example... (if (and (setq p1 (getpoint "\n Specify first Point :")) (setq p2 (getpoint "\n Specify second point :")) (setq p3 (getpoint "\n Specify third point :")) (setq p4 (getpoint "\n Specify forth point :")) ) (entmakex (list (cons 0 "LINE") (cons 10 p1) (cons 11 p2) [color="red"] ;(cons 10 p2) ;(cons 11 p3) ;(cons 10 p3) ;(cons 11 p4)[/color] ) ) ) Or should I repeat the same entmakex three times to get these line drawn ? Thanks for any help in advance. Quote
VVA Posted October 12, 2010 Posted October 12, 2010 (setq i 0 lst nil ) ;_ end of setq (while (setq pt (getpoint (strcat "\n Specify point № " (itoa (setq i (1+ i))) " : ") ) ;_ end of getpoint ) ;_ end of setq (setq lst (cons pt lst)) ) ;_ end of while (mapcar '(lambda (p1 p2) (entmakex (list (cons 0 "LINE") (cons 10 p1) (cons 11 p2) ) ;_ end of list ) ;_ end of entmakex ) ;_ end of lambda lst (cdr lst) ) ;_ end of mapcar Quote
jammie Posted October 12, 2010 Posted October 12, 2010 Hi Unfortunately Entmake dosen't support the creation of multiple objects at one time. You will have to use entmake 3times int the case of your example above Is the number of points picked fixed or will it vary? Quote
alanjt Posted October 12, 2010 Posted October 12, 2010 http://www.cadtutor.net/forum/showthread.php?51628-entmake-continouse-line-example&p=350070&viewfull=1#post350070 Quote
Sweety Posted October 12, 2010 Author Posted October 12, 2010 A very great examples . Thank you all. Appreciated Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.