vanowm Posted March 15, 2015 Share Posted March 15, 2015 Hello. I have a function that draw line: (defun drawLine (start end) (entmakex (list '(0 . "LINE") '(100 . "AcDbEntity") '(100 . "AcDbLine") '(8 . "") (cons 9 start) (cons 10 end) ) ) ) How do I make it select that line so it would show with grips? Thank you. Quote Link to comment Share on other sites More sharing options...
pBe Posted March 15, 2015 Share Posted March 15, 2015 odd why you use 9 as startpoint (defun drawLine (start end) (entmakex (list '(0 . "LINE") '(100 . "AcDbEntity") '(100 . "AcDbLine") [b];'(8 . "")[/b] (cons [b]10 [/b]start) (cons 11 end) ) ) ) (defun c:demo () (setq ss (ssadd)) (setq p1 (getpoint)) (setq p2 (getpoint p1)) (setq newline (drawLine p1 p2)) (sssetfirst nil (ssadd newline ss )) ) Quote Link to comment Share on other sites More sharing options...
vanowm Posted March 15, 2015 Author Share Posted March 15, 2015 Thanks for the response. It works. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 15, 2015 Share Posted March 15, 2015 Note that if ssadd is called without the selection set argument, the supplied entity will be automatically added to a new selection set, e.g.: (defun c:test ( / p q ) (if (and (setq p (getpoint "\nStart: ")) (setq q (getpoint "\nEnd: " p)) ) (sssetfirst nil (ssadd (drawline (trans p 1 0) (trans q 1 0)))) ) (princ) ) Also, note that the subclass markers (DXF group 100) are not required for LINE entities: (defun drawLine ( start end ) (entmakex (list '(0 . "LINE") (cons 10 start) (cons 11 end) ) ) ) Quote Link to comment Share on other sites More sharing options...
pBe Posted March 15, 2015 Share Posted March 15, 2015 Good catch LM Also good call on (trans p 1 0) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 15, 2015 Share Posted March 15, 2015 No worries pBe! Quote Link to comment Share on other sites More sharing options...
vanowm Posted March 15, 2015 Author Share Posted March 15, 2015 Thank you very much. These little details are very useful for newbies! Thanks again for taking your time to teach us Quote Link to comment Share on other sites More sharing options...
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.