nababeer Posted March 16, 2014 Posted March 16, 2014 Hi there .. This lisp helps you to quick draw pile section and profile with annotation text around entities. Just drag & Drop. Command : "PILE" Please feedback )Pile.lsp Quote
asos2000 Posted March 19, 2014 Posted March 19, 2014 My 5 cents its better to use subroutine for creating Layers Text, ..... etc ;; Create a Layer (defun makelay (LName LColor LType) ; CAB (vl-load-com) (if (not (tblsearch "LTYPE" LType)) (vla-load (vla-get-Linetypes (vla-get-ActiveDocument (vlax-get-acad-object))) LType "acadiso.lin")) (if (not(tblsearch "LAYER" LName)) (entmake (list '(0 . "LAYER") '(100 . "AcDbSymbolTableRecord") '(100 . "AcDbLayerTableRecord") (cons 2 LName) ;layer name (cons 6 (if (and ltype(tblobjname "ltype" ltype)) ltype "Continuous")) ;linetype (cons 62 LColor) ;layer color '(70 . 0) ; on, unlocked, thawed ) ) )) (defun _makefonts (listoffonts wdth hght / doc font fntdir st) (vl-load-com) (setq doc (vla-get-activedocument (vlax-get-acad-object)) fntdir (strcat (getenv "windir") "\\Fonts\\") ) (foreach f listoffonts (cond ((or (setq font (findfile (cdr f))) (and (setq font (findfile (strcat fntdir (cdr f)))) (findfile font)) ) (setq st (vla-add (vla-get-textstyles doc) (car f))) (vlax-put-property st 'fontfile font) (vlax-put-property st 'width 0. (vlax-put-property st 'height 0.)))) (princ)) ;;; make a line (defun makeline (str end Ltp lyr ) (entmake (list (cons 0 "LINE") ; *** (cons 6 Ltp) ; Linetype name (present if not BYLAYER) (cons 8 lyr) ; Layer (cons 10 str) ; Start Point (cons 11 end) ; End Point (cons 39 0.0) ; Thickness (optional) default = 0 (cons 62 256) ; Color number (present if not BYLAYER); (cons 210 (list 0.0 0.0 1.0)))) ) ;; pre set to Middle Center (defun MakeText (G72 G73 HT LYR PT RO STR TSYL) (entmakex (list (cons 0 "TEXT") ;*** (cons 1 STR) ; * (the string itself) (cons 6 "BYLAYER") ; Linetype name (cons 7 TSYL) ; * Text style name, defaults to STANDARD, not current (cons 8 LYR) ; layer (cons 10 PT) ; * First alignment point (in OCS) (cons 11 PT) ; * Second alignment point (in OCS) (cons 39 0.0) ; Thickness (optional; default = 0) (cons 40 HT) ; * Text height (cons 41 1.0) ; Relative X scale factor, Width Factor, defaults to 1.0 (cons 50 HT) ; Text rotation angle (cons 51 0.0) ; Oblique angle (cons 62 256) ; color (cons 71 0) ; Text generation flags (cons 72 G72) ; Horizontal text justification type (cons 73 G73) ; Vertical text justification type (cons 210 (list 0. 0. 1.)) ; Extrusion direction (optional; default = 0, 0, 1) )) ;Group 73 | Group 72 ; | 0 1 2 3 4 5 ;3 (top) | TLeft | TCenter | TRight ;2 (middle) | MLeft | MCenter | MRight ;1 (bottom) | BLeft | BCenter | BRight ;0 (baseline) | Left | Center | Right | Aligned | Middle | Fit ) ;defun MakeText Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.