Has anyone heard of/written a lisp that will put a block at each grip on a polyline? I have to put a 3' circle at each grip along a polyline(probably 2,000 grips)for a wetlands plat I am working on. Thanks for any help.
|
Has anyone heard of/written a lisp that will put a block at each grip on a polyline? I have to put a 3' circle at each grip along a polyline(probably 2,000 grips)for a wetlands plat I am working on. Thanks for any help.
If it's an LwPolyline, then you will need to extract the vetex points, and the elevations (z value). Make the points a list, and then just insert a block at each point with a foreach loop.
Is that enough, or do you need more help?
Here ya go.
Code:;;add a 3' dia. circle at every vertex of a pline ;;Jeff Mishler May 2006 (defun c:circlevtx (/ ent i idx pt ss totparam rot) (if (setq ss (ssget '((0 . "*POLY*")))) (progn (vla-startundomark (vla-get-activedocument (vlax-get-acad-object))) (setq idx -1) (while (< (setq idx (1+ idx))(sslength ss)) (setq ent (ssname ss idx)) (setq totparam (fix (vlax-curve-getendparam ent)) i -1 r (getvar "circlerad")) (if (= r 0.0) (setq r 1.5);;adjust default Radius here ) (while (< (setq i (1+ i)) totparam) (setq pt (vlax-curve-getpointatparam ent i)) (entmake (list '(0 . "CIRCLE") (cons 10 pt) (cons 40 r) ;(cons 8 "circlelayer");set the layer here ) ) ) (setq pt (vlax-curve-getpointatparam ent (vlax-curve-getendparam ent))) (entmake (list '(0 . "CIRCLE") (cons 10 pt) (cons 40 r) ;(cons 8 "circlelayer");set the layer here ) ) ) (vla-endundomark (vla-get-activedocument (vlax-get-acad-object))) ) ) (princ) )
Thanks to the both of you. Miff, did you just write that? Worked well.
Rename the defun as needed
Code:(defun c:foo () (vl-load-com) (setq *model-space* (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))) (setq obj (vlax-ename->vla-object (car (entsel)))) (setq c (vlax-get obj "Coordinates") i 0) (repeat (/ (length c) 2) (setq x (nth i c) y (nth (1+ i) c)) (vla-addcircle *model-space* (vlax-3d-point (list x y 0.0)) 3.0) (setq i (+ i 2)) ) (princ) )
R.K. McSwain | CAD Panacea |
Yes & no.... I needed something similar last year so I wrote one that labeled the elevation of every vertex. I just took that and changed it to create a circle instead of text.....
You're welcome.
Coincidentally, that project that I needed it for was for Wetland creation......
Hey there Miff, you mentioned a program for labelling elevations at every vertex.....is that something you could post?Originally Posted by miff
Thanks
Just made a slight modification to the above post.Originally Posted by imblueflies
Works on 3D polylines.
Code:(defun c:foo () (vl-load-com) (setq *model-space* (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))) (setq obj (vlax-ename->vla-object (car (entsel)))) (setq c (vlax-get obj "Coordinates") i 0) (repeat (/ (length c) 3) (setq x (nth i c) y (nth (1+ i) c) z (nth (+ 2 i) c)) (vla-addtext *model-space* (rtos z 2) (vlax-3d-point (list x y 0.0)) 3.0) (setq i (+ i 3)) ) (princ) )
R.K. McSwain | CAD Panacea |
Hello everyone,
I want to create a lisp that you fill in the starting points of a profile made up of lines and arcs a text P1, P2, P3 ........... and direction of the arc R1, R2, R3 .... ...
and at the same time I fill up the table of coordinates and the ray of course in relation to the active coordinate system.
all objects within it should be ignored, while the external profile has to be moved to a new layer called F001
Who can help me with some advice?
dwg file in the attached sample.
The following may be of interest...
http://forums.augi.com/showpost.php?...03&postcount=5
http://forums.augi.com/showpost.php?...7&postcount=26