End view of pipe

End view of pipe

Anonymous
Not applicable
487 Views
3 Replies
Message 1 of 4

End view of pipe

Anonymous
Not applicable
try this one

(defun C:PIPEND ()
(setvar "cmdecho" 0)
(graphscr)
(setq e1 (car (entsel "\nPick circle for pipe end: ")))
(if e1
(progn
(setq e1 (entget e1))
(if (= (cdr (assoc 0 e1)) "CIRCLE")
(progn
(setq p1 (cdr (assoc 10 e1)))
(setq r (cdr (assoc 40 e1)))
(setq hPI (/ PI 2.0))
(setq qPI (/ PI 4.0))
(setq hr (/ r 2.0))
(setq p2 (polar p1 hPI r))
(setq p3 (polar p1 hPI hr))
(setq p3 (polar p3 PI hr))
(setq p4 (polar p1 (+ PI hPI) r))
(setq p5 (polar p1 (+ PI hPI) hr))
(setq p5 (polar p5 0.0 hr))
(setvar "blipmode" 0)
(command "pline" p2 "ARC" "S" p3 p1 "S" p5 p4 "")
(setq ans nil)
(setq ans
(strcase
(getstring "\nShade in half the symbol ? ")
)
)
(if (= ans "Y")
(progn
(command "pline" p2 "arc" "CE" p1 p4 "S"
p5 p1 "S" p3 p2 "")
(command "hatch" "U" 45 (/ r 12.0) "N" "L" "")
(command "erase" "P" "")
(redraw)
)
)
(setvar "cmdecho" 1)
);end prog
(prompt "\nEntity not a circle.")
);end if
);end prog
(prompt "\nNothing selected.")
);end if
(princ)
);end

Mick wrote:

> Hi, does anyone know where i can get a lisp routine that will draw a ying
> yang symbol to represent the end elevation of a pipe
>
> thanks in advance
>
> MICK
0 Likes
488 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
hey thats a great little tool.

if i wanted to add to it to get the user to draw a circle using 2 point then get this tool to draw the ying yang in that circle drawn. where would i put the code as to not mess this one up?

i tried adding the code
(command "circle" "2p")
at the start then changing the line
(setq e1 (car (entsel "\nPick circle for pipe end: ")))
to
(setq e1 (entlast)
but that didnt work. my knowledge is not that great as i have only just started experimenting.

any help would be great thanks.
0 Likes
Message 3 of 4

Anonymous
Not applicable
If you don't have some provision for user input to make the circle, in some line(s) following the
circle command line, then you probably need to do something like:
(command "circle" "2p" pause pause)

And you're missing a right parenthesis:
(setq e1 (entlast))

--
Kent Cooper


wrote...
hey thats a great little tool.

if i wanted to add to it to get the user to draw a circle using 2 point then get this tool to draw
the ying yang in that circle drawn. where would i put the code as to not mess this one up?

i tried adding the code
(command "circle" "2p")
at the start then changing the line
(setq e1 (car (entsel "\nPick circle for pipe end: ")))
to
(setq e1 (entlast)
but that didnt work. my knowledge is not that great as i have only just started experimenting.

any help would be great thanks.
0 Likes
Message 4 of 4

Anonymous
Not applicable
Beautiful!!

thanks
0 Likes