Does anyone have a lisp routine they'd like to share that draws storm pipes like barber shop poles.
I currently have one called pipe.lsp that draws storm pipes in tha Barber Shp Pole style, it prompts you for start and end points
then asks you the diameter of the pipe, then it draws in the barber shop pole linework for a storm pipe, "BUT" it draws the
storm pipe with 3 seperate line objects.
Anyone have an existing lisp that draws that barber shop pole style storm pipe as "1" object that you can pick and select
and get a lenght from???
Like this? This is what I got after following the instructions you gave, hopefully it is useful for persons assisting you.
Should look more like this. I'm trying to find a lisp that draws this as 1 object instead of 3. And prompts for the width of the pipe.
Thanks for further explaining.
What I would do is create a dynamic block with a stretch parameter and then write a short lisp routine to insert/modify it, as well as prompt for the width. Such a routine wouldn't be too difficult and would be an excellent exercise in code.
Take a shot, good luck.
search "insert dynamic block" in these forums and on google for help.
Post here if any questions.
Give this a look. Width would be controlled by linetype scale.
[By the way, a barber pole actually has spiraling stripes....]
@Anonymous wrote:
.... I was hoping the lisp experts out there may have already lisped this into a single object that can be listed for length and griped as one object rather than 3 separate lines.
Those things are true of objects drawn with that OSCH linetype in the thread I posted a link to [all of what you see in each color in the image there is a single object]. They do, of course, have the same disadvantages, such as they are, of all non-continuous linetypes, such as that if the overall length doesn't relate to a multiple of the definition cycle nicely, there will be portions at the ends that are plain-continuous.
Perhaps "group" the 3 lines? You may need to play with the ltscale for this to appear correct.
(defun C:test (/ os clt pw p1 p2 p3 p4 p5 p6 selset ) (setvar 'cmdecho 0) (setq os (getvar 'osmode)) (setq clt (getvar 'celtype)) (if (not (tblsearch "ltype" "dashed")) (command "-linetype" "l" "dashed" "acad.lin" "") ) (if (and (and (setq pw (getreal "\nSpecify pipe width: ")) (setq p1 (getpoint "\nSpecify first point: ")) ) (setq p2 (getpoint p1 "\nSpecify second point: ")) ) (progn (setq p3 (polar p1 (- (angle p1 p2) (/ pi 2)) (/ pw 2.0)) p4 (polar p1 (+ (angle p1 p2) (/ pi 2)) (/ pw 2.0)) p5 (polar p2 (- (angle p1 p2) (/ pi 2)) (/ pw 2.0)) p6 (polar p2 (+ (angle p1 p2) (/ pi 2)) (/ pw 2.0)) ) (setvar 'osmode 0) (setq selset (ssadd)) (command "_.line" p3 p5 "") (setq selset (ssadd (entlast) selset )) (command "_.line" p4 p6 "") (setq selset (ssadd (entlast) selset )) (setvar 'celtype "dashed") (command "_.pline" p1 "w" pw pw p2 "w" 0 0 "") (setq selset (ssadd (entlast) selset )) (command "-group" "create" "*" "" selset "") (setvar 'osmode os) (setvar 'celtype clt) ); progn ); if (princ) )
@smaher12 wrote:
Perhaps "group" the 3 lines? ....
If grouping serves the purpose, the same could be done with any appropriate kind of entity [Line, Polyline of however many segments, or (however unlikely) Arc], without the need to calculate all those endpoints, nor worry about either object snap or whether the linetype exists in the drawing yet, if after drawing the center-line path of the pipe, you apply this [lightly tested]:
(defun C:MIP (/ pipesel pw pipe selset isPoly pipeobj) ; = Make [existing object] Into Pipe
(setvar 'peditaccept 1); [save first and restore later if preferred]
(if
(and
(setq pipesel (entsel "\nSelect pipe-route object: "))
(not (redraw (car pipesel) 3)); highlight
(setq pw (getdist "\nPipe width: "))
); and
(progn
(setq
pipe (car pipesel)
selset (ssadd)
isPoly (wcmatch (cdr (assoc 0 (entget pipe))) "*POLYLINE")
pipeobj (vlax-ename->vla-object pipe)
); setq
(vla-offset pipeobj (/ pw 2)) (ssadd (entlast) selset)
(vla-offset pipeobj (/ pw -2)) (ssadd (entlast) selset)
(command
"_.chprop" pipe "" "_ltype" "dashed" ""
"_.pedit" pipe "_width" pw ""
); command
(ssadd (if isPoly pipe (entlast)) selset); (entlast) only if converted Line/Arc
(command "-group" "create" "*" "" selset "")
); progn
); if
); defun
Consider also whether to force an appropriate Layer, or force Continuous linetype on the sides, in case the initial object isn't Continuous. It could use object-type constraints in selection. You could incorporate means to convert even Circles or Ellipses or Splines into Polylines in order to give them width, but in piping drawings that doesn't seem necessary, as even Arcs or Pline arc segments may not be. I suppose you could also have the drawing of the center-line object inside the routine, but that gets more complicated [but is certainly doable] if you want options for entity type. And of course error handling, etc....