;;;Place a pipe section symbol (yin-yan, sans the dots) in an arc or circle. ;;;(uses YINYAN.DWG) ;;; ;;; AUTHOR: HENRY C. FRANCIS ;;; 425 N. ASHE ST. ;;; SOUTHERN PINES, NC 28387 ;;; ;;; All rights reserved without prejudice. ;;; ;;; Copyright: 6-18-94 ;;; Edited: 1-14-2008 ;;; (DEFUN psct_error (msg / ) (SETQ *error* oldpsct_error) (IF pcent (PRINC "\nPSCT Error: ") ) (PRINC msg) (PRINC) (SETVAR "osmode" oldpsct_osmode) (SETVAR "clayer" clayr) (SETVAR "cmdecho" oldpsct_cmdecho) ) (DEFUN c:psct (/) (SETQ oldpsct_error *error* *error* psct_error oldpsct_osmode (GETVAR "osmode") oldpsct_cmdecho (GETVAR "cmdecho") bname "yinyan" aname (STRCAT bname ".dwg") clayr (GETVAR "clayer") pcent T ) ;_ end of SETQ (IF (OR (FINDFILE aname) bname) (PROGN (SETVAR "osmode" 0) (SETVAR "cmdecho" 0) (WHILE pcent (SETQ pcent nil) (IF (AND (SETQ pcent (NENTSEL "\nPick pipe circle or arc ")) (OR (= "CIRCLE" (CDR (ASSOC 0 (ENTGET (CAR pcent))))) (= "ARC" (CDR (ASSOC 0 (ENTGET (CAR pcent))))) (= "ELLIPSE" (CDR (ASSOC 0 (ENTGET (CAR pcent))))) ) ;_ end of OR ) ;_ end of AND (PROGN (COND ((OR (= "CIRCLE" (CDR (ASSOC 0 (ENTGET (CAR pcent))))) (= "ARC" (CDR (ASSOC 0 (ENTGET (CAR pcent))))) ) ;_ end of or (SETQ ccen (CDR (ASSOC 10 (ENTGET (CAR pcent)))) cdia (* (CDR (ASSOC 40 (ENTGET (CAR pcent)))) 2) cirl (CDR (ASSOC 8 (ENTGET (CAR pcent)))) ) ;_ end of setq ) ((= "ELLIPSE" (CDR (ASSOC 0 (ENTGET (CAR pcent))))) (SETQ ccen (CDR (ASSOC 10 (ENTGET (CAR pcent)))) cirl (CDR (ASSOC 8 (ENTGET (CAR pcent)))) ellipse_ang (COND ((EQUAL (CADDR (ASSOC 11 (ENTGET (CAR pcent))) ) ;_ end of CADDR 0 0.00001 ) ;_ end of EQUAL 0 ) ((EQUAL (CADR (ASSOC 11 (ENTGET (CAR pcent)))) 0 0.00001 ) ;_ end of EQUAL (* PI 0.5) ) (T (+ (* 180.0 (/ (ATAN (/ (CADDR (ASSOC 11 (ENTGET (CAR pcent)) ) ;_ end of ASSOC ) ;_ end of CADDR (CADR (ASSOC 11 (ENTGET (CAR pcent)) ) ;_ end of ASSOC ) ;_ end of CADR ) ;_ end of / ) ;_ end of ATAN PI ) ;_ end of / ) ;_ end of * 270.0 ) ;_ end of + ) ) ;_ end of COND ellipse_ydia (* (DISTANCE (CDR (ASSOC 10 (ENTGET (CAR pcent)))) (POLAR (POLAR (CDR (ASSOC 10 (ENTGET (CAR pcent))) ) ;_ end of CDR 0 (CADR (ASSOC 11 (ENTGET (CAR pcent))) ) ;_ end of CADR ) ;_ end of POLAR (* PI 0.5) (CADDR (ASSOC 11 (ENTGET (CAR pcent))) ) ;_ end of CADDR ) ;_ end of POLAR ) ;_ end of DISTANCE 2.0 ) ;_ end of * ellipse_xdia (* (CDR (ASSOC 40 (ENTGET (CAR pcent)))) ellipse_ydia ) ;_ end of * ) ;_ end of SETQ ) ) ;_ end of COND (WHILE (WCMATCH cirl "*|*") (SETQ cirl (SUBSTR cirl 2)) ) (IF make_layer_ent NIL (LOAD "make_layer_ent" "\nFile MAKE_LAYER_ENT.LSP not loaded! ")) (make_layer_ent (LIST (CONS 8 cirl))) (COMMAND ".layer" "S" cirl "") (COND ((OR (= "CIRCLE" (CDR (ASSOC 0 (ENTGET (CAR pcent))))) (= "ARC" (CDR (ASSOC 0 (ENTGET (CAR pcent))))) ) ;_ end of OR (COMMAND ".insert" bname ccen cdia cdia "0") ) ((= "ELLIPSE" (CDR (ASSOC 0 (ENTGET (CAR pcent))))) (COMMAND ".insert" bname ccen ellipse_xdia ellipse_ydia ellipse_ang ) ;_ end of COMMAND ;_ end of COMMAND ) ) ;_ end of COND ) ;_ end of PROGN (PROMPT "\nEntity not a circle or not selected. ") ) ;_ end of IF ) ;_ end of WHILE ) ;_ end of PROGN (PROMPT (STRCAT "\nBlock " bname " or File " aname " not found! \n") ) ;_ end of PROMPT ) ;_ end of IF (SETVAR "osmode" oldpsct_osmode) (SETVAR "clayer" clayr) (SETVAR "cmdecho" oldpsct_cmdecho) (SETQ *error* oldpsct_error) ) ;_ end of DEFUN ;|«Visual LISP© Format Options» (72 2 40 2 T "end of " 60 9 2 1 0 nil T nil T) ;*** DO NOT add text below the comment! ***|;