Rod-end lisp
Rod-end lisp
(OP)
Does any one out there have an Acad 2000 lisp routine for creating a typical 'break' symbol for use on elevations
of pipes, solid rouds etc.
Any info would be useful. Thanks in advace
of pipes, solid rouds etc.
Any info would be useful. Thanks in advace





RE: Rod-end lisp
RE: Rod-end lisp
;CUTUBE.LSP
;a command to show break symbol in a pipe or tube
;
;cutubex - routine to draw the curved lines as one polyline
(defun cutubex ()
(setq P1A (polar P1 A QD))
(setq P1A (polar P1A (+ A HPI) (/ QD 2.0)))
(setq P2A (polar P2 A QD))
(setq P2A (polar P2A (- A HPI) (/ QD 2.0)))
(setq P3A (polar P2A (+ A HPI) QD))
(setvar "blipmode" 0)
(command "pline" P1 "arc" "S" P1A P2 "S" P2A P3 "S" P3A P2 "")
(setvar "blipmode" 0)
)
(defun C:CUTUBE ()
(setvar "cmdecho" 0) ;turn off screen echo
(setq CL (getvar "clayer")) ;get current layer
(setq HPI (/ PI 2.0)) ;make half of PI a variable
(setq P1 (GETPOINT)) ;get first point
(setq P3 (GETPOINT)) ;get second point
(setq A (angle P1 P3)) ;angle between two picked points
(setq D (distance P1 P3)) ;distance between two picked points
(setq HD (/ D 2.0)) ;half the distance
(setq QD (/ HD 2.0)) ;quarter the distance
(setq P2 (polar P1 A HD)) ;find midpoint between picked points
(setq P1X P1) ;p1x used if wrong orientation
(cutubex)
(setq ans (strcase (getstring "\nChange orientation <y/N>? ")))
(if (= ans "Y") ;if yes do the following
(progn
(setvar "highlight" 0) ;turn of graphics higlighting
(setq P1 P3 P3 P1X) ;switch points
(setq A (angle P1 P3)) ;change angle between picked points
(command "erase" "L" "") ;get rid of wrong one
(cutubex) ;create the curves again
(setvar "highlight" 1) ;reset highlighting
)
)
(setq ANS nil) ;reset variable ANS to nil
(setq ANS (strcase (getstring "\nDarken half symbol <y/N>? ")))
(if (= ANS "Y") ;if yes, do the following
(progn
(prompt " wait..") ;takes a little while
(setvar "blipmode" 0) ;turn blips off
(setvar "highlight" 0) ;turn off highlighting
;create a closed curve to hatch
(command "pline" P2 "arc" "S" P2A P3 "S" P3A P2 "")
;hatch closed curve with 12 lines
(command "Hatch" "U" (rtd A) (/ QD 12.0) "N" "L" "")
(command "erase" "P" "") ;erase closed curve
(redraw) ;redraw screen
(setvar "blipmode" 1) ;turn blips back on
(setvar "highlight" 1) ;turn highlighting back on
)
)
(princ) ;quiet exit
) ;end of command
(defun rtd (a) ;routine for radians to degrees
(/ (* A 180.0) pi)
)
(princ)
RE: Rod-end lisp
Flores
RE: Rod-end lisp
Thanks for the offer. My e-mail is :
wilsondave@pbworld.com
Thanks to everyone that replied to the original post.