rob8lyn Posted June 14, 2011 Posted June 14, 2011 Hi all, Does anybody know a way in AutoCAD to select all (or some) of the polyline or line "start" points and draw a symbol or object (e.g. arrow, X, circle, etc...) at those points? Appreciate any assistance. Quote
CyberAngel Posted June 14, 2011 Posted June 14, 2011 There's always AutoLISP. Not sure how you would do that at the command prompt. Quote
BlackBox Posted June 14, 2011 Posted June 14, 2011 Create a block that you wish to use as your marker for the start points, and replace the red text with your block's name. The block should be located within your Support File Search Paths. (defun c:MarkStartPoints ( / blockName flag ss) (vl-load-com) (princ "\rMARK STARTPOINTS ") (setq blockName "[color=red]BlockName[/color]") (if (and (or (setq flag (tblsearch "block" blockName)) (setq flag (findfile blockName))) (setq ss (ssget "_:L" '((0 . "LINE,*POLYLINE"))))) ((lambda (i / e ctab space) (while (setq e (ssname ss (setq i (1+ i)))) (vla-insertblock (cond (space) ((= "MODEL" (setq ctab (strcase (getvar 'ctab)))) (setq space (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))) ((setq space (vla-get-paperspace (vla-get-activedocument (vlax-get-acad-object)))))) (vlax-3d-point (vlax-curve-getstartpoint e)) blockName 1. 1. 1. 0.))) -1) (cond (flag (prompt "\n** Nothing selected ** ")) ((prompt (strcat "\n** \"" blockName "\" cannot be found ** "))))) (princ)) Hope this helps! Quote
dbroada Posted June 15, 2011 Posted June 15, 2011 not as elegant but you could draw your symbol once then copy it to each selected line using the END osnap. Do you want the symbol at both ends or just the start, and if just the start will that always be the way it has been drawn? (If a line is drawn L-R the start will be at the other end to a line drawn R-L.) Quote
rob8lyn Posted June 15, 2011 Author Posted June 15, 2011 Thanks Cyber, Render & dB for your replies! I have thousands of lines to mark, so I need something automated. Renderman's LISP program looks like it might do the trick. I'll test it out and let you all know how it goes. Quote
rob8lyn Posted June 29, 2011 Author Posted June 29, 2011 Create a block that you wish to use as your marker for the start points, and replace the red text with your block's name. The block should be located within your Support File Search Paths. (defun c:MarkStartPoints ( / blockName flag ss) (vl-load-com) (princ "\rMARK STARTPOINTS ") (setq blockName "[color=red]BlockName[/color]") (if (and (or (setq flag (tblsearch "block" blockName)) (setq flag (findfile blockName))) (setq ss (ssget "_:L" '((0 . "LINE,*POLYLINE"))))) ((lambda (i / e ctab space) (while (setq e (ssname ss (setq i (1+ i)))) (vla-insertblock (cond (space) ((= "MODEL" (setq ctab (strcase (getvar 'ctab)))) (setq space (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))) ((setq space (vla-get-paperspace (vla-get-activedocument (vlax-get-acad-object)))))) (vlax-3d-point (vlax-curve-getstartpoint e)) blockName 1. 1. 1. 0.))) -1) (cond (flag (prompt "\n** Nothing selected ** ")) ((prompt (strcat "\n** \"" blockName "\" cannot be found ** "))))) (princ)) Hope this helps! Worked like a charm! Much thanks and props to Renderman. Quote
BlackBox Posted June 29, 2011 Posted June 29, 2011 Worked like a charm! Much thanks and props to Renderman. Happy to help. 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.