|
|
Upload
| >> Mô tả tóm tắt nội dung file: |
Bộ AutoLISP chiến đấu Do kts. Trần Ngọc Thắng TỰ BIÊN SOẠN + SƯU TẦM dùng được cho AutoCAD Version Hight : Bổn CỐC CHỦ TUYỆT TÌNH CỐC : Ngưỡng mộ Long Cô Nương phái Cổ MỘ : Chờ Chết Sắp Sẵn Quan Tài Trong Mộ ĐÓ _-_-_ ^ _-_-_ Dại Gì Mà Chuyển Nhỡ Mai Này Tôi Chết Còn Có Cái Mà Dùng . . . Năm Nay Tôi Gặp Tuổi Hạn 49 tuổi . Các Cụ Nói 49 chưa qua 53 đã tới . . . Bó Tay Các Bác Luôn . . . Mà Xem Sách Các Thầy PHÁN TÔI RẰNG tôi thọ chỉ có 68 tuổi là tôi chết . . . còn những 19 năm nữa tôi mới đến số tuổi chết . . . Cũng Lâu Đấy Chứ các Bác ./. Chuyện Mã Lương vẽ giỏi đẹp . . . Được ông Bụt hay ông Tiên tặng cho cây Bút Thần : ông Dặn Mã Lương hãy vẽ Giúp Người Nghèo . . . LỆNH VẼ KHUNG TÊN ~ Tiêu Diệt Lệnh : Lệnh Xé Xác thằng Bé Ra Làm 100 Mảnh : Uống Máu - Ăn Gan : Mới Hả Giận |
| >> Tác giả: |
kiến trúc sư . Trần Ngọc Thắng [ đổi đường dẫn đến thư mục chứa LISP ngắn đi nếu dài quá không đọc được ] |
| >> Loại file: |
word Ảnh (jpg, png..) Khác (Nếu file nén thì hãy cho biết loại file gốc trước khi được nén.) |
| >> Link Files trên web khác (nếu có): |
https://www.cadviet.com/forum/topic |
- <a href="https://www.mediafire.com/file/czicu7v2hdd904k/Library_2008_TnT_For_AutoCAD.zip/file">Library 2008 TnT For AutoCAD</a><a href="https://www.mediafire.com/file/czicu7v2hdd904k/Library_2008_TnT_For_AutoCAD.zip/file">. e/ g0 v+ e$ q/ {3 a
Sao chép mã ********************************************************************************
5 O) J3 M& l' Q$ l# ?/ G* ACADLISP FOR AUTOCAD R.14 -> AUTOCAD R.2012 * D. [! L9 K i, t' o
* Tran Ngoc Thang DHXD-HaNoi41 from years 1999 -> 2015 *
8 g/ ^ N# D3 M M: F* Suu tam & Soan *
: x2 Z; {5 p8 m* W: m5 |2 o********************************************************************************
. W) V" [" r7 e5 P. t* a, C1 b r6 l6 T9 p1 n) x Y
; Next available MSG number is 104
$ {: S; @- T2 P/ z, C' D; MODULE_ID ACAD2000doc_LSP_7 E, U* X; e& d1 L1 u u7 \
;;; ACAD2000DOC.LSP Version 1.0 for AutoCAD 2000
+ p" U* f6 Y3 J1 N4 A;;;
5 O( W) M4 r0 q/ b;;; Copyright (C) 1994 - 1999 by Autodesk, Inc.0 x3 u. F" W; k
;;;% ~( L5 W7 i4 X$ `+ ?% D
;;; Permission to use, copy, modify, and distribute this software
8 r+ A9 r2 K; M; \;;; for any purpose and without fee is hereby granted, provided2 ~9 ^; Q+ l; \8 Y& ]0 ?4 _ U
;;; that the above copyright notice appears in all copies and5 h" S3 i6 G4 K# l1 M
;;; that both that copyright notice and the limited warranty and
' B& [: G& |1 b, }0 M;;; restricted rights notice below appear in all supporting) T+ u1 B0 j/ P& P
;;; documentation.
3 X' P1 X* u# u0 i# t: ^' b0 @;;;
. z. y' R( G. x;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.5 h$ ^/ F! S: U4 W
;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF' j! B4 B, t+ }. M ^& b8 {/ H. k
;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.. Z: w' [' ~# V8 c
;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
3 W' Q! }; s! O* V;;; UNINTERRUPTED OR ERROR FREE.
" l+ k, I3 }3 u8 U& z0 _: ];;;
7 Q9 Q3 E. d( Y% }" J4 b;;; Use, duplication, or disclosure by the U.S. Government is subject to! E+ w1 E3 H1 s6 o6 f1 z( P4 U+ _
;;; restrictions set forth in FAR 52.227-19 (Commercial Computer' p1 v0 B, _/ e4 r `& p% b( E. F& F
;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
- q$ C2 T4 F7 w4 h2 H& M1 ^- A;;; (Rights in Technical Data and Computer Software), as applicable.
* i" f" Q' A% T- ^; H;;;: a: s2 |0 l* F' K
;;;.6 K. L0 q9 x T, p
;;;2 ~6 k0 D) r$ o+ g' Y6 F. s% j6 S
;;; Note:
4 w: j* L( L" A; Q' K$ n;;; This file is loaded automatically by AutoCAD every time : {" T/ v6 U6 p" R! `1 B2 x
;;; a drawing is opened. It establishes an autoloader and
( z4 T7 W C# j* D! f;;; other utility functions.5 _4 p' X0 q' y" p% q% n
;;;
( ~4 A) ^( G5 P;;; Globalization Note: 9 O& x( W: K6 A) U( c
;;; We do not support autoloading applications by the native
2 j, m c2 G( o5 k. G& \* F% o9 Z! e;;; language command call (e.g. with the leading underscore$ T: e3 v" m$ y
;;; mechanism.)! h) H* s5 Y | P. N
5 Q' v) p, g$ Z8 W; i! V1 l3 W3 H& n8 x
;;;===== Raster Image Support for Clipboard Paste Special =====
, N' S5 H) m: u: d+ y6 Z1 W$ G/ ~;;! Y' j7 l3 K i9 }1 s; B1 M
;; IMAGEFILE. [- H U4 e9 R2 L6 j9 m
;;
) b/ L; t8 U$ m;; Allow the IMAGE command to accept an image file name without# `9 N2 f! ]$ s9 G, r" D6 {* R
;; presenting the file dialog, even if filedia is on.5 `' c( i+ `* I; a' T- y+ {- h
;; Example: (imagefile "c:/images/house.bmp")
; Q9 f, X8 _* h# L6 s;;( y$ U% _' m6 R4 ~% |9 Q7 l# @& t
(defun imagefile (filename / filedia-save cmdecho-save)% E7 N h1 D) u, M$ P; z
(setq filedia-save (getvar "FILEDIA"))
" v6 T8 a! l K. m8 r$ v3 T0 X (setq cmdecho-save (getvar "CMDECHO"))
0 f; } c" R! `' y; a: F+ @ (setvar "FILEDIA" 0)
2 D5 R6 C# u$ z9 y t. j (setvar "CMDECHO" 0)& C8 c- u2 s8 t: I
(command "_.-image" "_attach" filename)
' k& e |( X# h, r' k+ a (setvar "FILEDIA" filedia-save)! b0 e. q* m' O5 L K- ], N Y b
(setvar "CMDECHO" cmdecho-save)' m' ]' ]: p Z* q2 @* J
(princ)
/ C3 m& ~; P2 f; P- p6 c# N8 b)8 ~! h2 o) M' w; [9 y: c
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9 S1 P9 O( l+ q$ }
; Next available MSG number is 11
9 I+ u) p" ^* A5 [$ b& A$ z; MODULE_ID DDVPOINT_LSP_2 }& b8 X# N1 \
;;;7 {. T! R$ v( s4 `! }' F
;;; ddvpoint.lsp; M$ ]6 I- t3 D* Q p7 N/ G6 o! z
;;;
2 h( s$ Z$ v( o6 i;;; Copyright 1992,1994,1996-1998 by Autodesk, Inc.3 `# o2 h) F1 G6 X6 t/ |4 W% w/ i
;;;
3 g% v- ?: g1 i1 _/ V# A: z( R;;; Permission to use, copy, modify, and distribute this software
5 X/ ~/ y. q' C;;; for any purpose and without fee is hereby granted, provided0 J; P7 q S) {
;;; that the above copyright notice appears in all copies and' w! O, _0 O# ~( L/ ?
;;; that both that copyright notice and the limited warranty and
5 b% O# x4 n' o;;; restricted rights notice below appear in all supporting
: s* R2 ^/ x7 G, F) M' i;;; documentation.
; ~- ^8 R2 h9 @* @! @;;;( G( @* m* P; A! T
;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
; |% K# Z" [. c% m4 p;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
' D* {( Q% X0 e8 ]/ Q;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.6 x7 S+ A5 D/ }( {2 G4 ]
;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE: O5 A5 j4 s- }6 q( n6 p* F3 R' j
;;; UNINTERRUPTED OR ERROR FREE.
2 E: _( L- x7 A( Q {7 X;;;
3 e" t( e) p( x+ ?$ V;;; Use, duplication, or disclosure by the U.S. Government is subject to; q8 M9 o! k9 C0 ]% Z
;;; restrictions set forth in FAR 52.227-19 (Commercial Computer- w9 Z5 I0 Z2 R0 `9 n) l3 G
;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) + Q$ _" }3 D7 [+ B0 |4 G
;;; (Rights in Technical Data and Computer Software), as applicable.
5 \6 n' x, c$ I# f0 e( o;;;
5 Z+ I) n% H0 t1 J;;;.0 O1 Q; G" S/ i5 e( k, L* V% ?4 F
;;; C DVPOINT - 3D Viewpoint presets dialog.
+ P% M# w& ?# Y: H6 G/ z8 g. N i2 E;;;
! M+ f* o$ {# ?) m% e;;; Uses DDVPOINT.DCL for the dialog definition. G' u; ^; f' l! d2 F/ f
;;; The slide image is in ACAD.SLB.; s& P& \9 V5 Z* s" a1 l
;;;9 I7 {- H7 H2 x
;;; ===================== load-time error checking ============================
% i5 s8 u A# D a. f;;;7 g- x: K1 `# o0 _7 q: ]; ?2 E6 d
6 ?1 i5 V/ R0 U. m( H2 G( w1 U9 o
(defun ai_abort (app msg): A3 W3 B% ?8 M* y5 w" M$ c
(defun *error* (s)
2 i4 w/ H& }" x8 e1 } (if old_error (setq *error* old_error))
7 _4 x$ m) R+ A# G5 w$ T (princ): i1 _6 V6 f6 U" b5 y/ ?8 G. R+ r2 g8 B
)
4 C1 g7 F5 M( h& |1 a& Z$ G' n (if msg
9 l7 x4 _; P8 b (alert (strcat " Application error: "! T; e4 h! _0 C$ f: b/ o- a: r
app7 y' t' w+ B# b. ]1 n2 ?
" \n\n "
9 Z/ w. T) d& p1 }" _" S msg
" X$ Y2 [/ m- J/ Q- z1 S# B. @ " \n"* c# B+ J9 }- P8 e( R& v
)
. u8 r" x. Q' m) P/ A8 q4 f )) c/ F$ k8 Q& D p+ L# \( @# H# M
)
: r0 N2 q) _% s0 E- G (exit)
: L8 \# h: D- d) A ). ]: a" M+ j4 y+ ?8 t4 t7 h
1 W! G! q; ~$ X0 l
;;; Check to see if AI_UTILS is loaded, If not, try to find it,1 G, ~9 Y/ a2 ^# o/ P+ R4 X
;;; and then try to load it.$ z" Y4 L8 k! T# ~4 ^) L! s
;;;
4 n8 _" t0 A5 w% x. W;;; If it can't be found or it can't be loaded, then abort the
# p# a+ \0 M7 ?4 I }( @2 `, M6 L;;; loading of this file immediately, preserving the (autoload)% A" ]. {% D* Y: y$ I
;;; stub function.) A3 E( R* I% e7 ?
0 Z; D2 k" f$ z- j! H
(cond
; t% ^1 y6 ~& |, u1 L; r4 Q ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.' n" J; N+ k% g8 j6 F4 a
) E, ?3 D3 c- q3 f. W: C& l ( (not (findfile "ai_utils.lsp")) ; find it
4 i0 H* ^7 `" Z# L+ T& V! D* l (ai_abort "DDVPOINT"
# a5 t3 n9 R. A0 }* w (strcat "Can't locate file AI_UTILS.LSP." N" z; L; [0 F+ @5 a9 I6 O4 Z
"\n Check support directory.")))) F9 M- P8 K P0 a3 V0 I6 e
6 z1 }1 |) N$ E4 Q! X9 K& G( d! W/ v! D
( (eq "failed" (load "ai_utils" "failed")) ; load it0 ~4 U% S0 L. p. T; [' _% K( u# T
(ai_abort "DDVPOINT" "Can't load file AI_UTILS.LSP"))! a" K+ r1 a- H' Y1 r+ g0 x
)8 | E4 E/ R: H5 { y3 _( B
6 [7 m! F* ?8 P* u) M5 o- T3 S, C
(if (not (ai_acadapp)) ; defined in AI_UTILS.LSP v+ E& a; J! Q5 o
(ai_abort "DDVPOINT" nil) ; a Nil <msg> supresses* s5 z9 c2 j2 W9 q) N2 W2 G. x
) ; ai_abort's alert box dialog.8 G! U" C/ d' c2 ?5 k
" U( ~/ T# c# S5 G$ R- b
;;; ==================== end load-time operations ===========================3 P3 @3 ?7 f$ H9 N5 y( \
0 C+ I. V# n, X: x% a(defun ai_ddvp_start ( / image_x image_y image_h slide_x slide_y slide_h program)" ]' v0 F9 i& R+ m
;; Get program name
) {: ]0 o4 D2 Y; y% Q (if (not (setq program (getvar "program")))
: ?+ R9 e4 r0 m6 K3 Q4 q (setq program "acad")
1 q+ D( W% j+ |/ ~' u. J )
$ q+ G8 e+ H7 `! V f. | (start_image "ddvp_image")
; L% \$ W: x& g* e (slide_image
+ R5 v- q; B/ D: e2 o 0 0
+ k3 k6 V: `! L9 Z8 \ (- (setq image_x (dimx_tile "ddvp_image")) 1)
9 W( l+ X& z4 ~" a6 R- s (- (setq image_y (dimy_tile "ddvp_image")) 1); t9 v8 w8 h7 Z- K. x
(strcat program "(ddvp3d)")5 _: b! D* I+ j1 u% C& |
)# l3 [" m2 a: @4 k% A) r
(end_image): B9 ^7 }4 _3 X8 _0 M6 y
(setq
( h4 \) x2 i. {. L9 H image_x (float image_x)
$ N" H7 B3 x l8 d4 ? image_y (float image_y)
+ u& x7 S, O, q4 {6 @. t slide_x 12.4265) m, Y6 e! i7 v e# D4 D
slide_y 9.0
2 @2 L% ^6 S+ N' v% L image_h (/ image_x image_y)% W' K4 B* l& ^- q
slide_h (/ slide_x slide_y) O9 {" w7 z2 S& }/ @" m0 E
)3 g1 ]3 h/ B1 ?+ u
(if (< slide_h image_h)
1 u- o' _+ |. M7 o5 Q (setq slide_y image_y
. r6 @- b# M) A8 M slide_x (* slide_y slide_h)
7 V9 M+ E! Q0 e. o )
: [- x# @# [3 o5 p' ^( f1 J* |% l (setq slide_x image_x
$ O4 w2 W7 Z: g+ @8 N; a( M2 t slide_y2 (* slide_y (/ image_x 12.4625))8 U. x J. E8 w- `1 ~7 k2 }5 G( h
image_y2 (/ image_y slide_y2)' a F6 P n& O/ @
slide_y (* slide_y2 image_y2)8 J+ I0 J/ ^% X) b& J
! r8 a6 A1 i1 ?7 F )& S; l1 y$ h( A; D" _' V4 N) c: {
)' o! ^. X* g6 m" A$ [
(setq ai_ddvp_bx (fix (* 0.295 slide_x)), I. W j/ e: C- ^' w0 S
ai_ddvp_ax (fix (* 0.65 slide_x))
0 P! a" n. q+ \: f ai_ddvp_by (fix (* 0.4875 slide_y))3 G" o/ ?) j0 S
)- k* n" y; z2 `4 H; @
)) j0 c6 D; n2 y4 `, n; @" `5 I7 C2 }
' r1 P( e) G8 W2 e
(defun ai_rtd (arg)
2 b: H( Z8 P! b& E; [3 {6 T. x2 o (/ (* arg 180.0) pi)* g/ ?* M/ u: f/ C2 |
)0 |% N* p5 w! F; [) z) ^! m
2 ^9 H9 {$ o B7 ~2 I6 S4 A
(defun ai_dtr (arg)
P) z s7 [- l* x$ {, k7 | (* pi (/ arg 180.0))
. X# H6 Y* ]+ u2 F0 |* L' `/ D)% Y2 U, N. J- d9 ]' y; Q1 U8 |
$ Z0 q2 S* s2 `& f6 N(defun ai_ang3dv (v1 v2)
! I; R' x0 @; t& X! f/ f' [ ? (if (not (equal v1 v2 1e-12))
' J: l( P& u0 }, @/ I' h1 ^ (ai_arccos s7 T* e+ z) E2 w- G
(/ (ai_dotp v1 v2)
: V% A+ t) H$ i5 ^0 x. h0 ` (* (sqrt (ai_dotp v1 v1))
) z2 k v. s+ g0 f u7 E (sqrt (ai_dotp v2 v2))" W1 ~) F1 g3 M
)
6 i6 Q7 j4 |3 b% ]( u: }- L )
) n( B5 e0 f% Y )+ t) q7 Q' Y5 D1 ?" I" A; [! F
(eval '0.0)5 z/ q) A; n# t/ n8 g
)5 E/ Z$ U0 L j# g7 @+ s1 c) [2 h
)+ R* D' h! t. i0 y$ V) G( [
- y+ |. H% n* U6 H) |
(defun ai_arccos (ang)) t( _& ^9 o; p* _) }
(if (not (equal ang 1.0 1e-06))
L1 w/ P' l3 c2 _; x& O (if (not (equal ang -1.0 1e-06))
+ a4 p \3 R( `9 k+ T' q (atan (sqrt (- 1.0 (expt ang 2.0))) ang)+ T% A% f6 ?2 |) h! U
(eval pi)% C/ D. D: V$ u( O) H9 h' C
)
; z3 _, `. E/ |+ N6 f+ O (eval '0.0), }4 [( {7 j+ v g8 S
)
9 v/ H: g9 @3 @7 Z/ \)8 {7 D) L# x$ S% _/ L: n2 [ v" }# V
, W4 i3 ]# E4 z3 k(defun ai_dotp (v1 v2): e X3 J" u1 [7 C0 [& p0 r
(+
" y& ?- {! \: R/ q (* (car v1) (car v2))
8 _1 A2 O/ Q) Q$ P (* (cadr v1) (cadr v2))
$ Z1 o: e! h! @2 e+ o) {5 } (* (caddr v1) (caddr v2))$ s. k N6 H3 E/ m
)
9 u) M, D6 y) C+ U8 U) A)
8 @: U/ b ]: h1 v' h% }% H4 b+ ]4 t5 `( t- X/ p
(defun ai_ddvp_do ()
$ l& y; Y- X. A (if (or (>= ai_ddvp_b_curr 360.0)
! B5 i0 h6 A/ y! D3 i2 P7 O (< ai_ddvp_b_curr 0.0)% Q7 r$ g) v; I2 s: L8 F" h w
(null ai_ddvp_b_curr)
7 b% I2 K0 p& u5 n2 L+ k )8 Y V# u, }0 J3 q0 {. I
(progn+ C: {2 t0 G5 F' J: Y" r$ i; H7 r9 F- G1 z
(ai_ddvp_drx ai_ddvp_b_last ai_ddvp_bx 0)) }# J6 a( c3 \# g
(ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 1)
+ w' g. w/ r% E3 F+ E8 z (mode_tile "ddvp_val_x" 2)6 g9 c; j" ]2 x. D9 p
(set_tile "error" "Invalid angle from X axis.")
+ j. r0 g( T& `6 g- S* _1 c )
- k! ~: L/ D. o7 ]8 U (if (or (> ai_ddvp_a_curr 90.0)
0 u9 [, u5 A# {: K (< ai_ddvp_a_curr -90.0)
; S) d/ Z! x7 l4 x1 J (null ai_ddvp_a_curr). W9 {' F% H6 s9 X5 }5 \$ w
)0 g9 w b) u' [6 }
(progn
/ a. ^7 `6 ?, s5 x8 h+ L4 a! }$ z (ai_ddvp_drx ai_ddvp_a_last ai_ddvp_ax 0)% e: d8 s0 P j9 K
(ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 1)% t7 Y |: b- _5 @. w p) W% m7 f
(mode_tile "ddvp_val_xyp" 2)
8 S5 \& u# m: @& y$ `6 W (set_tile "error" "Invalid angle from XY plane.")2 t$ x8 v+ u' K4 P
)* t3 `- h! W6 R6 C5 F3 C. f
(done_dialog 1)
5 H/ K' t6 a" J- d/ e2 o- Q )
3 v8 Q6 g6 L8 s )
1 E- x$ X3 T& W1 D. a)9 k5 O6 V' c& T# {) b& X! @1 F
/ k- w/ S# M6 n9 p7 y% x; m7 ](defun ai_ddvp_set_a (ang) P7 i) `: p* a7 F
(setq ai_ddvp_a_curr ang)
. a' Q4 {. n3 F y J (if (or (> ang 90.0)
9 _9 E' ~: K8 f (< ang -90.0)) I/ ^% }1 a7 i9 e% v( \- {3 G
(null ang): v$ X* U2 S+ O
)
* c7 {( Z, N# L z7 j (progn% S7 c* T" w/ W& Y. J- r2 c% b# X
(ai_ddvp_drx ai_ddvp_a_last ai_ddvp_ax 0)4 |6 u0 f. r( s* `3 H' y; F* C
(ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 1)
% f1 J5 b5 a) U1 F3 W9 g6 l (set_tile "error" "Invalid angle from XY plane.")+ {8 y5 f5 h! f8 @& v/ C' M- E
)/ v& i$ l0 a/ g9 I( [7 B
(progn
9 ^0 @/ @- {" u (set_tile "error" "")
2 Q0 v7 ^5 Y' L$ i; L (ai_ddvp_drx ai_ddvp_a_last ai_ddvp_ax 0)8 |4 F: e0 A: e5 i8 M+ R: Z
(setq ai_ddvp_a_last ai_ddvp_a_curr ai_ddvp_t T)4 s4 Z4 P4 E* w- p
(set_tile "ddvp_val_xyp" (rtos ai_ddvp_a_curr 2 1))
$ i* L% [4 l( X, `# B' n (ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 1)" H5 ]- T7 B+ S4 p8 D
(ai_ddvp_drx ai_ddvp_a_curr ai_ddvp_ax 7)+ g5 H: ?$ E/ P, b' K) b/ v
)& d' b# p9 Y$ u7 O I9 f) O" {
): A1 h: I6 R9 R
)
0 k9 V2 }! U# T# r# G- o
! b2 k! q7 R3 q$ {! D(defun ai_ddvp_set_b (ang)
0 ]" @. z3 h1 f) a- D6 K (setq ai_ddvp_b_curr ang)- {, O; H* Z# k; {8 y, d$ p
(if (or (>= ang 360.0)6 j( T/ z/ r. ^9 K/ T6 b( A6 }; {# ?
(< ang 0.0)9 G+ S3 V; |" H5 ]
(null ang)
; ]# a) F e# S" ? )
- h5 T, ]: x. _0 D; v' g' t% R (progn$ N8 x. u! \5 g' y
(ai_ddvp_drx ai_ddvp_b_last ai_ddvp_bx 0)- `% Q9 Z' |$ S3 j
(ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 1); J6 |: V4 M. U5 y7 N
(set_tile "error" "Invalid angle from X axis.")+ e5 h* o- T9 w# Q4 d
)1 |3 O: ?7 ]" H
(progn2 K0 i3 R& c" ]
(set_tile "error" "")9 T0 t/ K, R; D
(ai_ddvp_drx ai_ddvp_b_last ai_ddvp_bx 0)2 Y0 L0 s) K( A5 p+ E$ S
(if (= ang 360.0)
- A% D9 t6 b( z" E* u, C (setq ai_ddvp_b_curr 0.0
# \% B" A# b+ g4 r. Z( u* o ai_ddvp_a_curr 90.0 6 l( Y: o2 a3 ? V- p
ai_ddvp_p T0 k$ Q! D* P% `
ai_ddvp_b_last ai_ddvp_b_curr4 u$ n/ A8 G1 j! f
)
9 e' P! ?$ }8 Z [! J/ [ (setq ai_ddvp_b_last ai_ddvp_b_curr ai_ddvp_t T)
/ p" B, d* g7 Y5 X) v6 ~ ): X3 w. @. z# `! y8 r
(set_tile "ddvp_val_x" (rtos ai_ddvp_b_curr 2 1))
6 A' f4 g* m' s t+ _; h (ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 1): u E9 y: {. _' |* E% ?
(ai_ddvp_drx ai_ddvp_b_curr ai_ddvp_bx 7)
1 r1 U- v- |" E; A ), G! s& R0 j5 g3 _5 |% \0 T
)
$ O& ]* U }' v)/ o0 D# M; k* x l& c/ N
1 Q9 {4 R$ }& U9 ](defun ai_ddvp_drx (ang x1 col / a x2 y2)! x& K' a: Z1 e, ?6 ^ i7 [7 J
(setq a (polar (list 0.0 0.0) 4 w' v3 Q. U0 z4 P# j% m
(- (* 2.0 pi) (ai_dtr ang)) ! \6 y, S) F' r- k- L9 q' I
25.0
, v! v9 ^( Y$ I0 E: @ )+ q/ K8 ^# K/ q! |
x2 (+ x1 (fix (car a)))
& p+ \6 [' C4 Y) e# e y2 (+ ai_ddvp_by (fix (cadr a)))
6 n5 O- o6 U9 [8 E8 q1 d/ Z' B$ @) b )8 g0 @9 C) u2 g7 J
(start_image "ddvp_image")) o! o5 l: w" T. ~* ~
(vector_image x1 ai_ddvp_by x2 y2 col)4 w& E& M6 D+ y& X: u) f4 S6 f
(end_image)
, z) s! C2 p" F z, m' J" |; h" l)8 P+ a$ s7 t' ]1 G: {3 y3 y8 g, P
5 e3 V; A: b5 ^ T(defun ai_ddvp_image (x y / ang1 ang2 list_xy list_axby list_bxby)$ ]7 f8 R9 K7 C
(setq list_xy (list x y)
1 y( H! |; o" ?4 Y list_axby (list ai_ddvp_ax ai_ddvp_by)
+ q6 C4 w! T7 I( @& v0 A list_bxby (list ai_ddvp_bx ai_ddvp_by)0 z: B3 W I# ] V& L2 M( h
)6 Q) j8 U5 X4 I# \) c# |% g
(if (> x (- ai_ddvp_ax 1))! c8 X7 Z1 ?0 e* F( L; Z
(progn% }* T) D x7 ~% V& S. C0 k
(setq ang1 (ai_rtd (- (* 2.0 pi) (angle list_xy list_axby)))) S5 s; _! n- _/ ]
(if (< 90.0 ang1)
1 i9 K0 N5 m3 w0 a* B& N* g& i: o: S (setq ang1 (- ang1 180.0)). i! V* _+ r7 Z/ d# |4 v- X5 Z; n
)
& H/ _' S4 s# ~- i (if (< (distance list_xy list_axby) 40)9 c8 f* t3 x0 x
(ai_ddvp_set_a ang1)4 V; }. s9 a: s* f$ H( k3 i1 m+ A/ h: `
(if (< (distance list_xy list_axby) 84)
# R& L8 M# w7 X (cond ((= ang1 0.0). Q1 o7 r. g$ a; J8 U# W
(ai_ddvp_set_a 0.0)
$ i$ b, Y* u2 k7 J ` )
% ~/ g# u8 t0 `* ~ ((< ang1 -72.0)
+ W. O( S2 _( B' R6 x! b (ai_ddvp_set_a -90.0)) b& t# w" u" L2 w6 o% o
)
1 P& t7 m5 A* `0 g8 @$ I* m ((< ang1 -53.0)$ B* f4 F8 g$ @: S" S
(ai_ddvp_set_a -60.0)" ?( K( m6 j- W$ z( r: E" f* j* a& Z
)
. f8 X S P# y ((< ang1 -38.0)
0 Z0 S/ R( u% j3 ]4 Z! E1 Y1 _ (ai_ddvp_set_a -45.0)7 A1 E8 w# ?* b ?* Q
), `, W% X. m( P6 R7 b/ ]$ T% }! a3 y
((< ang1 -20.0) B3 x2 R0 x. G0 D" V) x! X
(ai_ddvp_set_a -30.0)3 O( C0 H9 _' _9 ^ t
)
6 I5 p3 E# X7 U ((< ang1 -6.0)
9 R9 g( o" h$ b6 V (ai_ddvp_set_a -10.0)
0 F& c* s# o A: O- | )9 K, [% {2 K Y& ~" C n+ R; A
((< ang1 6.0)' \+ S' D- O- P% `& S2 T. a
(ai_ddvp_set_a 0.0); y7 N$ Z, q0 ^/ q5 y/ D" k
)2 u" X. Z* E! l& J4 N0 r% p
((< ang1 20.0)* M4 _& c9 t/ K/ |; p/ g) k. X
(ai_ddvp_set_a 10.0)
) W; j% P: v- s* E )/ H& L: ^: R$ d7 Z
((< ang1 38.0): E' R+ U! t# f1 K# F
(ai_ddvp_set_a 30.0)* W3 E; f" ]; j7 I( Z
)
" i3 |6 ~: o. Z* O4 L ((< ang1 53.0)
: Y$ l8 Q3 z8 d/ X1 [+ I* d (ai_ddvp_set_a 45.0): h0 D5 Z S) _; p# O% ^' z# e
)
: \/ p J1 s# Y+ t2 ~: i ((< ang1 72.0)2 A! F' I U) w: P$ v) R. J& l
(ai_ddvp_set_a 60.0)
& ]1 W+ R4 Q# l; `4 n: u9 n: c% b )
+ }6 a- h+ }7 b6 ~8 x, y6 B. M/ {* i (T; Q6 ~. ]$ n6 O
(ai_ddvp_set_a 90.0). m2 Z! D# Y. ^7 V" A
)' [/ l! }( [5 Y
)
; ?" O% V8 E6 b% w3 h )$ f3 w9 s# b: R: K
)
1 @5 g$ ?9 b& C3 ^: e# F )
/ H3 _9 }9 r) a (progn# J; G8 ], y3 {1 ^5 u2 W* o
(setq ang2 (ai_rtd (+ pi (- (* 2.0 pi) (angle list_xy list_bxby)))))* m U; g4 S6 b; S" z: x
(if (< 360.0 ang2)' X/ x- g! Y/ K+ T6 [) z1 [
(setq ang2 (- ang2 360.0))
# }, V/ Q/ K+ J3 X )1 I2 j" \1 c# K
(if (< (distance list_xy list_bxby) 40)3 I) L7 s. {% p, T
(ai_ddvp_set_b ang2)
( o m W. Y) z8 k6 t9 p$ v (cond ((= ang2 0.0)& J) q1 D' Q8 e$ c# I$ O
(ai_ddvp_set_b 0.0)
/ C2 z; K C5 I3 c! L' m )- Z/ b3 i9 z0 @# p) h
((< ang2 22.5)
a9 q! E I( A (ai_ddvp_set_b 0.0)
4 L' `! O) J8 B8 w% b )$ a7 F/ a" M8 C( ]3 X: S1 T" r
((< ang2 67.5)" ^ a! j0 s& j) V [
(ai_ddvp_set_b 45.0)' F9 h2 |( s- N
)9 x: V; o2 A3 z5 E
((< ang2 112.5)! }1 x3 X9 j" @0 C* u0 b0 ~/ A; t- i
(ai_ddvp_set_b 90.0)
8 } x3 c; X0 C5 \" e8 H+ D )
3 z$ w; j' ?# M8 o' {' ?7 s ((< ang2 157.5)& r; J. }- E W& I, e
(ai_ddvp_set_b 135.0)4 v) p. f2 u9 d) r+ v/ n2 C
)8 s$ N# |7 C$ g o; @8 o* m
((< ang2 202.5)4 M' S- ^; }* o& S5 z4 z: E7 _
(ai_ddvp_set_b 180.0)1 p) @. e1 J* ~1 T3 A4 V) g
)
; e, _+ H9 Z3 N7 q: F+ a ((< ang2 247.5)
9 f$ O# W: f" c* H6 G (ai_ddvp_set_b 225.0)3 s3 z/ g7 U, f) c: n) Q4 p: ^" ~
)
1 a; y a" m T8 E ((< ang2 292.5)
/ D$ J% g4 Y' F' [1 [) l9 ?6 w (ai_ddvp_set_b 270.0)
, l. s! p8 y) ], V! Y: `; ?, ` )
1 H/ I- |8 J; c ((< ang2 337.5)
4 N7 {: N3 X( E3 h" y: z (ai_ddvp_set_b 315.0)
8 B4 V& b# p/ D- B0 p5 K )
9 I- k7 n7 I3 c ((< ang2 360.0)8 E) ~" G0 S6 l
(ai_ddvp_set_b 0.0)$ j- J! j, i+ d/ W4 x/ N
)9 Z. V$ x, b" _6 P7 Y. \2 ]; @
(T
0 w; r* m# Q: n8 z7 J# v; P (ai_ddvp_set_b 270.0)9 e2 m) p% K( ]7 `! f$ q
)
g' L6 H9 Z" b0 v& b1 C6 @% B( h )
0 u& M/ q3 |' ? )
$ X+ U. @7 g2 D( [ b/ v/ Y4 I- E )
6 Q9 X; `! v5 I; g$ L: N. L: w )
S$ a: D+ N4 \- U) W3 T V)" v5 n3 n! A, u7 }2 m# l
% Y: x7 E# V$ _" t; m: _4 F- c(defun ai_ddvp_plan ()
' Z* U5 y! b; n( n2 H! f (ai_ddvp_set_a 90.0)7 Y v% x3 K0 d3 @
(ai_ddvp_set_b 270.0)" ]3 c+ t; z: V$ L
)& |6 @5 i! I/ A3 T9 \ l
9 ]- j G/ i, j1 p7 _( W7 n(defun ai_ddvp_setvdir (a b)
5 c% F, }/ f: A. e: G (list (* (sin (ai_dtr (- 90.0 a))) (cos (ai_dtr b)))
u( u) c! v1 B/ h$ }' v (* (sin (ai_dtr (- 90.0 a))) (sin (ai_dtr b)))
, k# v6 m3 I* ~7 f9 H (cos (ai_dtr (- 90.0 a)))
0 k) d, j: C6 L8 J) d V )
: s" ]( o( W# K8 q)
- \" d8 n3 G3 G7 K- g2 ?" `, o5 N! T. H, \9 D5 d1 V+ u! R
(defun ai_ddvp_set_abs ()
% L' Z6 p5 S: Q; W4 _ (setq ai_ddvp_wv 1)
2 A! I* H: F# Q. { (ai_ddvp_drx ai_ddvp_b_curr ai_ddvp_bx 0)( k _1 v3 z$ D6 ~' ?5 p# @
(ai_ddvp_drx ai_ddvp_a_curr ai_ddvp_ax 0)* @" v! H8 o, @. U& z J
(ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 0)
2 D+ U# d9 e+ [/ J. M (ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 0)
j' ~8 g, J/ F (setq ai_ddvp_vdir_base (ai_ddvp_fixzero ai_ddvp_vdir_base))0 y4 F1 v. R0 V# c9 `
(ai_ddvp_setang (trans ai_ddvp_vdir_base 1 0 T))+ x- D, m$ [5 d* I
(setq ai_ddvp_a_base ai_ddvp_a1 T# m/ ~5 M: ]5 L1 E
ai_ddvp_b_base ai_ddvp_b
1 h2 [- v) X7 Z5 z$ s% G )
* T3 K K1 Z9 }3 _3 `( g5 b5 e* l( o; f/ d; ?0 F4 S3 H
(setq ai_ddvp_vdir_curr 6 s9 }' v# s: z: l
(ai_ddvp_fixzero
! l. e% d7 }; U/ K (trans (ai_ddvp_setvdir ai_ddvp_a_curr ai_ddvp_b_curr) 1 0 T)
- V. E! q7 c( G% C2 S2 T )
4 t6 B) o8 Y6 r( X* N. @- f )
) G- P$ S, N3 C3 |9 {; A: p& N: l (ai_ddvp_setang ai_ddvp_vdir_curr)/ T0 {# X8 X6 s/ o/ W2 f5 w
(setq ai_ddvp_a_curr ai_ddvp_a/ A. `! o+ o, t
ai_ddvp_b_curr ai_ddvp_b1 @0 p- x; C* u3 L$ ^
)+ E( j% X* v. M
- {& }# V9 @: ?
(ai_ddvp_set_a ai_ddvp_a_curr)8 v; P ~" |0 @6 {/ V4 S# z& o
(ai_ddvp_set_b ai_ddvp_b_curr)
+ {0 G3 F& M/ Z0 U: h8 n. O$ o)
' L, s+ S4 G2 \4 {. X, C
3 a' S9 L6 V5 O% ]7 H t1 l6 j& d) E. b' P
(defun ai_ddvp_set_rel ()
- g' R4 N' b# H* r (setq ai_ddvp_wv 0)* e# @# H9 i2 U9 N
(ai_ddvp_drx ai_ddvp_b_curr ai_ddvp_bx 0)# V `" O* R4 V0 `- j
(ai_ddvp_drx ai_ddvp_a_curr ai_ddvp_ax 0)
4 y! F5 `2 E$ \2 {9 |) W& t (ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 0)
* L7 Q5 p+ Y# X& s7 y: ?* y. Y6 | (ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 0)- X8 X6 a9 G3 b- Q1 `
(setq ai_ddvp_vdir_base (ai_ddvp_fixzero ai_ddvp_vdir_base))1 t" }- {7 \- y" \- K
(ai_ddvp_setang ai_ddvp_vdir_base)
. z6 K/ I* O0 D (setq ai_ddvp_a_base ai_ddvp_a
9 Y! d8 M. ^5 ~7 Z( I- J ai_ddvp_b_base ai_ddvp_b( T, |9 o# o4 _% x4 b% Y: n4 K; I
)7 c" t& K \' f. n- m
(setq ai_ddvp_vdir_curr 4 P7 Z0 l' Y. j: {
(ai_ddvp_fixzero 4 H p/ ^/ K5 i$ a" q) j
(trans (ai_ddvp_setvdir ai_ddvp_a_curr ai_ddvp_b_curr) 0 1 T)
b* ^) G6 N# f: v" n! g )
K8 p5 V$ L$ ^ o1 {/ S )2 T3 L `& R6 e: l8 E- t
(if ai_ddvp_init
+ d( D, {# o4 ^, W (setq ai_ddvp_vdir_curr (ai_ddvp_fixzero (trans ai_ddvp_vdir_curr 1 0 T))
; G' j) O2 |" g4 E- n0 x# A& Z ai_ddvp_init nil' b' X8 ]# n- v& I: o
): ~! ?4 W+ e" C. r' w/ _
)' d% f# H- Z0 c) l/ F% O
(ai_ddvp_setang ai_ddvp_vdir_curr)8 P: O7 r j7 S3 z" U6 Y4 f0 O
(setq ai_ddvp_a_curr ai_ddvp_a2 E3 q, I4 q2 o; d
ai_ddvp_b_curr ai_ddvp_b/ e: J$ C: X4 L. N
)1 R- h' G% e+ x, z, [8 j! F7 z
(ai_ddvp_set_a ai_ddvp_a_curr)
}5 T! D. e* L1 }2 ~ (ai_ddvp_set_b ai_ddvp_b_curr) J( ~# ?) d, P
)
& v# F: [) j% H7 v. `: e/ P
: n/ W2 k. O. Y(defun ai_ddvp_fixzero (vector / vector_x vector_y vector_z)
" Z7 i- x- D3 o& [ (setq vector_x (car vector)
8 s# J S8 O) d. \6 @! C" }9 h vector_y (cadr vector)
5 A$ M, {7 g7 ~( W- z1 f- a1 t vector_z (caddr vector)
1 q" {3 o" t9 p! }7 O. u- K )2 M7 G. m+ @: b" f+ j- Q/ c2 y
(if (equal vector_x 0.0 1e-06)
- H* r+ ~" {: b2 r8 B% T (setq vector_x 0.0)5 O) ^& f _; F' r H# b
)8 L7 P+ e9 k! X$ u( B9 n6 i
(if (equal vector_y 0.0 1e-06)
. x$ [4 c2 ?9 ]7 n5 c& P- x n (setq vector_y 0.0)
5 P7 M% x; K' Z) R& h: x )
) U: q; j( q) _2 | (if (equal vector_z 0.0 1e-06)
9 _! u3 K5 T' ] (setq vector_z 0.0)6 e, v1 U1 d5 r5 K
)
5 }' J+ m% H1 h4 m1 G0 Q (list vector_x vector_y vector_z): e i3 u) c! N. ]# D
)
[) O% n9 s6 ]0 M' n' o. a& [
& H% W; `. H; L(defun ai_ddvp_setang (viewdir / viewdir_x viewdir_y viewdir_z ai_viewdir)
1 X( d+ G6 h1 F6 r* D' g (setq ai_viewdir (ai_ddvp_fixzero viewdir)/ \( ^2 Y! e3 q. F% B
ai_ddvp_b (ai_rtd (angle ai_viewdir '(0.0 0.0)))( X2 Q3 {1 ]+ V+ d' R! s4 V
)6 c' R6 S' Z$ E& F% G
(if (equal (list (car ai_viewdir) (cadr ai_viewdir)) '(0.0 0.0) 1e-06)
" p/ d/ ^' Z5 e8 G (setq ai_ddvp_a 90.0)
$ K. _2 p6 h E& d0 G7 ` (setq ai_ddvp_a (ai_rtd (ai_ang3dv * @1 W$ r) x7 I" d; y
ai_viewdir
8 `9 r/ o9 F- W! }! C: s (list (car ai_viewdir) (cadr ai_viewdir) 0.0)
' x8 s. ]1 z# V' i$ ~2 o$ r )! {; R) x; m1 q% C" J3 N2 x2 S) h
)0 L. t7 l1 u e
)
& g4 O% H: e' O )
1 i# o3 h6 i3 ]$ K: a (if (< (caddr ai_viewdir) 0.0)
. N: M: ^* }- @4 a (setq ai_ddvp_a (- 0.0 ai_ddvp_a))& w( b$ h: f# D: D1 p$ k% B
(setq ai_ddvp_a (abs ai_ddvp_a))
- ]& g& m- X: {; f$ _, W8 q; _ )
' J7 Q+ O* B j, L5 ~ (if (>= ai_ddvp_b 180.0)
" d/ u, k K) e2 v6 n: \3 [ (setq ai_ddvp_b (- ai_ddvp_b 180.0))
' G; y- b, A3 J3 f: w0 F (setq ai_ddvp_b (+ ai_ddvp_b 180.0))5 i( G. Y2 a) Z0 K: n: m
)0 M! w# Y- t+ c: O( t- K9 Z& q
(if (or (= ai_ddvp_a 90.0) (= ai_ddvp_a -90.0))
6 R" V! g+ p7 Y (setq ai_ddvp_b 270.0)/ h' ^) l! p& Q7 o1 T% G, x/ N/ k8 H
)3 L1 }+ v% Y% i, r% ]
)2 s/ G- x5 P' N u
0 F2 W1 J! _+ N(defun ai_ddvp_main ()
) m5 q: n5 O2 l' S" W (ai_ddvp_start)
" t* ?6 g& f& D: | (ai_ddvp_setang ai_ddvp_vdir_base)
* y$ l4 g8 {' P. x (setq ai_ddvp_a_base ai_ddvp_a( c, O9 G# e9 c% U
ai_ddvp_b_base ai_ddvp_b
. J, {8 Z+ t' H ai_ddvp_vdir_curr (ai_ddvp_fixzero * w0 k" r) O* S- F# r! s2 Y
(ai_ddvp_setvdir ai_ddvp_a_base ai_ddvp_b_base)1 O# J6 r% V( I& X5 Q
)! g7 }% l- R% k: n
)9 A0 U- X* n8 _. Z: x, `! k* \ T
(ai_ddvp_setang ai_ddvp_vdir_curr)
* U l9 ^% G8 n" Z (setq ai_ddvp_a_curr ai_ddvp_a
7 O0 q9 F, T( F, ]& G ai_ddvp_a_last ai_ddvp_a_curr$ O e; {5 Q5 t. [! J* C0 y! i
ai_ddvp_b_curr ai_ddvp_b* t4 b: s8 v, u8 W
ai_ddvp_b_last ai_ddvp_b_curr2 A. `) O- J1 b9 z, l; e
)
6 W+ H+ [/ D& y. `& L2 S (if (= 0 ai_ddvp_wv)
9 S5 Q+ D" M* I! w( u) l" E# @ (progn7 h$ s O) d' z0 W0 O
(ai_ddvp_set_rel)* S7 v- m5 q5 q+ B9 A. s5 N
(set_tile "ddvp_rel_ucs" "1")( o5 d0 m! N5 M1 L
)2 x3 m& Y# h/ j
(ai_ddvp_set_abs)9 i: A/ o) N8 s9 ~
)' o j% T6 I& g( C" f3 X( I
(setq ai_ddvp_t nil)
, h3 M$ h( G$ W. Z" Z) U/ Y. S (set_tile "ddvp_val_x" (rtos ai_ddvp_b_curr 2 1)). i$ U6 O4 u' m; {
(set_tile "ddvp_val_xyp" (rtos ai_ddvp_a_curr 2 1))( M1 s6 R; I7 e6 U: b
(action_tile "ddvp_abs_wcs" "(ai_ddvp_set_abs)")# @2 u7 u( r! O8 o( }/ j
(action_tile "ddvp_rel_ucs" "(ai_ddvp_set_rel)")" ?" \! v- T) t3 @& m; i K
(action_tile "ddvp_image" "(ai_ddvp_image $x $y)")9 x A/ X) Y8 {! g* W$ r) U- L$ G. z
(action_tile "ddvp_val_x" "(ai_ddvp_set_b (distof $value))")
4 V5 x; i, {8 }- I2 b (action_tile "ddvp_val_xyp" "(ai_ddvp_set_a (distof $value))")
; L Y' G9 W7 n7 m/ m! {0 d' P (action_tile "ddvp_set_plan" "(ai_ddvp_plan)")
* w- @4 T# K( Y o4 `3 |! v8 X4 X (action_tile "accept" "(ai_ddvp_do)")
' i/ J' I G: }" ~+ z5 n2 m (action_tile "cancel" "(done_dialog 0)")
& t* S s! z: j. G' k (action_tile "help" "(help \"\" \"viewpoint_presets_dialog\")")
4 V# v$ R& D) m9 ? (if (= (start_dialog) 1)1 Z3 K' X. G* B% }1 L1 U
(if ai_ddvp_t
. r' N! i4 V: A. ^/ |7 \ (progn D- j3 P& e7 X; X9 L0 s5 `! A
(command "._WORLDVIEW" ai_ddvp_wv)0 G% M9 T* Q( C6 @' O) ]5 v
(command "._VPOINT" "_R"
) K: K7 P! u: @; `) Z: U' z (strcat "<<" (rtos ai_ddvp_b_curr 2))1 |" H7 z1 o8 T: P- ^" v
(strcat "<<" (rtos ai_ddvp_a_curr 2))+ d( O7 H6 ?) k6 A" R' D
). i9 o0 b5 k6 D1 K6 S* f
)
9 p4 O# X' A. x3 c# V- Y% { )" N# W; T% ^: h6 A, q) z' B$ M* C
)" `+ @4 p, ?- z# Q( u, f9 h
)
- U- |1 Z% m/ d+ H8 }' |
) F+ T0 s$ ~! w8 J# P: W(defun c:VP ( / ai_ddvp_wv ai_ddvp_vdir_base ai_ddvp_vdir_curr" t! n0 x# z7 c2 Y( k2 G
ai_ddvp_bx ai_ddvp_ax ai_ddvp_by ai_ddvp_a_curr y( x3 o! z- t! Z
ai_ddvp_b_curr ai_ddvp_a_base ai_ddvp_b_base ai_ddvp_p
7 a" w: |' U8 p( _# `% a ai_ddvp_t ai_ddvp_init ai_ddvp_a ai_ddvp_b
# [7 P$ o3 N. g) \5 V; D: [ ai_ddvp_a_last ai_ddvp_b_last0 b; w' f0 i0 R S) _3 b8 i
app dcl_id old_cmd undo_init
" p8 X- b' O) `' U1 j) j5 R )
, p7 v, I- x+ T$ w8 P
+ N5 v* t5 o: [+ D ;; Set up error function.
+ O6 Q! z$ |$ n2 F$ s5 }/ V! B (setq old_cmd (getvar "cmdecho") ; save current setting of cmdecho( k0 s% c9 t! Z: E) f. i! X
old_error *error* ; save current error function! [: R/ u1 ?( J4 [. J# N7 G% P
*error* ai_error ; new error function
4 _5 P( c& r Q )
4 D7 ]3 [+ f# P% u1 ~6 O3 a+ F1 H9 V* h
(setvar "cmdecho" 0)
/ r4 T* Y2 M' \3 C6 v; S+ g! m; q7 w2 A
(cond
4 V5 }. F, ]8 V& I8 K ( (not (ai_notrans))) ; transparent not OK
8 q4 U% [) f$ H6 m+ A7 E) `" |* [3 B$ e ( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
% S. e; J$ P/ S ( (not (setq dcl_id (ai_dcl "ddvpoint")))) ; is .DCL file loaded?
1 v* o' ]3 V3 x6 Z3 d; w+ h (T (ai_undo_push)8 s2 Y5 B* T) h1 ~" K4 V. E
(ddvpoint_main) ; proceed!' E$ t# a; B: [
(ai_undo_pop)
) P" ^4 ]- ]8 U' C( ^% c ) . K; ?. \8 I" v# _
)
- q% r& X' A3 l$ v( W( ^( y1 L3 S2 t1 X
(setq *error* old_error)
9 q0 {3 e5 _& f K0 L (setvar "cmdecho" old_cmd)( e4 G) ^1 n2 Y
(princ)* C% P# E, M9 q5 M
)# T' d2 o. b: W% u3 v& _% y
" W+ V; W8 U. E4 W" S
(defun ddvpoint_main()
! c2 ^" u7 `3 }5 P, C3 A* p- j5 V+ ?- Y+ B' y
(if (and (= 0 (getvar "TILEMODE"))" [+ a! {" {) b1 _, X: b5 o
(= 1 (getvar "CVPORT"))
6 o; w) z* P3 f- f+ B ): q2 i5 l" c1 [1 M
(princ "\n** Command not allowed in Paper space **")
; A8 \* V: d4 d& h* _ x (progn
( T0 Z8 g% r2 d- J1 f* k (if (not (new_dialog "ddvpoint" dcl_id))" r9 j3 R2 ?% [* V5 C, L
(exit)) C5 [& t! E; }7 c) z. T% k
)
- K# Y( t+ M6 T (setq ai_ddvp_vdir_base (ai_ddvp_fixzero (getvar "VIEWDIR"))
- q* ]# Q {2 d% t9 S ai_ddvp_wv (getvar "WORLDVIEW")
" n5 t- I& Y0 l; `4 N9 Q ai_ddvp_init T
% R8 |5 X" d1 O3 | )
3 V, @& P# H) v% E/ t4 Q (ai_ddvp_main)5 _% d* M. }1 b3 l( C5 S Y+ w5 s) s( N' @
)
& l% I7 w3 n& M) U )
# c! ? y2 o! R, [)
( [! \1 n3 I8 X/ J( f% S ?, w" g0 U3 ?% V" z q: G7 t
(princ " DDVPOINT loaded. ")
" @1 ]2 o9 I, M: t6 q(princ)8 Q7 x, q$ y$ A$ `4 l
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4 Z9 j+ c# u" `) \ A
;============================= Tran Ngoc Thang =================================
9 A+ y* V' b3 D1 F7 [' I(defun c:zx () (command "zoom" ".5x"))
* g* j) i3 C$ D4 W& ^2 G(defun c:zz () (command "zoom" "p"))
4 I1 ?: w. E% e1 I8 b7 w(defun c:za () (command "zoom" "a"))
# z( _+ R! P4 A$ M(defun c:zd () (command "zoom" "d"))
6 e( F/ K' ~+ W0 `$ a9 ?0 K(defun c:ze () (command "zoom" "e"))
+ W4 T: f B4 _7 u4 k(defun c:zr () (command "zoom" "" "")), ~+ s" G3 E1 x, S- u8 [+ U
(defun c:vv () (command "ucs" "v"))" j9 {2 Z6 K, B8 l+ n
(defun c:co () (ssget) (command "copy" "p" "" "m"))
. v1 n6 I2 d% Z/ U(defun c:c () (command "circle"))
& ^3 x; r+ k& R' {(defun c:rt () (command "rotate"))' u3 u* \5 `+ a& E o
(defun c:3q () (ssget) (command "_rotate3d" "ANGDIR" "value" pause (princ))): W5 a+ |0 m8 M+ I5 ^
(defun c:30 () (ssget) (command "rotate" "p" "" pause "30"))
/ k, F0 B/ Z1 J" C# K(defun c:-30 () (ssget) (command "rotate" "p" "" pause "-30"))
5 {8 G# J: ^: v# |(defun c:45 () (ssget) (command "rotate" "p" "" pause "45"))
! a' S+ [- l3 _, Z1 |7 c(defun c:r5 () (ssget) (command "rotate" "p" "" pause "5"))1 s$ F1 p# w3 G7 f4 \8 Y3 \; R
(defun c:60 () (ssget) (command "rotate" "p" "" pause "60"))
4 M1 q% o5 ]+ R, t |0 x9 h(defun c:-60 () (ssget) (command "rotate" "p" "" pause "-60")). R. j; ~, r8 [$ ~# G
(defun c:90 () (ssget) (command "rotate" "p" "" pause "90"))& H& w. [8 n# |% `: y" u
(defun c:180 () (ssget) (command "rotate" "p" "" pause "180"))# [; I. t+ _7 {/ U
(defun c:-45 () (ssget) (command "rotate" "p" "" pause "-45"))- {" a( L7 S; B* h9 T6 w) i, {
(defun c:-90 () (ssget) (command "rotate" "p" "" pause "-90"))# Y: v; j8 B; x1 i2 O5 A6 p9 s1 n
(defun c:md () (ssget) (command "mirror" "p" "" pause pause "y"))
9 r! r. q' x1 d4 m, z: Z% n# a0 x(defun c:fd () (command "find" "p" "" )(princ))(princ)! _8 Q0 r0 t' j: a( e: e1 a- p
* L0 @ A" k7 @+ r9 g. X! S(defun c:VNI () (command "-style" "VNi-AUCHON" "VNI-vauchon" "225""1""0""n""n""n"))(princ)7 H4 ^9 ~& D4 u0 f) Q3 G
5 P8 K) P* R& X2 k3 Y; P(defun c:romantdim () (command "-style" "ROMANT-DIM" "romant,vnh.shx" "200""1""0""n""n""n"))(princ); I* j! K Z( n, |- k+ _
(defun c:romantext () (command "-style" "ROMANT-TEXT" "romant,vnh.shx" "200""1""0""n""n""n"))(princ)5 \: U+ e+ N) ]( b8 s
(defun c:vnhelvthuong () (command "-style" "VNHELVLT-Thuong" "vnhelv,vnh.shx" "500""1""0""n""n""n"))(princ)
6 {3 A3 r! b8 ]0 p4 d(defun c:vnhelvhoa () (command "-style" "VNHELVLT-Hoa" "vnhelvh,vnh.shx" "500""1""0""n""n""n"))(princ)8 s& }' L# |7 j" W! x' [! f) q
(defun c:truc () (command "-style" "TRUC" "impact" "0""1""0""n""n""n"))& l' |: x) p: V7 W& {2 Z* q
(defun c:chu () (command "-style" "CAMBRIA" "Cambria" "200""1""0""n""n"))
7 l1 q4 S, P4 T! x% n& T(defun c:cot () (command "-style" "COTES" "Romand" """1""0""n""n"))
" B0 {" x' _0 J5 T5 m% ` V9 k% y) I2 x% |; ~& l- p
(defun c:an () (command "-style" ".AVANT" ".vnavant" "200""1""0""n""n"))
& h: A5 [( ]2 j+ D3 F3 x6 N3 ~4 r. }(defun c:ah () (command "-style" ".AVANTH" ".vnavanth" "200""1""0""n""n"))
% G* k# k; F. O6 f: z(defun c:ha () (command "-style" ".ARIALH" ".vnarialh" "200""1""0""n""n"))
% a1 Q& F$ Z" V h1 h2 x# f6 l(defun c:na () (command "-style" ".ARIALNARROWH" ".vnarial narrowh""1200""1""0""n""n"))1 }& m% L! ^# c: k' ]+ S5 ^- A
(defun c:vn () (command "-style" ".VNTIME" ".vntime" "200""1""0""n""n"))7 q% g- a9 V7 K4 Q3 z- d( b
(defun c:vh () (command "-style" ".VNTIMEH" ".vntimeh" "200""1""0""n""n"))
# j& e" N' t4 X" N) F1 ]$ ~( d
6 W& ^) S0 K; i5 b: ?) i$ Y, x. R(defun c:ps () (command " SOUT" "CorelDraw-import-Photoshop" "W"))(princ);export the current view of a drawing as an EPS file8 W; T$ W% p* @0 x) ]& b8 Z. y
5 {( [2 R5 k& t3 h. r; L
;free lisp by cadviet,cd2k44% U9 O( o! J7 H s8 ~) n& i P1 u
;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830
: \$ C$ N# w7 q2 `7 i( [- W3 p(defun c:FTEXT (/ ent tstyle )& T3 V4 z: V3 q
(command "undo" "be")1 E/ G" ]$ G+ L( K/ v: b. i( ?
(setq ent (entsel "\n Pick text :"))2 y% L7 X U; ^% X. x" a' t
(setq TSTYLE (cdr (assoc 7 (entget (car ent)))))
" V# O- B t6 `$ f(command "STYLE" TSTYLE "romant.shx,vnh.shx" "0" "1" "0" "N" "N" "n")9 l* R4 e$ Q1 a/ |& X# V' }- W" t8 W
(setvar "TEXTSTYLE" Tstyle)7 ~& |0 p' T1 X g
(command "undo" "end")
( ~5 _4 R. V, x! M3 F5 Y; e)
( P `: c) }# Y/ I* s% S: u;Cam on cadviet nhieu 27-11-2023 04h15p36s (thanks cadviet)
( n" p; V+ \+ q9 ~" e: z/ S9 N, ^& n) o+ Q% Q$ \$ b
;free lisp by cadviet,cd2k44
4 K" E }- V) J- v5 K7 E- T;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830( V6 D) v( F' `- x$ T
(defun c:Fvnh (/ ent tstyle )( q8 q! R+ W! C6 |& Y
(command "undo" "be")
, | J, c4 W# G2 V6 m" v(setq ent (entsel "\n Pick text :"))& V/ _( l4 s4 z6 _! x& Y
(setq TSTYLE (cdr (assoc 7 (entget (car ent)))))
) F# u3 V1 H1 f4 P6 F, `(command "STYLE" TSTYLE "vnhelvh.shx,vnh.shx" "0" "1" "0" "N" "N" "n")
4 n! G5 G; N& ?: k2 A4 z(setvar "TEXTSTYLE" Tstyle)
8 T% K) A3 Q3 Q, s' S9 y(command "undo" "end")
2 z' F6 b7 ~; W; q3 Q/ k: T# d- h)9 o6 x5 l2 ?% q8 L+ Y
+ n% m! J% i4 }6 P2 u& g, W+ [;free lisp by cadviet,cd2k447 y' p. @, J7 k* t2 N3 p; I0 T& l" |7 m0 C
;link bai viet http://www.cadviet.com/forum/index.php?showtopic=538303 h# h/ \& K! A" s6 N3 ^
(defun c:Chbg (/ ent tstyle )
& P6 a- m* ^% w: f+ w9 j5 y(command "undo" "be")& p4 S) c$ v7 I5 u
(setq ent (entsel "\n Pick text :"))
+ H4 `2 t- n7 \) c, x0 t(setq TSTYLE (cdr (assoc 7 (entget (car ent)))))
& I+ D( _1 Y" {- v6 Q( \/ \0 R2 i(command "STYLE" TSTYLE "chhbg.shx,vnh.shx" "0" "1" "0" "N" "N" "n")2 \$ c9 z- P# O5 Q
(setvar "TEXTSTYLE" Tstyle) B; D' h! V3 I; }% K" A
(command "undo" "end")5 K A% w) ~; `5 C- u+ V$ |
)4 }. N: x, [! n# Q+ v
& |; E( I# c g;free lisp by cadviet,cd2k44
\! c( [( E6 T! t( b;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830
! U) c% Q: S$ P% O1 W, E S' f(defun c:Chsm (/ ent tstyle )
6 V6 P6 j8 K' r4 k7 ](command "undo" "be")
5 M! s r: K+ r. z8 ?$ G7 j) {0 i(setq ent (entsel "\n Pick text :"))
5 ?. l P% |' k$ j(setq TSTYLE (cdr (assoc 7 (entget (car ent)))))
! C. m- ]9 a7 I$ H(command "STYLE" TSTYLE "chhsml.shx,vnh.shx" "0" "1" "0" "N" "N" "n")/ B+ R0 ]! a% Z
(setvar "TEXTSTYLE" Tstyle)
' i- E: r8 u) z, f7 J(command "undo" "end")" G- a; ~' O4 x# L( w4 U+ H
), F2 ]- m% U l! P5 d/ b2 R& l
0 z; w0 I1 ?4 Z7 e6 W
;free lisp by cadviet,cd2k445 D( G4 U: K4 C
;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830
; h, e2 h5 F5 R2 q$ {, g(defun c:Fttf (/ ent tstyle )9 |9 A$ m! {. Y% [1 ~' A) x; I
(command "undo" "be")& y! b6 L9 Y$ A9 S' O, g, j
(setq ent (entsel "\n Pick text :"))
$ o; G( B9 @4 Q; z% G- s4 i(setq TSTYLE (cdr (assoc 7 (entget (car ent)))))6 N1 G7 p' d( V$ A, I
(command "STYLE" TSTYLE "Cambria.ttf" "0" "1" "0" "N" "N" "n")6 A/ H2 o9 C( h
(setvar "TEXTSTYLE" Tstyle)
& A p5 i. X1 a8 _! H( s7 h* n(command "undo" "end")
0 e5 ?/ `9 m. m. H+ C8 w# j+ m)4 O0 h4 I' ]% L. T$ g
$ g! z4 V% W0 g- H) \3 X1 a: \;;; ============================================+ a r8 p% A+ S3 g6 F# t5 a( b6 i
;;;
) ~* k: j$ d8 S! i% W& s;;; LISP Creater Tao Duong Dan AUTOCAD2000
, ?5 z- f2 ]& X0 k$ u;;;
- B1 q/ e2 n9 m3 w;;; ============================================
" n9 R5 x! m0 R2 w7 V m
8 ~- }, t& V; @8 {: L, L: p. V3 d;;; ============================================% r% W; Y7 v1 s& @
;;;
% V |1 q& F& ~, ]( S8 x;;; CREATING FROM AUTOCAD2000
0 u6 z4 @2 y- Z8 e;;; Tran Ngoc Thang - Sinh 03-05-1976
( F6 M9 n- t' b; j;;; ============================================
* v: W1 q/ z4 T+ ?, h: _( c$ E" }
(setvar "MEASUREMENT"1);Bien So SCALE Cua BHATCH- I5 z0 w- T# R3 [' l2 @: h, Q! q
;(setvar "DYNMODE"2);Bien So An Hien COMMAND LINE, B( Y) w# _( d* ]/ o4 S
;(setvar "VTENABLE"0);VTOPTIONS Enable Animation for Pan and Zoom
, q# E! `+ D' X q( y& w(setvar "INSUNITS"4)) `4 L" \, S/ E
(setvar "ANGBASE"0), [' M2 e) |$ X# m
(setvar "ANGDIR"0)
$ p# C; o$ B5 j3 M% {6 K(setvar "AUNITS"0)9 W* _& k/ b; l6 Y$ ~$ O& X: g
(setvar "AUPREC"8)1 \, h' J6 w/ J; t( o- F7 [4 y* C: P
(setvar "LUNITS"2)
8 O2 v6 `9 n0 y/ N: M) I; C(setvar "LUPREC"8)5 I: Q) G, X% I, }4 O) N$ q
(setvar "ACADLSPASDOC"1)
% f3 F/ F( D8 P3 }(setvar "pickbox"5)
4 p2 `: F7 }' x" a9 i(setvar "blipmode"0)9 F- D3 @, M& g0 u; `
(setvar "mirrtext"0)% ~6 S- _. k6 t
(setvar "cursorsize"100)2 I" b: Q: c0 k- \0 F
(setvar "ZOOMFACTOR"75)& Z* _5 r. F: S V4 f1 |
(setvar "LTSCALE" 10)" y- a8 k/ B# e8 J3 _
(setvar "lwunits"1)! J6 ] Q. X6 M/ }' q
(setvar "DIMBLK" "Closed")
% @- T7 i; S& r( z5 b4 K(setvar "DIMGAP"0.0693)
U, e7 _, o5 W* W) y; H" ~(setvar "DIMASZ"0.20)
6 ~8 v$ N* X6 u9 m& W(setvar "DIMCEN"0.2)( z: L4 e: x- j+ o' u; x0 A: F
(setvar "DIMDLI"0.1)4 M# d( F+ J9 R& Y
(setvar "DIMEXE"0.0693)9 T* [3 y4 d! e% a
(setvar "DIMEXO"0.25)5 G0 t- y6 h9 e
(setvar "DIMDEC"0)
& S! A/ t7 u, ~(setvar "DIMTIX" 1)2 c, Z4 v7 c0 H/ N$ [5 L' C
(setvar "DIMTXT" 0.099)1 L r6 z# d% M7 O( r: A' L! p
(setvar "DIMCLRT" 7)0 q& e% V5 \: l8 l; J8 I
(setvar "DIMTVP" 1)
- [$ C. ?, v4 ?/ ^* m(setvar "DIMJUST" 0)
/ H! [( m1 c/ v8 d& e9 U8 |(setvar "DIMTIH" 0)
' m* \- g- [- H% ]) W; ](setvar "DIMTOFL" 1), u3 U6 y& T0 _ s
(setvar "DIMSCALE" 1111.1111)
9 U( u3 D; I! o( U1 E/ D) M$ k& g3 }- a' _ g
- ]9 H. x- z' k# ^) ~% |5 @& D
[& i$ F' i; d p( g- G3 l
(defun c:zp () (command "'.zoom" "p"))5 _- N; i7 R, Y+ H! A$ M+ ~
(defun c:zz () (command "'.zoom" "p"))3 x: X* r j6 b
(defun c:ze () (command "'.zoom" "e"))
( o# M) r3 [. d6 }+ o, i& `(defun c:za () (command "'.zoom" "a"))! t. o- @8 x$ M w U( f
(defun c:zd () (command "'.zoom" "d"))
s( H$ q( I0 Z" G* A, N, p. I- v(DEFUN C:ZZZ () (COMMAND "ZOOM" ".25X"))& ]' G8 m3 _% G! r8 u; V
(DEFUN C:ZX () (COMMAND "ZOOM" "2X"))) R. y3 Z/ E; S" d1 _
(defun c:de () (command "ddedit")(princ))
2 \3 [* W% D4 V7 a" ^(defun c:dda () (command "Dimaligned"))7 D7 c6 y0 {9 X) E6 H
(defun c:ddb () (command "Dimabaseline"))
3 H6 ~9 Q# D6 P8 u(defun c:ddc () (command "Dimcontinue"))# {0 V3 |* h; j* g2 v* r
(defun c:dde () (command "Dimtedit"))& i ]% B4 D$ y( K0 }2 Q
(defun c:ddf () (command "Ddattdef"))
+ I$ W: X1 m" k2 p; U6 ~% E(defun c:ddi () (command "Dimdiameter"))
) z4 U! D2 d3 {2 A* K4 p5 J(defun c:ddl () (command "Dimlinear"))
8 M) d5 f1 Z! l(defun c:ddn () (command "Dimangular")), e( ^3 f! W [
(defun c:ddo () (command "Dimordinate"))
1 z3 t8 d2 y' y: R% D; I& Z3 ?(defun c:ddr () (command "Dimradius")): \2 Q7 i1 N9 i# ?
(defun c:dds () (command "Dimstyle"))
( Y" d, b# ]- l* X4 g/ \/ T1 ~0 `2 c; e8 Q/ C9 a
(defun c U () (command "dim1" "up" "select" "exit" pause ))(princ)3 r/ E* |" m* P2 s' L" u* V
(defun c H () (command "Dim1" "home" "select" "exit" pause))(princ)
- A# i( O } {* l5 |(defun c:UU () (command "dim1""update""all"))4 E. [( z" I- x' u4 `
(defun c:ded() (command "dim1""tedit"))
! ?- A* c" G( ?(defun c:da () (command "dim1""ali"))
! P3 Y3 [0 b6 `, [, [- p9 w(defun c:dll() (command "dim1""l"))) r' w5 [, H6 i* m& q( L+ Y
(defun c:dan() (command "dim1""an")) r: d& M; u) |6 f5 _7 I+ X" U
(defun c:d1 () (command "dim1""ra"))
) A! L& {. @0 q' C. e( \(defun c:n () (command "dim1""new"))
8 A* ]8 Q, \+ c9 l1 n" @( P0 B: q3 o; e* ]6 g. O" U4 o3 h
(DEFUN C E () (COMMAND " EDIT"))" E6 Y$ l4 A# h& {, m7 k1 l, r+ _
(DEFUN C L () (COMMAND " LINE"))
8 M' Z% p+ v! I9 @/ Y/ C) R! M(defun c:dd () (command "dist")(princ)) B. a4 z4 I4 y1 p
(defun c:w () (command "pedit" pause "w" "au")(princ))* P+ v' D5 Q' P! ^* i* m+ ]% S" V
(defun c:pg () (command "polygon" "polygon")): k Y/ ^( U( i1 r- p9 ]8 _& Y& b
(defun c:el () (command "ellipse"))2 R8 ^* B% F J" v" _9 t' M
(defun c:xe () (command "explode"))- T1 G8 [5 d; x+ L6 W0 C; i
(defun c:eex () (command "extrude"))( A& I- h8 @8 U4 Q2 w( A
(defun c:xg () (command "xline""a"))
- X4 b0 h5 x; U& ~) a+ | X9 [(defun c:xh () (command "xline""h"))
, m n& n* {: Y+ C! G2 V# h) F# R(defun c:xv () (command "xline""v"))
: `$ _4 G; U. t6 s' p( t% i' w
(defun c c () (command "osnap""cen"))( y; y3 d7 R- z9 `- E- q
(defun c d () (command "osnap""nod"))
- a0 V0 p* d; R, b2 y0 |( K(defun c e () (command "osnap""end"))
8 ^8 c: E& W v7 Y(defun c i () (command "osnap""int"))4 i. ~ Y1 q, W% L0 h6 s) M' i
(defun c r () (command "osnap""per"))4 X) n: M7 j! N% L8 p9 e
(defun c n () (command "osnap""none"))
+ l8 ^0 m3 r7 t m' g9 `(defun c q () (command "osnap""qua"))
- Y# R3 L# f: l) D- A! k. o(defun c m () (command "osnap""mid"))- H4 X$ J. o% p) U2 q: U, j1 r; X
(defun c t () (command "osnap""tan"))9 S+ Y4 s2 S8 m4 H
(defun c in () (command "osnap""ins"))% y- f. l% @5 `
(defun c:oa () (command "osnap""nea"))# y, [( n* k) @8 A d
(defun c:ol () (command "osnap" "End,Mid,Cen,Node,Nea,Int,Perp,Qua")(princ))8 T7 v) f+ v# U2 b8 X, B
;(defun c:du () (command "dim1" "up" "s" "pick" "other"))
6 M+ i& k" F5 A5 Z;(defun c:nn () (command "new" "y" ))4 O7 g2 X- K( B
' M; H2 ^+ x4 g( m$ F5 [% H
(defun c:/ () (command "limits"))# h* M1 D. e$ N; c
(defun c:`1 () (command "region"))7 j% D+ a! V7 F
(defun c:`2 () (command "subtract"))
/ \6 o7 x7 Y1 B(defun c:`3 () (command "union"))8 [& R6 @* n6 P3 p, B
(defun c:`4 () (command "intersect"))
- @8 M/ g7 ]' i" q(defun c:`c () (command "cal"))
& y0 x" `8 {% n, T4 z; {(defun c:`g () (command " olygon"))
2 h9 Y( e# [8 X+ @ L& n5 `4 u' ~2 Z4 K* z3 s) S6 |& S
(defun c:lmi() (command "LIMMAX" pause "" "zoom" "all" )(princ))
0 J5 ?1 l0 Q+ k @: `& _" D(defun c:drt () (command "DRAWORDERCTL" pause "Integer" "" "" )(princ))4 w) m+ B$ }) y. `8 z7 x$ E; K1 Y
(defun c:ip () (ssget) (command "print,_plot" ))(princ)
# U0 e6 l) _/ [; z+ V0 J6 L2 T0 s2 I. D
(defun c:ddm () (command "ddlmodes" pause)): H/ U/ Z0 e: y+ P9 `9 D
- M+ ^4 R }0 k4 B0 ?, p(defun c:sha () (command "shade" pause))
( p1 A2 l$ ~4 i$ Q( q' |& W7 A$ L( F% K2 S& O, v
(defun c:sr1 () (command "surftab1" "p" "" pause))
. H; P" P( f& {7 N& w2 }9 `" h& U3 S(defun c:sr2 () (command "surftab2" "p" "" pause))1 y6 W" H: }. U$ ?1 i2 J$ N2 `3 @
* J: j; I4 Q+ V5 k% J
(defun c:ad () (command "audit""y"))
) f8 b6 b* @' S/ |+ D7 r% p(defun c:q () (command "quit"))
# y9 X# r" B+ r1 Q" Z& B6 T# k2 T: F X
(defun c:30 () (ssget) (command "rotate" "p" "" pause "30"))
1 l, M# v& C* b$ Q(defun c:-30 () (ssget) (command "rotate" "p" "" pause "-30")) p" I- v) } c! \; H q0 ]
(defun c:45 () (ssget) (command "rotate" "p" "" pause "45")) H3 p) F S ~
(defun c:-45 () (ssget) (command "rotate" "p" "" pause "-45"))
# k7 _+ ^( G! ^2 I! C! u' a8 R1 B(defun c:60 () (ssget) (command "rotate" "p" "" pause "60"))
1 e2 J3 Q$ V. u2 Y; m(defun c:-60 () (ssget) (command "rotate" "p" "" pause "-60"))4 p. f& e4 z" H D% L8 Q
(defun c:90 () (ssget) (command "rotate" "p" "" pause "90"))
7 l4 n8 h" U- K(defun c:-90 () (ssget) (command "rotate" "p" "" pause "-90"))
& U% M, _3 J4 D8 `0 B(defun c:180 () (ssget) (command "rotate" "p" "" pause "180"))
v3 [8 y# Q1 v1 j% s* U# G7 `+ V% Y. h5 Z
(defun c:u3 () (command "ucs""3"))* s/ I. H, n4 @" |. V3 {2 G
(defun c:ue () (command "ucs""o""end"))/ V* |; Y% S$ H4 T4 u) @( [0 y
(defun c:ui () (command "ucs""o""int"))
1 P" l- f. F+ Z" i4 y9 K5 s1 ](defun c:um () (command "ucs""o""mid"))9 v; e- v* P' A
(defun c:uc () (command "ucs""o""cen"))% t1 F; R! Z; A+ i. N- u" }( r3 k+ N2 p
(defun c:uq () (command "ucs""o""qua")): ?2 s% N: \# t2 O8 ]
(defun c:3s () (command "ucs""3"))0 q& Q% }% x( T! I4 g9 c: U' c
(defun c:sx () (command "ucs""s")): }/ ~4 _4 o& m" D' X
(defun c:sf () (command "ucs""o"))
& H: r5 r0 }# A( k: Q. i(defun c:sz () (command "ucs""p"))8 D0 {+ v* _" r1 S! }9 w2 N
(defun c:sr () (command "ucs""r"))6 f+ a0 B: |4 p o$ I4 G6 j
(defun c:sw () (command "ucs""w"))! T S( @+ }1 [8 k: @& z
(defun c:fv () (command "ucs""v"))
* j% I6 p' s8 a7 O" H; T/ r(defun c:ux () (command "ucs""x"))
6 j% ^7 F4 u |(defun c:uux () (command "ucs""x""90"))0 r8 b: S5 A5 T2 n2 ?
(defun c:xxu () (command "ucs""x""-90"))
' @" O! @& O; H0 h( F4 |(defun c:uy () (command "ucs""y"))
8 R3 q2 W9 {: q) H2 x! P) x" g2 Q8 u$ m(defun c:uuy () (command "ucs""y""90"))' ?( Z5 s- P8 A. g( ^ R
(defun c:yyu () (command "ucs""y""-90"))
% W8 r) E. b; ^) ~(defun c:uz () (command "ucs""z"))
8 y4 m* t) {, J0 \. r6 L( j(defun c:uuz () (command "ucs""z""90"))! W' I0 p. A' W5 }* \
(defun c:zzu () (command "ucs""z""-90"))0 C% y) n, ~1 A2 ?' I' P1 O
(defun c:uci () (command "ucsicon" " roperties" ))(princ)
- `! p: |) r. Z' z1 t(defun c:ucm () (command "ucsman" ))(princ)
, W7 {, `+ D" U2 {4 p! U: [3 B- R! O# M; E9 v
(defun c:sa () (command "vpoint""_non""-1,-1,1"))- U9 D' \0 l* c" w" k' W# v5 X' a
(defun c:sd () (command "vpoint""_non""1,-1,1"))1 l& z$ N0 [) X; }
(defun c:se () (command "vpoint""_non""1,1,1"))
! d0 G- ]4 m1 ?: |(defun c:sq () (command "vpoint""_non""-1,1,1"))
5 Y/ u# X, c3 l" N(defun c:vc () (command "plan"""))
: u+ a" A1 s; [* c, L(defun c:vd () (command "dview""all"))
0 c2 G2 n1 x' i- S, ~ h! D7 g; i' {7 @( L8 r }8 e& d- r' H4 r @
(defun c:TT0 () (command "tilemode""0"))+ ]8 S T4 V' P$ V
(defun c:TT1 () (command "tilemode""1"))6 x% h0 w- r2 L8 t1 V
* o5 Y% z4 _0 {! R& A( L(defun c:vt () (command "vpoint""_non""0,0,1"))4 n7 o* A3 Q4 c9 r# k
(defun c:vb () (command "vpoint""_non""0,0,-1"))
; U/ Q2 L2 C: B. n+ ?! @: R(defun c:vl () (command "vpoint""_non""-1,0,0"))
( [: u: { J. V' }/ _) S) z(defun c:vr () (command "vpoint""_non""1,0,0"))' x+ `8 v9 ^4 C/ ^
(defun c:vf () (command "vpoint""_non""0,-1,0"))
" V* g' {2 B; A! l' J# k Z(defun c:vk () (command "vpoint""_non""0,1,0"))
9 K# h. ~ c0 E. ]3 w6 i* o S" P; ]+ Y6 K r4 Y) i t2 f
(DEFUN C:MM () (COMMAND "MIRROR"))
# O0 ^6 Q9 B7 O% D1 ~) N(DEFUN C:MP () (COMMAND "MOVE" " "))
+ v& g9 c6 g" t, R* D
, `7 U) x& u( ?8 R# ]/ t(defun c:mee (/ a)1 K7 i8 }0 K' S7 }" a2 g/ s
(setq a (ssget))(command "move"a"""end"pause"end")), M. S% c2 b3 O
(defun c:mc (/ a)1 ~* Z# r& F) i2 T+ ]% P: C
(setq a (ssget))(command "move"a"""cen"pause"cen"))
8 _7 s5 q" M' X9 z! Y; }7 V(defun c:cc (/ a)6 n! S& L5 _$ k) ^: q; W0 z
(setq a (ssget))(command "copy"a"""m"))1 I# q3 p3 @7 q: I+ c8 \5 {
(defun c:ce (/ a)
/ b9 D) V" V6 a5 j (setq a (ssget))(command "copy"a"""m""end"pause"end")); E0 z8 L6 B1 r* w2 x8 V
(defun c:cn (/ a)
$ @9 ^6 @ I% O- D (setq a (ssget))(command "copy"a"""m""cen"pause"cen"))9 n. r, l# T8 B# c7 {" {0 m
(defun c:tl ()(command "trim""l"""))
8 Y5 C X# _% l: M(defun c:tf (/ a)4 O4 O' X0 P2 Q8 e5 l" [: \
(setq a (ssget))(command "trim"a"""f"))
/ m4 {4 F( q! d5 b* k( Z(defun c:el ()(command "extend""l""")) T( q" t% C6 q' }% w
(defun c:ef (/ a)+ m' u7 g7 i3 n0 D; j+ t0 M
(setq a (ssget))(command "extend"a"""f"))
$ D) E0 e- G [8 X
8 w+ k& v2 _. J l$ x8 y; G, Z+ N- F( O: Y! S" V: z, [# _
(DEFUN C:110 ()(princ "\nChon doi tuong can offset ra 110.......") (COMMAND "offset" "110"))5 r3 ~5 V/ u: }$ t; A8 U
(DEFUN C:220 ()(princ "\nChon doi tuong can offset ra 220.......")(COMMAND "offset" "220"))1 J( g4 [8 C, D/ u0 W
(DEFUN C:330 ()(princ "\nChon doi tuong can offset ra 330.......")(COMMAND "offset" "330"))
; n- n, H) w% V6 ](DEFUN C:400 ()(princ "\nChon doi tuong can offset ra 400.......")(COMMAND "offset" "400"))
8 ^* o; I5 u$ K(DEFUN C:55 ()(princ "\nChon doi tuong can offset ra 55.......") (COMMAND "offset" "55"))
; g# U( u8 @1 S( J* z2 F* D3 P' s |6 C(DEFUN C:600 ()(princ "\nChon doi tuong can offset ra 600.......") (COMMAND "offset" "600"))
3 Q8 i/ t1 {. p- Y8 | i1 k+ m(DEFUN C:700 ()(princ "\nChon doi tuong can offset ra 700.......") (COMMAND "offset" "700"))
/ `- d9 w; t5 M( P0 t$ P(DEFUN C:800 ()(princ "\nChon doi tuong can offset ra 800.......") (COMMAND "offset" "800"))
0 X1 [/ G' |: i(DEFUN C:900 ()(princ "\nChon doi tuong can offset ra 900.......") (COMMAND "offset" "900"))" E: a$ Z: ?0 K3 F y n
(DEFUN C:1200 ()(princ "\nChon doi tuong can offset ra 1200.......") (COMMAND "offset" "1200"))% O" f" K T2 \: {0 l# G3 @9 @
(DEFUN C:1500 ()(princ "\nChon doi tuong can offset ra 1500.......") (COMMAND "offset" "1500"))6 ?# v3 j3 K1 Y4 k
(DEFUN C:1800 ()(princ "\nChon doi tuong can offset ra 1800.......") (COMMAND "offset" "1800"))
% o5 y3 x7 f+ E$ c% h: c. f8 P( U. c5 o; e% @(DEFUN C:2400 ()(princ "\nChon doi tuong can offset ra 2400.......") (COMMAND "offset" "2400"))5 {/ c4 K! e) K7 u: ^
(DEFUN C:3000 ()(princ "\nChon doi tuong can offset ra 3000.......") (COMMAND "offset" "3000"))! S# E; N! X4 U: R" B9 n
(DEFUN C:3600 ()(princ "\nChon doi tuong can offset ra 3600.......") (COMMAND "offset" "3600"))
' R3 w' r% v$ J+ j(DEFUN C:4200 ()(princ "\nChon doi tuong can offset ra 4200.......") (COMMAND "offset" "4200"))0 F- G5 p3 w7 R) n/ l! r
(DEFUN C:5000 ()(princ "\nChon doi tuong can offset ra 5000.......") (COMMAND "offset" "5000"))) S3 T0 H/ J' j; K1 g( [$ m
- X+ T7 L3 p$ C(defun c:mla () (command "-mledit""av"))3 `, L! Q* g. t
(defun c:mlc () (command "-mledit""mc"))! \+ B: t* j/ D" G" d4 {* G
(defun c:mld () (command "-mledit""dv"))
- t8 \. z4 _' q+ T/ R5 [7 q(defun c:mle () (command "mline""end"pause"end"))
( q# R1 U0 n' A# W5 Y% o(defun c:mli () (command "-mledit""ca""int"pause"int"))
$ J% U4 E# F, ]) |/ G(defun c:mlj () (command "-mledit""cj"))
5 e+ R( k* A. C4 R4 J/ J(defun c:mlt () (command "-mledit""mt"))6 i$ D e+ M& h1 d6 d/ Q6 s
(defun c:mlk () (command "-mledit""ca""end"pause"end"))% b3 s* V; D5 C# D8 Y. v
(defun c:mlw () (command "-mledit""wa"))0 I3 t! P) a) g% D5 C
$ z% R1 i* q6 \( [3 I6 g(DEFUN C CA () (COMMAND "DVIEW" "all" "" "CA"))9 T1 H9 G+ k$ A' e' I
(DEFUN C PA () (COMMAND "DVIEW" "all" "" " A"))' }3 c) v( ^3 @5 |' g, Y
(DEFUN C PO () (COMMAND "DVIEW" "all" "" " O"))
9 i& o* k" E1 l0 i' R/ }(DEFUN C DD () (COMMAND "DVIEW" "all" "" "D"))
6 t. u$ |& U; e, X; n(DEFUN C Z () (COMMAND "DVIEW" "all" "" "Z"))' R2 V" N$ C0 H, W/ X$ o }& |) q' S
+ R; W# X4 _8 `8 n(defun c:p0 () (command "pline""""w""0""0"))
, @! d: [" p3 K4 _9 C(defun c:ot () (command "offset""t"))5 v! w P9 r/ l7 A! w! b$ P+ e: C
(defun c:t () (command "mtext"pause"j""bl""h"pause))
- k* }0 E# V; p7 b% X) K(defun c:uo () (command "ucs""ob"pause))
: q+ s" i* l. b; c(defun c:f0 () (command "fillet""r""0"))0 @, j9 V9 }# }7 J$ }
(defun c:fr () (command "fillet""r"))
7 ?, y" D% k- S1 ?5 u
m" _' Q. I6 Q6 g7 h;CHAMFER. v+ Y5 T5 ` V$ y; ?$ @" b
(defun c:cf () (command "chamfer"))/ |0 |% j# w/ P4 {' y
(defun c:cfd () (command "chamfer" "d"))2 ]1 f0 |: B& @. l6 C1 s; _
(defun c:cf0 () (command "chamfer" "d" "0" ""))
2 Y+ E5 \: q8 J8 ?
1 J' Z" y3 k$ d; T# W;FILLET
6 y) k2 d4 E: a( ~* B& D(defun c:f () (command "fillet"))
: g; f% g9 M6 ^4 U3 L! @(defun c:fr () (command "fillet" "r"))7 k+ d+ E# e5 I3 n9 v7 f
(defun c:f0 () (command "fillet" "r" "0"))$ E2 q5 n4 H" l* U: N
, R( V- A5 W: ]7 C
(defun c:OO () (command "oops")). X2 G% q. w0 A( h
(defun c:dln () (command "dimlinear"))% [) C# F- j/ v4 S' _! z
(defun c:dan () (command "dimaligned"))* W, d( h; j% {5 O( |+ R M& ^
(defun c:ddc () (command "dimcontinue"))9 F R, }0 M3 u, y0 I! i, x5 y
( N( k/ B+ e4 k' w M(defun c:sc () (command "scale" "auto"))
9 N( _) y, G5 k m0 S3 S" E(DEFUN C:XO () (COMMAND "snapang"))$ f* F2 X) l5 h0 J# C' j5 ?4 W0 [
(defun c:cc (/ a)
" B( o0 i3 B* G; o! f8 { (setq a (ssget))(command "copy"a"""m"))
6 _4 \: W% A, f& S$ z, Y/ a- C, x3 i1 `. c* {! h
(defun c J (/ a)
1 ~& u, K0 d$ d. \; O0 ~" N: E (setq a (ssget))(command "pedit"a"""j""all""y")): E7 G- l5 G! Z9 T- z) F# Q' f
(defun c:JJ (/ a)( |' V1 Y2 P, f3 t- q- i
(setq a (ssget))(command "pedit"a"""j""y"))
) ?6 H+ i; h% V5 ^7 m3 \(defun c:TN (/ a)4 A6 C9 {0 \8 L n/ N9 X0 b
(setq a (ssget))(command "change"a"""p""T"))
9 a6 [2 @* _& |( L3 m9 N: l2 L# E" L6 b& V( U) y1 x4 F
, P, ?: G! o9 o; D4 G% z
;================== Tran Ngoc Thang - Sinh 03-05-1976 - Suu Tam - Tu nam 2000 - Hoc nam cuoi KTS . DHXD ====================2 K3 N: D; o& ~# [& H; _0 I
5 X; Z2 e. o/ i2 M2 b% K
(defun C:IB ()(setvar"cmdecho"1)
/ F5 d8 H* O. V' g (setq pt(cadr(entsel"\nSelect Block:")))
) s9 {6 C6 N% g9 \0 y (setq e1(ssget pt)) 1 W" e1 b- B8 t& U! k9 l
(setq e2 (entget (ssname e1 0)))" m2 e; b' X e9 J: z
(setq blname (cdr(assoc 2 e2)))- C* t7 }' Q; T, `5 O* ^
(setq oer *error* *error* err2)(command ".insert" blname))' ~; J4 T( Y, Z8 j5 H5 I6 W
% f: ] T; q) m2 D
(defun c:II ()9 u% P/ @2 S% ~; X, I
(setvar "cmdecho" 0)
: J, l3 M) L! Z5 K) @2 J$ ` (setq olderr *error* *error* myerror)- _& D+ L& A5 x5 P4 _
(prompt "\nSelect objects: ")' }' d" G1 B' A/ ~
(command "select" "au" pause). a' M0 W1 Y+ i: ]# d/ W
(setq sstxt (ssget "p")
$ H7 C- n ?. S2 r8 y+ ~ sslen (sslength sstxt)
& J, @/ F; N% `, n% x2 @2 R ctr 05 I9 G1 [/ l+ B# @. m/ a2 S
)
7 n3 K' o) y; u4 ]6 s, W (command ".undo" "mark")+ o; h) M! r. E8 `) D8 w
(while (< ctr sslen)
3 V" H: x" C0 d2 {8 J/ ?6 n (setq listxt (entget (ssname sstxt ctr))
! b5 t& A$ M% Z/ m txttxt (cdr (assoc 1 listxt))& _- }2 |3 Y$ Z' l0 v7 W1 F
enttxt (cdr (assoc 0 listxt))2 m6 V* j2 a# u# r: n, S' x
)4 w$ |( ^! d2 X# f. B0 K
(if (= enttxt "TEXT")) F! b/ n( W: L+ S0 C
(progn
, I/ C$ O. B2 U: k$ t9 Q4 |( } (setq testxt (substr txttxt 1 3))- N7 S& T4 d, X0 y& g# d% c
(if (or (= testxt "%%C") (= testxt "%%C"))8 D# Q. Q* ]% D; @
(setq newtxt (substr txttxt 4))" | r8 I* m. I
(setq newtxt (strcat "%%C" txttxt))4 U. G C7 J. _+ G9 E6 l- S6 y
)
7 W; Z/ M4 {8 R9 a/ T% K (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))
0 c! B8 x3 H% P4 j3 L (entmod listxt)
$ I& s- N4 N& A# K) r1 G4 _ )
! V- l" }0 c( t )" J5 n. ?+ W" j" w/ e
(setq ctr (1+ ctr)) W& n5 B. q0 u9 {/ g S, S
)
' {, }% Y) H8 Y (setq *error* olderr), a: |' A" Y! O0 V- D9 @! Y" l
(setvar "cmdecho" 1)6 g t* S2 |- u/ b$ V2 L) \' X
(princ)
) Q* K' F" Q; x2 I9 l). }4 x( B2 B5 M
, i8 e6 C6 M# {. h- D- R" V(defun c G ()
1 H/ v/ C4 X1 b/ m O (setvar "cmdecho" 0). V( } X4 P8 r: }1 G) q
(setq olderr *error* *error* myerror)9 R7 v8 {0 ?* [% R! v8 @7 k- S1 N
(prompt "\nSelect objects: ")
! h: X! R0 W/ Z7 B (command "select" "au" pause)
/ s8 B' q, \, l, j4 e (setq sstxt (ssget "p")8 M6 R. I9 q; D8 P4 k
sslen (sslength sstxt)5 j" B6 Z, X" Q! ~- J) g
ctr 0
0 U5 y1 K1 ? e3 e2 h ) y6 V4 v. e. W0 X* X: }+ h. S5 o
(command ".undo" "mark"). ?: }1 C, F! n( u, W( f
(while (< ctr sslen)/ U. W, N& X4 L- _ K- S
(setq listxt (entget (ssname sstxt ctr))
. @% r3 ~) r/ R0 a0 Y2 N# \" Z txttxt (cdr (assoc 1 listxt))
5 [8 m( j) I: C5 h. u enttxt (cdr (assoc 0 listxt))
! L. N; n6 U5 P' H6 d) s. \ C )) w3 w' N. z. R
(if (= enttxt "TEXT")
/ H# I4 y" s: x+ x @ (progn2 D% _& v. I! [# V
(setq testxt (substr txttxt 1 3))
1 c5 b, M, H. Y- V l: \ c (if (or (= testxt "%%d") (= testxt "%%d"))
! {6 f5 h9 W+ `0 o+ E0 N1 W (setq newtxt (substr txttxt 4))0 k) T# j" X) L* K+ A
(setq newtxt (strcat txttxt "%%dC" ))1 Q2 ~" H1 |! X
)
" H% \ ?1 F- M4 a (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))
8 T+ V' t- g# b+ g. p5 D# J (entmod listxt)
9 e- B5 t; [6 H2 x+ j# |6 v ), `5 M8 C9 l. \
)
0 _+ G3 o2 x1 Y& |/ U (setq ctr (1+ ctr))& A" {- w' h4 c( o/ F" F( G
)
8 o9 i( t ~+ Y& X- A (setq *error* olderr)
8 a0 }1 _7 n, ~/ r2 V (setvar "cmdecho" 1)/ p7 q7 `/ e" c0 N
(princ)4 G, F: K" L6 U+ ?" v5 a2 t
)7 a4 ~6 B9 G8 U8 R( ?
* F# h `- S g(defun c I ()
! t% D3 Y! y3 f* E9 ^ (setvar "cmdecho" 0)
1 y x h2 u5 I$ {& K. P3 e1 ] (setq olderr *error* *error* myerror)
1 ?, x6 ?0 M5 s' y (prompt "\nSelect objects: ")! M, C. t# ]# g
(command "select" "au" pause)
, M+ L9 y% }1 Y, B0 f0 _ (setq sstxt (ssget "p")
) [1 a* w& Y8 ^$ [6 S6 o sslen (sslength sstxt)5 l1 a; j4 i' s1 l1 O$ c
ctr 08 ? C0 q7 ]9 w. |( I8 O X+ N
)
* b$ p$ q0 z; o3 S3 d) y (command ".undo" "mark"). I3 _1 I. X C! u) G* n* f! C" S
(while (< ctr sslen)2 i3 J }! V- x+ s' f( Q, ?
(setq listxt (entget (ssname sstxt ctr))
6 l" z% |! Q1 k1 o3 e txttxt (cdr (assoc 1 listxt))0 g2 o3 M7 H9 Z) O/ y$ Z$ o4 i
enttxt (cdr (assoc 0 listxt))4 g# T$ p# ]# f3 q* w6 ^, {: A) m
)6 q: D, H u; ]& S9 p% r9 B% w
(if (= enttxt "TEXT")
1 f3 k C# B. a1 Z2 i (progn* W3 j+ h0 S1 }
(setq testxt (substr txttxt 1 3))% R0 {5 a: R' Y8 j& Q, P$ J; E6 G b2 e
(if (or (= testxt "%%p") (= testxt "%%p")): V! G+ u' b/ Z0 |& s, M6 A
(setq newtxt (substr txttxt 4))
2 P8 \. w' ?0 c' a1 K (setq newtxt (strcat "%%p" txttxt)); P6 ^# _, h5 i7 s
)
r+ O3 t8 y& w8 m. f# M7 Z (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))
$ E( Q2 f: I9 q- u) A, _7 } (entmod listxt)
! B1 C' k1 i$ J )0 o- n3 g: b6 G% k
)% s, H& t+ N* h
(setq ctr (1+ ctr))
3 {2 _5 q K+ Q. M )
6 k& ` `! w, [0 o8 a (setq *error* olderr)) Z9 `# h$ ^: |' U2 f6 H, ~0 y6 a
(setvar "cmdecho" 1)8 y1 x, A9 u6 O5 h" j
(princ)
0 z S. c& q8 H" I)
7 H8 {, v8 [* A/ V6 r
; o1 I- _8 u% E, @& M(Defun c:CB (/ a)
. N' l5 q8 c3 N+ C2 Y0 i (setq olderr *error* *error* myerror)
3 G+ x f" G9 S# k/ s$ U6 Z# _8 N (setq ocmd (getvar "cmdecho"))
# n# r$ K+ K& k- S. u6 U (setq oblp (getvar "blipmode"))+ h' I2 r7 }, L$ N2 J" I6 D1 }
(setvar "cmdecho" 0)- y' A( X8 @) }5 T* K Z' F& U
(setq a (ssget))" d2 e% a( z5 D
(command "CHPROP" a "" "C" "bylayer" "")
8 f3 j h3 K, B: o; N (setvar "cmdecho" ocmd)
9 v; [1 d: I/ x4 @4 d1 e& j (setvar "blipmode" oblp)3 o2 u+ [+ g: ], @
(setq *error* olderr)1 q [6 G( c8 t" t
(princ)
. G, R# f$ `7 u$ q)# G. k% K" w% r, v: k0 e
4 y( N6 Q" w7 I- Z
(defun c CC (/ co43 obj23 la23)
: _7 E, k) N6 S% a (setvar "cmdecho" 0)
; `0 M9 c1 I4 Z4 k% m) c1 y: | (setq co43 (getstring "\nNew color : "))
5 L5 g& X+ Y; X3 l' d9 Z (setq obj23 (car (entsel "\nPick object on desired layer: ")))
" t* a) Q" L* q4 V: m (if obj23 (progn
% H" V! I7 S' {& R) j (setq obj23 (entget obj23))) }! u0 o3 E7 r' f9 F
(setq la23 (cdr (assoc 8 obj23)))
8 d) m. Q5 _1 a5 o (command "layer" "c" co43 la23 "") N' Z& g6 X4 ]) g7 M! [9 {
)
8 V% v5 ~( E0 j5 D- f1 M )* ?8 U& e& [# P C
(prompt (strcat "\nLayer has changed..." la23))
! {0 G, E7 S4 q5 G6 Y (setvar "cmdecho" 1)
& ]* R* X; ^, p0 h; m (princ)
/ b! S1 k5 V3 q4 e4 n7 S' W; e)
4 j% w5 t: w1 V* U* I1 I$ q! u. s- z- }: P0 H4 a" z8 g
(Defun c:RP (/ a)
6 n2 `+ A9 {6 |# W: P" f Q (setq olderr *error* *error* myerror)+ P9 M- p5 x9 n3 {; C7 \- W4 B* a" Z
(setq ocmd (getvar "cmdecho"))$ E8 L- @/ c. N A
(setq oblp (getvar "blipmode"))8 H) d1 q4 H0 ]( e3 {! _1 a
(setvar "cmdecho" 0)' @) J; c6 W0 V( ^0 A$ K, f
(prompt (strcat "\nUSE: Delete object(s) belonging to"7 N0 y, R7 Q z# b! M9 o' U9 o
" the layer of the entity picked...!"))
6 j; b6 d8 h3 o6 g7 d (setq a (entsel "\nPick the entity with the desired layer to delete: ")); r7 y9 r. g3 Q( |8 Y
(if (/= a nil). U+ |, ^" Y" u3 U! v6 C2 P5 Z
(progn (setq a (cdr (assoc 8 (entget (car a )))))
' {+ J* k1 B& s4 Y/ A (command "Erase" (ssget "x" (cons (cons 8 (eval a)) tempword)) ""))
5 ^ O+ }' x4 n4 k" x: }0 U- K# k (prompt "\nNo entity selected!"))
, I6 R. Y$ u0 X8 k" R (setvar "cmdecho" ocmd)
8 C) c/ k; b% S; t8 z: f( E8 ~ (setvar "blipmode" oblp)+ Y5 s" S; B3 ^' ~$ J" n) b+ @! g
(setq *error* olderr)
* ^6 V5 y$ Q" [6 [7 L8 `- D (princ)0 t1 ^+ z8 a! ~- o/ m
)3 g4 G" R4 K `
& |' U3 \3 e6 Z
(DEFUN C:WL(/ SSET NET SSL M): D2 y# s* H9 z) {
(PRINC "\nSelect lines :"): U& F) ~ s7 F0 n, k( z
(SETQ SSET (SSGET))2 E: `& L$ e* K c! u7 |2 [
(IF (/= NIL SSET) (PROGN
9 I+ X! R2 I2 T3 Z: X, S$ v4 Q (SETQ SSL (SSLENGTH SSET))
4 E% P' J ]5 o Y l! l, k) C (INITGET 4)( N& B7 j3 j( [2 N
(SETQ NET (GETREAL "New width : "))
8 W1 A5 r0 [: B* n j! L (IF (/= NIL NET)% g, i1 q: N- G8 I5 n5 n: O0 J
(WHILE (> SSL 0)4 }( X; U& Z5 w, {. e
(SETQ M (SSNAME SSET (SETQ SSL (- SSL 1)) )), b4 g8 f7 ~6 ~
(IF (= (CDR (ASSOC '0 (ENTGET M))) "LINE")
- Z# a+ [! S1 ] (COMMAND " EDIT" M "Y" "W" NET "") & D. W, { |! g# _7 @/ {. A$ c1 {
) ) l0 `7 C# d# z# u0 Z
)
' \7 z7 x! `0 ?9 M! ~ )))8 C7 P# Z) r/ n. K. y
(PRINC)
5 U) j4 K+ i1 I)2 z0 X( u) D; Y% D
0 a7 N+ I% b- t) A- O/ [( f(defun C:MML ()
$ x G# u3 e/ f" f; ^8 I4 u (princ "\nSelect objects to move to another Layer.")
" S. E0 d+ a1 R5 @8 @) z# o; e (setq ss (ssget))2 X" E; b- p B8 L) W- V$ [
(SETQ UL1(GETSTRING "\nLayer to move entities to : ")) l2 l) L, d* f4 ~ ^, g
(setq counter 0)
3 A( d. @+ p9 r (prompt "Moving to layer.....")(princ ul1)
, V0 J; q% \( W3 s* }4 U7 D (setq e (ssname ss counter))' ]( }/ l' ~0 t
(setq l (cdr (assoc 8 (entget e))))
U0 Z( x/ B4 D% ~- o (setq S (ssget "X" (list (cons 8 l))))/ u" q4 T7 [; w8 [/ B
(command "CHANGE" ss "" " " "LA" UL1 "")5 O+ P, l- M J8 D; h- X2 k
(setq counter (+ counter 1))& \4 m6 A" i4 G1 i
(princ)1 C$ S" x- K" k1 f" P1 q
) ; F9 q6 L# p! X4 w5 l
! ~$ f" _# x' V;;; ================================ GHI CHU ============================
0 O5 e/ s. ]( i6 M7 t2 L;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========
+ ^: A. K7 ?& I3 ~+ _: ^;;; =======================Thuong Dung Font Romant.vnh===================
% |9 @' T- ]( y# _" Q% Z9 N;;;==================== Tran Ngoc Thang - Sinh 03-05-1976================
5 |8 f7 `4 \! a, `2 ^3 O0 T4 S, `- }5 e+ Z. Q: Y7 c( P9 c* G
(defun c:RS (/ pta ptb ptc ptd X Y X1 Y1 rmsz pl1)# l3 A4 P, G/ x D3 f
(setq oer *error* *error* err2)% ~6 `5 ?& n# d4 c* i+ T% Q% z/ ] Y
(PROMPT "\n(VNI-TTF)(D)ining room. (S)torage. c(L)oset. (C)onference. (O)ffice. (K)itchen. (B)ath. (M)aster Bedroom. ")8 i7 y8 n9 C$ j! f3 R/ C
(SETQ Cpt(GETSTRING "\n (RomanT.vnh)(DD).(SS).(LL).(CC).(OW).(KK).(BB).(MM). (Vni-SHX)(oD).(oS).(oL).(oC).(oww).(oK).(oB).(oM)."))) W. D [+ ]$ z9 `
(IF(OR(= Cpt "K")(= cpt "k"))(SETQ CPT ' "Nhaø Beáp"))
& q* G1 ~( y; T2 L5 C (IF(OR(= cpt "B")(= cpt "b"))(SETQ CPT ' "Phoøng Veä Sinh"))
2 p/ \: W4 g, d' l (IF(OR(= cpt "C")(= cpt "c"))(SETQ CPT ' "Phoøng Hoïp"))
" F- e( c L8 e7 {% V; H (IF(OR(= cpt "O")(= cpt "o"))(SETQ CPT ' "Phoøng Laøm Vieäc"))
4 L5 Q/ {; @/ Y# p% z (IF(OR(= cpt "M")(= cpt "m"))(SETQ CPT ' "Phoøng Nguû"))
& c* ?% E+ a, l1 F6 w# f9 ` (IF(OR(= cpt "D")(= cpt "d"))(SETQ CPT ' "Phoøng Beáp + AÊn"))
a, e3 O' e( v (IF(OR(= cpt "S")(= cpt "s"))(SETQ CPT ' "Nhaø Kho"))$ l5 j. y3 x/ C: f J. Y, C
(IF(OR(= cpt "L")(= cpt "l"))(SETQ CPT ' "Phoøng Ñeå Ñoà"))
* K' |9 f7 y6 |5 f* y9 {( @' a, g% g. t7 o1 `
(IF(OR(= Cpt "KK")(= cpt "kk"))(SETQ CPT ' "Nhµ BÕp"))
! m t9 q- p% T# U: i1 @* b (IF(OR(= cpt "BB")(= cpt "bb"))(SETQ CPT ' "Phßng VÖ Sinh"))1 u1 O- F" }# y. C+ j
(IF(OR(= cpt "CC")(= cpt "cc"))(SETQ CPT ' "Phßng Häp"))& r' d7 z7 }7 ^% n9 Q, w/ R
(IF(OR(= cpt "OW")(= cpt "ow"))(SETQ CPT ' "Phßng Lµm ViÖc"))/ ^& e1 C6 [: {- _
(IF(OR(= cpt "MM")(= cpt "mm"))(SETQ CPT ' "Phßng Ngñ"))
" X8 F# C9 q1 c (IF(OR(= cpt "DD")(= cpt "dd"))(SETQ CPT ' "Phßng BÕp-¡n"))9 V) T$ q1 J. \7 u% ` X
(IF(OR(= cpt "SS")(= cpt "ss"))(SETQ CPT ' "Nhµ Kho"))
9 S- {5 v+ x$ v; q1 X7 v (IF(OR(= cpt "LL")(= cpt "ll"))(SETQ CPT ' "Phßng §Ó §å"))
7 L7 s4 u9 ~/ C+ R/ P* o
8 ^. q& h$ @5 `5 p, G (IF(OR(= Cpt "oK")(= cpt "ok"))(SETQ CPT '"NHA/F BE/M/SP"))
+ ]. `. T2 f' P" T$ |5 W (IF(OR(= cpt "oB")(= cpt "ob"))(SETQ CPT '"PHO/F/NG TA/W/SM")). {' F- z- l8 b
(IF(OR(= cpt "oC")(= cpt "oc"))(SETQ CPT '"PHO/FNG HO/JP"))
8 a! z; P) J8 @9 o) P9 p: g3 r (IF(OR(= cpt "oww")(= cpt "oww"))(SETQ CPT '"P.LA/FM VI/E/M/JC"))9 N# U8 f& _6 F
(IF(OR(= cpt "oM")(= cpt "om"))(SETQ CPT '"PHO/FNG NGU/R"))$ A7 [2 V% x' Y% v
(IF(OR(= cpt "oD")(= cpt "od"))(SETQ CPT '"PHO/FNG A/WN"))
" N) Q1 [2 |! J7 x! Z1 T2 w+ z (IF(OR(= cpt "oS")(= cpt "os"))(SETQ CPT '"NHA/F KHO"))
' x( Q# [5 v7 h0 h4 }' c" p (IF(OR(= cpt "oL")(= cpt "ol"))(SETQ CPT '"PHO/FNG /DO/M/F"))( Q3 g/ }! B. Q* S' ]
(setq pta (getpoint
3 A& r5 E$ F: k "\nPick first corner. : "))3 D+ K- h0 u! Q: n c7 z: o2 I% A7 D4 Y
(setq ptb (getcorner pta- ~0 e2 X+ S, S- f* e
"\nPick second corner. : "))
8 ?5 ~2 k& L- M (setq ptc (list (car ptb)(cadr pta)))
/ ?3 @ V& b3 Z# c+ }2 w (setq ptd (list (car pta)(cadr ptb)))( r7 i' `+ c4 r" R
(setq ang (angle pta ptb))' @3 C8 O. g1 F8 k
(setq d1 (/(distance pta ptb) 2))% n3 q; g& K$ V2 U
(setq cp (polar pta (- ang (dtr 0)) d1))
1 M* l/ h% O; Q$ I# s3 { (setq X (distance pta ptc))" a6 D; q: t+ r I6 \
(setq Y (distance pta ptd))' R' `/ {3 ~* n7 ]3 p R
(setq X1 (rtos x 2 1))) q( K2 O) J/ E$ X8 k' g0 Q7 ^
(setq Y1 (rtos y 2 1))/ m7 n5 D& X6 \" e9 h- N
(setq rmsz (strcat "(" X1 " x " Y1 ")"))
! g! K0 d0 [9 X% j. q( X (command "TEXT" "c" cp "0" CPT "ROMANT-TEXT" "" rmsz))
2 s! p' g5 `; p5 ^4 D (defun dtr (angg)% b5 N& ]5 `1 L, w0 g
(* pi (/ angg 180.0)))
3 m) M, M; S, o6 h: f( j
! n# \1 R: Q: v4 D6 v& F(defun c:ZS (/ pta ptb rmsz pl1)
) V3 |" B1 D/ v+ G9 Q$ V. Y9 @. J (setq oer *error* *error* err2)1 R# [2 f) S' ?. G: I* P; d
(PROMPT "\n (Vni-SHX-TTF)floorp(L)(oL)an.(E)(oE)levation.(S)(oS)ection.(M)(oM)planFoundation.(C)(oC)Found.(K)(oK)Khung.(P)(oP)View3D.")0 _! C( J+ ]% \8 h8 s) H
(SETQ Cpt(GETSTRING "\n (RomanT.Vnh)(LL)floorplan.(EE)elevation.(SS)section.(BM)planFoundation.(CM)foundation.(KC)Structure.(PP)perspective."))2 a* t: H+ g# K7 M! K0 f( D
' u9 K2 W& G0 p7 L$ i. g (IF(OR(= Cpt "LL")(= cpt "ll"))(SETQ CPT ' "MÆt B»ng TÇng 1 : TØ LÖ - 1:100"))
4 {) Y7 p5 k8 W' N5 J2 F. y2 c" D (IF(OR(= cpt "EE")(= cpt "ee"))(SETQ CPT ' "MÆt §øng Trôc ?-? : TØ LÖ - 1:100"))- R7 i) B8 ]& ?' H( o4 z4 T. ?/ @
(IF(OR(= cpt "SS")(= cpt "ss"))(SETQ CPT ' "MÆt C¾t A-A : TØ LÖ - 1:100"))
9 \) c/ L- r4 ]+ e6 y! s2 W (IF(OR(= cpt "BM")(= cpt "bm"))(SETQ CPT ' "MÆt B»ng Mãng : TØ LÖ - 1 : 100"))6 K }6 V$ `; s5 K6 I
(IF(OR(= cpt "CM")(= cpt "cm"))(SETQ CPT ' "MÆt C¾t Mãng : TØ LÖ - 1 : 100"))
8 Q0 J) f) D Q ] (IF(OR(= cpt "KC")(= cpt "kc"))(SETQ CPT ' "KÕt CÊu Khung Däc Nhµ : TØ LÖ - 1 : 100"))4 t7 {, W7 x* R
(IF(OR(= cpt "PP")(= cpt "pp"))(SETQ CPT ' "Phèi C¶nh Mét Gãc Nh×n"))5 x3 L3 ] v5 B6 ^+ d+ F
5 r4 Q) w. E' k" s' ^3 L @/ k5 V
(IF(OR(= Cpt "oL")(= cpt "ol"))(SETQ CPT ' "MAËT BAÈNG TAÀNG 1 : TÆ LEÄ - 1:100")), L' j; z, w# q
(IF(OR(= cpt "oE")(= cpt "oe"))(SETQ CPT ' "MAËT ÑÖÙNG TRUÏC ?-? : TÆ LEÄ - 1:100"))
$ E0 J* l; }: S% ]) O (IF(OR(= cpt "oS")(= cpt "os"))(SETQ CPT ' "MAËT CAÉT A-A : TÆ LEÄ - 1:100"))
) i7 k+ ~. X" m2 F0 ~ (IF(OR(= cpt "oM")(= cpt "om"))(SETQ CPT ' "MAËT BAÈNG MOÙNG : TÆ LEÄ - 1 : 100"))9 Y1 Q, u% L2 ^$ H
(IF(OR(= cpt "oC")(= cpt "oc"))(SETQ CPT ' "MAËT CAÉT MOÙNG : TÆ LEÄ - 1 : 100"))4 Q5 e: u1 s+ t5 X9 G, Q+ I
(IF(OR(= cpt "oK")(= cpt "ok"))(SETQ CPT ' "KEÁT CAÁU KHUNG DOÏC NHAØ : TÆ LEÄ - 1 : 100"))4 \% h7 C- Q* e$ f* Y4 q
(IF(OR(= cpt "oP")(= cpt "op"))(SETQ CPT ' "PHOÁI CAÛNH MOÄT GOÙC NHÌN"))& U# l- I* c/ Z: ]) R1 p
" G! ?- j* ?! O (IF(OR(= Cpt "L")(= cpt "l"))(SETQ CPT '"MA/W/JT BA/W/FNG TA/M/FNG 1 : TI/R LE/M/J - 1:100"))3 v+ b# U$ u) U6 E6 {. E$ U2 @8 F
(IF(OR(= cpt "E")(= cpt "e"))(SETQ CPT '"MA/W/JT /D/}/SNG TRU/JC ?-? : TI/R LE/M/J - 1:100"))
, ], T3 j( P) @0 } (IF(OR(= cpt "S")(= cpt "s"))(SETQ CPT '"MA/W/JT CA/W/ST A-A TI/R : LE/M/J - 1:100"))3 i) U/ s4 e2 ?0 `. c9 K
(IF(OR(= Cpt "M")(= cpt "m"))(SETQ CPT '"MA/W/JT BA/W/FNG MO/SNG : TI/R LE/M/J - 1:100"))0 d! B5 N5 K! x( _+ r Z) \
(IF(OR(= Cpt "C")(= cpt "c"))(SETQ CPT '"MA/W/JT CA/W/ST MO/SNG : TI/R LE/M/J - 1:100"))- z% u3 _8 _% b) T
(IF(OR(= Cpt "K")(= cpt "k"))(SETQ CPT '"KE/M/S/T CA/M/SU KHUNG DO/JC NHA/F : TI/R LE/M/J - 1:100"))
_7 b7 T+ S; i4 z (IF(OR(= cpt "P")(= cpt "p"))(SETQ CPT '"PHO/M/SI CA/R/NH MO/M/JT GO/SC NHI/FN"))
3 @. v: i7 s5 O. t( W1 O4 R (setq pta (getpoint
0 g3 j; [, G `: X' D# Y "\nPick first corner. : "))
2 {3 w- E$ o* p3 [* u (setq ptb (getcorner pta+ r* F, M( P+ ]1 ]
"\nPick second corner. : "))0 C9 p9 ^1 u( b, \: |) L% \, B
(setq ptc (list (car ptb)(cadr pta))); B+ v6 n% f! k; B- K
(setq ptd (list (car pta)(cadr ptb)))
4 V9 M0 M+ a- A/ o+ M& T! W (setq ang (angle pta ptb))1 C2 O2 k! u0 b- R% p
(setq d1 (/(distance pta ptb) 2))$ p5 M. m5 d/ g5 i# \/ a
(setq cp (polar pta (- ang (dtr 0)) d1))8 X4 C- v' Q+ \" r
(command "TEXT" "c" cp "0" CPT "ROMANT-TEXT" "" rmsz))8 v ], G$ T* a
(defun dtr (angg)0 e% p- `3 j0 E
(* pi (/ angg 180.0))): S @6 D1 ?0 }5 b4 o% ], @
2 i& m* v& h2 Z" l: b) v
;;; ================================ GHI CHU ============================
$ c) S. K! n3 F3 M! k: x [;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========
! \; Q. X3 }2 G; W4 L0 u;;; =======================Thuong Dung Font Romant.vnh===================! C+ t o$ F! A% b4 y
;;;==================== Tran Ngoc Thang - Sinh 03-05-1976================7 m; @; }! @0 \, E
" k4 ]9 W9 C2 D/ g9 K(defun c:RRS (/ pta ptb ptc ptd X Y X1 Y1 rmsz pl1)5 K- Y1 U N) K! g
(setq oer *error* *error* err2)' Q+ T7 y2 q' h; l) g# i
(PROMPT "\n(Vni-SHX-TTF)(oD)(D)ining room. (oS)(S)torage. c(oL)(L)oset. (oC)(C)onference. (oWW)(O)ffice. (oK)(K)itchen. (oB)(B)ath. ")2 I- H5 g: T ]( f! ^. k
(SETQ Cpt(GETSTRING "\n(RomanT.Vnh)(M)aster Bedroom. (DD). (SS). (LL). (CC). (OO). (KK). (BB). (MM). "))
% z* ~3 ]" r. z/ E* n, s (IF(OR(= Cpt "K")(= cpt "k"))(SETQ CPT ' "Nhaø Beáp"))4 B1 L( R0 y @: s
(IF(OR(= cpt "B")(= cpt "b"))(SETQ CPT ' "Phoøng Veä Sinh"))9 B9 V6 v/ i7 I0 S& o
(IF(OR(= cpt "C")(= cpt "c"))(SETQ CPT ' "Phoøng Hoïp"))1 a6 a( Z7 z$ W1 }! q' S7 t0 ?
(IF(OR(= cpt "O")(= cpt "o"))(SETQ CPT ' "Phoøng Laøm Vieäc"))3 D4 n6 O4 u) f3 ~
(IF(OR(= cpt "M")(= cpt "m"))(SETQ CPT ' "Phoøng Nguû"))! Y$ e; V; G& N$ I5 u* I( @/ Y, e5 ]
(IF(OR(= cpt "D")(= cpt "d"))(SETQ CPT ' "Phoøng Beáp + AÊn"))
7 W, w( {8 E, L (IF(OR(= cpt "S")(= cpt "s"))(SETQ CPT ' "Nhaø Kho"))% ~0 Z6 D: p* n6 L4 D) K
(IF(OR(= cpt "L")(= cpt "l"))(SETQ CPT ' "Phoøng Ñeå Ñoà"))$ s# ~9 N' w0 n" E, C4 r
* A' _" W ~4 m' f" O
(IF(OR(= Cpt "KK")(= cpt "kk"))(SETQ CPT ' "Nhµ BÕp"))
! D7 M6 f' ?8 _$ | C (IF(OR(= cpt "BB")(= cpt "bb"))(SETQ CPT ' "Phßng VÖ Sinh"))4 S/ z3 M; t7 `- X& w
(IF(OR(= cpt "CC")(= cpt "cc"))(SETQ CPT ' "Phßng Häp"))1 s" l/ Z [1 a8 N
(IF(OR(= cpt "OO")(= cpt "oo"))(SETQ CPT ' "Phßng Lµm ViÖc"))* s* Y8 R3 k% k, N
(IF(OR(= cpt "MM")(= cpt "mm"))(SETQ CPT ' "Phßng Ngñ"))
6 X9 X+ W1 X8 N/ X) j1 l9 i& f (IF(OR(= cpt "DD")(= cpt "dd"))(SETQ CPT ' "Phßng BÕp-¡n"))) V- a+ p: y N6 H; N4 m0 ^ O+ X3 D
(IF(OR(= cpt "SS")(= cpt "ss"))(SETQ CPT ' "Nhµ Kho")). x# a* o: L, O7 g3 B
(IF(OR(= cpt "LL")(= cpt "ll"))(SETQ CPT ' "Phßng §Ó §å"))+ n) m: `5 B' G% e
?0 h4 J5 D6 n" a% q& a5 n
(IF(OR(= Cpt "oK")(= cpt "ok"))(SETQ CPT '"NHA/F BE/M/SP"))
% u1 l; r$ o4 v7 T8 { (IF(OR(= cpt "oB")(= cpt "ob"))(SETQ CPT '"PHO/F/NG TA/W/SM"))
: m& a, Z& w" d b& s (IF(OR(= cpt "oC")(= cpt "oc"))(SETQ CPT '"PHO/FNG HO/JP"))
/ F) n) F) z' k7 H5 n' s (IF(OR(= cpt "oww")(= cpt "oww"))(SETQ CPT '"P.LA/FM VI/E/M/JC"))
2 T" d0 v6 [( d+ g C (IF(OR(= cpt "oM")(= cpt "om"))(SETQ CPT '"PHO/FNG NGU/R"))
) d2 J/ ?9 z* l" Z8 x5 X. B (IF(OR(= cpt "oD")(= cpt "od"))(SETQ CPT '"PHO/FNG A/WN"))6 }+ Z, p$ a% j0 o- i
(IF(OR(= cpt "oS")(= cpt "os"))(SETQ CPT '"NHA/F KHO"))& g" ?$ _ C; F( ]7 S
(IF(OR(= cpt "oL")(= cpt "ol"))(SETQ CPT '"PHO/FNG /DO/M/F"))+ S* l% k4 }& K5 a2 ?2 N% V
! I3 M. k L& m v
(setq pta (getpoint
; C8 _/ Z' T, i% U; c7 c$ p "\nPick first corner. : "))& a1 [7 }# A- o2 [, p
(setq ptb (getcorner pta
6 r8 c7 t! Y! |) x" ~$ J+ H "\nPick second corner. : "))
: {9 x1 D! Z5 h: O' r (setq ptc (list (car ptb)(cadr pta)))! U7 t* J) B3 m H$ J9 [6 h3 B
(setq ptd (list (car pta)(cadr ptb)))$ S* M' B$ e9 x- P
(setq ang (angle pta ptb))
# d9 R- S1 h5 U, L# W9 ? (setq d1 (/(distance pta ptb) 2))
: t2 y5 F4 s/ ~" H; D3 _ (setq cp (polar pta (- ang (dtr 0)) d1))5 _( s2 R% [" T, z5 I% h: i( @
(setq X (distance pta ptc))
8 {* ~' ^2 l% v% u: ~& Z, G) h (setq Y (distance pta ptd))$ F+ l9 @% S, Y' b/ t+ V
(setq X1 (rtos x 2 1))& M- J' s( f- M5 a* d: M
(setq Y1 (rtos y 2 1))
* r0 ^: b! n6 L1 o/ @9 G2 J% E (setq rmsz (strcat "(" X1 " x " Y1 ")"))0 b4 R) C- X- }( g5 f+ @8 j
(command "TEXT" "c" cp "0" CPT "text" "" rmsz))# c2 h& k5 T' t& K8 `
(defun dtr (angg)
# M D; f! b) V( b) U& c (* pi (/ angg 180.0)))
3 j/ l6 N2 Y B) F7 {
2 W X- e _0 x- @. }# X2 l0 m;;; ================================ GHI CHU ============================) h& T$ y0 i* r( \( D/ {
;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========! O7 ~) I1 Q- ]7 D; S* O( U q
;;; =======================Thuong Dung Font Romant.vnh===================
( U G+ W& P- a6 r/ H
+ Y: M! M- O4 w& S5 V: N( c(defun c:GS (/ a b c d), p, U* {$ a+ `; N
(graphscr)
: [! Y+ |+ V/ A! t (prompt "\nSelect text to set style....")
. e* S4 d9 ]* ^+ T! X7 s& l7 d/ a# J (setq a (entsel))8 v: H% L! R/ J
(setq b (entget (car a)))
. |4 e8 f4 Y: Y8 @5 v (setq c (cdr (assoc 7 b)))
$ u) @" ]" ` j2 e! n (setq d (cdr (assoc 40 b)))7 W7 y0 W# P+ e+ i
(command "style" c "" d "" "" "" ""))2 d- i0 R5 d' p. ?1 e
(princ "\nType GS to set text style.")
* H& Y2 ?3 C2 D& e- E" j( w
/ O6 C# O, c! p* J* J! c9 n(defun c:RC (/ olderr ocmd oblp pt1 pt2 pt3 pt4 l w)4 p4 V" w; z. G( `2 ]4 L
(setq olderr *error* *error* myerror)
0 \4 W, p* D9 }; p/ j: g" Z& b (setq ocmd (getvar "cmdecho"))8 m( u& j* A B( t5 l
(setq oblp (getvar "blipmode")): c$ b- O6 G7 W) c5 {9 [) O% J
(setvar "cmdecho" 0)# t4 ?+ s9 E/ a; w. f6 \
(initget 1) ;3D point can't be null+ Y5 e7 o4 B& C& X, L
(Setq pt1 (getpoint (strcat "\nCorner of rectangle or square: ")))
( B/ k Q3 `) ]% S (setvar "ORTHOMODE" 1)
4 @6 t, Y9 K6 ~2 M/ {, Y (initget 7) ;Length can't be 0, neg, or null
5 l$ |4 I- u9 i: f7 G (Setq l (getdist pt1 "\nLength: "))0 `# C7 J+ `6 c7 t) u+ }
(Setq pt2 (list (+ (car pt1) l) (cadr pt1) (caddr pt1))); D0 N$ n. c% `1 e
(grdraw pt1 pt2 2)
/ c6 n2 m! K: p( m7 m9 Q0 K (initget 7 "Square") ;Width can't be 0, neg, or null6 w3 N7 T* Z' I2 q5 |
(setq w (getdist pt1 "\nSquare/<Width>: "))
; g8 |( V+ O# `. V" [ (if (= w "Square") & ~3 r7 L( W6 F; H
(setq w l)
8 s( L3 g1 L9 | E% W9 { )8 l4 c b. A5 V9 i; E! S
(setq pt3 (list (car pt2) (+ (cadr pt2) w) (caddr pt2)))
8 Q# o3 Q' n7 _ (setq pt4 (list (car pt1) (+ (cadr pt1) w) (caddr pt1)))
8 a1 z& b5 R. v! m/ w, [# k' ~ (grdraw pt2 pt3 2)
' o# m3 \8 q Y) {& I (grdraw pt3 pt4 2)- c7 b; K$ P9 y p
(grdraw pt4 pt1 2)
( M! ^" a9 _& u0 b5 A. s (setvar "ORTHOMODE" 0), }1 a6 L1 {; W" _' r, l
(command "pline" pt1 pt2 pt3 pt4 "close")
" o+ A& P, R5 p& n (setvar "cmdecho" ocmd)
, V% d1 x. o0 ~* q" d5 |& O- T (setvar "blipmode" oblp)
W0 K" W6 |+ M7 N0 e, m5 V0 q5 F (setq *error* olderr) ; Restore old *error* handler0 f& o2 s, N2 O0 f
(princ)
4 y6 q& r* H1 ]: n1 M! R( L5 d)) }$ w8 k. F- B7 @# D# F8 ]8 W
4 M* r2 d) w4 s; T2 `9 N5 f
(defun c:SG (/ ent pt1 pt2 ang)
" e) e7 e u9 T5 ~( \5 | (setq cmd (getvar "cmdecho"))! m, ]' t9 U& F8 j: n7 G" C( F/ A
(setvar "cmdecho" 1)8 z& n9 C% l/ j/ C
(prompt (strcat"\nSnap angle will be set to angle of line"))
8 I) g! B% Q/ J4 l# ~- Z (setq ent (entget (car (entsel))))1 e3 _* A6 X; N2 s; r, l- i+ Z
(setq pt1 (cdr (assoc 10 ent)))9 V9 y9 g, g# P0 j8 v' f, o/ _
(setq pt2 (cdr (assoc 11 ent)))3 X, e( l0 x3 }1 r, ~8 E' {3 D
(setq ang (angle pt1 pt2))# G/ {* n- j, Z# O* X" }
(setq ang (/ (* ang 180.0) pi))
- T0 ~9 I4 r% d (setvar "cmdecho" 0)
% Y7 W+ p$ a4 s R+ G6 P) o% m1 f (command "setvar" "snapang" ang)* X% B* U! [2 }" p7 q
(setvar "cmdecho" cmd)
) U, s$ Q6 E4 m3 C9 L)
- a F! m2 o O8 T( U6 F* q" ?+ g$ S+ j: e3 Z. G3 T
(defun C:TG (), H" s, [& g" `' Y
(initget "Increase New")
( s. y+ @" G7 O; b+ E3 s1 }+ y (setq ans (getkword "Increase/<New>: "))2 ~8 c- f! M- ]2 h8 _
(modang)
- M% F# O9 Y7 @* F/ k3 z# ~)& l, M1 ^( V& Z. B+ h$ H! H
(defun modang (/ ang ss ca e na ssl)8 ]0 R, m3 o9 [% X( Z
(if (= ans "Increase")
' a3 c! p! M4 s4 l. Y (princ "\nIncrease angle for text by: ")8 k" K0 B m6 \- ^- `/ c5 u
(princ "\nNew angle for text: ")* u/ f9 ]+ H. T' i' ~2 F
)
* J$ ^/ q+ d- z: M: H5 z c+ f (setq ang (getreal))
( U% E0 d3 {) B ~, t (setq ang (* (/ ang 180) pi))
% y5 j8 |& T: K( b" Z (setq ss (ssget))
, ~2 K1 k& Y- i* ^( v8 [; ~ (setq ca 0 ssl (sslength ss))& }+ n; F5 a0 `) | z
(while (< ca ssl)
, j# n s4 D6 y- s& [& @' C (if (= "TEXT" (cdr (assoc 0 (setq e (entget (ssname ss ca)))))) a4 }- H4 M& R7 @& r3 C. W
(progn! p% b C5 [7 ]) J
(if (= ans "Increase")& [7 y- h* R1 G8 ~/ A/ J, ^: X
(setq na (cons 50 (+ (cdr (assoc 50 e)) ang)))
6 S! S. U" ]& z, Y (setq na (cons 50 ang))2 h, J1 P& y+ }# }
)
/ D3 J n4 p! v (setq e (subst na (assoc 50 e) e))0 u% f* C8 K, j, p8 r- r
(entmod e)
4 q, G: d) ^# N8 }1 J% s (setq ca (1+ ca))! k$ j$ k$ D' X0 L
)- e- `; g; E8 f
)% _6 B/ j5 J9 C; \3 N K
); [& C x' v- o; h Y8 x
(terpri)( R6 a/ g$ ^: P3 ]- @
)/ T" b) A1 k$ x" [9 @' e" n, J
$ i& u0 c" K* J x) D! h% Y' _ K! i
(defun c:WL ()# E) g; E& m- ~( q P& B8 M
(setvar "cmdecho" 0)) _2 R$ v3 P& N8 s% B
(setq a 1)8 d }, E" V M. \0 B
(prompt "\nSelect Polylines to change: ")' r, H* i2 d; s2 U
(while (/= a nil)
/ V1 q$ e7 V7 ~: g I8 v4 w" ] (progn
8 d" c! N# T5 x q5 j$ a) Y (setq a (entsel))0 n; q! b6 J: i& l
(if (/= a nil); t& C( v! E# [8 }; L* ~
(progn$ k" s4 I' \# i* D
(setq b (entget (car a)))
# B. l2 `. N* _; { (setq c (cdr (assoc 40 b)))& H4 J2 L9 w' |& [
(princ c)
2 e4 ^$ {/ }. E8 o; [# A5 k (command "pedit"a"w""lw""")" p* T1 }' G9 H) K
)))) - j* @! j, j* W& F" L* t
(princ)0 \6 R$ {2 M1 D
)! u' g$ n0 R% ]
( l' I v2 h% _+ ?8 c8 d;;; ================================ TEXT FIT ============================8 ]; I g9 s8 }) V
! k/ {# W2 S1 x& P5 s; u3 N, Y
(Defun c:FT ( )
7 D! H0 ?1 N* ]7 a) Y+ @" V% Q (defun setsnapang (arg /) (setvar "snapang" (angtof (angtos (cdr (assoc 50 arg)) 0 8) 0 )) )9 G8 B& z( d8 P5 K6 C& C# V+ G1 r7 p
(Defun LL-xyz (arg) (CAR (TextBox arg)) )0 l r7 l+ H7 ?& O% E# P
(Defun UR-x (arg) (CAADR (TextBox arg)) )3 [; t) Z F J* Y; A+ i
(Defun LL-y (arg) (CADAR (TextBox arg)) )
$ p) g! a5 ~ n0 K$ M+ O" E- ?9 f5 h (Defun LR-xy (arg) (List (UR-x arg) (LL-y arg)) )( a; l; Z- C3 m' T% w( C+ Z! p
(Setq ename (CAR (EntSel "\nSelect Text to stretch/shrink:" ) )
& J0 T; ^% l, b Textent (If ename (EntGet ename)) )
8 Y$ Z6 ]& k7 D4 g- x, r6 v9 m7 l! _ (If (= (CDR (Assoc 0 textent)) "TEXT")
; _5 o K3 {5 l! }- F( E9 b (Progn (initget 0 "Start")$ t" i! U5 y* A7 C8 }
(Setq NewEnd (Distance (LR-xy Textent) (LL-xyz Textent) ) )0 Z8 {, H$ w3 a& b
(setsnapang Textent) ;set snap along text entity
; a% E' U8 |. @; t7 I (setvar "ORTHOMODE" 1) ;drag along the text, b" x1 _* |% C7 _2 z2 x
(setq : o2 s3 x. k& a9 _, Q9 O; f7 w' B' c
TMP (getpoint (cdr (assoc 10 Textent)) "\nStarting Point/<Pick new ending point>: ") )
& H% x* Q2 F( n& d, q$ c7 | (setvar "snapang" 0)
, j* H5 F; Z3 T (cond
" H8 _: P/ E+ L7 R8 I; l. u* P ((= (type TMP) 'STR) ;;new starting point to be selected
! e7 ]8 @" R* I2 _& y" d (setq Start (getpoint "\nPick new starting point: "))( v7 e( E7 R I( ~) [
(if Start (progn7 f+ n; a- H- N; D2 k
(command "_UCS" "_E" (cdr (assoc -1 textent)))
, t3 Z) j! Q# R8 { h' p (setvar "ORTHOMODE" 1)" K+ h% x. N0 c$ |/ ?# D" D" h( N
(setq NewPt
. T$ l U4 P( h (if Start
' d: }1 g6 s1 s$ s! R (getpoint (trans Start 0 1) " ending point: ") nil ) )& u' M9 } ?7 l6 Y+ R
(if NewPt (setq NewPt (trans NewPt 1 0)))* L$ J( B- u! ?, v6 C4 I, D- |1 X
(setvar "ORTHOMODE" 0) C1 v* T9 ]. r/ y/ f7 _; j' E; D
(command "_UCS" "_W") ) ) )4 ~: ^+ ?, e5 d, V4 d) j2 x
((not (null TMP)) ;;new ending point selected
6 ?; e% l- `' j& ?, n (setq Start (cdr (assoc 10 Textent)) NewPt TMP) )" x4 e$ i5 k: U, @! d. ]1 @
(t (setq Start nil NewPt nil) ) )
/ w w ]- _2 y, d5 X: X (if (and Start NewPt) (progn
, @6 q7 q }& C) \. l (setq Val (Assoc 41 Textent) ;;current width factor
$ o8 K9 V- Q% v( q% S1 `' m Val (if Val (cdr Val) 1.0) LTC_%
" e0 S& i0 ~* ?5 G0 P5 G (* (/ (Distance Start NewPt) NewEnd ) Val )
' g0 w* @- O% {% ` I2 s9 U textent (Subst (cons 41 LTC_%)3 v9 F o3 R' _5 }
(assoc 41 textent) textent)
3 z7 c6 D2 A$ t( G* ^7 v s textent (subst (cons 10 Start) (assoc 10 textent) textent)
& {9 z& v. _" d! {! @: z textent (subst (cons 11 NewPt) (assoc 11 textent) textent) )2 h1 o5 m# ]* x* s' @
(EntMod textent) (EntUpd (cdr (assoc -1 textent))))))) (Princ))
$ z/ C1 p. W/ n8 A- @! D8 [2 I8 h) W# }+ y% _: D' X% R
;=====================================================================
( b; z( F4 V1 E5 V$ e$ m) V;=========================COPY + ROTATE ==============================2 g: G4 n1 c8 g' `3 y* F
;===================================================================== N1 D( L. I. s1 J7 r' d
: L# M" h* c. C" B& l- K; \
(defun c:CR(/ olderr cm loop ss1 ss2 bp mult lent ss2 lp1 lp2)
' J% p( v# u0 P7 V1 V (setq olderr *error*
; D X3 F7 U& q) b6 Y2 v4 I: a *error* croerr)
P4 m# B% o) P (setq cm (getvar "cmdecho"))8 O. K9 M% g3 O( I- X
(setvar "cmdecho" 0)
+ [' l: u" T5 s- x; g. T0 e (setq loop t)* Z h, e: S! R3 Q1 f+ k+ {
(while (not (setq ss1 (ssget))))/ _9 J) r& j3 J9 w+ @
(initget 1 "Multiple")" | @; Y/ O: j, u1 q
(setq bp (getpoint "\nBase point or displacement>/Multiple: "))
5 a; h) D: ]1 W T; b4 F4 j8 Q* A (if (= bp "Multiple")$ ~ V& N1 ^: _7 }8 N) k/ B& l
(progn) s/ J" b) e2 j% N
(setq bp (getpoint "\nBase point: "))
' ~% u3 A% @4 g' X* x* N (setq mult t)
) n4 E# k4 |1 L" Y( {1 m ~ )* ?) v8 N5 U4 D8 m5 P4 v6 N
)1 G4 R$ Y# F% P* a$ s
(while loop
: ~! w8 w x$ }- D0 B; k1 C (setq loop mult)$ z& w3 D/ D% T' c4 j6 t+ t& o# ^
(setq lent (lastent))2 m* d0 b" L: ^3 o: @2 X
(command ".copy" ss1 "" bp bp)" O6 r |* H5 [ l' T4 s! J
(setq ss2 (lss lent))
0 k* ?* x% D- Y6 c (setq lp1 (getvar "lastpoint"))' H7 D/ z( u3 {* v; j
(prompt "\nSecond point of displacement: ")
; a2 F' R7 [& J) U: e. M (command ".move" ss2 "" bp pause)
: o! ~4 M4 ^* O* s (setq lp2 (getvar "lastpoint"))
( R9 P3 u# P1 z o6 V! W (redss ss1)
* m' s/ h& ~. j (if (and (not mult)8 ~4 {& w7 o& Z B
(= (distance lp1 lp2) 0)1 h p3 a6 \* Z! ]
)
1 j* E# t" l. N; F (setq lp2 (getpoint "\nRotation Point: "))
) A f( H$ X+ d )
* L- g: t2 I6 P7 E; y& c (if mult
: G+ l% P6 l* _, g (prompt "\nRotation angle ")7 ]8 C7 x c! R7 t) y. [9 T
(prompt "\nReference/<Rotation angle>: "). A4 K% |8 P/ {) O( p6 A
)( n8 t9 _: ^; p5 E6 ]. `5 b& f9 X
(command ".rotate" ss2 "" lp2 pause)9 J: Q5 p o: C& ~0 a
)
5 v' L8 N c8 B5 M* Q* @# ~" z* ~ (setvar "CMDECHO" cm)
0 T0 U6 G( _5 {1 c, J (setq *error* olderr)" M! V8 [# d3 M0 x8 F. K$ \
(princ)
' m2 R6 J# b U1 {8 S( i)
5 E' T( f, ~% e; Z4 ~/ I(princ)& W* l0 M2 c6 |& z S
(defun croerr (s)
% ?( F0 w: D, U7 L* `% q% M (if (/= s "Function cancelled")
$ E# g% R: ~, K* @! I1 L" u (princ (strcat "\nError: " s))
8 p0 p4 ~$ J6 Z' K- f )
' ?( F" z# B7 ?* t$ b) k" M (setq S nil)
7 t4 ^5 u% ]' D, K (setvar "CMDECHO" cm)* w, @' j6 y% V6 W
(setq *error* olderr)
; h( E1 s. m! f) x (princ)9 i7 u, u: K: n6 E
)& U. S* @( _, K1 s0 Y. j
(defun lastent (/ a b)
: `% }3 T' y# Y J, M& Z7 o (if (setq a (entlast))
& ]/ a4 H# E% p (while (setq b (entnext a))
/ m- H$ @, E/ a' w g( X* f7 J/ I (setq a b); [2 ?8 c% s) j8 s* |
)+ F* `7 E5 C% d: R9 d8 ?% u
)
) @1 L) l$ ^0 K: x: N2 ? a
7 c( Q; U D1 A, M( o7 @- A)5 ]/ g4 U% |* d) L
(defun redss (ss / en i)
2 C$ b* Y! E S (setq i 0)
6 n- Q* l1 \+ y; r( M f; Q, _6 @ (while (setq en (ssname ss i))
; N' g' h$ t( d# Z5 r0 {. S* f (redraw en 1)
) ]4 U% ^0 _+ M7 R0 X (setq i (1+ i))
3 t7 H. U5 N. \1 D, I )6 V) n: k M5 m1 I& D
)7 t2 B% a* F7 D$ o
(defun lss (en / sels ed)' F! u9 ?8 U. Y2 @+ \' u
(setq sels (ssadd))# f S# ~, ~3 `* g6 R
(while (/= en nil)
) G* H% P+ T* P2 h: F4 x) }: u (if (setq en (entnext en)) (setq ed (entget en)))
# f2 u) {) @ ~) {3 { (if (/= en nil) (setq sels (ssadd en sels)))
_. p1 \) Y1 a" D (if (or (= (cdr (assoc 0 ed)) "Polyline")
$ Y1 Q+ x( Z6 U# E& F# ^ (= (cdr (assoc 0 ed)) "Insert")3 l( ?* O, ]8 U. F. J
)% D) x7 Y/ Y% l
(while (/= (cdr (assoc 0 (entget (setq en (entnext en))))) "Seqend"))/ g- l& E" o' C1 H1 i6 E' j/ O
)
2 \* e O) y. }) g ): m; d2 B" L! u
sels# O4 k9 _- \" L* m
)
9 z& Z. V/ l1 B c( t+ Z2 `' `
5 Q# n# \/ n" F8 F: q) G;;;; ================== CAC FUNCTIONS DUNG TRONG ACAD.LSP ==================3 C. }0 s5 T# V. j( V5 I! c ^
;;;==================== Tran Ngoc Thang - Sinh 03-05-1976===================: q2 }! u# ]9 a; k
) ~' H3 |& _. a5 z4 K! L(defun c:00 ()(princ "\nChon doi tuong net Defpoints")(ssget)(command "change" "p" "" "p" "la" "Defpoints" ""))
. E: u c8 `! `; g5 M) I5 z5 W* _9 Q(defun c:0 ()(princ "\nChon doi tuong net 0")(ssget)(command "change" "p" "" "p" "la" "0" ""))5 f0 `2 f' ~6 Q+ K1 S
(defun c:1 ()(princ "\nChon doi tuong net COT")(ssget)(command "change" "p" "" "p" "la" "COT" ""))6 p) P, H' b8 H$ c' s9 ]! z. N2 p
(defun c:11 ()(princ "\nChon doi tuong net DIM")(ssget)(command "change" "p" "" "p" "la" "DIM" ""))3 F2 ] x8 W0 ~, W
(defun c:22 ()(princ "\nChon doi tuong net MANH")(ssget)(command "change" "p" "" "p" "la" "MANH" "")); [) r$ _$ p" {3 ?+ d! ?
(defun c:33 ()(princ "\nChon doi tuong net NETMANH")(ssget)(command "change" "p" "" "p" "la" "NETMANH" ""))- l$ Z0 B. f4 q6 l
(defun c:2 ()(princ "\nChon doi tuong net NETDUT")(ssget)(command "change" "p" "" "p" "la" "NETDUT" "")) ^9 x) l% d2 r1 G. J3 @. w
(defun c:3 ()(princ "\nChon doi tuong net NOITHAT")(ssget)(command "change" "p" "" "p" "la" "NOITHAT" ""))' Q0 D) x' ~0 j# I# _- s2 G
(defun c:4 ()(princ "\nChon doi tuong net TUONG")(ssget)(command "change" "p" "" "p" "la" "TUONG" ""))3 r7 g% L8 e$ Q9 l3 Y. _9 h6 ]
(defun c:44 ()(princ "\nChon doi tuong net KHUNGTEN")(ssget)(command "change" "p" "" "p" "la" "KHUNGTEN" "")), n. q7 y0 a9 W) \
(defun c:5 ()(princ "\nChon doi tuong net TIMTUONG")(ssget)(command "change" "p" "" "p" "la" "TIMTUONG" ""))
- t( ?9 e2 \. W3 G f' w* {& T(defun c:6 ()(princ "\nChon doi tuong net CUA")(ssget)(command "change" "p" "" "p" "la" "CUA" ""))
1 P0 l/ \$ ]0 x) I* P(defun c:77 ()(princ "\nChon doi tuong net THAY")(ssget)(command "change" "p" "" "p" "la" "THAY" ""))8 A5 l/ g# n9 L+ {0 O9 M
(defun c:7 ()(princ "\nChon doi tuong net NETTHAY")(ssget)(command "change" "p" "" "p" "la" "NETTHAY" ""))5 m+ Y2 d9 Q' O: Z/ {% V u
(defun c:8 ()(princ "\nChon doi tuong net HATCH")(ssget)(command "change" "p" "" "p" "la" "HATCH" ""))! v1 m0 h1 z: D0 i7 p. Q& u9 [# }
(defun c:9 ()(princ "\nChon doi tuong net TEXTTXT")(ssget)(command "change" "p" "" "p" "la" "TEXTTXT" ""))3 X. ?3 y+ v$ @, J
(defun c:99 ()(princ "\nChon doi tuong net TEXTVN")(ssget)(command "change" "p" "" "p" "la" "TEXTVN" "p" "C" "bylayer" ""))) k: X+ {* V8 M9 T5 Z
(defun c:td ()(princ "\nChon doi tuong net THEPDOC")(ssget)(command "change" "p" "" "p" "la" "THEPDOC" ""))' y! U1 z7 }. [6 W
(defun c:ddt ()(princ "\nChon doi tuong net THEPDAI")(ssget)(command "change" "p" "" "p" "la" "THEPDAI" ""))- C# B2 V+ V3 a
1 E/ C1 G- e; p# N;=====================================================================
8 E( F N" K4 R8 j;===================DAT Ti Le Theo KHO GIAY BAN VE====================
; Q6 B! Y( h" r;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================2 j$ i, V& ^5 e9 e, a: v6 q
) k4 Q/ _6 |5 p/ x;(defun c:SA6 () (Command "DIMSCALE" "111.11111" ))(princ). d6 d9 @# `+ ^0 ]2 p! h0 ]; L
;(defun c:SA5 () (Command "DIMSCALE" "1111.1111" ))(princ)
: B" S0 i* K" l) z* _4 g/ {: P/ X; E;(defun c:SA4 () (Command "DIMSCALE" "1111.1111" ))(princ)
/ E. @& E9 X5 R l; l6 i;(defun c:SA3 () (Command "DIMSCALE" "11111.111" ))(princ)4 i+ f+ E7 v; Z9 W1 u! U6 c4 E$ X
;(defun c:SA2 () (Command "DIMSCALE" "111111.11" ))(princ)
$ X0 {1 y' S5 e- G) _* ^" y" j;(defun c:SA1 () (Command "DIMSCALE" "111111.11" ))(princ)4 g6 F. ~( ~: M
;(defun c:SA0 () (Command "DIMSCALE" "1111111.1" ))(princ)
; V0 j" Z( j3 E( a) A7 [8 g5 H V: x i
" |' Z: ~1 z A6 G* [;=====================================================================9 g, U! X2 z' [7 }9 s
;===================DAT Ti Le Theo KHO GIAY BAN VE====================
K0 U; f4 T0 b5 ?" ^) V;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================- c$ Y' j, U- d# c/ L
3 {8 t- J; e ^2 d, Q: j
;=============== DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =============
( U Y5 ?4 Y, x6 q
0 }0 p! ?' W: T( Z: @;=============== DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =============
; V- H" Y4 V& n7 ^
9 u; g* W! |' ?7 O% c: u% V(alert "Using the NetXuatAnh-[ 5940.00 x 4200.00 <pixels> ] command!")
8 `( N7 R5 S2 V3 l$ u0 b(princ "\nEnter (DEFUN C:netxuatanh () to get to real LAYER command.\n") (command "NETXUATANH")4 W2 e# b2 V) k! Z5 h" O
5 R8 e% n7 p' {0 m. p2 F# G8 ~;=============== DAT LAYER NET de xuat anh JPG [W x H] [5940.00 x 4200.00] ===DRAW=== R; T1 w: X( B! r' O! b& D
) v" }" J! C! c. a
;(DEFUN C:netxuatanh (): j: K9 S# z$ L: O! D
(COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.6" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "5" ""
' w% f+ f# K/ F3 d "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "1.58" ""
- ?- U8 g8 M! I "M" "MANH" "C" "9" "" "Lw" "0.5" ""
8 c- I9 }9 K3 n, `4 V2 q( l "M" "DIM" "C" "1" "" "Lw" "0.6" ""
% I0 C7 w4 S% _( t4 {# e "M" "THAY" "C" "7" "" "Lw" "0.7" ""
) \1 w" {7 L; g6 H1 t2 O "M" "NOITHAT" "C" "60" "" "Lw" "0.5" ""+ F7 V) n) U# v7 p, x
"M" "HATCH" "C" "5" "" "Lw" "0.35" ""6 }5 g) E9 y [% _% x
"M" "COT" "C" "2" "" "Lw" "2" ""
. m9 G/ ^+ V) m/ ~5 p) y* ^9 [ "M" "Defpoints" "C" "7" ""' [4 e1 Z- A; z7 N& O
"M" "0" "C" "3" "" "Lw" "0.5" ""
: V2 q; @% v/ v; "M" "1" "C" "1" "" "Lw" "0.5" ""+ E; [, P0 A! b, M# v
; "M" "2" "C" "31" "" "Lw" "0.5" ""
2 c0 V; Y# {* _( q! r/ a: N( a; "M" "3" "C" "8" "" "Lw" "0.35" ""( X$ v# m# G0 A" L; F
; "M" "4" "C" "4" "" "Lw" "0.8" ""1 R( t2 J9 c, [' K" M: a
; "M" "6" "C" "6" "" "Lw" "0.35" ""
+ o# p0 g, s9 E8 S; "M" "7" "C" "7" "" "Lw" "0.4" ""0 L+ p7 L; ?+ V- u: j, O) ^. K; @
; "M" "8" "C" "8" "" "Lw" "0.35" ""
0 m" z0 X% x) d- J; h4 ] "M" "DAY-DIEN" "C" "3" "" "Lw" "0.5" ""
/ j$ j, [* {2 G; W- M) [* H" O2 p "M" "DUONGBAO" "C" "7" "" "Lw" "1" ""
) `1 _8 Q+ w- r V! r" v' @$ e8 n; "M" "KE" "C" "8" "" "Lw" "0.3" """ z: g0 K" v) D. A- z3 G4 R
; "M" "KT" "C" "9" "" "Lw" "0.35" ""- [- _+ w ?9 J4 _; n" y
"M" "NETDAM" "C" "4" "" "Lw" "1" ""3 X8 l! h( [ q5 k
"M" "NETTHAY" "C" "255" "" "Lw" "0.7" ""
9 W/ o% i _& D7 z4 \6 E "M" "NETMANH" "C" "43" "" "Lw" "0.5" "". q9 ^5 \& n4 _# ]- y& @
"M" "ThietBiDIEN" "C" "2" "" "Lw" "0.8" """ Z2 i' I6 s2 }* E/ |6 J
"M" "TEXT" "C" "7" "" "Lw" "1.58" "") w G' ?( ]4 P8 `2 `4 [
"M" "TEXTTXT" "C" "7" "" "Lw" "0.5" ""( k& [5 z- S+ O( o8 e' h* \
"M" "TEXTVN" "C" "60" "" "Lw" "0.4" ""% y: z! U- W( h. j/ r0 K
"M" "TEXTVNi" "C" "60" "" "Lw" "0.4" ""
" N# r& |. ~+ N. D' s D9 {8 { "M" "THEPDAI" "C" "3" "" "Lw" "0.7" ""# X. E8 y: o4 T9 j7 J
"M" "THEPDOC" "C" "2" "" "Lw" "1.58" """ d7 n% `( R* {4 a+ r
"M" "CUA" "C" "6" "" "Lw" "0.5" ""7 e4 u5 K( a3 G% J6 J) l
"M" "CUAMATDUNG" "C" "6" "" "Lw" "0.5" ""
& u, q3 W, h* u2 t7 u4 \' \3 _) U6 {1 x4 x7 `4 L( x/ U
;=============== DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] ===NUOC===% J0 b7 K! O8 r8 a. e
$ W" j, {% m& K( o7 y8 P: [ "M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.5" "" ?. f* ~- |+ |
"M" "4-WateR_IN" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE1" ""! s& @$ G0 F, |7 c8 \ Q
"M" "4-WateR_OUT" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE2" ""
6 m: d- ~7 ^4 f( q; "M" "250" "C" "250" "" "Lw" "0.35" ""; h2 n9 m1 W# ^9 j
"M" "KHUNGTEN" "C" "4" "" "Lw" "1" "", ^) r1 |$ j: ?, o+ {. Q% H3 `- E
"M" "TIMTUONG" "C" "5" "" "Lw" "0.5" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "10" )(princ)3 }3 Z* ^3 t$ l. S
5 {6 r( A2 t# f" J
;=============== DAT LAYER TEXT de xuat anh JPG [DIM] [TEXT] [GHI CHU]======. ~% u; ?2 V: \! T
;===================================30|04|2024==============================
' P0 C4 z% D A& U0 ]) G; S. P$ {" ~4 n; w2 _
(Command "-style" "VNi-AUCHON" "vauchon.ttf" "225" "1" "0" "n" "n" )(princ)1 x% D4 u0 {7 f1 f
(Command "-style" "VNi-COURI" "vcouri.ttf" "200" "1" "0" "n" "n" )(princ)6 T& b: D4 s2 E. d2 u }. Q/ f- M1 u
(Command "-style" "VNi-COURIB" "vcourib.ttf" "200" "1" "0" "n" "n" )(princ)
- K" D( k# I1 p+ p% A; q (Command "-style" "Vni-VietNam" "vn_vni,vns.shx" "0" "1" "0" "n" "n" "n" )
- U& ^. z! d7 w: n% b (Command "-style" "Vni-ROMANS-TEXT" "vni-romans,vns.shx" "200" "1" "0" "n" "n" "n" )
4 |/ I; G$ m. e (Command "-style" "COTES" "tcvn3italic,vns.shx" "0" "1" "0" "n" "n" "n" ), d5 A( o8 a! E, d& M* w
(Command "-style" "TRUC" "impact" "0" "1" "0" "n" "n" )
' a1 B( e4 l: ^( W8 ^" j5 g (Command "-style" "VNHELVLT-Hoa" "vnhelvh,vnh.shx" "500" "1""0" "n" "n" )
2 |8 F i" i4 F( j, | (Command "-style" "VNHELVLT-Thuong" "vnhelv,vnh.shx" "500""1" "0" "n" "n" ). Q- V8 r! J* L2 Y
(Command "-style" "STANDARD" "Cambria" "250" "1" "0" "n" "n" )$ P/ C! [) V5 [# ~' }
(Command "-style" "CAMBRIA" "Cambria" "200" "1" "0" "n" "n" )
" {; j6 R- V1 X! g (Command "-style" "GHIKH" "romant,vns.shx" "0" "1" "0" "n" "n" "n")( M6 `7 g1 {, L4 B" A% I6 W
(Command "-style" "GHISH" "impact" "0" "1" "0" "n" "n" )
% b8 d g% P6 y; Q% Q; W (Command "-style" "ROMANT-DIM" "abcroman,vns.shx" "0" "1" "0" "n" "n" "n" )
( v7 o1 z# B8 _! M4 b7 z" j/ m (Command "-style" "ROMANC-KhungTEN" "abcroman,vnh.shx" "200" "1" "0" "n" "n" "n" )
$ t4 s( }+ l: V (Command "-style" "ROMAND-TEXT" "abcrom,vnh.shx" "200" "1" "0" "n" "n" "n")
& _, Q& g3 \* \/ [& h8 t (Command "-style" "ROMANT-TEXT" "tcvn3italic,vnh.shx" "200" "1" "0" "n" "n" "n" )(princ)
3 v8 D- t& m% { J" }
3 g( Z5 V9 d% }" A, j m* [;============= DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =DIM-STYLE=* M* z; G5 \$ O7 @- g
;===================================17|10|2024===================================
% Y f& e2 Z& T3 q* T% e! C8 @0 [
# y5 a4 M% T6 v- j& V. \ (Command "DIMTXSTY" "ROMANT-DIM" )(princ)
" C$ Y6 d3 u# w6 G+ m (Command "DIMBLK" "Closed" )(princ)
2 @5 \! u9 R) A) {1 `8 @
! M0 q0 s2 M- q' X& ^- q# a" k* S! V;============= DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =DIM-STYLE=
( m. o+ \- W! y- D: W& x8 X;===================================17|10|2024===================================
3 ~0 \/ a% a% h, d6 r6 t& Q d; k
1 m. R- D# f' z) r4 B9 z;(Command "-units" "2" "8" "1" "8" "" "N")
( Q, ]' [- ~$ G; Y& L0 a& |. v, ^) C(Command "-plot" "Y" "" "publishtoweb jpg.pc3" "User 1 (5940.00 x 4200.00 Pixels)" "Landscape" "N" "Display" "Fit" "Center" "Y" "monochrome.ctb" "Y" "" "N" "" "N" )(princ)
: _# O, p3 T, w& t. f1 ?' r* Y; F: a! }: }) A; E6 Z; H
;============= DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =DIM-STYLE=) v, r" y- D b9 c
;===================================17|10|2024===================================
' @, ~8 k+ \ c6 S# E0 c. `; i/ _& ]' o& [- L+ j
;======== KET THUC - DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =====# D. T1 p' ?' R3 P4 |1 n
+ k; T: {: s7 r' o' u( t- {;======================== DAT NET IN & TI LE BAN VE =============================
5 r) l5 E, q/ |: a* H% Y% h
4 z5 A3 q3 \+ c6 [;=================LENH VE KHUNG TEN - Tieu Diet Lenh==================
& x' h' Z( D' {: V;=============== DAT KHO GIAY BAN VE - KIEU KHUNG TEN ================
2 J! z0 t: \1 q7 t5 g;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
0 x" R2 K; N- [; H;=============================11|07|2025==============================
; B% M/ P0 i+ _* ?+ ^, e4 Y& [; }( P;Ti Le Ban Ve - 1 : 1008 L$ u. |( P' H+ D
(Defun c:kta4 ()
6 ~$ l1 P0 ^5 Z, P3 w! A& O) z0 d# C (setq mv_sc 100);Ti le ban ve2 l8 q; K/ s, y- |2 Q0 ]" X, c. H% b! w
(setq x4 297)
6 F+ ?; {& b2 _( a. x( y (setq y4 210)# ?8 W: L# o# h: v1 K: T6 t% H, B
(setq x4 (* mv_sc x4)
* p f2 }6 s [& ?# a y4 (* mv_sc y4) )) E, r+ Z$ O% D% y7 b2 E ?
(command
! Q P) t$ o/ b0 \$ s5 [% N9 Q5 a "LIMITS" "0,0" (list x4 y4)
5 ]2 Y1 Z, ]/ d' n9 H "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C": T. P3 l* e+ K9 Q" ?7 L
;Khung CHU NHAT Chinh * H7 v' y( [; |1 l" X9 r
"RECTANG" "500,500" "@28700,20000"
0 f7 [- _) I; _# }4 F- W) s "RECTANG" "700,700" "@28300,19600"1 _! d* {% Z: B- G- T) f1 J! |$ E' S
;Khung Ten Chung/ `+ t* |8 E) M1 D/ g6 E- a* k ]
"RECTANG" "700,700" "@8000,1250"
8 N9 L* z6 y, ^$ R "RECTANG" "700,700" "@17300,2500"
; P3 H0 Y( T- o;Ten Ban Ve6 b& l5 e* R( F! x8 l
"RECTANG" "18000,700" "@11000,1250"; a* s- T [+ L0 F
"RECTANG" "18000,700" "@11000,2500"" l1 Z- Z, J! h! y* [
;Khung Ti Le + Ngay Thang Nam0 t+ K$ d* v# K) \+ v$ K4 G
"RECTANG" "22500,700" "@2000,2500": H# f; C: Z5 ?9 W
;Khung CHU TRI
) A5 f/ [# N* L$ y+ Z$ s "RECTANG" "8700,700" "@3800,2500"
, T o: y; V# d8 M p: `* |) V) w @"ZOOM" "_a" ))
. M" X9 @' A8 \;=====================================================================
- W( o- r5 a* _4 J* e8 p$ R;Ti Le Ban Ve - 1 : 100# v6 B2 Z4 C9 [
(Defun c:kt4a ()
9 R% c z$ e) C7 h4 n (setq mv_sc 100);Ti le ban ve2 o; N% s6 r; e8 F( ^* e6 X
(setq x4 297)) a/ z8 s! @8 L) S& Z4 p& P# R
(setq y4 210)
- d( F, A9 K9 i8 F+ H+ b (setq x4 (* mv_sc x4)
. v+ t u) Z+ s3 K% v y4 (* mv_sc y4) )7 d& j8 P- Y0 y7 W
(command i) @; n: V* Z' W Q( O( j
"LIMITS" "0,0" (list x4 y4)
) q1 N: W4 D$ r* C "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"0 J9 S7 C! V/ f9 [
;Khung CHU NHAT Chinh 0 D- N6 a* J. r( d9 ^6 h
"RECTANG" "2000,500" "@27200,20000": n( u6 o5 X1 m! f8 ~& W9 D1 Y
"RECTANG" "2200,700" "@26800,19600"% y( a; y* P# i# S% `( a6 }% b
;Khung Ten Chung
1 V t0 B3 ?% @! Q/ A. ~. N "RECTANG" "2200,700" "@6500,1250"
; R3 @8 p$ F* u, m* I. ?7 o "RECTANG" "2200,700" "@15800,2500"
1 h# f. @9 L0 H+ N" U m;Ten Ban Ve: p' }% G- C* R9 l6 B
"RECTANG" "18000,700" "@11000,1250"
- w! O6 G0 _! v1 z "RECTANG" "18000,700" "@11000,2500"
7 q4 M1 d, D. E3 m;Khung Ti Le + Ngay Thang Nam
: u/ A! H8 t: F "RECTANG" "22500,700" "@2000,2500"
: a9 M7 n/ _0 W7 P0 K" B;Khung CHU TRI4 g1 b8 x1 i+ |) C. q4 l
"RECTANG" "8700,700" "@3800,2500"( `' J' ?3 {% w% ~$ e K* U# U
"ZOOM" "_a" ))% u% K; h F W& Q
8 X1 Z' ~8 |/ \( ]+ D;=================LENH VE KHUNG TEN - Tieu Diet Lenh==================
; T$ E0 ~) m6 \" L0 O" V3 I;=============== DAT KHO GIAY BAN VE - KIEU KHUNG TEN ================
1 ]1 M: B$ l6 K3 t7 ~;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
9 H8 j7 g7 ]' L. H, ^2 m4 M) s;=============================04|07|2026==============================
' n1 {* J) h$ \' F q;Ti Le Ban Ve - 1 : 100& ]. F% F6 P7 q7 z+ x6 g
(Defun c:za4 ()4 U. w9 M, o# i: A* Y/ ^% T1 }
(setq mv_sc 100);Ti le ban ve
6 g8 V/ w2 p2 \, D/ x (setq x4 297)+ ~) f( ]6 ]4 O0 f7 @3 L
(setq y4 210)2 \5 b9 \$ {6 x9 c
(setq x4 (* mv_sc x4)
- z1 d3 x: v3 n* ` y4 (* mv_sc y4) )
# [8 p5 |4 _, }9 B3 @& H8 B7 t/ t (command ; b( o7 e6 T+ `3 c( a
"LIMITS" "0,0" (list x4 y4)' J. [( b$ ]$ \% [# \0 m! R
"PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
$ N. V! Q1 i% }4 I" O( @3 Y& G6 E' A9 L;Khung CHU NHAT Chinh
! n( ~ C! p. T% N3 n y& S! ~ "RECTANG" "500,500" "@28700,20000"
7 w' C: j6 J' ? "RECTANG" "700,700" "@28300,19600"
# P3 _3 y* t1 j;Ten Ban Ve
1 A4 [6 ~2 c5 a "RECTANG" "24500,700" "29000,1950"+ m, U! [+ L8 t+ H E0 w
"RECTANG" "24500,1950" "29000,3200"! l8 p+ \/ S' v7 t0 e6 x
;Khung Ti Le + Ngay Thang Nam
; P5 L* w+ [' i. x "RECTANG" "24500,3200" "26750,4450"% i7 ?- `7 h. Q4 r0 A
"RECTANG" "26750,3200" "29000,4450"
5 A' B& v+ k! V. H;Khung Kiem Tra
7 q: b( z2 t) S" c+ ] "RECTANG" "24500,4450" "29000,6325": j2 H0 m- Z; |4 {
;Khung Thiet Ke
% o9 N% Y# H$ E- D$ O "RECTANG" "24500,6325" "29000,8200"' i0 F. G: j- h" {6 p5 v- O! b9 I
;Khung CHU TRI
. A, S# _; W$ E1 C9 ^$ F "RECTANG" "24500,8200" "29000,10075") T9 I" e: l# e* c/ P
;Khung GIAM DOC
' R9 G) }" J8 |/ r1 y* e: S8 B "RECTANG" "24500,10075" "29000,11950"
& U+ G' n5 ~+ b; Y;Khung HANG MUC
, W2 Z* A: C V2 Q: N5 ` "RECTANG" "24500,11950" "29000,14450"
3 N, F4 |$ t8 Y;Khung CONG TY
; s& n3 T1 ?8 ^/ g- P9 p' k3 c "RECTANG" "24500,14450" "29000,16950"# r5 S' M2 K5 H. m% H
;Khung REPAIRE8 j* h9 C, |! C, O( n
"RECTANG" "24500,16950" "29000,18125"# O$ }/ b9 f8 R
"RECTANG" "24500,18125" "29000,19300". C; c3 H. L# w. F
"RECTANG" "24500,19300" "29000,20300"8 Q: f2 j9 m- ~- R" t' I. y
"RECTANG" "25500,16950" "25500,20300"
0 ~' B- {5 R9 M "ZOOM" "_a" ))
8 ?' ?9 n% d7 e;=====================================================================
7 Q( \% f/ y+ S) X/ R4 b;Ti Le Ban Ve - 1 : 100* m r9 i8 U+ q8 t# ^5 w
(Defun c:zb4 ()
, X, j! s! y: A (setq mv_sc 100);Ti le ban ve" \% ]# ^+ Z; ^& i2 f" E
(setq x4 297)% |4 x; T# c9 R: J( v& Z
(setq y4 210)
8 D0 X; i8 }) i$ K2 h% b (setq x4 (* mv_sc x4) * h3 `9 D6 |" O: c/ [7 T
y4 (* mv_sc y4) )
4 Z- J! @# T0 s: d8 y, S (command 3 d. w$ O, q& ^! Y7 ?8 @1 b$ m
"LIMITS" "0,0" (list x4 y4)
/ U- X( `0 \$ r7 o. [. W: \ "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"# v- o+ g2 k+ L' Q' [' W* u
;Khung CHU NHAT Chinh , Q g. }9 r+ l; ~
"RECTANG" "2000,500" "@27200,20000"
6 o8 p- O3 V& w0 D- D: q "RECTANG" "2200,700" "@26800,19600"' h! N _$ k4 S) l! ?
;Ten Ban Ve
( |) W% ]/ b$ _! C) o "RECTANG" "24500,700" "29000,1950"
2 ?9 r' N- X5 d x. z "RECTANG" "24500,1950" "29000,3200"/ ?: t, `6 H: D/ M
;Khung Ti Le + Ngay Thang Nam
7 X& F1 o' k4 x# b; n" Z "RECTANG" "24500,3200" "26750,4450"
/ r7 Y8 I6 s4 k" K7 S( Y "RECTANG" "26750,3200" "29000,4450") d! q/ f) g r# z1 n' Y0 B
;Khung Kiem Tra* {) O5 @7 P. R C$ C
"RECTANG" "24500,4450" "29000,6325"
/ \; F9 r$ U8 H# e# P% C! ?- O;Khung Thiet Ke) n+ q: u, e# R9 M& O! X' V A
"RECTANG" "24500,6325" "29000,8200"
8 F% s( I6 T9 B! C) a- A;Khung CHU TRI
6 V! I' |% F* O, e! m "RECTANG" "24500,8200" "29000,10075"
: J; j+ I* C0 v) F; C;Khung GIAM DOC
7 R e. s8 S9 y$ I. e: v. m6 E9 A "RECTANG" "24500,10075" "29000,11950"$ n9 L3 U! X) n% t r0 o/ F _2 g
;Khung HANG MUC
- H3 g y8 N5 B) D2 @ "RECTANG" "24500,11950" "29000,14450"6 g, k/ L5 |1 g3 P* k# H
;Khung CONG TY
% P& w4 C! m. v" n "RECTANG" "24500,14450" "29000,16950"
! R# i3 k$ Y; x. z+ y;Khung REPAIRE
6 |; S1 ?3 i' m9 Z "RECTANG" "24500,16950" "29000,18125"
4 w* A: q3 ]( u "RECTANG" "24500,18125" "29000,19300"
, P' \3 E" E: n "RECTANG" "24500,19300" "29000,20300"
; @" }3 F( W7 N2 m* G: v& \# _ "RECTANG" "25500,16950" "25500,20300"- ]6 `, u- j9 N% c
"ZOOM" "_a" )): D2 k) E: U% X7 [$ l, H6 ]
3 D% i3 C* J$ H7 @;;; ============================GHI CHU Khung Ten========================
7 o/ y! }7 [9 V7 \, X6 H3 ~ B9 j;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========
6 X, X) H& E! ~;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 ====================
" {" {' n" ~2 ^& c;;; =======================Thuong Dung Font Romant.vnh===================2 I: j3 u d0 s$ g0 V( z# w
4 X* g$ w' p) e, C, n(defun c:GhiChu (/ pta ptb ptc ptd X Y X1 Y1 rmsz pl1), N5 D+ M. K) y
(setq oer *error* *error* err2)+ K0 q- a7 x! m; |; |
(PROMPT "\nChuTri. ThietKe. KiemTra. TiLe. Ngay. HangMuc. QuyMo. KieuNha. CongTrinh. KyHieu. TenBanVe. Kts. TranNgocThang. ")5 w) g3 z; Z8 H' Z
(SETQ Cpt(GETSTRING "\n(CT). (TK). (KT). (TL). (Ng). (HM). (QM). (KN). (CTr). (KH). (TBV). (Kts). (TnT). ")). O, J) |( u5 G `; c Z! P* U' v
(IF(OR(= Cpt "QM")(= cpt "qm"))(SETQ CPT ' "Hå S¬ ThiÕt KÕ Nhµ D©n Dông quy M« :"))
7 h" |& B6 _+ v$ Z8 b# t' v (IF(OR(= cpt "KN")(= cpt "kn"))(SETQ CPT ' "2 TÇng 1 Tum Thang"))$ n, ^) ?; `) h: N4 e6 `
(IF(OR(= cpt "CT")(= cpt "ct"))(SETQ CPT ' "Chñ Tr× :"))
9 m8 n+ B$ D& ~4 | (IF(OR(= cpt "HM")(= cpt "hm"))(SETQ CPT ' "H¹ng Môc :"))
1 G* A% ]3 Z T! o4 F (IF(OR(= cpt "CTr")(= cpt "ctr"))(SETQ CPT ' "Nhµ ë Gia §×nh - Nhµ LiÒn KÒ"))
, m3 a5 V' ^/ a9 d (IF(OR(= cpt "TK")(= cpt "tk"))(SETQ CPT ' "ThiÕt KÕ :"))
8 `7 _+ w3 b8 A# K" i' a0 w (IF(OR(= cpt "KT")(= cpt "kt"))(SETQ CPT ' "KiÓm Tra :"))
: l4 ~4 q( g: s3 _6 p9 C( m (IF(OR(= cpt "TL")(= cpt "tl"))(SETQ CPT ' "TØ LÖ :"))
0 r0 s6 @+ n! g8 H' ^2 t8 }) q (IF(OR(= cpt "KH")(= cpt "kh"))(SETQ CPT ' "Ký HiÖu :"))2 B% W* R/ H- p/ B& ]
(IF(OR(= cpt "TBV")(= cpt "tbv"))(SETQ CPT ' "Tªn B¶n VÏ :"))
8 D6 H8 N2 X2 d- G (IF(OR(= cpt "Ng")(= cpt "ng"))(SETQ CPT ' "Ngµy :"))" j# J" U% F9 N9 \3 p" o8 C7 g
(IF(OR(= cpt "Kts")(= cpt "kts"))(SETQ CPT ' "Kts. TrÇn Ngäc Th¾ng"))
6 ]; G. G- ]: a& u/ a( U# W. s; Z (IF(OR(= cpt "TnT")(= cpt "tnt"))(SETQ CPT ' "TrÇn Ngäc Th¾ng"))8 Z( w* A5 F, Y9 o8 ~2 i
(setq pta (getpoint4 I/ K0 g7 ]+ |8 \+ F1 U$ l( z8 D
"\nPick first corner. : "))
) A# I1 ]- U m3 @ (setq ptb (getcorner pta8 K- ]. p0 j& P" o: J& G
"\nPick second corner. : "))
% r0 S/ q$ A2 g9 h$ V# @ (setq ptc (list (car ptb)(cadr pta)))+ q z/ w# h$ Z" b# y4 ^* n
(setq ptd (list (car pta)(cadr ptb)))
' k+ W& r$ V) T$ [7 k& X (setq ang (angle pta ptb))6 S/ j6 I% T; [) F
(setq d1 (/(distance pta ptb) 2))+ b' g6 {* W2 T
(setq cp (polar pta (- ang (dtr 0)) d1))& j- L: j2 C' V, d& n1 T
(setq X (distance pta ptc))& i0 x$ Z( U& G5 @9 F S
(setq Y (distance pta ptd))( T2 M( K: G& G
(setq X1 (rtos x 2 1))6 V; |$ C( f( `2 Z
(setq Y1 (rtos y 2 1))8 Q' J; D j$ |! {+ ^- i7 Z
(setq rmsz (strcat "(" X1 " x " Y1 ")"))9 c% Y! W8 y9 H6 J9 o% H# A9 B
(command "TEXT" "c" cp "0" CPT "text" "" rmsz))3 ?$ c, B# C9 m- \2 O
(defun dtr (angg)
/ \+ D- Q8 z* q: b (* pi (/ angg 180.0)))
; N: N* p4 S8 f# a/ _7 E
- q" d: ~+ `8 M;;; ============================GHI CHU Khung Ten========================2 j6 H v1 _' m
;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========7 Q5 S3 L! {9 c" ?
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 ====================
% p% O$ _' [6 M7 Z- M) f- r;;; =======================Thuong Dung Font Romant.vnh===================
) k7 P% j$ v; T. B: d) @7 \$ G
. \0 U& f2 B" \! Z* r! q" S. \(defun c:iit (/ pt str pta ptb ptc ptd X Y X1 Y1 rmsz pl1)% }, v9 n0 ^% l0 x. T) W
(setq oer *error* *error* err2)
1 [/ s n" d+ q- q5 y. d" Z (if (not h_text) (setq h_text 250)) ; Kích thuoc chu mac dinh là 2.5
& ]7 V0 Z/ y3 h+ } Y" h/ L$ N5 R/ R* g5 Q
(setq ht (getreal (strcat "\nNhap chieu cao chu <" (rtos h_text) ">: ")))1 ?! S- X& \- O
$ k" U/ n9 B& s (if ht (setq h_text ht))
I4 M Q+ g, J5 R2 N5 _- _$ ?. |* |9 \
/ J- h" v3 O& B) V6 r n1 g% @% A! ?(setq ang (getreal "\nNhap goc nghieng moi (do) <0>: "))* C. L8 h4 n* f; F# ~2 D$ e: N. U
% J6 [' ~0 l! ~& n. K (if (not ang) (setq ang 0.0))5 K; f: A, p9 |5 S
I, S! k" J$ d4 q; @
( H0 x% E' Y/ v" E1 m6 m% B- D. z* s* @8 k" O6 Q- ]8 a
(setq pta (getpoint
( f* s1 Z, W7 I4 `6 K: g1 p "\nPick first corner. : ")), x3 ~, v8 r9 e3 O% n
(setq pt (getcorner pta; d. l! k4 S D' w9 f
"\nPick second corner. : "))
( ~) [: }, Q/ {/ N0 Q' O+ d! G. H1 [3 N v* K" o0 [* \
- j8 u& Z2 ~. ^' f
(command "TEXT" "j" "M" "4700,2575" "0" (SETQ pt ' "Hå S¬ ThiÕt KÕ Nhµ D©n Dông Quy M«") ) (princ)
' V3 D M4 G0 m! V4 j D# ~: h$ w' \! L( ~5 E- J; x: x. H3 e2 U
(command "TEXT" "j" "M" "4700,1325" "0" (SETQ pt ' "2 TÇng 1 Tum Thang") ) (princ)
" q/ z$ d# B2 s. F, b. A) I- I, T0 g; s7 M% X( } y
(command "TEXT" "j" "M" "10600,2850" "0" (SETQ pt ' "Chñ Tr× :") ) (princ)
3 I% M+ Y$ f0 Y5 Y/ D4 ]$ x2 Z- P t: ?) W( ^2 B) B
(command "TEXT" "j" "M" "10600,1100" "0" (SETQ pt ' "TrÇn Ngäc Th¾ng") ) (princ)7 \' o4 Z2 k! R+ y/ W" q
! u5 ~' m2 } l (command "TEXT" "j" "M" "15250,2575" "0" (SETQ pt ' "H¹ng Môc :") ) (princ)5 ?: ]# b1 [ a
$ T% U& ^, G* X (command "TEXT" "j" "M" "15250,1950" "0" (SETQ pt ' "Nhµ ë Gia §×nh . Nhµ LiÒn KÒ") ) (princ): O( j Q9 d# L1 y7 `2 z: \4 m8 b
) D# B& z) z" o* W (command "TEXT" "j" "M" "15250,1100" "0" (SETQ pt ' "Tel : 09.76.89.12.94") ) (princ)
/ O( a) f( k* a/ c! B* C* c( s4 e1 z/ m* ]$ H, F0 d& Z. t' |
(command "TEXT" "j" "M" "20250,2850" "0" (SETQ pt ' "ThiÕt KÕ :") ) (princ): `8 K8 i9 R! g8 n# y
! o: d% U7 |/ x3 z% |( O) u! i
(command "TEXT" "j" "M" "20250,2300" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)- G! y# B$ A$ v8 {
1 m0 H1 B* R( {/ r8 x
(command "TEXT" "j" "M" "20250,1600" "0" (SETQ pt ' "KiÓm Tra :") ) (princ)
: V; C' ]6 w. A, B
- H: K& {1 z& ]: w (command "TEXT" "j" "M" "20250,1100" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)$ r8 G9 y% h. {2 W
7 X9 U; U4 }7 t* \1 Y (command "TEXT" "j" "M" "23500,2850" "0" (SETQ pt ' "TØ LÖ :") ) (princ)
! Y, S; n+ E/ y: l% C
7 s5 L; j: D3 a ]1 @ (command "TEXT" "j" "M" "23500,2300" "0" (SETQ pt ' "1:75") ) (princ)/ s6 g/ d) [" G2 Q j
6 F Z1 x6 M6 n) ^1 I3 K
(command "TEXT" "j" "M" "23500,1600" "0" (SETQ pt ' "Ngµy :") ) (princ): l" C! L# Q- X" z
$ i% C* g% L8 j) D! J" Z* p: b; A
(command "TEXT" "j" "M" "23500,1100" "0" (SETQ pt ' "2026.07.02") ) (princ) w" L0 T* d: ?6 q8 X. w! O' ?, [4 L* V
4 u1 n6 C) r7 {, T- | (command "TEXT" "j" "M" "26750,2850" "0" (SETQ pt ' "Tªn B¶n VÏ :") ) (princ)
) P0 Q. F- k0 _) W# a \. I' `3 u& T& X$ ^$ i% l# a' e' [4 y! ~
(command "TEXT" "j" "M" "26750,2300" "0" (SETQ pt ' "MÆt B»ng TÇng 1 + 2") ) (princ)& I% H# x. }) Z) G* T$ j
9 I! g4 C0 Z* l, w* H, }- c- n
(command "TEXT" "j" "M" "26750,1600" "0" (SETQ pt ' "Ký HiÖu :") ) (princ)
: q4 K7 ?; J" Q K1 P% E# w0 G9 U( q! ~" n9 C/ n
(command "TEXT" "j" "M" "26750,1100" "0" (SETQ pt ' "KT-01") ) (princ). f: C" }9 h3 t" O
1 |0 X! c6 o: e3 e- X8 ~0 H4 ^
(setq ptc (list (car ptb)(cadr pta)))0 Z' u$ Y C+ U4 L
(setq ptd (list (car pta)(cadr ptb)))
. O. \( o/ B- Q( w# G$ {7 y6 _3 n2 H9 A (setq ang (angle pta ptb))
L& q+ {2 Z& c5 ^$ i* p+ q! }/ ~3 j9 C (setq d1 (/(distance pta ptb) 2))
; ?& M3 i' {2 I6 M. X9 ` (setq cp (polar pta (- ang (dtr 0)) d1))
" V. n9 {; R$ X, B8 k: {+ M) [ (setq X (distance pta ptc))- _$ b( L/ y* {3 v1 S* R
(setq Y (distance pta ptd))4 g7 g1 g! H- r% q2 A& a
(setq X1 (rtos x 2 1))# W8 m! o- o* Y0 j% }3 E5 h8 R
(setq Y1 (rtos y 2 1))
$ f4 }0 E+ M' L% C! P0 Y (setq rmsz (strcat "(" X1 " x " Y1 ")"))
/ ]9 r6 Z& R7 d- J' K# e& x) p (command "TEXT" "c" cp "0" CPT "_text" "" rmsz))
~4 }/ w4 P4 R I (defun dtr (angg)3 c) A! H) U/ w% e8 r
(* pi (/ angg 180.0)))
( o/ v3 X) V% x8 c6 L/ D$ d8 f* ~7 A9 T+ `" b' r% z; d
;;; ============================GHI CHU Khung Ten========================3 \# e/ s. d- Z0 x
;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========; C1 q# d0 R( v
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 ====================9 L3 Y- t. [+ Y% ^. p" f8 ?7 y
;;; =======================Thuong Dung Font Romant.vnh===================
" U3 v4 \8 d# o p4 X, f# ]/ h$ b- ^" _9 L# f2 ^" U
(defun c:ipt (/ pt str pta ptb ptc ptd X Y X1 Y1 rmsz pl1)
n) e9 l0 d9 c2 s (setq oer *error* *error* err2)
1 W7 Z1 Z O: f: j (if (not h_text) (setq h_text 250)) ; Kích thuoc chu mac dinh là 2.5
' h9 @# i! I# q* Y. G' F c* F8 Q
(setq ht (getreal (strcat "\nNhap chieu cao chu <" (rtos h_text) ">: ")))
8 Z" M7 ~+ W" N0 e; W+ G. }& X/ Y1 I! d, Y7 |4 x3 O5 N
(if ht (setq h_text ht))
1 V! g( Z. z+ I4 t8 C& E2 C: R4 k7 V- |* Q7 u
5 u( o9 W" _( C/ S(setq ang (getreal "\nNhap goc nghieng moi (do) <0>: "))* A2 H% b% L6 Q2 S5 `
. {* T* u9 i( \8 W2 J3 @
(if (not ang) (setq ang 0.0))5 y) [( A9 c3 Q3 k2 w
' E+ m; k; z* x* c# K7 ?- n
/ c) b: F( ? S. H- s3 f; z7 Y. n
(setq pta (getpoint7 @. n4 C% w- L& P6 }3 J# N
"\nPick first corner. : "))
, z7 l+ k5 R! @" u2 v$ f" H (setq pt (getcorner pta
1 z+ \7 n" {; Z1 j3 @ "\nPick second corner. : ")); ~6 y8 C8 D' {
3 d' m& c- ~/ L( z" r5 J
! A& ~/ i& ]6 |2 H# H (command "TEXT" "j" "M" "5450,2575" "0" (SETQ pt ' "Hå S¬ ThiÕt KÕ Nhµ D©n Dông Quy M«") ) (princ)+ h0 c+ P' e$ v* k/ {9 g" V1 N
% q! t- r$ M4 e6 ?* h0 V; O (command "TEXT" "j" "M" "5450,1325" "0" (SETQ pt ' "2 TÇng 1 Tum Thang") ) (princ)$ W" S: v! Y! A9 [. b5 F* w# V
, e# B v9 D5 M (command "TEXT" "j" "M" "10600,2850" "0" (SETQ pt ' "Chñ Tr× :") ) (princ)
5 O7 d1 P' |- C# k
0 p8 V& x! J" ^ B6 P, C9 u (command "TEXT" "j" "M" "10600,1100" "0" (SETQ pt ' "TrÇn Ngäc Th¾ng") ) (princ)' G( w; m" X) H1 `
K7 l- D* q; _% b7 W% Q T- \7 |
(command "TEXT" "j" "M" "15250,2575" "0" (SETQ pt ' "H¹ng Môc :") ) (princ)/ ]/ `" T5 l. l P6 w
. q! Z @: r# d/ K4 d (command "TEXT" "j" "M" "15250,1950" "0" (SETQ pt ' "Nhµ ë Gia §×nh . Nhµ LiÒn KÒ") ) (princ)$ i" c. I) }# [- t
0 z! h7 H% ]( {
(command "TEXT" "j" "M" "15250,1100" "0" (SETQ pt ' "Tel : 09.76.89.12.94") ) (princ)( \! a' }( z8 B) f. `2 `7 u: U
' p4 {( e5 ]7 X2 [" F7 h (command "TEXT" "j" "M" "20250,2850" "0" (SETQ pt ' "ThiÕt KÕ :") ) (princ)
3 b. d0 O: m: U5 B* v
* u& Y+ t+ G' e9 y: s- o) N (command "TEXT" "j" "M" "20250,2300" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)# h* Q* x7 H6 `& i3 i. O
) [& @/ H5 v. z! b (command "TEXT" "j" "M" "20250,1600" "0" (SETQ pt ' "KiÓm Tra :") ) (princ)
- J+ t8 Y9 V2 v
b/ C7 V7 y* @# k. x6 o (command "TEXT" "j" "M" "20250,1100" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)6 F$ m0 n, v$ d9 f/ e2 N$ v
* I: W, D4 m& M) ^+ Z (command "TEXT" "j" "M" "23500,2850" "0" (SETQ pt ' "TØ LÖ :") ) (princ)2 g& m% d9 a$ r8 C
6 d" t$ z4 y# ?7 b; x; I% k& A7 C (command "TEXT" "j" "M" "23500,2300" "0" (SETQ pt ' "1:75") ) (princ)0 A% r6 R: j! l
1 E3 ~9 `. x+ v: K3 B# h( p6 H (command "TEXT" "j" "M" "23500,1600" "0" (SETQ pt ' "Ngµy :") ) (princ), W# S4 V+ } w- C6 y" P4 L
8 k& k) j/ [) G6 f# T. f
(command "TEXT" "j" "M" "23500,1100" "0" (SETQ pt ' "2026.07.02") ) (princ)- ^' \9 g: n$ @4 Z, e! F9 z
9 d$ n0 h! \" ? E* L! `7 C
(command "TEXT" "j" "M" "26750,2850" "0" (SETQ pt ' "Tªn B¶n VÏ :") ) (princ)( ?3 P. l$ |( _
) {- p8 J/ D5 B/ Q (command "TEXT" "j" "M" "26750,2300" "0" (SETQ pt ' "MÆt B»ng TÇng 1 + 2") ) (princ)( V& T5 J4 o5 T1 h
5 A" `2 R; m4 z: p6 f& G
(command "TEXT" "j" "M" "26750,1600" "0" (SETQ pt ' "Ký HiÖu :") ) (princ)8 L$ ^$ K0 Q. M1 b( H8 r$ Z
' I$ Y( L% v) L (command "TEXT" "j" "M" "26750,1100" "0" (SETQ pt ' "KT-01") ) (princ)% U( v9 r4 m- W1 h
9 F7 G, R2 q' j# {1 H (setq ptc (list (car ptb)(cadr pta)))3 F! l- J2 P7 i/ g, b. n* o( B
(setq ptd (list (car pta)(cadr ptb)))
5 \- _ D$ ]0 a3 L" c (setq ang (angle pta ptb))
8 b c' t. l v (setq d1 (/(distance pta ptb) 2)) n `# V' \- L8 q$ K
(setq cp (polar pta (- ang (dtr 0)) d1))
; f: X$ W8 y7 N7 A (setq X (distance pta ptc))# G: K1 X. j5 C
(setq Y (distance pta ptd))
$ ~7 z* p6 e9 k. j- z% l (setq X1 (rtos x 2 1))
+ e6 `/ g5 f: i1 `+ `, W (setq Y1 (rtos y 2 1))
6 Z U: S, V2 H+ `3 D (setq rmsz (strcat "(" X1 " x " Y1 ")"))) N: w! P$ E8 u/ i& p! J. v
(command "TEXT" "c" cp "0" CPT "_text" "" rmsz))
# `3 [& V$ @0 Y2 w (defun dtr (angg)7 i) `" v6 h- i8 u U$ I
(* pi (/ angg 180.0))). c, x# c% l3 T! O0 {$ J4 @) o; B
' p& A& g* i, H
;;; ============================GHI CHU Khung Ten========================
5 j; b' O# S9 C% b; D;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========
/ L8 g q4 h" W8 |, u! O;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 ====================
) m+ e6 n: f' v- L3 l;;; =======================Thuong Dung Font Romant.vnh===================
% Q) x& c( o2 E; l4 E+ Y2 [: h- p) |) n
9 Z4 X( q r& t( s* N(defun c:iza (/ pt str pta ptb ptc ptd X Y X1 Y1 rmsz pl1)2 ]: L, Z' c7 T3 `: m9 w1 W
(setq oer *error* *error* err2)2 ?- S# E" T! ^8 `
(if (not h_text) (setq h_text 250)) ; Kích thuoc chu mac dinh là 2.5) i" Q. K% c. _+ n
' f: L. T. @* c4 ]' M (setq ht (getreal (strcat "\nNhap chieu cao chu <" (rtos h_text) ">: ")))$ p" o7 r3 U8 ? R+ [$ J7 ~
: M- W1 c$ a# ]0 ~5 M
(if ht (setq h_text ht))% @+ F, v, ~) Q# }
) d- H9 p$ J! R7 b9 a
/ E7 f. J, e7 G% s4 T(setq ang (getreal "\nNhap goc nghieng moi (do) <0>: "))
. e- R& @# U1 t2 u3 n% b5 {9 @, }5 P& ~/ M" d
(if (not ang) (setq ang 0.0))
# P$ e( X& }1 I2 ^3 J5 b" l
, N5 u1 C& @* M( _" M
* |/ _# n) _& E8 x s3 T
! r4 c4 U% W* X/ |! H3 \/ M) F (setq pta (getpoint+ N# [" L; a# \: }. A) D: x$ y
"\nPick first corner. : "))
" P! V" |) }/ M0 Y! Z (setq pt (getcorner pta
) ^, y! L0 v$ C+ s) [ "\nPick second corner. : "))
$ I7 ]' z% j5 K$ N8 [% j `" w* w& P! S$ x6 D5 q
# ~ N& Y6 F1 ]& D2 G
! O) U) A4 {/ ]' z4 K
(command "TEXT" "j" "M" "25000,19800" "0" (SETQ pt ' "STT") ) (princ)
, k4 v/ S* d3 c3 X3 W4 `6 a
) a. r+ m+ D& O# A/ i- s (command "TEXT" "j" "M" "25000,18712.5" "0" (SETQ pt ' "1") ) (princ)
: B- e$ m0 C6 i$ J$ P" [
+ X7 x* e* T1 L0 E% D (command "TEXT" "j" "M" "25000,17537.5" "0" (SETQ pt ' "2") ) (princ)9 i& T7 P4 B/ ~8 q* E% c* y8 k
+ ^" a. V! i. I" N
; D' ^% \/ b; k. \: M' \1 p' { (command "TEXT" "j" "M" "27250,19800" "0" (SETQ pt ' "Ngµy Söa Hå S¬") ) (princ)
; @1 }0 F8 X9 [% ?7 ~$ z" e9 \% a5 S9 T1 j% Z# F
(command "TEXT" "j" "M" "27250,18712.5" "0" (SETQ pt ' "15.05.1997") ) (princ)2 h& F) Q8 T" @3 _
% x3 X& r- N: g (command "TEXT" "j" "M" "27250,17537.5" "0" (SETQ pt ' "04.07.2026") ) (princ)
& r5 }( {9 W7 t* Z4 d1 S6 r
2 [/ R2 ?6 ?# k
2 ]" ~! G2 F$ n9 D! r (command "TEXT" "j" "M" "26750,16600" "0" (SETQ pt ' "C¤NG TY - Corporation") ) (princ)- j! K, E1 W1 s+ B; U3 Z2 h
( R* W9 g9 |+ o& @
(command "TEXT" "j" "M" "26750,16016" "0" (SETQ pt ' "ZENNI.S.Z.T.K") ) (princ)
7 ]6 |! c( @; U2 y3 m
( t' |2 G9 z6 N- R (command "TEXT" "j" "M" "26750,15433" "0" (SETQ pt ' "§Þa ChØ C¤NG TY") ) (princ)8 y6 U5 w# d3 k3 j+ U( I1 i
5 N8 b! @3 n( _
(command "TEXT" "j" "M" "26750,14850" "0" (SETQ pt ' "§Þa ChØ : 00.00.00.00.00") ) (princ)3 f" K* \0 r$ f+ `: \, z$ j
e% n# R( X) q. J, u) o$ g: v* p. q( i
(command "TEXT" "j" "M" "26750,14100" "0" (SETQ pt ' "H¹ng Môc : Part Project") ) (princ)
5 ^9 Q& O- |% } v4 q; ?& M2 _) z. F2 g& P- l% W8 w
(command "TEXT" "j" "M" "26750,13516" "0" (SETQ pt ' "Nhµ ë Gia §×nh") ) (princ)' i; I; J. A6 c5 M
/ g2 V+ G+ o0 o3 e/ o! i (command "TEXT" "j" "M" "26750,12933" "0" (SETQ pt ' "Nhµ LiÒn KÒ") ) (princ)
. j# {* A: _: l8 e& e- q( @2 o3 w9 k, _/ i( @5 _$ k# B0 b" S9 u
(command "TEXT" "j" "M" "26750,12350" "0" (SETQ pt ' "Tel : 00.00.00.00.00") ) (princ)
- G" {8 K1 S8 V2 P8 M/ J$ f% T2 c: V- B4 o
6 x9 b, D3 Q" d1 F: l6 ?
(command "TEXT" "j" "M" "26750,11600" "0" (SETQ pt ' "Gi¸m §èc : Director") ) (princ)
^) W a& V' }, L2 g4 X; {- m" k, C& Y# a
(command "TEXT" "j" "M" "26750,10475" "0" (SETQ pt ' "ZENNI.S.Z.T.K") ) (princ)( r! \9 R, ^3 q
+ L5 A0 O6 `) h# T- @ (command "TEXT" "j" "M" "26750,9725" "0" (SETQ pt ' "Chñ Tr× : Main Project") ) (princ)
, F' v) u8 [8 U m( G v# o2 j, t$ p y
(command "TEXT" "j" "M" "26750,8600" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)
+ L8 o: z6 K; {
7 H3 e5 ^- j4 `9 g: Y9 F: K (command "TEXT" "j" "M" "26750,7850" "0" (SETQ pt ' "ThiÕt KÕ Vµ VÏ : Design") ) (princ)4 m8 N$ s5 m( V- g- m( k- r: J
0 r) D7 [ E# i" X! C( ~ (command "TEXT" "j" "M" "26750,6725" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)
$ i/ X' c. m t p( p& M
7 i* z# C* O) x4 M8 r (command "TEXT" "j" "M" "26750,5975" "0" (SETQ pt ' "KiÓm Tra : Checking") ) (princ)
8 R& B: S/ _# j- U1 E5 i0 t- q) i1 X
(command "TEXT" "j" "M" "26750,4850" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)0 s4 E- Z/ m) X7 H% _4 A- ~
" i+ v' |/ _8 y0 O% Q2 ~. D/ c$ n& A" v! i, ?# H& A
, x5 ^! z( z( N' c3 c (command "TEXT" "j" "M" "25625,4100" "0" (SETQ pt ' "TØ LÖ-Khæ") ) (princ)
. z: i5 b7 I% O0 m
7 Y; M( d: k7 ^& R2 C9 d9 u (command "TEXT" "j" "M" "25625,3600" "0" (SETQ pt ' "1:75 - A4") ) (princ)
7 |0 C. Y" Y! w3 }& c$ m
. S7 c0 g, s( o. ], g( M (command "TEXT" "j" "M" "27875,4100" "0" (SETQ pt ' "Ngµy Xong :") ) (princ)7 P, P3 i" x# t6 X. W1 w: B
& D4 V' Y: S4 _9 J
(command "TEXT" "j" "M" "27875,3600" "0" (SETQ pt ' "2026.07.04") ) (princ)
- ?5 N* z1 ~' q: z' L5 t( O5 I/ o8 m, N5 @
(command "TEXT" "j" "M" "26750,2850" "0" (SETQ pt ' "Tªn B¶n VÏ :") ) (princ)
0 j$ x+ @( ~+ ~, c% G4 a8 o3 m- p
(command "TEXT" "j" "M" "26750,2300" "0" (SETQ pt ' "MÆt B»ng TÇng 1 + 2") ) (princ)& J* E- d' r3 E2 r! l* i
3 ~+ T$ a7 t4 V5 o
(command "TEXT" "j" "M" "26750,1600" "0" (SETQ pt ' "Ký HiÖu :") ) (princ)
2 }3 L* a1 [1 j2 M v7 w- ` g% q& q; \' G% c" o% f
(command "TEXT" "j" "M" "26750,1100" "0" (SETQ pt ' "KT-01") ) (princ)
" F! m! I y: V6 }1 q2 t" \2 R) _ @8 _- U5 ]
(setq ptc (list (car ptb)(cadr pta))). c' V. x6 v0 b" ~7 d6 b9 F
(setq ptd (list (car pta)(cadr ptb))). Y$ I" j: D& h6 \" f
(setq ang (angle pta ptb))
8 |7 S( q+ }9 Z( `5 P; E3 O+ s (setq d1 (/(distance pta ptb) 2))# N( k3 }! \/ o
(setq cp (polar pta (- ang (dtr 0)) d1))* O3 o! ^) p3 s0 z V i+ T
(setq X (distance pta ptc))
! @, g1 O! y# U9 W9 S: l% ^ (setq Y (distance pta ptd))
7 w2 _5 K7 T: o4 k% C (setq X1 (rtos x 2 1))
8 E. b. `: `! n7 ^7 T5 f (setq Y1 (rtos y 2 1))
0 s5 n% a8 P, P8 R8 R! Q8 U (setq rmsz (strcat "(" X1 " x " Y1 ")"))9 K$ s. ?" J/ N9 V
(command "TEXT" "c" cp "0" CPT "_text" "" rmsz))& _; [" u" h6 p) @3 D) k+ c# K
(defun dtr (angg)6 W# m% X1 z4 E
(* pi (/ angg 180.0))). C6 D$ e( ^$ K( n
' |( Q L4 R8 ?; l$ B) l8 ~
;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========
9 B1 j4 ~0 d, r3 y3 X;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 ====================& O" U. m) A' L6 Z7 B5 O! x
;;; =======================Thuong Dung Font Romant.vnh===================" M. `1 ~. G: d2 _
" Y7 K1 X1 s' d2 [(defun c:pta4 (/ pt str pta ptb ptc ptd X Y X1 Y1 rmsz pl1)* Z" R- s& q1 r3 }5 y S
(setq oer *error* *error* err2)
- p0 u$ I6 Y: w. Z (if (not h_text) (setq h_text 250)) ; Kích thuoc chu mac dinh là 2.58 i8 Y! c# E- @. y
! U. Z/ N3 _2 S. w6 O7 U (setq ht (getreal (strcat "\nNhap chieu cao chu <" (rtos h_text) ">: ")))
g# e+ E7 ], n( D/ R$ g) }
+ \& v. d7 ~' p3 A# U/ z+ } (if ht (setq h_text ht)): B Q% ^1 f+ K6 o F4 b
. ?2 F1 F$ f6 J% u
7 ~) L( f, w6 U(setq ang (getreal "\nNhap goc nghieng moi (do) <0>: "))
+ R* h; J4 [: j; o( T1 Z: @7 W7 E9 r% T7 z2 Z3 e. T1 A
(if (not ang) (setq ang 0.0))8 a$ m! t V8 m6 D* ?! l6 h
, D0 m6 ~2 b5 k6 E7 b) D
! o% V1 S' r n$ e6 k
* ]/ e2 Q# S/ j, c
(setq pta (getpoint
+ p7 g, l* D' }" E* W "\nPick first corner. : ")), R# p4 {* Y" k( z' d
(setq pt (getcorner pta4 E8 H3 p# s+ n! s M: A
"\nPick second corner. : "))
) @4 ^+ _3 o8 s+ y! c6 ]( D/ k9 M$ K5 L
2 C- Q5 f# R6 s& ~" c
(command "POINT" "4700,2575" ) (princ)" L1 n* T7 \3 j/ P# a1 h- w
( O3 B& P+ N+ b$ q1 y& c& c9 L# c
(command "POINT" "4700,1325" ) (princ)
) Z5 K; b, a: [0 d# E9 o. \ i2 W! O* \% [+ ~# W) t0 e
(command "POINT" "10600,2850" ) (princ)
1 V) A+ }0 i" x, r0 B( P& o
3 o @. p f* H" n/ S, O1 I (command "POINT" "10600,1100" ) (princ)
Z3 U8 I1 R% H0 p/ d9 i' O; D$ n5 U- R) {, y
(command "POINT" "15250,2575" ) (princ)
. C _7 |+ ?) i. X0 `& ?: E7 f9 {" a9 [$ ]4 |7 N/ _4 ?$ D4 J
(command "POINT" "15250,1950" ) (princ)
% q# Y: f& ~& R9 r# y* O+ j
7 ^$ S& H4 y. h: p# R (command "POINT" "15250,1100" ) (princ)9 }! c5 C- r5 K# L
9 a! @6 T+ |: Z$ M* D (command "POINT" "20250,2850" ) (princ)+ {- w: x6 ?0 I& D: n
: P8 i; C& ~: j N5 O5 t/ P3 X (command "POINT" "20250,2300" ) (princ) [6 e& W W! {8 @) F
8 E9 [4 z7 w9 g. j9 `) J
(command "POINT" "20250,1600" ) (princ)
. c9 j% Z. b: N2 b
& }0 o9 \& Q& E+ j. j8 Y: i3 r) k' `) n (command "POINT" "20250,1100" ) (princ)
9 l) t- I4 O \' C0 {: J6 b% Q) y' B
(command "POINT" "23500,2850" ) (princ)
6 O% }' j9 X8 X& g2 [7 x `5 D) n: B( {" s8 \& A9 {/ e( N
(command "POINT" "23500,2300" ) (princ)- Y% O T" R1 \/ X
$ V; K @) r: ?8 `1 Y3 p/ J" F+ e
(command "POINT" "23500,1600" ) (princ)
( K/ o7 P9 L; l% o4 @& R( ^' }) V! F; r; S- W. O* f
(command "POINT" "23500,1100" ) (princ)! i" \' u1 c( R
2 T8 a8 B# \; N; } `
(command "POINT" "26750,2850" ) (princ)
9 ]! }/ B: X! {+ ~
! ]/ o+ o/ t' m( o& ~ (command "POINT" "26750,2300" ) (princ)
8 d! x- R8 T& b- _ a8 E9 L8 M9 Z5 r$ V
(command "POINT" "26750,1600" ) (princ)* k8 U# R3 F0 c( _1 Q0 b8 P
3 ?/ o9 ], w& t- P3 O3 W (command "POINT" "26750,1100" ) (princ)
( o2 q1 Z8 S) e4 H7 e B
1 {, h0 M }1 s+ i5 G (setq ptc (list (car ptb)(cadr pta)))) r" i2 [+ N: S" b5 X; n# q/ W% a& n
(setq ptd (list (car pta)(cadr ptb)))5 K: Y4 b/ u5 I5 n% S
(setq ang (angle pta ptb))/ L% `) F% H% g+ O1 |5 ^
(setq d1 (/(distance pta ptb) 2))
* I* y& R5 `9 p4 ` (setq cp (polar pta (- ang (dtr 0)) d1))% }2 T5 a: D2 \# D
(setq X (distance pta ptc))
% {) H. Y$ e" M) ~* Z; S& k (setq Y (distance pta ptd))
A& _4 h y$ @7 f) x* V8 g' u (setq X1 (rtos x 2 1))7 P, O/ v7 V3 P2 o9 M
(setq Y1 (rtos y 2 1))
& h4 ]3 k4 R0 H9 Y7 n8 v# M# B* W3 J/ j (setq rmsz (strcat "(" X1 " x " Y1 ")")); ^# {+ O; L3 m
(command "TEXT" "c" cp "0" CPT "_text" "" rmsz))' f) J! N; o9 I$ @5 F
(defun dtr (angg)# E" K& A5 D5 m ]5 L6 Y
(* pi (/ angg 180.0)))
' T4 \' J% Y4 I- y. Y. q4 z M
0 B3 D2 r: M9 E! B( A7 h;=====================================================================8 p; {' [8 m7 m+ `
;====================DAT KHO GIAY BAN VE - KIEU 1=====================! Z' p) A( d& P# D: H& K; @& Z. }
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================3 m% Y/ J5 X! A; D8 ^8 s% D& K. c+ @6 `( F
8 d/ Z, O) o" L. B3 n
(Defun c:a6 ()
) a9 T- N- K# D (setq mv_sc 100);Ti le ban ve
7 h8 O& b. _; j6 X" P% u; C (setq x4 74.25)
" z1 A/ r& T4 U F (setq y4 52.5)
& d/ ]6 K8 m: i1 f2 } F (setq x4 (* mv_sc x4)
& A7 s6 v# q) ^5 h$ E1 | y4 (* mv_sc y4) )( j0 }! M% ?3 z' R$ V# i
(command ! l7 S0 t% B4 S
"LIMITS" "0,0" (list x4 y4)
9 q' j9 m4 ~" S "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"( q$ J$ a& F2 R
"RECTANG" "125,125" "@7175,5000"
! z, c- @: i- D "RECTANG" "175,175" "@7075,4900"1 _( b8 s5 [7 E" ?: u! \- z; r& I
"ZOOM" "_a" ))
# h* q0 _9 D: n* v;=====================================================================
4 T1 x7 E6 G8 l2 S' z7 J" L% K+ g" G) f(Defun c:a5 () x3 r0 ]7 O& @) e* c
(setq mv_sc 100);Ti le ban ve2 x" K, ^/ N$ z
(setq x4 147.5)
7 U3 y# \/ q4 { ?" Q3 ~ (setq y4 104)( V/ T, f, y* W" J7 z A. g5 X, d; C
(setq x4 (* mv_sc x4) ; }: ~; k% v4 J# R" {9 A' V; P
y4 (* mv_sc y4) )
% g4 L. J) u8 P2 E9 z1 ? (command : i* u' r& H7 o7 m/ V0 x) b' V
"LIMITS" "0,0" (list x4 y4)
1 @$ ^8 E5 k4 M* R "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
& e, D5 S# K0 S& \* n) W5 I "RECTANG" "250,250" "@14350,10000"' N. [4 k1 F: x$ W! M7 b" U# C
"RECTANG" "350,350" "@14150,9800"
8 \1 T) O& a8 H7 ]5 F "ZOOM" "_a" ))
. y/ P& |; Q' E;=====================================================================
1 _& f- A, n% M# {2 W% y(Defun c:a4 ()
, Y3 n# v7 J7 ?# M- a (setq mv_sc 100);Ti le ban ve
* p- o! `, A3 S- M9 O (setq x4 297)
+ }+ t& F, y0 V (setq y4 210)
! d. {3 A" C0 e: J' S# A7 h7 ~ (setq x4 (* mv_sc x4)
. p! d# P$ l2 E; | y4 (* mv_sc y4) )" K4 v& g& U5 e; p% j8 w3 O
(command 9 T% J f/ J7 A4 [* `- m0 l) Z
"LIMITS" "0,0" (list x4 y4)- j9 D' ]+ |3 t0 M
"PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"4 e# b7 \/ ~; S8 {" Y$ M7 s z
"RECTANG" "500,500" "@28700,20000"+ p' |# n( \! g! i( P7 H
"RECTANG" "700,700" "@28300,19600"
. T5 t# c* e I& q A3 Y "ZOOM" "_a" ))
O2 P& b0 S' c) u8 T$ R) F: Z. {;=====================================================================
8 R5 V/ i; [: ~0 N! t# C; D0 Z3 M8 ](Defun c:a3 ()! P+ Z3 N b" J6 W* y5 V
(setq mv_sc 100)5 g6 w- S/ n5 ?+ @
(setq x3 420)
5 n! U" P1 u" E3 K0 b C( _ (setq y3 297)5 H) O2 [4 U- v h" A
(setq x3 (* mv_sc x3) " V% b5 d; `- N7 J q' k
y3 (* mv_sc y3) )
1 M8 R; _2 f7 {3 m (command + a/ m3 s _: ?! ~2 P
"LIMITS" "0,0" (list x3 y3)9 v0 P- v X k* q) v! _
"PLINE" "0,0" (list 0 y3) (list x3 y3) (list x3 0) "0,0" "_C"2 [- c) o3 Q1 } |0 Q
"RECTANG" "707.14285714,707.14285714" "@40590,28285.71428571"
6 Y3 M |: o+ E9 I "RECTANG" "990,990" "@40024.28571429,27720"0 z/ p& l7 A" W1 G
"ZOOM" "_a" ))- L/ Z3 K' j7 b: V; P- B" d1 g4 z+ q0 h
;=====================================================================
, }( P) i! l* h9 ~$ F* A, C% ~5 m2 _(Defun c:a2 ()! z$ f0 C4 L6 o9 }3 `. [
(setq mv_sc 100): r# I" F9 R$ ]$ I8 o. p4 b
(setq x2 594)
& M$ j9 u2 e' d9 _/ Z) n j1 q (setq y2 420)& _: W/ z' V" }1 R" V$ V' ]
(setq x2 (* mv_sc x2) - H5 b- k) ]. e% n
y2 (* mv_sc y2) )# w/ p! U; G5 g7 T! n5 E% g
(command
3 M/ R+ b/ \4 D# c$ Z6 u' T- K" p "LIMITS" "0,0" (list x2 y2)
$ \9 y1 @' R: i6 z W "PLINE" "0,0" (list 0 y2) (list x2 y2) (list x2 0) "0,0" "_C"
4 J! G! b2 V* g. e) }( Y) q "RECTANG" "1000,1000" "@57400,40000"
, z. F2 S6 F L: ^. W4 }: L "RECTANG" "1400,1400" "@56600,39200"
' S8 y4 g+ W& o# S3 ]& T8 y1 `$ k "ZOOM" "_a" ))# A" v8 e# D4 x8 G- ?
;=====================================================================
: m8 @: f5 `. w0 K$ E9 Z(Defun c:a1 ()) c2 U! C% w/ [; q" x9 D( I6 w
(setq mv_sc 100)
* O1 \ t7 Z6 h! u7 W$ s (setq x1 840)
' F, t% k3 x$ [4 v1 B (setq y1 594)
- n# D% g" x$ U (setq x1 (* mv_sc x1)
_$ o7 J+ S. Z% @/ `8 F' a y1 (* mv_sc y1) )) x2 K7 g8 d7 y5 s
(command
# J) L) T: k( x7 W) N "LIMITS" "0,0" (list x1 y1)2 Q6 V/ j/ z3 G0 n
"PLINE" "0,0" (list 0 y1) (list x1 y1) (list x1 0) "0,0" "_C"# p% O. ?$ E! q( Q- p- S9 M
"RECTANG" "1414.28571429,1414.28571429" "@81180,56571.42857143"
& P! q" |# ?% b6 R% ^ "RECTANG" "1980,1980" "@80048.57142857,55440"4 q# ~4 g7 Y/ Q) }2 D
"ZOOM" "_a" )): H) g8 x0 k6 _$ J
;=====================================================================5 t2 @8 B0 e' \. Q3 \' K
(Defun c:a0 ()% L, |3 n* s! E! i* [8 |
(setq mv_sc 100)7 C: i2 w( w' o; ?7 K
(setq x0 1188)% j) R/ B; s5 b5 O. d) |5 R3 C
(setq y0 840)
3 |1 _( R: o% l% K1 | (setq x0 (* mv_sc x0) 7 z8 g1 S) E$ v0 X/ c% x# c
y0 (* mv_sc y0) )
$ I% l! H. x5 \0 Q# N (command
) ^, k4 g, x- x) S! n "LIMITS" "0,0" (list x0 y0)" f l/ G% z4 r- D9 ?# H! ]
"PLINE" "0,0" (list 0 y0) (list x0 y0) (list x0 0) "0,0" "_C"
/ t) Z* F7 Y* U7 k* G "RECTANG" "2000,2000" "@114800,80000"0 c8 H" }% `2 p
"RECTANG" "2800,2800" "@113200,78400"
1 [/ P+ u% L# I) t6 W6 }% | "ZOOM" "_a" ))
. @) g3 B1 d$ `* s2 j/ e% ^1 M: z! F" x& v, f0 A& F6 H5 `/ K
;=====================================================================/ r# ?, Z0 g H- f
;====================DAT KHO GIAY BAN VE - KIEU 2=====================! u8 {# Y0 z( W* V ]7 R) o
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
: n3 t% J' s5 `- c" d+ p9 ?# o d8 K, A+ c
(Defun c:6a (); _! i& `4 @4 X2 l
(setq mv_sc 100);Ti le ban ve' J; s) z& w& [7 e
(setq x4 74.25)2 a7 j. S, H6 b/ V
(setq y4 52.5)
% ?' _9 i$ K; o6 d1 d (setq x4 (* mv_sc x4)
8 D4 p! F0 j) p! W1 a7 h. D+ P y4 (* mv_sc y4) )3 Q$ J- n7 Y, b% s
(command + H/ c, d/ q* T
"LIMITS" "0,0" (list x4 y4)
0 ?% q. b d7 U, X "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"5 P0 A( j! ]" Z1 ~( J* |
"RECTANG" "505,125" "@6800,5000"
6 R+ {0 {* I8 G4 W$ s( U# B "RECTANG" "555,175" "@6700,4900"
2 J8 y+ K6 S; k" ^ "ZOOM" "_a" ))8 |9 p/ _. `( Q0 ?' Y) ^. W4 ~
;=====================================================================
y% d6 k" |# V(Defun c:5a ()5 S6 r& [1 K4 l6 K) z! ^9 k
(setq mv_sc 100);Ti le ban ve3 |- K2 L4 x6 M+ H
(setq x4 148.5)
" V7 @- n& k; k (setq y4 105)
& m" c6 _3 _ r" Y' g; O (setq x4 (* mv_sc x4) 3 V* Z/ u: J/ k. d$ L# u
y4 (* mv_sc y4) )5 p# m. Q. c9 L7 A
(command
: U) ?( z& L; j6 P+ P& Q1 P "LIMITS" "0,0" (list x4 y4)
( c2 v2 r7 r! h1 l' |3 s- p "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"! r6 s- w# D, A6 G% X* M
"RECTANG" "1000,250" "@13600,10000"2 V5 ~2 s8 N+ [
"RECTANG" "1100,350" "@13400,9800"
3 N: @. x+ p* U4 s "ZOOM" "_a" ))" s) B h Y. d1 p# k
;=====================================================================, N0 ]5 ^( L& C/ J; ^
(Defun c:4a ()5 e% a! w- m! |9 s
(setq mv_sc 100);Ti le ban ve
n" o: s, S' j+ l1 a (setq x4 297), L* c0 j7 q* V( @
(setq y4 210)
, K. E* a c% f5 _- T (setq x4 (* mv_sc x4)
6 m* v/ s( i6 W, u( f3 Y7 ?: j y4 (* mv_sc y4) )$ N2 _# |& S. e. k
(command + s2 |& L+ c5 n8 I: ^# `
"LIMITS" "0,0" (list x4 y4)) E* g8 X8 ~3 l p' S( x$ q; o# v
"PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
" Y5 [2 C; S1 E, d7 n "RECTANG" "2000,500" "@27200,20000"
, ^" x5 t4 s1 e/ Z "RECTANG" "2200,700" "@26800,19600"
# X" d4 Q4 N3 H: ?$ q "ZOOM" "_a" ))9 G( K1 n: D& v: [. _) G9 v
;=====================================================================
5 ?9 Y, a, {# Z0 b" d(Defun c:3a ()
& B! l6 B& Z5 H- J (setq mv_sc 100)3 R4 S' T8 l+ U
(setq x3 420.0428571429)
* Y0 K3 i/ `/ V a7 U: r6 t (setq y3 297)
) B i0 D0 B& F0 r7 J (setq x3 (* mv_sc x3)
2 W7 U* _( Z5 _* C y3 (* mv_sc y3) )
7 O! ^* H5 @4 A% c- P" m6 A+ e (command " y1 r7 q7 Z. v6 }7 ?% a
"LIMITS" "0,0" (list x3 y3)+ U9 _6 ]3 y+ v+ d) D; `: y
"PLINE" "0,0" (list 0 y3) (list x3 y3) (list x3 0) "0,0" "_C"/ m. p6 \( r7 f: H
"RECTANG" "2828.57142857,707.14285714" "@38468.57142857,28285.71428571"" Z) s( R* R, n8 |% _2 `
"RECTANG" "3111.42857142,989.99999999" "@37902.85714287,27720.00000001"! Y4 r7 Y+ H% j* g7 o
"ZOOM" "_a" ))( b3 }+ d( x4 g' i
;=====================================================================
) u* J; ^4 c" C" s# b5 v(Defun c:2a ()+ O- b7 B' R/ f/ }* h/ x
(setq mv_sc 100)& D( a b" Y' g* u5 z
(setq x2 594)
8 _* N, F; S6 q" }1 T9 H1 N (setq y2 420)+ |9 X, f6 b9 D) V, I3 y4 Y
(setq x2 (* mv_sc x2)
0 h9 U" f* P' P( J) e! p) n y2 (* mv_sc y2) )* g2 f, g5 d8 B
(command
4 e9 K" k! a) k; A% _% E3 { "LIMITS" "0,0" (list x2 y2)
' `, T: V! I6 G; s "PLINE" "0,0" (list 0 y2) (list x2 y2) (list x2 0) "0,0" "_C"4 Z+ Y7 B- v# n7 e' C& y
"RECTANG" "4000,1000" "@54400,40000"6 v- v6 ^; u) L# q( d
"RECTANG" "4400,1400" "@53600,39200"
0 F; a% b- r( a- N "ZOOM" "_a" ))
3 f' g' O! j; i, h- {;=====================================================================
. N& x& R7 _2 T5 q2 k! [/ S' z(Defun c:1a ()
& c: E# Q R8 j/ D (setq mv_sc 100)( y0 ]0 d) O: D, o; \
(setq x1 840.0857142857)* [) i# ?% L" Y A
(setq y1 594)( I+ \) e; [4 ~( S* b8 s2 E
(setq x1 (* mv_sc x1)
( C* I* B" X! K$ V {) w y1 (* mv_sc y1) )
. g* O3 `$ y/ s0 E5 l' T$ Y (command # v! U8 ]& A8 e
"LIMITS" "0,0" (list x1 y1)& I- G" X) b& x7 D
"PLINE" "0,0" (list 0 y1) (list x1 y1) (list x1 0) "0,0" "_C"
" J w" z8 I. ?9 B9 l' g- U3 K "RECTANG" "5657.14285714,1414.28571429" "@76937.14285714,56571.428571436"
6 j5 T) O) |# E7 W/ E: p "RECTANG" "6222.85714286,1980.00000001" "@75805.71428570,55440"
4 o/ s7 { p+ X4 S. V! ? "ZOOM" "_a" ))4 D& L% q8 R* O1 q9 d3 T" @8 n
;=====================================================================1 x, l8 {& c$ u$ \) l4 s# M5 W+ a
(Defun c:0a ()
. w0 h! R, c+ ^: c2 Q (setq mv_sc 100)
% c: H [% q$ W( v& K0 h (setq x0 1188): g. S# Y# F: ?" g
(setq y0 840)
* R# q' X$ _7 X1 i! i0 L (setq x0 (* mv_sc x0)
2 r9 j, i: H: ^7 ` y0 (* mv_sc y0) )6 `9 J* N7 Y$ ^8 \" e* x
(command
" u1 H% v' G/ e) ?* }: ?2 l' | "LIMITS" "0,0" (list x0 y0)2 u& W8 x8 L* q& m$ W, H8 p
"PLINE" "0,0" (list 0 y0) (list x0 y0) (list x0 0) "0,0" "_C"$ z8 |8 R0 F$ [5 A
"RECTANG" "8000,2000" "@108800,80000"
$ { f; D, Z! \9 G4 L0 v- {4 v, ^0 p "RECTANG" "8800,2800" "@107200,78400"
8 O! G: Z, [6 h! t, _" m" d3 Z2 y "ZOOM" "_a" ))- T/ _) {( E" ?% l& S& c
. }2 ?- t4 ~) f, k8 f$ K;=====================================================================
; h7 n6 z" ~$ m4 d) H! |- n; N ];==================DAT KhoGiay Theo KHO GIAY BAN VE===================, ^3 T) W% x/ g8 r7 j/ v
;=========================== Nguoi Khac ==============================
; M, D* V( ]" R% n' h(defun c:khogiay (/ oldlst a b c d e f g h kho TL)3 [4 h' X8 r) c9 i6 E9 u5 I
(command "undo" "be")
0 i# l2 p" _" `; f(setq oldlst (mapcar 'getvar (list "CMDECHO" "OSMODE" "cecolor")))2 y6 m& S. w- N8 r
(setvar "CMDECHO" 0)
% Y" Z/ h+ y8 V3 g6 ?; P (setq a (getpoint "\n chon diem chen :"))' U; D+ N7 `" Q/ z4 }& @7 R
(if (not TL) (setq TL 1.00))* V* k: ]) y8 \
(setq TL1 (getDIST (strcat "\nScale <" (rtos TL 2 2) ">:")))
0 G$ c' A7 c9 Y+ {1 x(if TL1 (setq TL TL1))& S4 p* M! e- _4 ]5 j$ n
(setvar "osmode" 0)
8 S; E P$ W& m) z(if (not (tblsearch "layer" "Defpoints")) (Command "layer" "N" "Defpoints" ""))! [9 Z9 a* B* H& A5 ~
(initget "0 1 2 3 4")
0 v' F9 ^$ p: c9 S) b (setq kho (getkword "\Kho A0 _ Kho A1 _ Kho A2 _ Kho A3 _ Kho A4 [0/1/2/3/4]? <0>:"))
4 C6 n# c2 O" E) O1 M (if (= kho "0")% j$ P3 V4 e) q! v
(progn
% r8 o( d# U& C( z, E9 {; E4 c/ [ (setq b (polar a 0 (* TL 1189)))
+ h3 g9 @ ~7 ]2 Z' {/ e! V (setq c (polar b (/ pi 2) (* TL 841))); f4 X* x& o; s$ v
(setq d (polar a (/ pi 2) (* TL 841)))! L/ j# X9 @& ]8 x( L/ L
(setq e (polar a (/ pi 4) (* TL (sqrt (* 2 12 12))))): Y; n" L0 v- h! V; Z" k$ [' T
(setq f (polar e 0 (- (* TL 1189) (* TL 24))))
$ v8 {8 A1 l h) m6 Z (setq g (polar f (/ pi 2) (- (* TL 841) (* TL 24))))
1 q g+ X" M$ {% V- V( T0 |; I (setq h (polar e (/ pi 2) (- (* TL 841) (* TL 24))))
' r& ?& E% J$ L/ } (command "Pline" e f g h "c")
d1 L/ ~$ O. G! J; j: \(command "change" "last" "" "properties" "layer" "0" "")9 {# |2 | u% ^7 |
(setvar "cecolor" "4")
1 w. T, M- q5 p$ @2 K$ [( e/ S1 X (command "Pline" a b c d "c")% ]& Y. J" z; _# h
(command "change" "last" "" "properties" "layer" "defpoints" "")))
5 l7 ~9 ~( e+ \# E+ [. G) i (if (= kho "1")
4 @* ?9 u0 @- }* t2 f$ R( }8 o4 E (progn
% a8 \( T( Z" u/ [: l5 E, ~# B* g (setq b (polar a 0 (* TL 841)))9 D9 P2 z/ c3 r6 L' @
(setq c (polar b (/ pi 2) (* TL 594)))& i' h7 l* X& s9 I2 q+ Z: N' v
(setq d (polar a (/ pi 2) (* TL 594)))
4 O a! ? H/ S+ n0 x( N6 m, b (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 12 12)))))
" y! Y9 \" J% Q! A4 Z (setq f (polar e 0 (- (* TL 841) (* TL 24))))' p }1 [" x( g: w5 e
(setq g (polar f (/ pi 2) (- (* TL 594) (* TL 24)))) C3 {! [: U# k: [% C; a C/ i& {/ L& [
(setq h (polar e (/ pi 2) (- (* TL 594) (* TL 24))))
6 [" Q' Q' @0 w k* A3 [ (command "Pline" e f g h "c")
1 W, R2 X( s* Q F( q, m(command "change" "last" "" "properties" "layer" "0" "")
g6 Z$ V3 a6 E4 z* K0 u4 |(setvar "cecolor" "4")
; R3 c- x- R+ k: z9 z (command "Pline" a b c d "c")$ `7 j# L% C- {' P' T( b3 O" [
(command "change" "last" "" "properties" "layer" "defpoints" "")))
6 J; u b1 ?3 i% o/ W (if (= kho "2")$ h2 F. s" b' r' u7 s
(progn
8 N$ T' _; u! X6 } (setq b (polar a 0 (* TL 594)))
+ p! x1 l& t: `( V (setq c (polar b (/ pi 2) (* TL 420)))+ T0 ^! w1 K8 E8 x% s
(setq d (polar a (/ pi 2) (* TL 420)))6 p" ^7 M! L4 }" z: E
(setq e (polar a (/ pi 4) (* TL (sqrt (* 2 100)))))
, ]+ J$ b0 {; c' u4 }( ?& [( J (setq f (polar e 0 (- (* TL 594) (* TL 20))))
5 {$ x8 y/ n& Y (setq g (polar f (/ pi 2) (- (* TL 420) (* TL 20))))5 m: E5 c, l, G. S
(setq h (polar e (/ pi 2) (- (* TL 420) (* TL 20))))$ H+ x, t% R- t/ x
(command "Pline" e f g h "c") ( o! |! H. A0 {
(command "change" "last" "" "properties" "layer" "0" "")" A |' A8 u$ J9 {# T
(setvar "cecolor" "4")9 |* S5 |& n# m. I: c
(command "Pline" a b c d "c")) X+ x2 E* \& ~9 `$ p/ H+ z0 o2 S
(command "change" "last" "" "properties" "layer" "defpoints" "")))
* `& C" S1 ~- Z9 M' }6 g* n3 p (if (= kho "3")
y. ?& J U# k) j5 |& U, }) _, q (progn
3 s. ^. T1 _* c1 E; J- l( Y (setq b (polar a 0 (* tl 420)))
, z4 U* A: X T (setq c (polar b (/ pi 2) (* TL 297)))3 h4 S( n# J5 ]9 L
(setq d (polar a (/ pi 2) (* TL 297)))
- |' b2 F4 V' T3 J5 Z; {" G (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 100)))))" r! o0 ?. ]$ g: Q# [+ R
(setq f (polar e 0 (- (* TL 420) (* TL 20))))" L: z2 e( x' |& w2 s
(setq g (polar f (/ pi 2) (- (* TL 297) (* TL 20))))
2 B/ G& D; y' p (setq h (polar e (/ pi 2) (- (* TL 297) (* TL 20))))1 E9 n3 B, q* T. D6 ~7 H
(command "Pline" e f g h "c")
( q5 K$ T! H; W (command "change" "last" "" "properties" "layer" "0" "")/ D9 ~- d( i$ Z9 T% s
(setvar "cecolor" "4"); z1 s" H. r6 z5 J G2 q
(command "Pline" a b c d "c")
! ^- ^7 y: ^# g# Q$ |: L/ \ (command "change" "last" "" "properties" "layer" "defpoints" "")))
5 f% d0 G& m8 J+ e' n$ V (if (= kho "4")
' U* ^& O5 l8 N' p8 U. f (progn% I- o2 L. h( f; [" c
(setq b (polar a 0 (* TL 297)))
$ L+ z/ b! u* m; q! D (setq c (polar b (/ pi 2) (* TL 210)))% Y, C- y- z+ T1 n0 U6 X" {0 ?5 D, N
(setq d (polar a (/ pi 2) (* TL 210)))
. h3 |6 D* { j6 t (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 81)))))
- S: l w: Y( X! U/ f$ G (setq f (polar e 0 (- (* TL 297) (* TL 18))))
4 Y6 v. @7 M( u$ X6 M+ v6 k8 t& m (setq g (polar f (/ pi 2) (- (* TL 210) (* TL 18)))) [1 ^! s* e' I1 _
(setq h (polar e (/ pi 2) (- (* TL 210) (* TL 18))))( M2 p2 U3 W* Y7 q4 D. Z0 n* v7 z. m
(command "Pline" e f g h "c")
* z$ d3 |& v8 A" `. R(command "change" "last" "" "properties" "layer" "0" "")1 s3 \! Y- s- K, K
(setvar "cecolor" "4")
- O) y# Y* E$ P (command "Pline" a b c d "c")
& p# ?* c; I2 p: @5 x Y9 B( `, {& G(command "change" "last" "" "properties" "layer" "defpoints" "")))
6 t5 D! y' ~9 t" t. O2 r- m(mapcar 'setvar (list "CMDECHO" "OSMODE" "cecolor") oldlst)5 q8 Y: k( E, x# z5 x) k
(command "undo" "e")& r1 ]2 B* Q1 C y
(princ))
4 E7 r5 e$ y! y& u3 A0 R% S/ z6 c;=====================================================================( Q$ G6 x- q2 ~1 d3 X
;==================DAT KhoGiay Theo KHO GIAY BAN VE===================9 ]8 `& W; y" d% w
;=====================================================================) I- |! I! x2 S. Z0 ]& o
0 Q1 w" `" k& l# g2 [ t7 V
;=====================================================================
% [5 M! ^. ^& j( l, E' K) C;===================DAT Ti Le Theo KHO GIAY BAN VE====================7 p; |9 h J+ l' c- f
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
, p/ X+ C _+ M7 `7 j; p+ @. P; Y4 L+ b* H
(DEFUN C:SA6 () (setvar "DIMSCALE" 411.11111)( h! s/ h) ?" c: j( c# Y
(COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.1" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "5" ""
: b$ X, v3 n' z+ y" }' E "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.3" ""
$ h k7 R; C0 d) A "M" "MANH" "C" "9" "" "Lw" "0.1" ""3 m: a3 _7 z: B0 O4 ^
"M" "TEXT" "C" "7" "" "Lw" "0.12" """ `" K0 c3 V/ t- V1 o( A
"M" "DIM" "C" "1" "" "Lw" "0.12" ""
' W) [& E0 w8 V/ |3 \' x "M" "THAY" "C" "7" "" "Lw" "0.2" ""1 _8 g* Q7 T r9 S7 d
"M" "NOITHAT" "C" "60" "" "Lw" "0.12" ""4 ?8 O. ^; s0 }/ ?
"M" "HATCH" "C" "5" "" "Lw" "0.1" ""
# I E+ ]! Z" U2 C* X "M" "COT" "C" "1" "" "Lw" "0.3" ""3 Q% ^1 }9 Q; u' ]# j; y
"M" "Defpoints" "C" "7" """ a% k( q: x, g- j; l+ R. X
"M" "0" "C" "3" "" "Lw" "0.12" ""; c1 G+ f3 L7 N5 ?$ d- Q1 Q! ~
"M" "CUA" "C" "6" "" "Lw" "0.12" ""# v% M$ H; ]1 t0 i* G. u
"M" "CUA MATDUNG" "C" "6" "" "Lw" "0.12" ""
/ K" C u. d% Z/ h L "M" "DAY-DIEN" "C" "3" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"
# O1 Q# o1 L( T/ J+ D "M" "NETDAM" "C" "4" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"
N: _, m- u$ |) y4 ^# d "M" "NETTHAY" "C" "255" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"# E, w$ ?$ a/ S9 w* J
"M" "NETMANH" "C" "43" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"
" G$ J' |( l2 q/ K7 R' s "M" "ThietBiDIEN" "C" "2" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"
! s7 U. o P+ Q. }5 t "M" "TEXTTXT" "C" "7" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"
) Q. @6 x1 r" c "M" "TEXTVN" "C" "60" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1") ~9 M) j4 s# f
"M" "TEXTVNi" "C" "60" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"
# r) x, F* i3 b5 R "M" "THEPDAI" "C" "3" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
) T0 R8 |8 W6 s) w8 @: J( z "M" "THEPDOC" "C" "2" "" "Lw" "1.20" "" "LT" "Continuous" "" "" "LTSCALE" "1"
7 i" l: A6 o; `( ]/ p* t "M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"
4 b4 b( w& G, A$ E( `' Y) W "M" "4-WateR_IN" "C" "4" "" "Lw" "0.4" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2"$ ]& Q Q- @5 c( ~8 U6 ^5 l
"M" "4-WateR_OUT" "C" "4" "" "Lw" "0.4" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2") v, } U" e# s; E1 {) _5 R) \' R
"M" "KHUNGTEN" "C" "4" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"5 h u3 } w& g8 N
"M" "TIMTUONG" "C" "5" "" "Lw" "0.1" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "3" ""))(princ) j4 f$ n6 x9 P/ U5 c) a% _
(DEFUN C:SA5 () (setvar "DIMSCALE" 611.11111)% z8 t% u" P" M/ \ m
(COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.12" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "10" ""5 g# t a' k5 d$ n, n
"-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.4" ""9 A; h& p. [9 f/ Z
"M" "MANH" "C" "9" "" "Lw" "0.12" ""3 [% G% \1 T4 H: l
"M" "TEXT" "C" "7" "" "Lw" "0.12" ""& `6 q" ]' r# [5 t0 @
"M" "DIM" "C" "1" "" "Lw" "0.2" ""2 ~* v' O' y0 e6 ^: _8 r
"M" "THAY" "C" "7" "" "Lw" "0.2" ""
7 C8 h8 o, v& n" E. Y N: z "M" "NOITHAT" "C" "60" "" "Lw" "0.2" ""
* S- q/ V- c$ O1 E4 l; z4 { "M" "HATCH" "C" "5" "" "Lw" "0.1" "", j O% \) x: P1 @5 C7 Q
"M" "COT" "C" "1" "" "Lw" "0.4" ""' s- k4 l5 s+ v) b# w6 ^4 B, {
"M" "Defpoints" "C" "7" ""
2 r* e# H7 `9 L5 m! a$ B9 T, L, h "M" "0" "C" "3" "" "Lw" "0.2" "", O5 s( @! f* t+ ?
"M" "CUA" "C" "6" "" "Lw" "0.12" ""/ H1 U& R" O. b2 B! }$ i
"M" "CUA MATDUNG" "C" "6" "" "Lw" "0.12" "" V2 v* G' b! N1 c8 ^8 ?
"M" "DAY-DIEN" "C" "3" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"
1 M5 r2 ^/ _& r8 k* v( C2 C7 ^ "M" "NETDAM" "C" "4" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"
# n5 O/ i3 E% M# N, b! A r1 v- X "M" "NETTHAY" "C" "255" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"
3 I6 |( v5 L# Q: l) J5 R3 b0 k$ K "M" "NETMANH" "C" "43" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"
) m% o* H9 q% `5 l7 m, V7 r4 m' | "M" "ThietBiDIEN" "C" "2" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1" `( M5 _0 a7 P- T
"M" "TEXTTXT" "C" "7" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"+ e9 e( E6 s) K3 Q/ X/ r& m
"M" "TEXTVN" "C" "60" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"6 I, U1 c+ T" G% W9 |% A+ A
"M" "TEXTVNi" "C" "60" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"
' c3 ]7 e) |2 X/ \ "M" "THEPDAI" "C" "3" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"3 q: u3 b$ `; O, f9 i2 Q
"M" "THEPDOC" "C" "2" "" "Lw" "1.40" "" "LT" "Continuous" "" "" "LTSCALE" "1"$ b: L) f# G3 h, B6 W# Y& |
"M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"9 s& u3 T a7 V. k6 j
"M" "4-WateR_IN" "C" "4" "" "Lw" "0.5" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2"3 _' ^4 ?7 G* G6 L9 g- D
"M" "4-WateR_OUT" "C" "4" "" "Lw" "0.5" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2"
( \0 K6 d% y8 C1 F, } "M" "KHUNGTEN" "C" "4" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"5 z% |) t% \, n; _8 z7 P9 z, B; j
"M" "TIMTUONG" "C" "5" "" "Lw" "0.15" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "5" ""))(princ)0 j$ s, z+ z) V! `
(DEFUN C:SA4 () (setvar "DIMSCALE" 1411.1111)
6 m5 ^; J6 ~% a6 z# [' X1 ?) I- q% P (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.2" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "20" ""
5 ?) q6 f0 C [, X/ M: B* W4 i1 ` "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.6" ""
3 z! F; M' }5 U; y7 H. U "M" "MANH" "C" "9" "" "Lw" "0.2" ""
5 c6 ~& ?7 N* w W& N% M+ U" g% i "M" "TEXT" "C" "7" "" "Lw" "0.2" "", L2 `# `. s! R( G
"M" "DIM" "C" "1" "" "Lw" "0.25" ""
+ [' s& U9 l. ^3 Z" x: i "M" "THAY" "C" "7" "" "Lw" "0.35" ""
7 d! |$ {- E- s* X; L' H "M" "NOITHAT" "C" "60" "" "Lw" "0.25" ""/ d7 W( t. ]# U1 k2 N$ _
"M" "HATCH" "C" "5" "" "Lw" "0.15" ""
9 a( l9 o0 T9 V3 r# E7 C- { "M" "COT" "C" "1" "" "Lw" "0.6" "") _9 Y' F( g! i$ k% f& H0 N
"M" "Defpoints" "C" "7" ""3 V, |9 d% Y# U, _' K6 {
"M" "0" "C" "3" "" "Lw" "0.25" ""8 N4 L+ g: l! U- ], O) `3 |
"M" "CUA" "C" "6" "" "Lw" "0.25" ""
# g) S" n6 |5 J* E. J/ \1 k "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.25" ""
) e( t6 I: ~5 B% v2 m, B7 j4 _ "M" "DAY-DIEN" "C" "3" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"% a1 U( ]2 S" r$ @6 V/ T
"M" "NETDAM" "C" "4" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"
: ?: N' X/ G# X3 j# |, @ "M" "NETTHAY" "C" "255" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
) }$ c, E* ~- W- ?9 j; K "M" "NETMANH" "C" "43" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"! l1 O1 [7 r3 R- z: \$ I2 f
"M" "ThietBiDIEN" "C" "2" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"5 y4 f$ T+ q: O
"M" "TEXTTXT" "C" "7" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
( b1 t, E9 B% L8 Z# _3 r "M" "TEXTVN" "C" "60" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"; w6 b: Q; c& ~+ y4 ]
"M" "TEXTVNi" "C" "60" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
) @! { b1 s4 i7 I "M" "THEPDAI" "C" "3" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
! v+ m& r" T0 O0 a "M" "THEPDOC" "C" "2" "" "Lw" "1.58" "" "LT" "Continuous" "" "" "LTSCALE" "1"0 O' p6 n0 l& F/ i( u: L0 ]+ D) I
"M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
s: s4 a q- I% v) g; i! R2 a: o "M" "4-WateR_IN" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2"* e% x( b+ S7 E; k% t
"M" "4-WateR_OUT" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2") N6 J# n% b1 {# _, x
"M" "KHUNGTEN" "C" "4" "" "Lw" "1.00" "" "LT" "Continuous" "" "" "LTSCALE" "1"; Z0 f. R+ H/ N& [6 q
"M" "TIMTUONG" "C" "5" "" "Lw" "0.2" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "10" ""))(princ)+ _8 Z* ]# u, O' u
9 y- B- U6 q, P- b; t! T. I
(DEFUN C:SA3 () (setvar "DIMSCALE" 1611.1111)
% B; I& V& E9 `. r y: ` (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.35" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "30" ""0 ~+ u) s0 x/ a0 j. R
"-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.7" ""0 x) Y, q: {8 e' x- t
"M" "MANH" "C" "9" "" "Lw" "0.25" ""
/ A b3 X! s% ?2 S# Z- ~ O" v, { "M" "TEXT" "C" "7" "" "Lw" "0.2" ""3 N( S6 o+ y- t4 j
"M" "DIM" "C" "1" "" "Lw" "0.35" ""7 g& R! ~% z. n4 u/ }+ Z3 V
"M" "THAY" "C" "7" "" "Lw" "0.4" ""$ T- i$ W/ d; N o d& k
"M" "NOITHAT" "C" "60" "" "Lw" "0.25" ""
2 Q) d4 s* C# \ "M" "HATCH" "C" "5" "" "Lw" "0.2" ""
* D, [) ?: |# |- P+ H "M" "COT" "C" "1" "" "Lw" "0.7" ""' O E- ~% o- t5 l8 c
"M" "Defpoints" "C" "7" ""- R! p- `) q9 I! q; V( }
"M" "0" "C" "3" "" "Lw" "0.25" ""0 {+ ?% N# p) \! j3 D# y, \9 ]
"M" "CUA" "C" "6" "" "Lw" "0.35" ""
: m/ e3 M/ a4 u* o9 k: S9 | "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.3" ""
& n( I. ]# t# ~% O" z5 w/ i "M" "DAY-DIEN" "C" "3" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"8 w" g+ V1 i4 J; N( f
"M" "NETDAM" "C" "4" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"1 w( a: n! \; o8 ?3 q/ Z
"M" "NETTHAY" "C" "255" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"" ]1 L3 b% R+ c# b& b6 V+ J" t: c
"M" "NETMANH" "C" "43" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"3 l2 {/ J6 z1 c
"M" "ThietBiDIEN" "C" "2" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
6 o& \6 X1 e! f) u6 ` "M" "TEXTTXT" "C" "7" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
; u/ K$ z8 C) W! ~ "M" "TEXTVN" "C" "60" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"1 @* r2 n9 ]* ]
"M" "TEXTVNi" "C" "60" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
$ j( H) u3 I$ k$ c "M" "THEPDAI" "C" "3" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
+ H8 A- H# f3 T+ O& V "M" "THEPDOC" "C" "2" "" "Lw" "1.58" "" "LT" "Continuous" "" "" "LTSCALE" "1") y3 z F B: w, K
"M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1": R6 f! h7 f# ~& d" Q! N. J" O7 I
"M" "4-WateR_IN" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2" P( V; C, {5 G) d" c2 _) Y
"M" "4-WateR_OUT" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2"+ W/ @2 h8 m; N3 V8 h$ U6 o
"M" "KHUNGTEN" "C" "4" "" "Lw" "1.00" "" "LT" "Continuous" "" "" "LTSCALE" "1"+ T/ P; x2 m5 W8 v7 i
"M" "TIMTUONG" "C" "5" "" "Lw" "0.25" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "20" ""))(princ); R$ U! w7 f5 Z7 T
5 G8 J" W/ u8 }+ W6 P9 Q1 Z2 N! o
(DEFUN C:SA2 () (setvar "DIMSCALE" 4111.1111)
; |- O$ i0 I$ Y" X (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.35" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "45" ""
% F7 k# V; Y4 @( G' e+ G "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.7" ""
" Q( N7 H# V0 ^. c5 q5 p* T "M" "MANH" "C" "9" "" "Lw" "0.25" ""3 W5 {2 \# t `
"M" "TEXT" "C" "7" "" "Lw" "0.25" ""
0 }6 y- g- e* E$ e- u" f "M" "DIM" "C" "1" "" "Lw" "0.3" ""
' D% k A- q+ P2 t j "M" "THAY" "C" "7" "" "Lw" "0.4" ""* D" G l' X: C6 {: v6 V$ F
"M" "NOITHAT" "C" "60" "" "Lw" "0.3" ""! S8 O4 {) V' w' G2 g& o9 }1 q
"M" "HATCH" "C" "5" "" "Lw" "0.2" "": c8 k& X1 b3 D5 z$ [
"M" "COT" "C" "1" "" "Lw" "0.7" "": j! a! L* S' p! \8 O' C- E' {. r
"M" "Defpoints" "C" "7" ""
8 ]1 C1 v* }6 c "M" "0" "C" "3" "" "Lw" "0.35" ""
% Q! t! t- [' ?& M5 z "M" "CUA" "C" "6" "" "Lw" "0.35" ""
0 N7 e9 B4 Z1 p4 X6 t "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.3" ""
" W. a4 Q3 k) P( S6 { "M" "DAY-DIEN" "C" "3" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"# O+ P- ~" |: n) D& Z" U. g
"M" "NETDAM" "C" "4" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"6 d! J0 h2 F- u: k% |( {9 r
"M" "NETTHAY" "C" "255" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"7 S2 @9 C9 \- j) v! Y W
"M" "NETMANH" "C" "43" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"
- S, W+ l* [# C8 i "M" "ThietBiDIEN" "C" "2" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"8 ~7 x% L# ^+ ^ J
"M" "TEXTTXT" "C" "7" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"
$ U) z$ Z- U) P+ D "M" "TEXTVN" "C" "60" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"
) X( t( c& X2 T# E8 ^ "M" "TEXTVNi" "C" "60" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"2 n2 n: G$ a3 W" O0 S* J# Z
"M" "THEPDAI" "C" "3" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"
2 o$ ~5 R9 y& k; b "M" "THEPDOC" "C" "2" "" "Lw" "1.58" "" "LT" "Continuous" "" "" "LTSCALE" "1"
5 V1 T1 K8 _1 Q/ O "M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"
c {/ s3 I9 @( f" _3 \8 \ "M" "4-WateR_IN" "C" "4" "" "Lw" "0.7" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2"
2 H8 A2 r9 p1 L% W; ^) D, R* S "M" "4-WateR_OUT" "C" "4" "" "Lw" "0.7" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2"
- F0 S2 M& l5 x% O6 Y "M" "KHUNGTEN" "C" "4" "" "Lw" "1.20" "" "LT" "Continuous" "" "" "LTSCALE" "1"
0 n- K5 F8 W Q5 n g "M" "TIMTUONG" "C" "5" "" "Lw" "0.25" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "30" ""))(princ)
# z8 a( ]9 k- X" d! k. s1 u9 o
0 _: E6 U7 c! }% }) q+ ](DEFUN C:SA1 () (setvar "DIMSCALE" 4411.1111)$ ^% U- z0 b0 c. h# B) L
(COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.4" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "60" ""
8 u( @: ?7 b' H$ }9 L "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.85" ""
2 H- X2 [$ a/ h- z+ f) i. s [ "M" "MANH" "C" "9" "" "Lw" "0.35" ""# ?2 m) p- ]2 U9 O
"M" "TEXT" "C" "7" "" "Lw" "0.5" ""
/ y5 y3 x( K+ N# p- A; |2 X/ R "M" "DIM" "C" "1" "" "Lw" "0.35" ""! k9 O& g* X/ K% s( m
"M" "THAY" "C" "7" "" "Lw" "0.4" ""
1 Q- Z( {( ]! `8 M6 [. K "M" "NOITHAT" "C" "60" "" "Lw" "0.35" "" d. Q) T* M( I: X1 P5 A
"M" "HATCH" "C" "5" "" "Lw" "0.25" ""
- k+ S8 s: O- M: @ "M" "COT" "C" "1" "" "Lw" "0.85" ""3 R+ i+ `' n u0 `+ ~8 x; w
"M" "Defpoints" "C" "7" ""/ G; H9 J) M/ Y. L
"M" "0" "C" "3" "" "Lw" "0.35" ""+ C# d5 q% e4 e) a- B4 q1 |4 x
"M" "CUA" "C" "6" "" "Lw" "0.4" ""
1 s+ S! {5 u$ k: j: |+ X5 @! w "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.35" ""
2 c6 y* ^- W$ `, a. h "M" "DAY-DIEN" "C" "3" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
8 |# ~! \& I Z "M" "NETDAM" "C" "4" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"2 [: u6 X: Z' [% z) u$ |/ ]
"M" "NETTHAY" "C" "255" "" "Lw" "0.9" "" "LT" "Continuous" "" "" "LTSCALE" "1"
0 t N! q: g, k' B "M" "NETMANH" "C" "43" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
8 z7 g: I0 P) _3 }& A "M" "ThietBiDIEN" "C" "2" "" "Lw" "1.0" "" "LT" "Continuous" "" "" "LTSCALE" "1"
7 V. F/ B0 X$ J. N+ G "M" "TEXTTXT" "C" "7" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"; z& W/ }( r/ l, V+ e) a: p
"M" "TEXTVN" "C" "60" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1". S0 b$ d/ \$ G0 I4 q
"M" "TEXTVNi" "C" "4" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
1 u# i; h1 i" `5 q6 w: G "M" "THEPDAI" "C" "3" "" "Lw" "0.9" "" "LT" "Continuous" "" "" "LTSCALE" "1"
( K1 _- I& g" q7 I0 T1 h "M" "THEPDOC" "C" "2" "" "Lw" "2.00" "" "LT" "Continuous" "" "" "LTSCALE" "1"
2 F) P+ F/ r5 G, d5 N) s& x+ g. p "M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
2 j# U% O7 z& E7 L; H5 P5 A$ z1 e "M" "4-WateR_IN" "C" "4" "" "Lw" "0.8" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2": D& s. i1 b9 z" {
"M" "4-WateR_OUT" "C" "4" "" "Lw" "0.8" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2"
A6 v$ w, H% n6 p "M" "KHUNGTEN" "C" "4" "" "Lw" "1.40" "" "LT" "Continuous" "" "" "LTSCALE" "1"" m4 B! u( _$ f% j0 C
"M" "TIMTUONG" "C" "5" "" "Lw" "0.3" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "40" ""))(princ)9 w6 M% W! l( c) J6 d$ `
" l: `. R, w! Y& J: ]4 f# s& O3 `
(DEFUN C:SA0 () (setvar "DIMSCALE" 6111.1111)+ u& w1 u- _; z& k: A; o
(COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.5" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "85" ""2 u. u8 U" _6 a2 I6 m
"-LAYER" "M" "TUONG" "C" "4" "" "Lw" "1" ""
& g: U5 w6 l9 X- x4 ^ "M" "MANH" "C" "9" "" "Lw" "0.35" ""
: A6 l' A. L9 }% l) v' E "M" "TEXT" "C" "7" "" "Lw" "0.5" ""7 h2 H$ }' k# o3 s, z! V
"M" "DIM" "C" "1" "" "Lw" "0.35" ""; f1 W5 B7 s# \' C
"M" "THAY" "C" "7" "" "Lw" "0.5" ""& t2 l7 d7 Y# A. h
"M" "NOITHAT" "C" "60" "" "Lw" "0.4" ""
8 I# b6 y) v5 r% ~ "M" "HATCH" "C" "5" "" "Lw" "0.35" ""! G K% U0 G4 O
"M" "COT" "C" "1" "" "Lw" "0.1" ""' L; z& [6 y, R* R" {
"M" "Defpoints" "C" "7" ""
9 }3 ]) }$ f2 [5 \6 o$ Q "M" "0" "C" "3" "" "Lw" "0.5" ""
6 v7 N& A* ` |3 H( v i3 H( D* G "M" "CUA" "C" "6" "" "Lw" "0.5" ""
- G1 b( F6 E# m9 k "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.4" ""2 u& M- {! V6 o- ^, |+ H
"M" "DAY-DIEN" "C" "3" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1" I6 c' N' X! O' A8 R) `
"M" "NETDAM" "C" "4" "" "Lw" "1" "" "LT" "Continuous" "" "" "LTSCALE" "1"
) K4 m- o" V" Z5 z( ? "M" "NETTHAY" "C" "255" "" "Lw" "1.00" "" "LT" "Continuous" "" "" "LTSCALE" "1", n9 n9 q' _/ I1 \2 V/ J
"M" "NETMANH" "C" "43" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"
. m; C7 }! G* w0 i "M" "ThietBiDIEN" "C" "2" "" "Lw" "1.20" "" "LT" "Continuous" "" "" "LTSCALE" "1" l# C! D. K( U8 e! e
"M" "TEXTTXT" "C" "7" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"
; u/ |7 J g: {6 x; } "M" "TEXTVN" "C" "60" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"
2 D6 S' q; U5 p" n P "M" "TEXTVNi" "C" "60" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"
; [. Q8 d7 d" o "M" "THEPDAI" "C" "3" "" "Lw" "1.00" "" "LT" "Continuous" "" "" "LTSCALE" "1"
: O4 c. ~) d- e+ g' Y% n* w. q "M" "THEPDOC" "C" "2" "" "Lw" "2.11" "" "LT" "Continuous" "" "" "LTSCALE" "1"
' f6 {! S3 F/ v* G0 v) L "M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1" S7 M5 X9 c* E$ [ @4 ^
"M" "4-WateR_IN" "C" "4" "" "Lw" "0.9" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2"
3 v1 D% K; Q4 K: M, P$ ] "M" "4-WateR_OUT" "C" "4" "" "Lw" "0.9" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2"
5 n, C& |, | \# s- @0 o "M" "KHUNGTEN" "C" "4" "" "Lw" "1.40" "" "LT" "Continuous" "" "" "LTSCALE" "1"
( q# [4 M \2 t& Z$ N- w2 ]" \ "M" "TIMTUONG" "C" "5" "" "Lw" "0.35" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "55" ""))(princ)
0 j- O! S9 p9 w D% j(DEFUN C:O () (COMMAND "OFFSET")); [6 w F- q) I4 r
(defun c:s1 () (command "surftab1")) G% N6 B8 p% g0 f
(defun c:s2 () (command "surftab2"))
. a$ |, y( q6 V* R5 p, N/ C# ^(defun c:ep () (command "explode"))9 E W( B0 D; j: j
(DEFUN C S () (COMMAND "AUDIT" "Y" "purge" "all" "*" "N" "QSAVE"))
+ Z% Z4 X- W8 `: P+ N# ^(DEFUN C V () (COMMAND "QSAVE"))
& a8 v5 r& m# W( o! e(DEFUN C:S () (COMMAND "STRETCH" "C"))
3 f+ ? ~; e9 N9 o1 C) q9 v& X0 |: ]2 x ~
;************************** CAT DIM *************************** s. W- Y! r! O7 u0 H [
! d( W; D! S) ^+ P7 K; E(DEFUN C C (/ CMD SS LTH DEM PT DS KDL N70 GOCX GOCY PT13 PT14 PTI PT13I PT14I6 h! V5 z- |2 `) ]5 E% A( ^4 e
PT13N PT14N O13 O14 N13 N14 OSM OLDERR PT10 PT11)2 X0 q& r9 S0 s5 D8 H5 u- |1 N
(SETQ CMD (GETVAR "CMDECHO"))
- `: F- N n. w1 n/ V(SETQ OSM (GETVAR "OSMODE"))
7 u% C- m2 N$ E6 {& G9 ~(SETQ OLDERR *error*
/ L0 o5 X8 L1 S# s' {1 `7 f0 v *error* myerror)5 D! W& Z% h& Q7 ]
(PRINC "Please select dimension object!")
/ B# u) v" d) v4 @(SETQ SS (SSGET))$ G; p; Q5 C+ b
(SETVAR "CMDECHO" 0)6 ?0 d ^" o0 P; Z# z& a5 V
(SETQ PT (GETPOINT "Point to trim or extend:")): {: C8 J& H8 q; F! S7 K* \
(SETQ PT (TRANS PT 1 0))
5 h6 G. e8 K2 V(COMMAND "UCS" "W")
; J6 I* P$ _0 l5 w(SETQ LTH (SSLENGTH SS))
2 C! Z0 J0 v% x8 H(SETQ DEM 0)2 L1 \4 J0 `7 x V! Z/ X
(WHILE (< DEM LTH): K# S# T. {( g$ Z! b, V0 W8 h
(PROGN. x" Q$ O* ~+ {. j [, e
(SETQ DS (ENTGET (SSNAME SS DEM)))2 q3 @$ _2 y% ?- c
(SETQ KDL (CDR (ASSOC 0 DS)))4 m8 Q6 w: N# Q% @8 P
(IF (= "DIMENSION" KDL)
5 D0 G0 q0 k8 B+ L8 e. l (PROGN: Y! Z5 S9 V! l5 J4 u
(SETQ PT10 (CDR (ASSOC 10 DS)))
|: I Y3 @9 x5 R3 t7 D (SETQ PT11 (CDR (ASSOC 11 DS))); H0 x& c! M. s: h+ W. }5 f% ]
(SETQ PT13 (CDR (ASSOC 13 DS)))* `9 T$ B$ W" @5 Q
(SETQ PT14 (CDR (ASSOC 14 DS)))
' ] y" _, Y* Y& f; A3 v- c) Z (SETQ N70 (CDR (ASSOC 70 DS)))
% u) c) v8 u- G% }0 u. F (IF (OR (= N70 32) (= N70 33) (= N70 160) (= N70 161))
$ k& Q" R4 P: N) j6 n; _1 j F1 |7 ] (PROGN
% S# u% P/ d; j4 i- K9 l# z (SETQ GOCY (ANGLE PT10 PT14))! \, [5 P$ Q" @/ E" G( q6 y
(SETQ GOCX (+ GOCY (/ PI 2)))/ a4 p( e! f: j& C1 d& u
)
& D) j7 z0 x; g2 b )
% x' W4 W6 j+ k (SETVAR "OSMODE" 0)
0 J! _1 }7 v$ F3 {3 L1 W! M1 T (SETQ PTI (POLAR PT GOCX 2))+ v5 @; U3 e+ J) L# k, m/ h
(SETQ PT13I (POLAR PT13 GOCY 2))9 U b! {8 K+ @, l! I( _
(SETQ PT14I (POLAR PT14 GOCY 2))
3 P. ?0 f5 P# K }3 ` (SETQ PT13N (INTERS PT PTI PT13 PT13I NIL))8 p9 J5 [4 M% Y: k1 J- [
(SETQ PT14N (INTERS PT PTI PT14 PT14I NIL))( x* T- ^# m) a' e
(SETQ O13 (ASSOC 13 DS))7 C0 i4 i6 C3 a8 d
(SETQ O14 (ASSOC 14 DS))! K- G9 }$ `% f! B- M7 x
(SETQ N13 (CONS 13 PT13N))1 H. Z3 L- R% V1 h. M/ e# d
(SETQ N14 (CONS 14 PT14N))7 u$ I" H3 {& {$ y9 Q! ` y- b
(SETQ DS (SUBST N13 O13 DS))' J) k! D2 J1 M$ Z1 _9 g+ Q. c4 A
(SETQ DS (SUBST N14 O14 DS))6 A/ W0 @+ O- p1 a
(ENTMOD DS)
0 A9 G4 T8 s. o; Q# t ), K% A2 e2 i8 Y$ K
)2 n& b# ]0 S$ s2 e! }
(SETQ DEM (+ DEM 1))
2 ~: b* L5 c5 P8 D )
/ L! G1 Y$ b& W+ e3 A9 Z)
4 L" R6 F4 C1 r+ r7 k& b3 H) K(COMMAND "UCS" "P"); ? D- H- k$ y" m& D
(SETVAR "CMDECHO" CMD)
+ o4 D0 G: w# x6 ^' `$ h4 v) c* A; h(SETVAR "OSMODE" OSM)
8 @% L; k6 l& [. R(setq *error* OLDERR) ; Restore old *error* handler
X9 r7 c% t4 A* y(PRINC)
: Q5 L$ n( o% m. G( |" Z)
6 P' r9 T* [7 L# r9 z) a) A" x
o! K3 `) K, {% }, V(DEFUN C:BD (/ CMD SS LTH DEM PT DS KDL N70 GOCX GOCY PT13 PT14 PTI
3 {/ f* J1 V8 \9 y# V PT10 PT10I PT10N O10 N10 PT11 PT11N O11 N11 KC OSM OLDERR)7 }' E" k# ^1 {4 e9 c
(SETQ CMD (GETVAR "CMDECHO"))1 @1 n* r, @4 k& Z k/ T, i
(SETQ OSM (GETVAR "OSMODE"))
, n& P3 A4 G5 w& C(SETQ OLDERR *error*2 u9 v0 N Q. L: s; z
*error* myerror): y3 r) b: X4 @( A) g# `
(PRINC "Please select dimension object!")8 d" J2 ^- S9 v5 M1 @+ B
(SETQ SS (SSGET))
) }! N& {- U' j6 i(SETVAR "CMDECHO" 0)4 E I2 n3 t" A/ u' k5 z; n @- U
(SETQ PT (GETPOINT "Point to trim or extend:"))6 p3 P, d7 Y. l/ e# X0 \" m1 S
(SETQ PT (TRANS PT 1 0))2 G4 K$ ?3 ^3 w1 p* ^
(COMMAND "UCS" "W")
4 @0 D/ S* q. ?+ N3 M1 N) }(SETQ LTH (SSLENGTH SS))
* _: O9 _% o/ c; L" D& W(SETQ DEM 0)7 a( L; ?! ^! A$ [2 m' `4 u
(WHILE (< DEM LTH)
2 z3 B: J, d! b5 T1 U I6 c9 ^ (PROGN
' b9 v0 L4 X- w' T! w; h: i (SETQ DS (ENTGET (SSNAME SS DEM)))
( w! L" q1 g' }1 R (SETQ KDL (CDR (ASSOC 0 DS)))
; G9 i' H6 J" t9 v' t: f- J (IF (= "DIMENSION" KDL), ~) j' r- k; e" O) @+ J$ i$ h
(PROGN
% x% K" M- f/ `( X) ^. s! _: C (SETQ PT13 (CDR (ASSOC 13 DS)))
; B0 X( J# `: T$ P0 O3 U/ R (SETQ PT14 (CDR (ASSOC 14 DS)))
1 w) R2 V9 \, c% ` (SETQ PT10 (CDR (ASSOC 10 DS)))4 W" [: L1 Q4 i9 r7 }+ N
(SETQ PT11 (CDR (ASSOC 11 DS))) a/ t0 W$ k) ^+ p0 H7 P, n
(SETQ N70 (CDR (ASSOC 70 DS)))
' ~; b/ p' g- ^6 `' q5 D3 V9 _ (IF (OR (= N70 32) (= N70 33) (= N70 160) (= N70 161))8 ~/ h1 A) O8 C y, h' ]
(PROGN
4 {- j" U& t7 f- O# ~: N" k8 [2 ` (SETQ GOCY (ANGLE PT10 PT14))3 G+ M# D3 P3 e/ p0 Q
(SETQ GOCX (+ GOCY (/ PI 2))); _& s: A7 _! ]" W% @; s' {
)4 L, J9 O% i6 E+ g
)3 g5 N" i( @9 F) X, ^1 n
(SETVAR "OSMODE" 0)
( [: J- P" S8 Q3 ~& Y (SETQ PTI (POLAR PT GOCX 2))2 Q' t1 ~% s8 c% m a( Q
(SETQ PT10I (POLAR PT10 GOCY 2))
: {, I# h j% p4 H1 W (SETQ PT10N (INTERS PT PTI PT10 PT10I NIL))) R' O5 _2 b: S
(SETQ KC (DISTANCE PT10 PT10N))
$ W+ _; X( Z" C: ~& H (SETQ O10 (ASSOC 10 DS))
0 G5 w7 h3 u2 Y+ x5 w& p* U' D, f: v (SETQ N10 (CONS 10 PT10N))
0 d( ^) k+ n6 b ?7 \ (SETQ DS (SUBST N10 O10 DS)), m$ u1 d y9 S+ m
(SETQ PT11N (POLAR PT11 (ANGLE PT10 PT10N) KC))
% R K$ V2 Q4 N* H3 M (SETQ O11 (ASSOC 11 DS))
/ C+ l4 Q L& s+ b$ N, R# N- c (SETQ N11 (CONS 11 PT11N))! }: D, n6 b; n w: V% M& w) R# b
(SETQ DS (SUBST N11 O11 DS))" U: c. K i, X# E& S' g
(ENTMOD DS) ?0 X: S5 b$ c' o* R( o, _5 X( I
)
4 q0 z; J3 _1 J" v6 p9 B )
8 D! y: P6 T- M& u% A (SETQ DEM (+ DEM 1))
7 k6 F& d, ^9 I) R& e )
0 h: ^# J: n# l' _' W3 H. ~5 c)! Q* S* G& _; o* g. T; k; F, g1 G
(COMMAND "UCS" "P")/ P+ \1 _3 I: ^/ @6 o
(SETVAR "CMDECHO" CMD)$ S% C& Y5 x/ T* W) J3 ~0 t
(SETVAR "OSMODE" OSM)
. e9 z% t! M9 r5 v# }! B(setq *error* OLDERR)
f3 s0 C/ g% X" S2 R(PRINC)
1 k+ D* @0 x; T1 Y)
+ f8 g- f% M0 V+ n& {: d0 g8 Q" E2 k; [0 m: A- v* ?/ V8 ?8 @% @
7 I- h% G; t, t _( n3 u& J! c;;; ================ BAT - TAT CHE DO GACH CHAN TEXT (TU) =================/ [# C/ D9 N( i0 V$ U
/ `) U# W, o4 J7 P; n. J7 f* U
(defun c:tu () (setvar "cmdecho" 0)(prompt "\nHay chon dong TEXT can gach chan ")' s O( L9 F! _
(prompt "\nSelect objects: ")(command "select" "au" pause)(setq sstxt (ssget "p")9 ?6 D: m) D" @, }) w
sslen (sslength sstxt) ctr 0)(command ".undo" "mark")(while (< ctr sslen)(setq listxt! V& a1 U5 ]2 H1 z
(entget (ssname sstxt ctr))txttxt (cdr (assoc 1 listxt))enttxt (cdr (assoc 0 listxt)))# E: _, l/ s: v% g" a
(if (= enttxt "TEXT")(progn(setq testxt (substr txttxt 1 3))(if (or (= testxt "%%u")
3 b9 m, a- T; v1 ~$ \ (= testxt "%%U"))(setq newtxt (substr txttxt 4))(setq newtxt (strcat "%%u" txttxt)))6 o0 c) P: |" M: S
(setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))(entmod listxt)))$ g: w1 A- _. [. h) v% z b. ]# I
(setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))) l! ~5 Y0 |' a0 v
% J" c8 i9 c5 Y8 r/ y
;;; ================ CHEN COT (TUU) =================
! y; j8 J* e3 ~$ u4 z
$ u) S, [0 J v+ R8 {(defun c:tuu () (setvar "cmdecho" 0)(prompt "\nHay chon dong TEXT can chen cot ")
8 Y* s9 y% z* l (prompt "\nSelect objects: ")(command "select" "au" pause)(setq sstxt (ssget "p")
) z( m( o: p3 K2 w; e" i sslen (sslength sstxt) ctr 0)(command ".undo" "mark")(while (< ctr sslen)(setq listxt
4 e% U; @2 W9 `; F2 C% O1 m# [' t( Y (entget (ssname sstxt ctr))txttxt (cdr (assoc 1 listxt))enttxt (cdr (assoc 0 listxt))). P7 e. [* u) A' ]
(if (= enttxt "TEXT")(progn(setq testxt (substr txttxt 1 3))(if (or (= testxt "%%p 0,000")5 w! S, D, \/ J0 [' i8 W
(= testxt "%%P 0,000"))(setq newtxt (substr txttxt 4))(setq newtxt (strcat "%%P 0,000" txttxt))). F* T4 M6 L% ] @# u
(setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))(entmod listxt)))
3 T* P$ C7 |, u/ N (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))
1 j' K" N6 k: z9 _. h* ]2 a3 s. ]) z
;;; ================ CHEN KY HIEU THEP (TP) =================
% H1 F8 Q8 T2 s# ^3 k1 {
* i4 j) a. N% C(defun c:tp () (setvar "cmdecho" 0)(prompt "\nHay chon dong TEXT can chen ky hieu thep ")
L0 l+ K5 ]6 V- u (prompt "\nSelect objects: ")(command "select" "au" pause)(setq sstxt (ssget "p")* X0 D. {3 i4 ~4 f
sslen (sslength sstxt) ctr 0)(command ".undo" "mark")(while (< ctr sslen)(setq listxt% u! l7 P0 L, B* A+ o: c
(entget (ssname sstxt ctr))txttxt (cdr (assoc 1 listxt))enttxt (cdr (assoc 0 listxt)))
2 b9 x, r+ B; Z (if (= enttxt "TEXT")(progn(setq testxt (substr txttxt 1 3))(if (or (= testxt "%%c")1 P9 M' T) H) @
(= testxt "%%C"))(setq newtxt (substr txttxt 4))(setq newtxt (strcat "%%c" txttxt)))
; l2 S8 O/ ]2 U& p (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))(entmod listxt)))
- J% C$ A8 w' l0 D6 B (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))
A3 E8 [0 p. d2 q% E" N0 R3 T, z4 a9 q$ j' \. H
;=========================== TAM TUONG (TAM) =================================' v; J- d( w; E! b F' z
8 d6 _9 f9 R3 i9 j. r9 B- k$ Z. q& i
(defun c:tam(/ data_m)
0 H1 y- }/ M( v- ~2 H4 l1 O (defun import_data(/ i)(setq data_m (ssget))(if (= nil distan_m) (setq distan_m 110.0)): w* t" d2 S, C; b+ v: D( K( T
(princ "Distance (")(princ distan_m)(princ "):")(setq i (getreal ))(if (not (= nil i))/ Y# ~# ?. H7 H0 H
(setq distan_m i)))(defun process(/ ent check)(defun p_check()(setq check 0)' l9 H+ f* Y3 e- K" d# f: e
(if (= "LINE" (cdr (assoc 0 ent))) (setq check 1))(princ))(defun p_d_offset- y9 R3 R5 F. L/ b* c4 S( c7 q
(/ p1 p2 p3 p4)(defun makeline(/ e2 e5)(setq la (list (cons 0 "LINE")(cons 5 (cdr
% p4 p: j$ J5 s; ]- s }- ^ (assoc 5 ent)))(cons 8 (cdr (assoc 8 ent)))(cons 10 p3)(cons 11 p4)))(entmake la)(princ)" r) P+ X& n% b! }$ O4 b E0 f
)(setq p1 (cdr (assoc 10 ent)) p2 (cdr (assoc 11 ent)))(if (not (= p1 p2)) (progn (if: k2 b+ D/ x7 p3 T4 K; {
(< (abs (- (nth 0 p1) (nth 0 p2))) 0.000001) (progn (setq p3 (list (+ (nth 0 p1)
4 ^1 F/ H" y9 k/ } distan_m) (nth 1 p1) (nth 2 p1)))(setq p4 (list (+ (nth 0 p2) distan_m)(nth 1 p2), W" `2 r, F2 O! P6 b
(nth 2 p2))) (makeline) (setq p3 (list (- (nth 0 p1) distan_m) (nth 1 p1) (nth 2 p1)))
+ ?& i" M g3 c" G (setq p4 (list (- (nth 0 p2) distan_m) (nth 1 p2) (nth 2 p2))) (makeline)))(if (<
& }" ~2 ^1 c8 w0 O4 f, H6 Y" ~ (abs (- (nth 1 p1) (nth 1 p2))) 0.000001) (progn (setq p3 (list (nth 0 p1) (+ (nth 1 p1)
6 f L. t% Y# s; G' D" P distan_m) (nth 2 p1)))(setq p4 (list (nth 0 p2) (+ (nth 1 p2) distan_m) (nth 2 p2)))
( K3 ?, b* O; `; o! w (makeline) (setq p3 (list (nth 0 p1) (- (nth 1 p1) distan_m) (nth 2 p1))) (setq p4
$ o. d+ X3 J- U( O, M, h' e: N9 y2 O (list (nth 0 p2) (- (nth 1 p2) distan_m) (nth 2 p2)))(makeline)))))(princ))(if (not9 h+ o) U( B8 V" {2 X
(= nil data_m)) (progn (setq i 0)(while (< i (sslength data_m)) (progn(setq ent (entget
9 V1 s- h2 k0 d1 K0 f3 U (ssname data_m i)))(p_check)(if (= 1 check) (p_d_offset))(setq i (+ i 1))))))(princ))9 A8 `0 H3 J( m( \9 K, p
(import_data)(ai_undo_push)(process)(ai_undo_pop)(princ))
, r5 \1 ]; G% E& m; h- z- L+ M; H2 N" d3 A* {1 l% Z U$ X
;============ GHI CHU PHI (T1) ================
S0 A7 m1 O; s1 i: L/ N" Q
C' ~6 I2 W" U' }(defun c:DuongDan ()(setq D1 (getpoint " Diem thu nhat: "))(setq D2 (getpoint "Diem thu hai: " D1))
! L o4 Z5 w7 V (if (> (car D2) (car D1)) (setq D3 (polar D2 0 16)))(if (< (car D2) (car D1)) (setq D3
' K/ D, h$ ^4 Z& M4 O1 P* w (polar D2 PI 16)))(if (= (car D2) (car D1)) (setq D3 (polar D2 0 16)))(if (> (car D2)) T! C! e3 z, w3 u+ ^0 u( C
(car D1)) (setq D4 (polar D3 0 3.2)))(if (< (car D2)(car D1))(setq D4 (polar D3 PI 3.2)( q9 {& W& p9 _9 m3 P3 _* D
))(if (= (car D2) (car D1)) (setq D4 (polar D3 0 3.2)))(if (> (car D2) (car D1))
! t; ]( F2 G! Z$ Q; p (setq D5 (polar D2 (/ PI 9) 3)))(if (< (car D2) (car D1)) (setq D5 (polar D3 (/ PI 9)
# e% N% G, Y% ?; `* u 3)))(if (= (car D2) (car D1)) (setq D5 (polar D2 (/ PI 9) 3)))(command "color" 1)! h' ^. ]0 l- Z- R- H$ s9 o) ~& e
(command "line" D1 D2 D3 "")(command "circle" D4 "3.5")(command "color" 7 )! K3 D; `7 `7 s
(command "text" "m" D4 2.5 0 "1")(command "text" D5 2.5 0 "%%c6a150")
% \4 H6 A( j" j L6 W7 b- Y. m8 ^ (command "ddedit" pause))# s! c! U2 }7 B% Q* b0 q
! X! [6 r+ }9 y' ~8 e+ p2 X7 g;;; ========================== Join (J) =================8 J6 c4 H% P+ l8 q5 Z6 ]
0 k* L, H* \' ?0 _. p1 c(defun C:J () (Setvar "cmdecho" 0)(setq m:err *error* *error* *merrmsg*)(setq sset (ssget))
! N6 A# _' K" ~8 A, s (if (null sset) (exit))(setq kt (getstring "\nJoin all (Y/N) <Y> ? "))
- X( A; e ^" h: n& Z (setq ssl (sslength sset))(setq temp (entget (ssname sset 0))etype (cdr (assoc 0 temp)6 [, s0 t! u( _
))(cond((or (= kt "Y") (= kt "y") (= kt ""))(progn (cond((= etype "POLYLINE")$ h6 U* x( U/ D% ^; M0 f! s
(COMMAND "PEDIT" sset "J" "all" "" ""))(if (or (= etype "LINE") (= etype "ARC"))
* ]1 t8 y/ v# L C: z9 O (COMMAND "PEDIT" sset "" "J" "all" "" "")))))((or (/= kt "Y") (/= kt "y") (/= kt "")); b% B, \/ [) a- J+ t
(progn (cond((= etype "POLYLINE")(COMMAND "PEDIT" sset "J" sset "" ""))
6 A% F6 W+ m7 U) q, q! V3 L G (if (or (= etype "LINE") (= etype "ARC"))(COMMAND "PEDIT" sset "" "J" sset "" "")))))). S2 m( z, _) Y7 B% j! O
(setq *error* m:err m:err nil)(princ))4 R' Z9 s5 e6 e+ J
2 q3 p* \4 G d;=====================================================================8 t! G' Y; }' x# q; z, L1 V+ T$ M
;;; DOOR.LSP 1.0, Copyright (C) 1998 by CAD Department, HUCE.
! T7 i. Z+ O+ Z;=====================================================================/ P* r& F4 C6 ~( g( m( L
- B) {$ R! s# X9 d. |# _; o! O8 A
(defun C:D1 (/ p1 p2 p3 p4 side dis wid ang angsile old)5 P! c6 W \+ M8 s
(setq old (getvar "OSMODE"))
5 c( U+ j! I, T# u9 P, a$ w3 q
* e# g5 y- ~" f (setq p1 (getpoint "\nStart point:"))3 a6 V8 q$ g) }* e/ C" V6 P
(setq p2 (getpoint p1 "\nEnd point:"))% U9 i" Z; M! b
(setq side (getpoint p2 "\nOpen side"))1 @6 c6 o: H6 }" y8 S+ _/ P: A4 L
/ {, c7 D. M7 P2 @ M- @0 B$ w9 Q (setq dis (distance p1 p2))
, a& y+ _* U0 R% h (setq ang (angle p1 p2))
+ @+ D- E/ L" K! n (if (< ang (angle p1 side))
$ G% k1 [5 D& B7 }9 b3 U! R7 j% z (setq angside (/ pi 2) ) n+ K4 G4 j) `$ c
(setq angside (- (/ pi 2)))* Z( m% C$ w& P( z* Y5 [
)- R$ A' O# _% c/ U+ C
(if (>= (- (angle p1 side) ang) pi)
) }: H" e7 \1 J+ o6 q, C/ x1 p (setq angside (- (/ pi 2)))5 X* d. F# b# r/ r3 a
)
- S" ~! n) W- P" ^$ h (if (>= (- ANG (angle p1 side) ) pi)
" O9 I- g9 D S+ N+ r+ K# r# y (setq angside (/ pi 2))5 _% m+ O; s% l9 r
)
# n2 ~( C3 K" y* u9 j! x/ f& D% F5 J
(setq p3 (polar p2 (+ ang angside) dis) )8 O5 w- c n! T% G9 a5 c
(setq p4 (polar p1 (+ ang angside) dis) )( M+ t8 W0 ?3 o9 L5 u/ [
(setq wid (/ dis 15))1 }9 J" B0 O+ D5 ?5 I2 a
% J( k2 z3 v5 |& N (setvar "OSMODE" 0)7 d7 h+ R: j& e0 d2 F
X0 S, X% d# T% h+ s6 o (command "PLINE" p1 "A" "D" p4 p3 "L" p2
' n7 L! E3 M7 v/ b: P (polar p2 (+ ang pi) wid) % \0 l- R0 I! Q
(polar p3 (+ ang pi) wid) + R2 u7 G9 a' l6 ?) A
"")
6 s2 @! }) K- j# ^0 Y/ A) L5 [ U1 |
(setvar "OSMODE" old)
6 i: |: l7 q9 m3 ~6 R (princ)+ M7 j) V4 e5 q H e
)
: I; b, M- y# N' @7 ~9 A
3 P. _' F8 K* Z7 w: }3 K$ n7 @;=====================================================================
5 a. A& z+ ~& _$ m# o/ }5 ^
' N+ V+ P1 z2 f(defun C:D2 (/ p1 p2 p3 p4 side dis wid ang angsile old)
4 h% {$ a* e) C3 | (defun cua1 (pt1 pt2)( N8 e+ u! ?3 l1 r, S. ]
(setq p1 pt1! b' o: t+ @/ O& W( v% x
p2 pt2)- l" `6 }% `- l. n v' t7 M% b
7 q, t F4 f6 q- K n; g (setq ang (angle p1 p2))
6 X) v4 P" t. H( U2 Z% \ (if (< ang (angle p1 side))" S( |9 k% f- Y* j. |
(setq angside (/ pi 2) )
8 J( t3 L2 r& m! x: K$ Y6 c (setq angside (- (/ pi 2)))& u- l p% z3 n; G8 i
)
& c3 K/ W6 A# ` O1 `/ L (if (>= (- (angle p1 side) ang) pi). m& m4 ~. I$ K+ i
(setq angside (- (/ pi 2)))
' b$ l8 O3 J( f; }, l/ Z3 ^5 e )3 s0 w4 B7 R {
(if (>= (- ANG (angle p1 side) ) pi)
$ [& {6 F9 L. l6 R3 e! Z (setq angside (/ pi 2))
8 j3 O4 W3 I+ h' V )
+ q* J* N, q) Z5 {8 N& ^9 b: s- x7 @) d8 ?+ Q" `# Q( }: x [
(setq p3 (polar p2 (+ ang angside) dis) )" n- n4 H# O9 l: U! `( ^7 B' Z
(setq p4 (polar p1 (+ ang angside) dis) )7 G& P. r" w7 v$ p
(setq wid (/ dis 15))! _0 D& r/ Z/ y2 \7 {
. ?9 p) h; j6 D( C (command "PLINE" p1 "A" "D" p4 p3 "L" p2 9 X+ \ J2 B5 F3 q$ S" ?* C o
(polar p2 (+ ang pi) wid) 2 m. \# E5 y, d3 k) c Z
(polar p3 (+ ang pi) wid) , |1 A3 a+ L# d! q Q2 B
"")
" }# R, S/ F2 _& j7 [ )
# Q1 j0 U6 ^9 N) o;=====================================================================
$ N9 q: O# H9 j' n (setq old (getvar "OSMODE"))
2 [3 L' y6 \6 P$ P) E
4 L$ Q) y' [# z& Q' i0 M (setq p1 (getpoint "\nStart point:"))
- ~- _9 y) G' J4 |7 e2 A3 R' [; Z (setq p2 (getpoint p1 "\nEnd point:"))( e, Z& a( H# N
(setq side (getpoint p2 "\nOpen side"))
: h3 a3 Q- h3 y$ ~: ] C$ Y3 G- @2 x
(setq dis (distance p1 p2))9 P$ P3 ]- B" j1 N: U* M6 I
(setq dis (/ dis 2))
' R+ w/ t+ E. [. ~$ q: s& v2 b) C# |
(setvar "OSMODE" 0)
0 J) f+ }) {8 ~% g4 w5 u3 C A0 m* z( t* f' o
(setq p1 (polar p1 (angle p1 p2) dis))
1 V9 d0 E4 m0 z4 @6 ~ (cua1 p1 p2)
8 i# D& w' d9 D, q8 ~* H7 ~7 ?( Z4 U
(setq ang (+ ang pi)) L0 Y) o; u5 K. }' e* X5 z
(setq p2 (polar p1 ang dis))
8 X- V w4 l0 w$ b* i& Z; (setq side (polar p1 () dis))
( U( X. v% X% N! A, | (cua1 p1 p2) 9 X7 \# d5 E# E' U+ }
8 K+ b8 P9 n& }( P
(setvar "OSMODE" old)
# y5 D/ ~* V8 D6 i) p' Z5 n( ~+ Y (princ) Z+ N; H4 \! k. a
), j4 C5 x: @5 K- k: ]$ @5 w# R I
5 P! o( I( J' U! K;=====================================================================
) W, m w; @) n8 e8 q) K5 k f;"Glue" text strings. All adopt first's properties.
6 E' G1 e! ^ @) C2 a) _; Author:
9 m+ x7 h+ M; I, a' {4 p0 a) j; Henry C. Francis
- `" p S$ D8 i w. R. _; 425 N. Ashe St.
; @+ y* E% G B/ {7 n( I) ?% g; Southern Pines, NC 28387
, {, o* L" B' N/ c4 u5 \, z; http://www.pinehurst.net/~pfrancis
: R! D8 Y% ]! |, [; k, G; e-mail hfrancis@pinehurst.net
" p. H/ I& q$ w) w6 `; All rights reserved.
7 \7 _+ S2 |/ S8 p( e(defun c:gst ( / ename ent1 ent2 old1 oldsl old10 old11 old40 old50 newstr newsl new1 new10 new11)8 F4 w6 }2 m! _( }" I y( S- {- v
(while
5 L) Y7 M' Q; s7 G5 n3 W (not
) Q! B {) G& [! o: B3 I (and
6 t* D) c/ f! e/ l& r F (setq ename1 (car(entsel "\nSelect first text string to join: "))); v7 {* h: @0 l, T" T2 Z0 a+ t+ B
(setq ent1 (entget ename1))# O1 J* I; b8 j7 H0 T
(eq(cdr(assoc 0 ent1))"TEXT")
/ g2 J3 z! y; w+ [' Y p );and
. C2 Y$ {( f$ y+ F" m& K2 W9 k );not. W' B; U$ p7 z
);while
0 E& \* i4 p/ v(setq old1 (cdr(assoc 1 ent1)))
) [3 J; \( e, X) u6 [8 n! L; X(while
7 k% M) b8 E+ z0 ]0 q (not4 p% w) z6 A8 C" r, L' ?7 ^
(and# u/ v3 U- G* }
(setq ename2 (car(entsel "\nSelect second text string to join: ")))
- F+ c; K- u+ V8 @0 A (setq ent2 (entget ename2))7 d% ]: F. m6 W8 R, [9 B4 F
(eq(cdr(assoc 0 ent2))"TEXT")2 l; \1 T8 U4 J" l: W6 f6 H/ I1 B( H
(not(eq ename1 ename2))2 V+ e1 k3 n2 S# M! K' |6 \* Y( o( [
);and" p4 j6 d4 b7 O8 ]7 y2 ]; |' n
);not
, i8 n8 Y/ p" o7 E O, {) K1 f8 r);while
# @; a8 s1 X; S0 K: L$ D _7 d(setq old2 (cdr(assoc 1 ent2)))
& h: I0 J* ~/ ]0 x H1 M(setq new1 (strcat old1 " " old2)
9 H; X5 c5 Y- ]" v ent1
* d! K3 ~! w3 o- z2 v$ s' F (subst (cons 1 new1)
; e) ]9 Q: O: x; G8 f (assoc 1 ent1)
8 E7 u6 O/ f" U4 w; `: D ent1)+ b) ^* F; p4 F/ b" Q
);setq% \6 g- Y5 L* F" h4 i9 j
(entmod ent1)
1 K" j3 G: i" G+ o, m(entdel ename2)% h5 F6 ^( c& R$ s2 O, H' @
(princ)
3 ]9 g. N ~6 C I, a, |);defun+ Z# t, c4 b$ O* N; q% O7 t/ K
\& H" i0 y- \- O
;=====================================================================' D Q# K! N; ^# v6 ]& Q0 e
3 B6 x+ p" ]& U: G2 |& V
(defun c:nt (/ g1 g2 ss1 olderr nterr l i temp e1 e2 new old dd dc)
: s0 m# ~& C( Y5 A) A3 m
0 w! I: w$ o! f1 R (defun nterr (s)6 w- T E# h# E: x4 N p
(command "_.UCS" "" "_.UNDO" "E")) Z# }, U3 E# Q; s2 e( ^4 c7 a
(setvar "cmdecho" 1)
7 b9 o, v$ E; h. j( A (setvar "blipmode" 0)$ D1 w2 c" o% {5 A8 f* E
(setq *error* olderr)# ?5 X) ?" {9 f( k0 U+ i1 c# w
(setq g1 nil g2 nil ss1 nil e1 nil e2 nil olderr nil 6 F: x. w: r1 b E: @: {2 U
nterr nil temp nil i nil l nil new nil old nil dd nil dc nil)
4 s* m: q8 Q# s! d7 x (princ)
$ l! X) L2 d8 l% b )
2 O+ O# G8 ^; c; d1 a3 ~, `* p$ i: G0 G! C/ l+ W% G
(defun tim_in (dt / p01 p02 ktra)
1 p& b* { L9 X+ o (setq p01 (cdr (assoc 10 (entget dt))))5 s! {" Q% M1 P8 |, n" `6 m
(setq p02 (cdr (assoc 11 (entget dt))))" P5 a! P; Y# s. I% i8 v6 Y
(setq ktra T)
- O) ~9 |4 D; L6 D7 E, M% z+ b (if (and (> (car p01) (car g1)) (< (car p01) (car g2)) ( _& r8 A5 m% t9 }, f: J. P' ^
(> (cadr p01) (cadr g1)) (< (cadr p01) (cadr g2)))
! K7 W9 z/ j% x$ r3 F: U# [" I (setq ktra nil)
0 G0 j( M! D: X3 a )
& g7 ]9 a2 h5 ^" R (if (and (> (car p02) (car g1)) (< (car p02) (car g2)) 1 F9 i4 H$ e( A! Y. g! n
(> (cadr p02) (cadr g1)) (< (cadr p02) (cadr g2)))' B) p7 Y3 r" Z- G" z) n
(setq ktra nil)
) t, s! X$ T; ~; ~. W+ g6 [ )" k& T H1 B: g8 K& z y
ktra: h( x5 L. `' K7 d8 n; x; M
)/ U! }, b) P# x0 r' s
8 V; b! f! O: r/ Y6 H2 t% T1 l
(defun timdt (dt1 dt2 / p01 p02)1 U# ~- S% P) N# y; Y
(setq p01 (cdr (assoc 10 (entget dt2))))1 F% x' ?6 d3 u; y* H! H" l4 \, P
(setq p02 (cdr (assoc 11 (entget dt2))))/ E5 Z0 |' R$ Y1 E$ x$ T: L
(setvar "ucsicon" 0)- S3 U; n5 x8 x
(command "_.UCS" "E" dt1)- U" w5 m3 H$ m/ u
(setq p01 (trans p01 0 1)), r) S6 y$ U5 R( r
(setq p02 (trans p02 0 1))
! Y7 ]4 |8 w0 K6 d (command "_.UCS" "")
$ P& Q& {) ?$ B- ` w7 r) G (setvar "ucsicon" 1) }" F4 C. d$ F% M( Q1 K
(if (and (equal (cadr p01) 0 0.001) (equal (cadr p02) 0 0.001))
9 h9 H" T" \: |% Z2 b7 B T
$ l" R' [" ?2 G' \ nil
' i2 c& v. A9 P) g/ t ). F$ Y) U; C- a3 R& X" T' a" F
); u+ q4 j2 X! x+ W3 H9 ~
1 X/ E: o6 A+ Z' t2 S9 B/ c/ Q+ {
(defun tim_out (dt / p01 p02 kt)
/ m- [( F0 Z" d (setq p01 (cdr (assoc 10 (entget dt))))2 q) _- H! V; X! ?3 `
(setq p02 (cdr (assoc 11 (entget dt))))4 o- N! h/ q# f8 Q! b
(if (and (> (car p01) (car g1)) (< (car p01) (car g2))
$ s, c2 Z, n' ] (> (cadr p01) (cadr g1)) (< (cadr p01) (cadr g2))). M: E7 E' @7 o( b5 |# e' b2 h
(setq kt p02)
0 i& v$ S; |, b6 f: ]( k5 s )5 R' R8 Y9 j: a5 n5 t1 F
(if (and (> (car p02) (car g1)) (< (car p02) (car g2)) % ~! a9 o4 a! ~' b# N* N4 u
(> (cadr p02) (cadr g1)) (< (cadr p02) (cadr g2)))" ^3 T/ D( X1 j$ K. y+ H/ b
(setq kt p01)
5 \% E) }! q% B- g+ ^ )0 `& x4 {) {0 W6 ~# J/ j
kt
# A- M: y: ]) |! U* [9 |6 I# A )
9 k$ J, Y6 R$ f; g
0 i+ j8 X5 s, Z: G: |) r# S, ], j (setvar "cmdecho" 0)
* _3 o- C, s E8 M (setq olderr *error* *error* nterr)+ C% p9 Q8 F, q$ _+ \
(command "_.UNDO" "G" "_.UCS" "")
3 n2 H) l" D1 \0 b: h (while (null ss1)" B" @! @9 F7 y7 W& t$ o
(princ "\nChon tuong muon noi..."). c8 i1 \6 A* C. W
(initget 1); G. o$ u6 w: U$ @" P0 h/ F8 T; y
(setq g1 (getpoint "\n>Goc thu nhat:"))1 m/ L2 M" }2 K; d& {8 ]/ x
(initget (+ 1 32))! n7 _, m* G @, T3 H
(setq g2 (getcorner g1 "\n>Goc thu hai:"))
- V& D F. E+ {8 n (setq ss1 (ssget "c" g1 g2 '((0 . "LINE"))))
! U: H5 `7 S& ?0 @9 Z (if (null ss1) (princ "\nKhong tim thay doi tuong!"))/ [, v9 w' v: H' |0 L4 G& s$ `2 o
)
+ s# R+ o4 I6 j& s2 ]4 U6 U8 o
' U% t) l1 U$ X L: ? (setq temp (list (min (car g1) (car g2)) (min (cadr g1) (cadr g2)))
M4 D+ V% |& w* F6 G- z0 e" S g2 (list (max (car g1) (car g2)) (max (cadr g1) (cadr g2)))0 ~+ A( t3 r4 ~$ L; N
g1 temp)
, c- L: k/ X- P+ L0 N. n1 A3 A$ s (setq ss1 (ssget "w" g1 g2))
% e, L+ C- Q6 O9 B4 y F& l (if ss1 (command "_.ERASE" ss1 ""))" R- z4 ?+ q4 H7 W( X, @
(setq ss1 (ssget "c" g1 g2 '((0 . "LINE"))))
: b- a% H! ]) D7 |5 h: Z9 S
7 k* k# g$ f2 T: @4 O* f* |0 I (setvar "blipmode" 0)* O, n' M0 }6 I5 _; f/ f
(setq i 0 l (sslength ss1))2 ^" W9 t4 n& L5 X
(while (< i l)) s, c/ B: C: \: O* R% |# U2 @) R
(if (tim_in (ssname ss1 i))
0 D. u/ D+ T; I9 m# j% f( [* g2 S, c (progn , l- x8 i$ O! O# b2 y
(ssdel (ssname ss1 i) ss1)
/ u& q/ X( N# C( m (setq i 0 l (1- l))
% {/ c k% F8 U2 ^2 u) t' ~ )
% D2 W! U4 C$ j% T! S( d (setq i (1+ i))4 ^ \7 l2 v! F1 d4 N" G/ w
)
: ~, W- t) d" @% P2 q: ]0 [7 c )
6 c" k5 ^; d9 T' Q8 O (setq l (sslength ss1))$ B9 W( E$ u- \( \; B! k
(while (>= l 2)
* f/ t3 X, I& x/ M5 a (setq e1 (ssname ss1 0))
0 C: ]8 A2 g& W% h n (ssdel e1 ss1)) u7 _8 r5 c+ N! ^9 A$ Q: [" a
(setq e2 nil i 0 l (sslength ss1))8 x r9 o$ }* c) }" ]; Y# ~3 l8 @
(while (< i l)
( R' x/ J g/ H6 z* o, f7 x (if (timdt e1 (ssname ss1 i)) i) _# v- h6 z5 |0 }& l
(progn
: a6 W1 ]) t# m: `9 p: A" ] (setq e2 (ssname ss1 i))
/ O8 e0 X7 u7 E (setq dd (tim_out e1))9 q9 P* V M8 k, d& |
(setq dc (tim_out e2))4 z/ q# P2 B4 Y
)
. g' ~( T9 J( L- V* ?8 d( t ]: C )
9 h' E8 _1 r, K# R" l (setq i (1+ i)), B0 G( }5 {/ U
)! W+ W8 S4 @# t
(if e2 (progn' {% ^. N3 s# [" Q6 z/ H2 Y, V
(ssdel e2 ss1) / p, A4 L5 g" z5 C" W0 `
(command "_.ERASE" e2 "")
3 n# E! c& H8 E4 G (setq temp (entget e1))
1 h# k5 x: s$ ]9 K1 { (setq old (assoc 10 temp))
, |2 E) f$ g) e% y (setq new (cons 10 dd))4 ?( B2 t6 b: G3 i( V# ?9 ]
(setq temp (subst new old temp))
$ v5 }/ Z' ^' [0 K8 n5 K (entmod temp)
9 ?& ^: j2 Y4 }% i" d. t5 f U (setq temp (entget e1))( O+ d& f: @5 q
(setq old (assoc 11 temp))
9 ?, g, q0 D6 \ (setq new (cons 11 dc))
: R" i3 x6 ~9 A' ^% g# H1 G (setq temp (subst new old temp))
4 w! d( o$ W' X+ U% Z+ m: M (entmod temp)* z: V9 e- C0 `6 D
(redraw e1)
0 Y9 C7 \& R9 q. i+ s (setq l (sslength ss1))
+ B- o5 O! B! I1 z; G )
: t9 e- A9 {; q y ), `8 f& a( s' }, {) M0 \4 o/ x
)
* X1 Q' k# x4 O
1 ?* y% Q1 A4 J9 W (command "_.UCS" "" "_.UNDO" "E")- F& j' t9 P4 C6 G+ q) J
(setvar "cmdecho" 1)
M' [& ~/ e& l$ }5 F* a0 D (setvar "blipmode" 0): m* d/ K$ t7 x, H; a2 u! `3 d
(setq *error* olderr)
( s9 z$ i! m) Z" A: \! [9 { (princ)
/ _+ C. Z+ D$ F9 D3 S/ P% ^* d)3 B5 Y& X) X9 E2 Z9 F- z5 o5 b
;*********************************************************************9 g: M- z9 {1 Q8 U
(defun ketthuc ()$ {. M% G; b# L' T
(setvar "cmdecho" luuecho)
. s6 d4 l1 E1 D4 F D# b (setq *error* luu
2 T0 h( u5 L/ D3 [# s( H luu nil
6 M* }9 E& d% a3 S' J" ~ luuecho nil! X3 T) a3 R$ |' H% R
);setq/ T |$ m( `4 [" G7 N# |8 J9 G6 l4 O$ w
(princ)
9 D/ K! _% D T8 n/ p+ A6 ]' N)
' v; H* a0 \ Y9 s3 F;*********************************************************************6 U) ^: b, |, C: m
(defun modau ()
+ n7 A5 O+ `6 z+ N* K7 u6 A3 H(setq luu *error- H# ?5 V7 w, a
luuecho (getvar "cmdecho")
1 ?+ S( h& L5 Q$ P0 E+ z' g *error (ketthuc)* I, s$ W" P$ a0 F5 d- N6 O
)5 X4 _( {4 N) _$ n5 Y
)' F4 F. Q4 c- R
;*********************************************************************
& H& C' [+ E+ y8 i6 |6 w8 d8 N! r) ?(defun xulytext (text / kytu ma sokt luusokt lui )
% w( f* S6 {3 c" c+ C(setq kytu (substr text (strlen text))
6 o$ u/ C% p8 g7 d% x ma (ascii kytu)
% L1 ]5 ^4 F- N0 E7 u sokt (read kytu)
2 g9 Z1 E5 T5 | lui 1: Z7 U1 u6 b; F
)+ f2 Z) o7 z' g/ q! W( X
(if (numberp sokt)
( w& s$ |4 o' [9 y# y# W" d2 z (progn
. Z3 f5 |0 r" B1 k (setq luusokt (1+ sokt))8 M$ v& Z* W1 n) h
(if (and (numberp sokt)
/ L, A+ Z- f0 N2 c* R3 ]9 x (> (strlen text) 1)3 b! p G4 b( J n
) ; r9 S3 ^# y) w" r
(progn
' B* o* N! v! `3 i0 R5 L (setq kytu (substr text (1- (strlen text)))
& h! @% G) g G4 X( o; Q sokt (read kytu) 1 u* x0 F/ g& A% j' c4 A' p% ~0 e
)+ n6 _! t8 c: V( Q8 O5 f0 F$ _
(if (numberp sokt)
. C& A( J' M; p: t4 a$ v& { (setq luusokt (1+ sokt)
3 m( ~* F& f8 L' U5 F9 w0 o y# K lui 21 i5 J4 l( b2 s5 E- N' a4 l) }: F
" y/ x+ F2 b) d8 k; h3 Z% e; x ). J% i8 i3 C+ \: I# o- o E. ^
)
$ a$ f1 [9 d' {7 ^ );progn 7 y9 j y! O; b0 N6 D- x
)
$ I/ I& l# b* o. ? (if (= luusokt 100) (setq luusokt 0))& M) y6 u8 L% e) X" f( w, V: M( j2 f
(setq kytu (rtos luusokt 2 0)
+ N. X8 e. O% d3 C8 e; A# { * b8 }( g. c# s0 {4 u6 c% @6 p
text (strcat (substr text 1 (- (strlen text) lui)) kytu)
0 Y, u G6 o( R% a7 a: e )
9 q5 O$ n4 Z8 o3 ~4 ` );progn ( V' j" k L$ R$ E' T
(if (or (= kytu "z")
; S: g& ]) u5 m' d6 P( V5 [0 y8 H. X (= kytu "Z"); U e G B, X5 h$ ~4 m6 M
)
1 A$ \) v3 w/ ~* {5 A7 A8 J" f (setq text (strcat text "0")
: D! J: e0 E& j8 y" I. r& n: K+ \7 z textxl "0"
& B: Y1 _5 ]7 h0 i: W; n )8 e5 W% X5 L- h/ ?( d& d$ V% e: N
(setq ma (1+ ma)
3 A! Y _- _$ K4 [6 U9 u text (strcat (substr text 1 (1- (strlen text))) (chr ma))
% E) H i& w9 M3 V1 @ )
8 e& P2 B$ K" Y );if
% p" z2 \) W+ N) v8 g);if
+ l( Q" U& t) h% f# L)
O& L; A& C2 w;*********************************************************************: a/ l; ]2 q2 a7 N% X7 c
(defun doitext(tendoituong / chuoi doituong thoat tam dsach kieu text vitri10 vitri11 dem canle)) U! i9 s+ h6 p& o4 i
;Neu doi tuong la text thi tiep tuc/ p: v& R7 Z- [, d
(setq doituong (entget tendoituong)
+ n3 d6 a3 G8 ]" P: f kieu (cdr (assoc 0 doituong))
: j! J2 `& U! C& R, w canle (cdr (assoc 72 doituong))
7 \9 @& X" K ?+ W# L. V: {) + u6 s6 Y- o) j- g
(if (or (= kieu "TEXT"), D7 g8 c/ {$ V" o0 X- W' P
(= kieu "MTEXT") & i& l- k# e1 y1 O
)
( z% C! }1 N6 Z) N( Y2 L (progn
( |3 S7 q7 n5 E1 h9 q (setq textxl (xulytext textxl)# t2 b( v- ^* t' a
text (cons 1 textxl)- V/ z/ a2 o/ ~- G/ \" \9 a
vitri10 (cdr (assoc 10 doituong))
6 b0 y/ X4 V" G2 c8 R" S0 B8 t/ g. W& u vitri10 (list (+ (car vitri10) (car vitrilech)) (+ (nth 1 vitri10) (nth 1 vitrilech)))
3 ~" }) b* Q" x+ e* E1 Q vitri10 (cons 10 vitri10)
, f/ H4 u' ^. P0 [2 w$ p vitri11 (cdr (assoc 11 doituong))
! h2 ?8 P( F P1 ~" G: j- y vitri11 (list (+ (car vitri11) (car vitrilech)) (+ (nth 1 vitri11) (nth 1 vitrilech)))% N$ v+ @4 |' r
vitri11 (cons 11 vitri11)
+ n* { _1 H& A7 @. F0 T dem 0: X2 N$ h! @/ Q8 L; [$ _
dsach nil
, F" R: U( o5 W7 p )
2 v/ Y) R5 x: w- Z: l (foreach tam doituong
7 I( c! J& m/ }/ ^ (cond7 _6 ^& q/ i8 O! \
((= (car tam) 1) (setq dsach (append dsach (list text))))
# G8 S+ Y: B' P- J ((= (car tam) 10) (setq dsach (append dsach (list vitri10)))). y1 k. j' f; Q. f/ v
((= (car tam) 11) (setq dsach (append dsach (list vitri11))))8 {8 ^* W- m- T
((setq dsach (append dsach (list tam))))8 T( @* s; v! }5 `. N6 n0 I
)3 a7 u3 K: n) b& t, @9 j+ X
)
' [3 `& f7 v$ \+ ]9 L# Q9 i0 d (entmake dsach)# u( D5 H7 i# A% V) d
);progn, F( y8 y, r( K6 w0 d
);if: n/ j# A/ X7 @1 s- m! @5 A5 F
);- G4 F5 c1 F4 u6 F7 n) F
;*********************************************************************) D* T; i, _3 w- S# l
;sao doi tuong cu sang vi tri moi. r: {- N$ y, p% R" |
0 f- O' \* k2 P6 o$ g2 H3 }(defun copy_dt (tendoituong )8 i+ K6 k( v7 [1 }2 E
(command "copy" tendoituong "" goc toi )
9 b: q7 ^+ J* N4 J);defun* m+ |% A' ^0 a! j1 s7 y/ C# `7 `
) T: \! J. y& O
;*********************************************************************( S% i; d- Y- A5 U; p
3 b. F( Z6 j+ C: ^(defun c:ct ( / cumdt dodai thoat dem ten doituong textxl dem goc toi)
( y3 J- R) l/ R2 l% H7 P+ L6 v$ |; Khoi dau cua chuong trinh: X+ J( U4 h0 C2 D- @, r
(princ "\nCopy Inteligent...\n")
2 Z9 r- Q- @% Q$ V% ~' y(setq luuecho (getvar "cmdecho")
5 H/ e8 k3 J4 a* G! ^; T( U luu *error*
# H2 `! ]( f. x5 k& N, } *error* ketthuc4 V* d% a+ T: j O, W
cumdt (ssget)
+ j* k4 t- `. O3 H dodai (sslength cumdt)7 v3 Q' [. E- P, F: y' I
goc (getpoint "\nSelect base point:")
1 K0 ^6 N2 o; l thoat nil
! c% Y$ a) C7 s C8 v dem 09 {+ j& ]1 A2 Z) t! w. K9 x% X9 ^& c
textxl nil& R. k" A8 E) r+ |
);
6 w& V9 ]/ f, E: X) t& Z(setvar "cmdecho" 0)
$ d, M, h* N7 H B8 X4 A9 y; Loc ra duoc ong text de xu ly: \! T5 C9 |0 |) @: s% k. ?
(while (and (= thoat nil)
. `9 O1 u: \/ c7 d# c" _ (< dem dodai)
0 d/ y( L; d: p8 S4 I* ~! a% G& g ): X* E; v- M% h" v
(setq ten (ssname cumdt dem)
* u; I# t: v& n dem (1+ dem). Y0 c' K* u, o( G J+ B
doituong (entget ten)
c V* n* G' i( R kieu (cdr (assoc 0 doituong)) / I. h8 l( a- W7 _: L7 T) p
)' m- e" {2 ?9 B' n
( P# U2 A! _$ z% |! y
(if (or (= kieu "TEXT")
- |7 \9 ?- |4 Q9 M (= kieu "MTEXT")
2 @0 p. ?, k- Z A )
) s1 l: w: e4 D9 e% h+ M [( `7 ^0 W; ~ (setq thoat T
! g9 Y; Z) @* }/ {9 {4 s textxl (cdr (assoc 1 doituong)) , e6 H5 C6 U3 Q: P
)
- l) T* X4 Y- W |5 j )/ M1 N0 R$ p* d" n. C& i
);: n+ Q; s8 X% ? F
(while T
3 @* |/ N9 U! Y" `0 x- A(setq toi (getpoint "\nSelect next point: " goc)
9 f- C5 ?6 S; { d. O' J% e vitrilech (list (- (car toi) (car goc)) (- (nth 1 toi) (nth 1 goc)))
' Q/ o N0 K/ x. M* Q dem 0
: x! I% X+ |' T7 I6 o8 S, [)0 m! C; o# j* W; I1 J. g3 Z" V- p/ C
(while (< dem dodai)# G# a8 U% ]. S+ J
(setq ten (ssname cumdt dem)4 ^# h/ M$ S) D
dem (1+ dem)6 ~/ E$ \7 ]8 s& y+ j
doituong (entget ten)
: m- }3 q7 `# g/ d, V v kieu (cdr (assoc 0 doituong)) + v8 ^! O1 R; v4 L
)8 }6 W. Y) p0 ?5 W3 i
" d5 c2 Q' Z' g5 k8 z: `( { (if (or (= kieu "TEXT")
/ A! ^/ d6 r) G (= kieu "MTEXT")
6 U8 \0 O: Y' c) Z7 E' e )8 { X1 z3 @2 B' l. O. ^
(doitext ten)( `2 l4 |6 G0 u6 f6 z( |5 ~# N
(copy_dt ten)
: n) k- T# E1 p' V2 Z6 f) ], R( i/ w1 ~. T$ w7 R' a1 M
);if+ C6 |% u' L n) n" E( { Q+ U
)+ \2 a9 I* U' l, Z( C
);while
. h9 k) T. E, s. {(ketthuc)
( {/ U4 S9 d& a! D0 O);defun) R1 Y7 v7 J% ^) `- @1 r
(princ "Type \"DG\" to start")) Z" T- p0 j1 ^" a' |4 i
;Note: bien toan cuc: textxl vitrilech
9 E2 }) h5 k: C. M8 }8 m. ]7 @+ ^3 y* e3 T- Q# V& B
;=====================================================================. m! J, u, G. \! m3 L3 a
;;; PLJOINFUZZ.LSP% J# T9 a9 T2 ]& T
;;; Joins lines, arcs and polylines using a fuzz distance9 k7 q, C! v3 ]# p8 q2 R
;;; If only one object is selected it tries to join to all objects that are possible" Y p7 q# s0 r3 g- e) `+ W7 y& @
;;; By Jimmy Bergmark
& B" a" `% r& f% V+ r, {( {$ X;;; Copyright (C) 2003-2004 JTB World, All Rights Reserved: ~; c$ {. s2 [9 V; [( K
;;; Website: www.jtbworld.com$ p& b1 I2 h3 }& G6 v9 Q
;;; E-mail: info@jtbworld.com
+ N& |2 [4 q- ^0 g* s) {;;; Tested on AutoCAD 2002,2004 and 2005
* s2 i" r- F; _6 I/ _;;; Latest revision made 2004-11-11' W, J0 m3 q5 ~( w- J8 l- c
;;; Minor code cosmetic change made 2004-11-13
. W6 b1 E9 H4 |8 z3 G;;; Bug corrected 2004-12-230 u. i3 |0 V1 J+ C+ _
' x" O9 ]* P8 |- A2 \(defun c:jf () (c:pljoinfuzz)) ; this line can be commented out if there is an existing command called jf3 |" P a& e) t: q0 S" U5 U3 R
(defun c:pljoinfuzz (/ ss1 entLine objType oldcmdecho oldpeditaccept fuzz okObjects); r' k! \! S6 v: T
(setq oldcmdecho (getvar "cmdecho"))
$ u2 p8 D6 B5 l (setq oldpeditaccept (getvar "PEDITACCEPT"))$ e) I1 ?8 ^: g3 H" z# k
(setvar "cmdecho" 0)
5 y' B0 ]5 T3 M f+ c) z (setq A2k4 (>= (substr (getvar "ACADVER") 1 2) "16"))0 E; X7 g& N3 Z) W" r/ T, u, o
(if A2k4 (setvar "PEDITACCEPT" 0))
0 x/ P2 L6 q4 C, k( S* d0 \ (setq okObjects '((0 . "LINE,ARC,POLYLINE,LWPOLYLINE")))) O$ i: {3 X; \
(princ "\nSelect object to join: ")
4 f; V" b$ M) }, ~ Y (setq ss1 (ssget okObjects))
- f5 V, e' K1 w" e8 ~3 D9 z (setq fuzz (getdist "\nFuzz distance <0>: "))3 b+ b6 ?# I# B9 s- g9 h
(if (= fuzz nil) (setq fuzz 0))
1 f2 g& }. e% B z (if (/= ss1 nil)* Y- u4 y* M; [* w
(progn2 b6 i; X- b* o& w
(setq objType (cdr (assoc 0 (entget (setq entLine (ssname ss1 0))))))
% K d) D# y5 }' J5 q (if (= (sslength ss1) 1) (setq ss1 (ssget "X" okObjects))); k" r, `+ F+ N4 `1 I: ]! W' @# j
(if (member objType '("LINE" "ARC"))5 R, j9 ~; W* _% E
(command "_.pedit" "_M" ss1 "" "_Y" "_J" "_J" "_B" fuzz "")7 k& S6 M" ^, ~$ C
(command "_.pedit" "_M" ss1 "" "_J" "_J" "_B" fuzz "")
# o" t% f. I- J8 e( ~ )
6 ]' i- B8 J6 ~7 J: v )* i3 [- \' n* h' ]" {$ p
)( ^1 S+ U0 a: c, ?7 t8 C6 y5 p
(setvar "cmdecho" oldcmdecho)& O$ R7 E$ u/ c. |) _8 h0 [& ^
(if A2k4 (setvar "PEDITACCEPT" oldpeditaccept))
4 I2 T8 N+ j3 V1 \% ?+ M" a (princ)
- z% O) o* o( r7 W, A)- B7 X# ^) s0 k$ V4 ^
! v+ \8 B! v- x;===========================VE CAO TRINH===========================+ L- Q- i# \0 v7 Y, g
+ a& Z( Q0 _$ w! |(DEFUN C:Cotcao (/ CMD PT1 PT2 PT3 PT4 PT5 PT6 PT7 PT8 NPI TX DX DY TL OSM OLL
3 K6 O7 H& U7 I6 y3 |2 y CRST RSIZE TSIZE STR PRMT FCH NBC OLDERR), W3 C3 u5 R- v8 a6 @7 T% i
(SETQ OLDERR *error*# g. ]0 t: f. B5 ~& v2 n
*error* loisb)3 s* D' S4 ^6 m4 D4 V6 {
(command "layer" "m" "dim" "c" "" """")0 |: X z2 z* |3 E8 J
(SETQ CMD (GETVAR "CMDECHO"))8 `+ d5 N5 s6 K' E# d& P
(SETQ NBC (GETVAR "CLAYER"))- W) }6 Z' |6 m$ d0 t. L) Q" Z
(SETQ OSM (GETVAR "OSMODE"))
+ o1 h. r0 d/ t8 J(SETVAR "CMDECHO" 0)
! p& n& b9 @, a, g6 \' g' R(SETQ PT1 (GETPOINT "\nDiem cao trinh:"))
4 M7 _. e1 q) m `(SETQ TX (GETSTRING "\nCao trinh:"))
9 [1 ]& g; A0 Z6 E. f5 h8 Y2 C4 E) f(SETQ FCH (SUBSTR TX 1 1))
8 e+ z. N+ y8 |) z* @' A' k z9 N( J: i(IF (= FCH "@") (SETQ TX (STRCAT "%%P" (SUBSTR TX 2 (- (STRLEN TX) 1))))). C p6 a4 e( z X ^3 m* \
(SETQ CRST (GETVAR "TEXTSTYLE"))3 c9 u/ o% }' K% G& a/ M
(SETQ RSIZE (CDR (ASSOC 40 (TBLSEARCH "STYLE" CRST))))
4 B9 R, {+ q1 @- {7 Z(SETQ TSIZE (GETVAR "TEXTSIZE"))
; [2 G3 x+ T. w; o5 r2 x% r(SETQ STR (RTOS TSIZE 2))7 @# F M. \. v# o& e7 g
(SETQ PRMT (STRCAT "\nText height <" STR ">:"))
) ?8 f7 v$ o9 A, H' K7 l(IF (= RSIZE 0)# `; ~0 {1 L6 O) t6 R& R% g
(PROGN8 E% W7 f& q+ e* o
(INITGET 4)
5 v' j4 I, h: q8 T: M* Y (SETQ TSIZE (GETREAL PRMT))9 h# Q. O+ [& o1 y) }2 f9 V
(IF (= TSIZE NIL) (SETQ TSIZE (GETVAR "TEXTSIZE"))
& l- z, v0 U6 U (SETVAR "TEXTSIZE" TSIZE))
8 }1 k5 p% _$ Q! T4 E, H0 h v )
" G8 k7 R7 W; O+ l5 |3 I, \5 j5 [0 y)# `0 D: q! K2 D2 _) }# c
(PRINC)$ c$ d% L* Z4 w1 E3 |% M6 b
(SETQ TL (/ (GETVAR "TEXTSIZE") 2))
- t. D- K9 h+ o1 P& j(SETVAR "OSMODE" 0)
" T4 y6 S; _9 r: L' W( I(SETQ DX (CAAR (CDR (TEXTBOX (LIST (CONS 1 TX))))))) g7 L6 Y4 s! U; p* U
(SETQ NPI (/ PI 2))
9 K K/ O N- F(SETQ PT4 (POLAR PT1 NPI (* 1 TL)))8 y) \; M/ |+ S3 L& Q3 N; K# U- j2 `0 U
(SETQ PT2 (POLAR PT4 PI (* 2 TL)))- h7 u7 z) Y3 a( r
(SETQ PT3 (POLAR PT4 0 (* 2 TL)))
! [8 ^2 ~) M) p Q2 i(SETQ PT5 (POLAR PT4 NPI (* 5 TL)))1 v# {! x; D6 l- |3 l
(SETQ PT6 (POLAR PT2 NPI TL))
$ @& L2 t" H% g+ }- R- y9 {(SETQ PT7 (POLAR PT6 0 (+ (* 3.7 TL) DX)))
& X% {2 L8 |' } U( z(SETQ PT8 (POLAR PT6 NPI (* 1 TL)))
8 T/ j6 f3 T# h* i4 m/ [* W+ H(SETQ PT8 (POLAR PT8 0 (* 2.5 TL)))% f2 o( O `* `3 S& Q
(SETQ PT9 (POLAR PT1 pi (* 2 TL)))
2 [. ~8 `. S) ^$ q- k" [(SETQ PT10 (POLAR PT1 0 (* 2 TL)))6 w- @9 x. t+ J j
(COMMAND "COLOR" "7" "")
# g$ t" ]- O" ]1 k( l: P(COMMAND "STYLE" "COTES" "tcvn3italic,vnh.shx" "" "1" "0" "n" "n" "n")4 r& N1 e ~2 A2 e
(IF (= RSIZE 0)(COMMAND "TEXT" PT8 TSIZE 0 tX) (COMMAND "TEXT" PT8 0 TX))
' a, |% G) l* U(COMMAND "COLOR" "BYLAYER" "")
4 k' ~, N2 F2 M' `; Q(COMMAND "SOLID" PT1 PT2 PT4 "" "" "pLINE" PT1 pt3 pt2 "")
( y. c: t6 \) U& G: |* K(COMMAND "COLOR" "BYLAYER" "")& U3 m7 Z K5 t1 K2 i
(COMMAND "pLINE" PT1 PT5 "" "pLINE" PT6 PT7 "" "pLINE" pt9 pt10"")" s/ ], @0 w- B6 Q$ ~
(SETVAR "CLAYER" "0")1 ^6 b0 [: w/ Y' K
(command "ddedit" pause)
3 b" ?! x; C2 A(COMMAND "COLOR" "BYLAYER" "")
; N7 d+ [. y4 z(SETVAR "CMDECHO" CMD)9 h, e5 s0 K' r0 A% g
(SETVAR "CLAYER" NBC)
$ w9 C8 ?) V4 j+ j. q1 p(SETVAR "OSMODE" OSM)
! E. c) w: l! e6 G& u0 V(PRINC)
0 [8 s) T B7 I# _2 q8 Z; R), `4 u; _% D, y! }7 B
1 j# H: M' k- U;;; =========================== VE NET CAT CHEO (GC) =============================* k1 t% j: e7 w i$ Y2 x u, g
4 |1 H g) F" I& E3 f3 _(Defun c:G1(/ p1 p2 p3 p4 p5 p6 p11 p12 l ang)
$ h" _) _ D/ Q$ ? (setq x (getvar "osmode"))3 @$ \0 W0 u# b0 o, o
(setq p1 (getpoint "First point : ") k+ \8 Y# i; W: F7 T- S# g' }
p2 (getpoint p1 "Second point : "))
0 l/ j5 a' v" Z/ j (setq l (distance p1 p2))! N4 H% T- |0 @3 _! w8 O$ _+ l: R6 a7 J
(setq p11 (polar p1 (angle p2 p1) (/ l 5)); a& {% t) C7 a8 y( ? B0 l+ U
p12 (polar p2 (angle p1 p2) (/ l 5)))
( g2 @/ S0 H1 _! ?- o (setq ang (angle p1 p2))
. ~6 Y7 ?& ?3 P3 Y' B2 C (setq p3 (polar p1 ang (/ l 2.5))& ]% h( e# [* g
p4 (polar p3 (+ (/ pi 2) ang) (/ l 5))
' X% Q% e( y5 S% X6 k1 T7 r p5 (polar p3 ang (/ l 5))
4 s* t$ p' A; A0 n4 N8 s1 D6 d" i p6 (polar p5 (- ang (/ pi 2)) (/ l 5)))
- X9 f$ ~$ ^) }( e# b (setvar "osmode" 0)- i1 s# |# d5 y" q% _3 _8 q& V8 R# b
(command "pline" p11 p3 p4 p6 p5 p12 "")
, c5 M$ t) {( `6 ~* |0 a H (setvar "osmode" x)
: `. v- f4 [; X ?)
1 r. J4 j: U6 K. k6 g;----------------------------------------------------------------------------------( J) _; o% f1 @! {
(Defun C:G2 (/ ps1 ps2 pf1 pf2 pf3 pf4 pf5 pf6
5 M! M4 \& f ~0 @" n7 t7 ? s pf7 pf8 sb sh se ang old_osmode); (setq old_osmode (getvar "OSMODE"))& m+ v* @7 b1 B' ?: y% U
(setq ps1 (getpoint "\Chon diem thu nhat: ")): F* R- w* v6 d/ g
(setq ps2 (getpoint ps1 "\nChon diem tiep theo: "))% B7 y4 S7 z( R* o
(setq sb 50.0 sh 200.0 se 20.0); { v# X: v0 K1 E5 z! ^7 v
(setq ang (angle ps1 ps2)) ^. V* `& P! g% a" {: r$ R
(setq pf1 (polar ps1 ang (- 0.0 se)))
% t) H5 Y, |$ [9 F# X C (setq pf2 (polar ps1 ang (/ (- (distance ps1 ps2) sb) 2.0) ))
7 C6 C$ l1 b0 _" S* x5 F9 g) q (setq pf3 (polar pf2 (+ ang (/ pi 2)) (/ sh 2.0)))
) c; z& J* |7 U& m. b1 z; g, A* u (setq pf5 (polar pf2 ang sb))
$ _2 t9 Z; ?) J2 L (setq pf4 (polar pf5 (- ang (/ pi 2)) (/ sh 2.0)))
% U* J, B2 f' A5 { (setq pf6 (polar ps2 ang se))
3 o; G/ w& U. ?. Q, } (setvar "OSMODE" 0), K% _1 W3 G2 `5 \
(setvar "BLIPMODE" 0) e# N) r1 e3 `; ]
(command "PLINE" pf1 pf2 pf3 pf4 pf5 pf6 "")
n5 H( _- |% J# D/ l& Y (setvar "OSMODE" 703)) u! j5 X9 U5 v9 t# `, m; q# H
(princ) )
; o6 Y: l! {: C, j9 u9 R;----------------------------------------------------------------------------------: O; z- g1 `" ^( k: p8 D7 k
(Defun C:G3 (/ ps1 ps2 pf1 pf2 pf3 pf4 pf5 pf6
& ~/ s! h6 x+ ~% D, p5 v# M pf7 pf8 sb sh se ang old_osmode); (setq old_osmode (getvar "OSMODE"))" ]/ V: E8 X: b/ u; f. U5 Z q
(setq ps1 (getpoint "\Chon diem thu nhat: "))
* Z$ Y3 |: E5 b5 D8 i (setq ps2 (getpoint ps1 "\nChon diem tiep theo: "))' U; G! W1 H! t, L; C
(setq sb 100.0 sh 150.0 se 20.0)
6 v) ~2 U) A! h (setq ang (angle ps1 ps2))
2 C ~* T. H& Q8 w' R2 a (setq pf1 (polar ps1 ang (- 0.0 se)))
) N8 }6 q' i* c$ T- Y3 E; |3 R (setq pf2 (polar ps1 ang (/ (- (distance ps1 ps2) sb) 2.0) ))
/ R! G& v7 t& \5 x# ?" Z, ] (setq pf3 (polar pf2 (+ ang (/ pi 2)) (/ sh 2.0))), {2 u2 A' d" W- A/ a
(setq pf5 (polar pf2 ang sb))
" I j5 y0 _, t4 B. Q (setq pf4 (polar pf5 (- ang (/ pi 2)) (/ sh 2.0)))( n7 W4 j: O0 ~ L
(setq pf6 (polar ps2 ang se))
$ D4 k$ y; h! ] (setvar "OSMODE" 0)
( F0 H+ O5 F: \( I (setvar "BLIPMODE" 0) ^$ C" k$ M' ^5 C4 f
(command "PLINE" pf1 pf2 pf3 pf4 pf5 pf6 "")
; @0 l+ `5 D" O$ ^3 N (setvar "OSMODE" 703)
- P0 ]% M& V" O, W" e" E7 S (princ) )5 E* V. ?5 ]: O% n- L$ r) K2 m
;----------------------------------------------------------------------------------
, S% b0 O4 n1 A(Defun C:G4 (/ ps1 ps2 pf1 pf2 pf3 pf4 pf5 pf6
% [: |+ O$ w6 [8 ?! n pf7 pf8 sb sh se ang old_osmode); (setq old_osmode (getvar "OSMODE"))- @7 m* F$ W1 u3 C( x
(setq ps1 (getpoint "\Chon diem thu nhat: "))! U/ z+ o3 M5 M- P" V7 P/ e
(setq ps2 (getpoint ps1 "\nChon diem tiep theo: "))
% ]# U' x& c+ `$ b( b+ K (setq sb 100.0 sh 250.0 se 20.0)2 x2 o# u0 N/ J! q
(setq ang (angle ps1 ps2))
# I, S3 H, ^8 ?$ i6 k% b (setq pf1 (polar ps1 ang (- 0.0 se)))
6 J- G# S; P' F1 R( T4 m- u( z (setq pf2 (polar ps1 ang (/ (- (distance ps1 ps2) sb) 2.0) ))
1 f# U( L2 n, ~/ b/ Y L- Z: } (setq pf3 (polar pf2 (+ ang (/ pi 2)) (/ sh 2.0)))0 f) _6 V7 j) N- Z- x+ N/ ^
(setq pf5 (polar pf2 ang sb))
4 k' q; T- _3 K7 w, K4 p (setq pf4 (polar pf5 (- ang (/ pi 2)) (/ sh 2.0)))
- n1 U: O0 Y. Q. p (setq pf6 (polar ps2 ang se))/ P D7 J# |/ u3 A }+ e# d/ Q
(setvar "OSMODE" 0)
/ f# H9 K0 b) g" ?; Y# S, R (setvar "BLIPMODE" 0)
, ]0 \ R6 o: e+ d5 L (command "PLINE" pf1 pf2 pf3 pf4 pf5 pf6 "")) ]" M6 T% R9 G3 y. S2 A
(setvar "OSMODE" 703)
$ m) X% x& u. P# ~5 B (princ) )
+ q5 H& I3 e4 P: h. V% l$ i% J
! s0 P& s I3 L& E;==================================================================================/ Y$ ]' S( Z; i+ f
(defun c:ang (/ ent pt1 pt2 ang)% f$ S$ d: ^+ K Z0 Z
(setq cmd (getvar "cmdecho"))
/ n: Y' l, R. ] (setvar "cmdecho" 1)
# o* Q# A6 [0 N (prompt (strcat"\nThay doi truc toa do theo duong thang chon truoc"))
& n% x$ l# K7 L. A/ b6 G (setq ent (entsel "\nChon duong thang:"))7 q, q. D4 V( q+ A! g# s! y
(if ent
) [3 X+ }! \, e$ F (progn) u1 k7 }4 n8 ]. I2 g5 l
(setq ent (entget (car ent)))
) \- B Q1 e' ~ (setq pt1 (cdr (assoc 10 ent))); s6 C: y$ E. J$ t
(setq pt2 (cdr (assoc 11 ent)))+ c, j2 m5 j/ `" e. C: F- {( W
(setq ang (angle pt1 pt2))+ o; h' G- w" w
(setq ang (/ (* ang 180.0) pi))
& h% C! m8 j) g' o$ a (setvar "cmdecho" 0)7 M D' |' ~5 ]' }/ D
(command "setvar" "snapang" ang)+ A1 q. ^3 I7 O7 B1 N
(princ "\nGoc cua truc toa do moi : ")
, d* l/ H. I R (princ ang), H1 z- a5 O& \" \/ v
)' u' x5 q5 c. F9 H
)
' c7 k1 ]. C ^2 o8 ?6 W (setvar "cmdecho" cmd)
1 m" L8 o/ u' ~ (princ)- m0 Q( v0 B# U! b) Q; K
)
' b/ t3 V& b5 r% S( M2 g O* {;==================================================================================7 F; \! e4 y+ W: F- e7 n
;============================== KY HIEU DOI XUNG ==============================
* l$ y3 W) }! f3 |) Y7 B8 W |;==================================================================================
+ S8 T2 |( j- b! g$ |
) F$ F3 o1 t w1 K3 N; O(DEFUN C:DX (/ CMD OSM OLDERR PT1 PT2 PT3 PT4 PT5 PT6 PT7 PT8 PT9
: b% ]6 ^! w4 [, |7 I, E* O SZ G45 G135 G90 G180 SS loi)& [% @ m' @8 G0 U# R6 c
(defun loi (s)8 g% e2 }! ^+ F& s' P9 o5 n
(if (= s "Function cancelled")
* | \# O% J0 M' C, ?6 b (princ)
9 M1 N4 W1 e: q }' y5 x" d# } (princ (strcat "Error:" s))
$ q* L8 `5 U0 s2 Q" b )
* K& y" v9 K C7 P* B) s0 E x (SETVAR "CMDECHO" CMD)
. G+ [9 V3 V. F& H" [ (SETVAR "OSMODE" OSM)/ R1 D/ Z+ a8 y, R8 a1 C
(SETQ *error* OLDERR)
, W8 N- E2 R$ A4 R) N7 G (PRINC)
' O+ {7 \- Y5 u)* O* e I: v# c* |; v5 C
(SETQ CMD (GETVAR "CMDECHO"))# T8 S* K; s7 Z1 L1 Z$ f
(SETQ OSM (GETVAR "OSMODE"))1 R8 t# `! \$ U- h9 P; [
(SETVAR "CMDECHO" 0)
- C6 A3 c+ T* ]% @& r2 l (SETQ OLDERR *error*
( i$ U3 |2 N7 z8 k0 j" e9 [; X *error* loi)
4 I! }: V( R0 [% Q& E0 R a (SETQ SZ (GETREAL "Size <1>:"))/ @+ h; r/ y" S4 Q2 Q. ]$ Q8 }
(IF (= SZ nil) (SETQ SZ 100))2 A) r, f5 c- p9 A1 j$ n
(SETQ G45 (/ PI 4))0 p, c6 K! m+ n" W- g9 {. `
(SETQ G135 (* 3 (/ PI 4)))
8 a S5 c R1 e/ }8 M% o8 G" { (SETQ G90 (- G45 (/ PI 2))), I. t6 x( S, [/ ^
(SETQ G180 (+ G135 (/ PI 2)))" p3 j2 C+ p3 e8 K5 J
(SETQ PT1 (GETPOINT "\nDiem doi xung:"))
! N/ V3 l; n. t2 s. C K (SETVAR "OSMODE" 0)' m( d ]8 q' x2 V
(SETQ PT2 (POLAR PT1 G45 (* 2 SZ)))1 H3 E/ I4 o8 w. L0 Y7 \- ]
(SETQ PT3 (POLAR PT2 G90 (* 2 SZ)))
3 v4 W( z- `9 d4 }3 W/ N (SETQ PT4 (POLAR PT1 G45 (* 1 SZ)))
- \& s: t/ M/ Z (SETQ PT5 (POLAR PT1 G135 (* 2 SZ)))( Z$ R7 h$ B9 \3 g9 O
(SETQ PT6 (POLAR PT5 G180 (* 2 SZ)))5 j7 J! I% Q8 k
(SETQ PT7 (POLAR PT1 G135 (* 1 SZ)))
: |) L) z b. ^9 b (SETQ PT8 (POLAR PT1 G45 (* -0.7 SZ)))
: X& m) P: ], Y$ e4 T& w+ X (SETQ PT9 (POLAR PT1 G135 (* -0.7 SZ)))8 w- ^. X% L+ d& b
(PRINC "\nGoc quay:")1 Z) X- e4 w7 C& e) W8 F; Y
(SETQ SS (SSADD))
) z6 z. l8 k, o2 o(command "layer" "m" "Dim" "c" "" """")! j _* z2 A* T. M
(COMMAND "COLOR" "1" "")
6 j( i( F: d$ m* _# g. K* w (COMMAND "LINE" PT8 PT2 "")0 M) N8 d) T& `8 B8 G% A( {
(SETQ SS (SSADD (ENTLAST) SS))
' a h! S9 P8 O/ V4 y5 y3 k (COMMAND "LINE" PT9 PT5 "")& g& j6 a: d+ Q6 V+ V' Z
(SETQ SS (SSADD (ENTLAST) SS))5 O" ? N+ V3 a' c+ ` d4 [ }# w
(COMMAND "COLOR" "1" "")4 f& K! h+ @3 z0 M6 N
(COMMAND "SOLID" PT2 PT3 PT4 "" "")
4 W8 B5 k* r7 h2 f: f (SETQ SS (SSADD (ENTLAST) SS))
# u( N+ @7 Z `4 S7 } (COMMAND "SOLID" PT5 PT6 PT7 "" "")( {4 R% C, f" H9 q2 L
(SETQ SS (SSADD (ENTLAST) SS))
U8 @9 Y5 c" S/ |* w4 y. H (COMMAND "ROTATE" SS "" PT1 PAUSE)4 ~; m+ v- p+ N! m! d# g* v
(COMMAND "COLOR" "BYLAYER" ""): L1 u8 S7 g, B5 k' s* [
(SETVAR "CMDECHO" CMD), T" g% A4 s" Y) i9 p( V) I0 G
(SETVAR "OSMODE" OSM)
" T' d; x+ b! \ (SETQ *error* OLDERR)2 }8 o2 U' }8 ^. Z3 z7 f
(PRINC)& a8 H- d5 i* m! X6 G
) D. P r. w) K6 d- w
$ p, C" O% s7 J
;==================================================================================
7 O: A2 ^4 M( T1 W3 f4 n4 m: C6 n;================================= KY HIEU TRUC ===============================, P5 m- X" j3 a8 T. @: j
;==================================================================================
! {0 Z! R, |" I2 \7 d( o9 J0 w
! N9 f& l, p4 Y$ v5 w: ?(defun C:vetruc ()( \( u7 y3 c- X4 K: }& ?$ w4 @4 K& p
(setq bk (getvar "USERR3"))+ @9 g: y$ g) U: C$ S6 Z$ O
(if (= bk 0)
. q. a/ ]) \: X' a7 B2 m8 \ (progn$ d) b$ |( v4 C/ K2 c5 ^6 V, N
(setq cont "1")
9 D' v& U% I, U: I, W (setvar "USERR3" 1)( r, P1 P5 u" W3 e% y" G9 r7 M
)9 k7 }+ q7 a: L) F: K# ^. G
(setq cont (rtos bk))
# B. O4 C0 \6 _3 O7 a) W8 A)( @, m1 ~- }, e! R
(setq pt1 (getpoint "\n Nhap diem dat:"))# Z0 h& C$ u; r3 H( ~$ x
(command "layer" "m" "Dim" "c" "" """")6 s* J1 ]& Y4 ^' o7 H: P+ r; c- _
(command "osnap" "")
# r$ k1 h4 z7 O(COMMAND "COLOR" "7" "")
; e4 B/ T1 A' h# |(command "circle" pt1 150 "")4 t7 u: K4 N6 T: n9 G/ U j1 L5 v
(setq pt2 (polar pt1 0 150))' B3 D2 l+ z9 `. ?' m8 \% O
(setq pt3 (polar pt1 (/ pi 1) 150)). }* z% p- h: E2 X- B+ A5 A9 P
(setq pt4 (polar pt1 0 300))
@" b2 ~" e! ^(setq pt5 (polar pt1 (/ pi 1) 300))
0 s _/ G" h; }4 L; O o1 C(setq pt6 (polar pt1 (- 0 (/ pi 2)) 150))& D8 G8 U: {; l, A( }; r% w6 Q
(setq pt7 (polar pt1 (- 0 (/ pi 2)) 300))# h$ N0 {+ z8 X* _9 U8 H
(setq pt8 (polar pt1 (/ pi 2) 150))
3 c7 \! d+ ^& d) H9 e$ S(setq pt9 (polar pt1 (/ pi 2) 300))
6 m5 D. M" [# d: |(setq pt10 (polar pt1 0 150))% ]0 w$ b9 H6 ]: _3 S p1 @
(setq pt11 (polar pt1 (/ pi 4) 150)) H- @) z2 [/ F0 J3 y( C
(COMMAND "COLOR" "BYLAYER" "")
! i$ k8 _4 n2 A" U E( s9 e(command "line" pt2 pt4 "")
* U3 o9 [, S/ w- a(command "line" pt6 pt7 "")
- |- Y" i- D) T9 n4 k. L% D(command "line" pt3 pt5 "")) d( i) F( @! E3 P5 `! b$ }
(command "line" pt8 pt9 "")
# v, `! E9 e# u, r& R(setq dk (strcat "\n Size:<"cont">")): n7 ^6 {* _& k5 E* L4 @
(setq bk (getreal dk))5 Y9 z$ s- \+ T7 e
(if (= bk nil)
/ |* Q' e) R4 B3 i, }$ X (progn
, N" J: \! R- c( _ (setq bk (getvar "USERR3"))3 ~9 X j, a$ V( O8 ]7 ~
)
2 k$ y( l' p& t+ o. g% j/ H8 v (setvar "USERR3" bk)
' N0 E1 D' W" U7 W- S )/ [2 `! s& T( I/ y8 l0 S/ u4 J
(command "scale" pt4 pt5 pt7 pt9 pt11"" pt1 bk"")
1 v) t; I; O* h; s: @0 ^(COMMAND "COLOR" "7" "")
6 t9 b1 a& n& }% p(COMMAND "STYLE" "Truc" "impact" "" "" "" "" "")
" `6 u' O' P# K0 d- o9 U( |(command "text" "j" "mc" pt1 (* 150 bk) pt10 "A" "")
8 u5 E% S9 N2 o/ T(COMMAND "COLOR" "BYLAYER" "")
' j9 ]# u6 i8 l: t; V4 V `# z)) e8 E ^- N( w, M% R- n
' j. }" k4 H7 C' _4 V) w$ G
;=====================================================================3 x6 G s1 g* o
;CA - Reverses the case of text. (Upper to Lower and Lower to Upper.)
3 ]) z; C4 Y8 ~! L;
1 J+ {% a P* y;Jeffery P Sanders! ]8 Z2 D" I. X
;4 v1 B2 Y# A+ j5 ^! g9 s/ h
(defun C:CA(/ en enlist tx newtx cnt tp asc note)
/ K- l" h, j; m) F$ _ (setvar "cmdecho" 0)
[& N- D9 D) I. M1 ]7 d (if(setq en(entsel))
2 S) v% x3 v8 v& L8 W (progn1 Y7 r7 ?1 f: J. y$ p q. b; }
(setq enlist(entget(car en)))
0 q9 d+ r4 O6 B8 x# V (if(= "TEXT"(cdr(assoc 0 enlist)))
) ^0 ~5 G; M& \ (progn: B- e9 w/ Y7 e
(setq tx(cdr(assoc 1 enlist))8 B7 z1 b6 u. j
newtx "" cnt(strlen tx)7 J0 I0 @" U' Q9 c, ]# _3 ?/ [9 r$ r
note "\n...CASE Reversed. \n "6 x# k) E* W' k) k* h
) g. j: B) c" S- S/ v2 C/ t6 ]9 a
(while (> cnt 0)8 p$ \. l) H% K- i' x
(setq tp(substr tx cnt 1))) t7 ^; M, `" C1 I0 c
(setq asc(ascii tp))
8 N- b& i2 Z/ P (if (> asc 96)
) ^* w8 w) w3 S( \ (setq tp(strcase tp))
" \9 w' a9 {. K6 ?; h$ X2 ] D$ s8 { (setq tp(strcase tp T))
& v4 `1 J; _! [ L )! p( I0 L2 J0 g$ c% y! k
(setq newtx(strcat tp newtx))
2 w5 I) x3 n& t$ l* q (setq cnt(- cnt 1))
) Q. i' k; _+ u. s9 Z( P, o0 B )) z/ ~6 T' Z8 H) p
(setq enlist(subst(cons 1 newtx)(assoc 1 enlist)enlist)). G. @+ i0 N. J! d/ x$ z
(entmod enlist)+ r, S8 A4 n$ ~& w: v
)
3 j3 `5 S7 _5 B7 F) ` (setq note "\n....Text Only Please. \n "); H2 A, R) X& H( Q! @( m2 A
)
4 T- T, Q% w$ |4 ^$ z5 m ) x* k5 U# v/ V7 E- X0 [5 m
(setq note "\n....Nothing Selected. \n ")- P9 J+ S7 ?# ~2 w9 X! }
)+ m1 f/ @: s- q3 e7 y/ ?( x
(setvar "cmdecho" 1)9 E3 ^) n6 G2 {! K: q" W
(princ note); a9 M/ l( j3 o% ?! b
(princ)# t% m, n! F+ L+ B& [
)
7 H/ t0 e+ c2 E2 }) G. Q( p5 j8 `* \0 {- ?0 K- u x# Q' a
;=====================================================================
8 A! ~3 R7 |% O0 r5 U6 t;==================== NEW TEXT STYLE UPDATE ==========================5 B5 m f: t5 `4 M' N9 R
;=====================================================================
* s, f3 p+ q" c3 T/ a; I+ p& l& @: n! Z( f& I3 O
(defun c:nS (/ tdt ssdt sodt index)9 M* S& G# j) }, U0 a B& h" m! e
(defun ObjName (ssdt /)
* \( h, Z0 [. U' O Y(cdr (assoc '0 (entget ssdt)))3 Z0 `' D. K. O- g
)
0 k, G3 J, s3 ~' i+ `. @/ I; C4 z(defun MoPL (ssdt /)7 b( Z3 t+ u' J9 o
(= (cdr (assoc '70 (entget ssdt))) 0)
1 l; G/ y! j! x b) {)4 Y9 Q& u# T" J, o/ }( R1 c7 f
(defun NoiPL (ssdt /)% \ _" O' d* }: E7 R4 s
(if (MoPL ssdt)
8 E7 v; p3 C8 R) A) q0 ?(command ".PEDIT" ssdt "J" "All" "" "X")4 N. S6 K4 u3 Q6 ^1 r
) O/ ^$ v; r) U$ e# C7 p5 Y' H
)
; q- S) X+ B t% m/ k0 w( Q) w(defun NoiLC (ssdt /)- X: g( m5 Y; A2 B/ u T* z1 u2 \
(command ".PEDIT" ssdt "Y" "J" "All" "" "X")/ d W; f4 ~5 @
)9 V: b0 _8 ^7 Q% E/ r. ]" V
(setq s0 {: |+ u" T0 C
tdt (ssget), T9 \4 Q0 L! o, ]' W
sodt (sslength tdt)
8 L/ |$ Q& p" y+ dindex 07 g8 W9 h0 D. P9 f& B
)
/ F6 N/ F9 o! a6 K( H3 _: k2 c(repeat sodt1 p9 Z" l6 g6 I5 Z% p+ C6 W8 M6 t
(setq
8 n9 z: C* a I4 b! h, Issdt (ssname tdt index)
$ T: i7 A {2 Z o9 e, i, ] k9 m1 @7 Kindex (1+ index)
2 q4 G' C' Z$ V {% b- Q6 r f& G8 o)
4 L: u- {) I1 H7 O# m. T/ A# ^% z(if (or (= (Objname ssdt) "LWPOLYLINE")) o' ^8 M; U+ O8 |/ [
(= (Objname ssdt) "POLYLINE")
+ S2 R; r& `8 c- R( B1 [)
2 t; r! u* n) A0 ?0 g(NoiPL ssdt). j: W: T, V7 o' J( l
)5 y* @# }( j( B0 \
(if (or (= (Objname ssdt) "LINE") (= (Objname ssdt) "ARC"))# E: N- p d1 L. z8 o$ @8 `
(NoiLC ssdt)
2 D8 [$ D+ Y) \% x' `( B), _- ~- T* b x2 P }1 @ I
)( q/ u* f- C* X+ J: @$ X
(princ)9 x+ k& U0 a) b4 p3 L6 r) `
)% g* h9 E7 @% _$ j( y6 _
/ J) S U/ @# X, P5 m, i7 J" Y4 l5 K U;=====================================================================; f6 S* B h" }% Z4 k
;;; AREAM.LSP8 P# z' @4 K& a
;;; Function: Calculates the total area of selected objects( K# X8 y5 z2 u
;;; By Jimmy Bergmark4 ~6 t$ e' ]" m# X7 U" X/ M
;;; Copyright (C) 1997-2006 JTB World, All Rights Reserved
k) M. I1 N9 m4 t# |! Z;;; Tested on AutoCAD 2000
( I! y/ s; @0 K7 i/ [) M1 C) w( v# B5 B& a2 T5 K) Z
(defun c:ea (/ olderr oldcmdecho errexit undox restore ss1 nr en tot_area)
: E9 A4 N3 ^6 ^, C% Z7 G (defun errexit (s)$ O2 K0 K* j9 @$ q- k1 n
(restore)
1 Y0 }8 ]& i" @3 \) u0 s4 P )# y S( n8 ^8 Y& P. P, q" l
& l& |6 ?* Y9 J: W' v9 W (defun undox ()
g8 o( O+ x$ i' B/ j3 }$ v (command "._undo" "_E")
) `: ]) k: f8 ~* f- t! P6 J4 O$ y+ Q/ } (setvar "cmdecho" oldcmdecho)
& U3 B4 c$ H% b# I# m) s* A% r8 _4 U (setq *error* olderr)2 I, r7 }4 l0 `# b- ~2 n; U; h$ m- l, E# W# R
(princ): J8 a3 Y* ^/ q) E
)
: x8 V4 @1 ]$ c* K3 q1 M* ?! k# g- e- u
(setq olderr *error*
+ [- X+ \* b6 @: z restore undox
0 l+ K. _# A g *error* errexit6 U6 w; i% B. a7 r, n$ K8 S- e4 @
)
8 f. H1 x+ k6 ?' N (setq oldcmdecho (getvar "cmdecho"))8 C+ k' c9 k; r; ^
(setvar "cmdecho" 0)( k0 F) ^7 e% l& ^ x
(command "._UNDO" "_BE")
* k6 S7 D6 N+ N2 X (if (setq ss1 (ssget '((-4 . "<OR")& M( \/ r7 X: f, _0 ^) z. y
(0 . "POLYLINE")( S* h8 d. V: |
(0 . "LWPOLYLINE")2 a5 Y# o; K8 ]8 J: @% R! L$ A7 i8 s
(0 . "CIRCLE")( A0 y2 c9 a# ^* }- Y3 z
(0 . "ELLIPSE")
5 M1 H2 F8 r- ]/ p: }5 d A (0 . "SPLINE"), k& A! n; H. i) y, Z2 m6 ]6 ?$ |
(0 . "REGION")
b" ?/ |& [- q3 f (-4 . "OR>")
5 ^0 I6 z% A* Y2 c' A# F/ Y0 | )7 ~1 D, i N1 r0 E
)
: k# T$ V \, F* X* j7 A9 U, h" \% _ ). i6 q* l" g; _; A; v( ]& h
(progn
8 {' E: O- O+ G! Z9 B0 S$ n (setq nr 0)
P9 _- A1 n! g u2 F1 ~# g (setq tot_area 0.0)
- V7 z7 E- _$ L! ^! ` (setq en (ssname ss1 nr))" ?0 O$ J0 D; b
(while en$ W. y9 M0 W0 a5 o6 d
(command "._area" "_O" en); u0 i: t0 u) _ q( N$ q" e
(setq tot_area (+ tot_area (getvar "area")))3 Q! T1 j, _7 ^0 ~7 D* X
(setq nr (1+ nr))2 I6 i- D( x1 @: A& N
(setq en (ssname ss1 nr))8 F- W* n- S# y* z
)
2 |" z9 q$ |, t* u (princ "\nTotal Area = ")
0 D8 ?( G9 [4 Z0 E1 Z# V (princ tot_area)
# K0 B% w* j R7 T9 s+ m3 @' S ); N$ f/ f' p( {6 ?1 L' G/ t, u0 }, M
)
3 `0 Z0 W$ e7 \% W (restore)7 [1 @# W$ g" |" P7 _0 u
)0 i2 H5 [1 O! k' ~. h8 t
5 D7 o$ Z! B2 }1 F3 q: t' t;=====================================================================
" D( x* D; W% F: P+ p# ^0 T;;; By Jimmy Bergmark
, L& b a& A( S. M- ~( l;;; Copyright (C) 2008 JTB World, All Rights Reserved
. w( X0 P$ _* _* i8 v;;;
8 w4 L1 S, _. [) f& V;;; Created: 2008-03-31! ^7 S0 P! Q4 P/ ?7 K
;;;/ ^5 m; _4 \# m
;;; Convert Attribute definitions to mtext. w. [7 N' m/ s
;;;
' j( J5 R7 F- r8 i0 y0 Q6 s* l6 N/ w' m$ `& {
(defun c:ATB (/ eset1 blkcnt en enlist tag1 ht pnt vl space)2 t! ^5 _/ f" m9 ^( W+ t T
(setq eset1 (ssget (list (cons 0 "ATTDEF")))1 f6 d% b+ s9 e" u8 }5 n) K8 C1 ]+ \
blkcnt 06 g) I; r; l8 i, y
)4 i i$ B# n) y) @9 e( P7 m; n; m7 ^
/ U% K9 j- I' }
(if eset1
p( {) p; e7 `! a2 @5 I (while (<= blkcnt (- (sslength eset1) 1))+ j" I7 F6 I% A/ L
(setq en (ssname eset1 blkcnt); x# V& S- B$ _$ Z* Y3 g% K
enlist (entget en)
9 e+ X3 x1 {2 q' q ht (cdr (assoc 40 enlist))
& z. X. b A5 h, J; ~: @5 k% s pnt (assoc 10 enlist)) K2 }2 W8 ~$ p. d
pnt (subst (+ ht (caddr pnt)) (caddr pnt) pnt); {3 G Z4 n4 F( Z- Y5 q9 k' M! Z! l
space (cdr (assoc 67 enlist))
9 d6 b* w4 N: b0 K- ^/ z )
- U. W3 E7 G3 r8 W1 ^, u* z9 Y (setq vl (list
5 ? S$ r) }6 ?/ L (cons 0 "MTEXT")$ M- c, E- T/ M5 I' e2 ^# f2 O+ u" A
(cons 100 "AcDbEntity")( i4 b1 P8 x* r! O3 K9 J
(cons 100 "AcDbMText")* i+ M/ y& N Q$ F- a
(assoc 7 enlist)
3 E4 w2 L" z: W, C: M (assoc 8 enlist)5 A% m4 ^$ t5 ]# P$ w: f
pnt! C, [) o' P- s" Z
(assoc 40 enlist)
5 _. W: r/ V; @ (cond ((assoc 62 enlist))
% _! h' |; y. t1 U8 K ((cons 62 256))7 S9 Z1 L$ z) _# p& G5 ]
)
' G: S z" n1 t% L (cons 1 (cdr (assoc 2 enlist)))
1 s9 E" D. d. H8 O2 ] (if (= space nil)- A7 Z& c. f& V$ ]# d( k
(cons 67 0)) u' X: O+ L% o. G
(cons 67 space)
# Z8 ^' w5 @4 q- Z! k )3 Z' b% I$ P7 |) x. C/ b6 c
)
$ P* ]$ b; j" t: k `( v, c! t )
: g. K& j/ x$ n+ ~# W- ^* t/ s) K( f (entdel en)7 M. ?1 `. H# w: K
(entmake vl)
6 I1 _9 D9 M1 Y (setq blkcnt (1+ blkcnt))
' A6 ^. k5 M2 M# q )$ ?* f5 Q6 d; x/ @$ v
)3 Y" C( m2 J# f1 U0 s
)
?9 Z7 n( v: V- q1 c) k
5 t* ]. W2 Q5 n2 q9 z;=====================================================================6 ]! b5 J, w$ w" G+ r
' M( }0 X9 G6 o: {
(defun c:xxx ( / cumdt dodai thoat dem ten doituong textxl dem goc toi)) K; f2 \) U/ J$ C
; Khoi dau cua chuong trinh% Q. p% {" o w. R( n
(princ "\nCopy Inteligent...\n")
+ }' Z6 @; f; u) V" w# o(setq luuecho (getvar "cmdecho")' U6 n3 e/ M& D, g( ~& q6 F
luu *error*% b1 Y( O. G1 S7 G d
*error* ketthuc
+ I' ^% E$ T7 ]! \ cumdt (ssget). z3 Y \4 w* Y7 \9 n
dodai (sslength cumdt)
{2 N- D8 i! @3 h goc (getpoint "\nSelect base point:")
; C+ s# m" n/ m( r( a n* h thoat nil
* o& A6 p" s* k dem 04 U% K" ~, ~8 B" J
textxl nil: N" O5 s: Q0 i. S
);! Q" [3 {2 \+ G
(setvar "cmdecho" 0)
+ z0 @, g: h1 O8 m; Loc ra duoc ong text de xu ly
" S+ Y0 e, M7 D' t z(while (and (= thoat nil)1 e5 Y' a4 u5 c$ ^+ H; L
(< dem dodai)
+ Y! i; f% f8 F6 r) _ )& w" R, I- s5 r1 X" y
(setq ten (ssname cumdt dem)
' `; I$ C% p+ p7 f dem (1+ dem)! P+ ~8 x L6 x2 t7 i' u6 o4 D
doituong (entget ten)
. C- k3 O/ C% o9 X kieu (cdr (assoc 0 doituong))
# Y3 V" ~! y# z4 U! \ ); ]! T: R5 d& a- O5 v
{' V/ i" |$ Q9 U (if (or (= kieu "TEXT")
9 C1 L/ l% j( W: `3 G1 f' P" f8 { (= kieu "MTEXT") * h9 ^0 I/ R" W
)
_: o& f. S/ c/ l4 H5 y ?1 ~5 ], z (setq thoat T
9 P( n- L5 E2 a/ A textxl (cdr (assoc 1 doituong)) ' F/ h0 a5 R7 b
)
( B7 l, G* F8 g; d* u$ g ), P5 @ a6 O* s, w5 R6 ~ _
);( A5 h- ^0 T; C$ U& c- [
(while T a" i3 X& ~9 s! N" Z* H( t8 I' g3 a
(setq toi (getpoint "\nSelect next point: " goc)! ?2 J( c4 d: Q* W5 \$ M
vitrilech (list (- (car toi) (car goc)) (- (nth 1 toi) (nth 1 goc)))7 k* ]' \0 a) Y" p2 W7 m
dem 0+ i7 }# K: B2 S2 {
)2 G" O5 N. F2 Y+ m5 H
(while (< dem dodai)
, K" b; U3 |/ U2 X7 k5 e* Z6 Z (setq ten (ssname cumdt dem)% S. P7 C1 z3 k! g' g% A: S5 q! |' B, }
dem (1+ dem)7 C) N! I! h% K4 ]+ L" H
doituong (entget ten)
_, q8 E; {1 a/ o | kieu (cdr (assoc 0 doituong))
, H9 i& ? i! A )
: {/ l; ?6 e {& z
w! [4 S: l* |& V+ ]" R& L5 X' H! w (if (or (= kieu "TEXT")
8 W% }5 H7 X* T1 b! r6 ? (= kieu "MTEXT") 0 l2 A6 h f: {6 K2 z/ B6 H, K$ Q1 O
)8 o5 l# ?- {! y+ G" H7 l
(doitext ten)( p) V5 e9 {5 n
(copy_dt ten)
6 Z; |) z T% C2 X- ^1 f
& V/ D# `6 ~6 j( p. G );if
) U/ }; L) z# S; r i, u f$ f)
+ d; S' @0 _* _7 \6 Y. G- N3 g);while
& n6 T+ K8 w, v8 F5 Z7 o(ketthuc)" A$ L/ x. h4 j8 H; H
);defun
; J3 Q# m$ V+ C(princ)
. a% E& e$ y/ B3 Y0 T- h3 T" w3 h$ f! [9 W' N
;=====================================================================
s: o6 W( e4 A* h* q;;; By Jimmy Bergmark
+ `; F8 h. i5 i6 y;;; Copyright (C) 2008 JTB World, All Rights Reserved
6 X7 |/ o0 l" d) Q- _;;;# L0 R* z/ d! ?7 ]+ ]( i4 j
;;; Created: 2008-03-31
( F4 o* |. x7 b7 a. s% O* P;;;$ j# [5 v0 D8 |: m
;;; Convert Attribute definitions to text6 W: E# b! _7 D2 Z) R; T- u
;;;7 I0 U! d- d! Z. P
) R6 P2 p+ g9 A6 I% d2 r(defun c:ATT (/ eset1 blkcnt en enlist vl space)
, V* E2 P8 B& K8 |4 _ (setq eset1 (ssget (list (cons 0 "ATTDEF")))) a, y/ s V, U+ b6 d6 G
blkcnt 08 E% B. e; L: ]2 l
)& \$ \! Q0 m8 i5 j3 q% B6 t$ Y; j
8 v6 A! b9 ?, ]6 N* C
(if eset1; X1 [$ @# ^. z- k2 n
(while (<= blkcnt (- (sslength eset1) 1))2 ]+ q/ {2 e( \0 L+ w) j
(setq en (ssname eset1 blkcnt)
) n- u; D, o+ r+ @' `* \7 @5 S enlist (entget en)4 g+ F# C: Z& J3 F# T2 V
space (cdr (assoc 67 enlist))
7 p2 } x3 x+ l: v )! c) m# b8 t" V8 ~2 ~: |
(setq vl (list1 L. K( M9 `* d' ]4 E) H0 `
(cons 0 "TEXT"), [ x' J/ e0 ]* r
(cons 100 "AcDbEntity")( z8 v* T+ h$ z
(cons 100 "AcDbText")
- D. @) ~$ ?/ `: n; ~ (assoc 7 enlist)) ]# w, i5 [7 U+ x- q A
(assoc 8 enlist)
& } J% w$ P9 H: z$ } (assoc 10 enlist)! |$ h5 V5 g/ a9 o: Q) g8 h4 \' \ {
(assoc 40 enlist)" o2 B9 a* Y4 ?
(cond ((assoc 62 enlist))
" n! @' n2 z% n ((cons 62 256))
' j3 k; N |( G )7 P8 M, L: v8 ^" n+ S) k; ]4 ?
(cons 1 (cdr (assoc 2 enlist)))
# k" O g; k; } (if (= space nil)" H. x0 N4 i; B) n0 V
(cons 67 0)
, }: p8 i% e6 r, | (cons 67 space)
( o2 S0 P5 a I3 A# O4 v' O! n0 ] )3 Q0 I& a1 ?, h9 o& r g
)
/ Q( T5 ?: k: Q! o+ ^ )' ^6 R* P5 E6 c" p) j- ^3 b6 y
(entdel en); f C' O" k8 y! T, m
(entmake vl)* b# N% c$ e( C- Q2 f4 R% }. C# j9 j) M
(setq blkcnt (1+ blkcnt))
' M& E( v. L# p. |* t: E )
3 ^, R" e/ d/ M- i+ s7 Q )
0 o/ x" p& |) V, n8 F2 |)9 K6 c ]! R: V6 v, h
;=====================================================================, {; C! p# K1 |8 U0 O2 \ D
;============================ Doi Truc ===============================0 k v1 d8 d3 l' |0 S( R9 t
;=====================================================================
2 u% M( j9 T; S$ j0 d0 z' H, @! ]1 E- P, @3 g9 G
;=====================================================================
. m* N, ~& ?4 m: w;=============== FUNCTIONS GA 1+3+5+7+9+11+13+15+17+19 ===============7 A) c- j2 N- [) T
;======================== Tran Ngoc Thang ============================" `- h; E; O+ H$ y3 P6 J) R
(defun c:ga1 ()
3 [2 F9 {0 g& g5 Q- m4 g(setq a (getpoint "\nChon diem: "))
! W( ~/ `% @& K5 H* p8 E3 d(setq b (getpoint a"\nChon diem: "))4 F9 _4 S/ Y6 v; T) Y; x
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
1 k' ]" P4 a. g- Q2 }(command ".circle" c a)) K& O. u- v; U% I8 {, N
(command ".line" a c "")5 T% T: O) Q% {, i% ]2 [
(command ".array" "last" "" "p" c "1" "" "")
+ ?- k3 a, v' i% C(princ))1 w" Z1 z& |) x
$ [- |$ g' o1 N+ Y* ~(defun c:ga3 ()7 h+ C* r1 f' Q# _! L1 _% a
(setq a (getpoint "\nChon diem: "))
% g. c, P5 O- _(setq b (getpoint a"\nChon diem: "))
% E1 l& j" M: G. Z/ v- }(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))6 O0 x" x( r# W. V" L. |
(command ".circle" c a)( `0 U6 X5 o% ^* G% H* ^0 ?4 A& M
(command ".line" a c "")
/ x+ ~) b+ y+ P8 w! N3 R(command ".array" "last" "" "p" c "3" "" "")
! L' k# z/ _, X% a1 c+ P% }(princ))
! X' e' s+ f8 ~# H
, L& A5 ?2 I' j(defun c:ga5 ()
% c" g; Z' p2 l4 |5 N) R(setq a (getpoint "\nChon diem: "))
, j5 s( M" U0 l5 ~ H& i! g* \& h(setq b (getpoint a"\nChon diem: "))
2 U% ]$ m+ j6 a- H6 `(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
$ e; r& m5 p, a" [(command ".circle" c a)% a; G$ K' l8 f: C8 s) j+ k, @
(command ".line" a c "")
% Z& l a, L# @5 I6 r0 Z/ t( k(command ".array" "last" "" "p" c "5" "" "")
+ m1 }" h4 b g. Q8 }2 [) z" s(princ))
' ?: S5 ~- m6 k8 Z# U4 s5 S2 _# x# O) H7 Z {
(defun c:ga7 ()
8 O; r5 v5 d3 Y& i2 h(setq a (getpoint "\nChon diem: "))) Z' H, U- s# g
(setq b (getpoint a"\nChon diem: "))
1 f1 x8 [ U& b(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))" K9 n! s' \: B
(command ".circle" c a)
# p6 L2 f: b) w2 ]& e0 y(command ".line" a c "")
& A& T) v$ N7 ?7 W8 g7 w' K(command ".array" "last" "" "p" c "7" "" "")
, O+ ?- a) `' D" w! d3 j& ?: D/ i) U(princ))
% O/ K! G) K: O7 |
; c) I; G& e! C4 B6 z& y(defun c:ga9 ()
/ i% u# o- [: C: M6 \# N(setq a (getpoint "\nChon diem: "))
4 r# E9 Y2 }: O+ z9 ~$ ~3 _(setq b (getpoint a"\nChon diem: "))
4 ?+ w" Y! T4 A, B) Q" ` v7 _(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))7 w4 e. x* y0 }$ z8 S
(command ".circle" c a)
4 f# z6 }/ p( T" W(command ".line" a c "")
: T5 Y' v; M, M6 ^8 Y2 r! ~(command ".array" "last" "" "p" c "9" "" "")! u9 C4 ~' @% |/ C5 E4 F- @: X P
(princ))
; j2 p% Y5 [9 h/ [ x3 l- w- I# I* E) t* j) N7 x0 {( ~
(defun c:ga11 ()
9 A: s0 h9 @# S% f(setq a (getpoint "\nChon diem: "))
+ p! l/ a5 A2 k" b1 u0 i: [( q(setq b (getpoint a"\nChon diem: "))
) R% A7 w8 r# _4 k1 S(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))( X3 }' j* @, E4 v2 e+ a1 z
(command ".circle" c a)
; f3 U' _& [! l6 S* A(command ".line" a c "")
9 G; l2 m! x2 n( E3 K. M(command ".array" "last" "" "p" c "11" "" "") q _8 [' B5 J& J C9 G
(princ)) o7 T# h! L% p
- `4 [/ N k2 W! [8 o(defun c:ga13 ()
, U5 u0 z2 ~& ~. k(setq a (getpoint "\nChon diem: "))
! Z6 U0 p0 [5 D2 G+ H(setq b (getpoint a"\nChon diem: ")): Y' w8 Z3 P9 g- v- L/ ]
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
9 P6 g8 p: r; v6 U* \" z% H(command ".circle" c a)
+ \1 {1 {1 Y4 @+ f$ ^(command ".line" a c "")
. Z+ g, A3 R, w- P) v T" u(command ".array" "last" "" "p" c "13" "" "")
" K0 O b% v V1 _( s, k# r9 Q(princ))( q& }/ J% |+ A+ m
4 w' u+ [. A# E I" G0 y
(defun c:ga15 ()1 s# L5 y9 G* F: C- i. F
(setq a (getpoint "\nChon diem: "))
, b' U, I. T! G" ]5 a) a' S& s(setq b (getpoint a"\nChon diem: ")); R# O4 h) M( J+ L
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))3 {/ i# ^0 P* Y+ s5 B' f( D# J& Y
(command ".circle" c a)
' x7 [% {0 G6 A/ e+ r(command ".line" a c "")
! s3 P4 x g9 s(command ".array" "last" "" "p" c "15" "" "")
: H" W5 L7 F4 O(princ))
) d u: E$ Y- R G8 Z, k4 n- J
0 j! Z+ {1 R/ H. ?# X) B- v(defun c:ga17 ()
" l( I3 w3 f) I! ~4 Q) d(setq a (getpoint "\nChon diem: "))( j _$ _3 m0 L# D. O1 X6 V u
(setq b (getpoint a"\nChon diem: "))" c9 o# @( n$ h& v" b5 k! l5 e
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))), j/ D ~ [0 u0 Q& Y9 V# {, d$ L
(command ".circle" c a)
' ?% U( z @" p" y(command ".line" a c "")
" H0 ?- B. C% p3 s2 U5 H(command ".array" "last" "" "p" c "17" "" "")% \ m- j! V3 [7 K
(princ))
( v+ ~' D1 ]4 | T& Q5 I
: P$ m' {# L% s, Z; T, ?: k3 k% K(defun c:ga19 ()6 M" D( h( k6 e/ h* T: J( G; X' i `
(setq a (getpoint "\nChon diem: "))
& c2 T' Z& B. {; a' b(setq b (getpoint a"\nChon diem: ")); t/ G4 S, W* Z G+ s) f
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
' s3 q5 S0 P$ n- R; w! V3 T0 F(command ".circle" c a)
$ u$ b6 m* g8 W ?(command ".line" a c "")
0 u" k8 R7 Z0 r( {+ C+ [(command ".array" "last" "" "p" c "19" "" ""); B5 N8 N; X# Q, l) ~
(princ))
& j" H7 s: Z6 f+ x& i( M6 i- h
! W2 t, H/ h2 T0 C;=====================================================================% W& `: z8 I0 t, y3 v
;============== FUNCTIONS GA 2+4+6+8+10+12+14+16+18+20 ===============
U4 J, d) ^0 p- y% ^8 n;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================& s* z' i6 F, b6 U I
(defun c:ga2 ()
8 L7 B; N! V0 K5 P1 \& n- C(setq a (getpoint "\nChon diem: "))7 w' `4 n7 A: x0 T+ P
(setq b (getpoint a"\nChon diem: "))' y& h! l! [5 k5 o+ ?
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
8 }) Z) B/ Y3 B2 L(command ".line" a c "")
: u$ m- L0 m2 x$ x(command ".array" "last" "" "p" c "2" "" "")
5 m) I$ z1 `- B9 }& r(command ".circle" c a)
' |( p5 z8 \. n. J# U(princ))& ?( N1 K* k/ e1 m Q
9 L4 c( B' k5 _) | z/ ^1 w. c(defun c:ga4 ()+ e' |/ d- f/ Q( {# _
(setq a (getpoint "\nChon diem: "))
e3 q4 T5 F8 e(setq b (getpoint a"\nChon diem: "))
# f! D; j9 |& O/ C3 c: q/ O(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
/ K* L2 { R9 q# l$ S5 ~0 q, C(command ".line" a c "")
' m$ |& g8 c$ r(command ".array" "last" "" "p" c "4" "" "")
3 J( J0 {* x$ }5 H% j- L(command ".circle" c a). z7 M1 s: R' V
(princ))8 {; A7 r; i$ @8 v5 }# ]$ X
: g( K* t }- F8 P" {/ b4 l
(defun c:ga6 ()) ~" o0 X$ T3 I7 ~" h
(setq a (getpoint "\nChon diem: "))
( Z% x8 x8 i0 W! F3 g" E9 o6 H) Z* ^+ C( G(setq b (getpoint a"\nChon diem: "))
' _- o/ x6 g% {- n2 U(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
. e, I- {& U* M2 s* v& N2 b(command ".line" a c "")3 `' ?( g" ~0 G2 d5 G2 ^+ v7 e1 Y
(command ".array" "last" "" "p" c "6" "" "")) q( c% ?* u t" w* v3 E; j0 l
(command ".circle" c a)
* j; ^, E+ K8 m0 C(princ))" G* ^( h. j0 d, s- m! n7 }) l
& g. D, U: U4 }: w* W5 S(defun c:ga8 ()
+ j u F8 A- W2 F7 g5 k(setq a (getpoint "\nChon diem: "))
3 [2 x" g" J- X/ {2 F(setq b (getpoint a"\nChon diem: "))
d4 O$ k' n; @7 U4 [" f7 Y+ R, g Q. ?(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
, i6 e3 v) s1 ~: _) `! L(command ".line" a c "")- z3 c6 L) W# o6 [! j2 N {$ l; k
(command ".array" "last" "" "p" c "8" "" "")' N- K: Z5 }6 z8 D; f; J( f
(command ".circle" c a)
r* p; i+ b- I% g! I7 Z(princ))
# L* ~% K+ c( e& c6 p( s. z& @" s0 X! f
(defun c:ga10 ()4 O$ `$ j5 y# A+ {+ M! d
(setq a (getpoint "\nChon diem: "))
# g, S1 w5 n! L; W(setq b (getpoint a"\nChon diem: "))
0 z# k2 Z% M2 G& H; P3 q$ {/ k(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))( W/ G) z1 L2 o2 {4 q
(command ".line" a c "")* R' Z; o7 n5 k h# h
(command ".array" "last" "" "p" c "10" "" "")9 S7 ]: X1 t1 Q2 B
(command ".circle" c a)( H( J# n' H. i$ p# E
(princ))+ Y6 T+ j8 a, B4 t) T. ~
' G# X2 P# B% j- f2 v0 c7 |
(defun c:ga12 ()
0 y$ Q0 \4 Q3 b( I* U(setq a (getpoint "\nChon diem: "))
- P; ]+ u: [+ L" ~0 J' `- W7 X(setq b (getpoint a"\nChon diem: "))4 a7 h& ?' J. u! c6 K& h
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))8 @0 A! s2 C5 i" v9 M: B' f
(command ".line" a c "")8 U, Q5 w5 ^8 j: }
(command ".array" "last" "" "p" c "12" "" ""), @+ p- H! E- C1 c0 K9 u
(command ".circle" c a)
: I4 k- {: c3 r r(princ))2 w Z4 Q0 N( L$ ~3 |$ ~) I/ E
+ m9 t0 g$ _+ F7 U$ j ]
(defun c:ga14 ()' r3 C( h5 `/ l0 a5 \
(setq a (getpoint "\nChon diem: "))) R7 p! {6 A! P' L+ D
(setq b (getpoint a"\nChon diem: "))$ R% B2 s- X& M1 H
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))1 ^& X* O4 ?1 I9 R; o2 j' P& I' i
(command ".line" a c "")' J6 \2 o5 w5 c' w' b0 Y
(command ".array" "last" "" "p" c "14" "" "")
; M; f9 r9 P9 ?# V$ {; V(command ".circle" c a)
" A2 ?/ l9 ]% B1 t& O- Q(princ))4 w$ @7 Y J% I5 y% x4 Z
2 D, @! V9 f4 e( k+ b5 e( v
(defun c:ga16 ()& @, }# s; @" A) ]8 ?
(setq a (getpoint "\nChon diem: "))% M4 y M/ U2 |- e& B% b! ]
(setq b (getpoint a"\nChon diem: "))
# {, b! G: W8 D- B(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
2 O/ J& v0 I7 u& K1 r$ Y" ](command ".line" a c "")7 K3 ?9 e& K9 d5 ?8 ?6 t( m
(command ".array" "last" "" "p" c "16" "" ""); D% D- G; C5 i! U& L
(command ".circle" c a)0 T; Q! t8 z) _$ H1 R" Y$ N
(princ))
g. o9 J4 N O! X+ G( R9 k1 W Y" r% J! N
(defun c:ga18 ()
4 K/ L, f* v2 P! v* [% W P7 `(setq a (getpoint "\nChon diem: "))8 v, x% J9 O* W. H
(setq b (getpoint a"\nChon diem: "))
/ C8 P* ]+ T; @(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))6 R+ U( f4 o/ D' v3 A5 E5 _) N
(command ".line" a c "")
; X/ [! b; A! p$ I I( l(command ".array" "last" "" "p" c "18" "" "")
0 r7 Y6 {' R# `6 {" \1 S3 g$ I(command ".circle" c a): U0 v( o3 C) o9 y- r3 ?) w8 G
(princ))2 i) ?) l8 m% G: O6 [/ D& P
$ C9 _2 _. P! g) [: Y
(defun c:ga20 ()5 Z' _9 S! R, |, T7 c- i! a) F
(setq a (getpoint "\nChon diem: "))' v) v* K& o: e8 C4 J i& C+ w
(setq b (getpoint a"\nChon diem: ")): n9 X5 D. T& }) e
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))- o( d& A Y4 b7 a5 q! S
(command ".line" a c "")
6 Z: s5 L/ g1 R, N! e8 J(command ".array" "last" "" "p" c "20" "" "")8 Q9 x1 ]6 X7 V- @, G% E% f8 }! r3 S
(command ".circle" c a)
; w, Z8 Z; S$ _' Q- h8 X- D5 O(princ))
) Q$ P1 j) v9 l% i' R% A, i- q$ u0 c4 d5 ], C* K) q
; ^5 ^; ]- T" f9 J% {0 X1 {' l0 P. ^% r5 d9 c: l9 |
;=====================================================================4 O5 _4 }+ }' |- E( h+ Z/ }
;============== FUNCTIONS GA TUY THICH : EVERYTHING IF ===============+ Z4 }4 B1 c' G
;========================== 06-11-2016 ~ 18h00 =======================
+ n" q0 M/ I' @;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
, u) O- }0 @) q1 A c(defun c:ga ()
- f; G, V0 m" f( U1 w(setq a (getpoint "\nChon diem: "))
4 M1 L# J% _3 [! g2 L(setq b (getpoint a"\nChon diem: "))% W6 y$ x3 o8 J% j
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))0 ~+ ]3 B8 x! d
(command ".circle" c a)3 [) Z9 ?0 T( @; L7 c3 A4 u: m
(command ".line" a c "")
$ G! B* k- c8 |% b }(command ".array" "last" "" "p" c "NUM" "" "")
% n4 R7 f# J; L7 [' v+ t+ b& n0 K(princ))
3 P- R& a% w7 }( E
4 d% N# D/ k% G6 u;=====================================================================9 z: M! E& r& O
;=========== FUNCTIONS HOA THI TUY THICH : EVERYTHING IF =============* R* c7 _& A4 R8 ~
;========================== 06-11-2016 ~ 18h40 =======================5 I4 T7 G( {" Y$ @7 \
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================# N$ g- ]8 S. ~" [" B. o
1 d2 r9 \) f2 W(defun c:hoathi ()
' Q0 l4 F- W0 X/ \' S. e(setq a (getpoint "\nChon diem: "))9 T: |: M2 M/ c3 [' y9 ]* u1 [6 `
(setq b (getpoint a"\nChon diem: "))
2 m( d' U2 N9 I4 o- I(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))) ]. n3 S" r- V) r& F" A' b
(command ".line" a c "")
4 r4 C7 U: ]6 _" q7 k& q(command ".array" "last" "" "p" c "NUM" "" ""): B+ c H: M" h2 J9 s
(princ)). b9 D4 R; _( [7 G
2 Z5 y+ ]0 F. ?8 s;=====================================================================- q! C. N$ X" I. c5 m* l$ J3 A' l
;============= FUNCTIONS CUNG TUY THICH : EVERYTHING IF ==============7 i+ b- R% q3 O" P9 g e
;========================== 03-11-2024 ~ 19h33 =======================
! Y& B) M' Q4 ?6 t;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
. T# B) J) x7 S {$ G3 r {. I4 h- i) U7 K& Q# s+ L
(defun c:cung ()
* q7 V f" W6 Y* x( V7 F3 L(setq a (getpoint "\nChon diem: "))3 c6 K. _8 w' E0 [0 ~$ m
(setq b (getpoint a"\nChon diem: "))
@; \3 [9 ]& B(setq c (getpoint a"\nChon diem: "))$ v& }0 }# ?. O+ l9 J
(setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
# x9 [* g! O/ V(command ".arc" a b c "")
2 o7 ]& i) H5 ?, b: @3 R* @(command ".array" "last" "" "p" c "NUM" "" ""): Z6 U& ~( X1 T, L0 b' q2 h
(princ)): @7 {3 O! K1 X. T% p
: R% ]: ]. m; ~;=====================================================================
; R5 @) C* L" n G: W;============ FUNCTIONS HECLOIC TUY THICH : EVERYTHING IF ============
6 t2 @ ]9 {3 A) |/ \/ t6 n;========================== 03-11-2024 ~ 20h02 =======================" l5 [' B; E' [; n! N( _
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
" T6 h- ?* t+ r p2 m(defun c:hecloic ()
. ?$ E J7 \- k8 G(setq a (getpoint "\nChon diem: "))/ o* P. O+ A- a6 W& C. ]. }
(setq b (getpoint a"\nChon diem: multi ")) m4 A5 V* [" _: [
(setq c (getpoint a"\nChon diem: "))(princ)
2 x0 W/ F8 Q! D$ ?& b(setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
% D6 U5 K* w+ D! u(command ".arc" a b c "")
9 f4 j8 \7 R, F7 e, P: [! g8 {7 J(command ".array" "last" "" "p" c "NUM" "" "")
( F x3 _: J& Q2 z(princ))
' g# N8 o2 n; Q, O+ s0 j1 M Y/ q0 l, V i J# l3 u3 P U2 q' a: i
;=====================================================================$ E2 S" f- [& W5 G
;============== FUNCTIONS GAY TUY THICH : EVERYTHING IF ==============
4 ?) _) l4 U# Y y) q;========================== 03-11-2024 ~ 19h38 =======================
/ y& ~9 c0 y" d$ X9 @& q+ L;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================1 w) F4 q" L& T
1 w7 p+ [# x$ c6 p
(defun c:gay ()
2 V( g. ?( v* ]" R9 _$ U(setq a (getpoint "\nChon diem: "))! i7 u9 B' U! a- ~
(setq b (getpoint a"\nChon diem: "))
3 n9 A" x4 r& s r m/ [% [+ v: [" U(setq c (getpoint a"\nChon diem: "))(princ)' A0 m* R" {! b$ t# s; e0 Z
(setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
: \" h# f3 |$ D- M(command ".pline" a b c "")
8 W9 ]2 ]0 r' [5 ?( o- @- `(command ".array" "last" "" "p" c "NUM" "" "")
6 f2 S" v8 A; x4 B' \6 {(princ))
' @8 F I; h: _2 i) T- i: o' `0 `+ d6 l! |) _2 \: H3 C6 `; }5 o: s9 e, w
;=====================================================================
# ~( Y: p) j. M2 I. P: W6 x;============ FUNCTIONS HECLOIT TUY THICH : EVERYTHING IF ============; R6 [( p2 y, @# g# \# [8 C' A
;========================== 03-11-2024 ~ 20h02 =======================
6 Z$ t+ ^ r: a4 O- C7 l8 ^! g;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
, A- W2 g& M+ l# L( b9 V
2 [! g3 R0 }2 R( K( t1 n(defun c:hecloit ()
?: T1 R) @6 e1 G. x" V(setq a (getpoint "\nChon diem: "))# Y& `: {" b" Y8 ]' Z+ x
(setq b (getpoint a"\nChon diem: multi "))
V" a K5 c2 L( j. Z7 f w7 V(setq c (getpoint a"\nChon diem: "))(princ)
% e( _+ b5 j2 r& o" I* O/ w(setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
6 a4 c+ b2 W6 {5 A" P(command ".pline" a b c "")
s* c# J/ `1 @3 ^(command ".array" "last" "" "p" c "NUM" "" "")
" ? m$ k( v5 j5 N6 Q(princ))
$ a5 R+ K7 O+ r; E& s3 O! F8 e* k
/ N+ i1 |: H) `9 f% T( c$ Z! F0 }/ ~/ X& ]
;;; ============================ Merge Hatch =============================1 C! Y. v [) K3 c# h0 a3 y$ W
3 B3 Y2 k# @. m/ I/ x8 Q$ t(defun c:mh (/ ss entht sl i dt dtht); B; p: Y6 _$ I, `' @
" N. y/ d) D4 A: ?' G
(princ "\nMerge Hatch - free lisp from CADViet.com")
7 Q. }1 j: G/ [' ?/ f: L+ E- u2 e1 S% n8 q2 ^$ m$ e+ l
(setq
9 }3 B1 A8 L, C$ W" K; \8 d ss (ssget '((0 . "HATCH")))
# p: J* Z1 o6 D- I' a7 u2 V" G sl (if ss
4 O7 N% E i( H G2 @ (sslength ss)% A1 k* s( s+ e5 m
0; t) L0 n, h5 V, {) _ w0 `$ W
)& Y# q" l- i6 D' y6 y: X( E8 ]
i 0* f$ V& t! @" b
l 0# J" f% Y, ~; V7 B+ d2 E; e
)5 K% W/ C3 L5 @5 q8 U9 T9 ?
# N0 p2 x [4 \7 Y5 c1 G6 _# F
(repeat sl
3 j' G- t! z. E) ] (setq5 N3 q; w3 }* ~3 H
entht (ssname ss i)
N/ O( K" d$ C- U# }7 y dtht (getbdata entht)4 ^3 \. [! ?3 T0 `# L+ k, u+ j
dt (append dt dtht)
* I o y, Z# _* r l (+ l (cdr (assoc 91 (entget entht))))
8 i. P$ i, w, o" { l h2 G i (1+ i)3 m1 `4 g+ E/ Y5 }
)/ S0 x' r8 M( ^2 s* w
)
& _ s1 E/ y& W! T7 g/ v! [
! n9 P* l# z, l$ } a% G+ ]8 y! n (setq ent (ssname ss 0)* k4 F6 c8 d& \/ g8 \/ [6 w
ss (ssdel ent ss)- `3 L, r v3 G- h8 Q- P
tt (entget ent)9 b4 ~. X$ H: h- h1 Y4 m" e# _
duoi (member (assoc 75 tt) tt)
9 ]# ]$ d( n+ a8 Q dau (reverse (member (assoc 91 tt) (reverse tt)))
+ x4 _6 D T/ S- } tt (append dau dt duoi)0 `, C: L# g9 q/ A, m/ N
tt (subst (cons 91 l) (assoc 91 tt) tt)- c' Q. B1 r/ ~; I
)
2 o# R% |" d0 @' D (entmod tt). f3 f8 R8 l$ `$ x1 W- U* y
! O4 } d3 j: B9 B( i) r: d6 j- Z (command ".erase" ss "")# M( S. r" A- d
(princ)
~3 g, V s( [5 d)7 h% ]! |+ T" u" f5 i$ \) v
! t4 ~3 {1 W6 B9 R(defun getbdata (ent)
I0 Q! N1 `: M3 n) h (setq tt (entget ent)
$ S3 Y& z) C' S4 s6 H8 L tt (cdr (member (assoc 75 tt) (reverse tt)))
1 u) ~5 N; d$ y5 L6 ?1 U9 u) d tt (cdr (member (assoc 91 tt) (reverse tt)))
' W- u' z# b. i. Z: [ )4 r1 x% }7 e7 f8 a1 @/ a3 a
)
X1 V* l1 Y, T. p: `8 R! W' Y
6 |1 ]% x2 q$ h. w z( L) E. s& E(princ)
" A' z& S0 k% y7 x7 L: n
6 A: f& J9 P, v3 R;;; =========================== CAC LENH LAYER ==============================5 R; Z% O8 }0 A. Y- Q9 X
;;; =========================== Layer hien hanh =============================& Z3 ]* Y3 G9 l$ u! Y" y
: ~' k! j1 w, p* u(defun layset (/ LAY) (setvar "cmdecho" 0)/ }3 b/ O o6 x/ O8 r0 Z
(setq LAY (entsel "\nPick vao doi tuong muon Layer hien hanh la Layer cua doi tuong do : "))
: R/ L [0 Y# T9 G5 J' W (if LAY (progn
7 _! G+ V( x. z0 x8 c3 _ (setq LAY (cdr (assoc 8 (entget (car LAY)))))
- ~+ E! g, ^; ^& ? (command "_.layer" "set" LAY "") (princ (strcat "\nLayer : " LAY " da la hien hanh.")) )
6 u) K5 E6 R3 E) n (progn
2 t( ~) y) F) n$ @9 }% o$ p$ a; [/ y8 ^ (if (not ddlop) (load "ddlop")) (if (setq LAY (ddlop)) 5 i8 g- v0 g3 u' {2 Z9 |
(progn
/ n4 {0 @ `3 ? (command "_.LAYER" "ON" LAY "THAW" LAY "SET" LAY "") (princ (strcat "\nLayer : " LAY " da la hien hanh.")) ) ) ) )(princ) )5 v0 a/ ~* I2 n& w1 d7 e8 f- f
(defun c LL () (layset))(defun c AYSET () (layset))
4 p6 L' |# i- U0 J. z5 E. T! J) c
;;; ================== Cap nhat doi tuong vao layer hien hanh ==================4 a# k: g" t1 r' k) f+ V
# F v9 P9 W% Z2 x5 f* w
(Defun LAYCUR (/ SS CNT LAY) (setvar "cmdecho" 0)2 l" V# ?* \( q; p) ^
(if (not (setq SS (ssget "i")))
' {: g9 D: H9 L* `4 o (progn (prompt "\nChon doi tuong cap nhat vao layer hien hanh: ")2 k" |0 J8 J9 Q9 ^
(setq SS (ssget)) ) )
# K7 @+ [, h( h4 e. t3 ]# j (if SS (progn7 ^+ ]1 R. ?1 t1 s7 q
(setq CNT (sslength SS)) (princ (strcat "\n" (itoa CNT) " doi tuong tim thay.")) (command "_.move" SS "")
4 Q5 ]" J% j7 g5 p! J/ X7 y2 d7 V (if (> (getvar "cmdactive") 0) * E: y! g/ c0 |. _2 u
(progn! M+ O: v: \- S0 E
(command "0,0" "0,0") (setq SS (ssget "p") CNT (- CNT (sslength SS)) ) )
4 \( ?+ \3 q3 W (setq SS nil) ) (if (> CNT 0)
G9 G* Z; Z9 D5 l9 q/ J; }6 i (princ (strcat "\n" (itoa CNT) " doi tuong tren layer LOCK.")) ) ) )
& G! C1 L, c! F+ e1 h* E# i' Y" ^ (if SS (progn) [7 h& O; J: y0 y: l k5 N( Q) {
(setq LAY (getvar "CLAYER")) (command "_.chprop" SS "" "_la" LAY "")5 {5 G; e0 R' F9 P5 J" P6 k b3 J
(if (= (sslength SS) 1)# s2 X" X' k. g" Z' L
(prompt (strcat "\n1 doi tuong da cap nhat vao layer : " LAY " (layer hien hanh)."))- O7 t# w, K1 r4 {/ j. R+ w# F
(prompt (strcat "\n" (itoa (sslength SS)) " doi tuong da cap nhat vao layer : " LAY " (layer hien hanh).")) ) )) (princ) );end, ]. v" W8 }+ X
(defun c AYCUR () (laycur)) (defun c HH () (laycur))! v$ N/ ?% v6 g- X1 X
( W0 o9 e+ n6 j9 B& j! e4 C) ~3 W8 ~
;;; =========================== Layer Iso ===================================
; ]0 r' [) L2 y8 Q+ |/ u
$ w: E# W. K: ?2 p) G+ a(Defun LAYISO (/ SS CNT LAY LAYLST VAL) (setvar "cmdecho" 0)
# J9 _; c5 Q b; j3 ` (if (not (setq SS (ssget "i"))) (progn0 q' N/ R( t' X8 U8 c g% I
(prompt "\nChon doi tuong tren layer(s) muon lam viec doc lap: ")- C# h7 F! s% z
(setq SS (ssget)) ) )
. |! [( r( x# w& n# T) ] (if SS (progn (setq CNT 0)) f) O" g- v' X! [) \
(while (setq LAY (ssname SS CNT))
O3 \! h6 A0 o4 b. o1 ]" Q9 A; N (setq LAY (cdr (assoc 8 (entget LAY))))
8 `. g' F7 A8 A# z7 a9 b" R3 f. K (if (not (member LAY LAYLST))! t- R/ r1 O* ^( I
(setq LAYLST (cons LAY LAYLST)) )+ y* J& [; ?; e
(setq CNT (1+ CNT)) )
6 a5 M( u! \- Z0 V (if (member (getvar "CLAYER") LAYLST)' H* W) s; Y2 d
(setq LAY (getvar "CLAYER"))! U8 V9 D& O" |8 |
(setvar "CLAYER" (setq LAY (last LAYLST))) )
! H# _( U% v3 [' W* G1 w (command "_.LAYER" "_OFF" "*" "_Y")4 A" z1 X! v& [
(foreach VAL LAYLST (command "_ON" VAL))
# j" L( A) u! w3 ~5 b0 i% J% x. @ (command "") (if (= (length LAYLST) 1)0 ^' j5 N/ g' N3 j/ K! u p4 S" M
(prompt (strcat "\nLayer " (car LAYLST) " da tach ra.")) Y# C1 b# a/ Q# L) m/ \+ E
(prompt (strcat "\n" (itoa (length LAYLST)) " layers da tach ra. "
# c. [* W! t1 F* X" X y; q: a "Layer " LAY " la hien hanh." ) ) ) ) ) (princ) )6 D4 P( z5 T5 r( m3 o7 U# H& {
(defun c AYISO () (layiso)) (defun c I () (layiso))6 I! [/ z9 {/ R; B# u: ^
8 O( i/ Z" W& j0 @7 c. \# e;;; ========================= Layer Match ==================================
/ _# V) L1 b7 ~4 b5 u+ T1 ^% e( {3 @- `% m$ n, i
(Defun LAYMCH (/ SS CNT LOOP LAY ANS)4 e5 c, x# G$ p. Q' K& i; J
(setvar "cmdecho" 0)
# V& ]) Q: R6 Y+ L7 ?) P$ v7 c (if (not (setq SS (ssget "i"))) (progn
! K6 B: C! g' M" d( Y& [ (prompt "\nChon doi tuong muon thay doi Layer : "): N1 U- t0 k0 U0 k% v* t/ [- k
(setq SS (ssget)) ) )- V* C" S. M. X% B2 _' p* o, p
(if SS (progn+ Z3 g9 e+ k! o, O1 N. Y( }0 {- z
(setq CNT (sslength SS))/ ?+ R' g1 q m7 Q
(princ (strcat "\n" (itoa CNT) " found.")) (command "_.move" SS "")
, \& w" q: P( w% g G$ Q/ _ (if (> (getvar "cmdactive") 0) (progn
; A% s6 l) T* ]0 b6 y* ` (command "0,0" "0,0") (setq SS (ssget "p")
1 `* k7 m2 [. Z- w6 w CNT (- CNT (sslength SS)) ) )8 V% Q; h/ ]! Q) m! z' @% ]9 K
(setq SS nil) ) (if (> CNT 0)
3 E0 T6 V- i% l- ^ (princ (strcat "\n" (itoa CNT) " tren layer LOCK.")) ) ) )6 E7 w j- a( d5 |
(if SS (progn
( s5 v( d' o) N* N" M; S1 O (initget "Ten") (setq LAY (entsel "\nTen layer/<Pick doi tuong>: ") LOOP T )
3 J8 U+ `! K8 ^" k (while LOOP (cond' ~3 \5 M. O9 {. ~' Y5 L
((not LAY)
: f6 _ p5 q8 I (prompt "\nKhong chon doi tuong.")
7 j4 c: Z5 z, d& h# D' q! { (prompt "\nSu dung layer hien hanh? <Y> ")" J. p" u0 l" z+ s+ k0 u
(setq ANS (strcase (getstring)))
+ U T- m' Y% r' p* x (if (or (= ANS "") (= ANS "Y") (= ANS "YES"))
4 d+ K( \: i; M (setq LAY (getvar "clayer") LOOP nil ) ) )) E' N- q: q0 E; u* u
((listp LAY) (setq LOOP nil) )
. q( S3 y( r$ M& i! K ((= LAY "Ten")
, `7 F. Q; v, i (setq LAY (getstring "\n>Nhap ten layer: "))
7 t# C1 ]# k8 a( r (cond0 F1 t) ]/ B& o+ {, b2 w1 h8 g
((tblsearch "LAYER" LAY) (setq LOOP nil) )* H G+ `6 C$ C9 Y) A+ ~
((/= LAY "")
; Q6 D5 N3 b( ?% }6 u (prompt "\nLayer chua co trong ban ve. Tao layer moi? <Y>: ")
+ A& { d0 L3 B2 q) B; ?9 ]3 O (setq ANS (strcase (getstring)))
& N. _% _; w$ O6 U. f M6 q3 _ (if (or (= ANS "") (= ANS "Y") (= ANS "YES")) Z% A/ ?5 E* N
(progn
8 e c: L! x( n8 C2 E. u (command "_.LAYER" "NEW" LAY "")! D# S" c0 ?! @3 r e: F+ |! p
(setq LOOP nil) )) W$ B* q' V3 j3 k9 q7 t) p& B
(prompt "\nLoi ten layer.") ) ) ) ) )3 F; k0 u6 x/ @
(if LOOP (progn (initget "Ten")$ q) n; `1 g4 R; `; {! o8 @
(setq LAY (entsel "\nTen layer/<Pick doi tuong>: ")) ) ) ); while LOOP
1 w$ i8 @0 ^! X8 O" |2 k/ } (if (listp LAY)
9 C4 U; k+ r6 u, h' o0 u) B (setq LAY (cdr (assoc 8 (entget (car LAY))))) ): L4 U. I6 Y$ U8 b
(command "_.chprop" SS "" "_la" LAY "")) |+ B F* b5 i* R+ @' |8 E" Q
(if SS (prompt (strcat "\n" (itoa (sslength SS)) " doi tuong thay doi toi layer " LAY )) )
5 k8 j J7 {+ {- _+ p (if (= LAY (getvar "clayer"))
$ D8 O. w, w5 {" Y (prompt " (layer hien hanh).") (prompt ".") ) ) ) (princ) )
% H" x0 @8 X9 y; H(defun c AYMCH () (laymch)) (defun c:CLL () (laymch))4 z. U+ j% w* P/ i, G3 n
$ b9 {2 R" q: G;;; ============================ Layer OFF =================================
% o0 b# |, d0 D6 `$ c
: s1 }8 B2 R; l" T(DEFUN C J (/ SSET SSL ENT LAY I MODE)
]+ Y! ^1 e/ M" M. Z! Q (SETQ SSET (SSGET))) z2 Q- n6 d2 j2 O8 g+ d
(IF (/= NIL SSET)
C7 M7 P6 \, D( q8 X& Y8 T w (PROGN
3 {+ ~9 U; |( F# q0 o (SETQ SSL (SSLENGTH SSET)). ^+ o9 M, e3 I b+ e# t5 k6 n
(SETQ LAY "") o8 J- D0 N. E% l7 k1 [! `
(SETQ I 0)9 ~/ t" h3 H1 y( a( N* G
(SETQ MODE 0)
9 e! y+ M& s- `: A (WHILE (< I SSL)) F/ T7 [5 c# d# S9 m& P$ I
(SETQ ENT (ENTGET (SSNAME SSET I)))
7 Z, C1 C5 U3 ?* G (IF (= (CDR (ASSOC '8 ENT)) (GETVAR "CLAYER")) (SETQ MODE 1) )
3 _$ R" ~; A. M6 R (SETQ LAY (STRCAT LAY "," (CDR (ASSOC '8 ENT)) ))# ]0 ^( {- ~1 u/ [1 J' O
(SETQ I (+ I 1))
, a& t J9 ?# A" x; }+ d9 T( { )2 q2 X! C/ o5 b6 m& f& ?
(COMMAND "LAYER" "OFF" LAY "")
# n# b* F. N$ t (IF (= MODE 1) (COMMAND "") )9 T) R: H: b6 B$ l
)
, x5 g- y9 m6 H( k )
# z* n( A- O6 o0 b- ~% ~ (PRINC)
5 H6 q* X4 j$ K)
1 ^( f+ ~, @. J4 }/ U1 r& W9 R, }& Z6 W" A$ s
;;; ================================ Layer ON ==============================
9 |! r- I$ U$ o- H" _2 ]
7 o/ v/ |: k A) x% A(Defun LAYON () (setvar "cmdecho" 0)/ G0 @5 d* T; t- A6 M0 Y! b# W, u
(setq Lay loff1) (setq Loff1 Loff2) (setq Loff2 Loff3) (setq Loff3 Loff4) (setq Loff4 Loff5) (setq Loff5 Loff6) (setq Loff6 "0")" I7 b4 I9 r* L
(Command "LAYER" "ON" Lay "") (princ (strcat "\n Layer : " LAY " da ON.")) (princ)). x# [) S8 m3 I2 q# A3 f9 Z ]
(defun c AYON () (layon)) (defun c:LOO () (layon))
" ]& @! D4 v) q3 s# h+ u(Defun C:LO () (setvar "cmdecho" 0) (Command "_.LAYER" "_ON" "*" "") (princ "\nDa ON toan bo cac Layer !") (princ))( g' M% j4 H0 ~1 D2 g
! j$ v* K; [9 w0 b2 S! F) i3 K
;;; ============================== Layer Freeze ===========================; V( t$ J3 a1 K b8 T2 e5 R7 T
9 b/ q u7 R3 L(Defun LAYFRZ (/ LAY TEMP)(setvar "cmdecho" 0)
2 h; ~6 |! o2 S s! O, S" R; M! `(prompt "\nChon doi tuong tren layer(s) muon FREEZE: ") (SETQ SSET (SSGET))9 D) R5 x- |2 A( t, W( I& M
(IF (/= NIL SSET) (PROGN
5 R7 P8 v% S% g& T9 T (SETQ SSL (SSLENGTH SSET)) (SETQ LAY "") (SETQ I 0) (SETQ MODE 0)
* N( h* I6 H9 Y1 A( @( t5 ]% z (WHILE (< I SSL)
- V) n, F; v8 b8 j' R: @1 ` (SETQ ENT (ENTGET (SSNAME SSET I)))
, ^3 D' T5 @( g (IF (= (CDR (ASSOC '8 ENT)) (GETVAR "CLAYER")) (SETQ MODE 1) )
+ z8 A- E+ q2 A2 T (SETQ LAY (STRCAT LAY "," (CDR (ASSOC '8 ENT)) )) (SETQ I (+ I 1)))' \9 t H; d* _
(COMMAND "LAYER" "FREEZE" LAY "")& H5 ~0 N: _3 f `
(IF (= MODE 1) (COMMAND "")))): Z3 q4 n2 o2 H+ j
(setq Lff6 Lff5) (setq Lff5 Lff4) (setq Lff4 Lff3) (setq Lff3 Lff2) (setq Lff2 Lff1) (setq Lff1 LAY)& ^. |. c& J" |# ` b9 {% G
(princ (strcat "\n Layer " LAY " da FREEZE."))(setvar "cmdecho" 1) (princ) )
* n3 d# ^3 N0 K2 c- \6 F7 D4 M(defun c:LAYFRZ () (layfrz)) (defun c:LLF () (layfrz))$ H1 z5 G* B9 e5 u8 N# O) |+ Y
3 _+ F7 t5 m& \6 ?# a& N) D! [
;;; ============================== Layer Thaw ===============================
7 r7 B6 m( l5 F5 a7 l" a$ y1 r8 ]* ]- O
(Defun LAYTHW ()8 Z; y1 m, e. e
(setvar "cmdecho" 0)
+ _3 g" t) f2 Y/ A$ `% x (setq Lay lff1) (setq Lff1 Lff2) (setq Lff2 Lff3) (setq Lff3 Lff4) (setq Lff4 Lff5) (setq Lff5 Lff6) (setq Lff6 "0")
! O$ f" k5 I. x6 h3 P* s (Command "_.LAYER" "_THAW" LAY "")0 A9 w! h y) J8 Y/ s: B' v
(princ (strcat "\n Layer : " LAY " da THAW."))
- h4 F& C% x2 g: e6 G9 a7 i (princ) )- \* v6 g0 J+ w1 r; a2 J
(defun c:LAYTHW () (laythw)) (defun c:LW () (laythw))
0 T" J+ @! }6 H* C5 S
; A2 j/ Y `. A;;; ============================== Layer Lock ==============================; f+ h& d4 d8 q4 G' C7 N- V. G
8 J a8 e. b+ a6 @ d; X7 o5 _(Defun LAYLCK (/ LAY)
, M4 u! c9 J' h; Z7 v' [9 ? (setvar "cmdecho" 0)
% Q: D, c& X5 d p3 K; T (setq LAY (entsel "\n>Pick doi tuong tren layer muon LOCK: "))3 L9 m ~2 W# V. X2 z, R
(if LAY+ {; V' @: j* O- X( Y K6 ~
(progn2 G4 [0 N! |: Y4 Y' L
(setq LAY (cdr (assoc 8 (entget (car LAY)))))/ c9 R& v- X4 O, q
(Command "_.LAYER" "_LOCK" LAY "")! r3 v/ h; j6 A
(princ (strcat "\nLayer " LAY " da LOCK.")) ) ) (princ) )
& V& b D" `- o: l9 ~' |3 O5 w6 i(defun c:LAYLCK () (laylck)) (defun c:LK () (laylck))) Y2 j" F8 Y1 J5 ~
! @0 F1 t8 g3 j |5 ~9 G' T+ L/ V
;;; ============================== Layer UnLock ==============================
* `1 p- A% ]' u5 e: F
* I; R% l+ g' h8 S; B% f: K' h" [(Defun LAYULK (/ LAY)& S4 _ R8 n( k& J" ]. @ K! w
(setvar "cmdecho" 0)# {* M( L @2 i
(setq LAY (entsel "\n>Pick doi tuong tren layer muon UNLOCK: "))
" P( T! S: N' Z1 m$ @9 ? (if LAY
7 q/ ]& U6 B- w/ e% W% \! U (progn
4 X) N/ Y& L+ C) ~; y/ X/ u (setq LAY (cdr (assoc 8 (entget (car LAY)))))& E7 `& V/ K2 L1 ^
(Command "_.LAYER" "_UNLOCK" LAY "")
4 n+ B. j% u( W. i# n8 |/ m (princ (strcat "\nLayer " LAY " da UNLOCK.")) ) ) (princ) )1 T1 Q: q; F5 |% R5 \& I
(defun c:LAYULK () (layulk)) (defun c:LU () (layulk))
! A8 \8 y2 R; m9 j' B# ^& o) c# B5 i' m
;;;===================== Delete all objects of Layer ========================. g) Z2 |8 f" J3 `; M( C7 _
5 Q2 w2 v# c1 B" N
(defun DELAYER (/ ocmd L S)
* z' h* A- @% C (setq ocmd (getvar "CMDECHO"))
I8 o& h: r" s; v8 t: w u (setvar "CMDECHO" 0)- ^' V/ J1 U# Q' Y
(setq L (strcase (getstring "\nLayer(s) to delete: ")))3 x8 A! A3 Z4 Z# N
(setq S (ssget "X" (list (cons 8 L))))
) }3 J2 k; c% Z" M9 C+ @! j& p: g (if S
, u( f! [' s$ r5 R7 ^! e (command "ERASE" S "")
, ~) ]& e/ c, o6 q& h2 v (princ "Layer empty or not a valid layer name.") )
, @% B2 p8 r6 [. ^ (setq S nil)
" V& W4 v* K) O (setvar "CMDECHO" ocmd)
2 e2 R: b- K9 g1 ]" R6 V (princ) )
0 O& x7 I! R/ E6 P+ R* ?& r(defun c:DELAYER () (delayer)) (defun c:DELLAYER () (delayer)) (defun c:DEL () (delayer))8 u; q A- M2 j& Z
# ?( c6 S6 {2 Q) `2 s;;; ========================= HET CAC LENH LAYER ===========================
. Z. K5 B& f- L; M5 V6 A! ?" k1 _ I3 G' R# b% |/ ?
;;;====================== EXTEND NHIEU DOI TUONG ===========================) f/ Q6 m0 v1 Y0 _: \
& E* n# q1 m5 ]6 a( I+ T. q
(Defun C:EET ()
8 v% E6 r. x/ S! W% u& _' o2 d4 k (Setq CVAR (Getvar "CMDECHO")) (Setvar "CMDECHO" 0)
$ y0 [1 ]1 G: E (Prompt "Chon doi tuong dich cua EXTEND :") (Setq CUTEDG (Ssget))
0 x* o6 X- }# S1 b" [ (Prompt "Chon doi tuong de Extend :") (Setq SS (SSget)) (Setq LEN (SSlength SS))6 k8 p e! I- b; Q( {" e
(Setq I -1)4 @0 J! W8 [) t& t- ^! I
(Setq SIDE (getpoint"Chon phia de EXTEND")) (Command "EXTEND" CUTEDG ""); [' e6 b7 s5 q
(Repeat LEN
5 C1 y9 \/ ]( u6 D: ] (Setq I (1+ I))
% e5 p- {& g/ ^$ E8 Y (Command (List(SSname SS I) SIDE)) ) (Command "")6 i; r5 X8 ?. X4 Z6 S5 u
(Setvar "CMDECHO" CVAR) (Princ "Da Extend xong moi ban lam tiep") (Princ) )
- [9 f/ h% V. F+ ^
' V7 h8 W& H1 z5 R {; Q;;; =============== EXTEND 1 DOI TUONG THEO KHOANG CACH ===============
+ n5 O6 R7 m; Y% R
) a9 ]$ n% \9 @& F(defun c:ETT () (setq os (getvar "osmode")) (setvar "osmode" 512)
; O- V) m) P) r; g" p (setq pt1 (getpoint "\nKich vao 1 dau doan thang can EXTEND "))& K0 x/ p- w0 b. X- `
(setvar "osmode" os)
, `; x1 t8 t, Y) `& ~" a (setq dis (getdist pt1 "\nKhoang cach can EXTEND :"))5 v2 p3 _9 ]- T) e4 ? ]- ^) c
(command "circle" "endpoint" pt1 dis) (command "extend" "last" "" pt1 "") (command "erase" "last" "") (princ))
* `: {: ]8 \' _9 p7 V6 V* b% l9 b: N$ E$ ]2 F
;; ================ Change width of polylines =========================
; u! L. ^4 K7 }7 [" v: O, K$ h6 }; b/ c7 L2 j5 t' x2 `/ C
(DEFUN wp (/ a b sophantu sodem list1 ha:wid)
5 O+ J1 E+ v# e5 Z" j! k# r' V(PRINC "\n Chon doi tuong can thay doi do day (Width) !") 4 T0 H8 g. K \
(setq b (ssget)) / }2 l1 f1 L3 c4 D( x
(setq sophantu (sslength b))
' m: N" b; P& Y: W7 Y (if (null ha:wid) (setq ha:wid (getvar "tracewid")))
2 q( Y& O* I j) c9 C% [2 f (princ "\nDo rong polyline <")) W L K% m1 m! d2 L! z
(princ ha:wid). s! y+ g, q, Z
(princ ">: ")
% h) {6 _5 @- ~7 p7 Q (initget 4)
7 G' V" I1 S J2 G' ~; l (setq ha:wid (getdist))8 c2 f$ W: [/ O+ q# B
(if (null ha:wid) (setq ha:wid (getvar "tracewid")))7 I; [) l! h$ z7 l' ?% v
(setvar "tracewid" ha:wid)
5 v" ?6 s+ ]) l: u7 H: @& } (setvar "cmdecho" 0)
2 n H: O2 M: [/ m' G$ H ~ (setq sodem 0) 5 A- y1 ~& X) ]& \& x6 I
(repeat sophantu& w9 {" r9 B/ @ X/ u5 J
(setq a (ssname b sodem))
* }. Q2 n, T# X (setq list1 (assoc 0 (entget a))): D7 b3 k. H$ ^6 \
(cond% U5 S( p7 E9 W
((= (cdr list1) "POLYLINE") (command "_Pedit" a "w" ha:wid ""))
G. b9 G, E, ]; ~* N' w# x (PROGN (command "_Pedit" a "" "w" ha:wid "")) )
$ V* O5 J3 W2 ^4 J (setq sodem (1+ sodem)) )(SETVAR "cmdecho" 1)(princ))
$ \0 p3 L% X8 F% p% b(defun c:wp () (wp)) (defun c:pw () (wp))
1 K* ]$ `4 `/ u; w6 o4 U2 G! I2 \8 g T+ ~7 l' y3 S/ y/ b' M6 O
;; ================ Change radius of circles ==========================8 |; T2 a5 s: B* \. r# f" f* ^" H8 m
( {( O. h+ F2 }% A
(DEFUN C:CHR (/ SSET SSL M RD I) (PRINC "\nSelect Circles :") (SETQ SSET (SSGET))1 {5 e S, s1 L4 G% P8 p
(IF (/= NIL SSET) (PROGN (SETQ SSL (SSLENGTH SSET)) (INITGET 4 "") (SETQ RD (GETDIST "\nNew radius : "))
; E' ]6 O4 E/ |( y6 n3 y (IF (/= RD NIL) (PROGN (SETQ I 0)
" m' l6 S; n8 n" K* m# e1 ? (WHILE (< I SSL) (SETQ M (ENTGET (SSNAME SSET I) ) )$ j; F0 U6 B$ q7 ~( _, P& I! Z! `
(IF (= (CDR (ASSOC '0 M)) "CIRCLE") (PROGN
) `' s( a: f" ~ E+ [( K0 k e/ }# k (SETQ M (SUBST (CONS 40 RD) (ASSOC 40 M) M)) (ENTMOD M) ) ) (SETQ I (+ I 1)) ) ) ))) (PRINC) )
& }9 J7 n/ A3 y$ B4 U. d0 t( z0 L+ o3 B# G4 v
;;; ============================== TEXT Hight ===============================
, W3 e7 d% O. J. B$ B; i4 [: R& M4 V; @' c
(defun texthght (/ ent hght)
* `! y; ]* l& j& C" M$ p (setvar "cmdecho" 1)
: z3 T! x# {# Z4 X2 o$ ~ (prompt (strcat"\nSelect text entity with required text height"))0 C, |% D( A7 w# c0 m0 n! K8 S
(prompt (strcat"\n."))% H( L4 F8 l# E% o' o* V
(setq ent (entget (car (entsel))))( B6 N& D% y# ]3 {& {3 h7 w8 I
(setq hght (cdr (assoc 40 ent)))5 B2 H9 i/ b9 A$ D
(prompt (strcat"\nText height now set at "))(prin1 hght)
- z$ o: f) }2 U, O% J (prompt (strcat"\n.")) 1 y, U4 ~0 T# A3 l; i9 `, M! ]
(setvar "cmdecho" 1)
& V( z/ v% d5 u" D! z s (command "DTEXT" PAUSE hght "") )
3 p% i1 d* T) u& Y! t( A(defun c:teh () (texthght)) (defun c:texthght () (texthght)): e, g& ]% o( k8 W2 B
. v: e) Q+ e2 V, R/ [; G;;; ================ BAT -TAT CHE DO GACH CHAN TEXT =================# [) T2 K6 ?9 M/ r F
+ c; j3 A# ~' {3 b(defun c:tuu () (setvar "cmdecho" 0)
6 R" v6 k9 B' `+ T; s8 K (prompt "\nHay chon dong TEXT can gach chan ")
* A0 S6 |# b s# p" Z (prompt "\nSelect objects: ")
- I! c, ?* C0 z* b- Q7 Z0 ~ (command "select" "au" pause)
- S( J- m5 t0 S6 [4 ]) j; n& Y (setq sstxt (ssget "p")
" m2 ^' h: W" S# X5 L4 K F! L sslen (sslength sstxt); r# C, u( C* ?) u6 f0 w
ctr 0 )% x$ t+ B @: f: S
(command ".undo" "mark") [5 Y' `: F, R3 ?4 `& N2 Q
(while (< ctr sslen); t2 Y1 R! o" C1 e
(setq listxt (entget (ssname sstxt ctr))
+ _4 d! p% u/ r! V txttxt (cdr (assoc 1 listxt))* b' y! {2 X7 i" ?/ {: T
enttxt (cdr (assoc 0 listxt)) )
3 W8 }' ^9 @4 d* c: a (if (= enttxt "TEXT"): W6 B8 R1 L' }# |- s# V& a
(progn, x0 }0 O% _, m/ C
(setq testxt (substr txttxt 1 3))+ n) ]8 H8 Y/ T# X: |. r! p
(if (or (= testxt "%%u") (= testxt "%%U"))
4 ^) q$ D) p( V/ Y2 K+ d (setq newtxt (substr txttxt 4))
; O" o6 \1 ^$ m& M( J l (setq newtxt (strcat "%%u" txttxt)) )
* K' N$ x# K1 x# A5 i2 o. | (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))
/ u I4 d/ I, C( Y (entmod listxt) ) )4 T0 f( d- I9 ]) Q
(setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))
: ^! x0 J, T' k7 L" ~7 S0 K: f2 V: G2 f h, W& Q: P
;;; ================ BAT -TAT CHE DO GACH CHAN TEXT =================
X& E8 X t4 X8 J5 }$ ~# k, I0 ]( o' A! F
(defun c:tob () (setvar "cmdecho" 0)* V7 N3 k! O+ O4 z& f
(prompt "\nHay chon dong TEXT can gach tren dau ")
3 }, E7 y8 j Z+ a/ I, K7 n t! `9 v4 S (prompt "\nSelect objects: ")6 p o3 d) U0 k
(command "select" "au" pause). s' P2 S. n* Z. L3 z4 u; o
(setq sstxt (ssget "p")
" `6 p4 R# e) K% M0 S. T sslen (sslength sstxt)- u, F e- L3 M# G
ctr 0 )
- u: O+ p8 d, r$ x3 l( ` (command ".undo" "mark")
" E. E3 ~; \0 q0 ] (while (< ctr sslen); \2 w. o2 q) P5 l" m
(setq listxt (entget (ssname sstxt ctr))7 s0 _- d5 ~ t, X7 l1 o+ O; r$ ~4 d
txttxt (cdr (assoc 1 listxt))
! [$ S1 q: h, M7 a# `* a enttxt (cdr (assoc 0 listxt)) )
3 c% _) a, a( P+ t, O( _ (if (= enttxt "TEXT") O8 M, w) Z' H5 y
(progn
9 b1 a2 x% I. j+ A- j+ o+ a t (setq testxt (substr txttxt 1 3))
3 }. ?' c @ G+ z2 W (if (or (= testxt "%%o") (= testxt "%%o"))& r4 H# q9 d- q- J# n; x$ M
(setq newtxt (substr txttxt 4))
& d3 i" r' g' Y4 r (setq newtxt (strcat "%%o" txttxt)) )
% j( O: Y0 t1 b/ g5 ^ (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt)), p1 B0 C' b8 G9 i, s4 q
(entmod listxt) ) )
0 O5 }: P4 E# p, C (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))
( c7 \7 V8 b& m. j2 t! N" b& K% U. G& N( C6 F5 O' a
;;; ========================== Tim & thay the TEXT ==========================
2 F% M+ F1 E; B* C8 [) ?
+ | ?- m- ~# }9 o(defun frstring (str search replace / str1 str2 index find)1 C) W8 o) P3 g9 f( a5 P' Z
(setq index 0) (while (<= index (- (strlen str) (strlen search))) (setq index (1+ index)). W" Q& D1 D' |, J* F; u$ I- h. T( t
(setq find (substr str index (strlen search))) (if (= find search) (progn (setq str1 (substr str 1 (1- index)))& H+ f) p! R6 t0 I8 A( R* b% ^
(setq str2 (substr str (+ index (strlen search)))) (setq str (strcat str1 replace str2)) ) ) ) (setq str str))
7 o( X" T. o" u& |# Y% c(defun hai (/ dial). ?, G& r8 p5 @9 k
(setq dial (load_dialog "hai.dcl")) ;;goi dialog
7 I5 K8 u, s* e: v5 q, `8 J$ K0 {6 t. f0 z (if (not (new_dialog "find" Dial)) (exit)) ;;4 t* W+ ~/ {8 G4 A) ]9 s# u0 Z3 F
(mode_tile "find" 2); Tao dau nhac tai hop thoai' n* d/ x C5 h; Q! A2 E7 U
(action_tile "find" "(hai1)")
7 S( p+ D$ _; H$ h. [" O* \ (action_tile "replace" "(hai2)")) o; g4 W v' S4 g- e
(action_tile "cancel" "(done_dialog) (exit)")
% Y3 C" L- c6 R4 k; Q; l& H8 v% k (start_dialog) A. x# G( P! V$ V. R
(unload_dialog dial))1 h5 L9 C% R) C% x) U+ N3 B- \! Z
(defun hai1 () (SETQ str1 (get_tile "find")))' @, c* ` X' R5 D% W
(defun hai2 () (SETQ str2 (get_tile "replace")))) w3 b0 U4 Q' d) R+ o2 i
0 ^# g- O% q! R4 k5 V4 J) h(defun c:TTT (/ a str str1 str2 newstr taphop sodem)
8 s1 ?) y& g5 I# L% _ (hai)
3 h9 q) j/ K* H B" j4 q7 Y (if (or (null str1) (null str2)) (princ "\nDu lieu khong hop le")
! F& h! \6 C+ { v/ K9 } (progn
3 A X; l' R, V! g: Z% z6 o1 J (setq taphop (ssget '((0 . "TEXT"))))$ ^$ t: O) |5 z5 @
(setq sodem 0)
. q+ y2 [7 a9 l9 P L Y (if taphop2 Y. I& l* \) j/ G8 G
(progn
7 t5 U$ q- O0 o9 Y# ~ (Repeat (sslength taphop)# Q: s/ U8 F1 }
(setq a (entget (ssname taphop sodem)))/ X7 ^! P; q# u5 @7 @3 J8 _
(setq str (cdr (assoc 1 a)))9 G5 S( A1 l; n1 y* ?- G
(setq newstr (frstring str str1 str2))
: p. b! x5 `# Q, |2 Q" B (setq a (subst (cons 1 newstr) (assoc 1 a) a))
2 G0 r6 ?2 ?" Q; b2 d (entmod a)
/ L7 R1 ^' }' k ]- R (setq sodem (1+ sodem)) ) )
4 i* u" O' W0 U+ [& a" ] (princ "\nNone "TEXT" selected") ) ) ) (setq *error* olderr) (princ))
6 \: ]/ c, o8 O! W! P
; V8 Q6 Y* t- K+ b0 ~; c5 C a: M;;;============================= CHTEXSTY.LSP =============================$ G( H$ ^ f/ q3 t$ ^0 \/ i$ D9 F
6 a! f8 I; E) q9 l+ E(Defun C:TXS () (Setvar "Cmdecho" 0) (Initget 1 "SE ST ")
/ U0 G$ }9 f- d7 I8 q# n6 t(Setq G (Strcase (Substr (Getkword "STyle/<SElection>:")1 2)))
" S" \( E$ C$ x$ P4 q+ U(Cond ((= G "SE") (Setq A (Ssget)) (Setq B (Sslength A))
+ h. D# S3 Z. O$ S, t- V(Initget 1) (Setq C (Getstring "\nEnter new text style: "))! { N4 p! J$ w1 T' s, b: B
(Extang C) (While (> B 0) (Setq B (1- B)) (Setq D (Ssname A B))
3 d- N! ^, d3 O- c7 k I- B% t3 x(Setq D (Entget D)) (Setq E (Assoc 7 D)) (Setq F (Cons 7 C))6 H' f6 |( d4 \
(Setq D (Subst F E D)) (Setq H (Assoc 51 D)) (Setq I (Cons 51 J))
% Z3 F& e9 Z. V+ C d(Entmod (Subst I H D))) (Setq A nil)) ((Or (= G "ST") (= G ""))
) L" I _7 t1 t, z(Initget 1) (Setq A (Strcase (Getstring: o9 l$ Z4 \- U8 y/ {+ p, o
"\nEnter text style to change: "))) (Initget 1)
( S2 w7 t% [: ](Setq C (Getstring "\nEnter new text style: "))(Setq D (Entnext))
& H: F, a) C1 n6 F- m% t(Extang C) (While D (Princ ".") (Setq E (Entget D)) (If7 @7 y. d* v8 A' l# G0 `0 q. h
(And (= "TEXT" (Cdr (Assoc 0 E))) (= A (Cdr (Assoc 7 E))))6 m- M0 H9 |" p5 w
(Progn (Setq F (Assoc 7 E)) (Setq G (Cons 7 C)); b: g8 R( O1 F5 j" J! c
(Setq E (Subst G F E)) (Setq H (Assoc 51 E)) (Setq I (Cons 51 J))
% J& R- s# @5 `) @(Entmod (Subst I H E)))) (Setq D (Entnext D))))) (Princ))
' X& F; L4 e, f9 g+ N% p' a, v8 @, n1 p& {. W
(Defun Extang (A) (Setq A (Tblsearch "STYLE" A))
7 r$ i; k% q+ G5 e(Setq J (Cdr (Assoc 50 A))))
$ Z# W2 [+ \( _. p4 \6 G& q& i/ a1 z- E7 n( @
;;; ============================ DRAW CLOUD =============================
2 a+ _, v3 e9 Q. V$ d; x' n
' U* W& a2 k( |1 F8 Z(defun CLOUD (/ pt1 pt2 arc1 cnt ss la) (setvar "cmdecho" 0)9 ^9 E3 S4 _1 k7 M! H' L
(prompt "\nVe cloud (may) khong khep kin - Tu khep kin ve diem dau!"); S+ S5 k* x4 L* }
(setq la (getvar "clayer"))
, m" @6 _% U% h$ M (command "layer" "m" "cloud" "c" "5" "" "")
7 x# V( s6 H! ]# P6 f$ ?+ C/ H( ~) u (setq pt1 (getpoint "\nEnter first point of Cloud: "))3 u1 U. g1 d7 Q7 ~6 b
(if pt1 (prompt "\nProceed in a COUNTER-CLOCKWISE direction...")), A* R& S6 g4 f: G; \
(setq cnt 1 ss (ssadd))0 G7 D) x4 `6 t/ V" U# w4 V, B
(while pt1 (setq pt2 (getpoint "\nEnter next point - and close: "))
4 B! f) e# J% `) Y( ^9 k1 b2 O (if pt2 (progn (command "arc" pt1 "e" pt2 "r" (/ (distance pt1 pt2) 1.75))
, L4 c8 g# o, B- \$ K6 f (if (= cnt 1) (setq arc1 (entlast) cnt 2) (ssadd (entlast) ss)) ))( J: I2 h' a( i2 Z
(setq pt1 pt2) ) (setvar "highlight" 0) (if (> (sslength ss) 0)
_3 Q, H9 f5 L; Y* \5 d/ | (command "pedit" arc1 "y" "j" ss "" "x")
1 }- Q1 Y% V' J3 Z (if arc1 (command "pedit" arc1 "y" "x")) ) (setvar "highlight" 1)
) W9 O+ a" B4 j! @& |0 U (command "layer" "s" la "") (setvar "cmdecho" 1) (princ)) % {0 k5 m! p, a
(DEFUN C:CLOUD () (CLOUD)) (DEFUN C:CLO () (CLOUD))" d/ l! m/ w1 d( s1 M) T
- y8 Z0 ]3 M, g3 v k: x" D5 d4 E# K
;;; ================================ Funtion-Dulieu ========================% G8 m5 ?& ]/ ]. B% C& L
;;; ================================ Funtion-Dulieu ========================
' _" u7 u* y) y# X3 |5 \1 r;;; ================================ Funtion-Dulieu ========================8 ~; S8 l* [- P6 U" L7 l' f
" a( {* L! v3 P9 H! L(defun ha:nhap (kytu thamso) (princ kytu) (princ thamso) (princ ">: ") (setq key (getint)) (if key (setq thamso key)) (princ thamso) ): G5 @* Y: U7 S: d% y
(defun ha:thoat () (reinit) (setq Temp "Da thoat khoi chuong trinh")). h' v0 b( O' H4 ~) k$ R/ m
(defun khoangcach (kh khq11 khq12 / h0 h1) (setq h1 (polar kh (angle '(0 0) (vectophap khq11 khq12)) 500)) (setq h0 (inters khq11 khq12 kh h1 nil)) (distance kh h0))7 c) x; F! v& t' V' V) Z
(defun hacat (hacat1 hacat2 / hacat3 chon) (if (and (/= hacat1 nil) (/= hacat2 nil)) (progn (setq hacat3 (polar hacat1 (angle hacat1 hacat2) (/ (distance hacat1 hacat2) 2))) (setq chon (ssget hacat3)) (command "break" chon hacat1 hacat2) ) ) (princ) )
+ r' L: x2 I& C& T, H& G(defun hauon (hauon1 hauon2) (command "fillet" hauon1 hauon2))
# M0 c( k9 p- l. E(defun init () (setvar "blipmode" 0) (setvar "cmdecho" 0) (setvar "angbase" 0))
/ H `' G9 y, c/ F1 }4 n$ S2 m4 t(defun reinit () (setvar "cmdecho" 1) (setvar "osmode" 0))
& W) i- z9 \$ \7 [(defun tichvecto (vecto1 vecto2) (apply '+ (mapcar '* vecto1 vecto2))) t( V1 Q) e Q
(defun vectophap (v01 v02 / vectochiphuong) (setq vectochiphuong (mapcar '- v01 v02)) (list (cadr vectochiphuong) (* -1 (car vectochiphuong))))- F# B$ Y& G0 m0 q
(defun ha:giaodiem (dc1 p1 p2 / hc hc1 diem1) (setq diem1 (vectophap p1 p2)) (setq hc1 (polar dc1 (angle '(0.0 0.0) diem1) 100)) (setq hc (inters p1 p2 dc1 hc1 nil)))
: c3 e% | v5 a- A(defun dtr (dtr) (* pi (/ dtr 180.0)))
( G( N* ~" q. H/ s(defun rtd (rtd) (* 180.0 (/ rtd pi)))
4 z E# Y7 w( G+ F1 o7 z1 [ j( d% g' b. k W7 K/ \8 C7 F' V
;;;==============================PROGRAME===============================
" _3 }* ?) A/ r# K6 G3 o/ x;;;=====================EditDiM Hien Hop Thoai Dep======================
, i1 H& X0 u* p% L0 S& Y;;;==============================PROGRAME===============================
' X3 J& ]& @* W, M
/ {+ Q1 `7 n. V9 L: n: G;;Dth Edit Text, Dimtex & Attributes(Chu Co Thuoc Tinh)/ a) `- u* x. g1 r( a; h
;;Chay Cung Du Lieu.Lsp & Hai.Dcl
. |0 @* e, J- E7 \& `) u" c' y* @(Defun Hai_Edim (Chon / Dial State Str Oldlis Dimdefault Pt10 Pt13 Pt14 St Ang Dis Pt Hc)5 z2 j' b0 j( m( O% Y5 o1 l8 Y
(Setq Oldlis (Entget (Car Chon))
" k% m2 z# o s" ]9 [ Pt10 (Cdr (Assoc 10 Oldlis))' z) l; U9 G% M4 v# E' g0 c( \ B
Pt13 (Cdr (Assoc 13 Oldlis)): U4 k5 m# E/ ?* g4 V- e) `
Pt14 (Cdr (Assoc 14 Oldlis))+ q6 r% C9 b! {& M4 H) j& ^: X" u
St (Cdr (Assoc 70 Oldlis))* |0 |% C& e% y, e( F
Dimdefault (Cdr (Assoc 1 Oldlis))
0 J! q/ w8 T* }, I )* q* g0 `, X* C' o3 L% z% E
(Cond& T) y8 i5 E& y# Q' c
((Or (= 32 St)(= 0 St)(= 160 St))- h9 |9 d8 c& [/ s# v; G5 l1 G
(Progn
) Q) Q" K9 R* i8 j; J. n4 V+ h (Setq Ang (Cdr (Assoc 50 Oldlis))0 |" f( \2 w3 Y' s9 C
Pt (Polar Pt13 Ang 500)( K& a- M8 S$ v
Hc (Lay_Hinh_Chieu Pt10 Pt13 Pt)/ B, S; {( h, D, g a7 c; @
Dis (Rtos (Distance Pt13 Hc))+ D* A" p' J0 L' t
)/ _9 e8 y, Q5 B! e- P$ A" o5 A
)
. s9 W0 ~% @8 v )
" E" Z A! o, I$ w; q' a* V; W; A ((Or (= 33 St)(= 1 St))
8 F- k" {& ]4 n& ]7 R8 @ (Progn(Setq Dis (Rtos (Distance Pt13 Pt14)))))
1 F9 Y0 T- G h$ |6 F );;End Cond
% M0 h: F; P8 k! o: x7 ~ (If (= Dimdefault "") (Setq Dimdefault "<>"))
E) m% b( \/ ?0 R% a& V. q (Setq Dial (Load_Dialog "Hai.Dcl"))( e0 I( i0 `( S& Y6 z4 D
(If (Not (New_Dialog "eddim" Dial)) (Exit))
, i8 ?3 Z( g" X; K" ^7 v (If (Or (= 32 St)(= 0 St)(= 160 St)(= 33 St)(= 1 St))2 v7 ]) z, `9 i, k; F
(Set_Tile "text" Dis))
& h- F) l, p# q (Set_Tile "ha:edim" Dimdefault)" b t% p, Y9 p; N
(Mode_Tile "ha:edim" 2); Tao Dau Nhac Tai Hop Thoai
7 l& i$ K1 c+ {/ V# \. J (Action_Tile "ha:edim" "(Setq Str (Get_Tile \"ha:edim\"))(Done_Dialog 3)")
4 U) l2 s: n2 L (Setq State (Start_Dialog))(Unload_Dialog Dial)# @" a, p; Y# M( V }
(If (And Str (= 3 State))
3 k2 F, {- {; x- N (Progn
! _6 |+ \5 Y9 V0 A! [" Z) c. U (Setq Oldlis (Subst (Cons 1 Str) (Assoc 1 Oldlis) Oldlis))(Entmod Oldlis)))
& K/ X% }2 z3 s )) r1 N7 o2 m( \! U/ _+ U6 h5 e! v
(Defun C:EH (/ Chon Name )1 D5 L" W' R A2 A h
(Defun *Error* (Msg)
7 M; y+ u/ P& a (Princ "\nerror: ")(Princ Msg)(Princ " ")
9 D' m) ?& n4 i& C: F (Start_Dialog)(Unload_Dialog Dial)9 C! _4 @( u& b7 |" N* J
(Setq *Error* Olderr)(Princ)
" ^- ^4 N0 l; `: l: n( p )
T v; k. W% s (Setq Olderr *Error*): Q5 |$ {8 {% I
(Setq Chon T)
8 j3 x2 z. T; |$ \6 x) O" s! G (While Chon
. X: r3 L" ]' C! ^- q. ~% q (Setq Chon (Entsel "\n\n\nSelect Text, Dimtext Or Attributes To Edit...")). w# F6 I- j" i }6 R' \; L
(If Chon5 B& A0 { Y+ y$ i" v5 L
(Progn
h+ i9 x9 u2 J4 B1 D; T$ } (Setq Name (Cdr (Assoc 0 (Entget (Car Chon)))))
1 N3 \5 X8 X4 G2 e# h3 m; p1 V! N (Cond* z& S, ~# |% ~9 ~( o
((= Name "INSERT")(Command "Ddatte" Chon))$ |2 {! v* i' \; G' y% p. Q
((Or (= Name "TEXT") (= Name "ATTDEF") (= Name "TOLERANCE") (= Name "MTEXT"))(Command "Ddedit" Chon ""))( V, `1 u8 r P7 o
((= Name "DIMENSION") (Hai_Edim Chon))' h6 `& S- F4 I8 n+ b, d5 D
)2 y, l& Q8 U# ]3 Y3 c! I
);End Cond
5 S0 o) @5 |3 W' e8 R );End Progn
7 v4 i; D+ y! N& O, ^ );End While
" T7 ?( H+ S! D3 y7 L, ^& ~ (Setq Olderr *Error*)(Princ)
2 g! z- Q& G+ E7 X# i. x, E/ k );End Program
4 q5 F0 f9 l( r0 @- L+ y2 Q0 C! [& u2 u. G2 R0 \
;;;====================DDeditDim=====================
0 T& z$ e3 C& Z6 ]( i& j$ s;;;=====================Hai.DCL====================== h3 ?7 g& b+ U1 y/ H
;;;====================DDeditDim=====================
! j, x& k" f( ^) f m" ?! J
; j2 `. d @" p- N8 z! m;;Dth Edit Text, Dimtex & Attributes(Chu Co Thuoc Tinh)
& L# e, K- H: a; D4 G4 h+ s. J;;Chay Cung Du Lieu.Lsp & Hai.Dcl
& q! n8 `' j0 Y- j2 m- M* }(Defun Hai_Edim (Chon / Dial State Str Oldlis Dimdefault Pt10 Pt13 Pt14 St Ang Dis Pt Hc); n _& B$ [- [2 ]2 l/ [
(Setq Oldlis (Entget (Car Chon)) Z$ D5 Q, W# H+ j' V2 C$ k c
Pt10 (Cdr (Assoc 10 Oldlis))
% e i8 J2 \4 I2 Q& N Pt13 (Cdr (Assoc 13 Oldlis))* s6 h& R' V: M' |6 ~
Pt14 (Cdr (Assoc 14 Oldlis))* p6 `5 ~) c; j- r, c% v" c
St (Cdr (Assoc 70 Oldlis))5 p( T! \- x* h. t
Dimdefault (Cdr (Assoc 1 Oldlis))
* F$ J$ a' P. b+ D5 u( H5 h2 i6 K )
# `* _9 R) U/ [* l. O# \1 \ (Cond: y/ N9 O( u# D( P( {& ^2 H
((Or (= 32 St)(= 0 St)(= 160 St))
: w$ o8 E7 D+ ^. X! D b3 G (Progn
" O- V6 N5 L8 X (Setq Ang (Cdr (Assoc 50 Oldlis))* X' o4 }7 R) h/ A
Pt (Polar Pt13 Ang 500)& T' f: O& u/ K0 W3 c' D
Hc (Lay_Hinh_Chieu Pt10 Pt13 Pt)
3 }" e9 @% t p Dis (Rtos (Distance Pt13 Hc))
0 |7 M+ \3 s/ G6 ~* ^4 m( s )
" g, D: t3 b! W; x+ `# _ )
2 d$ J/ C( L. Z) p' |4 |5 y )) [- k; Y. S1 W( U0 ~% l
((Or (= 33 St)(= 1 St))
$ `/ d$ _) \% t (Progn(Setq Dis (Rtos (Distance Pt13 Pt14)))))
2 L2 }5 d& U2 V! o( |3 S );;End Cond7 g( P1 |1 }4 G5 b$ J/ z" z
(If (= Dimdefault "") (Setq Dimdefault "<>"))
2 _1 Q c2 r x3 f; L ?+ t- @ (Setq Dial (Load_Dialog "Hai.Dcl"))" ^9 H8 ^7 ?( y ~# e
(If (Not (New_Dialog "eddim" Dial)) (Exit))
7 ?$ P! U) {) w' t. ~( Y7 Z4 V (If (Or (= 32 St)(= 0 St)(= 160 St)(= 33 St)(= 1 St))9 W4 k. B V+ }0 c6 C4 A5 w3 I1 ?
(Set_Tile "text" Dis))) m! p6 D+ x6 D
(Set_Tile "ha:edim" Dimdefault)
% ?7 W# U# ?4 k, P7 G (Mode_Tile "ha:edim" 2); Tao Dau Nhac Tai Hop Thoai
2 l# L: V' @7 x- T+ a (Action_Tile "ha:edim" "(Setq Str (Get_Tile \"ha:edim\"))(Done_Dialog 3)"), M3 o9 x4 t4 t* W* I/ s* H+ [
(Setq State (Start_Dialog))(Unload_Dialog Dial)
0 t: O/ v) l7 r8 w& c- Q (If (And Str (= 3 State))# _: E. [ U0 m
(Progn
0 u) E% m I! ~! W; A, z9 h" n (Setq Oldlis (Subst (Cons 1 Str) (Assoc 1 Oldlis) Oldlis))(Entmod Oldlis)))
( u- ?' d, ~% Z8 w3 h# P )& n1 B9 |1 z, b0 w3 r: W/ q
(Defun C:EH (/ Chon Name )
7 v1 g+ C9 [) F% f6 b" }# \, ^# e# v# v
7 Z0 i' x- x3 X! j- r;;;********************Du Lieu********************
. w, s5 t' T- r$ l+ [1 `6 o
; w( m* v1 u# u1 w, R% q$ B1 q(Defun Ha:Thoat () (Reinit) (Setq Temp "Da Thoat Khoi Chuong Trinh"))% @4 p* C* B1 M) W" a( J0 r8 T# L
(Defun Hacat (Hacat1 Hacat2 / Hacat3 Chon), V' e1 k- ]+ C: Y9 j s
(If (And (/= Hacat1 Nil) (/= Hacat2 Nil))
& L9 ?' C2 ~! w$ b (Progn3 c0 K) f: M: e3 \3 I
(Setq Hacat3 (Polar Hacat1 (Angle Hacat1 Hacat2) (/ (Distance Hacat1 Hacat2) 2)))
' K) y6 j) ~- ^! G (Setq Chon (Ssget Hacat3))" A. w9 N3 L& g% {" ?% O% f
(Command "Break" Chon Hacat1 Hacat2)
1 J& S' K& G4 I6 P )3 G8 X. x3 h+ l4 ^
)0 V8 M4 t- D7 E0 P, [2 I% ~
(Princ)) Y% f* F( X/ u, C& Q
)5 R% q0 [) Y1 Z, S w" b3 [
;;* D$ A. a: p- s6 }) g
(Defun Hauon (Hauon1 Hauon2)(Command "Fillet" Hauon1 Hauon2))
6 @& m; Z1 {9 [;;4 m1 M2 j3 O2 C# g. Z
(Defun Taolop (Mau Lop / A)(Setq A(Tblsearch "Layer" Lop))(If (Null A)(Command "Layer" "_N" Lop "_C" Mau Lop "")) (Setvar "Clayer" Lop))
3 J, a/ _8 f9 x$ G;;+ H- ~: j' I6 O5 d+ }, H* Q0 R
(Defun Init ()(Setvar "Blipmode" 0)(Setvar "Cmdecho" 0)(Setvar "Angbase" 0))
% L G K, d! B, H5 K, z9 Y;;
, j. E0 e6 W- {( f4 g(Defun Reinit ()(Setvar "Cmdecho" 1))& {1 c! B1 m- p+ N" e
;;
# C+ w$ |6 a; o2 e4 j2 w(Defun Tichvecto (Vecto1 Vecto2)(Apply '+ (Mapcar '* Vecto1 Vecto2)))
0 ~5 Q) [' G0 d Q;;
0 E' r5 z+ h8 M. G) ? N;;Cho 2 Diem Tinh Ra Vec To Phap# L) W I; z" {* m/ I
(Defun Vectophap (V01 V02 / Vectochiphuong)(Setq Vectochiphuong(Mapcar '- V01 V02)) (List (Cadr Vectochiphuong) (* -1 (Car Vectochiphuong))))
8 E% B0 m/ B# @;;Xac Dinh Vi Tri Hinh Chieu 1 Diem Len 1 Duong Thang" {) O" Y G% |1 E1 o
;;Da Biet 2 Diem Thuoc Duong Thang
+ F0 L( ~ v. Q3 C( e(Defun Lay_Hinh_Chieu (Dc1 P1 P2 / Hc Dc2)$ R: m+ A8 Q0 z g
(Setq Dc2 (Polar Dc1 (+ (/ Pi 2) (Angle P1 P2)) 100)
- _' A2 _: E$ S4 S* X+ ?; ]0 _ Hc (Inters P1 P2 Dc1 Dc2 Nil)))7 ^! v! c6 K4 a9 A) l1 k
;;Xac Dinh Khoang Cach Tu 1 Diem Len 1 Duong Thang
/ m' d7 p9 i7 t3 f( \;;Da Biet 2 Diem Thuoc Duong Thang
( Q5 }; S0 Y! T/ m; b. S4 H& ?& O(Defun Khoangcach (Dc1 P1 P2 / Dc2 Hc)6 J0 H0 q9 _( z: f# @) `% x" u! e
(Setq Dc2 (Polar Dc1 (+ (/ Pi 2) (Angle P1 P2)) 100)& A5 s; |2 ]: r+ {! r! y
Hc (Inters P1 P2 Dc1 Dc2 Nil))# @; k) v6 z) U; j1 B7 N
(Distance Dc1 Hc), C" ?2 U' b$ O7 f9 p/ P5 u& p. W
)
: d8 B) G6 A: n(load "nhapcua.lsp")
/ O/ l: K8 F4 i: a* S (Defun *Error* (Msg)6 K2 q6 X; G3 s% m1 `
(Princ "\nerror: ")(Princ Msg)(Princ " ")
5 O. w9 g; a( h- o1 h (Start_Dialog)(Unload_Dialog Dial)
7 f% S3 G: O. b: r+ L( O0 a (Setq *Error* Olderr)(Princ), E1 N; n7 [5 l/ l- A1 d9 H
) D8 |1 t: J9 x ?9 e7 u
(Setq Olderr *Error*)5 c# z* w8 [5 s
(Setq Chon T)
6 N, W O' S* u2 Z (While Chon6 d: }0 [6 g5 @! i. c! }
(Setq Chon (Entsel "\n\n\nSelect Text, Dimtext Or Attributes To Edit..."))6 u$ l$ K( b$ N+ N5 V
(If Chon
& w7 T) _8 i+ ?/ t5 i5 A (Progn
' f4 H5 A! C0 R3 D% G) E* G (Setq Name (Cdr (Assoc 0 (Entget (Car Chon)))))
4 s/ i" z+ x6 k5 b; R: c; S (Cond
3 q. h, t' S& b) `% R ((= Name "INSERT")(Command "Ddatte" Chon)): F7 r* Z2 L0 r/ H* ]; ?* t
((Or (= Name "TEXT") (= Name "ATTDEF") (= Name "TOLERANCE") (= Name "MTEXT"))(Command "Ddedit" Chon ""))
7 Z/ d+ E. w$ ^! i$ e ((= Name "DIMENSION") (Hai_Edim Chon))
! Q4 D6 s; g* x% I) z )
7 W4 b1 B7 W0 M7 A) u, Q9 |+ ` );End Cond
( T7 @+ i. ?7 m# ?8 T );End Progn
# n F9 `: C' K @& N9 G2 Z0 T6 | );End While
: S" h0 F- R% t% z8 v, ` (Setq Olderr *Error*)(Princ)
3 O& W$ Q% V ]: R. n9 o );End Program) I' f5 k, y% [- B% y
1 F) \: o( }8 |& K: \ J
; F) `9 C! V U5 ?( V+ V
7 }+ t! v* ~+ q% G) Y4 Q;===================HAI DCL Nhapcua.LSP De chay Hop Thoai EditDiM===================( _3 t _) t8 m9 H3 k8 A% w7 W3 z8 G
;====================================Nhapcua.LSP====================================
1 u7 J! z6 u" o6 u5 n;===================HAI DCL Nhapcua.LSP De chay Hop Thoai EditDiM===================, w4 S+ v; U: e: i: V8 P* ^' ^9 F. j
5 Q# V b7 x Q4 Y1 t
;;; ============================ Ve Hinh chu nhat ==================================
9 z" K" O& f K( m- T$ ?+ l(defun HCN (/ olderr ocmd oblp pt1 pt2 pt3 pt4 l w) @+ I! Y% i- I2 J* c0 Z4 k
(setq ocmd (getvar "cmdecho"))
+ q2 m8 P# x& [0 X- B (setq oblp (getvar "blipmode"))' u% @2 a5 S/ P1 O9 m' B, Z) v% n
(setvar "cmdecho" 0)
9 @ o7 b f0 s4 J4 b w (initget 1) ;3D point can't be null
0 ]+ Y3 t3 f, [8 s( ?1 v. L (setq pt1 (getpoint (strcat "\nCorner of rectangle or square: ")))
5 E9 P7 v# `) B- _9 d/ s (setvar "ORTHOMODE" 1), F; _; [* d4 f' w g+ t Y
(initget 7) ;Length can't be 0, neg, or null7 m" Y, t, W- F" _# ^; _' @
(setq l (getdist pt1 "\nLength: "))
% ~) ~* F$ F/ R' [4 | (setq pt2 (list (+ (car pt1) l) (cadr pt1) (caddr pt1)))
. g7 l; w$ F, Z: b( G5 B( U/ f (grdraw pt1 pt2 2)& n3 l* j! f9 f1 h- y
(initget 7 "Square") ;Width can't be 0, neg, or null$ w# V( b; M, `' e: j3 O: E
(setq w (getdist pt1 "\nSquare/<Width>: "))( F P3 S+ F6 z% K- n/ n
(if (= w "Square") ' D/ Z; J8 M' {! P, z8 V, G
(setq w l) )
, G% m( ~4 U' A8 c (setq pt3 (list (car pt2) (+ (cadr pt2) w) (caddr pt2)))
1 U! ^9 Z# s/ `- c (setq pt4 (list (car pt1) (+ (cadr pt1) w) (caddr pt1)))0 J$ g3 `- B$ j2 `+ {, q H8 {5 H
(grdraw pt2 pt3 2)' q, s# t5 t0 M& z9 ?
(grdraw pt3 pt4 2)
7 u3 i Z: ^( Z% z9 ] (grdraw pt4 pt1 2)* M& R2 w* R4 i: s0 q
(setvar "ORTHOMODE" 0)" Y8 l+ L8 Q! i: v5 g7 i4 @: w
(command "pline" pt1 pt2 pt3 pt4 "close")1 I) ^. `$ X% q/ [
(setvar "cmdecho" ocmd)$ i6 b( h' P& f! b" d$ p( E
(setvar "blipmode" oblp) (princ))+ J8 R/ W" F$ S' } Q' ^
(DEFUN C:HCN () (HCN))5 `- T% V! [' B6 j
! G$ T2 q9 s& l' e% O+ l
;*******************;*******************;*******************;*******************
5 e8 Y3 t/ Y& z$ H;****K E T C A U****;****K E T C A U****;****K E T C A U****;****K E T C A U****5 Z/ _1 t$ \' \
;*******************;*******************;*******************;*******************
5 J/ z: [$ n# a1 |- d
) Y9 ]* J" ?' l! k( {8 V;VE HINH BINH HANH8 s5 |& @" T* k# G: F' e$ H
( s0 |5 Y6 k" v z4 M: v/ ~$ y
(defun c:binhhanh (/ p1 p2 p3)
. D$ f+ N" s1 E* \/ A( x- B (setq p1 (getpoint "\n Nhap diem thu nhat:"))
; u" Q3 z9 x r$ d2 [2 G (setq p2 (getpoint p1 "\n Nhap diem thu hai:"))$ Q1 |, R i( K7 w
(setq om (getvar "osmode")), Y: ^& i0 D# a4 E' f
(setvar "osmode" 0)
3 I& J% R0 z" H8 |' U; h7 l (command "line" p1 p2 "")
( W. W; U3 @2 C2 j$ o(setvar "osmode" om)
. S. p; I" ]8 u3 z. h (setq p3 (getpoint p2 "\n Nhap diem thu ba:"))! X7 I. S( [, T z' S
(setq a (angle p2 p1))
, E; G4 V- b) O. M) r6 F (setq d (distance p1 p2))6 h ?6 z! A2 k# V4 o& M+ ?1 m
(setq p4 (polar p3 a d))
; I/ d0 C+ o( Q (command "OSNAP" "none")& c; l0 W6 @( @1 z& |2 h! Z
(command "erase" "l" "")$ L1 z$ o# d. d2 w+ t- M
(command "pline" p1 p2 p3 p4 p1 "")
1 l0 E& z3 n' B" S5 x3 |* t+ [(setvar "osmode" om)" e" t$ z3 I5 q* @
)
# D. M2 q" @& e- I5 {
* \) Z# {, q, `7 L( q4 M;VE LUOI COT
* o0 W N2 y8 |, P2 O( i u* Q
$ s: Y8 I9 e1 X, X- g(defun c:LuoiCot ()
- _- D" i; S- ]! a$ c(setq om (getvar "osmode"))
/ q9 M2 Z" J9 U0 F3 p/ G(setvar "osmode" 0)
2 r9 J, d* J0 X. } h (setq tile (getreal "\nCho biet Ti Le ve 1/x, x="))
& H: j0 s2 e n. M7 G( h4 P- [ (setq p0 (getpoint "\n Chon Basic Point:"))/ ~# p% E3 I* Z4 C; Q
(setq nc (getreal "\n Nhap chieu ngang cua cot : "))
$ B- ?' A+ k* G3 p) P (setq dc (getreal "\n Nhap chieu doc cua cot : "))
# e; z8 O. g7 l) Y5 h (setq p1 (polar (polar p0 pi (/ (* nc hstl) 2 tile) ) (* pi 1.5) (/ (* dc hstl) 2 tile) ) )
A O: X( T& ]7 |/ | (setq p2 (polar (polar p0 0 (/ (* nc hstl) 2 tile) ) (* pi 0.5) (/ (* dc hstl) 2 tile) ) )
0 H: M8 O; ?9 B/ ~7 v* v0 ] (command "rectang" p1 p2)$ Q2 b3 g0 k, W# C( h
(command "hatch" "solid" "l" "")+ o$ j" i# {# Z5 G) B
(setq bcn (getreal "\n Buoc cot theo phuong ngang : "))9 N u8 {- b3 M# J3 P7 G7 |
(setq nn (getint "\n So buoc cot phuong ngang : "))
: O1 q' E1 w0 e6 h1 i/ p7 | (setq w1 (polar (polar p1 pi (/ (* nc hstl) 2 tile) ) (* pi 1.5) (/ (* dc hstl) 2 tile) ) ); j3 b4 j9 ?7 C1 H5 T3 H8 v# O
(setq w2 (polar (polar p2 0 (/ (* nc hstl) 2 tile) ) (* pi 0.5) (/ (* dc hstl) 2 tile) ) ). E/ r4 B) v" f' n1 X
(command "select" "w" w1 w2 "")' \8 E f" p0 S6 u0 R9 q7 h! I$ l
(command "array" "p" "" "r" "1" (+ nn 1) (/ (* bcn hstl) tile) )
. P0 ^. ^' ~0 p& I1 m2 r5 v3 l (command "line" (polar p0 pi (/ (* 1000 hstl) tile)) (polar p0 0 (/ (* (+ (* bcn nn) 1000) hstl) tile) ) "")! d- N0 ~: y% x: M. O0 i
(setq w1 (polar (polar p0 pi (/ (* hstl 2000) tile)) (* pi 1.5) (/ (* hstl 2000) tile) ))
) _" t2 q( ~ J (setq w2 (polar (polar p0 0 (/ (* (+ (* bcn nn) 2000) hstl) tile) ) (* pi 0.5) (/ (* hstl 2000) tile) ))2 m5 r2 k" h6 I1 j; K# U2 L
(command "zoom" "w" w1 w2)
. x. S- L( ?% n2 d7 Q7 ~0 X- j (command "select" "w" w1 w2 "")
5 n0 }6 [* T$ Q7 f: m% J* { (setq bcd (getreal "\n Buoc cot theo phuong doc : "))5 S5 Z' i8 B" s& B
(setq nd (getint "\n So buoc cot phuong doc : "))
, n4 A1 L4 w9 @ (command "array" "p" "" "r" (+ nd 1) "1" (/ (* hstl bcd) tile) )
) v% {: @7 \- @$ o+ ~, B1 c3 w+ i (command "line" (polar p0 (* pi 1.5) (/ (* hstl 1000) tile)) (polar p0 (* pi 0.5) (/ (* (+ (* bcd nd) 1000) hstl) tile)) "")
2 P! a% |3 f: ~( g+ N (command "array" "l" "" "r" "1" (+ nn 1) (/ (* hstl bcn) tile) )* i& h3 K7 N; ?+ S0 P( \
(setq w2 (polar w2 (* pi 0.5) (/ (* (+ (* bcd nd) 2000) hstl) tile)) ) + O- t3 t! R+ e/ W1 B) h
(command "zoom" "w" w1 w2)
3 c. B- q! Q3 G3 \(setvar "osmode" om): O5 j$ n# v5 @. f$ F
)
) y* D: U% L. o: q# Q5 a' U
" _$ ^5 Y/ A) G' `/ D! H. n1 p;VE CUA DI
* x( A1 A( r$ j( \$ |9 u* E( z; |7 |8 D0 }' p2 D
(defun c:cuadi ()
0 v$ K( \9 u$ K1 b, s5 z(setq om (getvar "osmode"))
N- y, t' l$ q, x" H8 }(setvar "osmode" 0)
, o/ z5 q7 g# X, M' n9 }5 E, x1 G/ W. J
(setq tile (getreal "\nCho biet Ti Le ve 1/x, x=")), h+ T8 L$ a$ r* x* K/ B- b
(setq b (getreal "\n Nhap be rong cua : "))& o8 ~ F/ U+ r) Q4 t
(setvar "osmode" om)1 v7 G( h8 Y0 {- D! x
(while (< 0 1)
0 u% ^3 s$ ~( _3 H (progn
6 g- p& D N6 ] M (setq p0 (getpoint "\n Chon Basic Point:"))
& w! L9 B# i9 G7 ~/ C0 q0 A (setq p1 (getpoint p0 "\n Chon diem de xac dinh huong cua cua:"))
1 t9 k7 X' J7 [: B3 D4 o (command "osnap" "none")
% u! p% M3 s5 J/ `: M (setq p2 (getpoint p0 "\n Chon diem de xac dinh huong mo cua:"))
6 ^6 {$ ?9 X5 V (setq a1 (angle p0 p1))5 f0 y1 o. ^; {7 g0 n& }. {! @
(setq p1 (polar p0 a1 (/ (* hstl b) tile))) x8 K, N' E0 q% n
(setq a2 (angle p0 p2))
6 r W& E* X4 l1 X. ]$ t! ] (if (< (- a2 a1) pi) (setq a3 (+ (/ pi 2) a1)) (setq a3 (- a1 (/ pi 2))) )
/ N" U0 V" p- i$ N# I8 h2 A (command "pline" p0 "w" "0" "0" p1 (polar p1 a3 (/ (* hstl 40) tile)) (polar p0 a3 (/ (* hstl 40) tile)) p0 "")
5 f J! P! [' n3 ?3 E (command "rotate" "l" "" p0 (/ (* (- a3 a1) 180) pi))6 X. z, \( w, l# s' S$ N n
(command "arc" "ce" p0 p1 "a" (/ (* (- a3 a1) 180) pi))
' c4 g: l6 ?2 m(setvar "osmode" om)
3 K }. i6 G* G- z2 X))/ d% W/ I" u% F9 g) y, J
)6 Q% T* P/ `" A c5 w7 k: Q
3 d% o. W' u9 |% f9 K; Z# v q
;VE CUA SO
6 i1 ]7 |3 e8 u3 N6 `7 r4 ^3 Y( { s0 ]) K! p5 [
(defun c:cuaso ()$ S$ j, C$ o9 p; A0 q; U8 Y G. }
(setq om (getvar "osmode")) l* t6 U$ q8 ^1 R h) q
(setvar "osmode" 0)
- e# }" s8 _/ y& }% X% t6 t1 S' F( f
(setq tile (getreal "\nCho biet Ti Le ve 1/x, x="))# Z: h4 x8 Y" X9 F. U/ C
(setvar "osmode" om)( B8 s3 d2 y# k; W9 M! v
(while (< 0 1)
7 U4 N! O+ N. y1 c (progn, d# ?8 h8 H Y) A
(setq p0 (getpoint "\n Chon Basic Point:"))
0 F7 ^$ u1 D2 d$ f/ j (setq p1 (getpoint p0 "\n Chon diem de xac dinh be rong cua:"))
" G/ l1 W- z# z4 y. V (command "osnap" "none")
$ {6 I3 ^# D5 g, D3 ? (setq p2 (getpoint p1 "\n Chon 1 diem o trong nha de xac dinh huong cua so:"))2 d8 z; c8 J$ q: c! _+ |6 E
(setq b (distance p0 p1))1 }! o/ R" Q$ b5 l9 ^' j1 g7 h
(if (< b (/ (* hstl 600) tile)) (setq du 50)); w6 W3 F1 |2 L" n; e
(if (> b (/ (* hstl 600) tile)) (setq du 150))
+ f; ^4 d/ j3 f! j' F1 p* K% ] (if (> b (/ (* hstl 1800) tile)) (setq du 200))
" M# L. m2 Q. N% j/ n! M (setq a1 (angle p0 p1))) b9 ]+ k8 V7 _6 J4 \
(setq a2 (angle p0 p2)) t* Z6 u g1 u5 [, E" X @! r
(if (> a2 pi) (setq a2 (- a2 (* pi 2)) ) )
' Z- Z: M' x% e (if (> (- a2 a1) 0) (setq a3 (+ (/ pi 2) a1)) )1 L! v5 S: q4 z: n% G* T
(if (> (- a1 a2) 0) (setq a3 (- a1 (/ pi 2))) )
" {0 R, x! Y* J* q, R (command "pline" p0 "w" "0" "0" p1 "")' W: f# j& \$ a+ F' ^- i2 P
(command "pline" (polar p0 a3 (/ (* hstl 50) tile)) (polar p1 a3 (/ (* hstl 50) tile)) "")
' f! F1 t) J2 T* y6 @7 _, t (command "pline" (polar p0 a3 (/ (* hstl 100) tile)) (polar p1 a3 (/ (* hstl 100) tile)) "")$ S1 i/ k0 J/ \8 g
(command "pline" (polar p0 a1 (* (- du) (/ hstl tile))) (polar (polar p0 a1 (* (- du) (/ hstl tile))) a3 (* -100 (/ hstl tile))) - m' {- ?$ Q) L2 K( s+ |& @3 C3 |
(polar (polar p1 a1 (* du (/ hstl tile))) a3 (* -100 (/ hstl tile))) (polar p1 a1 (* du (/ hstl tile))) "")) J9 B2 |" q' D4 l- s& G
(setvar "osmode" om)
) ?% O5 y/ C, ?* u/ T; _' d))2 b" v, }5 @6 ~ j: J9 N( v* D
)2 J" w' |* h$ Z4 \
) j/ f7 I# ?5 J5 _3 J! K
;;;=== General Utility Functions ===: }+ A1 |" L; A/ w8 {# G' s8 H! Q
' O, f" _/ D1 S4 I' d, f0 ]; R12 compatibility - In R12 (acad_helpdlg) was an externally-defined
' O( e/ Q. |0 P- k! A T0 Y; ], V; ADS function. Now it's a simple AutoLISP function that calls the
; G" d" t# q; B+ k/ a; built-in function (help). It's only purpose is R12 compatibility.
0 R3 q8 o% V- F& K; If you are calling it for anything else, you should almost certainly
( Y* P; ~: v3 A1 X; be calling (help) instead.
4 G8 f1 i: b0 D; y' b( T; g& E! o) ?3 E$ w' Q( u4 y) R8 O/ M
(defun acad_helpdlg (helpfile topic)' T$ x" D% w- A! M( x; q0 M
(help helpfile topic)2 m# T, O' R8 y: e s* ^
)
- Z! s0 \5 I$ N( w" N
. a6 j* o. J+ ~
! |0 p, S! X, O- `(defun *merr* (msg)6 X( e: b) c1 g4 b: N* _1 O2 D w
(setq *error* m:err m:err nil)% z& \; t: |2 E
(princ)$ e* u0 u7 C9 G
)
# I! i0 t& D* c1 @( q' p) Z! ], p( X
(defun *merrmsg* (msg)
( e4 R3 [; o5 p( c5 V( t (princ msg)
! y- r7 @4 y; {7 o* H2 `$ f (setq *error* m:err m:err nil)8 u( b% [0 q- W
(princ)
, e# l3 J' r, q9 U+ h/ X)
, U: v3 K9 i% ?$ p/ E7 M9 }( g8 `
( i0 S7 t# {) S& J! Q j;; Loads the indicated ARX app if it isn't already loaded
1 p1 z& |* }5 r1 }# s0 _1 p;; returns nil if no load was necessary, else returns the5 B( d4 x9 G+ s
;; app name if a load occurred.
% m) b: L# g: k9 X- z, `(defun verify_arxapp_loaded (app) * w) z1 x9 E j
(if (not (loadedp app (arx)))
7 v3 E( D [9 p8 ? (arxload app f)
& Z& t# Y# K" E7 Z" S ). `4 V% x. u' ?" Z' Q. h
)2 t9 D# x5 q7 _5 w9 n$ d
8 i- _! r1 h* h# \; r7 G;; determines if a given application is loaded...
9 B, S2 f2 R5 x+ ~;; general purpose: can ostensibly be used for appsets (arx) or (ads) or....
$ D1 j) V2 u, e6 n5 Q;;% S0 a; p" |) R7 u, v
;; app is the filename of the application to check (extension is required)1 S6 k. ?0 V( j }% W- }/ X
;; appset is a list of applications, (such as (arx) or (ads)8 X$ I' B# x( n' ?' I, M3 J; |
;;
( n" O8 j! w7 W/ K* `) ^;; returns T or nil, depending on whether app is present in the appset9 N* e9 B* q7 s- X; T2 A
;; indicated. Case is ignored in comparison, so "foo.arx" matches "FOO.ARX"
" x+ a0 C0 D/ d8 `' s" m8 [/ f5 A;; Also, if appset contains members that contain paths, app will right-match3 A0 p J) r( ^. b% Z5 ?* A
;; against these members, so "bar.arx" matches "c:\\path\\bar.arx"; note that
|5 u' b0 a( P% |;; "bar.arx" will *not* match "c:\\path\\foobar.arx."
- K7 m: j" Y# l. L(defun loadedp (app appset)
: N9 V* @7 Z. o( n7 Z2 [/ E (cond (appset (or & m( x/ {* w+ c1 G0 S* H. t
;; exactly equal? (ignoring case)( H* I0 h2 ?' I$ D
(= (strcase (car appset))1 i( n: `( f# [' m9 n( O
(strcase app))
5 J& ^& u* f$ q, o ;; right-matching? (ignoring case, but assuming that( h+ T# s2 `$ L/ S& |* l) Y u7 `
;; it's a complete filename (with a backslash before it)3 i, X C9 x3 q) E. P9 k" k
(and
$ G V+ ]9 k$ e9 e (> (strlen (car appset)) (strlen app))2 `! G5 G: t, M, f6 i7 ~- K4 {4 g
(= (strcase (substr (car appset)
: D. p! v" ~! J9 _- b7 _ (- (strlen (car appset))
) a" A' Z5 l1 m0 n$ g( @2 ^9 U (strlen app)
/ L, w- b9 R4 Y6 J8 C" z )
' K1 ~# G, b2 B1 \ ~ ). ^( B$ }8 z( x7 M% s) Z5 f
) 8 o g. \$ w2 R b1 o. }6 ?" Y
(strcase (strcat "\\" app))
( j7 r1 p$ u7 X6 c' w; O )
- k' x0 q5 v1 ?$ H8 h2 d )
, _' E3 P3 G0 y7 O ;; no match for this entry in appset, try next one....
1 x! ?7 }5 N8 O) i3 L (loadedp app (cdr appset)) )))
' p' \* @% D; p _)! C! q2 W+ x( \' e6 P
6 b- \" Y6 e9 F9 U2 D5 V! O: }, N9 V5 q, ?8 v( r! r
;;; ===== Single-line MText editor =====# U, T2 J* B! V7 F0 Z& X" s; U3 G
(defun LispEd (contents / fname dcl state)
# [( x, A. E% Z, M! a; ^8 s0 a (if (not (setq fname (getvar "program")))+ C' u& e' D- B9 N. H6 d* b
(setq fname "acad")
7 r( f% C* U# L/ w- e9 o% M1 ^ ) {# M8 U8 T# }9 V/ ~$ p
(strcat fname ".dcl")0 r0 C% [: t* i6 W: o g. }8 C' `6 W$ @
(setq dcl (load_dialog fname))
4 U! U5 F; h- f- W (if (not (new_dialog "LispEd" dcl)) (exit))% y7 T: C2 H7 z1 `# N
(set_tile "contents" contents)
0 V! |$ h% c+ F- a (mode_tile "contents" 2)
9 ~8 h2 P& I& |3 ~5 T7 o (action_tile "contents" "(setq contents $value)")' r9 O" Q7 N( \0 d- `* d
(action_tile "accept" "(done_dialog 1)")
/ W# g$ y2 T) O! v7 } (action_tile "mtexted" "(done_dialog 2)" )4 [" ~4 Q; q! l+ W+ ]& m( r) Q
(setq state (start_dialog))
& `4 H: |7 L0 E8 B0 ? n. w2 J! b (unload_dialog dcl)
6 v9 Q* ?5 A: {1 R q$ [' y (cond7 O) r6 m C- g h% d( m4 u- c
((= state 1) contents)
- |. _+ Y- E3 q( y ((= state 2) -1)& O- Y: K. l! m
(t 0)
. ?) u5 ?# g0 O% @% m# V )" U* f5 K0 _1 d
)$ r6 N% h0 V, L: s1 B% _8 G! m
+ j$ N. t. m; U. K4 r6 p T
;;; ===== Discontinued commands =====
$ d3 x# X- W! t$ {$ B(defun c:ddselect(/ cmdecho-save)) b: y5 z4 I/ H T" M
(setq cmdecho-save (getvar "CMDECHO"))+ V, Y7 U: I: B( ~: _- \
(setvar "CMDECHO" 0)
# r& \5 w$ ^8 E' V (command "._+options" 7)
/ Y- S4 n" u' b6 K4 S1 X (setvar "CMDECHO" cmdecho-save)5 y, X! t* h h1 g- h8 I/ L
(princ)9 b9 d- t W6 \. ?* }9 U
)) b! {, v* p% W8 H+ b6 D
/ M% A. c4 E* V% O2 L(defun c:ddgrips(/ cmdecho-save)% D4 Q; i, W+ I4 p! W b5 [& _3 o9 y
(setq cmdecho-save (getvar "CMDECHO"))
" `) d& g: G7 p: M (setvar "CMDECHO" 0)7 g- T5 I" e3 M( \
(command "._+options" 7)
7 L ^5 \7 j* f (setvar "CMDECHO" cmdecho-save)
: _/ G+ N" F8 C3 X/ Q0 ^ (princ)* ?& e+ V0 y0 q4 Z7 x' v
)
7 E5 ^' X5 J- U/ `* x2 P/ ?! b9 U; G( ?6 u! Y5 `
(defun c:gifin ()
+ u$ L* S8 |; B% a( g& S (alert "\nThe GIFIN command is no longer supported.\nUse the IMAGE command to attach raster image files.\n")
3 y3 O. o0 _! x$ ^" I' | (princ); S4 {0 M6 u3 g
)
! _+ k( ~& ?. }3 D3 c B1 i$ J9 ]
+ Q- H% q1 p/ [) F(defun c:pcxin ()0 m* ^- _2 [$ i
(alert "\nThe PCXIN command is no longer supported.\nUse the IMAGE command to attach raster image files.\n")- I$ Q, K6 g0 r9 R. `+ X% r8 _9 J
(princ)
m# Z3 q. p) m# \, \- E) B! g0 u$ S* I% ?. m! S
$ {8 @6 o- \0 P6 C# |$ q(defun c:tiffin ()
7 W$ X6 V9 m( E5 [4 Q+ u( O& ?. D (alert "\nThe TIFFIN command is no longer supported.\nUse the IMAGE command to attach raster image files.\n")! G- b u5 W/ J
(princ)
& N" Q7 }: d# |; [3 U3 e, o3 }% ]/ p)
% ?8 I0 h; ~/ R0 A0 r! b4 H ~" k$ q5 l1 s3 Z% I
(defun c:ddemodes()
/ H* j/ \8 z2 C/ a) N (alert "The Object Properties toolbar incorporates DDEMODES functionality. \nDDEMODES has been discontinued. \n\nFor more information, select \"Object Properties toolbar\" from the AutoCAD Help Index tab.")1 |7 m- n* K& d/ U3 `8 w4 o0 h
(princ): [. S* W# w$ {: o; x; a0 a
)
0 P9 Z1 d; K: B3 b) p1 j# V: I3 F7 Q: S/ r6 M8 a7 U$ A
(defun c:ddrmodes(/ cmdecho-save)
s' [7 D! y) i6 _0 V8 B (setq cmdecho-save (getvar "CMDECHO")): v) E3 {/ u4 `) r9 O, Y
(setvar "CMDECHO" 0)) f* p' r3 a) a( ]5 O
(command "._+dsettings" 0)6 q4 M& m6 t1 G6 ?
(setvar "CMDECHO" cmdecho-save)
2 v% b) F& f5 ~' ] N( }- k (princ)) `$ n; c1 x' c) V* p
)1 d2 E1 V1 D( A2 w" K
$ ~$ ~" }) @) H% S
;; HPCONFIG @; f' |# c" Z7 b$ O0 e5 L# w- o
(defun c:hpconfig (/ hlppath)
+ ^5 X$ p) G# x1 N (if (not (setq hlppath (findfile "acad.hlp")))5 z: ]4 W! a) H8 k
(setq hlppath ""))
, {' M( ?( _- T8 J5 M: X8 ?( d* ?' W (help hlppath "hpconfig")9 B: z8 H/ }4 K) C
(princ)- A2 }+ f$ j$ Y, e
)
6 f* N& q7 }# x0 o# n' A; y% @1 V Y. y( s" _
;; OCECONFIG F9 }% S: c5 g8 m3 ]
(defun c:oceconfig (/ hlppath)
M% L0 \2 w5 I% } r# u (if (not (setq hlppath (findfile "acad.hlp")))# |5 | h; s. o$ _
(setq hlppath ""))- M$ M8 V) X# l. t& I& ^, S3 k# J
(help hlppath "oceconfig")
! \4 j* ]$ N: H2 Q* W l (princ)' A$ l! o9 T' x' h9 |4 F
)
2 j, G0 E% ?7 s, D
, K1 t' [ E: M6 _) G+ U;; CCONFIG
& k8 P: x7 R* b4 G(defun c:cconfig (/ hlppath)
8 u j# p$ e& X7 J1 m1 ]/ b& I1 k (if (not (setq hlppath (findfile "acad.hlp")))
) o* Y( u; L1 p (setq hlppath ""))0 X' v5 X% O( |7 R3 N
(help hlppath "cconfig")
, U6 N0 f/ F7 @% J (princ)
/ T1 i! ^/ {# ?0 n! r)2 x" S% Q8 [ k
5 P! N* ` d1 m1 ]+ G- S
;;; ===== AutoLoad =====. E. d& D$ f3 \6 q* ^6 n) I
0 M% {* s3 e$ H8 e1 e# ~;;; Check list of loaded <apptype> applications ("ads" or "arx")
5 S; m# Z4 c+ E+ X) T;;; for the name of a certain appplication <appname>.
8 ]( \0 l9 O9 B8 j& N;;; Returns T if <appname> is loaded.; J% Q3 e! R, j7 F( J
! \' V( ]5 v4 E6 |(defun ai_AppLoaded (appname apptype)) K2 N7 E+ v8 X9 x2 I# s! u
(apply 'or, [7 P% y) A; d f6 o
(mapcar
+ e% e6 z! g8 c+ g* E3 m '(lambda (j)
9 r( E/ V' }+ F) u# o, A: Z, q (wcmatch
6 Z0 R8 y$ L+ Q# Q0 G (strcase j T)
: L: u3 S. }2 e( j (strcase (strcat "*" appname "*") T)
: y% t2 u5 ]. O) { )
; k+ e0 E' m6 w, W )
& p e3 I8 |& ] (eval (list (read apptype)))" T( m& p# |, ]+ {$ g1 X0 n" P
)
* A1 g$ h7 d* j6 }* t' C1 { )
" X! c0 r# u% |- D" W0 M5 P)2 r0 h- X+ {/ B; l: O$ E
: D% |/ ]. }& w' [;;
( u4 K; A6 V3 M;; Native Rx commands cannot be called with the "C:" syntax. They must Z1 k: g" [, H
;; be called via (command). Therefore they require their own autoload ( F" ^+ Y7 R- o, f
;; command.% P) K: G4 [% E, }+ i
+ w6 F$ {9 j% s9 o(defun autonativeload (app cmdliste / qapp). x$ D$ n; J% T) l$ S
(setq qapp (strcat "\"" app "\""))
7 E1 O3 f8 I! W (setq initstring "\nInitializing...")# ] b9 B3 Z. ^6 P5 D3 b' [3 Q3 L
(mapcar( l9 l7 D+ N9 M
'(lambda (cmd / nom_cmd native_cmd)
0 V# V# M: f0 Z& c! r2 `& V$ h: @ (progn( s: C. }' |4 d4 A& Y) I- G7 Y
(setq nom_cmd (strcat "C:" cmd))4 g. X6 W+ P1 I0 K. i: o @
(setq native_cmd (strcat "\"_" cmd "\""))
4 L7 o; ~9 J9 ^% ~6 Y2 t6 { (if (not (eval (read nom_cmd)))
$ Z+ G3 e. u$ |$ p( B, T7 @ (eval
* W- z5 m- U/ D' ^% b- d% z (read (strcat! j% j( w# Z; u7 h, C3 D
"(defun " nom_cmd "()"0 f6 b2 j1 Y2 Q
"(setq m:err *error* *error* *merrmsg*)"3 y5 b; {% v' E7 h7 S
"(if (ai_ffile " qapp ")"
- E0 ~, a# k/ ^4 o3 H "(progn (princ initstring)"
1 J9 Y* e* l( |) `: O "(_autoarxload " qapp ") (command " native_cmd "))"/ C' G1 `" s: D& |9 h/ @1 L
"(ai_nofile " qapp "))"
4 x) S# n/ H4 T' E# L1 c, D1 u "(setq *error* m:err m:err nil))"
; K( c& V# Z: V o" N ))))))
; k! ]+ V5 {- A& q8 f o cmdliste)# m% Z2 j0 e1 u
nil; f+ j. _# e/ X; K# o1 J o
)
" b: R; L i8 S& \3 j# F5 E5 E( p9 a* F( ^2 T3 e. b& B
(defun _autoqload (quoi app cmdliste / qapp symnam)
3 a' G i/ f y O8 K! ~* e& ~% E/ j; ~ (setq qapp (strcat "\"" app "\"")): Z0 Y3 ~" H3 W4 E E1 b3 x; B8 ]
(setq initstring "\nInitializing...")8 [4 N. U* z [8 e
(mapcar3 N' ]1 G @0 J. X: V: y; b
'(lambda (cmd / nom_cmd), ~$ E- ?+ O. w0 V# ^( [
(progn4 }0 F; J9 V# L% I9 `% K4 N
(setq nom_cmd (strcat "C:" cmd))
% \: f. R/ G* ?: @3 v (if (not (eval (read nom_cmd)))
6 Q9 @7 O# U) O) R+ o (eval
* G: c8 D! r7 N1 n) P7 r (read (strcat9 `/ @ X0 ~5 ^# K4 b) G0 p3 d% r
"(defun " nom_cmd "( / rtn)"; T8 ?, Q6 U9 o4 l+ u
"(setq m:err *error* *error* *merrmsg*)"
3 w' b- _* Z- W5 t6 T0 _' A6 G+ ` "(if (ai_ffile " qapp ")"
6 w6 o0 T& E4 K/ E$ T* G "(progn (princ initstring)"
# f; {) F/ A8 t# f "(_auto" quoi "load " qapp ") (setq rtn (" nom_cmd ")))"% I4 O: [& ?5 q4 f$ }
"(ai_nofile " qapp "))": Z J% |7 y5 n D
"(setq *error* m:err m:err nil)"
( G7 S6 S' B6 L [) q/ r "rtn)"
( E/ e& X+ |' K2 P g ))))))7 T' J. k. s# o) A
cmdliste)
" _$ ?4 \: l) W' M3 q nil! A6 |4 F7 \# V, C3 X% R9 Z5 P
)
# @; @; y h4 @# f
* O: N* D' g8 V; P# l- E5 y. y(defun autoload (app cmdliste)
2 b! | o% W9 M, @& F (_autoqload "" app cmdliste)
1 v$ q6 a1 ], Y1 Y. Z( G). k+ k( j) r. E% g: E+ \
$ L' h& s6 L4 w, Q
(defun autoarxload (app cmdliste)
1 h5 _4 t ? }/ U7 Z/ R8 [5 W (_autoqload "arx" app cmdliste)) g/ e( x4 [2 l: ~ ^) Q
)
8 l# P) O9 T# c. o4 o/ q) a
1 H) u- r& L* E% T4 s(defun autoarxacedload (app cmdliste / qapp symnam). F9 p: ~0 v# {* d
(setq qapp (strcat "\"" app "\""))
! d, ~; W/ g$ j0 S2 M: O" ? (setq initstring "\nInitializing...") S& E1 P1 W# v: M) ~; ^
(mapcar
$ L2 s, o- ]2 j. p '(lambda (cmd / nom_cmd)
) y4 V( m2 \3 D; h (progn
t+ M& r% G I3 `* g7 s/ v (setq nom_cmd (strcat "C:" cmd)) X6 a5 F% s m7 K; C$ k& d( {. R
(if (not (eval (read nom_cmd))). ?# ~' o: o- d9 V# X
(eval
' m, w Y" W2 E4 u6 d/ x (read (strcat
6 z7 F O0 z+ g4 Z "(defun " nom_cmd "( / oldcmdecho)"3 X8 |8 {: {1 F" p& D
"(setq m:err *error* *error* *merrmsg*)"
+ I/ z; V+ P8 f9 y% F "(if (ai_ffile " qapp ")"1 `4 q& x, r# x7 g
"(progn (princ initstring)"2 v' y- Z8 P8 q1 ]" ^
"(_autoarxload " qapp ")"
8 l ^- Z$ m' H1 x5 @ "(setq oldcmdecho (getvar \"CMDECHO\"))". v! v h' V, F4 w- `% i
"(setvar \"CMDECHO\" 0)"( R. X* W+ h) L. F/ Y0 u
"(command " "\"_" cmd "\"" ")"
5 X1 G2 o+ N' j! q "(setvar \"CMDECHO\" oldcmdecho))"# Y L- m( |, B7 r+ P
"(ai_nofile " qapp "))"0 N* c- `1 m+ b. Y* o7 h2 J+ t/ ^
"(setq *error* m:err m:err nil)"/ ]1 C+ D0 h4 x# R- c" ^
"(princ))"% r! ^8 k1 R1 a- m
))))))' E0 F/ P P( N7 E) n4 `
cmdliste)* m2 T2 a4 ~7 l
nil. C3 N L* \6 @9 V
)1 V z0 t* t2 x7 R
5 A2 E0 u: Y$ t: ~ r. U& M0 h# c(defun _autoload (app)& l0 \( ]8 C; e9 ]2 {3 b0 `' L) z# a
; (princ "Auto load ") (princ app) (princ ")") (terpri)
" F8 @9 T+ t) O' Z3 F6 D4 m) S) ` (load app)
& Z6 ?9 }9 D# t: F8 w. m)
: q$ p. I2 G7 x; S* e* B
3 h& z3 |3 u' G5 M+ V(defun _autoarxload (app)
: ~7 M- D% T7 [, l3 ?: h8 w& ?; (princ "Auto arxload ") (princ app) (princ ")") (terpri)) r& V. ]9 t, E
(arxload app)' g" s1 x% V0 f% [) x# h8 A
)# p7 a: T' w1 S% K f
- Y9 X- P( s( [" ^& F6 J9 M3 a
(defun ai_ffile (app)
8 c# S; t% x+ W# u1 H: w (or (findfile (strcat app ".lsp"))
) [2 r x- p7 \* z6 t (findfile (strcat app ".exp"))2 O7 J9 E; V4 r- H
(findfile (strcat app ".exe"))
+ I5 W8 h6 O. L. I (findfile (strcat app ".arx"))
+ y: c+ a5 b: |- F* g1 n (findfile app)
) ]6 Q1 c+ n# }- h )1 f. n" n$ n" f8 h! ?$ f L+ r
)
( F3 u2 D$ o; P: M3 {& \; `
4 R. @- W! a, H2 A(defun ai_nofile (filename)
_: S' G- {. c! r (princ
. r+ X: H' P$ }2 }# r. |5 d (strcat "\nThe file "
/ [7 M X) r+ w. s! d6 } filename& V4 [! z3 S$ b* |* O6 K: ~* ]
"(.lsp/.exe/.arx) was not found in your search path folders."
+ p8 t }3 ?9 n$ @3 B. V )5 B- u% N7 d6 O( `0 D8 z0 Z9 d
)
0 h% C8 q" M+ S4 _ (princ "\nCheck the installation of the support files and try again.")7 w( h$ d" _. H" |( Z
(princ)2 x$ x/ Q( h0 Q3 n
)
% l5 t7 |6 t( B1 B" A o3 @8 V
! X* _ G( J y" W: ^" U7 n
( Z6 r/ f/ a* w) e% P) I1 z* I;;;===== AutoLoad LISP Applications =====
9 y9 o$ x) b' t( h% }9 b; Set help for those apps with a command line interface
8 `" u3 c9 Z6 S' _! V6 \+ c6 w' X, \; s% v* y8 _" K" N; n
(autoload "edge" '("edge"))
6 C Q0 R g# Q* p(setfunhelp "C:edge" "" "edge")$ _9 ~) i: T8 l; h) ^' L: R7 I
" l; r% r3 v S. _6 k: `( W
(autoload "filter" '("filter " "filter"))
/ p1 j) n5 F% ]1 m9 H( ?0 L8 P
: S0 y* i, x7 u& M3 D+ q2 n b( n6 o(autoload "3d" '("3d" "3d" "ai_box" "ai_pyramid" "ai_wedge" "ai_dome"
) a) w6 g, L' h) g "ai_mesh" "ai_sphere" "ai_cone" "ai_torus" "ai_dish")! E4 {9 ?# |; B) B0 w
)4 E! H7 f9 G7 D( L
(setfunhelp "C:3d" "" "3d")2 W1 n" z! k- u" m
(setfunhelp "C:ai_box" "" "3d_box")
; Y4 y K' X+ {- t+ F(setfunhelp "C:ai_pyramid" "" "3d_pyramid")
6 _! v5 g! S. s6 P2 ?& C6 E( f(setfunhelp "C:ai__wedge" "" "3d_wedge")+ Q0 }* m/ B: \9 O5 ]
(setfunhelp "C:ai_dome" "" "3d_dome")9 N0 D, M2 C8 y; Y6 y- j7 F' \
(setfunhelp "C:ai_mesh" "" "3d_mesh")
/ ?9 Q: q/ r5 S(setfunhelp "C:ai_sphere" "" "3d_sphere")8 e, a, W# t5 [
(setfunhelp "C:ai_cone" "" "3d_cone")* r3 W6 P; }9 d2 R) w& O
(setfunhelp "C:ai_torus" "" "3d_torus")
. k" ~" Z0 a) S. B0 S(setfunhelp "C:ai_dish" "" "3d_dish")
2 U) j* V% c4 A* S: j8 h' T0 r, Q# e; S0 c7 T4 n
(autoload "3darray" '("3darray"))
- R) @+ N+ ?3 G; @0 |/ e7 [# s(setfunhelp "C:3darray" "" "3darray")$ C) j$ i7 K2 ~6 A! x! \/ F. V! [
/ O# g* s# Y, B$ [(autoload "ddvpoint" '("ddvpoint"))
8 V8 i6 g+ v( h# M" ]/ P u# r, k/ Q A9 W+ v
(autoload "mvsetup" '("mvsetup"))9 w. W' T: D# N. @$ j3 t7 q! j+ w2 C
(setfunhelp "C:mvsetup" "" "mvsetup")+ ?1 U" T2 J6 r b6 E
6 C( o( |; S" X+ _8 ](autoload "ddptype" '("ddptype"))
( \* B$ m+ x% U/ n9 w% |% @
7 {2 F" n1 A- Y/ r' h" L- a A(autoload "attredef" '("attredef"))) q* ? S7 ]+ i' L, j- w
(setfunhelp "C:attredef" "" "attredef")
5 i6 z7 Y6 k. A ~' [! w( V* z/ N/ t5 o5 M$ s
(autoload "xplode" '("xp" "xplode"))$ [. l$ Z2 ^" M7 t3 w( K) i& L5 j% a
(setfunhelp "C:xplode" "" "xplode")2 s8 W5 A+ ~ P- ]) K1 g# l
W1 T4 N: v4 Y(autoload "tutorial" '("tutdemo" "tutclear"
/ l# V, N! z* c2 A "tutdemo"
4 y+ o4 ?9 O6 G1 T q "tutclear"))
: c) }& `* m; N8 i3 E) F4 L, h1 y6 b. s0 o) E; d
;;;===== AutoArxLoad Arx Applications =====
5 g" s" F# J1 {! h' A; ~: x6 ]6 h1 L& c" T% T7 l2 q
(autoarxload "geomcal" '("cal" "cal"))) D& {* n5 V% a" X6 ]" v$ A
+ U" ^7 }- i4 ~" G. o(autoarxload "geom3d" '("mirror3d" "rotate3d" "align"+ \; e3 f, o2 u
"mirror3d" "rotate3d" - `' t6 M& f: P3 g8 D w& [' t1 x
"align"))
& f# ~: r2 w7 K5 `, q% j/ m! v f1 c
6 r/ X7 n, K" z;;; ===== Double byte character handling functions =====
% `! [3 o" E5 C U& W: F% Y
3 t6 L) Q; b$ J4 M, p(defun is_lead_byte(code)
; Q# F8 W/ | Z( r+ I4 G0 w (setq asia_cd (getvar "dwgcodepage"))
! q' [4 S+ U, s9 v% E' q (cond' ~2 P! T: ?. P. {# M
( (or (= asia_cd "dos932")3 w2 }" W5 p0 y g
(= asia_cd "ANSI_932")
4 T) |( v1 I8 \# ^$ U# H )
( `$ ]# B# g6 [; ? (or (and (<= 129 code) (<= code 159))# z. h3 I, u5 I" V! g3 C* G
(and (<= 224 code) (<= code 252))
; W9 d& p# h/ v$ t9 A, B )
5 k \, u6 s3 `' E2 R )- v9 T' e/ A1 U4 [+ S, X
( (or (= asia_cd "big5")( l+ w, j' h- {# Z
(= asia_cd "ANSI_950")
1 H8 U. L" B( u+ F7 m )* J# m% O" n, d2 Y( N; W
(and (<= 129 code) (<= code 254))* ?" R" g9 Q. Z7 @1 b
)" M- }" K& ] B& \
( (or (= asia_cd "gb2312")7 \4 _4 [! n3 E Z
(= asia_cd "ANSI_936")# z6 p; j& D7 z P, r/ t
)4 I! ]: @: W2 F$ Q8 R1 s! Y5 ~
(and (<= 161 code) (<= code 254))
! u* {" N9 f- l! H9 x5 V+ { )
$ @3 a1 {/ [* @* m: \! y ( (or (= asia_cd "johab")& ], S) B% f9 j9 u
(= asia_cd "ANSI_1361"): I/ s3 a: {, i% p
)
1 q* O. F. h7 O5 `* x7 ^* V (and (<= 132 code) (<= code 211))6 d1 X1 ]% M* \9 w, m# b& u
)/ q! x! ^3 E& M8 P. G3 |
( (or (= asia_cd "ksc5601")$ o ^6 N% j) @# I6 y/ p
(= asia_cd "ANSI_949")7 v# W- Y( t* e; n. K" E
)
% a5 E' y7 R4 \ (and (<= 129 code) (<= code 254))- y7 d1 [, z: n: y+ C
): }# ^' n: f3 s0 I# H
)1 s; s B( S5 m. u# [
)
, C1 \2 T. G% r, p' P5 Y) `9 h) f
& X$ F& v8 I! x8 a;;; ====================================================
) Q1 n1 _; | j. o" i% k$ l: X6 l3 M. f# @
F; K. |: _4 a( Y/ D2 H; Z9 f7 e;;;! L! R7 Y8 @) `0 M* N
;;; FITSTR2LEN; _9 o C/ F# R2 a4 M; y+ m
;;;
; c4 I, G' @2 X# C1 {: e;;; Truncates the given string to the given length.
4 r K# L1 A. p& {;;; This function should be used to fit symbol table names, that
) v8 X$ t- j' p+ r) `3 a" ~% T4 S' d;;; may turn into \U+ sequences into a given size to be displayed' @; `) X+ C/ H
;;; inside a dialog box.
- N2 N' V6 G, o% O% a;;;
) W8 d+ Z' ? H* i& i4 B;;; Ex: the following string: }- r! O8 s! k+ [2 \: n8 k
;;;
- D4 O1 x2 v, P5 o$ q;;; "This is a long string that will not fit into a 32 character static text box.": l; r8 J: _" ~: g# Y
;;;& X+ {* [/ Q' D6 e
;;; would display as a 32 character long string as follows:
" ]* v9 N9 n5 F;;;
- [1 D$ [3 h+ m;;; "This is a long...tatic text box."! V; d) F2 {2 _: d* N: l
;;;
) u# [# l& i: Q3 D* ]9 z q0 S! ?
1 t4 u$ D' q0 H! X( U(defun fitstr2len (str1 maxlen)
" h$ Z5 y! N* Z' D4 S9 L! P+ I# j9 N: V& {. a. e6 N
;;; initialize internals1 ~# t9 B o4 g
(setq tmpstr str1)9 t: _, M' U2 H3 q
(setq len (strlen tmpstr))+ b5 ?% N: p# S" I8 s1 W2 e- h6 M
/ }0 E3 a& o- A, e$ A (if (> len maxlen) / X4 E: x3 o9 X3 L% B' f
(progn" E2 ^7 F: p, o+ s3 q, Y/ B* X9 Y4 s
(setq maxlen2 (/ maxlen 2))
* V- K3 b2 E8 Y/ j& g (if (> maxlen (* maxlen2 2))
- p) X y; L* J2 [1 t5 r (setq maxlen2 (- maxlen2 1))) Y& r: V* s& X
)
2 P* O9 U& V' M' k8 r (if (is_lead_byte (substr tmpstr (- maxlen2 2) 1))! v# o$ L) q8 \
(setq tmpstr1 (substr tmpstr 1 (- maxlen2 3)))
8 x5 ]$ T. I( @9 G& r (setq tmpstr1 (substr tmpstr 1 (- maxlen2 2)))
! V- L. q3 V7 _) H" j- R; ` )1 ^( H$ ?' L) h
(if (is_lead_byte (substr tmpstr (- len (- maxlen2 1)) 1))
' g, w. B+ i% T: i3 f/ v, x (setq tmpstr2 (substr tmpstr (- len (- maxlen2 3))))3 U& b+ b+ S7 e8 T9 J
(setq tmpstr2 (substr tmpstr (- len (- maxlen2 2))))
/ W" s8 U1 p9 a$ W" A )4 p: y! |3 y; n
(setq str2 (strcat tmpstr1 "..." tmpstr2))
p9 V# k$ s$ L8 B2 { ) ;;; progn) R( v& ]! {2 b- H8 W* K
(setq str2 (strcat tmpstr))
& g" b4 q e& ^7 d ) ;;; if
* d( u! K, N) [3 x) ;;; defun
# c2 B3 C/ @; E6 Z- q9 ?, K/ P: q' X, Q5 M4 s5 \0 a
- x0 o( \( P/ i, q/ u6 `7 c
;;;! d/ g. Q' k- V, @1 t
;;; If the first object in a selection set has an attached URL
9 o" O0 v, ^+ q0 M" z# }" _8 U;;; Then launch browser and point to the URL.
& \$ Y i/ w# x) e1 i# I;;; Called by the Grips Cursor Menu/ J$ { B& m: f) w/ p) o! L+ |* c
;;;
. U3 z2 [* ^' V3 q
# u( ^2 a( C0 z* [2 ?" T8 T(defun C:gotourl ( / ssurl url i)5 r4 f9 }; }% `* T0 p' p
(setq m:err *error* *error* *merrmsg* i 0)
8 a, z# x; a7 ?1 v$ V
- _3 {3 _: i2 L* u: t1 D9 T) M; if some objects are not already pickfirst selected, 0 |7 Z" n* J9 \ M% \: F* S
; then allow objects to be selected
* M! q* R6 _; ]1 {. L+ v. j
. x5 x9 q6 E7 J (if (not (setq ssurl (ssget "_I")))
9 Z. j( B L* r- ^6 @1 E# z- w+ ] (setq ssurl (ssget))
$ J" N3 m \* ~& D9 ?+ i+ E: M )2 m% c) O# I# h9 U4 u! {7 t j
5 [' q/ S4 Y4 X) i: l2 Y2 O
; if geturl LISP command not found then load arx application
j1 }( V- W- r! J
3 L9 [' u, Y8 X( p; P (if (/= (type geturl) 'EXRXSUBR)
- L# [ O) Y4 k3 `' [6 H2 U (arxload "dwfout")# F; P; p. I4 s1 v* I
)
1 ?6 u( O* E8 j: f; G/ I2 X" i3 B+ K4 y, e+ N! y
; Search list for first object with an URL7 a* N, _; o) ]' }
(while (and (= url nil) (< i (sslength ssurl))) {: ~* j! k* a0 N N/ k. s# J
(setq url (geturl (ssname ssurl i))
/ j( G W: V0 }; Z+ L+ |' ? i (1+ i))4 U" u9 d; x, g6 I
)) s0 X) R. k% B
2 w/ `# J, |0 S$ I9 O5 f7 v! ]; If an URL has be found, open browser and point to URL: V& u# c. _% n* |
(if (= url nil)( Y) _9 G" Y2 u9 N
(alert "No Universal Resource Locator associated with the object.")
& d/ _1 ?; `9 X5 a (command "_.browser" url)+ @0 S @9 b( P8 }% k/ q
)
- m$ @* x- g) i! f
5 P, Q4 L# P- Z' |5 x& I (setq *error* m:err m:err nil)
/ m" x {" M. V. F (princ) v4 w% _- y9 N6 T& ]0 V
# z# h0 L& m' M
)
% `* X+ {. r; H7 B
0 I4 {1 T5 b6 ^8 L/ u;; Used by the import dialog to silently load a 3ds file" Y7 d0 ]9 V ]6 p1 J
(defun import3ds (filename / filedia_old render)
M F+ @8 p' y8 R! A1 b; u9 C G ;; Load Render if not loaded Y4 A; D, e m
(setq render (findfile "acRender.arx"))
: _! s- Y; [6 ]/ g (if render; B- m; x* T$ n; o- b R
(verify_arxapp_loaded render)
2 _# R }- V' \' ~+ ] (quit)
& z! g, u/ a6 c$ F3 U )
1 M- ?( G3 }1 L5 o/ T" K/ o. H5 [- k/ i" s# l0 ~ |1 |. i
;; Save current filedia & cmdecho setting.) i; m& o8 a# w
(setq filedia-save (getvar "FILEDIA"))
% I6 f. Q5 F7 d6 A; m& U( v J (setq cmdecho-save (getvar "CMDECHO"))' R- `9 P9 x$ w$ p0 m- ?( U
(setvar "FILEDIA" 0)
4 P& v7 e% }4 ~% {; m (setvar "CMDECHO" 0)
; r3 x3 V" J' z& A+ Y- e) u; T6 R) R3 S6 p- ^
;; Call 3DSIN and pass in filename.. }' L% R5 O! U! u$ F2 \) H& A
(c:3dsin 1 filename); Y5 e6 n1 b' F0 d
/ e# o: h( O7 N/ Q2 [ ;; Reset filedia & cmdecho9 x i, _1 ? D4 M. }) o! U( y
(setvar "FILEDIA" filedia-save)
+ X8 P# f# U" f% K! B' P (setvar "CMDECHO" cmdecho-save), k9 r, u% ]/ i& B' V$ N# w
(princ)* o6 m/ H& ?* j
)
$ r8 O8 C* A! R$ {. \
8 g. l% v0 s1 b9 ?
0 q- f! X6 k) N! ]. [/ c% N8 w1 Q;;;=== Menu Functions ======================================
# q4 Z( P$ [& X6 r( l" {7 }% E' j# {9 B7 \
(defun ai_rootmenus ()
1 |# l! ` U: X9 h2 ^4 [ (setq T_MENU 0)5 @1 f2 N8 b- \+ A' w5 {: Y4 n
(menucmd "S=S")4 |* ]! a- x( [" B! l0 n
(menucmd "S=ACAD.S")
; n& A3 o* i/ Y- S% A (princ)& P% i& P0 ?' w Z1 Z" J
)( u6 R6 v! C# W+ [" S. k
2 ` L h* D' h$ d
(defun c:ai_fms ( / fmsa fmsb)
1 e4 Q/ u! _2 o$ T+ ? (setq m:err *error* *error* *merr*): u7 z( m, c M3 {
(ai_undo_push)1 r ?0 Z* b( Q9 V6 E, H: V3 |; B
(if (getvar "TILEMODE") (setvar "TILEMODE" 0))
* M! B' m$ X7 W' G* o$ W1 r3 B (setq fmsa (vports) fmsb (nth 0 fmsa))
) t6 W2 v5 G( b3 n' N (if (member 1 fmsb)8 v' K+ } r5 [* a
(if (> (length fmsa) 1)* g) F g! \. V) J8 w3 k" n
(command "_.mspace")$ v! ]9 A9 t4 D0 |% j+ ?) T. c- n
(progn8 r! s9 x5 t7 _- k* L
(ai_sysvar '("cmdecho" . 1))4 O( U5 @$ l$ Z2 E' D& U
(command "_.mview")
& Z" U4 j0 L3 H" f2 [ (while (eq 1 (logand 1 (getvar "CMDACTIVE")))3 M; O% w% \1 P3 n6 M; n# Z
(command pause)2 l0 ^, I% h4 t6 f/ p% p7 ~
)
& p, ~1 }7 \1 C% ]- x R (ai_sysvar NIL). F$ u; k4 Z; F/ Z
(command "_.mspace")# b* k: A5 C" ]- W/ h0 \
)
2 a7 A2 f2 y+ I, P9 W9 @- T9 W ). I9 s# L, e$ r" c! {( l" g" v) d* [) l
)3 j* E( t, Y$ @' N& b& i
(ai_undo_pop)
5 p8 h* t) @5 f. n (setq *error* m:err m:err nil)
" X9 W! H- b% n+ k6 r (princ)
, f! n. C6 }3 S) E9 |- ^5 F)
2 @6 {) m: G% @) p; t
; y' w9 X c# f; X/ r" Q$ s+ G(defun ai_onoff (var)
6 s, r& ?( `0 l (setvar var (abs (1- (getvar var))))
, z: I+ t8 }) b) W r8 c- _ (princ). t3 R) ^5 G4 p8 O, H- D( y! u
)
" i) G6 n% R5 D; i2 l( o5 X$ D( A) `" D
;;; go to paper space; v. f% S+ T8 l+ C5 H Z9 z- P4 f
(defun c:ai_pspace ()
3 K( a3 J2 X0 [. D (ai_undo_push)
6 s& L; Z& X. n! O, } (if (/= 0 (getvar "tilemode"))7 L% i; s7 s3 a* `5 F: E
(command "_.tilemode" 0)
& W1 \ b( @) b, z$ s' E )5 }# S8 D& V; y7 }. o6 g( p# K: T
(if (/= 1 (getvar "cvport"))4 {" {, e) f' y7 h$ {5 ^1 s3 N
(command "_.pspace")7 o% e; M! O" t' j- X) M
)
; }/ c, }0 x8 `4 F* K, z' @$ s (ai_undo_pop)
& A- E8 {/ y$ z0 a (princ)0 o3 g; k1 }1 s, m; M. X! n+ a
). F- k% N1 z2 g0 T* N& g& n! Q
7 u( k% E* T7 ] w) Q1 \;;; go to tilemode 1
/ N P! b5 z5 v5 Q) p& L8 `(defun c:ai_tilemode1 ()
! w0 k' N; C) P/ {7 b, l (ai_undo_push)6 j- o. B* `, J/ {% Q/ X+ n+ n
(if (/= 1 (getvar "tilemode"))
% I) R8 D; B8 C! s$ `, Z (command "_.tilemode" 1)
9 m4 `/ w4 S8 ~- F1 B )1 x9 W5 `4 r" z! U3 `' X6 R
(ai_undo_pop) t2 n! o% n P W
(princ)
' a2 X4 p) ~% ?8 ?1 I9 G)
( A; U! x+ G! J/ M, r
7 z3 j$ O \& x2 ~: G \;;; Pop menu Draw/ Dim/ Align Text/ Centered
4 n1 F& l) O% s4 _! H4 t% y1 `# f1 I;;; Toolbar Dimensions/ Align Text/ Centered
# u* U9 P; l: ]5 a/ j: o3 r* P- s9 N
(defun ai_dim_cen (/ ai_sysvar ai_dim_ss)
8 y6 Y# |7 ^, L, u (setq ai_sysvar (getvar "cmdecho"))* a- q4 y+ e: I: q; F' ]
(setvar "cmdecho" 0)
; v$ X! H+ O5 h# R" M* v" t, o& D (cond
& I% {% i, D f$ H: u0 W% a' l' U8 K ((setq ai_dim_ss (ssget "_P" '((0 . "DIMENSION"))))7 D; ~6 m& E# y) M
(command "_.dimoverride" "_dimjust" 0 "" ai_dim_ss ""
% V; L. X: P( ^ "_.dimtedit" ai_dim_ss "_h")
* K# I" ?7 [9 Y: _ )
* w) F! g3 v2 [# \6 t3 t4 Y (T nil)
7 v8 G% h9 P& O/ c )) a9 X( H; h: @ D
(setvar "cmdecho" ai_sysvar)
7 u2 s: Y) \ E. x (princ)$ w, T! Z+ l/ V/ K3 ^/ b& f8 g' { t
)2 L$ p" M" z. l2 O6 u% e$ B
4 q7 k7 h5 n2 B6 @4 z
;;; Shortcut menu for Dimension Text Above 6 r5 l* }$ U* E8 f
* x- S5 q" x3 p3 E: Y5 O/ V* r(defun c:ai_dim_textabove (/ ss)
6 k$ }( }: s$ t (ai_sysvar '("cmdecho" . 0))
9 j! B2 t: F! t( Z( W: B& j5 Q (if (setq ss (ssget "_I"))
; N7 g1 _& a4 R (command "_.dimoverride" "_dimtad" 3 "" ss "")
. F9 ?7 C' o5 N7 g (if (setq ss (ssget))$ b6 w- t% N6 x h
(command "_.dimoverride" "_dimtad" 3 "" ss "") + s8 d5 R1 r0 _1 c. {
)6 ^1 z, | g! y' b, z
)* G. c. H5 Y+ {+ n
(ai_sysvar NIL)6 ]; V/ N) O g5 h
(princ)" C/ j9 D, `! v8 \5 N& L
)
5 `& |0 k0 q" h/ L% i: a# T' n u- E0 j+ z' l6 |
;;; Shortcut menu for Dimension Text Center
; n; u+ x2 Y% N+ e( ]
, r9 c3 P, \" E. y9 w0 H* j(defun c:ai_dim_textcenter (/ ss)0 Q3 G5 \4 x! p& e/ n% R
(ai_sysvar '("cmdecho" . 0))* H9 J% a; y9 {7 x$ \$ b( Z; O
(if (setq ss (ssget "_I"))5 X5 G* Z5 W# z: V$ N$ N% P
(command "_.dimoverride" "_dimtad" 0 "" ss "")
, ^& L( X4 r5 O6 b6 }4 z- R (if (setq ss (ssget))
* q8 N! X1 P: r2 t (command "_.dimoverride" "_dimtad" 0 "" ss "") * o5 ?: l4 D! V2 ~! d
)( I: X: s) s! r6 {; Q B$ Z j" C
)
6 Y! {& w7 h$ R, o( p+ | f- C( n, d (ai_sysvar NIL)
* V$ Z% S; p& X9 k! ` (princ)6 k/ D! N! R0 Q
)0 s) l1 E. c0 Q& \ I+ @+ u+ Z
: R! o7 z, v4 [) q7 t" f1 `7 J;;; Shortcut menu for Dimension Text Home " W$ E" ~" V+ e9 }" `* ]
0 |; w2 H! C9 E1 _! M; n+ e
(defun c:ai_dim_texthome (/ ss)
) u( T- L L# c& u( s$ H6 h" h (ai_sysvar '("cmdecho" . 0))0 ^& L; i. V" {; X4 j2 u+ n
(if (setq ss (ssget "_I"))
6 X+ X4 \& u4 p W, g (command "_.dimedit" "_h")
# E- g* l$ ^1 H% ^* R (if (setq ss (ssget))
2 b1 M5 {! M- ?$ M$ a+ ? (command "_.dimedit" "_h" ss)
0 [& ]& r1 C; E, |7 g8 q ) r2 p7 n7 H' C% K( D! k
)
+ `/ F7 z, k4 b5 @) A/ x3 |# z* D (ai_sysvar NIL)( h7 g& R6 X+ `! @ G" W. D
(princ)$ \' E+ h4 A9 L! c: r& V
)
$ x. d: [) ]% d% I
# R: d8 P9 v4 Y
; Z) A' u+ Q$ p+ ?2 U* ];;; Screen menu item for CIRCLE TaTaTan option.2 j$ H1 T5 n8 D
;;; first, get points on entities" y. y8 U% e5 O0 @
(defun ai_circtanstart()
& n0 c' w3 N: q. u7 O0 ?) A (setq m:err *error* *error* *merr*)+ n7 I8 e* U: {! c7 R4 S# m
(ai_sysvar * ~6 L3 Z; \2 g% v
(list '("cmdecho" . 0)
- A: S9 L. m3 l$ b8 ]/ g ;; make sure _tan pick for CIRCLE gets same entity* g7 y$ ?* r L3 M$ ~
(cons "aperture" (getvar "pickbox"))
! R1 s; j9 v# ~ )
$ \$ F9 i: n5 K ): g% o$ Q. Q! P2 Z* U7 i0 ^7 Q& |
;; prompts are the same as CIRCLE/TTR command option& g; ~9 r1 N% Q `# C$ l
(setq pt1 (ai_entsnap "\nEnter Tangent spec: " nil))
+ t8 q. _$ E! J: v7 V (setq pt2 (ai_entsnap "\nEnter second Tangent spec: " nil)), |$ Q4 [& R4 k; v; [ @7 h
(setq pt3 (ai_entsnap "\nEnter third Tangent spec: " nil))8 ^0 ^ s. Z3 J; |' K, }
)0 x {" a0 C, t' m1 h+ _# |- ?) G
;;; Command-line version ~% U# F1 f, {& L- {' i
(defun c:ai_circtan (/ pt1 pt2 pt3)6 c4 V$ r% o3 n' }: m d
(ai_circtanstart); ~ k2 g0 _1 B" L' V2 r$ }
8 Q' d2 d+ \4 h8 n6 K/ j( v (ai_sysvar '("osmode" . 256))8 |* ~& c. M6 h( m1 H
(command "_.circle" "_3p" "_tan" pt1 "_tan" pt2 "_tan" pt3)8 j+ V! z2 G5 {) l4 _: x
) |; M! @& E% |5 Y$ y# W
(ai_sysvar nil)
: A+ Z' F4 C8 a7 d" s8 F/ j (setq *error* m:err m:err nil)5 h; h- V: D: K; O, B0 T0 x9 u
(princ): N$ H) J) z. Q1 Y: Q
)
2 E6 U) w& U+ k' G. P/ t;;; Use this if CMDNAMES == CIRCLE
$ H3 Q, ~: o; I(defun ai_circtan (/ pt1 pt2 pt3)9 @/ ^1 B& B+ Q+ r; ~9 ?+ O; t- P
(ai_circtanstart)1 j m1 k! H) D V; ?
9 `9 A% a0 V$ I" S
(ai_sysvar '("osmode" . 256))" \4 C2 A) ^& ^& d/ S) g
(command "_3p" pt1 pt2 pt3)2 X: C# q9 r% j+ f$ X( d
9 `/ p5 k! y7 @# y# G. x (ai_sysvar nil) q9 }6 g" c. V- I7 c4 l3 j) I( J
(setq *error* m:err m:err nil)
" D( M- w+ i5 ~0 l# V (princ)
+ F( L& Y+ C3 f9 o" k+ U' n k4 k)& E( X$ P2 b/ @0 p' Y% A" b# w# f
9 J) p8 R1 j& c, E
; b1 v+ C. E( v$ L
) }: R2 ]1 }" L! t;;; Shortcut menu Deselect All item.
+ N2 r3 p8 ^9 J; Y2 i8 D2 {3 \% [) ?
(defun ai_deselect ()1 N- R7 v5 r/ k E* ~9 _2 w/ t
(if (= (getvar "cmdecho") 0) ;start if
2 i0 e8 p- o: [' ?8 _- E+ K (command "_.select" "_r" "_all" "")
/ _7 \3 s1 O; g. f (progn ;start progn for cmdecho 16 S) @! N2 |2 t- A
(setvar "cmdecho" 0)
- y. m# j8 G/ m3 w, B (command "_.select" "_r" "_all" "")8 G G. {8 i# l9 d9 @+ s5 W
(setvar "cmdecho" 1)
* E7 B& \6 U9 F; n8 |$ h ) ;end progn for cmdecho 1
7 @9 l+ D3 v5 S* u ) ;end if
+ E6 t) w! r( N8 _ l8 v (terpri)
& B% m( L8 X, x } (prompt "Everything has been deselected")+ [$ s" _/ w! h, p8 E, m
(princ)
- O% F/ }% e. a% |( d$ L, Q/ x6 r% i)6 a& n8 a3 A& O' B9 ]; F: j1 x
$ O5 I, A. {6 l8 [- U9 k;;; Command version of ai_deselect to be called from the CUI
& _8 S! u ` \# E. m. _;;; so it gets properly recorded by the Action Recorder
! g0 \7 `1 V" P1 `; L0 y9 s;;;* B* G' A& G. e
(defun c:ai_deselect ()
+ o( ?! R: ~ f% c8 o7 }# K (ai_deselect)' C& E0 P5 u' ~& y1 D; K
(princ)* ?- c3 _3 O7 h
)/ F# u- V- T0 @* ^ t# K& G
% \' ~ g' L1 e- z0 D: y;;;
# K; ]& \& S3 @1 K;;; Enable Draworder to be called from a menu
- z9 d) y" X6 S% Q;;; Checks for Pickfirst selected objects
8 b" B3 |5 J* ?% k;;;' x- E* U3 l# D3 c5 J
0 D, z6 I6 a8 I- p. k
(defun ai_draworder (option / ss )
! a1 v0 [+ o- I- w7 v- ], L1 T3 f8 |. z) U( D
(setq m:err *error* *error* *merr*)
0 f0 W+ \9 n3 N" v" ^" M1 | (ai_sysvar '("cmdecho" . 0))# Q" A0 r/ w! H$ f
( ]% u8 l% J: o9 B4 f# q' s (if (setq ss (ssget "_I"))
; Q7 {1 w4 X/ n' ~ (command "_.draworder" option)
5 g1 A k C$ [2 i4 Y (if (setq ss (ssget))
( `5 V+ P/ t% D (command "_.draworder" ss "" option)
3 ~8 t9 p& j( C) S) ~9 j )+ R4 r9 j5 f# R
)
9 b3 R1 d& o, j( T7 G (ai_sysvar NIL)0 w$ J7 z4 g6 ]! a; W, ~3 c
(setq *error* m:err m:err nil)
, U; v. A( m5 o# r8 @7 r! |* n' K3 w( ~' Q T4 D3 t
(princ)
( W& y, v0 n3 y: j1 d) K8 x) W, I' t)
* W% J [) Q, {* a6 t/ N3 b( ^9 q8 P4 w9 f% f" C2 B
;;; Command version of ai_draworder to be called from the CUI1 _$ o8 }1 A0 j) z: a' t' h
;;; so it gets properly recorded by the Action Recorder2 D- I7 i& b% [4 o. U' E
;;; F& e* Y) ^. ? x% t3 `. B8 E
(defun c:ai_draworder ()3 [9 _% S, i @. v5 }3 [
(initget "Above Under Front Back")' @' I+ R/ W3 ^& v- N
(ai_draworder (strcat "_" (getkword)))
% U& S$ ]' D5 Z# }4 P (princ)
% M+ I0 k7 D. ~# Y: ~# V+ n)
5 J' Z" `% m' O: Y8 M5 D' S
# q1 d8 Y5 \ e(defun c:vlisp ()
5 c, l( c+ t5 {/ k (if (/= nil c:vlide) (c:vlide))9 ]1 [! S6 `" C$ m0 `" T7 C
) N! F& C a! A' d5 W j5 G
" h7 F7 f: X3 |4 Y: N1 s6 \(princ "loaded.")
# ~/ A9 {! w7 g; B) I3 c* H" L; w
;; Silent load.% x0 s' h7 B7 G3 z( t2 [: Y' ^2 {7 _
(princ)4 f0 z6 G! B5 n! E5 q K' G+ b, W* g
' O& K Z" S: Z& F- { \- Y, N
1 z* d+ Q4 @+ @; q& i
' V3 C! _$ i( P+ b+ o s;;;----------------------------------------------------------------------------
$ U& ^9 w2 ~* `2 O. f+ H: x;;;
+ R* X! x4 L0 c, G;;; DDCHPROP.LSP Version 0.5
4 A( A* \# K: ]. o;;;
7 o2 m7 i5 O9 C& ~;;; Copyright (C) 1991-1993 by Autodesk, Inc.
# C! r2 `0 R p;;;- c1 Q% d: P6 K3 E7 d
;;; Permission to use, copy, modify, and distribute this software
8 r) ~1 w# p! s& h( \ n( B5 {;;; for any purpose and without fee is hereby granted, provided; ^# X+ c- B; f
;;; that the above copyright notice appears in all copies and that
+ y& v, z/ H. r. s1 ]" ^2 r;;; both that copyright notice and this permission notice appear in8 g6 {( t8 l0 @+ }
;;; all supporting documentation./ w" ~# y" F b. A4 \
;;;
7 o3 {9 V. X/ M6 w F$ {' z' k;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED4 B$ [7 I# G; p2 o& c
;;; WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR( D/ a( d1 g: V9 ]3 Z2 D
;;; PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.; ~3 K* p+ R- A2 R& N
;;;/ p) Y" y& b% Y( h# F: c
;;; 2 February 1992
7 L" F ?$ n1 V1 m% z) y;;; + Y9 W' d. [9 Z, X- L$ z& m9 g
;;;----------------------------------------------------------------------------: Q7 n* ?$ j3 |& U8 u" N
;;; DESCRIPTION
: Z9 f' T- m1 A6 x& X0 z;;;----------------------------------------------------------------------------, ^1 Z/ y2 u& C1 n* u% A
;;; C:DDCHPROP is a dialogue interface for the CHPROP command.
* G& K; S8 ^3 V K;;;
5 F6 F& o) s0 W2 J+ K8 n;;; The command looks similar to DDEMODES. The main dialogue has an image
) M4 Q4 g0 f3 ?/ U9 i [4 A;;; tile, 3 buttons (layer, color, linetype), and an editbox (thickness).
( b1 e( v; V" d8 m6 V;;; The 3 buttons each launch a sub-dialogue containing a list and edit box. ) e* l% `2 ^" N S% {
;;; The dialogues are all defined in the DDCHPROP.DCL file.
) y8 G: J! m9 }8 o( E;;;. A$ M7 l; T3 l
;;; c1 j2 n7 r0 W! C' x% s
;;;----------------------------------------------------------------------------
" x! g J6 M! y1 D/ J8 e4 U;;;----------------------------------------------------------------------------
: }3 u8 R: }% w; Y3 T8 L" }2 Y, p+ s;;; Prefixes in command and keyword strings: - k( G# m' i4 R# m# f" v
;;; "." specifies the built-in AutoCAD command in case it has been
W' F) h0 ^, S;;; redefined.
% A9 Q' h) K- h! O" b+ e7 E;;; "_" denotes an AutoCAD command or keyword in the native language3 p( V$ A% m" a; ~
;;; version, English.
4 G& A/ y0 m- U, K$ N3 F% [;;;----------------------------------------------------------------------------
) A: U% }3 J: w# _& n: _* ]3 A+ F;;;
; ` v# v( F* C- K;;;( Q& V3 y, l, @. k8 q c
;;; ===========================================================================1 Z; x8 M B* |) T1 Z
;;; ===================== load-time error checking ============================+ T" A# ?+ S' P( U0 f9 J$ v
;;;1 ?8 u. I: [3 s7 }: t {0 G
+ T( X7 \- Q; _. ^' e (defun ai_abort (app msg)8 w4 K9 D7 B' o! `/ n4 z
(defun *error* (s)
/ |( n/ L, N' h- M9 B* [0 `9 I: f (if old_error (setq *error* old_error))- o; U% f! |/ O, m5 p0 j d
(princ)
3 A/ K9 W5 m- s* X )3 M; f* x% V+ W1 ^! h, b
(if msg1 Z* Y' t: P q
(alert (strcat " Application error: "
, O C0 x4 t L2 c& G. M app
K/ p1 n1 X+ `2 E" ] " \n\n "
# b+ {6 o6 L1 }5 M msg
8 I6 t& p: z# |; k' ?3 h2 O9 W " \n"
# ?6 @6 t. c/ \0 K )
' L7 H8 S0 V/ I/ E8 @# f ), o# t6 F! F7 U
), E( b( a/ E7 w* J5 J) A% l
(exit)
0 |2 S! ~* z$ R1 ` )
0 ~. \: v4 n4 w* _1 Q9 S
. s8 T% r* ^/ Y5 ]7 k;;; Check to see if AI_UTILS is loaded, If not, try to find it,
9 x7 i1 q* f9 c7 R& ]5 Z;;; and then try to load it.! U) D S2 t- V m, G# Z C3 V
;;;2 Y2 k3 \: j4 p/ I
;;; If it can't be found or it can't be loaded, then abort the
, F. x* L' y+ Y9 N' H# \+ K& ]8 l$ f;;; loading of this file immediately, preserving the (autoload)
! S8 z9 u5 B: s;;; stub function.
0 Y* G7 K0 E2 o6 m( }9 G. y# L6 q& u
(cond4 b4 i0 {! C& f4 b1 j' F) X
( (and ai_dcl (listp ai_dcl))) ; it's already loaded.
! g2 b* R" R$ A3 D; u6 J( w
" S9 D1 `4 ~# J ( (not (findfile "ai_utils.lsp")) ; find it
! L( n9 f% u% ^( I! h! U9 u: M (ai_abort "DDCHPROP"$ M V- ~/ H1 @" y
(strcat "Can't locate file AI_UTILS.LSP."
7 T3 Y% S6 g& ^. a2 F% ]; T! P" _! } "\n Check support directory.")))
Y: o7 e) Z p; g9 x# o& w. c: E1 b
( (eq "failed" (load "ai_utils" "failed")) ; load it
& y: Z _) e9 O5 X# |. W (ai_abort "DDCHPROP" "Can't load file AI_UTILS.LSP"))
: h( ]# W; {; ^" A2 w! D$ X+ ~ )* T# h" |$ D6 w7 k2 E j% d
4 }% g: e( M' W8 J0 J$ {
(if (not (ai_acadapp)) ; defined in AI_UTILS.LSP
* o/ r% P4 j9 _7 a( j (ai_abort "DDCHPROP" nil) ; a Nil <msg> supresses
3 k& Z! ]5 j1 P1 R1 ]% _$ ] ) ; ai_abort's alert box dialog.
+ ^0 s4 M/ T8 Y% z- D
: k1 v* \ P3 k+ M, _! d- M: B" F;;; ==================== end load-time operations ===========================
. o* L& p2 _0 ?! I; T+ @/ h; ]+ ^( E# N9 |% Q
;;; Initialize program subroutines and variables.
3 `+ v B; U8 h/ o! p6 y9 {: b9 L5 V: s( B3 J8 u1 w
(defun ddchprop_init (): U% ~- D" K% R5 j! k" w
$ A* Y) {0 D' n" d, I3 f ;;: |/ f. _7 R. l" {
;; Define buttons and set values in CHPROP dialogue box
( e! J# V+ q! Z ;;
# N; P2 R( d6 {) |. G (defun call_chp ()& S1 |# d; A/ V; ]2 M+ e
(if (not (new_dialog "ch_prop" dcl_id)) (exit))+ h4 j4 \( l f J5 F' U) p- O
(set_tile "error" "")' m* D+ [5 s9 j: v- q
;; Set initial dialogue tile values
! N/ G3 U* D- F, j (set_col_tile)9 H1 x- H$ j( X7 x) L
(if (= lay-idx nil)
/ ?- K4 T! o) g5 F% G3 n- @+ v (set_tile "t_layer" "Varies")' u" F+ L5 h2 b" a8 d
(set_tile "t_layer" (nth lay-idx laynmlst))1 Y, o9 B8 e9 W
)* G# o9 @1 ]2 F+ a& B. }, W
(cond / Z1 W9 \8 m* |% ^$ j
((= lt-idx nil)
/ z5 A2 u/ E# z* Q1 ? (set_tile "t_ltype" "Varies")
' ^8 O! e# k+ m7 G: V1 ^3 b) ~ )
4 |9 k' Z* d8 ]) N( V4 j5 j ((= lt-idx 0) ; set tile "By layer & layer linetype"
7 m# a& J( J) v) s (set_tile "t_ltype" (bylayer_lt))
5 o: y) f- [* n. e. I1 x4 ]2 n. _ )' L) @3 d8 C/ i/ C% I, {: g
(T 0 z) w* _& N) y& Y7 v0 K0 ~4 R, }
(set_tile "t_ltype" (nth lt-idx ltnmlst))
' C W9 [' B' u: j+ V2 D. }2 S )) K6 I5 n: p! t) ]5 S
)/ d2 J" R( d% B: |1 D/ n
(if (or (= ethickness nil) (= ethickness "Varies"))
* Q, x* V3 S4 c1 B" e7 _ (set_tile "eb_thickness" "Varies")3 n0 v N, b) N% u ^- V
(set_tile "eb_thickness" (rtos ethickness))
6 i$ \ q# H A5 i6 G. G) e )( O! \+ m V$ Q5 u. Q, V6 E* c/ M1 l
;; Define action for tiles$ ]2 e$ x& a; k
(action_tile "b_color" "(setq ecolor (getcolor))")! B( l: V# v- N+ ^0 b
(action_tile "show_image" "(setq ecolor (getcolor))")
3 [+ ?# e5 y8 ?% m3 o) G, C- ` (action_tile "b_name" "(setq elayer (getlayer))")1 T4 ^$ |$ S2 y3 B' m% N
(action_tile "b_line" "(setq eltype (getltype))")
# f% E% A3 l* F$ m (action_tile "eb_thickness" "(getthickness $value)")8 v! n; V8 F2 C
(action_tile "help" "(acad_helpdlg \"acad.hlp\" \"ddchprop\")")
( N, e: j. o l& m N( [4 A (action_tile "accept" "(test-ok)")$ w4 g# W) b# z
(if (= (start_dialog) 1)4 E6 o. E4 h* Z
(progn
8 y, S. n! `" d" a2 o0 R( t (command "_.chprop" ss "")
4 x u2 l' a" w- S (if ecolor/ D/ U/ V1 E/ v5 q/ ?2 e
(progn, ^$ T2 h" [5 \. l
(if (= 0 ecolor ) (setq ecolor "BYBLOCK"))0 D8 m4 t$ \8 ^1 Q9 @) l. J8 J1 q
(if (= 256 ecolor ) (setq ecolor "BYLAYER"))
: v4 f2 u# ?( l9 _ (command "_c" ecolor)
- v; j9 {1 R5 y U/ M )0 q- R+ B2 b4 P- O! R& K
): ^8 q2 w$ Y G! O$ x
(if (and (/= eltype "Varies") lt-idx)" [4 \( H, y- d" Z5 ]) U2 ]& D# g
(command "_lt" eltype)* a! B4 w3 e R7 m3 _' k2 w; C. H" J* ^
)- m' D6 W3 H) c5 v; N) U* x
(if (and (/= elayer "Varies") lay-idx)9 N( r, ?" x$ T' G8 a
(command "_la" elayer)
, ~/ S7 f4 ~; v; U )
% }. p7 F: b; }% F' Q! B. J% h (if (and (/= ethickness "Varies") ethickness)
& i# b I) y' U/ @* j) k) f e (command "_t" ethickness)
* }% G5 r' J; [/ _1 n Z' v6 H( r! b )
8 {0 W* ] t) U' n (command "")
) O# X1 _% [: U9 Q )
9 ~/ O5 ]- r9 x* @) i1 C (princ "\nProperties unchanged")
$ l# z1 \! G5 S )! A5 u+ v& d6 `3 u# Y
(princ)
9 l l6 } J! P+ B# i0 w )6 f# y, W# T1 w1 E( B
;;
2 ]& _) [ A& N2 n# I ;; Function to set the Color text tile and swab to the current color value.
6 ]7 r4 }/ U+ w1 i8 S. y- Q! ] ;;3 `$ e& G1 y2 T& s" v
(defun set_col_tile()
! X# T/ N1 S6 ~9 w* u1 D (cond u$ ]2 R! [ S- h' h
((= ecolor nil)
; T+ j, P2 r f8 S0 e/ g/ }! M* q (set_tile "t_color" "Varies")
+ |1 U( U: M! X; c (col_tile "show_image" 0 nil)0 k1 C( J2 L. Q$ ?; a! \
)
0 U2 e, P1 g/ U7 X9 M2 h x ((= ecolor 0)
$ H# T5 E+ q7 }) E ~ (set_tile "t_color" "BYBLOCK")* E% A) D! T; O3 a1 O
(col_tile "show_image" 0 nil)
# W% O3 F! u& Z* n7 i& k4 g )
3 U( O6 L* V' v4 z6 u7 E" i ((= ecolor 1)
% P5 a& D5 N j$ {4 y" D l (set_tile "t_color" "1 red")
* I/ a0 G4 r* M& {( ` (col_tile "show_image" 1 nil)
4 y, d2 W6 l2 _4 {6 j )
! U; o) s9 ]( ]( q& u5 m& S ((= ecolor 2)9 s- ?; p$ r* a% l& e
(set_tile "t_color" "2 yellow")9 o, A$ N+ V- T
(col_tile "show_image" 2 nil)& Y' n1 L% V3 [+ M
)
# s: N! F* w) Y1 I5 l ((= ecolor 3)% c# ]- K6 I8 ]4 p
(set_tile "t_color" "3 green")
( M! g$ E& o( Y8 g7 Z' Q (col_tile "show_image" 3 nil)
$ Z' ?% s# P! g7 n )5 c. i; ~. |" o9 m) a; \4 r
((= ecolor 4)! h8 j$ F: `: s7 d, h) L# K
(set_tile "t_color" "4 cyan")
' d8 o' x9 N0 ?+ u& D2 i' H (col_tile "show_image" 4 nil)
, P L" j$ a4 c- j* W )! _6 h* z% O/ Q; y
((= ecolor 5)8 U- Q' ?( Z8 ?3 P( k8 h) H
(set_tile "t_color" "5 blue")
4 o6 O( j8 [0 s6 A. H& } (col_tile "show_image" 5 nil)% r) D- A7 X( i- j8 h5 b2 i* k
)
, @, t7 e; V, R+ p8 b$ S ((= ecolor 6)
2 v( W1 t6 L; h% ?0 n7 b0 A (set_tile "t_color" "6 magenta")
8 Y! q; y, Y4 u4 B, A) u/ T (col_tile "show_image" 6 nil)+ ~: \4 L; D3 C$ L0 L
)
$ A+ V0 F, V+ P- a8 N7 Z ((= ecolor 7)
G% A! d- ~: g1 _6 y+ m$ V( O (set_tile "t_color" "7 white")4 A# P4 F: Y) u, O3 C
(col_tile "show_image" 7 nil)) F# d: ^) U9 d3 B5 Z
)
" k3 {( I+ a8 l9 w- p, A4 \ ;; If the color is "BYLAYER", then set the tile to
: x) J7 ~; R% H4 a( R5 n+ j ;; show it's set By layer, but also indicate the
+ F# H3 q* O$ _- T' s W ;; color of the layer - i.e. By layer (red)
2 T8 s) ]3 ]! a+ i8 v6 K3 Z ((= ecolor 256) c; I; G* t/ G' ]0 J9 O
(set_tile "t_color" (bylayer_col))
: U4 S! ]5 S9 X6 s (col_tile "show_image" cn nil)- h7 P! w! |2 A" \, ], F) V
)
4 X2 x; I# S6 ~ (T
0 |1 V8 |& H2 Q (set_tile "t_color" (itoa ecolor))" G1 `) w5 G% j/ S
(col_tile "show_image" ecolor nil)
1 u* j2 v N1 |- m+ D+ R )5 [- Q$ j! o9 `7 j0 s+ h* {
)& x8 @+ }% P. o( \' ]. B) A
) n$ H3 @ \: u) Q7 \
;;' L" V F% N$ W' ^% z% f3 J
;; Function to put up the standard color dialogue.# Z( u3 ]5 m: W
;;& t& F2 K; n: q1 [8 S
(defun getcolor(/ col_def lay_clr temp_color)9 t; Y6 s+ d) e9 ^
;; col_def is the default color used when rq_color is called. If ecolor
& R; W5 r; h- o3 [$ Z, }, V% ~ ;; is nil (varies) then set it to 1, else use the value of ecolor.
) F9 E6 R" \. W# a7 m( K (if ecolor1 k: \/ @2 E9 I( x" E
(setq col_def ecolor)4 L' N: c' A4 Q% {0 ]7 r5 T
(setq col_def 1)
* n$ Z( N7 l. ^1 `6 t5 u )) ^: F- P& D$ k$ ?1 v$ v3 ~- j
6 q& ~4 z( @5 L
;; If we're working with a single layer, get its color& d& C$ r" k$ B& t% y- C: e
;; for use in the color swatch if the user selects color BYLAYER.. y4 z: e) f: \' ]
(if (/= elayer "Varies")1 A# d' K+ {% {! Q. p9 e
(setq lay_clr (cdr (assoc 62 (tblsearch "layer" elayer))))
+ R, N. c7 y# z9 e4 w3 ? (setq lay_clr 0)
: a* X! z4 o; |, {, e7 M, ~. ] )
5 C, f9 k# H7 \, |- K' R6 M (if (numberp (setq temp_color (acad_colordlg col_def T lay_clr)))$ h( s& r) }) \1 J1 }. M; \# m
(progn: Z8 m3 ]& B- L2 F0 }9 ^6 T1 T
(setq ecolor temp_color)/ l J& `+ e% I' s# B
(set_col_tile)9 o7 u/ z* B" I' H/ a' E7 t
ecolor
0 }7 b, S" ^: d; \5 L$ j+ U )6 f; y" k5 l9 |, D1 f) F
ecolor/ g$ @& x9 {7 J) P$ L
) * @5 M/ M" L; `) ?* b' n3 c
); K0 [' w, Z4 {
;;* m, ?! i. b8 d* ~2 @
;; This function pops a dialogue box consisting of a list box, image tile,
2 @. t! i( T* B- g n9 [& V, @) P ;; and edit box to allow the user to select or type a linetype. It returns
2 I8 t8 R: l. ?! g) J( L+ l' n- W ;; the linetype selected.& C* @5 J& ]- w0 z; O1 V
;;" g: l8 ~/ G+ q* l
(defun getltype (/ old-idx ltname)
: R* ] v' A, _/ R- I# ~ ;; Initialize a dialogue from dialogue file9 g& N0 Y: p$ f0 U/ ?. c
(if (not (new_dialog "setltype" dcl_id)) (exit))
7 L7 `: }, ^! t$ d1 z+ B (start_list "list_lt")% }8 n" e2 y' G/ y3 h. C
(mapcar 'add_list ltnmlst) ; initialize list box
2 M/ Z2 p+ W$ N) K1 ~, I (end_list)
* P* D' W' s+ V2 P: w3 x- t! p (setq old-idx lt-idx)
0 K8 u7 T6 y( j8 z ;; Show initial ltype in image tile, list box, and edit box
& a- ^6 {. k- N. y; m+ B, t% e (if (/= lt-idx nil)" t8 a+ q4 [% X
(ltlist_act (itoa lt-idx))1 r, A7 v/ o) ?. M, }4 l* I
(progn5 U# o9 j6 _# Q5 ]) [$ d
(set_tile "edit_lt" "Varies")
P- }% I5 ]2 J, \. f. ^2 k (col_tile "show_image" 0 nil)2 P! v! ^' l4 ~. J# R
)
; j5 l m7 n2 P3 ~1 ?: u) I' {/ a )
n6 }* ?! T9 I" r; X (action_tile "list_lt" "(ltlist_act $value)")
0 n+ l/ l7 Y0 `( }7 G (action_tile "edit_lt" "(ltedit_act $value)")
, r, E& l. n9 H& E (action_tile "accept" "(test-ok)")
. H' `% V3 { @9 e- Z) z; q (action_tile "cancel" "(reset-lt)")% t1 q8 S( P T/ M+ ~6 ^ x
(if (= (start_dialog) 1) ; User pressed OK
( ]- ]2 }3 o/ D0 j) q" c* H (cond
& J2 v5 G5 D% L9 n# h. n. Y ((= lt-idx nil)
" w) d8 M% I; E) s9 P) V- q e (set_tile "t_ltype" "Varies")
4 a2 u2 b" _* ~* r "Varies"
/ ]7 @: O# e, f4 |3 ~4 x. @+ U7 V )# Z' \/ z G; P3 D' T* h
((= lt-idx 0)3 a* u0 M8 `9 t
(set_tile "t_ltype" (bylayer_lt))
- b2 m$ }$ e; a! O- E "BYLAYER"* v- G1 q7 Q# a& @' x+ i
) A+ W# Y$ \4 W8 e
((= lt-idx 1)9 r$ H. e9 ?# P4 q5 {8 x
(set_tile "t_ltype" "BYBLOCK")! A# a$ P3 @3 k9 ? p1 l4 `
"BYBLOCK"
/ u1 V7 o: h4 j: R% M8 f )( A( M5 I6 g; e7 ]& g. C9 y1 A
(T 3 F& P f; [* m6 ]% H9 m
(set_tile "t_ltype" ltname)
; i9 ~. m8 R" M. m. F1 G ltname& X# t7 i- P ^ n; `- `
)
! t1 [1 S9 O/ J' g y' \ )
' ?4 J1 H4 i3 A eltype" l f1 x2 e+ C0 S0 A( e: g
)
! j: ]( K: b" x6 R: w: P- C8 ^ )
. a3 o" A) k4 ]- k* g ;;9 V1 [. @+ a3 T0 i; u+ d- o
;; Edit box entries end up here6 y2 A& `3 f/ T" a( M
;;2 `4 |" \ q* s4 i
(defun ltedit_act (ltvalue)
4 n$ K" u/ ]7 b, m ;; If linetype name,is valid, then clear error string,
% N3 r( F: q9 p8 G6 p7 j( t& N ;; call ltlist_act function, and change focus to list box.
7 [- }, o, p) [+ O& L% W2 P ;; Else print error message.
5 w6 s: O6 S, i* _/ U) _; d, e (setq ltvalue (strcase ltvalue))7 r& C% ~" b2 x: [3 T( j
(if (or (= ltvalue "BYLAYER") (= ltvalue "BY LAYER"))
[# c) b( E: E) |" T- ^ (setq ltvalue "BYLAYER")0 G2 ^0 K3 ~% Q
)* |6 R2 D E) T6 H3 t" ~
(if (or (= ltvalue "BYBLOCK") (= ltvalue "BY BLOCK"))
& N: k* c4 B9 u3 E5 o (setq ltvalue "BYBLOCK")
1 N3 y" ^. h6 Q+ n3 d9 K )
/ \+ N+ U8 g5 D0 j (if (setq lt-idx (getindex ltvalue ltnmlst))
' z) X' v+ ]- C; {# l9 ^$ Z (progn Z1 N6 j! O% O6 V" T: H u
(set_tile "error" "")* y# F! P+ O4 r f, H: i' R
(ltlist_act (itoa lt-idx))+ N" b1 Q$ ?4 G0 h
(mode_tile "list_lt" 2)* g6 [/ ?, |. x; y w. v4 u
)
. I2 Y7 k4 \6 [8 B3 z (progn
9 n% I/ f/ U1 Q7 ?9 F( X (if (/= ltvalue "VARIES")1 l( p, _) v7 p: i# h# L
(set_tile "error" "Invalid linetype.")
* v; j5 _8 s3 Z3 T3 A& }7 F )
U! |7 D% h$ C5 j2 b I (setq lt-idx old-idx), ?9 l4 ?6 @! ?5 p) U; f. V2 G9 j* h! Q6 p
)
' |% I% }! n" Q0 l* ] R- F* z )0 a9 y. T7 K2 Z) Z) h; D
)8 {5 P3 ^; n! s. Z M
;;
( I$ N6 Q" N" q( D& s ;; List selections end up here
& b( K4 k5 Y8 L* Z9 ^6 u& g ;;
% O% Y/ N, x6 U. Y. b (defun ltlist_act (index / dashdata)
/ ^0 i; P6 y2 [0 J8 i. {& |8 O ;; Update the list box, edit box, and color tile; A4 ?$ ~ y( m7 d) z5 B
(set_tile "error" "")& p1 @* m3 ]0 @* U
(setq lt-idx (atoi index))' n2 e( M* w" Y* e4 q6 M% l
(setq ltname (nth lt-idx ltnmlst))
0 T2 y! {; o- l8 m* K (setq dashdata (nth lt-idx mdashlist))
- t; {& S3 s+ k/ G8 s; o9 | (col_tile "show_image" 0 dashdata)
4 H4 v) s' G/ t6 N2 }4 o% l7 S9 C (set_tile "list_lt" (itoa lt-idx))2 x/ H; k0 F9 h+ a
(set_tile "edit_lt" ltname)
- T: |6 ^& ^1 B1 w# ` )1 J5 D" r( q/ }9 j
;;
* v! t' q3 I0 `- l. f0 E, g8 J D% [ ;; Reset to original linetype when cancel it selected
5 K Y. J% v* x$ W ;;
3 C. j/ e- i8 v$ t (defun reset-lt ()
: X2 M* I @; @4 c: g (setq lt-idx old-idx)
) E8 ]5 F, B4 x8 F9 Y2 C. e (done_dialog 0)
, K0 f8 c4 z9 y. ~% p, m: r- b ); t1 y t! Q( j4 A/ z1 o. I9 o
;;" J; s3 h; f f( G/ @! M
;; This function pops a dialogue box consisting of a list box and edit box to " | d4 R$ Z Z( Y1 X3 I" y1 c* l
;; allow the user to select or type a layer name. It returns the layer name * n5 _5 ^& C- i" m$ ?' }% \% }
;; selected. It also the status (On, Off, Frozen, etc.) of all layer in the
; r. M) H; N- x4 C0 w ;; drawing.* a: w5 ]( i- ]
;;
, A y( D; c* ?3 x) @ (defun getlayer (/ old-idx layname on off frozth linetype colname)5 {8 B5 K6 c% R6 Q. R9 z1 Q1 E) ]
;; Load a dialogue from dialogue file
$ N+ e" _% y+ V, `1 S (if (not (new_dialog "setlayer" dcl_id)) (exit))
/ `2 X& K* o% y; Q5 e5 q. c (start_list "list_lay")
: y2 A1 C4 x; d( a+ P1 o3 C) n (mapcar 'add_list longlist) ; initialize list box) T$ B, q. f9 i3 J2 A
(end_list)
# U6 b/ I: O) [3 e ;; Display current layer, show initial layer name in edit 0 J" _7 s: g+ \% U# Z$ O6 Y+ D
;; box, and highlight list box.
1 T: K7 ^. N2 E (setq old-idx lay-idx)# A3 @4 Q" u) `* W/ q
(if (/= lay-idx nil) (laylist_act (itoa lay-idx)))& L d4 r% i2 g2 x* x" z( i9 U4 l' Q8 U
(set_tile "cur_layer" (getvar "clayer"))3 N8 Q8 }8 C9 X) ?2 r# }
(action_tile "list_lay" "(laylist_act $value)")
" a) ~$ o& h* a& k3 n. L2 \4 q9 l4 @& c& [ (action_tile "edit_lay" "(layedit_act $value)")/ `2 B4 W, M( E1 R# y. \6 w9 S4 U
(action_tile "accept" "(test-ok)")% G) F+ D! H& U( \
(action_tile "cancel" "(reset-lay)")
: M; R2 e1 m, q0 b (if (= (start_dialog) 1) ; User pressed OK
0 o& d- A4 Z: E' W! _) u. C. q1 o (progn
: o& \+ Z! D9 _ (if (= lay-idx nil) (setq layname "Varies"))$ [- Q s1 V' k/ A1 |$ l/ E
(set_tile "t_layer" layname)( C3 {8 v- W# Y' @
; If layer or ltype equals bylayer reset their tiles+ [/ _4 _5 e* P. M. a) K9 \. E
(if (= lt-idx 0)
0 } t) ]) y H2 M% g5 d (set_tile "t_ltype" (bylayer_lt))
1 W$ T$ N3 v+ D! v ); \% K; t& \ ^. O9 \
(if (= ecolor 256)" r# E- ]5 ]! \9 ?3 E! @; ?. d) F
(progn; K9 n* L/ s7 B
(set_tile "t_color" (bylayer_col))
- A5 g3 G9 V3 r2 z% F (col_tile "show_image" cn nil)
0 d5 a1 t3 ~) W3 \: A1 F7 Q )
4 y" c) u! q/ r7 d3 q7 R( a' s )8 K# d( B6 z8 g
layname
3 X: @& W* J/ t0 I9 I )4 L+ N# p" y/ @& }6 [! s0 G
elayer
8 p' @' F$ D. N$ K' o/ p1 g )
+ [+ T9 F9 u) j6 I ). X8 Z1 \# {! ]/ ^% b# ^% F7 j
;;
/ H+ a8 X8 R6 w5 M ;; Edit box selections end up here
) _+ r) ?' `5 z8 A ;; r) ]! o. P4 r
(defun layedit_act (layvalue)
; Y* m# n5 O V" Q8 h ;; Convert layer entry to upper case. If layer name is
. ~/ N' t9 S0 \" f( o+ h2 B ;; valid, clear error string, call (laylist_act) function,3 s, [! Q. D% N6 O- {2 \* w
;; and change focus to list box. Else print error message.
5 z% Y( F! R+ K; P- t (setq layvalue (strcase layvalue)), p4 A9 ~# a, d' R
(if (setq lay-idx (getindex layvalue laynmlst))
" P2 y P, g) J) N4 ] (progn
. s4 r$ n: m* k( [4 o: S: Z (set_tile "error" "")
4 {0 D5 ^ a6 f) E [) B, [. w* h (laylist_act (itoa lay-idx))8 e; c$ f2 x$ A
)
0 x& [1 j, y. K$ j (progn
# G9 ?/ j9 I1 i, t1 H( x (set_tile "error" "Invalid layer name.")* \1 R) T) |+ e1 B+ {/ L8 G
(setq lay-idx old-idx); u/ V: \* H4 k$ w. `0 g" V0 d+ M
)
1 G E; h8 u! u )3 X, M2 e7 T* m2 q; s3 m
)
( J+ u! \, a' ?: S6 g9 @ ;;4 n6 j( q n7 b6 p3 r
;; List entry selections end up here* X$ y& S8 r( \3 P
;;2 [. }1 o1 R$ w9 V
(defun laylist_act (index / layinfo color dashdata)
+ u2 l# o* m' h5 O; |" h$ W) x ;; Update the list box, edit box, and color tile, ^) R9 z# x7 w8 q
(set_tile "error" "")) I" x1 J( ?9 N7 E2 S3 S
(setq lay-idx (atoi index))
1 u$ S2 u, i# m6 e& w4 B (setq layname (nth lay-idx laynmlst))
5 T1 T% G, q: H" }8 s6 c (setq layinfo (tblsearch "layer" layname))
/ L& t5 {4 t) U (if (= (logand (cdr (assoc 70 layinfo)) 4) 4)0 N! Y; q5 E: ?4 C
(set_tile "error" "Cannot change entity to locked layer.")
2 a& m) }' _# u, d+ E (progn
; L, q% }- w Y1 g (setq color (cdr (assoc 62 layinfo)))
+ M+ h% {* P! { (setq color (abs color))7 ]* a6 d: E# K1 \
(setq colname (colorname color))9 p8 G- s3 X1 s( o6 f" W' t
(set_tile "list_lay" (itoa lay-idx))- @: }. c ~/ p' q
(set_tile "edit_lay" layname)
5 L7 U- e% e D+ u( x% T! F$ @, G (mode_tile "list_lay" 2)
- A. k+ F: T3 J5 P ); x' E3 c, t$ m$ Z4 O9 J5 y/ M
)
1 W4 l% s, t& l8 G/ S1 E4 V7 R )
, w$ k; c: k1 `8 {* @ ;;6 [4 }4 u7 F0 y0 o3 R% }% E
;; Reset to original layer when cancel is selected6 E Z' z: h# x5 M
;;+ m J X8 m6 P
(defun reset-lay ()9 W8 ~4 z2 E% e) @
(setq lay-idx old-idx)
; x6 r; t3 }& @ (done_dialog 0)
8 Q7 r& [+ m9 S8 Z )
1 S/ O) ?1 M0 q ~$ y u }& i' A, L ;;) V4 }4 [. m+ s5 ]
;; Checks validity of thickness from edit box. Since (atof) returns 0 when a # i# j1 U# I: b) d7 D
;; string can't be converted to a real, this routine checks if the first 5 d1 ~5 _! B, K' }
;; character is "0". It also checks to see if the value equals "Varies".4 L7 i6 |8 X( k
;;
5 U' Z9 j* R% n (defun getthickness (value)
) d4 Z- Q2 V2 [ y ~3 ` (setq value (strcase value))4 I: _7 [% Y- ^0 f0 m6 g# _
(if (or (= value "VARIES")
, V O, r+ k6 j/ r) a2 n (distof value)& o2 R7 c5 J5 [5 ]! t/ i
)! G+ ]7 A4 s7 y* v9 @& p
(progn
2 k1 B2 p( T4 e5 {: f) w% } (set_tile "error" "")
2 a1 V6 F- Y+ o, L( U. A (if (= value "VARIES")( r) n2 w9 Y5 [
(progn
& d& j6 {" G2 s. B+ h# b1 b (set_tile "eb_thickness" "Varies")
# m2 p& K2 a B# K4 o; m7 t. V" c/ | (setq ethickness nil)
( i. u$ w% q4 ~$ ~+ \" T )3 P/ @% p& e, u
(progn ]8 }( h# o* u3 E& Y ^0 X7 `
(setq ethickness (distof value))
; `4 Z# @6 C% E, k2 W (set_tile "eb_thickness" (rtos ethickness))7 c* v( I" ~0 V6 T6 ?# U
ethickness( X/ k6 m# f! z1 i1 u6 M1 @& V
)7 ]5 |( a3 @3 E
)
5 F* K6 f7 G( g9 M+ ?3 A )- B# u2 d7 @2 r8 [ l
(progn: j! R" A' W) F" T& _& z6 f' R
(set_tile "error" "Invalid thickness.")7 S3 N. F/ N2 r
nil
; c4 Z0 s7 o$ n$ V )
( u! i h4 V, `% J2 f6 r ); D7 [) J8 w7 W$ s
)' c B/ \/ @( g5 ~# _& w# E8 U
;;- E5 |4 `# Y7 X& V* s0 U3 j
;; This function make a list called laynmlst which consists of all the layer 2 s7 I0 ^2 t6 {
;; names in the drawing. It also creates a list called longlist which 4 }, }3 m- M1 \. K2 A6 ~
;; consists of strings which contain the layer name, color, linetype, etc. + g$ g @$ H/ _ `# t* _
;; Longlist is later mapped into the layer listbox. Both are ordered the $ T- S' A! K* G: D, q" }8 Z
;; same.
8 j1 }) G% s# A% [+ u ;;
& }; T6 L, U" ?% _( M (defun makelaylists (/ layname onoff frozth color linetype vpf vpn ss cvpname
; B! w& ?% Y1 ]* {! X4 X xdlist vpldata sortlist name templist bit-70
) N& j: e( m1 q$ m" R )+ n( O" l+ [% y; `' |1 J) M
(if (= (setq tilemode (getvar "tilemode")) 0)
* t2 ^9 N1 D. Y+ W (progn
/ o- ^4 ^8 G$ c" f (setq ss (ssget "x" (list (cons 0 "VIEWPORT")
( \4 o- y* K. E- u. @ (cons 69 (getvar "CVPORT"))
& q$ x Q* v# f6 g9 K8 S )
" P2 w; L* z+ o3 m )
% T/ J" Q$ i9 b )
6 H3 G- N* H5 V0 V (setq cvpname (ssname ss 0))
! n4 F. k1 H( f% | (setq xdlist (assoc -3 (entget cvpname '("acad"))))
|# w/ v1 o* g+ P3 u' ]- c; } (setq vpldata (cdadr xdlist))4 _& u8 k [! {% I% f
)
& Q( X7 q/ o t& S7 ?! _4 G. V )$ b# w: s* C$ c1 y. N9 K2 F
(setq sortlist nil)2 x- k" ~- ?% |: d. |- {5 S
(setq templist (tblnext "LAYER" T))
- o6 @; n7 O% N+ M5 p( v (while templist! W5 q( f4 Q+ I, J8 U
(setq name (cdr (assoc 2 templist)))( W0 ]' w+ l1 _4 A! f3 I
(setq sortlist (cons name sortlist))
/ h/ {: g' F$ h4 L/ c (setq templist (tblnext "LAYER")), X) t7 E# |: @
) " @7 ]* u- n% M) q
(if (>= (getvar "maxsort") (length sortlist))$ [& r5 L- l8 o
(setq sortlist (acad_strlsort sortlist))
; m/ D9 s3 \/ J5 G) s+ j (setq sortlist (reverse sortlist))
: I- t( V1 x% n )
3 i5 Y( q, w: n/ ?8 s5 F (setq laynmlst sortlist)8 v( ~9 r" ~; F: q8 I
(setq longlist nil)# W) Y! B* Q, B |6 i; @3 ~
(setq layname (car sortlist))7 S. I5 u2 i( S& W0 {( e
(while layname
% X; ~4 `9 ~. n (setq laylist (tblsearch "LAYER" layname))
3 @' w: {0 X. m: N6 I u" { (setq color (cdr (assoc 62 laylist)))" u4 f# h, s% T4 ]4 I2 N1 o. X
(if (minusp color)
& B7 h) B) }7 e4 } (setq onoff ".")
4 s$ O; C( P* e8 t (setq onoff "On")
' q+ W9 m) ~2 _5 v& L$ S )
! c' B$ ^; g6 A7 r9 q (setq color (abs color))
! H# T- c! R4 i (setq colname (colorname color))
9 ^, s$ {, j; R (setq bit-70 (cdr (assoc 70 laylist)))
7 T: c) ?# \4 _ (if (= (logand bit-70 1) 1)4 S# Z3 p; Q0 v* T2 ^) ]. `
(setq frozth "F" fchk laylist)7 d4 F* j' y- W6 m6 s9 X
(setq frozth ".")
; P7 H. j }, S6 S3 } )
; ?, d2 v, {$ e6 ] (if (= (logand bit-70 2) 2)+ \6 M1 J+ O+ @- @4 G# M
(setq vpn "N")& l6 l5 V0 p# j
(setq vpn ".")
* q* r( u% b" A1 U o+ L0 x; _. ? )/ o9 |' ~0 D/ h" ^. C
(if (= (logand bit-70 4) 4)6 y; `( S# u! A) w+ b/ _
(setq lock "L")
: r o7 h# d7 _. R! O (setq lock "."), J1 L" U9 S V7 z/ e
)3 M% ~! D' ?$ i* f5 @# R0 o
(setq linetype (cdr (assoc 6 laylist)))- i+ u* T8 v m$ I/ z5 M
(setq layname (substr layname 1 31))
- ?. r1 B$ O3 |4 M; a: n; c8 M (if (= tilemode 0)
! l9 ]4 B3 \1 s' L& v (progn3 T0 |7 j9 f9 ]' @! X. l* s
(if (member (cons 1003 layname) vpldata)
/ L$ Z6 A9 S; G' T* a( o (setq vpf "C")
. C' F3 m8 z0 k& h( z (setq vpf ".")
+ N/ O, M; p+ M )
0 t7 q" `, \( N )
% I/ Q# T* \, }# k) f: ]1 g (setq vpf ".")
( H0 b5 ]4 l1 o( h )7 [6 U% G, [) g8 z. _" z% _
(setq ltabstr (strcat layname "\t"
- S. T2 c5 y3 S$ [7 M onoff "\t"
: E: D" J3 C6 m; u frozth "\t"
6 l- Z. A% {" m' h# i4 B lock "\t"+ I/ G! P2 J/ t1 p( U M4 p8 j
vpf "\t"( [3 l/ }0 x% q) M a* |6 Y7 R$ k# f
vpn "\t"
, y7 ^+ y- B6 d6 y- G; O3 e, ` colname "\t"0 r4 T# ]& | ^
linetype4 U8 ^% O7 H5 t4 \7 H0 U
)
% {; b+ f& K% p1 G )1 j* R9 Y6 S! _' \% V1 e& l
(setq longlist (append longlist (list ltabstr)))" M# ^& u- z$ y
(setq sortlist (cdr sortlist))! J7 V# g; h5 P, P
(setq layname (car sortlist))
' a9 K# g) Z* N/ m# e: j )
5 ]) b7 p4 U/ L" c0 b5 V ): q8 [) k, V/ k: p
;;
/ H% [8 l7 M3 V6 H! k, C4 q ;; This function makes 2 lists - ltnmlst & mdashlist. Ltnmlst is a list of
2 m! P$ E' x { ;; linetype names read from the symbol table. Mdashlist is list consisting
0 ]# \0 I: n4 M$ P8 Z$ i8 Q& L: L ;; of lists which define the linetype pattern - numbers that indicate dots,
" d2 z" q+ b& M2 X6 z- T+ {: d ;; dashes, and spaces taken from group code 49. The list corresponds to the 0 R3 U' r' R. p5 s3 \
;; order of names in ltnmlst.
+ l9 Q& _! O0 C, ^& Q# x ;;* X8 B0 ^" d: q/ m
(defun makeltlists (/ ltlist ltname)
7 E& k! p% x" r4 n" I; P (setq mdashlist nil)
* N7 C7 y( s- W) Q; t5 X$ w/ R# N; R (setq ltlist (tblnext "LTYPE" T))
9 [" w. h4 a3 y; ~- H- u+ B) B: m; _( a' E (setq ltname (cdr (assoc 2 ltlist)))% G7 d! ~% V0 ^, O/ c; j
(setq ltnmlst (list ltname))0 r0 y, g, Y7 |
2 H/ \' X* A1 |9 {3 R; Y. |
(if (= ltname "CONTINUOUS")
* ~) P' o* O3 R% l8 n+ g' l (setq mdashlist (list "CONT")) v7 `3 J6 O* Q/ v, a
(setq mdashlist " I- K$ P+ A: _3 t- w" z
(append mdashlist (list (add-mdash ltlist))), C u+ D t7 d
)7 ^7 r f" k# g. J8 C
)
* n9 V( p5 W1 R9 J (while (setq ltlist (tblnext "LTYPE"))
: A% O+ ~: i; a! m9 C1 M8 o6 p (setq ltname (cdr (assoc 2 ltlist)))6 }' v8 o) O9 v& u0 v1 ]
(setq ltnmlst (append ltnmlst (list ltname)))
. V* D4 T9 i" t$ m3 J1 r1 | (setq mdashlist
' C- N; T/ w# d9 q$ | (append mdashlist (list (add-mdash ltlist)))
* S2 z3 M* v+ m$ X9 q" r3 M* j) Y )
5 Q7 p5 V1 ]- `: g& l) |9 Z ) m+ W5 _: N M
(setq ltnmlst (cons "BYBLOCK" ltnmlst))
* H/ n2 e0 N$ h' I/ a3 y. X (setq mdashlist (cons nil mdashlist))
, }% z+ W( ]) Y4 k9 @( u' H- W9 T/ Z (setq ltnmlst (cons "BYLAYER" ltnmlst))
: x. I' Y! R& h$ M0 l (setq mdashlist (cons nil mdashlist))0 P- w/ \# x2 W1 s3 w
)
* {) s, K( G6 O* n1 C5 q ;;( u' b" j Y& K7 N
;; Get all the group code 49 values for a linetype and put them in a list
+ W- [* M5 N% z0 r ;; (pen-up, pen-down info)
) i$ [" X v4 m1 S5 _ C0 W' O ;;
% Q/ d! f& g$ ~. W (defun add-mdash (ltlist1 / dashlist assoclist dashsize)5 e2 R2 G* ?3 m
(setq dashlist nil)
& ?, t1 |: Y" p$ T1 k (while (setq assoclist (car ltlist1))
: q8 |* W+ n6 _# L6 C1 k (if (= (car assoclist) 49)
4 L! ?) m! l8 l9 S& ~0 z+ z7 h (progn1 |. |/ \ w7 ]+ b5 i9 ]
(setq dashsize (cdr assoclist))0 a- J) T# ?; y5 E6 _: k
(setq dashlist (cons dashsize dashlist))
! j# i/ m y$ O4 I( W8 D) z )3 t2 v- Z! U# ]3 o7 L* t6 C
)
$ r: P: w3 g+ z# @8 M (setq ltlist1 (cdr ltlist1))) K8 j; ~3 L7 E# X# Y: }
)2 N7 m% d. d. n: z
(setq dashlist (reverse dashlist))
& O1 ]( q: j# h( N; L )+ ^ P, g) Q# y9 P; F
;;/ Q' N, U- {7 X
;; Color a tile, draw linetype, and draw a border around it
5 j2 `9 P8 S1 R* \# O7 o ;;
3 r* ?% \- e% u# S (defun col_tile (tile color patlist / x y). I: G* |2 F: n; z7 r* C
(setq x (dimx_tile tile)), ?6 q* E' K5 {; A1 |+ W( P
(setq y (dimy_tile tile))/ p4 T% ?, L6 Z9 ? Q* R
(start_image tile)* q& G+ q; X. P; a' E+ }2 u. u
(fill_image 0 0 x y color)0 | l3 n, |3 O7 w) J4 Y
(if (= color 7)
$ O l/ k/ b4 z1 M- Y+ i( ~4 ?! a! v (progn) B. R+ r) y& h5 v" F% E+ j, n
(if patlist (drawpattern x (/ y 2) patlist 0))
% l; m$ [1 i: z% d (tile_rect 0 0 x y 0)
0 t8 \" k$ V1 i. g( p3 P5 V9 L )
3 m% w3 d2 m6 ^+ Q* e" X (progn
+ Q9 L& y+ x+ B8 f8 `: q (if patlist (drawpattern x (/ y 2) patlist 7))- {1 }6 I# m0 s$ {8 |* X7 q
(tile_rect 0 0 x y 7)
5 |/ d7 {# @2 Z6 J# l )
b! X9 g' t, C1 B+ m )# N# j3 E' J) t+ d
(end_image)
0 n+ E D4 B; f6 u1 Y- o )
& C5 Z0 ]2 i. n$ P8 ` ;;
! G, \1 ?+ n3 U' Q2 Q ;; Draw a border around a tile
; |1 w# U+ f) S ;;# H( |" {* J7 A
(defun tile_rect (x1 y1 x2 y2 color)
" @/ i. ]) z0 V. H h9 p& m (setq x2 (- x2 1))
) |. J/ @$ H% \ (setq y2 (- y2 1))
9 i6 P N2 b6 U& l) n, V L% v (vector_image x1 y1 x2 y1 color)
; z2 n! P" l6 P: {' U6 ~8 y (vector_image x2 y1 x2 y2 color)0 L- o# v' H9 |- f K$ D* U
(vector_image x2 y2 x1 y2 color)& N: u0 `3 ^$ Y, j2 C
(vector_image x1 y2 x1 y1 color)
* W7 j/ N g) {2 P ). `! K+ q2 U2 I- c: E# s& A' m
;;% @# j8 S3 a, I: b/ u: c
;; Draw the linetype pattern in a tile. Boxlength is the length of the image
, T# o' t1 w+ j- k* v( J; b, m ;; tile, y2 is the midpoint of the height of the image tile, pattern is a
2 a0 H0 _& `' s ;; list of numbers that define the linetype, and color is the color of the 0 _0 g" n/ v' x5 B# X
;; tile.
7 w# E7 [4 m. @6 Z; Q% { ;;
( l4 Z6 z' i0 \2 f/ a# B (defun drawpattern (boxlength y2 pattern color / x1 x29 j' q4 w, q+ R* [- K
patlist dash)! n, C+ t( q b7 U3 U
(setq x1 0 x2 0)/ y+ j) A* L- o9 P4 @" O& L
(setq patlist pattern)- m( C& _0 @( j7 p
(if (= patlist "CONT"). e6 z; z# M- X: a
(progn
* P" x8 {0 Q5 J6 ?1 ]* @9 R (setq dash boxlength)
3 U( z) D! w1 n9 r" S (vi)
6 N: Q. A U; z$ k% E* v: ]6 W (setq x1 boxlength)( E" B6 V# o3 k5 Y% e; c' w
)- ]/ H' W' K: A$ X* W
)9 u) z; X6 d" S0 J* l% _
(while (< x1 boxlength)
8 p( q/ Q% i1 @$ f c (if (setq dash (car patlist))
0 g4 g# e5 v+ M5 P o$ K (progn f3 u1 y( @6 k1 Y' p
(setq dash (fix (* 30 dash)))
2 q" P. L% X& A (cond
5 w, Y3 p) P- }1 j: k' d. b ((= dash 0)
- ~) x' h' W/ e/ U0 j) u1 Y (setq dash 1) ! L% S; H/ }& M
(vi)
/ I, ], ?% _/ k" v- c: O )" Z6 u% G/ c& B/ f+ `
((> dash 0)
( U8 k1 o( W% a4 X# N$ r1 E/ U5 F (vi)
! P- }+ y4 ~# X- K: R )
' l c( A! D/ f9 d% `( o7 \ (T $ g4 W: t+ Q$ q2 E" @
(if (< (abs dash) 2) (setq dash 2))
8 c0 m& a$ k: W+ {: h; Y$ s (setq x2 (+ x2 (abs dash)))! V2 o* I& E; }& U/ R( C/ v* n
)
7 D& F0 A2 j" X5 u8 u, h2 S- P! N )4 I" Z5 L8 v$ ~( ~9 I( Y7 c
(setq patlist (cdr patlist))- l$ E7 X7 [$ S3 E7 V6 s- a
(setq x1 x2)
! _& q0 F& i& t )
2 L8 E/ F0 O6 |" }( ?- x9 [ (setq patlist pattern)
0 S% P0 D& W5 j- C: n/ `( G )9 x1 ]2 b! L6 U, T- h- @ X B" l) Z
)- @+ S! g. W2 D
)- b: U5 }, Q! w! B. O
;;
+ x' c7 Y; z+ k9 m0 e: h/ W" ` ;; Draw a dash or dot in image tile
8 z) P& I$ }/ D X! z2 ^) ^ ;;* ~- o8 ?. s) f
(defun vi ()+ ?' o" W8 h; M
(setq x2 (+ x2 dash))
- F+ Q' b' ?7 ], A# Q& g (vector_image x1 y2 x2 y2 color)
! U9 n% l6 J( J. v: x' @ )
6 b3 R" }' h' ]; n$ W ;;
0 E* y) ^- N# H. C# _$ Y ;; This function takes a selection and returns a list of the color, linetype,
+ V6 c+ a5 e: Z; E# e: U) S: \ ;; layer, and thickness properties that are common to every entities in the& R7 ^, v2 x* b
;; selection set - (color linetype layer thickness). If all entities do not
. l( w) U( d% w) A: A. @$ c7 l ;; share the same property value it returns "Varies" in place of the ; H7 Q1 k. ]6 s
;; property value. i.e. ("BYLAYER" "DASHED" "Varies" 0)
; v# ]8 E6 l# R- Y: ]1 D ;;
* P7 F b) \; X; A( {; T, N! n (defun getprops (selset / sslen elist color ltype layer
, q, c9 m- K9 D- U) z thickness go chk-col chk-lt chk-lay chk-th ctr); X/ r+ H% b6 u3 d4 A
(setq sslen (sslength selset))6 w' {, \4 c" ^9 y! M& L7 o
(setq elist (entget (ssname selset 0))). w2 c0 C4 h: v3 [
(setq color (cdr (assoc 62 elist)))3 Y# u: g( \/ [# t/ p% {/ n3 M
(if (not color) (setq color 256))
5 t4 L( S* s1 { y5 k (setq ltype (cdr (assoc 6 elist)))$ o, m" v8 l# L$ w6 n
(if (not ltype) (setq ltype "BYLAYER"))( m9 D' n; Z. e' E* `' |3 k! T
(setq layer (cdr (assoc 8 elist)))9 E1 E: o: P2 Y! @) t
(setq thickness (cdr (assoc 39 elist)))
0 L* n7 h- i# [" d) o (if (not thickness) (setq thickness 0))
7 B1 g9 F: N7 m W (setq go T chk-col T chk-lt T chk-lay T chk-th T ctr 1)- c' d% w+ T; A2 k. @
) W0 s2 t, W# U1 M1 f
;; Page through the selection set. When a property
# `1 L" k. P; y O. {3 u5 I ;; does not match, stop checking for that property.
% v# _5 g7 B' u ;; If all properties vary, stop paging.( W3 u6 @3 j G. a' n2 E
& m' x9 C/ R% m( `3 z (while (and (> sslen ctr) go)
) I b$ N1 J, P' K0 X) q! H (setq elist (entget (setq en (ssname selset ctr))))
* |4 Z3 I) A i- R (if chk-col (match-col))
1 l8 R/ V1 X; c1 }3 E (if chk-lt (match-lt))
: q# g# Q/ ~. \% v& b8 e) d (if chk-lay (match-lay)). M/ U: _! ?- J) j% x/ T
(if chk-th (match-th)). a# O% a1 c1 K5 d1 S q
(setq ctr (1+ ctr)), q% m$ h4 W/ |
(if (and (not chk-col) (not chk-lt) (not chk-lay) (not chk-th)) j% T( w4 ~5 k( z# M9 b# ~
(setq go nil)
p; P/ J) o2 D )1 n1 y' `6 i/ V" F7 M
)
2 v% y" h0 |. ^; k& \ (list color ltype layer thickness). ~9 y/ g/ d- S' f& e$ q7 i, }, R
)& k9 e3 `# o+ g3 v g; d# j
5 V; T" }) W5 [& {: x
(defun match-col (/ ncolor)
" o1 X, k6 Y# Y) {$ l5 h (setq ncolor (cdr (assoc 62 elist)))- d8 H& [7 X& K+ {) j. f% J* {
(if (not ncolor) (setq ncolor 256))- {5 y- l6 M% ^3 R* E& Y
(if (/= color ncolor)
N' s- j* q% U" y/ I (progn
1 Q8 ~' B3 ^7 { R (setq chk-col nil). }. ^8 R$ U- i6 I1 [# I* p" w
(setq color nil)+ w, X* p1 G7 @0 b: h9 m& y0 @
)
* W3 q; o" n. J )8 t b8 B, L' A
)
5 h: m! f) @( L
4 t$ h# i6 |/ R9 B3 | (defun match-lt (/ nltype)4 g+ Y ^3 {4 v
(setq nltype (cdr (assoc 6 elist)))1 |& z) w4 X$ s" N6 ]; K) f. }% ?0 n
(if (not nltype) (setq nltype "BYLAYER"))* {+ {; R" S/ k* }
(if (/= ltype nltype)+ _, X& O9 N7 d( a* ]3 @# d
(progn' V* H9 c d' Y9 u
(setq chk-lt nil)
! H0 a) E7 L6 s: V8 A4 z (setq ltype "Varies")$ H8 a5 o( x% m7 r" h; e4 i
)
- a! Y$ `0 E& F( ?9 o# a )4 V8 e: @+ x. s5 U5 x9 i
)3 c' k% O1 ~4 c2 g j" ^0 _
' h8 ~# U/ s9 v/ m3 b# g7 _. E5 b. t
(defun match-lay (/ nlayer)1 e* V, o8 E. c0 @1 @9 l+ S
(setq nlayer (cdr (assoc 8 elist)))- ^4 g! Z; o: j, a* z
(if (/= layer nlayer). X, P. p+ t. H
(progn
! h; g) n W2 g0 a% H( k1 Q8 P (setq chk-lay nil)" b7 F4 U/ H3 K- w( g
(setq layer "Varies"). Q: l3 Q. L5 U6 r5 L9 ~
)
8 S' V* u5 B3 o9 H: y ); Y4 l* w7 T0 i/ i
). s3 ^' C1 {1 I* I, i U
. s8 J1 i2 P: g
(defun match-th (/ nthickness)
* g. K% \3 {, S4 `; {9 ^6 Z' M (setq nthickness (cdr (assoc 39 elist)))- Y2 D9 P: E B# M6 }: _* B9 S
(if (not nthickness) (setq nthickness 0))
" l4 I' g2 [$ p$ j- ]' D2 P (if (/= thickness nthickness)
! C% G! W5 u: C3 d: N6 u/ | (progn
$ s) C( I; e, U5 G7 V% a (setq chk-th nil)
; l Q3 Z! K! ^1 p+ P (setq thickness "Varies")! ]: s" H/ S1 E1 X# K
)
" N) w8 _8 {: g- Q7 S/ L x )% r2 ~6 z4 @9 A+ U
)
! c8 o& E+ Z* L9 n+ j! f5 t9 g4 Q6 d- n/ N/ k9 w; P: V1 e' e
;;
0 P4 B% e7 K6 S3 a+ \/ U3 m. s ;; If an item is a member of the list, then return its index number, else
$ |0 G0 X$ ] W+ f+ b ;; return nil.- Y/ v8 Q) z3 b6 \. D1 y9 p
;;$ I# |( L6 y: L" v0 e
(defun getindex (item itemlist / m n)
5 A5 I, R$ V! e* w1 S8 G1 i (setq n (length itemlist)) D; B% U/ I" y6 `! U& D
(if (> (setq m (length (member item itemlist))) 0)
6 W6 c5 L: u7 M7 a (- n m)5 I5 B; y% `7 g t1 H
nil6 Z* [" |+ O0 P w! m' Z& [
)6 l- w/ f/ K" g
)- @3 _% `+ X2 R8 D5 r
;;" Z6 H" P5 [* }' H! r5 ]( G9 U
;; This function is called if the linetype is set "BYLAYER". It finds the ; ?" `& S9 _7 E# E' |/ \
;; ltype of the layer so it can be displayed beside the linetype button.- p; J" K, V+ a. g. U8 P( G4 w- x% t
;; [/ x% m q3 I: W
(defun bylayer_lt (/ layname layinfo ltype)6 t& P9 L: l1 j, f, L& b
(if lay-idx
( A, U6 C8 R: y6 [3 ^ (progn
$ ] g% F( I; { (setq layname (nth lay-idx laynmlst))0 F9 z: C7 x' d+ C" \
(setq layinfo (tblsearch "layer" layname)) h! M5 X: x" o7 w7 _5 a3 n0 P
(setq ltype (cdr (assoc 6 layinfo)))
: d9 x8 l5 D9 R5 J5 } (strcat "BYLAYER (" ltype ")")) R$ H$ |( b0 h
)
3 [' y6 g7 G! ^2 q+ G4 P: c "BYLAYER"
+ I% n* ^0 s" F7 }+ J0 Z )+ Q# j3 \7 S3 r: }
)
& Z7 L" {7 z$ x9 D ;;
6 \% [* u' w$ J& z" h ;; This function is called if the color is set "BYLAYER". It finds the 8 x! ?+ D% u7 T& n/ Y
;; color of the layer so it can be displayed beside the color button./ G+ r3 u& i# h. {" s) w7 c
;;3 @1 ^4 B- D$ r# L% B! w1 G
(defun bylayer_col (/ layname layinfo color)
, b: h0 U L# R( S- { (if lay-idx9 ]/ m, S* {5 V+ z3 m+ l5 `$ W
(progn! H$ ]% |, a7 E( J8 B
(setq layname (nth lay-idx laynmlst)): m8 S0 o& ~" }8 `# Z" ]7 [9 Q
(setq layinfo (tblsearch "layer" layname)). z |/ ^) w# C% q* @) Y$ Y" D" R
(setq color (abs (cdr (assoc 62 layinfo))))
) T- K; f- z( ]. W# m (setq cn color)0 n h/ H4 L5 X& ]1 `! ?$ i
(strcat "BYLAYER (" (colorname color) ")")
: }# K6 m! Y r2 i; i% j& e- W- W ), S" r8 z( M+ F: I+ ~
(progn9 |" _* d, I- V. y8 x
(setq cn 0)9 O& T( H9 P) R; q5 B; V+ N8 l% ~
"BYLAYER"
) R* r8 G2 K! `4 G )8 S3 G9 |. a" `) g* Y2 j
)$ E8 ]" T$ z2 u6 u' K- j
): @7 Z* J, B8 j) k! m" m* }
;;7 ]: }/ m! }) \/ I4 |% { A8 w
;; If there is no error message, then close the dialogue! K6 D7 ?) x% \. J9 T* F
;;3 @% O" }8 M- ] Z: G
;; If there is an error message, then set focus to the tile) a, S' g% H4 F' r6 L* V' }! s
;; that's associated with the error message.2 Z9 D1 j! `8 c Q
;;
* s0 w1 }0 J1 K( m! c4 N% M (defun test-ok ( / errtile)2 @5 Q( T+ X8 H$ a# F% ~4 {
(setq errtile (get_tile "error"))
4 k$ \* e0 O4 v1 L4 | (cond( h/ l% Q! V6 s: F) ~; R/ K
( (= errtile "")
- S7 g/ c: @% ] ^6 a9 t0 @) V4 S (done_dialog 1))
( h% P- b. U$ | ( (= errtile "Invalid thickness.")
8 n I: S6 F. b9 U; w (mode_tile "eb_thickness" 2))/ c5 s4 s& q- g/ i, U9 |, I8 Z ]
)/ V/ o5 r, p1 O, n
)
0 }3 v/ U" f% w ;;
5 u/ x( i4 G- n ;; A color function used by getlayer./ N; P! z. [$ T( p! L* N3 V
;;* P" i! [6 d/ s! C) P# |" _+ _
(defun colorname (colnum)
& ~* }' A% k1 I8 a) C (setq cn (abs colnum))9 _6 J, w# q# w% l
(cond ((= cn 1) "red")4 M& |/ V5 L$ ~
((= cn 2) "yellow"); x' H: s9 W' R/ ^' d+ B6 Q1 t
((= cn 3) "green")1 H9 k" J4 }$ Z8 C" H& p X5 W* h$ ?
((= cn 4) "cyan")
4 R+ {7 ]4 f; t" z l6 _" [ ((= cn 5) "blue")
8 K% Y, f4 t& e* `2 q5 S ((= cn 6) "magenta")1 ]$ ~3 z H% W! N
((= cn 7) "white")
- a8 J. b/ ]& j1 J# N7 W (T (itoa cn))' \% c4 `8 s6 R7 ]! f. M$ O: p s
)) `* I* p" @8 t& u% a0 ^6 V6 G) C
)
. C" y7 X1 E4 q' p6 h0 a: s( `7 ~6 V0 ^ t$ @( v" ~5 P
;;; Construct layer and ltype lists and initialize all
$ R6 O; J$ h- n;;; program variables:/ B V$ f" O# |# W5 o
$ {( S$ J0 `- H& C* z (makelaylists) ; layer list - laynmlst" z" W3 Y2 j* N' D
(makeltlists) ; linetype lists - ltnmlst, mdashlist
3 y: {0 J5 S6 ^ ;; Find the property values of the selection set.
* V2 w) J, u' q1 m ;; (getprops ss) returns a list of properties from
& Z8 f" w: j8 o. I ;; a selection set - (color ltype layer thickness).
& g5 W) n& h8 A- i3 g, F (setq proplist (getprops ss))
0 X/ l" y3 W* _6 f) m' r# r# }' b& a (setq ecolor (car proplist))
8 B8 I- D6 z' I (setq eltype (cadr proplist))
1 q) X$ d1 r0 v, x$ P$ Y$ r- I (setq elayer (caddr proplist))* V( {) H3 M5 v/ B A% ]& Q+ w
(setq ethickness (cadddr proplist))
2 A# X8 N% _9 F5 v+ f) s ;; Find index of linetype, and layer lists; u C; i {$ m
(cond
* Q6 G) w. i3 v% U* s6 x4 F/ B; C2 E ((= eltype "Varies") (setq lt-idx nil))
. R# t1 P- f& P: x+ M, O; ((= eltype "BYLAYER") (setq lt-idx (getindex "BYLAYER" ltnmlst)))/ X5 }# C7 o) W+ q! Y2 q2 p! t) }
; ((= eltype "BYBLOCK") (setq lt-idx (getindex "BYBLOCK" ltnmlst)))
% U- ~: Z/ N; C9 Z9 }: K1 l (T (setq lt-idx (getindex eltype ltnmlst))). B" i0 h9 [2 e D' E
)
1 y% O7 z) O8 z5 z (if (= elayer "Varies")( y, N! T! g, U3 G8 N- t$ ?( g
(setq lay-idx nil)
+ R6 t+ z0 k- @! S4 k* `4 e (setq lay-idx (getindex elayer laynmlst))
) L3 q+ l3 t( {0 x l )
2 j& v9 ?3 J/ u# c (if (= ethickness "Varies")
$ ?4 g0 {+ p5 E d" q! |6 o$ p (setq ethickness nil)4 d: z& o* ~$ ~1 f
)
4 R2 p1 E% m! d; V$ h0 S; d3 o0 w/ R- B# [
) ; end (ddchprop_init)
2 }' E1 D/ Q9 f) e8 {2 E( x. h# H5 _8 C! L9 t; j+ [: H# R# b% w
;;; (ddchprop_select). W4 W. y, V q. z* V
;;;. [ { x+ e* h& t+ I7 m
;;; Aquires selection set for DDCHPROP, in one of three ways:% V$ g/ ^2 P4 }8 Y
;;;
) |- d, G. k- q8 _0 I% {) J, y;;; 1 - Autoselected.2 b2 L3 S: ^' Y6 b, r1 u3 E4 Z' V
;;; 2 - Prompted for.
! ]0 }7 f& z2 S* _+ D8 G;;; 3 - Passed as an argument in a call to (ddchprop <ss> )
. ~$ l6 H2 y" N;;;, ~/ Q8 l9 t. g5 l
;;; The (ddchprop_select) function also sets the value of the
6 B+ H, Q0 J, e. C;;; global symbol AI_SELTYPE to one of the above three values to
2 V- o+ |" | K( I;;; indicate the method thru which the entity was aquired.
3 G; Z+ h; \! V3 d8 n2 u- f- r9 o Y! H# N, P7 S; g
5 n6 G* Q- d9 y; F(defun ddchprop_select ()4 g- \3 n- C; c/ c
(cond
' u6 J/ A f- B& m0 {: M% X ( (and ss (eq (type ss) 'pickset)) ; selection set passed to
! b' B0 p8 W- y4 l ^0 _" C2 [ (cond ; (ddchprop) as argument
7 l6 f( g. s/ v% o& B* ^2 l ( (not (zerop (sslength ss))) ; If not empty, then- ~; _, o' w/ _. v! E$ E. r n- H8 Z- ^! H
(setq ai_seltype 3) ; then return pickset.1 { d: c- [" Z0 O& X h
(ai_return ss))))
) b/ u& j" f; [9 ~ X, q$ e& b- c: a8 V5 }
( (ai_aselect)) ; Use current selection
! R0 v& K% C2 q, ^ ; set or prompt for objects
) J9 N7 D9 E) R" @" {5 A
3 U; }2 F6 j, i2 v- T3 s (t (princ "\nNothing selected.")
- X# E- x9 G: f n4 ^ (ai_return nil))1 I Q0 l# U& {! t
): J7 ]1 _+ M, o6 J4 T& l! z
)
% I9 @- [% ]8 o- T
8 s& {& Q/ y. z0 ^6 _. V;;; Define command function.
$ e1 Q7 m# g! ]6 G) q4 ]5 s7 L4 Q- E3 {2 m% L b, H1 |
(defun C:CH ()" u! t" u. J; ?) d/ v- d
(ddchprop nil)
: W! ~6 }. O% m8 `* i# [. k# @2 e (princ)
* a6 \' Z* i) ^/ B5 y* Q)
2 z K4 k7 M2 s& M9 h3 Z
. T8 F5 }! \% O0 D. w( P# }1 k
! j" t9 B$ U7 H0 }. E$ W;;; Main program function - callable as a subroutine.; l1 @0 u1 q ^0 X) c
;;;, x# l/ r( v% {, B' k0 N& K
;;; (ddchprop <pickset> )7 B2 b. W' |" Z, G
;;;
( b$ l \1 F6 `; Q( x- R;;; <pickset> is the selection set of objects to be changed.
: s$ k; h& {0 r: Q6 I;;;) f+ ^* C% p# I; M& N: O
;;; If <pickset> is nil, then the current selection set is+ r, j7 ^' ~6 z: U5 ?
;;; aquired, if one exists. Otherwise, the user is prompted' e! t! o+ K5 k* Y8 B" J- p
;;; to select the objects to be changed.
/ X- e" f8 U" z& x' J;;;* H2 c- [& k* w. ~
;;; Before (ddchprop) can be called as a subroutine, it must/ B9 U: G; ^' V2 p( H! ]7 U& [
;;; be loaded first. It is up to the calling application to
}6 s- M2 N$ i- @( k% u;;; first determine this, and load it if necessary.' u9 T6 m$ B: h1 `4 V5 x
9 D6 M4 `8 ]3 I9 Q; N1 Z6 I
(defun ddchprop (ss /
- q1 h$ N4 X- T! u6 R
. R. V1 H* V. T& B1 m' @ add-mdash ecolor ltedit_act s8 j) C9 i& G5 h3 r
assoclist elayer ltidx selset' j# P5 @( J9 q0 A$ r* T, E8 Y
bit-70 elist ltlist set_col_tile4 E: T, \* G7 e
boxlength eltype ltlist1
, w+ Z# U$ E5 w7 ~# C) p bylayer-lt en ltlist_act sortlist
7 r, n e. M. T, m6 E( r7 { bylayer_col ethickness ltname
8 `/ ]- p! C. x( {; ?2 S' x/ O* e bylayer_lt fchk ltnmlst sslen
- _9 k7 n( k% w8 { call_chp frozth ltvalue templist1 l" k, k% i* W- O+ ?& K3 z E
chk-col getcolor ltype temp_color
( s; u* g9 z. S/ L8 H* |% k$ n; M chk-lay getindex m test-ok4 N B" }% u3 C7 V3 H$ @. m) G' p
chk-lt getlayer makelaylists testidx
% Z, h& s. {, o$ } chk-th getltype makeltlists testlay
# s0 J5 t2 F) {# O, G A cmd getprops match-col th-value
2 R9 B b% q o: n cmdecho getthickness match-in thickness
$ ~3 X S$ \# d+ O/ T. e3 l cn globals match-lay tile5 E8 V" T$ z# W6 V" ^8 @
cnum go match-lt tilemode @2 e# |, H& I- ^
col-idx index match-th tile_rect, {8 j+ _: b6 K% h
colname item match_col vi
5 f: i0 B$ `: `, B colnum item1 mdashlist vpf
' S2 n8 f$ }( \. D6 q5 M8 s color item2 n vpldata" i5 n' W- y% v; \
colorname itemlist name vpn
. F, P4 k9 b7 f$ Y9 s% A# G col_def lay-idx ncolor x: v5 u2 a. n4 h! d5 A9 \6 o2 B" X
col_tile layedit_act nlayer x10 S0 R1 [9 r1 k. @
ctr layer nltype x29 S9 P7 l; U6 q* N
cvpname layinfo nthickness xdlist: p6 y- Y$ d9 d% E% x
dash laylist off y+ w- Y8 `1 y i/ w: h8 f. Q+ M5 m8 G
dashdata laylist_act old-idx y14 f) ^' t2 V6 c. Y& k% H% F
dashlist layname olderr y2
9 X! q/ H+ u' e$ E1 a& v! t0 C( `) e# p dashsize laynmlst on undo_init
N y- `0 [- N* [4 n- G6 ^. y% R dcl_id layvalue onoff& z) l$ T$ P/ F8 ]" n
linetype patlist
! v3 s$ C+ L2 s7 ^ ddchprop-err list1 pattern* M* [& A6 V' v3 Y7 E& j
longlist proplist
4 I7 n9 w5 z4 L3 L8 W8 _ lt-idx reset-lay
% ], X3 ?# H' h drawpattern ltabstr reset-lt
* R2 Q/ K3 u1 {3 m2 ~6 v$ Z9 F1 Q )0 p) Z& ]& R! a. o
0 a; w$ {9 s S (setq old_cmd (getvar "cmdecho") ; save current setting of cmdecho9 y1 r) H! h) t, e* L% R
old_error *error* ; save current error function
4 K9 T2 j& @0 K |3 O" P *error* ai_error ; new error function9 D' K4 S0 |5 b, S# m
)* `4 K- S$ ^8 F+ k2 n5 F
$ a1 o9 {- z! ]5 U. P2 |" o
(setvar "cmdecho" 0)- P! p0 Q8 `" m( r' v
9 c# ^" M X8 i, c; N: k
(cond+ X& y' H: j: [% Z2 V2 Z
( (not (ai_notrans))) ; Not transparent?
6 e) P- { g) y( n- i ( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
& s3 y) W4 Y4 S2 ? m ( (not (setq dcl_id (ai_dcl "ddchprop")))) ; is .DCL file loaded?- I( r! A# j; k/ R7 @0 e0 X
( (not (setq ss (ddchprop_select)))) ; objects to modify?" a8 x2 `6 a) s% h5 C
9 l$ {$ m7 v7 m' s, A+ {
(t (ai_undo_push)
+ T# L& }7 j J g: @8 Y/ @0 c (ddchprop_init) ; Everything's cool,
) \! x; R3 f. i2 | (call_chp) ; so proceed!
7 Y6 q, o" E" l' L (ai_undo_pop)$ C% d; Y8 Z; B! W9 @4 S
)
! N( {3 Z* S" o# Q )
- K$ Z; u" j9 M4 J0 L% i. @- V4 D( ~$ ?$ {4 R; d0 E8 C6 L2 Q
(setq *error* old_error)
+ m& U& E# P+ x6 p5 \( M (setvar "cmdecho" old_cmd)# v7 U# P) f' O* c
(princ)
* A9 G7 q3 C- G6 c6 U8 B2 ])
6 w9 L* w d- Y5 c! B7 l+ k1 P. s
;;;----------------------------------------------------------------------------0 r1 C4 p6 B( O# B$ W4 {4 S
% s: D! l0 E2 q& x( ]$ [9 H(princ " DDCHPROP loaded.")8 N+ Z5 [$ t" ?( ~ b$ N g7 M
(princ)
1 T$ C8 o8 g6 F/ J* U1 k
/ N" [3 _: b. n' U$ v* X/ _;;;----------------------------------------------------------------------------. [7 M; ?. E5 G2 P4 W+ r
; f, x5 D3 }8 [, p& T$ `) H;--------------------------------ddmodify.lsp----------------------------------
% f3 z; y8 j) w% {; Next available MSG number is 111
! ?9 m( Q' X+ a. j; MODULE_ID DDMODIFY_LSP_
0 v5 o6 Y$ x# }% p4 ^;;;----------------------------------------------------------------------------
2 _) [8 C5 A$ o3 g. X0 g: d;;; DDMODIFY.LSP
. x; \ z( R/ q4 d, C;;;
* g8 I" C8 v% X1 Y5 E) ^;;; Copyright 1997 by Autodesk, Inc.
4 B ^( _+ y% I8 {: J: T. X;;;- R5 A; _+ x: i
;;; Permission to use, copy, modify, and distribute this software
1 ?0 @# o" p* E" H" u+ v;;; for any purpose and without fee is hereby granted, provided
, s: F. ~* L" ~;;; that the above copyright notice appears in all copies and
) ]# j& S2 W" d( ?! b2 |;;; that both that copyright notice and the limited warranty and$ b3 d# j3 M) V5 ?1 k+ F4 J7 g
;;; restricted rights notice below appear in all supporting, j2 A" Y4 ^' [5 d/ V
;;; documentation.9 g# Y# c/ w a
;;;
+ S1 a6 r1 x1 b" N- U8 [7 Y6 R ?;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
1 C) |$ {& T2 P& s4 r# y;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF0 h$ O7 M) ]$ C3 U' @4 n; x
;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
0 c2 o# E' N- c' W;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
+ I, g2 @% D' V( K3 l/ x4 ~;;; UNINTERRUPTED OR ERROR FREE.' C# W0 q3 R- I8 Z8 j* r
;;;+ ^; T F/ H+ \/ D; R0 S4 @
;;; Use, duplication, or disclosure by the U.S. Government is subject to
2 [) M U; z* `1 Z7 g;;; restrictions set forth in FAR 52.227-19 (Commercial Computer
) d" B& b4 c. e2 g I6 ]3 U;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)2 @" w0 |- F% _) {. k
;;; (Rights in Technical Data and Computer Software), as applicable.4 u F6 |" z. e% `/ H% b
;;;+ j, \- g, [. h, z3 m* G
;;;., K- s; T: N% U% d8 ]: a
;;;
" t Y" ^; y) i! E;;;----------------------------------------------------------------------------9 `- C2 P1 g& a7 s9 ?" f
;;; DESCRIPTION
$ L2 |+ ^6 d& x$ J% z;;;
# ~# t+ Z# E7 N% X& v. f4 \;;; This function allows the user to get a listing comparable to the LIST- f% f4 Y) n* T7 b3 R- A8 B
;;; command for most objects. In addition, most object fields in the" r1 ^# q! i/ L0 J4 }
;;; dialogue box are editable. Points can be specified dynamically by
: \+ h: c+ [+ B9 S6 h0 s6 O4 O! P;;; temporarily dismissing the dialogue box. Each object has a unique
% [' Y: v( i& B" {;;; dialogue.( N% u, q/ _+ s0 D- v8 P9 r9 b; Y
;;;% m# ?3 i# N4 |7 a" Z A
;;; Naming conventions
$ ?' }, f# e! K2 x/ R! N8 w;;; Long function and widget names may use an underscore "_"
# c# A: B+ M/ H% t5 X) B;;; in their names to make them easier to read, long variable
6 s+ F" y2 `2 F! O;;; names use a dash "-".2 F& b# E9 L. T/ ~% h* j5 r$ t/ N
;;;----------------------------------------------------------------------------( C6 P$ \/ y7 i. n: \
;;;----------------------------------------------------------------------------( C3 U, ?6 X. j" i
;;; Prefixes in command and keyword strings:
4 [! L( ~% W: G! s6 x2 }! {;;; "." specifies the built-in AutoCAD command in case it has been& L* M8 s' p+ Y
;;; redefined.
) Y# `, L; e. F F+ S( V;;; "_" denotes an AutoCAD command or keyword in the native language" C4 z2 f0 m( z/ U2 s# |1 D7 Q
;;; version, English.. t% \$ W$ Z @$ _
;;;----------------------------------------------------------------------------
2 I+ J7 e& h, V8 Z/ h;;;
8 N! c0 {2 r, E, C7 D: Q;;; Avoid (gc)s on load to improve load time.
# x) i X& V. i, f+ P4 K" W# j;;;2 k8 f1 C& B9 d- k/ z3 w; O7 b( m
(defun do_alloc (/ old_allod new_alloc)3 k( w+ o4 ]! w: H2 W8 t- z
(setq old_alloc (alloc 2000) new_alloc (alloc 2000))
. ?1 d. W: ?% P6 m2 l Z$ T7 f: U (expand (1+ (/ 17000 new_alloc)))
. B7 L6 W0 f$ N/ {$ V; ^ (alloc old_alloc). p, F' s6 Y' H
)
/ }5 m3 O2 P' c; v v5 O, j2 s(do_alloc)
8 H3 u1 y. Z/ R2 ?(setq do_alloc nil)
# N2 u6 k5 K8 t, V- X$ H' D; i1 W4 b! |) Q5 Z' m5 _3 D7 j
;;;, v" V- H" y" _3 \" p& V1 @
;;;/ X4 x% Y8 V7 x- G0 U
;;; ===========================================================================# n6 M2 L; H U1 T/ t! ~
;;; ===================== load-time error checking ============================* w* ~- O$ c- n% Y8 ?4 g$ X+ x
. g X# w7 @; ^3 f. a1 r (defun ai_abort (app msg)
* `5 q- L0 T4 b6 F5 z (defun *error* (s)
( u7 k4 O$ @# W4 c9 q6 w/ A (if old_error (setq *error* old_error))+ v$ E2 |4 n% [0 }; p
(princ)0 y) r, @6 U, k7 Y7 g% i
)
3 P- S0 x5 ]6 v5 y; r m# Y$ @: x (if msg
/ R$ J3 J& ], Q' f3 |6 s _5 T (alert (strcat " Application error: "7 N; V$ N4 a* R( Q" J
app2 `2 p3 y! o* H: j5 `
" \n\n "
5 `4 R5 A1 m" G3 {4 Y+ b" B msg! T2 V3 t* q1 y$ S O
" \n"$ i. ^% c7 H' B4 X4 I
)* u& H5 e5 {5 b( N
)
. C$ R+ c$ h' `, M ). v. h& c1 o4 E& H H
(exit)
6 j# |" m9 U0 d+ U6 J: @$ }+ W8 Z )
1 [& {/ _: i! S0 P( X/ K
4 H; k! `+ Q e+ n5 Z7 ^;;; Check to see if AI_UTILS is loaded, If not, try to find it,/ Y5 l7 a6 E6 ?
;;; and then try to load it. If it can't be found or can't be
9 W/ G0 ?8 n# };;; loaded, then abort the loading of this file immediately.
/ H! {' x6 a3 F0 a
) B: C3 @7 H2 y, m* `/ m0 v6 ]7 e (cond
4 f ?- D! u, Y+ D1 p" t ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.
* {$ j5 e' P: Y: c& p
. Q) G/ Y; i# @2 H ( (not (findfile "ai_utils.lsp")) ; find it
! R4 X5 q6 i N# b5 |* V; c2 C (ai_abort "DDMODIFY"
! ?9 m% v0 M) ]0 n% Q+ X (strcat "Can't locate file AI_UTILS.LSP."7 d1 W+ a1 I7 s! f
"\n Check support directory.")))( l9 \4 ~" E5 q: }' C
* ^, L% J7 i& l
( (eq "failed" (load "ai_utils" "failed")) ; load it1 l. q3 Z4 C; t5 ^
(ai_abort "DDMODIFY" "Can't load file AI_UTILS.LSP"))
0 A) v4 F1 x Q )
5 `5 A' M' Y9 j- C
1 |/ U: T, @; _8 r; Y) m;;; If we get this far, then AI_UTILS.LSP is loaded and it can( z# x4 X6 h9 p( O, _# t) |
;;; be assumed that all functions defined therein are available.
5 l6 Z" [" `* z, O6 G1 O- [( }4 ^, ]4 D; ?$ j/ Z9 F
;;; Next, check to see if ACADAPP.EXP has been xloaded, and abort
0 D7 m# N5 _! p& S m;;; if the file can't be found or xloaded. Note that AI_ACADAPP% e4 c E! U0 Z9 `( U3 v$ ]" ~9 x
;;; does not abort the running application itself (so that it can
0 ^7 B/ h$ k6 e4 b) g5 r;;; also be called from within the command without also stopping6 R# t1 ]6 T; P3 `. K" B
;;; an AutoCAD command currently in progress).# j& U, |: F4 E' W0 {
- E$ K) E5 S. C
(if (not (ai_acadapp)) ; defined in AI_UTILS.LSP
9 Z, ]' L( m3 q p) [5 f (ai_abort "DDMODIFY" nil) ; a Nil <msg> supresses9 T- F" e7 n, p9 N8 I5 O. ?. A
) ; ai_abort's alert box dialog., V9 W/ B3 J3 S$ T5 F' a
5 ~( t9 D3 g T2 a7 x4 q4 h* z;;; ==================== end load-time operations ===========================
5 {# L2 i }/ w& ^1 L* ]- H! c% _* H$ c6 ?! B$ L6 M! I& x
;;; global variables
1 x7 V v% U- ~; U0 w
9 z8 u! b C: {1 j' o+ w" g(setq hatch-elist nil)
! t( F% P, K& \3 b/ m6 X9 ^. M' u% z0 t" j q5 {
;;; If we get this far, both ai_utils.lsp and acadapp.exp are1 ]$ J H9 T* L6 ^+ C# Q) C1 m- g2 [
;;; assumed to be available.
, x5 n: Y; \) i0 K
8 ^7 c) L8 @) h% ?0 o0 L6 _$ l;;; Define and encapsulate all subroutines that are declared
* }7 q6 U3 R1 M- b* l: p;;; locals of the (ddmodify) function.
' P4 C+ I: [" e& Y9 W: r" d; c3 p5 x+ s! v2 T2 E0 e2 Z
(defun ddmodify_init ()+ j( I" q: X4 n `- l. @
;;
6 r. p# g# {* ?9 Y0 [! ` ;; These three functions modify the enitity list for common properties. Since
2 V6 V3 Z9 j$ B. C _ ;; color, ltype, and thickness are absent from the object list when they are \$ l2 R0 K9 s! f
;; set to their defaults (i.e. color = bylayer), a simple substitution using- E. R$ v) B0 f# U; K
;; SUBST is not possible.
7 T) e' O( W, J* K ;;$ ^2 A( \* g7 T
(defun modify_properties ()4 C& e5 \2 t$ q0 t2 b h5 l* U
(emod ecolor 62)
|3 {% ~1 K6 ~9 R (emod eltype 6)
1 B, ~" n' Q* l& q (emod ethickness 39)( }4 N) g- p5 f* \
(emod eltscale 48)
- U0 y( L- g o7 ?+ `# ` (tempmod elayer 8 nil)' D+ j! X8 L& i. ?2 _
)
# w7 ^9 k( D3 V, [) w+ [5 a ;;' k& B2 R t& e f+ m0 Z
;; This function is used for modifying common properties of the ACIS
+ J# ~8 V8 C5 h0 l. B5 D8 { ;; based geometry objects. Thickness is not valid for these objects7 T) |8 L* J; U! T9 w
;; so it is left out.. S- i. a3 z) d. P) }, n
;;
& ~, v& t4 n9 G( g' @' s! l (defun modify_prop_geom ()
8 G( O: o5 l) L: o& P (emod ecolor 62)# K3 _9 e O" n: p
(emod eltype 6)
# X9 `% U& Q( u/ o* Y; T (emod eltscale 48)* e2 y& d, E u# A1 ~0 t- Z! }+ w
(tempmod elayer 8 nil)/ s# u$ F# a5 l5 s( U* v5 K
)' k F) M3 e' i. e+ F2 f
1 k( K5 ]$ ~- p: L9 H+ `0 ~' W
(defun emod (value bit)( k& f/ f6 K- f2 J
(if (= bit 62)2 S: V0 x1 r7 _. W1 i
(progn
1 v9 ]& F# g/ |( T9 c! N (if (or (= value "BYLAYER")) A0 t$ B8 h$ W2 e, R7 k, J
(= value "BYLAYER")) (setq value 256))
/ R. q2 q3 h! x! p J% r& @ (if (or (= value "BYBLOCK")$ W2 q+ G0 Z' l
(= value "BYBLOCK")) (setq value 0)). N+ `6 y. L% a- D+ T2 M) T
)0 }: p8 g) Q5 |" X% d, X1 D' X! C
)* A/ L# @+ @: f5 ~* _0 ^3 p% w
(if (setq oldlist (cdr (assoc bit elist)))) O( K% q) U# X5 A! @
(tempmod value bit nil)
6 p7 N1 b, z' X! f g" U (setq elist (append elist (list (cons bit value))))
9 T6 K" O+ v, Q2 ?# K% A9 o )* w# w: Y$ w: [1 V/ r( _5 Y
)& M( s% ]; r; W& I4 J# v
;;9 E* H" a* A0 V/ N
;; Resets object list to original values. Called when the dialogue or) [* H% S* b( C4 L2 K4 n* H) E
;; function is cancelled.
, v# D8 Q: b& V9 s3 H. p, q1 P ;;+ i9 @/ {% A+ [6 c$ s7 y9 |
(defun reset ()) Q2 e" o5 j5 f/ v& |
(setq elist old-elist/ O6 g' z! T9 |' K& |' {
ecolor (cdr (assoc 62 old-elist))
! a3 r3 b9 l# Q7 o- S ethickness (cdr (assoc 39 old-elist))
% O5 |/ D$ G) g/ V% | eltype (cdr (assoc 6 old-elist))
1 L; \0 Y' H% e; T elayer (cdr (assoc 8 old-elist))
4 }+ O0 o) C; y eltscale (cdr (assoc 48 old-elist)). x6 u: g7 o! O0 R1 F
)
7 g! u3 i% w9 o% Y (if (not ecolor) (setq ecolor "BYLAYER"))
. G- w$ u: u' R! P# i! X (if (not eltype) (setq eltype "BYLAYER"))
- g/ @- Y2 j0 O+ J4 y, _$ W% N (if (not ethickness) (setq ethickness 0)), I9 h, j$ _# P) e& r3 p2 m: A
(if (not eltscale) (setq eltscale 1))
" ]4 `. r# S/ X (modify_properties)
# X8 r p! V% v; [- G (setq reset_flag t)0 V. Y1 u4 e+ a$ E7 E
(entmod elist)
7 j/ Q. r+ B3 _5 F3 X7 c! h: u )
1 [+ K3 d% s, D2 w' y ;;
8 _3 ^( y. N: L% R/ X ;; Modify object when dialogue is temporarily dismissed to reflect latest
( R0 Z, u# B8 n% }2 h* O& l ;; settings of dialogue. It converts the point from current UCS coordinates to4 a1 Z4 A9 I! B
;; the proper object coordinates (world or object).! C q1 F6 V# u# [. i! o h- O# x
;;
6 |7 L `# z7 U! p+ Q8 N9 `5 [ ;; Arguments: value - in current UCS coordinates
( J0 Z1 L x8 D" t ;; bit - object code (i.e. 10 for start point)* H, N/ O X# i1 A+ k: g6 ~
;; ptype - point type 0=world 1=planar0 O2 d2 ?9 m) K& O7 w& U* O
;;
; K4 k/ \$ a/ e$ H6 d) P4 | I (defun tempmod (value bit ptype / newpoint)
. O4 g1 J0 n* p5 m$ e (cond
9 I! u2 A! A" k& n7 W/ B( N ((= ptype 1) (setq value (trans value 1 ename)))
$ E8 O. j m; |$ E' { ((= ptype 0) (setq value (trans value 1 0)))
' h1 h0 H9 @! H- |9 ] )
) x$ U; n# j$ I7 l& w! C4 U (setq elist (subst (cons bit value)
; l( d- V" O, t& }5 f0 ^- q* W (assoc bit elist)# [- z( @9 z8 e0 D. i
elist( D, H% n+ n- q/ f+ D5 Z/ C
)
) I/ W$ f- f' f% p+ G. K )9 S2 Z" s% T# ?; E0 [2 r
)1 H! B. c$ b# g; L- I, x
;;
7 Z9 b* E2 Q7 \* r ;; The following functions are called after a dialogue has been temporarily
8 P! f" j9 @" ]# v g ;; dismissed and the user is selecting a point. If a point is selected the
7 G( x* G$ T, Y* k0 y ;; object list is modified and new X,Y,Z values set. If no point is selected
+ D9 o6 w* m: O* _! k: k& s; s% E ;; (null response), then the point is reset back to its previous values.% ]4 c# y5 S- z# |! I% S
;;2 r) N& C! v3 V2 S& I7 q
(defun ver_pt1 (ptype)
_; F; f( F" p K& ^ (if pt1$ ? q. _, ?- k
(progn
J$ x+ H! L6 x" ?4 r (tempmod pt1 10 ptype)0 B) \! i6 R' i4 V! n
(entmod elist)
' H. E! t3 s% e6 B, r, P4 n" v )
8 T/ Z; r! r2 i) t (setq pt1 (list x1 y1 z1))4 u" c0 Z8 T. [: i e# g/ b
)7 H( H8 A& I; _2 T7 T
) ?0 i, H* g5 k( ~5 u
9 {1 _/ }/ G/ U' q7 M ; (move_pt1 <ptype> )
: |8 Z# G( T1 [: ]- Z ;: {* t$ a7 ]! R% n3 k3 a/ s
; Called in liew of (ver_pt1) to translate block insertions which3 U I0 l& v0 q
; might have variable attributes attached to them. If the distance
1 }* t1 d2 t2 O4 m$ x# o ; the block is to be moved is < 1e-6, the move is deferred./ X) @8 v, Y8 H, B- L. `, C
/ \* \& O1 u5 T6 s0 ?# f- b2 I (defun move_pt1 (ptype / basept hi)
E9 |5 l0 F+ [2 R* R" X: P; K (setq basept (trans (cdr (assoc 10 (entget ename))) ename 1))& Y% V6 n1 X! n( {( J
(cond
5 d+ \2 X" u: u ( (not pt1)6 f5 [7 \% I* G }/ P# V
(setq pt1 (list x1 y1 z1)))
6 O+ g( w! Q* n% ^1 k
% E2 \$ L8 s* o+ t" A8 V" q ( (> 1e-6 (distance pt1 basept)))" |% v- ` k; R; l; b
+ g$ U0 E# Y% r) F
(t (tempmod pt1 10 ptype)) @: G+ c4 I8 Y2 ^" F1 Q
(setq hi (getvar "highlight"))
; Y& T5 j, c0 V (setvar "highlight" 0)! z2 {4 G9 g! m B
(command "._move" ename "" basept pt1)# F$ `. G& J: Y3 v2 l3 ~3 M
(setvar "highlight" hi))
( K0 I3 P8 w+ a# y0 n )
V4 N' u" G M )
3 F. u6 _4 U1 ]/ b% r* g! l4 r$ Q! L) a1 V% c c
(defun ver_pt2 (ptype)( A4 S! Z% S7 z' e* w
(if pt2
1 p$ m2 }* \) Q* ^ (progn
0 O" Y9 W# P: U (tempmod pt2 11 ptype)- s8 r* q1 Q. z- [. l
(entmod elist)
) K5 b4 `- c4 c) F )8 \3 c7 I1 U& y+ G5 b
(setq pt2 (list x2 y2 z2))4 d+ Z+ o6 [ i$ C5 ^5 r
); t. d' F7 n ]$ O' {
)) E$ h, F. l6 S8 F3 O; E3 h$ a
. i" {$ M) ^# _ b0 n6 u (defun ver_pt3 (ptype)& e( \% ]" [% }+ m
(if pt3
. a b' \ b- a% F) f9 _1 L4 n+ R (progn: }/ Z2 d; h1 S: [+ d4 I
(tempmod pt3 12 ptype)
8 m1 P. W, m. A; z3 d (entmod elist) [( ], M+ ~8 y
)
3 _# Q8 h9 E* j, h8 R$ n (setq pt3 (list x3 y3 z3))
2 Z6 Q& |, b, A8 j )
3 k; d- o- g- h. R' Q! w9 c )8 A) o8 z, ?0 ]' i# X0 U! f/ d9 f
0 D+ ?+ _! o* [0 _! I (defun ver_pt4 (ptype)
9 M5 v. L" r& n9 d (if pt4
% h9 e) Q. i( I( v5 v4 i& X+ G4 V (progn
+ e% `/ F& y( U# K1 e! S9 Z (tempmod pt4 13 ptype)* K+ \& F$ x: F1 Y) r6 }3 @
(entmod elist)
- V# n6 c% \$ K& k6 H/ i: v- J/ n- Q5 B )" A* l0 P# ?0 R+ N0 h3 j4 E9 M
(setq pt4 (list x4 y4 z4))! b: i3 M$ _ ]2 T% k
)
8 w; W8 ^; ^9 x2 b% \! P )
: c/ |; s [1 i; I3 g' m3 w# Q3 G ;; Xline/Ray
( w$ U" ~: G! m* e+ {: i7 c (defun ver_xline_pt1()
. c" u# `; H$ l (if xline_pt1
x, ]2 x- W7 i3 h; l, S& |4 o (progn
" U1 X. q7 ?* [3 P9 r0 J$ e ;; convert to WCS.+ w, p' n ^9 U
(setq value (trans xline_pt1 1 0)); g" B. _# M0 I8 g+ S5 T
(setq elist (subst (cons 10 value)
/ z# @' [* l1 c' q7 @* ~ (assoc 10 elist), A$ {5 Y- E) n! @) H% R
elist
* _4 j" m/ p# V, j8 v& y )/ @# t% j9 `6 T# K
)
! K, R* q4 F" ~8 l; H$ c. _ )
0 B% ]+ N$ w3 I4 f; n (setq xline_pt1 (list xline_x1 xline_y1 xline_z1))
# H6 s4 R0 y( A$ m( Y( j )
8 O0 o- K! x$ m j8 z+ X )
6 I& N+ r$ _# G$ r; F$ ~4 Q7 P5 P- R6 n% U# h" F
(defun ver_xline_pt2()
* ~* T' l$ S, c. } (if xline_pt22 O/ s) w; u9 r8 Z
(progn; U& ~! r% n: V+ M
;;" |. @0 b1 }, E8 f; {' ^
;; Calculate new Direction Vector WCS9 u; Z) @9 [$ H5 u2 c
;; x / (sqrt ( (x**2) + (y**2) + (z**2) ))
% E9 y" c( R& `( \; @. a (setq temp_dir (trans xline_pt2 1 0))
) V! ~. @: y. k+ w3 O (setq temp_dir_x (car temp_dir))
1 M# S1 w' j/ g$ h1 O (setq temp_dir_y (cadr temp_dir))' k p' q3 H- D f$ S: U
(setq temp_dir_z (caddr temp_dir))) f t8 b- e8 {' e, q. l
2 q/ t" b0 g9 Z [% K
(setq temp_xline_pt1 (trans xline_pt1 1 0))
: `, e9 v. S1 s2 W. j- }2 L (setq temp_xline_x1 (car temp_xline_pt1))
$ g4 P8 J5 @" \- B- Q3 V (setq temp_xline_y1 (cadr temp_xline_pt1))' c' a. M$ d- E+ m( R8 @
(setq temp_xline_z1 (caddr temp_xline_pt1))( M+ }+ `# q. |
4 ?# }2 s8 S1 M (setq denom (sqrt (+ (expt (- temp_dir_x temp_xline_x1) 2)
' O/ |0 p% Y' G; N% H) Q* q4 Z+ w (expt (- temp_dir_y temp_xline_y1) 2). p2 f9 D% L( Q
(expt (- temp_dir_z temp_xline_z1) 2)% Q0 E- m2 F9 `( ]: t! t+ b
)))# D! A" n- g& _6 `
(setq temp_dir_x (/ (- temp_dir_x temp_xline_x1) denom))
' u- i# ]9 A5 g+ w$ w5 G! p5 ^# K% ` (setq temp_dir_y (/ (- temp_dir_y temp_xline_y1) denom))
: Y: r6 p0 B8 l* O2 U! C+ n (setq temp_dir_z (/ (- temp_dir_z temp_xline_z1) denom))6 i/ r+ W/ l c" u2 p, X# d
(setq elist (subst (cons 11 (list temp_dir_x temp_dir_y temp_dir_z))+ j1 D0 O; c5 x9 _
(assoc 11 elist)$ N* J# K( n$ ~( [
elist' _ K a8 s E0 o `8 n
)
/ h/ K# R4 F: J8 P )
' @! b" u5 X9 ]+ N; {$ R' Z B (entmod elist)" u( L9 y% w1 x |
(setq xline_x2 (car xline_pt2))
3 Y; ^' `2 n9 T: I4 o6 H* X R (setq xline_y2 (cadr xline_pt2))
' F P+ W: I6 @" m0 d4 E. s( O (setq xline_z2 (caddr xline_pt2))
Y6 f4 E& F7 Y) X/ V" a+ ^
* V! L* e1 M0 r' r5 u/ _& |$ t5 h( j6 n
)
9 L3 M6 T2 a ]0 V ]$ L. x (setq xline_pt2 (list xline_x2 xline_y2 xline_z2))7 F/ d" R9 G4 V, j# T7 n
)
; u9 d: t' |* Z. _" n. K )% p, K6 K0 T; _7 ~- o% {+ I
5 R8 y" n4 [/ ]1 A6 a
;;
! X/ l/ O9 E H6 {) D ;; Common properties for all objects& V. D6 d. @ X* f
;;
" c' b8 m! u" ?5 }& g7 c. I (defun set_tile_props (); {, w) H* v: ? z
(set_tile "error" "")
) R8 }( g; g) T; e" Z1 Q: x8 B7 b (setcolor)
1 h0 I1 @9 K. p$ b (cond
9 R# Z2 [( G6 i$ r3 \2 Q5 f ((= eltype "BYLAYER")
; b/ f7 B0 X% ]+ t' r (set_tile "t_ltype" (bylayer_lt)))
1 |) q2 H! R8 r1 d" e7 ^( L0 l% ^ ((= eltype "BYBLOCK")
; J' R9 j: y, Z' |8 g (set_tile "t_ltype" "BYBLOCK"))
# K0 T0 V2 {$ H& Q0 b (T (set_tile "t_ltype" eltype))3 a% t) h; p, v0 u- {" J. I' x
)- P# Z; _: S7 x% ~! H
(set_tile "t_layer" elayer)
1 X. l2 v9 `5 l (set_tile "eb_thickness" (ai_rtos ethickness))
2 F5 g3 O' _( Z (set_tile "eb_ltscale" (ai_rtos eltscale))
% b% x" ]4 ?1 ~/ q (setq which_tiles (ai_common_state etype))
+ i' m- T' {* M7 S% g [ ;; Disable tiles if need be...
m ~2 r4 \' d }5 q/ S" ~0 p& W4 E+ |& U. q$ |1 q3 k
;; Layer Button and Text Field
, g3 ^. I# R6 ~! t8 F( b (if (/= 1 (logand 1 which_tiles))4 Z, l* {, s3 C$ |# Z0 K
(progn
3 Z& x& \1 m: y( W+ ^, {! q (mode_tile "t_layer" 1)7 P F- P: u: W- K2 n* M7 u
(mode_tile "b_name" 1)
5 F' R+ E. }- E! p" w9 T: `- d )/ {2 j5 A' q& z9 P/ }" m' m
)# \3 ]- V% ` ^5 D
;; Color Button and Text Field
4 D6 f+ k" Q) }2 f) H (if (/= 2 (logand 2 which_tiles)) G8 B) ]; j1 `* J: c4 G
(progn
% B0 G7 R! T t2 {. l# c (mode_tile "t_color" 1)
1 M# K8 l" h- D) j( { (mode_tile "b_color" 1)+ v1 R5 f/ d$ w$ @& `- U$ g
(mode_tile "show_image" 1)
2 ]- \/ K4 Z+ N& S% B2 q6 z )
J2 d9 d8 D1 a( B6 O& B )9 z7 I5 r; g6 @: E3 e( F
;; Linetype Button and Text Field
6 q7 D* ]/ y9 Z9 |6 O8 d (if (/= 4 (logand 4 which_tiles)), C- Y; E Y. a6 ?
(progn0 B# {$ i2 p* \$ V4 w( p. q/ v6 C
(mode_tile "t_ltype" 1)
! v4 I5 y! n2 I0 a) `% S( y% M (mode_tile "b_line" 1)
- q# {- f, P8 b/ z6 J )6 j$ e3 U, b& P0 n
)5 }9 J) b. W9 A; V
;; Linetype Scale Edit Field8 a7 b9 \/ N6 J* }
(if (/= 8 (logand 8 which_tiles))# i3 b$ b9 E$ c( H. d* K0 M, x
(progn- M) X1 e1 s' F, G2 @9 c
(mode_tile "eb_ltscale" 1)
1 v) G, O9 e" k- _$ u! j )
0 B( @4 d2 U7 y- q- ]5 _8 T )
* G! l0 `% z" w2 b8 O ;; Thickness Edit Field.
: ^1 G0 o2 s) O+ f, Z a4 A (if (/= 16 (logand 16 which_tiles))
) ]8 C! X2 w2 S; I8 Z (progn
" W! a) ~! @% D5 s( i' H# D- @ (mode_tile "eb_thickness" 1)
9 d+ H# X" e# E C* R k( I5 u( n7 Y' j )
- v5 _0 z4 a4 A )' Q! G0 H) I, f6 Z8 m1 W- ^$ i8 }
): h3 D4 P$ f( Y* C2 ~$ f' ]
;;$ k: S- H8 Q; ]; j- x2 X7 X( ?
;; XYZ Point values for all enitites
- Y1 u) c3 S9 X; E) @- S- a% g ;;' H: V( |% |. i0 h6 ~! c
(defun set_tile_pt1 (ptype)# ^8 s3 P: L1 r; I) I4 q
(if (= ptype 0)
# Y6 I$ A; X ]4 p (setq pt1 (trans (cdr (assoc 10 elist)) 0 1))
; H! r% |$ x& x+ J4 A (setq pt1 (trans (cdr (assoc 10 elist)) ename 1))+ E! J" d) T. i, V- U& h
)4 n2 U q: v3 C; P! D0 X
(set_tile "x1_pt" (ai_rtos (setq x1 (car pt1))))& G- `0 c( }8 `3 p4 q
(set_tile "y1_pt" (ai_rtos (setq y1 (cadr pt1))))7 A( V8 a k2 e$ V' Q
(set_tile "z1_pt" (ai_rtos (setq z1 (caddr pt1))))
. d) m; @ g# F" q9 o0 P# d )
3 {( t6 y( |( d9 X* z- j (defun set_tile_pt2 (ptype)2 { r+ ?0 h- |- `' h
(if (= ptype 0)
% O! y9 e L$ G. j9 I$ T- Z (setq pt2 (trans (cdr (assoc 11 elist)) 0 1))7 ?+ s2 V+ J! a9 l3 v
(setq pt2 (trans (cdr (assoc 11 elist)) ename 1)): i; k, g ^* V2 \% a6 {
)1 J0 R0 q$ p* i' s
(set_tile "x2_pt" (ai_rtos (setq x2 (car pt2)))). e3 v2 V. E& J' d
(set_tile "y2_pt" (ai_rtos (setq y2 (cadr pt2))))8 L$ V; ?" ]+ K6 d# j
(set_tile "z2_pt" (ai_rtos (setq z2 (caddr pt2))))
+ W8 c# r# M' [) U' i )$ V. ]( U; r2 q( q0 R( K# B1 E
(defun set_tile_pt3 (ptype)
' `3 W6 A6 u3 G/ O: ^0 j, p (if (= ptype 0) D% w6 d: U1 i. o' `
(setq pt3 (trans (cdr (assoc 12 elist)) 0 1))
k9 z% k! L6 k8 {+ L( [ (setq pt3 (trans (cdr (assoc 12 elist)) ename 1))4 Y6 `+ ^! u( V9 x1 u
)+ H! c) \4 ~9 P" J, U8 B5 k
(set_tile "x3_pt" (ai_rtos (setq x3 (car pt3))))
3 { I/ {+ {) T! f% l (set_tile "y3_pt" (ai_rtos (setq y3 (cadr pt3)))), d& ^8 e* h! J! t8 {
(set_tile "z3_pt" (ai_rtos (setq z3 (caddr pt3))))% n4 B( u3 E+ l, _8 P& l. U: |2 Y
)
* U% J0 b @; S+ [ (defun set_tile_pt4 (ptype)
, Z1 @& |& K. @8 W (if (= ptype 0)) U9 U0 M2 a4 I) g6 V
(setq pt4 (trans (cdr (assoc 13 elist)) 0 1))
: g5 t, ?4 H. H( d% y, B1 D* w" F0 \ (setq pt4 (trans (cdr (assoc 13 elist)) ename 1))! ^, j% a( D% t u7 J$ w$ U
)
- l% T v+ m! X: H$ C+ M/ S0 Z" T (set_tile "x4_pt" (ai_rtos (setq x4 (car pt4))))
3 b) T, A l C/ o. O8 a (set_tile "y4_pt" (ai_rtos (setq y4 (cadr pt4)))), o& b5 b" {' l ~& K8 x# x7 w2 I* t
(set_tile "z4_pt" (ai_rtos (setq z4 (caddr pt4))))
* W+ ^/ h- V% i+ }6 Z ). j$ k( o, n# k+ U. x; m
;;& B3 W" q( W+ ~2 h! \! V/ s
;; Xline/Ray7 o7 o2 G% s) l0 h6 `% `
;;4 ]; i4 k2 Y5 z- N
(defun set_tile_xline_pt1 ()
, G S1 E" m( z% `; y; V9 T" ~' G4 g4 ]
(setq xline_pt1 (trans (cdr (assoc 10 elist)) 0 1))
8 m# P) W/ w' G5 t# U$ f! }( H2 q6 s9 I* W
(set_tile "xline_x1" (ai_rtos (setq xline_x1 (car xline_pt1))))# X; @2 y4 g4 \+ q2 q
(set_tile "xline_y1" (ai_rtos (setq xline_y1 (cadr xline_pt1)))) L; z& [% k* F% O( j5 Z) p, x. p
(set_tile "xline_z1" (ai_rtos (setq xline_z1 (caddr xline_pt1))))) u' [1 \6 w1 ~, }% X& E1 K- ^0 o
)& X1 Y$ t" x& W( w, c
(defun set_tile_dirv ()% A2 b- F! | Z G- b U
;; Convert 11 group to local UCS (displacement)
1 S% l' y5 V" Z+ D. p$ |+ v (setq dir_pt (trans (cdr (assoc 11 elist)) 0 1 1))
$ Y* S2 D/ X1 l) S; A
- ? w& F1 W4 N (set_tile "dir_x" (rtos (setq dir_ptx (car dir_pt))))
8 } T; W+ A! u A6 F/ ? (set_tile "dir_y" (rtos (setq dir_pty (cadr dir_pt))))2 N2 {) {9 L! N
(set_tile "dir_z" (rtos (setq dir_ptz (caddr dir_pt))))" w* s/ L5 ~1 l" P, i/ X5 p. k
)
9 s2 x2 i. Q: B9 A v (defun set_tile_xline_pt2 ()
& I5 i6 w4 ?: S( w$ ?$ Z (if (not xline_pt2)
2 ?; c) Q% x' O& a ;; Initial second point is Root Point + Direction Vector
. w0 k& e4 P0 P# U# K* V2 { (setq xline_pt2 (mapcar '+ xline_pt1 dir_pt))
" k; ?& X7 v6 L3 |: E: N4 o) }( I ). [, [# m; x$ @- _
(set_tile "xline_x2" (ai_rtos (setq xline_x2 (car xline_pt2))))- w R( Q( U4 @& X7 z
(set_tile "xline_y2" (ai_rtos (setq xline_y2 (cadr xline_pt2))))5 h0 V3 z) M3 R/ N
(set_tile "xline_z2" (ai_rtos (setq xline_z2 (caddr xline_pt2))))
3 s5 F6 I1 `( N8 a ) G2 R! n' J5 n# Y( [
9 l7 U4 H s [: s. r! u ;;& \( _* J( } ]( ~& Y6 F
;; Handle for all objects3 P" u9 g0 V, g; V! Z6 s, J, ]
;;
% d! j* s4 U% r! T4 W (defun set_tile_handle ()
' S S6 A. n9 w& D; s (if (setq hand (cdr (assoc 5 elist)))
2 n; D. F% [% B9 G. L0 I! i (set_tile "Handle" hand); Q/ H; f3 L4 S. v
(set_tile "Handle" "None")
4 z! N$ T X1 Q3 y6 ^ )
# U5 |: Y$ Q- t& e6 H% r1 @/ z0 x )
6 H* ?, b9 v H5 l! m' `, a; I6 x$ X ;;, w' ]' {1 \! |6 E4 b9 R! N0 u. p
;; Radius for ARC and CIRCLE
5 W6 c4 W* K3 H3 w! M5 ] w5 T3 g# V# O ;;' J2 L7 f7 ~+ k- ~
(defun set_tile_rad ()
J5 o" e5 {9 x" Y (setq radius (cdr (assoc 40 elist))). B& }, q& Y( g: m# Z2 t& q0 T
(set_tile "radius" (ai_rtos radius))
( [ G+ i5 R& } )
4 R6 n/ f d7 u) L6 w# k- }7 | ;;
& C' M$ H1 ~! Z4 l' w( Q# o/ O [+ A) t ;; Start angle for ARC
' K! Z2 D8 U! C M1 O ;;
( V8 r8 p% A$ J8 E5 [$ U- r: B (defun set_tile_stang ()
! N+ e J! t% h) ^$ ~5 t* J (setq st_ang (cdr (assoc 50 elist)))4 J6 W4 Z1 v2 A9 g) G( ~
(set_tile "st_ang" (ai_angtos st_ang))
% {# d8 s1 U$ }0 } )
: U" H( i. t7 R; G {( ` ;;' n* e2 a& m1 T6 o n( n
;; End angle for ARC3 m7 D( u4 Z6 { Z. q
;;
9 l& c' J* ?' ^( J1 `, P (defun set_tile_endang (), e8 }4 J8 z" ^0 b' u
(setq end_ang (cdr (assoc 51 elist)))! f$ d) ~5 s7 x8 [8 |
(set_tile "end_ang" (ai_angtos end_ang))3 F5 \3 S* k. |
)
& Q* B/ p5 ]" h2 a ;;0 t3 D: ~* \# c' H
;; Rotation Angle - Text, Attributes, Block insertions and Shapes7 Z5 f: s9 D( j- Y1 M8 y! k( b
;;
8 \ n# r5 W- V5 b# t) [0 A (defun set_tile_rot ()
6 V0 o& S O! t3 n (setq rot (cdr (assoc 50 elist)))* R/ s/ d& }2 T2 i& v4 a( M5 v
(set_tile "rot" (ai_angtos rot))
: p9 B" l) Y: e5 [ )/ n9 H# C3 ^9 e4 s$ b$ V% O
;;
4 s5 I5 f# i) J4 u/ r% l. u# @ ;; Height - Text, Attributes and Shapes7 p" @" }! \4 O7 J: Q1 c3 Y
;;
5 S: ?. f, {' p& w) t; w9 d (defun set_tile_hght ()( y" }+ I, Y+ N7 g
(setq hght (cdr (assoc 40 elist)))% x9 E7 M4 T: u. [$ P2 K6 _: z0 Q
(set_tile "hght" (ai_rtos hght))( V7 d8 {0 |( G7 s1 ^
)9 p: i, M c" Y$ K* T3 J4 l
;;& w- Q3 m$ v( X( J% Q! v* a
;; Width Factor - Text, Attributes and Shapes' x& a+ v( P6 X5 Q
;;
0 Z" c" @7 ^0 R R5 F* v2 N (defun set_tile_wid ()
3 j/ g B! `; I% b# W (setq wid (cdr (assoc 41 elist)))
A# ?" \7 P8 \# h3 v R1 Z4 Z (set_tile "wid" (ai_rtos wid))
- ~6 [+ Y' O$ M8 f: q )
& H3 O3 }% W U ]/ Q ;;
+ [1 Q1 @) `: o7 n ;; Obliquing Angle - Text, Attributes and Shapes' Z4 s: |- X+ `4 Q2 L; O
;;* l5 y+ R9 C3 {( r, x$ {6 N
(defun set_tile_obl ()
, H* R7 ^4 \( ~ (setq obl (cdr (assoc 51 elist)))
& U: N% S& g. Z (set_tile "obl" (ai_angtos obl))
9 V9 l! |; u5 C/ M0 ~5 a, W- I )
7 p# K3 \8 Z: T* b$ J0 k ;;
4 Z! Z3 C( ?& h( q ;; Text string
, b: ^3 A& |; E& l ;;* s3 N% T* s5 I% l. e5 |1 b1 ?
(defun set_tile_text ()- e: |! o! |( G M; S
(setq text (cdr (assoc 1 elist)))( ^0 z/ a3 s- r( {4 e4 X7 V/ ~3 X
(set_tile "t_string" text)
& f# v3 H6 ]0 }5 [7 A )
: I/ H6 T9 ?/ Y" p6 K ;;
1 y+ j: @# I5 m ;; Attribute Tag
+ V8 p; _8 l5 ~ ~/ J- b ;;
& J$ Q$ _1 q F3 m4 ` (defun set_tile_tag ()5 U3 K# E% N1 y6 C& O" h( E4 M
(if (= etype "ATTDEF")" K3 \* M) W3 Y6 E! L
(progn) `: j% g9 A# V+ g8 [+ B2 Z
(setq attag (cdr (assoc 2 elist)))" J. _4 `: ^: c5 p% }/ B+ t
(set_tile "tag" attag)
( M8 ]3 {7 a3 O; T5 `) \ )4 c8 ^3 D# w3 H) H
)
8 ^7 ^" J8 q/ W2 {2 g6 H# D )
U/ c4 m$ W2 X3 r' o ;;
$ ?: n+ E7 @6 Y) D1 J$ _ ;; Attribute Definition
$ X+ O; c" J! y' ` ;;
6 h: T3 Y: E% i. W% w (defun set_tile_prompt ()" ^# @% o; Q0 ?8 `
(if (= etype "ATTDEF")
' {; k1 b, `+ y$ l" @ (progn
0 b3 S+ q& C( {, ?' O( I- g6 j (setq atprompt (cdr (assoc 3 elist)))
, j( g" U# [2 N (set_tile "prompt" atprompt); j- J( L. R9 y
)
- \6 k% Y X9 _; j )
" i5 ?' E7 }: \8 A% E& Z) Y )& y! [0 ~: O {3 s/ U
;;
- K+ M) C6 s& k ;; Justification setting for Attributes and Text. Initializes7 R% R# ~( B, ^: w! B- R0 ]
;; popup list box6 P& b0 c' N( J7 U; e7 |6 h
;;
# d/ V+ W) U9 V- j% l2 ^" V (defun set_tile_just ()# S* N+ c0 o/ Y4 b, v$ ?0 R
(setq ha (cdr (assoc 72 elist))) ; horizontal alignment, M+ A5 I- ?2 I- Q; c7 r4 b+ Q% j% i% M
(setq va (cdr (assoc 73 elist))) ; vertical alignment. U' T. q) Z: Z, f
(setq ha-prev ha)& ~' t+ H0 `7 h+ h3 r- L7 K
(if (= etype "ATTDEF")
" Z% N- r7 c- e/ Z8 F (setq va (cdr (assoc 74 elist))) ; vertical alignment
# }, g+ s' V8 o# X$ P# Z! @* ~ )
8 s' \5 K6 Q8 ~+ v0 O (setq jlist( U: t6 p; \3 I
(list "Left" "Center" "Right"+ C6 R4 {& x8 F9 F4 t. z1 k+ @
"Aligned" "Middle" "Fit"" f, u) Z3 s3 O- t: {" u
"Top left" "Top center" "Top right"$ A" \: U1 w6 w; z
"Middle left" "Middle center" "Middle right"3 Q; }0 Z5 j6 a) \& L7 x
"Bottom left" "Bottom center" "Bottom right"
( y& i* I- X8 r# K- M6 k )8 C4 }# A, B7 Y1 g' p7 L; E
)
" [! T3 N0 b+ m1 e( Z. @ (start_list "popup_just")
/ f7 a4 L2 f% p R (mapcar 'add_list jlist)1 l6 f7 h9 u8 [, A7 ]# h
(end_list)' V& G" N" i `- w) S7 c; m
(set_just_idx)
5 f, O4 q; K# R" M* P (set_tile "popup_just" (jlist_act just-idx))
5 z% M6 A. @# u& b& t) }6 B )
+ l4 j+ r& ^2 F, n- z ;;" Q% }# j/ U; V8 ^
;; Style setting for Attributes and Text. Reads symbol table for popup list+ s: s: w- e( M) s; S/ _
;; box.
. c% X" w1 G* l: P ;;1 n. I! j, H% ?2 r6 L6 _
(defun set_tile_style (/ sname style-idx tlist)
) R9 J! [2 z1 U' f (setq tlist (tblnext "STYLE" T)9 q t( V( d- h9 O& {# B4 t6 N
slist nil)
% ~$ I- k2 L( ~& C0 b (while tlist1 n+ ?; [8 _, ` p% i( [( T
(setq sname (cdr (assoc 2 tlist)))! T+ a. v, U9 j7 Q3 b/ c" T
(if (and (/= sname "")
3 i. r" u, \, N2 b* q (/= (logand 16 (cdr (assoc 70 tlist))) 16)); k- Y+ B8 O% s" r( d
(setq slist (cons sname slist)))
" I; G4 f7 _8 n! @ (setq tlist (tblnext "STYLE")))0 n: _. ]/ L! k* `8 ^ i- y3 g% D' a
(if (>= (getvar "maxsort") (length slist))
0 d+ U5 B H- N. f (setq slist (acad_strlsort slist)) ; alphabetize style list" u* \6 p$ ~- x3 \
(setq slist (reverse slist))) ; or reverse it to put it in DB order
4 a- l2 L5 A5 M3 x% J
! Q5 v1 \& e4 E- w/ s- L (start_list "style")5 K& O8 P, h2 `1 e; l2 i6 N
(mapcar 'add_list slist)
/ H q7 U- P/ X% S. g$ S (end_list): i: ~5 `7 J: p- L5 a- L5 ^% n
(setq tstyle (cdr (assoc 7 elist)))
6 Q4 F x' P6 i" ~% N& R# \- f7 k6 P+ [ (setq style-idx (getindex tstyle slist))7 j D' A; E: E; p) ?
(set_tile "style" (itoa style-idx))
0 `8 O0 T& j- S8 ] )7 o* Y9 f4 o3 d9 ^: i' N
;;( t% B# w' Q6 U/ B/ D6 |
;; Text and Attribute setting - upside-down, backwards. I6 X4 Y l S
;;
+ a( T2 O! c8 }6 l (defun set_tile_bk-up ()) B# ? d, S" W1 C c( H$ L
(setq bk-up (cdr (assoc 71 elist)))
$ [' Q+ V. @5 b0 P F) i (if (= (logand bk-up 2) 2)
2 W! F- y1 T3 i6 M. z+ V+ a (set_tile "bkwd" (itoa (setq bkwd 1)))
. Z1 w: {, `6 l7 X' p: N: W7 g (set_tile "bkwd" (itoa (setq bkwd 0)))5 f- j$ k: P: a% s
)
; ?3 a2 g& M j! m; d. p (if (= (logand bk-up 4) 4)( m( L* o1 T; R* l: ^
(set_tile "upsd" (itoa (setq upsd 1)))! K7 H* Z- D7 E3 y9 ~5 J( l
(set_tile "upsd" (itoa (setq upsd 0)))5 d1 A6 X! p/ F+ w
)
/ l$ L+ e' m- n/ v$ V, L Q )
% n7 n; s4 C; a5 B, |" t' G+ h( { ;;
9 I/ w4 l+ g0 H3 c# a, s3 W, y ;; Attribute setting - invisible, constant, verify, preset4 T: L" m( V! Q0 }) f
;;" T/ p0 |8 }9 j
(defun set_tile_icvp ()
% O# j5 D/ I- {' P (if (not (setq icvp (cdr (assoc 70 elist))))
9 I/ k' _2 N( {! \3 ] n) j (setq icvp 0)- Y& k- }8 h9 b7 y+ n- e9 `
)
$ `5 i0 A* q/ \7 O+ I v% g (if (= (logand icvp 1) 1)
, C4 O+ a0 r. ~$ t& n/ P (set_tile "inv" (itoa (setq inv 1)))
: v2 g3 c6 L$ X: q9 n2 }9 ^ (set_tile "inv" (itoa (setq inv 0)))* y4 Y& D: z# ^3 x' w& b# N! [
)5 y; n i1 F6 w0 k+ S
(if (= (logand icvp 2) 2)
% q; s% s& F/ t; | (set_tile "con" (itoa (setq con 1))), Y, l( T/ Q1 W# Q% j% z) O# m
(set_tile "con" (itoa (setq con 0)))
5 L p6 k% V6 i1 r& K1 r )9 {5 I$ X3 [8 y8 E* z
(if (= (logand icvp 4) 4)
( j6 w* b/ c! S/ H& Q* r (set_tile "ver" (itoa (setq vfy 1)))1 G% l" p1 v$ o I* x% ?! {1 Y
(set_tile "ver" (itoa (setq vfy 0))): m1 Q% B. S' @8 l+ ~1 e2 S, k* y
)" ^+ o; A2 a* i% X
(if (= (logand icvp 8) 8)
* \) t$ F4 x/ a- ?# } (set_tile "pre" (itoa (setq pre 1))); k4 y' G4 r {+ Y1 J# n, O# e
(set_tile "pre" (itoa (setq pre 0)))
) E* P6 K" { [% w) X; g$ I& w )
. X! G5 [$ M+ l2 A1 V )
6 H& w% R3 X# p/ Y* m7 I ;;
* n+ i' Q, w7 C, y8 W5 @2 c/ w ;; Scale factors for block insertions- i1 O/ y6 w1 ~
;;8 P) N+ [: I3 W+ q. K3 r# Q7 C
(defun set_tile_scale (/ temp)
; w9 w* f: \5 h# k (setq temp (getvar "LUNITS"))7 b7 D: }' P* ]* b0 w* V. g) ^
(setvar "LUNITS" 2)* b: j- [4 a7 V/ V4 D8 ?* J2 ~4 ^
(setq xscale (cdr (assoc 41 elist)))
; f& _5 A$ ]4 ^. U. q# {: k (set_tile "xscale" (ai_rtos xscale))1 K& L/ k7 u q9 J+ O4 A0 R- ~
(setq yscale (cdr (assoc 42 elist)))
. w7 C6 A& s9 j& Y/ G (set_tile "yscale" (ai_rtos yscale))
+ W# O. |3 {$ M. J% f (setq zscale (cdr (assoc 43 elist)))0 J7 B. k6 O' M" n: _( _
(set_tile "zscale" (ai_rtos zscale))
3 c1 F1 k. W) V4 {# A' n8 X X (setvar "LUNITS" temp)
" s( S! d3 [ h4 r0 K )& O3 l. `8 s% ~" h9 u4 ^7 n8 r
;;5 {1 z- m$ H5 ^* i7 e* ]. l
;; Rows and columns for block insertions* e) t- I2 ^4 O5 w
;;, A( J2 R( u% ^
(defun set_tile_rc ()
; B; g# H% i( V7 h (setq columns (cdr (assoc 70 elist)))
1 B/ T) t2 W3 k0 }$ o, N (set_tile "columns" (itoa columns ))
4 d# E9 R. ~6 D9 ?8 G1 i q G' Y6 Q (setq rows (cdr (assoc 71 elist))); e# x" o/ N3 l
(set_tile "rows" (itoa rows))
7 ^. ?6 S ?$ `5 X6 e4 F (setq col-sp (cdr (assoc 44 elist)))
; u2 _" n" c! g. U! \- y (set_tile "col_sp" (ai_rtos col-sp))
: q2 ], W) N. o) Q9 U5 `# R (setq row-sp (cdr (assoc 45 elist))): h' I0 |5 X5 U& b8 h9 ^
(set_tile "row_sp" (ai_rtos row-sp))
3 @0 F7 f0 J1 Z# d- h) G# y (if (/= hasclip T)1 C* W) Q7 z. e
(mode_tile "xcliponoff" 1); f' C5 G! u4 g
(set_tile "xcliponoff" (itoa xcliponoff))9 ^* a4 Q& W+ _
)/ O1 }7 F4 h4 L7 S
)+ A- `, n6 l8 \9 q% d
;;
/ O3 q1 y2 J; ]' } ;; Invisible edges for 3DFACE
( `- P2 s8 u4 u7 C; A) c ;;1 O: Y6 t2 b% u9 K& B
(defun set_tile_edges ()
( u7 b m; F6 _9 m. c% }$ f( _0 R B (setq f-vis (cdr (assoc 70 elist)))1 e( H; C+ x9 d* [0 L
(if (= (logand f-vis 1) 1)
9 h- k& Z2 g) q+ e7 a (set_tile "edge_1" (setq edge1 "0"))
6 v1 I: k: ]; i# r (set_tile "edge_1" (setq edge1 "1"))( Q& I& W2 I1 x8 p% s
). g; [7 j0 |( z' M
(if (= (logand f-vis 2) 2): |" T6 v# x( g
(set_tile "edge_2" (setq edge2 "0"))
7 }8 P, w2 L$ v ^4 y (set_tile "edge_2" (setq edge2 "1"))1 r& d ~9 Y, C
)/ r9 K5 Q0 b+ F% j$ p, ~/ X
(if (= (logand f-vis 4) 4)' |* L/ @6 P: k8 h5 J" t4 I) y2 J
(set_tile "edge_3" (setq edge3 "0"))
( V) w! ^# a1 L (set_tile "edge_3" (setq edge3 "1"))! ?: T% O4 l2 |# I2 B6 I
)
. p; {8 B/ y3 P& u# U, B$ O* d (if (= (logand f-vis 8) 8)' n- W6 w0 M ~: R! Y" E2 ]
(set_tile "edge_4" (setq edge4 "0"))1 f& k* R4 J- ]& m( l
(set_tile "edge_4" (setq edge4 "1"))
5 u7 C1 [; { h3 v4 ` )
. n5 Y- v+ o" D. V X v* J. M/ c& t$ | )+ V! U- U1 i" w" R$ C; {! c
;;
: V. e7 s' T5 a" Y ;; XYZ Point values for polyline vertex8 X- o- ^7 D& I6 ], f% W
;;
% U2 O V6 E0 R1 n. s2 Z0 _( f3 M% ? (defun set_tile_vpt (ptype)+ w% X0 ^" {$ M. v b7 _
(if (= (cdr (assoc 0 vlist)) "LWPOLYLINE"). A$ O p3 P F4 v* Z5 a/ N* q. M! D' N
(progn" m* l9 ]2 |) O7 j
;; ctr is 1 based, vertices are zero based.
! y1 f9 y. r7 ]. ~0 E" H (setq vpt (cdr (getLwVert (- ctr 1))))
" ~3 N3 [: @( f( y: D1 I (set_tile "xtext" (rtos (setq x1 (car vpt))))- \ B- i8 ^. y
(set_tile "ytext" (rtos (setq y1 (cadr vpt))))( p- F% l2 H6 V3 n4 b1 Q0 O
(set_tile "ztext" (rtos (setq z1 (caddr vpt))))1 q4 {/ V! ~; }$ E. j; v2 S
)1 q; ]) Q0 _( \# A8 T+ _, f# [
(progn" H) W: q# z) o; O' l
(if (= ptype 0)
* W" f, q* |: f4 B( }& a (setq vpt (trans (cdr (assoc 10 vlist)) 0 1))" ^9 ?# t7 w0 ^) F6 V" B/ p
(setq vpt (trans (cdr (assoc 10 vlist)) ename 1))
5 t3 t$ g/ R6 Z* S) X) t )
1 i% W% e8 {1 B' Y' e* t* e
0 z% d1 m, D2 w- m (set_tile "xtext" (rtos (setq x1 (car vpt))))
1 I1 |% V2 b& `) u" A# p (set_tile "ytext" (rtos (setq y1 (cadr vpt))))) M0 o" Y- x$ B" N- T
(set_tile "ztext" (rtos (setq z1 (caddr vpt))))* E/ L6 K% e' ]$ ?. e
)0 i# G6 K$ R" ^
)
$ ^: N2 D! A$ p9 ?7 L* _' W: p# `! u7 k* i7 r
)
& `9 f ? |6 x' y( q3 k ;; This is the equivalent to doing an entnext on the heavy weight# c0 ~* i z& }0 A
;; polylines. The hard coded '4' below allow stepping over the
! T- w( F6 T) i ;; 40 41 and 42 group code information. The while loop finds the, B6 D- v7 D) }/ K# x0 W# J8 Y! u- N
;; first vertex which will be used as the starting assoc in the
" D# {, V: q h- i ;; call to nth.
9 W2 N0 L( V1 s1 u' I ;;
9 `9 {- B j$ A. Q3 d1 q3 V (defun getLwVert (tmpctr / count tmp)
9 n2 `9 S# v0 s. c- [3 h (setq count 0)
" F; _( C; R* a/ H% t4 y3 M (while (/= (car (nth count vlist)) 10)
, n t6 J' o |( F (setq count (+ count 1))
( L% m( |" o' G, d) q% Q6 g/ G# [ )' Y" \6 l/ O3 N8 }$ {
;; If the counter reaches the number of vertices,: b5 w5 x' l, Q; L
;; reset ctr and tmpctr to zero again.% O3 y2 h# ~) I& } e
(if (= tmpctr (cdr (assoc 90 vlist)))
' E+ d; v' ?# @+ ] (progn& z8 r0 X, q8 Y3 d/ T
(setq ctr 0)
4 V9 q; W1 F1 S (setq tmpctr 0)- ]% s) l' Q: g' n! b( T7 Y" b
)" u2 G' d9 c' x# g: y
)+ \7 @% L" r6 Y! u+ I8 S
(setq tmp (nth (+ count (* tmpctr 4)) vlist)). m9 u9 A4 A& E w
(setq tmp (append tmp (list(cdr (assoc 38 vlist)))))
/ d+ P2 M# J; v/ U (setq pt1 (trans (cdr tmp) (cdr (assoc -1 vlist)) 1))% x$ i( D" V. x6 W6 w% V5 \+ ~* r
(setq tmp (cons 10 pt1)). U, X; [+ l( q# J
(setq tmp tmp)
' v# u4 G$ y. j( b3 U )' M5 r5 S- |, ^' k
;;
& ?- r" @5 `, T ;; Set tiles for Spline properties. If the spline is rational then we
6 f8 Y- x# B& O4 i$ p, b% \+ Y ;; need to display the weight values of the control points, so set4 W8 o$ p7 f9 `9 j! w6 B
;; flag to 1.
4 ^" p% r. m( z/ Q% y ;; 1 = rational spline
; T. ^3 C! c; J* ~1 {- R ;; 0 = non-rational spline% r& F! C1 ?( T9 r& N( n6 B" \. K& x0 ]
;;1 z$ {1 F8 x. Q6 h4 r6 B' z
(defun set_tile_spline_props ()
' Q; G) j5 L& B x (setq rational_spl_flag 0) ;; initialize rational spline flag
: x. |! M. x, c (set_tile "Degree" (itoa (cdr (assoc 71 elist))))0 l d: @" o. a
(setq bit70 (cdr (assoc 70 elist)))
& H; d( n, Q# x- g1 Q (if (= (logand bit70 1) 1)
8 T$ l# m/ s' n, q3 k (set_tile "SpProp4" "Closed")
( G; d0 z: X( m( y$ \/ N' m! o (set_tile "SpProp4" " ")1 t! j6 |4 Z: s, s
)
+ m) h5 F, b" e (if (= (logand bit70 2) 2)
& S7 ]: w" N( c- g- V (set_tile "SpProp3" "Periodic")
0 W" @* V' k; d# d (set_tile "SpProp3" "Non-Periodic")
- J( x7 J$ |6 S8 r8 o5 l ). v( r: D. F. O; d. w* a, r
(if (= (logand bit70 4) 4)9 t3 K- O6 A* _0 g/ W& d8 H+ Z
(progn/ @# y, J) {# S
(set_tile "SpProp2" "Rational")
* }' J& [9 s0 P (setq rational_spl_flag 1) ;; this is a rational spline
, U1 x3 @- _7 r1 B A )
& k9 C, H& P) V q. ~ (set_tile "SpProp2" "Non-Rational")
6 S: v% e8 a/ [8 H )2 d! z+ T; _" Y! O: o0 b
(if (= (logand bit70 8) 8)
( f, [" B8 n& y, e& \ A/ k! n: W; a (set_tile "SpProp1" "Planar")4 K6 E. g, `8 b" M P
(set_tile "SpProp1" "Non-Planar")* M' H C+ }4 `& {! p
)
8 f- ?) n9 r, R4 }: ]3 U6 G (if (= (logand bit70 16) 16) p( p& v" L3 C
(set_tile "SpProp5" "Linear")
7 ?. z( v0 H+ ~, I9 [: \7 e) C0 f (set_tile "SpProp5" " ")
9 S$ d$ {0 i+ h0 t4 a; ]4 n )4 @1 w: a: k/ Y1 P. J+ N& D
). `( o0 x X z6 I2 Y1 r' C, A
;;
& ~# T) G& i D* R ;; XYZ Point values for spline points5 A9 X- N0 I8 S, \+ }9 h
;; Need to account for WCS/UCS& c+ @3 d4 L) N% G2 u9 U
;;
! y) |$ K3 R7 f) l8 M2 S1 U* L' S (defun set_tile_cntl_pt ()
& Y7 a$ R: Z+ Y% }" `1 l# w (setq cntl-pt (cdr (assoc 10 elist)))
4 g% W Q p; H1 Z9 n0 \. R (set_tile "xtext" (rtos (setq x1 (car cntl-pt))))
1 _8 N$ A; w- m- s (set_tile "ytext" (rtos (setq y1 (cadr cntl-pt))))
! K+ H* o# ?% W0 f: S- H+ a! y (set_tile "ztext" (rtos (setq z1 (caddr cntl-pt))))1 D1 V f: d& s7 Q; j, j1 F0 Q, X
(if (= rational_spl_flag 1) ;; if rational spline, g' r! H" z8 V3 w
(progn ;; show weight
9 s/ W" n+ W. j/ @ M (setq weight (cdr (assoc 41 elist)))
) ^7 b" F. t, x. F$ u9 k; \0 F (set_tile "weight" (rtos weight))
& }: U' W% X% V% K5 ~" G# ` ) ;; else
+ X* @8 ~" h g& Y2 n' e7 z6 Q (mode_tile "weight_text" 1) ;; disable weight field
3 m% E( @$ n0 U8 E )
( { ~- r+ ^) b2 m )# y% v c. r3 A! c8 s
;;
. j. B' F+ k+ [/ D$ E/ s ;; XYZ Point values for spline points: o+ E. _! a% w9 L9 f7 P
;; Need to account for WCS/UCS! d5 p- m+ l7 U4 A" T
;;3 {! P1 ^' {" {; {4 ?
(defun set_tile_data_pt ()
! Z1 i( {1 g8 @, A, p (if (not (assoc 11 elist))8 B4 L4 w# H# d$ ^6 z& Q
(mode_tile "data_pts" 1)) I% t4 _# [) I7 o, w8 M D
(progn$ S, |! G$ ?! A1 u3 M( d
(setq data-pt (cdr (assoc 11 elist)))& e# m9 S/ z3 N+ C7 M/ [
;; display points with current precision.) A3 M+ I5 B! I
(set_tile "dxtext" (rtos (setq x1 (car data-pt))))
. Q: n+ g- o4 B6 G, S$ J& C& M0 b$ C (set_tile "dytext" (rtos (setq y1 (cadr data-pt))))
0 h- J+ M5 i. V- W (set_tile "dztext" (rtos (setq z1 (caddr data-pt))))2 ^; K7 [9 B, V$ _ c3 f' o* L9 z
)3 ?+ V6 `. I- C0 q2 @6 r E. G
); C; ]. ~8 {) ?" t" n: ~
)
6 n7 r, ` D0 b; U2 M ;;
# Z3 {8 q6 C7 ?$ W3 @' g/ h- v0 u ;; Fit curve, fit spline, or smooth spline surface setting
$ |" z3 j( E0 b1 E2 C$ ?- i. T7 { ;;
6 f; T% c( X" K, X( n (defun set_tile_fitsmooth ()+ j: M: k% ^, T" h! T8 U' _$ d
(cond4 c: p1 C& [( u
((= (cdr (assoc 0 elist)) "LWPOLYLINE")8 W8 a6 c* o: v. o; @
(set_tile "none" "1")& e' ~7 }& D M% q
)& R8 c: @$ L. a1 n' j7 \- n8 R" \
((= (logand bit70 4) 4)$ l D5 U2 ]6 c- D8 M
(cond# @5 Y0 k0 I0 P4 U
((= bit75 0)( Y2 ?0 \& o/ \5 o& V9 o
(set_tile "none" "1") y# m/ g/ f! W" Q6 ^' u
(setq spltype 0): ^6 G7 m0 J1 E) Z6 f
). |+ I7 ^# K& u9 U: M+ _/ V
((= bit75 5)) s8 b; m! _; n A
(set_tile "quad" "1")
' E7 }$ k6 o7 K {( }6 c (setq spltype 5)% N/ I }$ w- q) O
)
6 y- \+ x+ a. J) m. k ((= bit75 6)
) J9 ^1 t. H$ J, z' c (set_tile "cubic" "1")3 K" L* X) W7 z; `* S
(setq spltype 6)( L# l3 T" i9 }! P4 d3 b4 }
)
8 i% v W- a- B4 N% [# \; d ((= bit75 8)( H+ ]$ w) `6 W- J
(set_tile "bezier" "1")
( d9 F2 I+ h* d, o (setq spltype 8)7 b( d9 P; d) w) S% m
)
x! U0 x7 t+ m' p& X3 W )2 Z9 A3 W# `: a* ]5 F6 @ e% s
)8 x c- F; g4 @8 G% A, F W
((= (logand bit70 2) 2)
2 P {1 f) `% q0 O7 z (set_tile "fit" "1")* p# S# I. [; I+ }7 m
(setq spltype 1)
M4 Z! |# b$ J. ^6 `/ V2 O )4 e- e* b( n( d3 P' b% ]1 n
(T (set_tile "none" "1"))
! w. o) r3 a3 x" A) p$ n )& \( X% T h! Y' D' g' K2 p
)" P0 G+ H/ D0 P4 \# f5 R! R& F
;;9 g5 B: \8 @1 |0 X( L
;; Closed or Open mesh and polyline setting
8 z# ?, D" m" ^# n5 s5 m/ n ;;
1 D5 B, ~8 U% [1 t* a (defun set_tile_closed (), w; e2 O6 h9 e& X, U4 D, |2 L) i
(if (= pltype "3D mesh")
, Z9 p. h7 r5 |7 I5 t (progn
. ~1 Z1 M( g" ^9 |9 L- U% q4 G (if (= (logand bit70 32) 32)
& [ T; d: n; E2 ?0 B (set_tile "closedn" (setq closedn "1"))# [7 m7 f) ]1 j6 v4 \- S0 _' D
(set_tile "closedn" (setq closedn "0"))
. @9 I) M- C: m! s' {" t )
4 n3 q7 P% l" P: _ (if (= (logand bit70 1) 1)' f4 z( J. ]! i$ c
(set_tile "closedm" (setq closed "1"))
' W* m, ~$ C; o (set_tile "closedm" (setq closed "0"))
2 E, T: a5 F6 Y )6 N+ v, [- `: g" d0 p' j. U
(setq old-closedm closedm old-closedn closedn)
5 M' D4 ~! B1 ^) G! S& ~4 K )% p- Y' H4 { m9 h
)4 n. a3 b4 a& B+ k9 R+ J+ q/ I" F/ A
(if (or (= pltype "2D polyline")
9 w/ I3 s3 r4 m: s: P (= pltype "3D polyline")# a$ I3 [; q) z8 i" R/ O
)
) l% U; B, ^ Z5 m, K/ E (progn
0 x; @+ g: U. C) z8 e5 k (if (= (logand bit70 1) 1)4 Z! H0 Z7 L$ Y0 W
(set_tile "closed" (setq closed "1"))7 e j$ _/ L0 S7 @! O
(set_tile "closed" (setq closed "0"))! S4 d% g4 X0 B9 p j% x0 S
) ]9 @$ r& p) @# `- a. B
(setq old-closed closed)
3 p& n: w5 q! w/ ] )
# x) W D% u9 l0 V. [, [ )
8 u3 R4 f' b, P1 @$ [ )
+ C# k. x/ |3 {- ` C8 I" ] ;; Set common action tiles
8 c8 Q" e4 v c$ T( K( i ;;
6 [: f" I/ |! K6 \ ;; Defines action to be taken when pressing various widgets. It is called
0 X) L% Z# U' W; z/ S ;; for every object dialogue. Not all widgets exist for each object dialogue,
6 p* Y$ _" i! G, ^+ b ;; but defining an action for a non-existent widget does no harm.# V3 a; J/ V, n
(defun set_action_tiles ()
8 a: d* T$ y( a4 H (action_tile "cancel" "(dismiss_dialog 0)")
# v$ D1 q; K+ b# r! o (action_tile "accept" "(dismiss_dialog 1)")
6 y" A/ Y8 c( ~9 Q& c (action_tile "help" "(help \"\" help_entry)")
2 \3 X1 [; E6 D/ } A (action_tile "b_color" "(getcolor)")
8 R& b* L+ W7 T' c( b W) s" w+ h (action_tile "show_image" "(getcolor)")
* ^9 S( [: ~7 w (action_tile "b_name" "(setq elayer (getlayer))")
% s' a) S# s G( ?* r1 K (action_tile "b_line" "(setq eltype (getltype))")
7 e3 }6 z5 V _ (action_tile "eb_thickness" "(getthickness $value)")
: C2 t' R6 z R (action_tile "eb_ltscale" "(getltscale $value)")
" r0 d) Q! x5 a' [3 n
5 i7 ?/ j7 ^/ ]" l# K Z) N. ^/ r (action_tile "pick_1" "(dismiss_dialog 3)")2 t( N1 g) r7 E9 q; q( f1 G
(action_tile "pick_2" "(dismiss_dialog 4)")
) ~7 ?: S$ o: l& J5 a (action_tile "pick_3" "(dismiss_dialog 5)")6 \1 L' @, C8 x5 P- A9 g6 ]2 `
(action_tile "pick_4" "(dismiss_dialog 6)"), v) G2 \# k/ G" r& S
(action_tile "x1_pt" "(ver_x1 $value)") I1 |: W& p3 \7 s& P" u
(action_tile "y1_pt" "(ver_y1 $value)")% X" ^$ y1 `) R+ m- l1 Z
(action_tile "z1_pt" "(ver_z1 $value)")
" Z' D9 _: D. f# x3 d0 e (action_tile "x2_pt" "(ver_x2 $value)")+ G5 X" m" f3 {# t; @2 _
(action_tile "y2_pt" "(ver_y2 $value)")
. D4 f2 ^, s; E (action_tile "z2_pt" "(ver_z2 $value)")
/ L; E o8 v- \2 `7 S; r k) a; a (action_tile "x3_pt" "(ver_x3 $value)")
, t% ?$ D- q: }: D$ h) z9 C# p l (action_tile "y3_pt" "(ver_y3 $value)")
0 m4 a2 b: d0 ]8 j) h# `1 ~ (action_tile "z3_pt" "(ver_z3 $value)")) ?$ G+ ?5 Z! _& W1 P- A1 U# O
(action_tile "x4_pt" "(ver_x4 $value)")- ^" e j, O+ q! H
(action_tile "y4_pt" "(ver_y4 $value)")
1 e# \# o9 T$ n8 D* A (action_tile "z4_pt" "(ver_4 $value)")! M. O& j) \+ B; I% l* x
! J1 F3 m5 d9 i6 k* I" Y3 A* S
;; Action tiles for Xline & Ray
* D. j# S! K7 x4 L (action_tile "xline_x1" "(ver_xline_x1 $value)")) f. R% b0 s# B. B5 ?: V! \
(action_tile "xline_y1" "(ver_xline_y1 $value)")
- a. L: f0 a1 S: v! w% T5 Q5 y (action_tile "xline_z1" "(ver_xline_z1 $value)")
* x* c& s( P9 {* X9 U5 [- ^ (action_tile "xline_x2" "(ver_xline_x2 $value)"); Y+ C$ x/ a$ ]$ b0 ?8 p9 S7 w" U
(action_tile "xline_y2" "(ver_xline_y2 $value)")
8 h1 b1 y, |! U: \5 `( a, c (action_tile "xline_z2" "(ver_xline_z2 $value)")
- f# [5 M: ?' l8 `0 E* Y
. d. J6 {, e8 @ (action_tile "edge_1" "(setq edge1 $value)")8 t8 M1 ]5 j ~/ N4 e
(action_tile "edge_2" "(setq edge2 $value)")
; \4 H3 g A: x: Q# w; V: A& N (action_tile "edge_3" "(setq edge3 $value)")9 F/ T1 ?( `8 b& Y; Y* L
(action_tile "edge_4" "(setq edge4 $value)")7 U5 n9 K2 C! A0 z& m" @+ c& R
% n* u+ o/ a2 m' Q9 k
(action_tile "radius" "(ver_rad $value)")5 t! ^7 E4 I& D5 _7 Y
(action_tile "st_ang" "(ver_ang1 $value)")
4 q( o1 X, s1 w (action_tile "end_ang" "(ver_ang2 $value)")9 n8 i6 e" f! U8 f
(action_tile "end_eang" "(ver_eang $value)")
1 u9 T+ O( r# _ i" |8 }1 A% [" L (action_tile "minrad" "(ver_minrad $value)")
6 S: r3 [9 g | (action_tile "majrad" "(ver_majrad $value)")
1 O5 _# U( k& x( O
M* k1 L: V9 I5 x* `/ d, u/ t (action_tile "xscale" "(ver_xscl $value)")3 v' t) B8 E+ p- L( a" c7 H
(action_tile "yscale" "(ver_yscl $value)")
1 D# T6 H8 Y$ r. p (action_tile "zscale" "(ver_zscl $value)")
2 }8 I6 G$ D+ J6 }5 W. _0 h" B, }7 G (action_tile "rot" "(ver_rot $value)")
3 { D7 n; y6 ^! k (action_tile "columns" "(ver_col $value)")* e+ }% W2 d! a4 |9 q" Q
(action_tile "rows" "(ver_row $value)")7 }7 ]3 h' J6 ]1 O2 j- e, M
(action_tile "col_sp" "(ver_colsp $value)")
5 U; K4 o" k8 @4 \ (action_tile "row_sp" "(ver_rowsp $value)")' K! E- W q/ z+ x4 ]6 y: g
8 {- Y1 y2 e* ?+ N (action_tile "hght" "(ver_hght $value)")
# D! y; ~ Z' o. G (action_tile "wid" "(ver_wid $value)")1 J8 P. {0 C1 H. h# i1 u! ]0 ?
(action_tile "obl" "(ver_obl $value)")
) l! _! ]+ v( Z) K( c" R (action_tile "style" "(style_act $value)")
! I9 R' p3 S; _
/ V/ }9 j' W2 _: m2 _ (action_tile "t_string" "(ddgettext)")9 I/ x4 `) ~* l# s" g
(action_tile "tag" "(ver_tag)")
8 x0 O7 \ B( i: o. s (action_tile "prompt" "(ddgetprompt)")
: m i7 O0 X9 S! B/ u! |; U (action_tile "bkwd" "(setq bkwd (atoi $value))")
1 y) R" b2 o1 J; H (action_tile "upsd" "(setq upsd (atoi $value))")
9 \3 U) p! |$ R; @0 _ y5 p (action_tile "inv" "(setq inv (atoi $value))")$ u0 f3 S% o1 ? D5 R9 G
(action_tile "con" "(setq con (atoi $value))")
6 W5 R4 `+ u) h5 z% t2 W& w- L (action_tile "ver" "(setq vfy (atoi $value))")( Y3 b- o. h H* n5 g W" I
(action_tile "pre" "(setq pre (atoi $value))")6 I9 |) Y2 e) N/ o
(action_tile "popup_just" "(jlist_act $value)")
+ E% a2 _: P. S2 F1 d
O5 A# k0 X G/ x# g (action_tile "closed" "(setq closed $value)")1 M4 P; r! z# N8 g0 K- T4 ~
(action_tile "ltgen" "(setq ltgen $value)")
^& H! H9 g7 f4 X (action_tile "closedm" "(setq closedm $value)")
4 b4 C, p9 _! Z! X9 v! Z (action_tile "closedn" "(setq closedn $value)")+ {9 g6 Y$ N$ Z
(action_tile "next_v" "(next_vertex)"): ~! t+ Q' D' ?6 b6 Y& f
(action_tile "xcliponoff" "(setq xcliponoff $value)"); P4 c+ M! T2 m8 @- k
# K. F- C: q- ` _* L (action_tile "next_cntlpt" "(next_cntl_pt)"). F( u( H9 B* z) v& {; s
(action_tile "next_datapt" "(next_data_pt)")2 f( `9 @" x% ] r, ]; _% U/ s* H
4 @: N2 B! U; o; p1 s
(action_tile "none" "(if (radio_gaga \"none\")(set_uv 0))")
: U# [) |2 o$ r. Q- O- C& J (action_tile "fit" "(if (radio_gaga \"fit\")(set_uv 1))")* F% W; D q6 v
(action_tile "quad" "(if (radio_gaga \"quad\")(set_uv 5))")9 A' a; O. Y) s( W" c1 y6 n4 w
(action_tile "cubic" "(if (radio_gaga \"cubic\")(set_uv 6))")4 x5 R" o. ?3 `3 ^
(action_tile "bezier" "(if (radio_gaga \"bezier\")(set_uv 8))")% B) x0 E+ V3 y% |, ]: y8 P
% Y2 b) Y% o9 ]4 {5 T- `
(action_tile "u" "(ver_u $value)")
1 g6 y( n! y; I (action_tile "v" "(ver_v $value)")- a$ \2 N- Q( M3 r
)
" z0 n5 \4 l, y9 o
$ k" W* e* n1 |1 u. m8 U (defun ddgettext()
\) b6 E$ j% H5 o- P- s! V0 D4 R* u (setq text (get_tile "t_string"))
* Z8 t ~1 k5 }0 v0 M8 m )
! {" |3 ?* a& D$ G% T% U8 U
o" a2 E, _- G2 J1 Y, b% }& N) [ (defun ddgetprompt()
% x" s5 S R# l% }4 V, Y (setq atprompt (get_tile "prompt"))) Z! ^' X& v/ P: A$ [
) f6 S( Q% \& x3 s8 f
5 p, J" f5 z4 _2 t/ R8 u# b ;; As OW doesn't support disabling of individual radio buttons within
6 O- j2 B; P i- s V8 M ;; clusters, a check must be performed as to the legitimacy of the; K6 B- G W k8 J
;; button pushed and reset if necessary.
8 G: E" \0 Z) c E7 M (defun radio_gaga (pushed)
" K. Z; }. _* v, ^) H3 z (cond5 h0 _( R) R" ]/ G& d5 [3 ?
((and (= pltype "3D polyline")9 l! R0 O. V3 E d- I
(or (= pushed "fit")
& T" Z( S3 ~& X: Z! k (= pushed "bezier")
9 |( m' @; B) Y- L* Z ). y, X) G2 ?7 ~+ |7 l% p+ p, W
)' G2 k k& q9 n
(set_tile "none" "1")# l+ t- z7 a h; |. p
nil
3 {- p. h p+ }6 E( I )
$ {- B( g6 g) h# ^5 s ((and (= pltype "3D mesh")
( J' K. B) r: B; ?, e$ I1 V (= "fit" pushed)
& g7 I1 z S, D {8 q )9 Y6 o. M( \- X/ S2 e
(set_tile "none" "1")' C0 ?. X q5 N, I; W) W1 o
nil% M1 T4 o8 q; C: J b" y* h/ `
)
( j0 S! r# z, t/ j# [" _6 G ((= pltype "Polyface mesh")+ `! Z8 @5 _ |3 `5 e2 L# |
(set_tile "none" "1")
# [2 I8 {# i; B% V0 q' r! }% O nil) ?0 A1 @. L3 m2 g
)
+ I' Z% P) W+ i/ q8 o8 Q; c ((and (= pltype "2D polyline")" [% `4 ]* Q6 l+ U) M1 [( {
(= "bezier" pushed)
3 ~' a2 h4 J6 y* b2 |, f )
: A- s' R0 V t$ s' e! m (set_tile "none" "1")
! T% z! v: _5 ~3 \$ O3 | nil9 a" Y( q, s$ _
)
4 y( G; {% {8 O6 z7 P0 M (T)
3 n, b: G. f, Q0 {- R )5 ]6 y* P% N. A
)) E1 T% e$ W. x- K
;;; Q; _8 g( H4 V# a7 A
(defun set_uv (type_n)5 \7 t6 b# `. m8 [
(setq spltype type_n)! f# g: Y- m/ W4 c# e- r
(if (= pltype "3D mesh")
' v3 S) f. F) B3 o- X (if (= spltype 0)
$ L( B. U# K% Z" I# }& D% r (progn
7 c3 X H2 t& D4 a/ ^' ? (set_tile "u" (itoa (setq u 0)))
( S( A) J5 i4 n9 g. c( h- Z0 I+ X (set_tile "v" (itoa (setq v 0)))
7 R3 r1 u f* I8 u )0 x U. r$ `3 f4 m7 Q
(progn$ |* g4 _' d. ^/ }" g
(if (= u 0)
( n. [; G! j4 W [5 S0 { (set_tile "u" (itoa (setq u (getvar "surfu"))))
6 Q' |8 a) q8 {9 h: J9 a )7 X) {" d7 `) f# O& q; z: @; k. z
(if (= v 0). Y |% Q! R9 C' U5 Z" t |* E
(set_tile "v" (itoa (setq v (getvar "surfv"))))6 o( R3 _+ [) _7 i$ o# `
)
6 ~, S: V0 ~2 w2 [+ _& q& N )
8 g+ b% F- ~/ e+ L; X: m )
! ]0 S9 b/ |' ^9 J" Z& i; J- c5 J4 U )5 u. [8 _+ Z! v0 j
)
4 h' K% v8 e1 E+ V% x5 y) R: b0 K
9 W9 H* y b, ]' [
* s# }) a' _' k& I q ;;
+ i" I; P+ P+ T4 Q4 ~+ n' ] ;; Verification functions
' t* L: D& D1 L7 W" c$ m ;;
3 H; F# j8 n! ?7 Q$ W0 C ;; Verify distance function. This takes a new X, Y, or Z coordinate or& P o$ e! U- C/ i& t
;; distance value, the tile name, and the previous value as arguments.
2 b) F7 m4 D; R1 S6 C- u2 | ;; If the distance is valid, it returns the distance and resets the tile.' s. T7 \# @: R, \$ } o( T
;; Otherwise, it returns the previous value, sets the error tile and keeps
Y6 `- C9 M9 Y: I9 }2 q( I+ J0 X% A ;; focus on the tile. Shifting focus to the tile with invalid value can
9 t3 s; O" V4 B ;; trigger a callback from another tile whose value is valid. In order
/ Y; B% w; s8 Q) h: X ;; to keep the error message from being cleared by this secondary callback,
" {, o/ g" y% Z/ j# C8 c$ l ;; the variable errchk is set and checked. The last-tile variable is set
& V9 i+ A8 k# G* U ;; and checked to ensure the error message is properly cleared when the) B; G% e/ l2 ?( J4 N
;; user corrects the value and hits return.
" s8 y7 A8 ?- r2 k( m. C9 H ;;' e: g. C3 o1 z+ g- W6 {* e
(defun verify_d (tile value old-value / coord valid errmsg)
) K# k0 |6 {9 n7 e5 C0 B8 Z4 W9 X1 ] (setq valid nil errmsg "Invalid input value.")
x4 m! [( g+ ~& [% b (if (setq coord (distof value))
F9 ^# N1 M. Z- \+ k: Y (progn
0 B5 q! ?5 J- L (cond
- {( r& v& w% ?" s+ r ((or (= tile "radius")3 N/ \, [' O" o7 t' s2 Z' W$ d
(= tile "hght")3 ^; E- m4 [8 w. W! O/ h$ Q
(= tile "wid")( t4 g' i, b ~. P; n) A) U& A
(= tile "majrad")
# H& d& g' V C7 v (= tile "minrad")
9 H8 x' R5 E+ ~5 l (= tile "eb_ltscale")2 W6 S8 B9 I/ H8 u% S
)+ V: G/ E+ D3 Z0 }6 o
(if (> coord 0)
8 `' H8 W; [; m- b (setq valid T)% H) j( a$ Z$ }' |$ u2 i. |
(setq errmsg "Value must be positive and nonzero.")
$ W! I* H. B7 B; c& T0 V! D )8 Q/ h& i4 X- D) w! m d. r" x
)
9 m7 l' L) S. l" Z7 i% F# S- N8 w ((or (= tile "xscale")
# m! m* z, j0 U2 Y- e9 H (= tile "yscale")
5 I4 W( c V( j- S" K8 ]& t. b, W# N/ q (= tile "zscale")
- s/ ~/ e4 @* q. j. Z )- l# R$ ^. z1 ~" p' b$ z7 U
(if (/= coord 0)0 a# l1 Q: ]. s6 _% ]. S" U& [" `
(setq valid T)* m B* v- U7 R ?3 P. L( Y k L0 S
(setq errmsg "Value must be nonzero.")0 n" v+ A" n; o o' V4 e4 {; n" S
)5 |' T& f, { J
): G( N+ V( d% }6 T1 B, R+ V4 }$ j' J
(T (setq valid T))
) N l/ E) i7 u- @( a )
" _9 L2 q& l+ D* C) ^, v )
4 {5 N1 ], [) k% E" d$ ] (setq valid nil): @$ ]7 G a/ ^0 ?3 R; H
)' u- S. z; ]; u: F' u" R
(if valid5 y: q1 F) @2 N* t7 c' q4 F5 @% y
(progn, I. H/ C! H2 }* O. c- R
(if (or (= errchk 0) (= tile last-tile))3 E& V; C* Y. R5 H- a
(set_tile "error" "")2 G' D* X: F& o4 a6 `3 F+ G" P
)
3 U! C y! C3 \3 Z) Q! q: L- K# w (set_tile tile (ai_rtos coord))
" ^2 L: F ]1 D0 @& ~& b (setq errchk 0)( E' k4 p9 g! K. ]: L5 S6 `7 p
(setq last-tile tile)& @9 T( [# v8 x+ L# T. O3 V
coord
8 E$ t W$ F; u/ F6 u )
4 l9 [3 w l* _) | (progn T- \5 l3 H4 O$ o, N& z! l: Y& }
(mode_tile tile 2) ; Move focus to offending field
( K7 w7 w8 e' ~( o; o2 n (mode_tile tile 3) ; Select offending text
. e5 w5 m9 B+ b- G! E (set_tile "error" errmsg)
9 K) ?9 m; a3 b3 ]: | (setq errchk 1)& y+ N A B/ q9 z3 N: j
(setq last-tile tile)6 l( v; X R7 n3 j
old-value
! T( |7 K/ ]% k- A; K" h( O( T9 u% n. J' ^ )
) {1 F/ _8 R- Q# q3 Y+ K. T )/ w9 J' ^/ N3 H* p5 J3 x. T
)
* Z% c4 c# p% S ;; Function for Xline coord edit box checking.3 T. W' ~/ \. [+ w& w! l N
(defun verify_xline (tile value old-value / coord valid errmsg)
, G. h" _0 z4 @& T7 W& Q( e k (setq valid nil errmsg "Invalid input value.")2 h U# U5 W7 z8 e0 h& f- |
(if (setq coord (distof value))
: _. Q( T: J% g6 q/ r o (setq valid T)
% C* f0 z* l. a" u, p" L (setq valid nil)
& d7 w2 @/ i5 ] )
7 W* \# p. ?5 c5 P, `, A$ [0 [ (if (and coord8 N3 p3 s7 L, \
(and (= (atof (get_tile "xline_x1")) (atof (get_tile "xline_x2")) )9 U2 ~5 `- Q) N# d: A- O( M
(= (atof (get_tile "xline_y1")) (atof (get_tile "xline_y2")) )9 o) w0 J' n9 z
(= (atof (get_tile "xline_z1")) (atof (get_tile "xline_z2")) )
8 ^) |% S9 \4 _* ?. u7 C )
2 e$ d; Y$ O0 H3 o0 {$ t )
* B% M ^4 o* T, b (progn
# c3 ?, l* ~% d% m7 v; { (setq errmsg
8 Q( ]: R2 f9 T4 Q) R) L+ H. ~8 { "The Root point and the Second point cannot be equal.")
b1 O3 A8 @2 E (setq valid nil)7 c7 k! e$ Q; f3 h% g3 K
)% l: Q8 b5 L/ `9 m
)* H. `0 Z" @/ s" Z9 h
(if valid
: q3 n8 V7 S8 n9 T F1 L (progn6 w) Y2 U2 u" ?* G! `: H" w- m
(if (or (= errchk 0) (= tile last-tile))
, E; x* l7 e: [ (set_tile "error" "")
1 n9 |* @9 B3 h# d1 S2 i% l$ K )- S; ?1 C4 D1 L! u+ {5 h6 p, p
(set_tile tile (ai_rtos coord))) y3 L$ I$ b1 x# `
(setq errchk 0)' P/ s; L6 j( t7 L# ^( [
(setq last-tile tile)
- t" {. Y& |) \" x2 F coord) W: \) N" G+ G/ i6 y) i
)$ c" Q9 u& T- }: }. F
(progn5 p6 @$ O: }3 }) t
(mode_tile tile 2) ; Move focus to offending field
) U# ]3 }) j$ X: \( a9 l (mode_tile tile 3) ; Select offending text
1 W8 e- x# q6 i0 U& o (set_tile "error" errmsg)( S4 X: q! w* o7 V" q: z" t ~9 J# l
(setq errchk 1)+ v) X/ N4 M( T) ^
(setq last-tile tile)
4 n) r. [4 H: G% J& H6 f. _ old-value
+ b# I. [' V6 G" O )
# ?; { e! Z$ U2 _4 w+ c )
3 u) m. r$ K& V2 ] )0 U/ Q8 m& R) y' m9 S9 H
* V6 U3 t7 k8 ~8 X" C% {0 Y ;;
* R' A6 ^' ]5 K' u9 i ;; Verify angle function. This takes an angle and a tile name as arguments.6 }. w& t( {# |. Q
;; If the angle is valid, it returns the angle and resets the tile.& s5 f0 t7 v/ f
;; Otherwise, it sets the error tile and keeps focus on the tile.
! [) C+ k; T% y5 z2 O- C ;;" S; W s; q5 T! a5 W- {/ R
(defun verify_a (tile value old-value / ang valid errmsg oblqmax)
5 R7 Z) p4 F4 W* N# K! n (setq valid nil
- J" `2 b2 N+ z) l% a9 t0 } errmsg "Illegal input value."
: k( `2 w" P8 [) W! _9 ]/ q% r8 V) J )5 x$ Z2 x$ @- s7 Y, L: ~0 \) D* W
(if (setq ang (angtof value))
$ ^- G3 @3 R; v& F (cond" P% \ r* Y0 A+ Q" C9 H% t8 ?. m
((= tile "obl") ; Restrict obliquing angle
' r9 i$ q1 n5 M (setq oblqmax (+ (* (/ PI 2.0) (/ 85.0 90.0)) 0.000001)). k" m* V: w$ ]- O* D$ J% z- G
(if (or (<= ang oblqmax)
4 N" @, j. k# b& G! m (>= ang (- (* 2.0 PI) oblqmax))
( ^ ^: I* L5 R* w )* N! n4 ~9 T' R- w. w# `# X3 T
(setq valid T)
: f! Y7 u: x$ w3 x P' _ (setq errmsg% s& a& k; x; D2 ^: F
"Value must be between -85 and +85 degrees.")
1 ?6 {6 g% U2 [ )( ~, c4 I- D- t: P
)0 s$ s; |1 E3 }5 F, |
(T (setq valid T)) ; Other angles not restricted. r4 }0 v B% u N* K5 @+ ?; k
)# x6 Y% i0 f3 W; A
(setq valid nil) ; Invalid angle input
# d# A9 m6 z( c9 H1 ?7 d )) u2 B9 G$ Y/ _) q
(if valid
0 ?; g9 P4 U, ?2 m! C+ F (progn3 X3 w$ _& ?& G+ `
(if (or (= errchk 0) (= tile last-tile))
0 w5 ]* x- j8 s$ I4 c (set_tile "error" "")6 t, \1 m( @9 I. y1 ^2 V; G$ d1 X+ X
)
) B* I, i5 G$ F+ \7 _ I6 t (set_tile tile (ai_angtos ang))
0 p+ k) \3 {2 E. A (setq errchk 0)
2 M$ d$ D, ^9 q: ]5 @4 ~4 W (setq last-tile tile)! p" B5 }% V+ M/ Z# E# b
ang$ |8 H9 G% E) F5 b) Z3 ~
)
' _0 Z+ I" {$ l" U (progn
* D1 a1 Q. Z7 s (mode_tile tile 2) ; Move focus to offending field ~6 |4 _ Y! M1 e& b8 u
(mode_tile tile 3) ; Select offending text0 j+ q+ [# l! e: B$ [0 U* Q2 f% [
(setq last-tile tile)2 A7 N* B( I; u2 r, }2 v
(setq errchk 1)5 `1 L+ d# q Q9 I4 f
(set_tile "error" errmsg)
8 l3 k2 G' u( }2 |- |5 d# d old-value
! p1 l0 v' {5 a1 D, s. q8 I& [6 C )
6 N! |* p6 W9 o& |" f, U$ u )
/ P2 f$ X% Y& m6 k m )
2 O8 p9 ], l5 E! \3 M! Y ;;0 {: S2 G$ O! ?: [" h
;; Verify angle function. This takes an angle and a tile name as arguments.
% |' J) Z0 j: K! }1 x ;; If the angle is valid, it returns the angle and resets the tile. p5 _1 L2 M2 S, ^7 J1 [ W
;; Otherwise, it sets the error tile and keeps focus on the tile.7 Y4 V7 V- {' u& A
;; This function is specifically for the end angle of the ellipse object. If' h* M& L% z& N( n; Y' w
;; the end angle resolves to zero then we want to display it as 360.
8 j- u2 c! O' N4 X& M0 N2 { ;;
8 W7 O( S% [1 ~$ N/ M4 B (defun verify_ae (tile value old-value / ang tempend)1 c" U4 u$ l. U% Q6 e- r
(if (setq ang (angtof value))) u7 r9 E. _' @; d9 s' L+ m
(progn) P! @# d7 i3 P; ] J
(if (or (= errchk 0) (= tile last-tile))& E3 b8 j/ \8 G' |+ y, K! l+ V4 b
(set_tile "error" "")
5 ^: l3 D6 ?/ U1 Y6 F- @2 B3 H )) V, O r# K# F+ D6 I
(setq tempend (ai_angtos ang))
8 j* v- @+ H& l* i( \% a- E7 F8 |- r (if (= tempend "0")+ O g( m, K$ L4 x V) R( n6 f
(set_tile tile "360")
- h: J: M& _3 S# t ]3 A4 ~2 s- F+ F (set_tile tile tempend)
9 |8 l4 J8 P8 E! Y( f )
3 {4 c' C% j3 S+ R( Z( Z (setq errchk 0)& U' ^# L9 E/ O0 Q( u4 H" b+ c8 J6 s
(setq last-tile tile)
! Q. J. v3 i) V+ ^% l4 J/ Q ang, |" Q$ z7 l; L- h- c0 v
)
, Y2 W6 X) |2 Y& s5 W. G) ]# O (progn( A: \1 Z7 X" B. Z% L" o- P1 ^
(mode_tile tile 2) ; Move focus to offending field+ x' U+ U2 m: \, {, s
(mode_tile tile 3) ; Select offending text8 s3 J" d( T6 i1 V
(setq last-tile tile)
8 m8 h- w$ L: Z. v; b0 ~% Z (setq errchk 1)
. K |" a" v- L( A6 z4 P" z (set_tile "error" "Illegal input value.")
8 J0 {! T: b6 n7 G+ W old-value# i, f3 q, D2 Z: E
)- E. t( f( [2 _% q, x' G
)" \$ W1 x' `4 w4 \7 ~4 q( e6 {
)
+ C- z- P9 ?4 w; C: ~' Y ;;
& m P* R* H0 T# ?' A, n* y ;; Verify integer function. This takes an integer and a tile name as8 W, ?8 H3 i3 ^5 B/ M( p: u
;; arguments. If the integer is valid, it returns the integer and resets the
( K: C& y4 e: I7 U9 a6 o ;; tile. Otherwise, it sets the error tile and keeps focus on the tile.
+ K" K4 a( |: I, u# Y- C9 D1 d ;;* j+ o4 V- Z! V2 A2 _
(defun verify_i (tile value old-value / int valid errmsg)
" S! i: q9 E! n+ f' B3 p (setq valid nil)
2 V- j% j6 D6 M& L% e/ o! V8 p% [( f (setq errmsg "Value must be an integer.")
" A. Z( L" c# O. k9 Z8 L* F (setq int (atoi value))
4 H6 _8 B8 @3 [, L (if (setq intchk (distof value))
4 @. a! {' P+ ~& I7 R2 ^ (cond
/ a1 I! K. k! K ((or (= tile "columns") (= tile "rows"))
7 S8 i" `; ], c& Y1 i (if (and (= int intchk): @! r V' i2 |
(>= int 0)7 e# [$ [8 u$ _+ O
(<= int 32767)
3 j: P* L0 ?: f# d, u( h1 e$ N. o )
6 L; O3 U) ~+ x, J" E5 U (setq valid T)
6 @: O& D0 E" y (setq errmsg "Value must be an integer between 0 and 32767.")+ w8 n! B3 @4 k6 H( y0 d3 D
)
2 @- [ i. B0 _9 D3 X. H )! P) E5 ^! [; }' M7 L! {
((and (or (= tile "u") (= tile "v")))( d0 D9 o- q$ h: x
(if (and (= int intchk)
& C/ a" ^' W2 q, K) H# q3 `5 [ (>= int 0)
9 B$ F) z! G% \& C5 j" H* c9 } (< int 201)
0 k* M' H E) L& ~% u5 q ) k8 w1 i; f$ w* J
(setq valid T)& h9 `5 g* H7 _
(setq errmsg "Value must be an integer between 0 and 200.")
; O% e; Q" l$ B6 f, }4 N )- j/ Y! u% r( C9 p
)" Q; U( x. v* u8 B3 z8 i
)
/ |% M# |. K8 Z5 @5 w0 d: f )1 l2 j% n3 v- X/ @. n' [" |* N
(if valid
% ~9 S1 K3 n0 e1 K; a (progn7 n! \' r, j& M E6 e# Z7 O- C+ `
(if (or (= errchk 0) (= tile last-tile))
- d% @, @5 P9 X, P' n/ l1 ] (set_tile "error" "")$ O2 x4 ^$ t. h9 y6 i7 j& }8 u- K
): m# M( E; |+ f; c; z, O
(set_tile tile (itoa int))* c2 i9 s( U l3 B7 w
(setq errchk 0)
3 O0 m, g% n( Q6 ^" | (setq last-tile tile)
5 p7 N& @9 I; l6 m int' d! Z* ^6 s" Q; c( _
)5 f& E1 @# A( D# ]
(progn. e' M3 m4 ~; j3 M
(mode_tile tile 2) ; Move focus to offending field
9 ^9 w# o0 A F. r! y6 N (mode_tile tile 3) ; Select offending text
. @3 x# F0 |: i: d0 z (set_tile "error" errmsg)
$ _" H. r, s7 C5 _3 S (setq errchk 1)
m) a' ^5 e5 k( U (setq last-tile tile)# ~9 T2 a% |7 E9 ~) j
old-value
! W* y5 ^7 `2 e! U* { )
" v8 A' T( [! r# e1 S )
' [/ V/ e9 w& i& {+ j )
* A8 e1 W2 E; _3 u4 y# r ;;: {) T% ^0 X) `/ {
;; Functions that verify tile values for integers
. e2 L" Y+ q3 S2 n3 U ;;0 N% U% _" o% w5 o/ W' ?
(defun ver_col (value)
8 w/ T6 M' J* u7 a2 e& Y (setq columns (verify_i "columns" value columns))8 W! G7 g6 |' \! U7 w( X3 |( v3 X: m
)& J4 [. {. a: O* d$ Y; Y
(defun ver_row (value)
' W" {2 a: L( Z6 T (setq rows (verify_i "rows" value rows))
- S9 E/ j/ _! T7 [7 e8 g: S, h )
& Y* o7 \8 M1 M, D( y- C (defun ver_u (value)7 `" `' ~7 ~/ ]/ w& c8 n8 g' M
(setq u (verify_i "u" value u))
: V3 Y' m( } J; ~5 G/ n )( w# a8 T+ D2 v: R" X% r/ m/ Q
(defun ver_v (value)
7 J. P6 b9 [# i5 V1 C) p (setq v (verify_i "v" value v))$ i: a8 z7 d, }2 U; b
)
7 ?$ q" Y' a& | ;;
8 w! Q8 D/ O- A* e9 d3 z% H ;; Functions that verify tile values for reals
& H5 m/ g6 M3 {, p+ H% X5 d ;;6 C6 R5 W( G( X3 v0 F6 C
(defun ver_x1 (value)
0 f6 V g) D4 C. T2 j (if (setq x1 (verify_d "x1_pt" value x1)) (calc))4 z- ~0 j+ S+ H% n( R8 c( ~
)% n) o! L5 y" r! r7 g3 Z8 L! l# m
(defun ver_y1 (value)5 n4 H7 n% A, |! V
(if (setq y1 (verify_d "y1_pt" value y1)) (calc))7 l& m$ ?; w3 n3 u
)$ z7 L5 a! k8 b7 U( ~# O, l4 C
(defun ver_z1 (value)
5 o! v# p; ]6 c, l8 R$ S (if (setq z1 (verify_d "z1_pt" value z1)) (calc))* W4 G' |, Q3 |% w% w1 a
)
* I2 g" k# R. Y7 Z# k' X) t+ t1 P (defun ver_x2 (value)( M# `5 s% L% Z- G% l+ l
(if (setq x2 (verify_d "x2_pt" value x2)) (calc)). H6 y; O" d4 ?! b
)
! d: t# c* ^. w6 |' ? ]& R& [ (defun ver_y2 (value)
8 f1 J* Y# O4 t- N( N8 n (if (setq y2 (verify_d "y2_pt" value y2)) (calc))) I8 m4 F( f# O& T
)* n: v% `1 Y) \, Y4 v, S0 \
(defun ver_z2 (value)( T# j% ^/ l& I3 B% e, [
(if (setq z2 (verify_d "z2_pt" value z2)) (calc))
" r9 R$ s: X6 u- q: F. L )
4 o3 y! @5 u2 C7 c (defun ver_x3 (value)
0 P, b9 A3 T( x6 \' ~ (setq x3 (verify_d "x3_pt" value x3))! v+ ^9 m* v7 F7 ^. j
)
3 P! C3 _; R" o' y (defun ver_y3 (value)
2 B& |- ^0 @. \8 k2 y (setq y3 (verify_d "y3_pt" value y3))
& m+ B( O- F# l; H6 T5 p% R )
N# C$ F/ @2 L- J) L u1 X (defun ver_z3 (value)
' m8 ~: m: |, u. U8 O/ Y# C1 j (setq z3 (verify_d "z3_pt" value z3))* K. r9 v7 n( l9 E/ _7 v7 C( j; ~2 R0 }! S
)
2 K0 H- q/ l# t/ V (defun ver_x4 (value)
. D1 m) n0 ^0 u( t2 S- S# B (setq x4 (verify_d "x4_pt" value x4))
- W# g( l- b5 h) ? )6 c" g$ l! O7 z+ _5 a: Q
(defun ver_y4 (value)
( O" U6 M: z7 b: s2 Z (setq y4 (verify_d "y4_pt" value y4))6 [2 q* g" X+ `: y4 M6 b4 Z" w
)
1 \5 R4 m8 @" z3 T (defun ver_4 (value)
. P8 X& o1 o/ n: T0 w1 O (setq z4 (verify_d "z4_pt" value z4))
% Y3 [% }9 ~; v: j4 S$ |, T' C )
3 g; T! j6 L( I0 N; l0 f2 u7 {+ w! H (defun ver_xscl (value)$ k$ s, Y' T" q0 O
(setq xscale (verify_d "xscale" value xscale))2 r2 T' i8 a8 p& @ r, H- W; w
)
# \" ~- C! E- D$ m (defun ver_yscl (value)
% d Z: s% E, `+ z" Z$ e6 [ (setq yscale (verify_d "yscale" value yscale))
! }4 ?# w( w% S )
' Q0 B m, _" g5 n: O. R/ G9 v (defun ver_zscl (value)& d+ Z2 V" _$ I1 ]/ w$ z
(setq zscale (verify_d "zscale" value zscale))! Y! H3 E3 N, F' [0 p
)' P6 a; w% p7 [* F& S; b! {
(defun ver_colsp (value)1 x% r9 x. {- [; {; x" D+ F
(setq col-sp (verify_d "col_sp" value col-sp))+ H7 c$ n# v& s# V- B5 B6 @
)
( R) E6 G1 s" n (defun ver_rowsp (value)* g7 c( R% y1 y' Q* H' N
(setq row-sp (verify_d "row_sp" value row-sp))
5 l: Q9 C5 q. L' H+ B6 c )
0 m4 D5 @% q" \: }: A7 A: _- T (defun xclip ()7 z8 b8 ]' O+ b) W5 G" I( d
(setq xclipmode t)
- w; r4 U7 J! \* \* N" V2 Z (if (= xcliponoff "1")3 ~# y, }( e+ m" I3 l
(command "_.xclip" (cdr(assoc -1 elist)) "" "_on")8 [" N# J1 Z* P
(command "_.xclip" (cdr(assoc -1 elist)) "" "_off")4 K/ v. S( D1 [' N4 L6 V
)% x2 h7 l. n- t4 B' |. Z
)+ Y* U1 o1 Z/ F0 @$ k5 Q
(defun ver_rad (value)
" A6 c1 m* r8 G& x0 p (if (setq radius (verify_d "radius" value radius))# P; R& X+ ]7 a
(calc)
3 M3 a. U* z) X% P0 u* z2 d )
1 Z4 R. a, l1 @8 v )2 p3 K& K3 J, L% `/ G1 a E5 N
(defun ver_majrad (value)
. ]! Q8 A% U& K& n (if (setq majrad (verify_d "majrad" value majrad))
& {+ m9 _4 N9 W2 n: T (ell_calc_newval "majrad")
9 s& d' P; s' t/ o( g% ^ )
5 r! h$ G* {* v* d )
3 l2 f3 n1 N2 H$ Y (defun ver_minrad (value)
* t8 U6 r# O) G( L: \0 j+ X: W* b( f (if (setq minrad (verify_d "minrad" value minrad))
4 @+ h3 _8 _+ I1 A, {9 ~+ n (ell_calc_newval "minrad")* j7 {5 ^ e/ R9 {3 j/ b
)- p! x0 m, C: [ b
)
! j% V9 b% A) g2 N/ Z (defun ver_hght (value)
4 u9 D1 o! j" S! e/ b( G; k (setq hght (verify_d "hght" value hght))' C) I. n. u4 a4 E. u
)* n9 Q& m* ]( D
(defun ver_wid (value)
" l1 b4 L$ k) R9 E, M; Y% X (setq wid (verify_d "wid" value wid))/ o+ K/ U6 [8 N. h1 |
)
7 u0 N4 C& D9 g. Q: D# { (defun ver_xline_x1 (value / temp)
* N1 F) i( y+ @ (setq temp xline_x1)
1 j" \) O. b% h2 i9 y (setq xline_x1 (verify_xline "xline_x1" value xline_x1))
- q1 j* @/ P' E( @5 g' K- c- P( J (if (/= temp xline_x1)' B" b* ]! j9 `% r* t
(progn (modify_xline 0) (set_tile_dirv) )
& S8 B p/ ]4 W( ` )" E- n9 L* } N/ N, z
)) g, A: h! O5 w" C; n1 C' ~
(defun ver_xline_y1 (value / temp)* L* K5 I" ]. E. z
(setq temp xline_y1)
& e# X0 Z$ h8 L4 Q5 f (setq xline_y1 (verify_xline "xline_y1" value xline_y1)): e+ T$ n. n3 w8 o z- _" N2 R" U4 T
(if (/= temp xline_y1)
3 a2 y( K& F* a (progn (modify_xline 0) (set_tile_dirv) )5 L. m+ }7 {4 z! t7 Q7 Z- Q
); m; c, V7 V9 t# C3 r
)/ ^" s, Q5 J& e4 K6 l! }
(defun ver_xline_z1 (value / temp)' B# S3 W6 O$ K# v3 h0 q
(setq temp xline_z1)
5 [7 q/ H# \3 z( g' H& U$ Q' q (setq xline_z1 (verify_xline "xline_z1" value xline_z1))
3 x, @; ^: v- o3 p3 `2 Z8 s$ @( t (if (/= temp xline_z1)
8 h, L4 h1 z: y; H- M (progn (modify_xline 0) (set_tile_dirv) )
$ W4 m" W0 [4 l' g+ q )
. r. M$ ^1 p! e# f+ Z! u% x )
0 W5 r- v) q5 N- x7 T: s (defun ver_xline_x2 (value / temp)
4 m& v" b, ~# _! J* l (setq temp xline_x2)
; V- G+ E% q- { (setq xline_x2 (verify_xline "xline_x2" value xline_x2))" T8 C' Q2 j6 V/ _' b! {- T1 O% k
(if (/= temp xline_x2)
- x2 l; I4 Z$ @ (progn (modify_xline 0) (set_tile_dirv))* p" w$ l- l, w0 a% m
)9 G. M2 G3 N' Q# {1 a
)
0 y% @/ m$ o3 m8 o. a& R (defun ver_xline_y2 (value / temp)
( y }- e6 g* h (setq temp xline_y2)
( x4 Y5 J3 l0 B (setq xline_y2 (verify_xline "xline_y2" value xline_y2))
3 S0 K; ?9 f( |: B) r! C (if (/= temp xline_y2)
! X6 Z# k4 j3 C+ k" S (progn (modify_xline 0) (set_tile_dirv) )8 ^( W3 H- \; q6 U) a) e- `
)
7 }) K, Z) U/ a4 \$ _2 I$ I )- _1 l, V3 r# N* E" H
(defun ver_xline_z2 (value / temp)% \0 I/ W! x1 d
(setq temp xline_z2)
$ J/ U6 z" D, g& t+ B (setq xline_z2 (verify_xline "xline_z2" value xline_z2))
, h* O( B4 |4 U" I |4 `8 a (if (/= temp xline_z2)! S3 _+ Z0 x# B' s( @
(progn (modify_xline 0) (set_tile_dirv) )& D! v+ `* f4 Z: h3 A6 j
)3 W" L' W/ ~! u, d
)- w" _* r9 |. ^
;;0 i- W+ a9 T z. Q1 A; |
;; Functions that verify tile values for angles/ i# T/ K% w6 [3 R3 A
;;
' E4 |* E* @" @, \! d8 z (defun ver_ang1 (value)
1 S) `1 D* L. k0 Z' s' F% b (if (setq st_ang (verify_a "st_ang" value st_ang))
0 u# @) l2 C- i- M (calc)$ h9 F; d" c# c( K$ z2 d9 W) l
)
/ [, B& c9 }" V4 l ^ )
; k4 S7 J d3 V7 T (defun ver_ang2 (value)" s# ^! J0 `4 q
(if (setq end_ang (verify_a "end_ang" value end_ang))
" t; B7 F4 q& L* l: g2 q3 z (calc)
6 F! C. v; \! o )- H7 ]1 i% e' t6 m
)
% R/ d. Z( S$ r; _ ;;& g) B5 N H& D9 {
;; Verify tile value for ellipse end angle. Handled slightly$ R7 ?( [1 x0 B0 F: f) D, R
;; differently than the other angles.+ }# y t5 z4 W) Y
;;1 ^" g: o- |6 U+ A& A {" @
(defun ver_eang (value)* K5 B+ v3 ^* p! r
(setq end_eang (verify_ae "end_eang" value end_eang))
! B. U3 L$ q' e* G )2 `9 A0 E' ]8 S& j% z4 G& h& R6 m
(defun ver_rot (value)
! G( U1 a: b+ F H (setq rot (verify_a "rot" value rot))& h7 x/ n' U, L1 p7 r+ _1 b
)
; q" m6 J; j" I* v; Z (defun ver_obl (value)& [! Z/ p: [: _7 `% W
(setq obl (verify_a "obl" value obl))
- |3 x7 \" V2 { K0 M' r2 v/ F7 } )
4 F) d: J. P; e ;;- A3 ?" X6 x& Q
;; Function that verifies attribute tag field for null string,
9 [( u5 e8 h8 m# E3 Y ;; or a string that contains one or more spaces. Tile value
# B- D: C+ s) a ;; is also converted to upper-case as well.' o; A- T6 v ~" C$ I. p
;;2 Y) E% F5 Z' d* n+ ?. X# F
;;
/ Z e& p% o9 z6 b: y( @! r9 E, { (defun ver_tag ( / tval); K+ d( S" d1 R L% d
(setq tagval (get_tile "tag"))
l: t8 A+ {- V* b (set_tile "error" "")) r) H* W2 y% S+ ^4 T4 S
(cond
4 g, D5 X- [' C9 S3 L8 ?* W ( (or (eq "" (setq tval (strcase (ai_strtrim tagval))))
1 U' Z4 Q8 n: v (wcmatch tval "* *"))6 c5 @* [# @: [% W
(set_tile "error" "Invalid attribute tag.")
; o) e; m5 v% V- J (mode_tile "tag" 2)
$ e L- q; c! k" @$ R! r (mode_tile "tag" 3))
# h" E- }/ W. U$ X* Q9 Q2 |9 z6 L (t (set_tile "error" "")( P9 u/ V- h/ r3 v* z( K9 B
(set_tile "tag" tval)6 i- e. p3 z1 h7 H6 u9 Q
(setq attag tval)))
4 g& Q: x q/ x& M9 g )
- B+ i0 n2 ]! s) r% l# ?$ x ;;7 f/ g% C5 Y# f# ~6 M
;; Calculation functions- c' f1 b g, |7 p6 X
;;" h" Q. u7 z" Z: B" w. g% {# w- p4 H
(defun calc ()( A6 d1 }1 g5 ~
(if (= etype "LINE") (line_calc))* b+ f+ h4 i8 s9 P
(if (= etype "ARC") (arc_calc))4 C0 P& l9 l' F# i! w
(if (= etype "CIRCLE") (cir_calc))
8 @! b# R# P: u k n ) {, D% L* H* C0 U# [/ H: [
;;; K- P( [- i/ g) b5 ]! I
;; Calculation functions for lines, arcs, and circles. x B9 L- a; @6 k! Y- Y8 V
;;2 @3 n7 s5 M3 f
(defun line_calc ()
9 c% X+ F9 H, @: u* B4 k+ c, p (setq stpt (list x1 y1 z1))
0 G! Q+ `1 P; ^, }* J' B: s (setq endpt (list x2 y2 z2))! _: |" K& S2 k
(set_tile "delta_x" (rtos (- x2 x1)))
- h; W3 ?; ]0 w, m+ k (set_tile "delta_y" (rtos (- y2 y1)))
3 B: k4 I( g# g7 [: q2 Z (set_tile "delta_z" (rtos (- z2 z1)))2 m+ X. G+ w1 b* l( d
(set_tile "l_length" (rtos (distance stpt endpt)))
: m- C8 g. r( d1 F+ V: Z (set_tile "l_angle" (angtos (angle stpt endpt)))/ Y- b) S8 w6 [
)
8 q- ~, k$ h' J- Z, }: e# f
0 h. a5 q+ q" t. G (defun cir_calc ( / area units); I+ ?1 @& G; g! i
(setq radtest radius)& Y: f3 j2 L: J5 u4 @6 h* U2 L
(set_tile "Dia" (rtos (* 2 radius)))/ E- u* ~# O/ O- G: @/ \
(set_tile "Circum" (rtos (* 2 pi radius)))- X" A8 z: u/ E: s- v. Q6 r) f9 \5 G/ o
(setq area (* pi (* radius radius)))5 i: B* U+ h% ^2 V" F
(setq units (getvar "LUNITS"))% W' C. \3 q O: o0 ?
(if (or (= units 3) (= units 4))/ Y1 N" A6 L2 r( `# I, R- @
(progn9 I4 V2 d% E# `7 E: u
(setq area (/ area 144.0))
# }) r$ b: w7 o& G; ? (set_tile "Area" (strcat (rtos area 2) " square ft"))
- b5 T# r/ y8 L. V8 c/ h )8 j/ n0 |5 e& }
(set_tile "Area" (rtos area))
' |: F8 Q/ i# K' V8 h% a" }+ N )
- t! P- T6 c+ h7 @' r1 F( ~ )
! i c1 w$ m7 A4 \5 l* V& e) b8 O6 | g, b! p
(defun arc_calc ()9 P* i& Q$ g: Y4 R- @& c
(setq totang (- end_ang st_ang)): ~3 \7 Q$ Y* p* ^
(while (< totang 0)( [" r& F9 F0 u$ R
(setq totang (+ totang (* 2 pi)))$ ]( z9 l" P+ t& [" C
)3 K) M8 b4 s, Q0 ~" f
(while (> totang (* 2 pi))
; L5 w, C! `7 }% i" R9 x- D" ? (setq totang (- totang (* 2 pi)))
0 E$ U% K/ I2 U# v" a ); f0 R# Q0 f. C+ f2 G
(set_tile "tot_angle" (angtos totang))
- Z7 y: B2 X( z0 J3 ], ^ (setq arclen (* (* 2 pi radius) (/ totang (* 2 pi))))9 V5 \ M( H. b- M; F
(set_tile "arclen" (rtos arclen))1 n0 _9 F, }" A. m6 x% V* G
)) y/ }' _6 E/ \: V6 q
;;
4 l [) o- h. \' j' X/ i) B0 d6 Z ;; Calculate the major radius, minor radius, major axis direction.5 G) b! A8 I& T+ ^
;; Get radius ratio. Convert Start, end parameters to start and end1 W1 K6 J' j( w T0 S
;; angles. Save Major Radius value in "old_majrad" in case the user9 u, H. |8 i4 T5 p9 L% J1 h. v
;; chooses to input a new Major Radius value later. It's needed to
( O( P% y/ Q' e8 o0 B ;; calculate a new Major Axis Vector value.
! s3 }" j+ J( _# }* s, r ;;
/ U4 M& ~2 h2 x: p$ Q% t( s (defun ell_calc ()! T6 K, L- M5 `2 T9 P
;; Get major radius from the major axis vector.
4 c" D' I; w7 m) q (setq majaxis (cdr (assoc 11 elist)))& M' o% T6 K. i( R* u' ~. A
(setq xx (car majaxis))
|" d+ c8 [0 U( |3 e, H( O0 k (setq yy (cadr majaxis))
* l! c9 {9 N: K" P v, P" a (setq zz (caddr majaxis))$ k4 N5 Z! p8 y6 h; V2 ^
(setq majrad (sqrt (+ (* xx xx) (* yy yy) (* zz zz) )))+ O5 B4 f' `* Q$ Q: c
(set_tile "majrad" (ai_rtos majrad))( N0 P; a/ S& x1 M& ~5 |
(setq old_majrad majrad)/ K# L3 U7 j: `& J7 K \6 z
;; Get radius ratio/ z) t2 u0 ]. F
(setq rrat (cdr (assoc 40 elist)))
( K' B; k! ^- W% _6 ^: t' g- |1 E (set_tile "rratio" (rtos rrat)), ?1 ~* ]5 a {% L
;; Calculate minor radius
/ x l# |3 ]7 e6 X (setq minrad (* majrad rrat)): z* v7 K; x+ S6 L+ K2 z
(set_tile "minrad" (ai_rtos minrad))
* T5 ~- N! y! v7 U ;; display major axis vector
4 d6 U, c2 b4 W# v (set_tile "Majraddirx" (rtos xx))) W0 n" j$ B; T. b# E
(set_tile "Majraddiry" (rtos yy))( ]- ^' a! @6 B2 N# n) b5 x5 I
(set_tile "Majraddirz" (rtos zz))+ Z( l0 N5 f7 A7 Y- r. _
) ^$ Q3 m/ z5 \+ E+ n5 X. G ;; Convert start parm to start angle- i7 \4 G% Y* w: K" T: T8 i
(setq stparm (cdr (assoc 41 elist)))
' A+ w! Q0 `; M$ e$ K (setq vecx (cos stparm))4 D5 Y a9 b/ u( t) }0 P0 q7 @
(setq vecy (sin stparm))
9 e5 S7 ]+ z4 b2 U) L' k4 U (setq st_ang (atan (* rrat vecy) vecx))
; q# j2 p. x$ |2 @4 l (setq tempst_ang (ai_angtos st_ang))3 j$ z" O$ N6 V# j5 c
(set_tile "st_ang" tempst_ang)
9 Q$ z B' x& B5 J ;; Convert end parm to end angle. If end angle evaluates to 0( V7 h$ f( U7 K- B/ }
;; degrees then display it as 360 degrees.+ f5 Z2 B" h! N# F
(setq endparm (cdr (assoc 42 elist)))9 J/ v" h/ C% E3 M4 c& [
(setq evecx (cos endparm))8 d! m c; x/ q/ O8 P2 |6 W5 U! M
(setq evecy (sin endparm))+ @" {0 F4 O# L3 p1 M% D! V
(setq end_eang (atan (* rrat evecy) evecx))
) O- _+ H' q0 ^' Q (setq tempend_eang (ai_angtos end_eang)); T+ n' [8 z9 O$ H3 O* g3 ^
(if (= tempend_eang "0")0 ~ U* O, T6 F2 Q
(set_tile "end_eang" "360")8 d6 d3 }# Z" E& p/ s$ ^8 a6 b, z
(set_tile "end_eang" tempend_eang)" h* W* \$ `( g! }7 ]
)+ b$ M( E g" I) j& Q( J5 H
;; Get area of the ellipse.3 k1 J6 y& } Z/ R1 i6 V: T$ ^$ x2 ?
(ell_calc_area)
* @. ~; t2 E, J, k' y& ? )5 W {8 _6 n" O/ @* y
;; Calculate area of ellipse. If it is an arc then
% U/ M9 x2 N9 P3 b' {( m ;; grey out area display.
# [8 E" V7 N3 ^ Z- k ;;9 ^" n$ F( D0 a1 @# Q& s
(defun ell_calc_area ( / area units)) G8 | }9 |# y8 {/ z) }: H
(if (and (= tempst_ang "0") (= tempend_eang "0"))
4 y( d2 O, q' M5 [ (progn2 g) a8 c2 k% `; l0 Q7 J
(setq area (* pi majrad minrad))
) }. w4 ^5 S0 ]% b5 f9 W+ V (setq units (getvar "LUNITS"))
* D2 H% e7 i; G; \8 F (if (or (= units 3) (= units 4))
' ^: p2 @ ]. x" d2 c# a t/ s (progn
/ {( l( L- a- j: {( k (setq area (/ area 144.0))! s5 l# }; ^. L8 \3 _( w
(set_tile "Area" (strcat (rtos area 2)" square ft"))
* T7 c, u1 }% ^8 a9 u )
! w$ V2 G6 t ?1 t( X; r (set_tile "Area" (rtos area))7 i# Z; `8 k# N. b4 b' i: ]# c
)
( }. v: T: K: }! v }* ] )
7 G5 `& r$ n& Y9 ]) u: ]! k (mode_tile "Area_text" 1)2 q/ a( r. W' c; [* M! O- S* C
)& R- r" Q; U% a9 Y# ?
) ~6 S; H9 `. a4 G1 L# w( p9 O
;;
8 F$ r! ^ A, w3 {' T ;; Calculate new values for ELLIPSE& |8 ]/ S2 a* f! \8 M
;; Minor Radius, Area
) }1 A* y! t/ P, M& O ;;7 e8 Y/ _9 O# `* E# @5 _
(defun ell_calc_newval (ell_tile)
) p h% K$ b C, j1 P8 B5 h (if (= ell_tile "majrad"). N) Y9 H7 m3 r& @# w1 \
(progn& Z% n0 O X+ ]; _# Z# y
(setq rrat (/ minrad majrad)), k# L/ a4 R2 S+ h2 L; P4 U
(set_tile "rratio" (rtos rrat))
; w) H3 x h6 P* t1 g0 B; b& D1 n (ell_calc_area)/ L* v& Y" H1 [% Z4 j
)
4 G$ @2 U9 @7 a% A9 Y8 X& N )* r0 V0 S2 _( n1 B6 m
(if (= ell_tile "minrad")+ _1 ^3 o9 N; W5 ~9 X; M
(progn
0 t# d3 Y. h% u) m& f1 B6 V1 l) [ (setq rrat (/ minrad majrad))
! i( E( X, u( F: V1 z (set_tile "rratio" (rtos rrat))
+ u2 {- b: G9 ~/ F/ _/ @ (ell_calc_area)
0 r; _+ Y( i! o$ H )* d: B/ q$ C5 F
) K, a! U# |3 Z9 l( A% x
)
" `% a- K5 a7 J, I( D! c
# {% ]# c# N1 m) U9 r9 L (defun set_dimen_props (/ loop a stl txstyname)
- ?! u' c9 S* ~! U4 v/ y4 d
G8 ~( ]" K7 k* K (setq stname (cdr (assoc 3 elist)) ; get style name7 T/ T( o" \7 P- ^* q% K
stl (tblnext "DIMSTYLE" T)' ^$ M5 v6 H- B. T
stlist nil)5 l/ d% ^1 _# ^% U" [1 o7 ` A# Q
;; Get all style names and list them in alphabetical order6 [4 q$ M" y" Z) @
(while stl
3 z& L8 U* v! w! S/ m (setq sname (cdr (assoc 2 stl)))
4 y3 v% u( J. r6 ^ (if (/= (logand 16 (cdr (assoc 70 stl))) 16)9 o' k& D6 ^" T! H/ R1 N
(setq stlist (cons sname stlist)))
; |. }) Y7 X1 L (setq stl (tblnext "DIMSTYLE")))8 a+ x; o6 u4 \( e- t& d
* j) p! L7 w i4 n9 Q
(setq len (length stlist)
# }$ }6 @$ i: y8 P- p" r* g loop 02 `/ }% Q. k% @+ y& G+ B
dimsty stname
7 p' f6 B+ c" I z )( c% W! ?4 C# k( Y
4 q0 i8 c3 w# y& N7 k% v; k
;; alphabetize style list, depending on maxsort
- ?' p0 j1 r4 c& ^! y2 E8 y (if (>= (getvar "maxsort") len)* C1 J) i) X. A$ {
(setq stlist (acad_strlsort stlist))
# F- m2 L9 [, C5 }9 O6 L- v (setq stlist (reverse stlist)))
/ i, n. P7 d3 b4 n# z+ Y* E2 s3 @
; *UNNAMED style (dimsty = nil at this point) is replaced with+ H. X/ Z# {# ]% |% B1 G
; the current style. After R13, we require dimensiosn to have a& f( C9 ~" {3 C0 }
; dimstyle, so we plug any holes where we find them.
" y. @# d. C( Z$ I8 A: j3 w (if (null dimsty)
5 t6 {- Z0 [. i5 _' V" @ (setq dimsty (getvar "dimstyle"))
$ p3 S5 [0 ~$ ~7 @0 q )
( B8 G! p) ^& a: y1 f1 E1 X ; Show the styles in combo box
0 s3 O; \* R/ U0 L (start_list "mod_style" 2)% }0 F r* N4 T" U, e) W
(while (< loop len)+ Q3 B2 H' L: s3 I+ L6 d
(add_list (nth loop stlist))
- _. |- A) h' t% U (setq loop (1+ loop))
& \: l) b* R$ L4 d; T7 g )/ b3 H( @ d1 w' L2 t
0 j' G5 B( u& v- D" [ (end_list)" R* e' f* B; W% S/ b1 \; k
5 S. l- l$ o L ; Hilight the style name of the selected entity# ]. ]! o9 H5 l: T4 g9 t
(while (and (< 0 loop) (/= dimsty (nth loop stlist)))
- j/ i3 [( p" I E! N (setq loop (1- loop))% K! u9 z1 j- X% h: _
)
1 O6 F& H7 @( b (set_tile "mod_style" (itoa loop))
, ~& b; g O! R, s9 k7 w3 u, r v- V* X3 \. N
; The following is the list dimvars. It must be sorted in the same
1 F6 J' t# _+ U' E ; order as the resfub returned from DDIM (ADS module).
# |* Q0 H3 M6 O+ X' J$ H+ i5 s
+ n2 m1 y$ _. v6 t (setq dimtbl (list "DIMSTYLE" "Style name" "Standard flag values"
# h% }( e" G6 K0 t+ V' j& P! h "dimpost" "dimapost" "dimblk" "dimblk1" "dimblk2"
8 c' V" A. T3 U3 U5 F4 m- Z* ^; [* | "dimscale" "dimasz" "dimexo" "dimdli" "dimexe"5 i1 a% D1 g* U7 b
"dimrnd" "dimdle" "dimtp" "dimtm" "dimtxt"
4 V( B$ i& h& j: o7 l7 x "dimcen" "dimtsz" "dimaltf" "dimlfac" "dimtvp"; b" ?( H. s( T1 K' w& Z$ |
"dimtfac" "dimgap" "dimtol" "dimlim" "dimtih"! W/ v- p* \& T* t6 L5 Q
"dimtoh" "dimse1" "dimse2" "dimtad" "dimzin"
% |1 j- S* N: z' w6 \ "dimalt" "dimaltd" "dimtofl" "dimsah" "dimtix"
; R# V2 p: T y/ K0 z* S9 Z "dimsoxd" "dimclrd" "dimclre" "dimclrt" "dimunit"# ?, m0 k$ a L/ z8 t- G+ @: J
"dimdec" "dimtdec" "dimaltu" "dimalttd"
6 R( }7 B, @% ^! ^2 B "dimaunit" "dimjust" "dimsd1" "dimsd2" "dimtolj"
# j2 {" W- q0 ?8 p# @ "dimtzin" "dimaltz" "dimalttz" "dimfit" "dimupt"$ E6 ^# E: v" K+ c6 X5 U8 _
"dimtxsty"
. c G- y7 D( n( D( B ))
% `" N1 u0 B* q( t. A+ B (progn) R/ ?* V2 v% S6 M2 ^6 t' H
(setq sv_dvlist (ddimen_getostate dimsty)0 M4 O2 M: D- q Z$ b
txstyname (assoc 340 sv_dvlist)
& W8 Y7 k, z! z9 [6 z sv_dvlist (subst (cons 340 (tblobjname "STYLE" (cdr txstyname)))
/ J7 @; m0 z" M' K; y H. R txstyname sv_dvlist)
. D3 I1 w7 u* H( _) C dimlist sv_dvlist
% V7 N$ h, c$ j+ A- l, n2 h+ | )! d" A% k3 R& f* n- I" d# [" n: O I
)
0 s' D& V9 C$ E$ W; ^; N/ j (if (= dimtype "DDLEADER")
# {6 k9 U, r- k: @ (mode_tile "mod_format" 1)$ W7 w0 x8 H, \" \( g9 O# S
)
+ U. s& i# F/ a2 L' o: v& ` (action_tile "mod_style" "(setq dimsty (ddimen_style))")
' F9 [" j2 |; T0 H (action_tile "mod_text" "(done_dialog 4)")& D/ J+ _- W8 ?6 o# V1 q9 k/ }% g, w
(action_tile "mod_geom" "(setq dimlist (ddimen_dlg dimtype 11 dimsty dimlist))")
% ~) F U9 g1 Z (action_tile "mod_format" "(setq dimlist (ddimen_dlg dimtype 12 dimsty dimlist))")
! ?8 Y9 K' }, |, I: O: y; z (action_tile "mod_annot" "(setq dimlist (ddimen_dlg dimtype 13 dimsty dimlist))")$ _* ]: h5 _7 ^! g9 |+ L9 ^
(action_tile "accept" "(done_dialog 1)")8 f, |0 c& T2 ~, |
)# W" }3 {+ [+ q& U0 t' m) T2 x
;;8 V* p& y R2 E: s
;; Get dimvars that have been restored.7 K& @$ x5 S" m& ? ~
;;$ _ O$ j+ D! I, ]! Y
(defun ddimen_getvars (/ elm dvlist dv i)
+ Q/ {0 G. Z! u3 n+ M (setq i 3
0 }4 W3 Q- v. ]% [2 f, K9 L dvlist (list (cons 0 "DIMSTYLE")( B$ F: ]5 a- M0 |4 _
(cons 2 (getvar "dimstyle")) (cons 70 0))
% f2 i c) y ^6 R+ {8 h+ R )
9 J' B1 K( {3 ?; A- ` (while (setq dv (nth i dimtbl)) T8 s+ X6 k2 p, s9 f
(setq elm (getvar dv)
1 v3 l" ~$ |6 x6 Q dvlist (append dvlist (list (cons dv elm)))
, h% }4 L/ |" [/ } i (1+ i)
- u# ^( S) I$ H7 [% k! D/ i )
1 F5 _4 z+ ~4 G& ?7 n$ }. c) W- n. u; I )
* ^3 E1 L5 X% S% I/ y; w" m dvlist8 p" I- A# Q2 [ E0 L5 O
); b ]* X% W0 L5 o. A, s I- O
( W# Z) o& I( E! L3 ^5 \8 n1 E8 [: ^
;;
5 v9 z+ Y3 H/ d$ ~" ? ;; Get the original states of dimvars. This is for DIMENSION entities.
8 d5 \5 H/ Z4 f% Z$ m. {$ V ;;
. Z. }4 J8 \/ b& ]% I# Q# x (defun ddimen_getostate (dimsty / dvlist elm i dvvars)1 h- {+ M$ i; A3 [0 `
(setq dvlist (tblnext "dimstyle" T) ; Get a skelton list
5 X5 g3 G* ?. v* Y% Y dvvars (ddimen_getvars) ; Get dimvars for that entity9 ?/ i* N8 \( y; D2 ~4 b( w' ^
i 1( m( L" q- W- G
)
1 i3 E! i6 h: u
$ @2 Q: h* \+ y* v" }3 j ; Create a list that contains values of the selected entity.
: `. ?* J4 D+ C7 f1 @, X( m+ B; x. M/ U/ D
(while (setq elm (nth i dvlist))2 M9 i& V8 e! ?- y
(setq dvlist (subst (cons (car elm) (cdr (nth i dvvars))) elm dvlist)& w1 u7 U5 u3 [" n! U( W
i (1+ i)
u; J( R8 g4 b# f! d$ C )) j! p. H0 Q+ F2 a6 f9 n+ x8 E
): c1 U' s; c8 }$ X2 u/ Y8 z
dvlist
4 i( i! s' a2 X' H) d )
; L9 K. B9 T& D' u2 _2 ?! w- W7 `' m1 V( _, E. R6 m: O
;;+ j; L; y. s8 N% l0 M; C) J$ J
;; Restores dimvars of the selected enity.
" j Q$ A' w- a# U/ V/ d2 I* I) ` ;; r/ y2 A: q+ a4 W/ z/ b
(defun ddimen_dimsty_restore(/ dimtbl dimsvcurset en)
8 e6 ]# F" r. I: P# R. R- C8 d& @ (setq dimtbl (list "DIMSTYLE" "Style name" "Standard flag values"% s1 `+ B; J E( H' t+ B, w
"dimpost" "dimapost" "dimblk" "dimblk1" "dimblk2"& |, E+ U. s6 J
"dimscale" "dimasz" "dimexo" "dimdli" "dimexe"9 U ~ y F+ H# q+ {+ {
"dimrnd" "dimdle" "dimtp" "dimtm" "dimtxt"! Z' Z* _; l" G: o4 P% P
"dimcen" "dimtsz" "dimaltf" "dimlfac" "dimtvp"
/ `1 @" G: k$ }2 [$ {8 g "dimtfac" "dimgap" "dimtol" "dimlim" "dimtih"
" y# x. K6 p5 y& w5 n o' N) f "dimtoh" "dimse1" "dimse2" "dimtad" "dimzin"
0 W+ m6 y2 e2 |7 m% Y* p. Z "dimalt" "dimaltd" "dimtofl" "dimsah" "dimtix"; J* o; }: I1 o0 n5 @
"dimsoxd" "dimclrd" "dimclre" "dimclrt" "dimunit"
* k& D6 h0 p7 {$ Y8 w2 Y7 x "dimdec" "dimtdec" "dimaltu" "dimalttd": A4 n3 o( @$ z, J% h
"dimaunit" "dimjust" "dimsd1" "dimsd2" "dimtolj"
8 s! M% L) k4 ~ Q6 Q "dimtzin" "dimaltz" "dimalttz" "dimfit" "dimupt"
- I4 w+ [1 _" L- N! d "dimtxsty"
8 Z" t$ @' m2 u& d: \ ))9 n. d" X* t ?) K* B4 w. x
(setq dimsvcurset (ddimen_getvars)) ; Save current variable settings6 j- N# A1 ^) s* d9 b% ~ C3 I
(progn
) m4 b: l' ~- b (setq en (cdr (assoc -1 elist)))
- E* ?7 g5 E+ `( p5 w# t' W! n (command "_.dimstyle" "" "" en)
" v" y0 q/ p' @% j. z( X )
3 N4 W+ }- o, V' ~. a6 @6 [ dimsvcurset
( V% L/ m. m3 ?2 X5 ?1 J )% b' u$ R& C& d z* Y& }
;;. J: ?4 ~- T+ V, ~
;; Modify Leader d( q8 z! r. w' F' E+ l. S
;;8 k Y" _# G6 s! r$ t
(defun ddleader (/ dtypebit blkname bename sublist a stname n dimtbl
* H3 _* F9 Y. p4 k; J5 P dimsty dimlist dimtext svtext dimovr sv_dvlist stlist8 T8 }8 i" |, L2 Y# n
dimtype dimsvcurset)
$ m( Y3 ]; o1 m% R4 q# W (setq dimtype "DDLEADER"
$ k: N: k+ N! f& [- c dimsvcurset (ddimen_dimsty_restore)6 | P- o/ v/ K) I: P8 M
)
/ U/ a3 o* v) R, A (if (not (new_dialog "ddleader" dcl_id)) (exit))
6 K# J- q9 s3 T0 y ;; Set initial tile values& A- c& U6 X; {% K5 \
(set_tile_props)
1 n7 R8 H2 ~$ g+ |) \$ z (set_dimen_props)
0 x @: r& P+ d: n8 D. { (set_tile_handle)+ G& D! ?0 u# s O( V3 R, s! U
;; Define action for tiles
{3 Q) q3 w% s (set_action_tiles)
6 g+ u# {1 ~' s+ C (mode_tile "mod_text" 1)# p' ?0 w" L( a/ B# T" ?4 F
1 t! { C2 @& e6 V/ D
(action_tile "mod_style" "(setq dimsty (ddimen_style))")
) l/ A+ ~- z0 }6 y' X (action_tile "accept" "(setq leadtype (get_tile \"s-s\"))(setq arrow (get_tile \"arrow\"))(done_dialog 1)")9 D" @! {. Z: }8 A4 y7 q
;; Get ARROW and TYPE.
/ V& B4 b0 m9 N- A (if (= 1 (logand (cdr (assoc '71 elist)))) (set_tile "arrow" "1"))
: r2 R6 s( A# H: i q9 } (if (= 1 (logand (cdr (assoc '72 elist))))8 t- S& ~9 ~% k3 {, M$ y! P# x
(set_tile "s-s" "spline")3 l O7 m7 E0 Q' J/ J" K
(set_tile "s-s" "straight")4 m% ]& b) n0 t! P: ]8 ~- q( M4 p0 H
)
2 t2 a! e6 t6 H+ | A* G( n, q' b ;; Start the dialogue.+ V) L% R- g" M' r& Q- k0 i1 L( K
(setq dialog-state (start_dialog))
9 |, M. x4 T) e' Y; v6 V/ [. @ (if (= dialog-state 1)
/ F" ?' @4 m3 | (progn5 o- k0 B; u1 Y. I' q% U/ d) N
;; update the style
1 Q( J6 T+ ~% D& k1 R$ b (if (/= dimsty stname)4 u9 i8 ^, p8 [
(progn
0 z T; v+ a: D6 d* g2 @ ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case- r1 |, R& v1 A U* L
; doesn't have it.
& q- Q9 |8 n* D( l+ c. T/ X: o (if (null (assoc 3 elist))% D6 H1 V7 W7 l
(setq elist (append elist (list (cons 3 dimsty))))
( p2 m1 T1 J+ @4 Y& C( O ; else just replace it.5 Q7 s" B8 P/ D" {9 [1 s- g9 ^
(setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist)): A, s, L+ J; Q3 _6 }- v$ |! ?
)
; R- l% W, [9 P! @ ; refresh sv_dvlist with new dimstyle.$ D4 a1 K- L6 d6 i+ h% o. l
(setq sv_dvlist (tblsearch "dimstyle" dimsty))4 Y1 Y8 `: u1 O3 o2 N# S; k2 e
)+ T7 z9 f0 ]) r+ C
)! r0 ^" p T7 {) F4 }
(if (not (null dimlist)) ; attempted to change dimvars+ ^, H* c2 z8 m2 X
(ddimen_complist sv_dvlist dimlist dimtbl)+ i1 P* v8 ?" r$ ~( n: K
)1 I2 F/ M! D j, o; k
;; update for ARROW.+ g, e- K% G% j' n3 S' g& e. ]
(if (= "1" arrow)
6 \# q; _7 w+ U6 u* |- J+ j (setq elist (subst (cons 71 (logior 1 (cdr (assoc 71 elist)))) (assoc 71 elist) elist))' V n, v! c8 E5 r o5 k+ `
(setq elist (subst (cons 71 (logand (~ 1) (cdr (assoc 71 elist)))) (assoc 71 elist) elist))5 E. g: [: p* Y9 n! m6 f+ ^
)
, U' m" c0 D& i( K1 w ;; update the TYPE.' n& A6 Q" u1 S' o) e U
(if (= "spline" leadtype)3 d' U+ m4 a- `7 I) d; H' N
(setq elist (subst (cons 72 (logior 1 (cdr (assoc 72 elist)))) (assoc 72 elist) elist))2 `8 Q1 C8 D, @" _. M8 g/ w" ]* N @
(setq elist (subst (cons 72 (logand (~ 1) (cdr (assoc 72 elist)))) (assoc 72 elist) elist))
! I. Z3 }; t9 h3 r9 N( I \- E )
- R4 p8 F; w/ W/ Q; B5 T (modify_prop_geom)
! }9 ^! p2 J6 E2 Z ;; update the Color
M2 s) A/ a* X2 [4 l4 ^ (setq elist (subst (cons 77 ecolor) (assoc 77 elist) elist))7 M+ V2 u0 d$ ]6 u5 k8 Q! y
(entmod elist)
6 i. ^$ s5 B% }* r )
8 [" D2 k0 X! t, m: ^3 p )
9 }& U, f. u* P9 U: C) ^0 w( [$ I (ddimen_setvars dimsvcurset) ; Prepare to exit
/ x% O# o" L6 `3 k9 R8 h& {0 ` )9 e& s, j4 y4 R6 |* w- ^% P9 `5 o* ] j
~' ]. @" ?4 f; M) C+ |( ~
;;
. K& Y2 M8 F3 z0 o, y ;; Get dimvars of a dimstyle with overrides.
. ] @, W1 p2 k: s/ T0 O ;;$ Q6 O- @' ]* G$ z7 Y9 f5 J
$ L3 m% e0 r0 S6 C2 m
(defun ddimen_getdimvars (dimsty / dimovr dvlist elm i)
- a) G* v n+ Z3 d; Y
. P" _. T5 r1 _+ C) M ;; Get override information for the specified entity.7 x& m8 z" Q3 F2 Z: A. ~
;; Leader/Tolerance cannot be restored by DIMSTYLE command, so we& B8 s2 X& p$ q' b Y; U6 k6 K
;; must obtain override information through this tedious operation.% n8 i- E- A. V, s
(setq dimovr (car (cdr (assoc -3 (entget (cdr (assoc -1 elist)) (list "*")))))* d l/ k5 a/ n
dvlist (tblsearch "dimstyle" dimsty)1 |5 I4 J, x& {
i 2
; ]! B9 I. k" ~# o x8 y )
6 L" P& R- @9 _, l" f* ~- i% q
( T' {. x* x7 S0 M1 p$ f ; Update the list with overrides if overrides exist.
3 A; i: C( o6 _% o( Z
; c @* Z& \7 U% T (if (and dimovr (= "DSTYLE" (cdr (nth 1 dimovr))))
3 A: C, ^5 w" w. \6 n# M$ j9 O (progn# ?: J& M5 y9 E* u) O) M; T& Q) _
(while (setq elm (cdr (nth i dimovr)))
1 x9 k9 H( `8 y" n (progn) \8 ~ e# D$ o% c& D2 T. f# {
(if (or (= elm "{") (= elm "}"))9 q. T1 o( o1 m4 p, P
(setq i (1+ i))
, ?' P n; ]1 c+ D (progn
6 ?3 H2 }0 @) H4 g% W1 n (if (or (and (< 180 elm)
+ n; |8 n. W4 \5 n- u (< elm 190)
. f% W9 O4 r% D1 S/ S ) e: o9 M& |( O; J2 }
(and (< 80 elm)4 @% q& e: q, Z
(< elm 90)
& g( L( Y7 _7 V )% e* X Y5 p# V$ f3 S( `; _ p
)
; d5 q' C9 l) P U; s: L0 _ (setq elm (- elm 10))
2 H9 m- J- l4 g$ P$ {% H1 S3 `; ~ )
8 [# m- H/ b2 J$ @ t I; L (setq i (1+ i)
' G! {* C& r: E" V elm (cons elm (cdr (nth i dimovr)))
$ l6 Q2 B9 G, f$ ^' [( T dvlist (subst elm (assoc (car elm) dvlist) dvlist)3 {) W* b3 K) ]+ F2 k
i (1+ i); t( }+ X. X0 i+ E, R1 j8 [& `1 @
)1 ?9 y- ]* I. J2 B1 C
)
, n- C7 p; k7 j- J ). A' G" R. U' y2 o8 \1 e
)/ ?$ `; M1 r! w E+ ~
). m7 m% j# I8 J9 R2 I
)
& {8 W' V3 Y! G )
- p+ y* R F" B. d& y8 Y3 L dvlist
, _) ^1 m* }6 H6 g/ h/ I# E% ? )
/ u- m- g: M5 Y) I$ j% R! f4 Q# E. M. [7 w& ]' O
;;
( G" H+ O: X2 Q* q: Q3 O; f ;; Modify POINT
' x7 C% ?1 K) Q: J1 l/ F. j5 _ ;;1 z$ K: \. x5 k v9 O" S
(defun modify_point ()
& K y- }4 R: `& l (modify_properties)3 Z1 M1 G( ~$ b3 F# | U
(setq pt1 (list x1 y1 z1))
/ C) G: ~7 v7 \ (tempmod pt1 10 0)
R1 X! P$ w7 C1 K# y2 G- H7 j (entmod elist)* m/ A/ s* |$ D& W: A
), \) U) t4 T+ z) f
9 \% e; r' S6 I! h. G! L* I (defun ddpoint ()
" F3 B3 J+ S! ~, V3 E (if (not (new_dialog "ddpoint" dcl_id)) (exit))
1 h, B2 [% R8 h7 } ;; Set initial tile values$ s M/ U! ^ v8 h
(set_tile_props)
& c6 U' e' [1 G% e! T: z (set_tile_handle)
& f5 y/ R, \8 r) w- u. | (set_tile_pt1 0)% @' `7 M( N" S& p/ U F
;; Define action for tiles# P% O* z' V7 `& Q6 p
(set_action_tiles)5 N B% d5 I, Z4 k1 U% ~
(setq dialog-state (start_dialog))$ L: u% I T8 k, w4 _" }
(if (= dialog-state 0), U$ s1 e7 _; q6 h* _- O
(reset)9 q* T4 ~" u2 w. A
)2 ~! m) F' v2 S0 S
(if (= dialog-state 3); M9 l" c" J4 _) z9 F) m
(progn4 o8 m# Y6 @( [% F+ I& J! x
(modify_point)- t3 s6 l1 c5 ~) C) ?9 H
(setq pt1 (getpoint (list x1 y1 z1) "\nPoint: "))
; A* l! N" x' x }2 [; ` (ver_pt1 0)! R( q7 h# k/ D
(ddpoint)
( M8 m) A% H6 k& D( B )
$ y0 R5 H1 @ k+ K* x' s, s. y ); o u4 ^" g( R# C
(if (= dialog-state 1)
i% z6 [! @2 ]# V9 k7 R- Y (modify_point)
$ j6 Z+ U; u' G! Q" ~8 W; O ). Y h: k* ? s9 C
)
, p2 A( k, L6 _8 B/ A ;;
+ S% o7 G# i9 Z, }2 x& m" P ;; Modify LINE
, t2 Y+ s+ q$ N. H$ Y7 ? ;;# L% B( s- T3 D: J i! K
(defun modify_line (), J9 a9 L& b1 l9 ~
(modify_properties): ]$ }5 L& k2 M& Z; e5 T% [4 w
(setq pt1 (list x1 y1 z1))
! j( |0 Q0 t b p' o. L' I3 a- z (setq pt2 (list x2 y2 z2))6 G" Q$ A' B* n4 ]5 a8 g3 l S
(tempmod pt1 10 0)+ Y' ?; | P9 O9 C' H
(tempmod pt2 11 0)$ R: ?) A8 l9 s: M" x- o
(entmod elist)' D9 ]7 h/ w: G" d1 W
)
) F1 @$ W) ?) K. d, Y2 h% b5 R (defun ddline ()
; j, r6 }8 E% V6 x7 _) z. T (if (not (new_dialog "ddline" dcl_id)) (exit))
1 {9 a0 R$ f5 E2 P0 R P ;; Set initial tile values
: O& k+ H. D4 g, C. g2 o& c7 Z0 B (set_tile_props)# O2 f/ ~; {( @. G0 R- o6 U! B
(set_tile_handle)
2 q* P1 r* E6 r& x5 ? (set_tile_pt1 0) _4 F, q6 F% ] \2 D+ o
(set_tile_pt2 0)4 g3 E4 C2 D, ?/ r8 A3 A
(line_calc)7 z1 U$ y; J0 w+ k% \
;; Define action for tiles
0 _1 U9 K* I; q# f* t& U- @ (set_action_tiles): Y4 E+ A# d7 `2 Q* q$ u2 x, z
(setq dialog-state (start_dialog))# m( B. O7 c. T
(if (= dialog-state 0)
/ [: b/ D4 m7 _# A4 W (reset)
$ d; R7 h; M5 {! F" O7 `+ |* @+ S+ K )) ? n6 @) a, Y& T( F/ d
(if (= dialog-state 3)5 v+ w; z* O$ L9 \- P
(progn L3 C% H F& i( u Y N$ o
(modify_line)
6 I4 \5 V. X1 t (setq pt1 (getpoint (list x2 y2 z2) "\nFrom point: "))
4 K6 P4 W/ r, r \! |- o (ver_pt1 0)
& X( Q+ Z4 q3 x( y/ i0 S7 q% G. `! ~ (ddline)0 |- k$ e& Z8 S$ d+ _0 n
)
& w) T5 {2 o$ u7 c$ n$ P) p! p )5 t5 [& M' z$ `3 B" X2 Y6 H
(if (= dialog-state 4)
; ?' j1 J5 A$ J6 A( q (progn- ~ Y4 o @3 U- G- F" i& }* r
(modify_line)
# b" T8 @, s$ w3 O+ ^7 u* T$ j (setq pt2 (getpoint (list x1 y1 z1) "\nTo point: "))( \1 Y% X+ b! F( r, D
(ver_pt2 0)! C0 |% a( i1 b# D1 W9 T: ?9 y- B
(ddline)% [. t5 X5 ~ ^' U+ a3 E
)
+ H$ I$ _0 O+ y' ~9 w )) A2 @ B" D/ C A0 G) O
(if (= dialog-state 1)0 T0 W: H; J8 n1 p2 M
(modify_line)
. \, A, B: H3 ?% V3 Q: Y ); u! B5 O; O- `- f* n0 ~. V7 @1 F1 }
)
. T u2 M8 U/ I7 m$ ^* } ;;
! f: c& ]! g$ P* B ;; Modify MLine
# s0 K5 f m# w1 ? ;;
# {6 e2 t; d/ [/ | (defun modify_mline ()
1 H6 `" t) Q" e8 N; G0 o9 _ (modify_properties)
) {, }0 s7 w4 f6 Q: U (entmod elist)
# L q% c; V( e) z1 p2 w )
) T# x F+ K& D$ Y5 m+ u% c4 P' J3 { (defun ddmline ()8 u0 m1 a# |2 f7 |! e! R& m
(if (not (new_dialog "ddmline" dcl_id)) (exit))) t- }# O- i/ P7 Y7 y
;; Set initial tile values5 y i8 R: C) F& V% {3 |% i
(set_tile_props)
5 z9 c, l! e0 |% G2 V ` (set_tile_handle)
$ f1 c( `) }$ Q% J ;; Set mline style text field.; n2 U$ A- X2 c3 V! s. @; {
(set_tile "ml_style" (cdr (assoc '2 elist))), h: g2 j P# y1 K4 u7 _( M
: x/ T7 Z8 ]+ D" D/ p" ]" S
;; Define action for tiles2 M3 H3 ]- ]: x0 |
(set_action_tiles)
- C: L2 m* M% [1 z (action_tile "ml_edit" "(done_dialog 3)")9 w' a m! F3 G6 v
(setq dialog-state (start_dialog))
; z+ @- B6 w; C6 W! | ;; Dialog cancelled, reset to original values.8 L6 t: I2 j% X5 ^$ l
(if (= dialog-state 0)8 `! K0 F0 B: o0 U+ g
(reset)
& ?- H4 |) U6 P5 S% O2 A& h+ }% U )% Y6 Y# [; a; }
;; Dialog OKed, update the mline.
d2 R+ ^( {- `( R (if (= dialog-state 1)
9 p2 d& K& q# V1 A2 `4 f (modify_mline)- y \0 H* `" w, A! U. k
)( ^) }3 }9 M9 q9 K5 J+ Q- V0 c
;; Edit Mline, call MLEDIT.
! S, D' d6 M6 Q# [ (if (= dialog-state 3)$ @$ E- G+ z; y2 y7 }: q5 N
(progn$ A5 V7 N% U. a7 z- P' s
(modify_mline)
$ p4 h- r' O! g% k (command "_mledit")
% O9 ` |# B+ z5 k& K" D5 M8 y& g (ddmline)3 D4 ^8 y' ]0 F3 O- U2 C+ P
)
9 j8 z4 }0 D+ S6 m )# ~ f/ ^7 T& y9 d& t
)$ R0 S5 x9 R) l3 W' q' I. q+ E
;;# n, t H/ h$ u8 Y8 A
;; Modify Xline
+ [) O* U& G% S ;;
) M# l+ c5 }+ z4 O$ {$ Q (defun modify_xline (flag)
9 K: Z) e' g7 j' Z- Q$ @ (modify_prop_geom)( r' c' X% `# I5 H( k
(setq xline_pt1 (list xline_x1 xline_y1 xline_z1))
3 f3 l: ^ F3 M) G$ H (setq xline_pt2 (list xline_x2 xline_y2 xline_z2))
6 _& i. E% e3 L f ;; Update the Root point.
6 V5 w" v6 Q: G( e9 p (setq elist (subst (cons 10 (trans xline_pt1 1 0))
9 U( {& S" Z7 l( m- Y (assoc 10 elist)
9 o2 ?& \8 Y0 a) B# ]; k elist( w* C8 |$ p3 h2 b
)1 W# i6 L u! H! p9 w; P2 Y3 h
)! x% L1 u( ~: ~6 v7 ~' N2 f
;;, s- H9 g7 _* q$ Y5 ~2 R2 ^
;; Calculate new Direction Vector WCS+ E, K# W3 t0 U0 K9 L6 t
;; x / (sqrt ( (x**2) + (y**2) + (z**2) ))
2 Z/ I( H* Q4 z( r6 d- b% a
- t/ K& n* i! }' \ (setq temp_dir (trans xline_pt2 1 0))
! m! g6 W! ?3 ~/ R& m: x/ ]- o (setq temp_dir_x (car temp_dir))$ n6 z! C* z/ n7 _% [% `
(setq temp_dir_y (cadr temp_dir))
( L6 `9 u$ y6 Q1 k (setq temp_dir_z (caddr temp_dir)) F+ J7 ^, n6 G j3 r- [8 H
* d% |4 C1 j: a (setq temp_xline_pt1 (trans xline_pt1 1 0))
9 ]# Y3 t4 R& d4 L O+ H; o7 {/ H (setq temp_xline_x1 (car temp_xline_pt1))( i, X8 C9 d+ j
(setq temp_xline_y1 (cadr temp_xline_pt1))
8 f( C; b- C+ x+ P4 q6 b2 Q1 y (setq temp_xline_z1 (caddr temp_xline_pt1))9 y8 Z) B* R" B j+ H7 k( z
/ P- U; Y5 W0 d! y9 g2 `8 k (setq denom (sqrt (+ (expt (- temp_dir_x temp_xline_x1) 2)
) B3 w$ d% F2 f5 r (expt (- temp_dir_y temp_xline_y1) 2)% A( | ^: ~& e$ u- A4 s8 b) ]
(expt (- temp_dir_z temp_xline_z1) 2)
/ }4 _$ b7 m1 m/ `6 B )))2 T$ V5 Q7 Q" D- @0 G4 b5 f5 M
(setq temp_dir_x (/ (- temp_dir_x temp_xline_x1) denom))
. l- e! P: C% M0 Q5 w. y J (setq temp_dir_y (/ (- temp_dir_y temp_xline_y1) denom))
$ y* W* z: _7 }: H) b% t (setq temp_dir_z (/ (- temp_dir_z temp_xline_z1) denom))
6 r& A- @* c) Z2 @ D (setq elist (subst (cons 11 (list temp_dir_x temp_dir_y temp_dir_z))
& ]6 q6 ?' g! l! |, }$ V (assoc 11 elist)$ s6 k V( L( H! q
elist
: d$ Q5 ] B f/ _ X )
. M0 u6 b! O- U4 z )0 Q* x' D/ a" v7 w- R
(if (= 1 flag)$ a9 c3 O+ L* Q5 X# N- P1 U- S
(entmod elist)% N7 N& W: Q: \
)
# t/ o' E7 ^( V. C )4 y4 O2 z7 r. V
" n0 A) Q% G, ]3 {1 K8 v3 a
(defun ddxline ()
2 t# O! _. }" l4 k9 \ (if (= etype "XLINE")
0 O, N( @1 I& ~% S+ t (if (not (new_dialog "ddxline" dcl_id)) (exit))
) P0 q3 ~; d: h s0 { (if (not (new_dialog "ddray" dcl_id)) (exit))0 x- N. q2 E# E$ A: G
)6 N, V$ @; o$ [
;; Set initial tile values; W1 G2 o( b( z$ R7 |$ X' L
(set_tile_props). `+ r1 t* Z8 ?$ E& ~( y z
(set_tile_handle)
/ b6 A8 w( o9 k3 C, ~& h* j (set_tile_xline_pt1) v( I4 Y- [4 ]; N
;; Convert to UCS and post Direction vector.) q. K% \$ Q( Y# t
(set_tile_dirv): }: s2 @3 \4 G1 Y1 J5 V1 {
;; Calculate second point by adding Root Point + Direction Vector.! x) A/ J2 s' X& j# s% A
(set_tile_xline_pt2)
! x( l+ V* ?. n, j; O/ ]3 D ;; Define action for tiles
* Q5 f. S+ S: F$ z (set_action_tiles)4 C! m) k' P3 n! i( U5 z, A7 }6 ^& t. _
(setq dialog-state (start_dialog))
2 E9 @0 s6 R9 M j (if (= dialog-state 0)2 p W1 e# `* r n( c w
(reset)2 e* @& I( a- I: ^ I
)
1 w( m' B1 p! i2 F3 W (if (= dialog-state 3)9 b% f6 p. T. i2 S
(progn
5 g& O9 J/ X+ f r (modify_xline 1)( S7 K! v) j( e
(while (equal xline_pt2
3 r1 P7 d; a" `' H7 O) ^ (setq xline_pt1 (getpoint xline_pt2 "\nRoot point: ")) 0.000001)
% n# I3 ^. \9 G (princ "The Root point cannot equal the Second point.") k# z% c, Q" g) s H
)
7 |# w; N" x1 i (ver_xline_pt1)
2 |, E* }1 {* K7 I% u' _9 K; d( V: B l! r% s (ver_xline_pt2)* c. s T0 \6 c- U1 _
(princ)
9 }3 U( Y7 X+ n i0 m (ddxline)
* W' Y% j p7 j; j* a, }4 g( d )
& i/ I; K0 P9 N1 T' f! p( d )( _5 U* D: C* i
(if (= dialog-state 4)/ ^( z) Y: A! t2 l
(progn8 B V7 N4 y; z0 P0 V" K T4 K
(modify_xline 1)
$ y( Y# V( o& H- }8 {3 { (while (equal xline_pt1
) u- V) G- V2 {- t# B5 G* F (setq xline_pt2 (getpoint xline_pt1 "\nSecond point: ")) 0.000001)- C( [ |8 U$ X! S& n
(princ "The Second point cannot equal the Root point.")
- p4 s/ S% R* O: @ )
" l$ D+ a& H; K3 _$ j8 u) Y+ j (ver_xline_pt2)
0 T. x2 \3 _+ B, c7 a2 v- j(princ)
/ y+ N4 M6 b7 t) u8 Y (ddxline)4 K3 s5 r1 |1 Z2 u& U9 B. o
)
( M" e+ O, U/ b, M, O0 J* t )
v7 Y2 R5 @* g& _# u- q3 H! j) a (if (= dialog-state 1)
1 [& Q& ]3 }$ h (modify_xline 1) H( q2 a+ U% A$ E+ f m
)
, |+ D% X$ X; {: Z: O; E$ A )
/ X) @7 B9 g$ }4 @' ` ;;
4 q1 j7 y3 E& {3 c6 t2 r4 N ;; Modify ELLIPSE+ q$ K/ l; @6 x" v8 a4 ~3 l
;;5 d n8 J( H: s) W+ {1 }2 A
(defun modify_ellipse () M# M6 z1 l& V- u% ]3 n$ a
(modify_prop_geom)8 f- k3 {" K) p4 g, G' {" o. q
;; Update Ellipse Center Point value.+ }/ W0 R* x; `8 A [- f
(setq pt1 (list x1 y1 z1))
& R9 _3 q, P+ x; x, b (tempmod pt1 10 1)
0 N1 ~4 \8 `- _7 b ;; Update Start Parameter value., K j5 r5 l: d/ B
(setq y_val (sin st_ang))
. O/ @/ Y; B9 t# |* r( | (setq x_val (* rrat (cos st_ang)))" x# c9 U& b2 [6 ?, U
(setq stparm (atan y_val x_val))
4 @3 G" w: {1 p9 _/ O ]# J (setq elist (subst (cons 41 stparm) (assoc 41 elist) elist ))* e) E0 @& w# j, r1 L# W
;; Update End Parameter value. Normalize it, if it's less than# m! T) k5 K6 |2 O: t
;; the start parameter.
5 u) L+ t0 I& E5 t- O% { (setq y_eval (sin end_eang))
+ d+ J9 ^/ s0 V: v: w) R# X (setq x_eval (* rrat (cos end_eang)))3 O$ e# q5 j) M* h' Z( F( o |7 f u
(setq endparm (atan y_eval x_eval))
7 \5 N% }& y2 a* M X9 \1 f (setq diffparm (- endparm stparm))
, W8 |# v5 Y3 B: V) _ ;; Epsilon of 1.0e-6 radians for checking a zero length arc.' D# g7 n8 d0 E# s9 V- d
;; Since zero length arcs are not allowed - construct the full" J+ `: D3 C2 T" G! m- y
;; ellipse in this case.
# N3 c6 D% o6 o7 Q! H8 j6 D3 y (if (<= (* diffparm diffparm) 1.0e-12)8 Z; q# x1 ]3 c! A
(setq endparm (+ stparm (* 2 pi)))4 u; Z7 N" m Q d* z# t
)
& v: G U! x# t! u; o/ q5 t! K: b (if (<= endparm stparm)
4 |- f" Y% b& D; Y! c9 {/ p0 n (setq endparm (+ endparm (* 2 pi)))4 S2 b, }, u H1 y1 i3 I
)
; z* D7 T. k; |$ Z (setq elist (subst (cons 42 endparm) (assoc 42 elist) elist ))/ t/ x5 [& b8 e5 j* t0 Y
;; Calculate the Major Axis Vector by first calculating
0 G, ?! V W9 |& T1 F' @" Y* g ;; a unit vector using the old Major Radius value. Then O7 a, N+ Z! O& C6 d
;; Multiplying that by the (possibly) new Major Radius+ q7 M$ Y$ }1 O/ j4 D+ O4 c- J
;; value to get the new Major Axis Vector value.3 I% k4 d/ C4 K1 \& z! c+ O
(setq unitxx (/ xx old_majrad))
& z/ q6 z1 R" n% P( @- a (setq unityy (/ yy old_majrad))
0 V! d) A0 k# M6 |/ r! @& w K0 g (setq unitzz (/ zz old_majrad))
. z5 s6 o- g8 C (setq newvecxx (* unitxx majrad))
1 e6 ?- B# T Z- |; z7 C4 `* o (setq newvecyy (* unityy majrad))
9 o0 J$ ?1 j; p# S9 Z4 c$ I! l (setq newveczz (* unitzz majrad))
: c6 @: z( T+ H+ U5 D9 m" ^ (setq newmajaxis (list newvecxx newvecyy newveczz))( `/ ^! Y- t; A4 x& j3 J6 U% n
;; Update Major Axis Vector value1 X# l7 w* |: u5 o( U5 s
(setq elist (subst (cons 11 newmajaxis) (assoc 11 elist) elist ))) F! S, U& V; Q6 J7 C- o
;; Update Radius Ratio value" j/ U8 e9 g) d% t& w" U
(setq elist (subst (cons 40 rrat) (assoc 40 elist) elist ))
2 q5 s( _/ I1 b# y# `- a8 l (entmod elist)% H2 m L: E6 @
)8 T$ T9 J5 w9 J1 S' `4 |
3 X2 p7 k+ C8 v3 V
(defun ddellipse ()
/ q2 L4 ~& A9 v6 Q& |. W5 l (if (not (new_dialog "ddellipse" dcl_id)) (exit))
: P& m4 S) u+ x! q$ ~ ;; Set initial tile values
2 V& z, y6 ^# M* R4 N (set_tile_props)+ b/ T4 h+ \/ e
(set_tile_handle)
! i. l: }; W6 N8 H7 E, W, K (set_tile_pt1 1)
F5 W" m# G" {0 x1 y (ell_calc)0 g4 E/ i- Y: I6 w( O# |
;; Define action for tiles
; m& K3 t E) P( x6 t (set_action_tiles)
& F/ x. }' |3 p' r! v! V: _ (setq dialog-state (start_dialog))$ r& P& D, [9 l! _2 j/ |
(if (= dialog-state 0)" T: R* |9 B. }
(reset)3 x1 O; \4 o# T7 a6 C
); z9 Q2 O# ~# |8 g
(if (= dialog-state 1)
: h& t6 }' D0 \( f (modify_ellipse)8 v% w, V6 d5 y' o% z4 ?8 B/ v, p* W
)8 s/ O% p' A4 M; t5 K5 t
(if (= dialog-state 3)
' Q$ {7 X+ j2 ^& n1 P3 K (progn
' j" F, X; a* \6 E% Y1 x# L/ A (modify_ellipse)
( ~8 V7 j/ G7 h/ A9 D" F. E0 q; c (setq pt1 (getpoint (list x1 y1 z1) "\nCenter point: "))! h) O, C. {2 c9 i* u$ N: u
(ver_pt1 1)/ d, \' Y8 ^9 H2 O# x. l7 p8 [( G- \
(ddellipse)
, P7 r8 L' ]7 A8 J6 N1 b" ~ )
6 G9 f6 e! k* y7 @3 J; e/ b8 l )
- U' H! m# O; e1 O )
! S2 F2 R6 B9 V5 m4 s) E ;;
6 ]1 P$ q$ z: P' ^6 [' s* ^ ;; Modify REGION
) z2 L, I4 H) O0 e' Q ;;
0 {% C3 {5 `2 U& c' J3 c (defun modify_region ()
4 L/ l0 F/ l- _" w: U2 ^ (modify_prop_geom) n" ?' g1 r, Q( Z @( J
(entmod elist)
1 h" A* L$ z7 A& _1 n0 D ): l( v8 p+ F7 k6 c6 G+ S
& S" i0 y+ ?. ^# r# {4 H
(defun ddregion ()
1 h1 L* ~8 ? o) J (if (not (new_dialog "ddregion" dcl_id)) (exit)); K% L7 A2 W0 L' s
;; Set initial tile values
$ n6 S& C$ R! D (set_tile_props)
: Y! q/ }/ Y$ j' c (set_tile_handle)
4 K" j# Y/ h$ S. e! t ;; Define action for tiles
& e7 h# ^( W/ L8 F- y+ r3 I3 e (set_action_tiles)" X4 Q! Y: P% j4 K) |7 D
(setq dialog-state (start_dialog))" ] H3 c% t1 ~7 M
(if (= dialog-state 0)
8 s& c' z1 u C$ ^ (reset)
2 `2 j* g- ~6 }0 ?. g2 [) M X; x+ U )
* l9 g" s! W4 t6 t' O# K/ b, F% s (if (= dialog-state 1)
- k, Q5 x3 _ P (modify_region)
+ H9 @4 I5 N8 g' |# |. h! Z5 m )
! r6 t" {( V/ j5 S/ [4 b )
" d; o# p" O) ? ;;
( z3 K7 ?6 g0 o: K' N ;; Modify 3DSOLID* ]8 }7 K% c9 E/ T
;;" p% M* f* d: |; P4 G! |
(defun modify_3dsolid ()
, D- U/ `* |- w* r! m" _ (modify_prop_geom)/ }& X& K' B8 i. {
(entmod elist)
4 z/ x+ f6 t _: J )
, M8 W# J& k( I0 _5 s( {8 ^& j4 T+ l
(defun dd3dsolid ()
& r9 G) `- z8 p (if (not (new_dialog "dd3dsolid" dcl_id)) (exit))8 i8 R ?/ U/ o# R4 P# ~" g8 D' [
;; Set initial tile values
2 Q7 I2 d) ]' Y+ V( D1 [) ` (set_tile_props)
8 y8 D' a2 [( ?/ x/ |" a7 P* {3 \+ ^ (set_tile_handle)
8 u5 [; u# H' V" @- Z1 I ;; Define action for tiles
& H* r# f6 T0 G) t6 Z! q5 f' Z (set_action_tiles)
# @6 d _# j _) E3 d( o3 T (setq dialog-state (start_dialog))4 ^: N, k& |/ R
(if (= dialog-state 0)
7 N2 f1 l5 a8 i/ P) i2 X (reset)
! S6 Z0 L: P" v. i )
3 i& z' o4 U* L2 G! |1 h# h: u (if (= dialog-state 1)( ]1 j) }# }8 A
(modify_3dsolid)
% S" e: X9 K7 ]3 q# V. { D' U )6 ]' ]7 u# y8 p% V# I
)
5 m: n8 o2 Q4 [0 A$ I" ~ ;;
. _4 ]6 O; B3 y0 u) j/ } ;; Modify AcDbHatch) C% S% I/ L3 h
;;
}2 @) M2 `: l" E (defun modify_hatch ()3 {9 ^( A+ U9 }# |/ q
(modify_prop_geom)' V7 n$ d6 @7 N3 k, V$ H0 N
(entmod elist)8 R( @% S$ S: G8 i4 _
)
* y& [7 t# U2 {' N, x9 }( N! l2 @4 S* q( I3 l A( A
(defun ddnewhatch ()
5 M) K {1 x# M- W& `1 f2 t (if (equal hatch-elist nil)
4 V t, b8 I* s2 o1 {9 C! j (setq hatch-elist old-elist)# L7 f; z- l0 z0 a$ a- q& @
)8 t' u! r% I5 z6 Z
" T0 d; P$ k' M$ y* g5 r, y4 d& t
(if (not (new_dialog "ddnewhatch" dcl_id)) (exit))' ~. B- ^! M9 V5 |
" @! Z5 r9 B I- |, r/ l! x
;; disable the thickness tile% `3 ], B1 t$ f
(mode_tile "eb_thickness" 1)1 P: t. D7 r4 Z# v$ n* m
(mode_tile "e_thickness" 1)' i/ D9 y" E' h; B( V, |* ^
! @* }) i' |& L; B* P (setq help_entry "modify_associative_hatch_dialog")" P$ \6 j9 S2 c7 }
(set_tile_props)
6 l4 S4 A6 J- }% B' M) ]% S (set_tile_handle)
9 d+ x4 i9 M/ c
5 V. p" L7 `3 S: L/ c ;; Define action for tiles# m# T. {3 A1 F# l7 A; [0 N: k3 Q
(set_action_tiles)/ g% V `& P0 g0 G' z
(action_tile "b_hatch" "(done_dialog 2)")' ~' |) u% `2 q- M
(setq dialog-state (start_dialog))* U2 \5 B" G/ [6 z
(cond
' {) E, a d: F ( (eq dialog-state 0)( _3 O' l" }6 K% d; i5 h% p
(setq old-elist hatch-elist)) p7 \9 k; d! z F& i: V9 |
(setq hatch-elist nil). z- D) W5 z, r! z" |
(if (= (checkforlockedlayer ename) nil)
6 V h" H6 }# J( q (reset)
! U/ p* o" c: r (progn ;;; special handling for locked layer reset
# V7 n4 f+ M0 E" ]) S" X% A; g ;; unlock the layer
: `4 G# |* I/ N (setq layername (cdr (assoc 8 (cdr (entget ename)))))
( S) V( O& L5 j (command "_.-LAYER" "_Unlock" layername "")% j. F+ b3 n! G1 ?6 T
;; reset modifiction" [% k+ }6 i0 ?, K: d" l/ ^
(reset)6 @3 H. B( V! G- C
;; lock the layer again
- M0 a! G" e3 E }* [- e& v (command "_.-LAYER" "_Lock" layername "")1 v+ u8 b l9 _6 @
)
* d) e" b: A/ L7 R+ Y )5 Y5 R! Q9 Q; |3 l
nil ;;; makes (ddnewhatch) return nil for Cancel* A& W! I' k+ }2 x2 g
)
4 s6 H7 y! L% M1 j0 b; Q% b" | ( (eq dialog-state 1)
' b0 i5 t$ N5 @$ J (setq hatch-elist nil)
, E, M7 l: C3 g/ {8 K; V: _ (modify_hatch)/ M$ X/ O0 J7 o
T ;;; makes (ddnewhatch) return T for Ok; F# c8 U6 [' c% D- e `
)
! m+ ?, I8 B. g3 I4 B$ i ( (eq dialog-state 2)
5 f Z9 S3 M8 C) S* c3 @% H( A0 D) c
(if (= (cdr (assoc 70 (tblsearch "LAYER" elayer)))& x* L/ h& X" O M
4+ T9 K# o6 k3 L1 g3 N! @' }" d
)
$ [, o- G+ y+ ?% e ;;; new selected layer is on a locked layer
1 X2 v, E. J( o9 y# A ;;; we can simply modify the hatch properties2 @0 ~7 C1 @( M. u# S
(modify_hatch)
. _) E% [+ Z5 }0 v (progn
0 d7 P. R$ r6 F& a5 D4 w (if (= (cdr (assoc 70 (tblsearch "LAYER" (cdr (assoc 8 (cdr elist))))))/ z. P1 i: t! x. z$ }7 q
45 u0 q" [0 Z* z' D" b, U
) 0 K, p0 W6 j- H
;;; We changed the layer previously and now the hatch lies on a locked layer.
& U- {* a* I: b" T# e ;;; We have to unlock the layer forethat we can update the hatch properties." Q, K4 T9 [3 x- ~2 a- b
;;; If we don't do that (entmod) fails to update to the new layer.
4 l8 _# l' |" A# z& C- o1 f (progn3 @5 Z8 ^- X% B& h6 g# ~
(setq layername (cdr (assoc 8 (cdr elist))))
# P+ x2 C& F) r1 V5 }% h (command "_.-LAYER" "_Unlock" layername "") ;;; unlock the layer5 L4 o; B3 o# V" Q" R4 `
(modify_hatch) ;;; update the properties' o k4 F" Q+ Q3 R7 q
(command "_.-LAYER" "_Lock" layername "") ;;; lock the layer again
$ N# Q* O. b6 r. ^4 s8 S )
# @9 I$ F% f6 V9 a/ z) |0 m+ x6 R ;;; All other cases we simply update the properties
7 I# X+ @1 c; T (modify_hatch)8 T! E5 O! @4 E* T7 h" M8 n) O
)
/ S) _7 V9 N/ v6 Y )" c8 n- h, p. D7 h4 h' S
)
3 j0 ?$ T! b7 I3 V9 o9 N& I (if (= (checkforlockedlayer ename) nil)
0 \0 a! Z" ^+ o8 F (command "_hatchedit" ename)
6 {+ ?5 o$ U- b; R( b. A* O. P+ A9 W (alert ;|MSG111|;"The hatch object is on a locked layer.")
! R' h N" Y1 D/ a3 q: J0 r' M )
" Z7 a8 B0 e" f- L! H% | (ddmodify ename)" ~5 I# [5 C! `" w5 s( j/ F
)
+ B0 Q/ \) j; a# ]+ O/ K4 k! v. z )
- ]- l4 l2 ^# J )$ |% Y4 G& K$ n# |! T
;;
+ h3 Y, C1 e H+ q" I ;; Modify BODY
+ w- P2 |' w/ S/ r& e& w ;;
2 [0 |; e% o- j6 f0 H* q( U" a, [( d (defun modify_body ()- S! L x) m8 B, {2 m
(modify_prop_geom)* o5 a" v; f5 d1 G4 w
(entmod elist)
! t( V K( d' f )
$ o9 I) A" J7 T/ `1 n
( I, ^: s0 h* S q9 e" f7 e (defun ddbody ()
0 m1 {! [# B: z) b, \ (if (not (new_dialog "ddbody" dcl_id)) (exit))
5 h3 D* Q* ~4 E. a0 q# o ;; Set initial tile values
- ^- _- ?! N% I. A (set_tile_props)! d0 U$ X+ S' r) w1 K4 `
(set_tile_handle)/ c+ [" ?* Y$ n' A
;; Define action for tiles1 ^8 r7 D. ?2 K& T: \- a
(set_action_tiles)7 ?4 P" Q- b; W$ ]7 p4 S1 x y
(setq dialog-state (start_dialog)): Y" W4 }. C M+ X$ S
(if (= dialog-state 0)
$ x2 Q8 Q$ g# N# }1 S N- y7 a (reset)# o3 g: ?9 }1 J" E2 ]: I) M
)% b; z, _) ^* T( V0 B, O6 Z
(if (= dialog-state 1)3 w) H* b! u) R! v0 u% F# U
(modify_body)
/ ?) H$ L4 \# H" i" |7 K )
+ j9 ^' }' f6 a )3 A5 ], i c3 o& @- Z) U8 v/ c
;;: m/ G: ^! m; V' K& g8 G
;; Modify CIRCLE0 f# Q$ C: A9 Y! G9 @
;;
9 c! w7 o3 X. _+ P" g3 L (defun modify_circle ()5 i) ?- |9 U0 Y9 T
(modify_properties)
5 d: k3 I8 Y5 q0 M) }' U (setq pt1 (list x1 y1 z1))
% k: ^: K) j! K) m9 O. P0 M (tempmod pt1 10 1)+ j! i& ~! N( |
(tempmod radius 40 nil)
1 B/ z! ]! L2 K0 \ (entmod elist)( p- x2 a( t& B. Z; N/ X* ~, _& y
)
! I! g ~+ v4 N0 R! m( T, t- j3 U# }% n: k) a2 j1 v$ v
(defun ddcircle ()2 f' h( W6 @( l* Q" c' O
(if (not (new_dialog "ddcircle" dcl_id)) (exit)); r# B. `9 u- t
;; Set initial tile values: I8 W2 J0 M' @' c
(set_tile_props)
3 F1 w+ |+ O$ @/ U! N (set_tile_handle)
4 d+ h# {) A, q% w# H (set_tile_pt1 1)
+ x3 |3 f5 _: p0 {1 h9 ~! y2 B (set_tile_rad)
! J3 z2 o& s) i+ }5 l: A- O (cir_calc)" P! r- m# y8 S
;; Define action for tiles
. L3 X& F/ r z1 h (set_action_tiles)+ V7 z# R5 F7 h, d% p. w: z* o1 l
(set_tile_pt1 1)
' P9 \$ ~ R: P' |% k6 | (setq dialog-state (start_dialog))
+ S( Y" ]7 _& E8 m& O+ k5 ~ (if (= dialog-state 0)
5 r& p. o8 ^4 m1 ]/ n1 Y' @( n' | (reset)
( J& V) d5 S; J! g: r )
! Q5 O, K+ v& a4 k, R; D (if (= dialog-state 1)6 v: F, ]* [9 U& t
(modify_circle)
3 _' E/ a5 L1 P4 \4 p W )% G4 L8 m! Y/ C5 K( t
(if (= dialog-state 3)0 G2 c- t/ z0 |& O( x0 |
(progn* w. r. R4 D' H9 g+ C
(modify_circle)& B2 i! U; J! f% d" J
(setq pt1 (getpoint (list x1 y1 z1) "\nCenter point: "))
, n, ?, X' s# s1 F) l (ver_pt1 1)! Q" R- W3 F, }4 ]; X4 p a9 ~0 ~( w
(ddcircle) o |/ o' f6 h- l& U
)4 {9 y. c. o; U
)( ~6 y% k/ U, U7 ~8 D3 k
)
0 h. L7 T* }* ^ p. h, c# X ;;
- i" l. s" f' @' Z* O ;; Modify ARC2 e5 t9 Y+ N* ^/ X( J3 l0 T" x7 M
;;0 a$ i8 ?+ i* |1 Y6 l, y0 B3 B
(defun modify_arc ()
6 X. h! Q4 [8 U (modify_properties)% B' h! A- ~ n/ P) R2 D1 {: ]
(setq pt1 (list x1 y1 z1))
& Y0 l* p) e- m$ L3 d (tempmod pt1 10 1)1 `4 ], U& Y W% P1 U
(tempmod radius 40 nil)& m6 ?( ]4 L7 R: V2 U) D
(tempmod st_ang 50 nil)9 {3 B2 y" }( m0 y/ [ }
(tempmod end_ang 51 nil)
$ W1 y$ e5 ]7 D9 e (entmod elist)# }) p. `% A( B! B
)1 y5 a! T8 T2 u3 a9 c- Q
(defun ddarc ()
* }; d6 W5 | m, e. M" s) w (if (not (new_dialog "ddarc" dcl_id)) (exit))
- S% N+ [. b2 e% Y$ v+ q ;; Set initial tile values5 c' w7 u) T5 y6 f* q
(set_tile_props)
: g' z3 }: r5 ^3 p1 p7 K. O (set_tile_handle). w2 w0 B }1 \7 ~( N
(set_tile_pt1 1)
3 |" \/ q t, @2 k8 z (set_tile_rad)" q& g1 i. y; F8 @8 M
(set_tile_stang)2 o; v" _% D' P5 e+ g9 z; X6 O
(set_tile_endang)
p8 }9 T7 T: e, t8 V2 E0 ` (arc_calc)# X" c; H# l# u3 C, E
;; Define action for tiles
- c5 F& _ c/ ? (set_action_tiles)
8 ^; M+ @0 I O; x3 T6 x (setq dialog-state (start_dialog))/ j# F% \' A' d0 O+ E% y8 v
(if (= dialog-state 0)8 l1 m# X5 Z& z8 Z$ J$ f& y
(reset)% Y }0 s% R O
)
, K5 c% w9 `; m (if (= dialog-state 1)" Y# H4 O1 g) ^6 A! O
(modify_arc)
3 p2 g+ Y& U% [4 a, Q7 q/ r# | W )
' g, S! R- P2 e8 H (if (= dialog-state 3)0 Q; C4 Y) b9 q4 V2 M {
(progn1 t3 m, b6 T' | t# N# Z1 s4 X
(modify_arc)
& Q* v9 C6 s5 y; N (setq pt1 (getpoint (list x1 y1 z1) "\nCenter point: "))9 t* X1 Z( A- P0 ^' }& t
(ver_pt1 1)
( m/ M" R- @$ y. o y( _2 Z) \8 n* t (ddarc)
5 R: [% G0 ^" U0 W# w )9 I+ z) d# `& [% }6 ?8 P
)% k& W8 m6 N/ u5 O
)
# ]1 }( ]3 b& W( K! z ;;. l9 c( T" M' V
;; Modify SOLID or TRACE0 i4 n* u" A$ D2 I6 o! e- U, ]
;; Note the Z value of the object is determined by the Z value of the fourth1 Q* [/ x1 D( A5 [& d+ d
;; point - code 13. Changing the point values of a solid or trace from a UCS
5 w3 C2 a. V! A) M; J4 B ;; that is nonplanar to the UCS the object was created may confuse the user.
/ E6 h2 I& N9 {( Q$ n3 } (defun modify_solid ()8 f% Q2 x4 l* R* a$ c+ S6 J) u* h
(modify_properties)* [8 n+ O. k5 Y% A$ o8 a3 q3 ?
(setq pt1 (list x1 y1 z4))! N" Q5 M% U; U/ p$ `
(setq pt2 (list x2 y2 z4))+ {( n) r0 n! [" I4 S2 B8 t
(setq pt3 (list x3 y3 z4))
, I) W: b9 P' _ (setq pt4 (list x4 y4 z4))1 B' n* L0 w! d: V% m8 v
(tempmod pt1 10 1)
, @. U. T9 c. L3 a/ @ (tempmod pt2 11 1)
6 o% U* L4 d& ` (tempmod pt3 12 1)
4 F% ^* B/ P0 E% a* k/ c (tempmod pt4 13 1); [- ` H- P; y( N/ Z4 D/ Z2 x3 W
(entmod elist) p: i/ M( h E# A3 X6 w: l [
)
* e6 L; _* @/ `2 K1 O, s$ P0 l% y7 w @7 n1 _- [% W
(defun ddsolid ()) g$ f9 ` \6 x6 r
(if (= etype "SOLID")
! _5 w" l+ c9 Y: N* E0 P' {$ Q2 V (if (not (new_dialog "ddsolid" dcl_id)) (exit))5 a, Y8 s2 D, B) q
(if (not (new_dialog "ddtrace" dcl_id)) (exit))
; J2 d+ ~7 h7 P" n. N )
# K6 @1 l. F6 z1 S/ F% W, D ;; Set initial tile values9 W( _" ?0 d6 ]1 W) Y, s( u' e
(set_tile_props); {1 K6 _: u8 E( a ?4 F' Q
(set_tile_handle)
4 |+ h" v' R y& E" V (set_tile_pt1 1)& L# N( u S/ F7 g2 p E; V' }3 Q+ D
(set_tile_pt2 1)
, Y; a0 f( O) E v& H" T: N (set_tile_pt3 1)
; \8 A2 V t* `7 r, J (set_tile_pt4 1): P7 A( c% c, r' ?) D& r6 B, Y% U
;; Define action for tiles- t& k& t0 D7 c! B. K
(set_action_tiles) A* Z. q2 w3 K( ^* \* ^( c8 I
(setq dialog-state (start_dialog))# j) c$ D$ @, G5 i5 A
(if (= dialog-state 0)
! U3 ], W. p2 X: y* M (reset): @- U" |7 ~# e3 M1 s
)# Y- \* z8 F( z' s
(if (= dialog-state 1) f$ b' r& f5 Z5 i" k* F. x0 X
(modify_solid)
* V) F2 z/ X1 U; m/ ? )" N; v( A" V3 G; c) F8 y
(if (= dialog-state 3)
% |2 R8 a& k+ C8 a# O (progn
+ t' R$ W% T6 A8 V1 t* ` (modify_solid)& v( ~1 g# ]7 b; Y2 d7 w8 G
(setq pt1 (getpoint (list x1 y1 z1) "\nFirst point: "))
( A4 o2 V! y5 r5 ^ (ver_pt1 1)
& K" P. e) z* T/ s: ] (ddsolid)4 @ t. z ], o! l8 Q! P7 p$ ^$ t
)
+ G3 P& x8 C f B) O: C& q )" Z/ @. ^: j& {, F& ], f: u
(if (= dialog-state 4)
' p7 B0 n3 ?* X (progn
: J# C% f) E8 [ (modify_solid)4 j5 w) r4 @ c9 l1 `+ F
(entmod elist)
" L, X2 q# _! U& q# W. Y; i* J (setq pt2 (getpoint (list x2 y2 z2) "\nSecond point: "))
9 S+ v) z1 g4 A+ e! f% k (ver_pt2 1)
5 D4 l) ^1 z- q1 J% k (ddsolid) o/ k$ B2 j4 h$ R4 t
)
: ]6 U+ P" h" o, A, C. y6 } )( y( e& q; U+ ~' O* @- c
(if (= dialog-state 5)
# p7 B8 z1 b- L' Z" U4 I! W (progn& K, Z+ y) F1 @5 d0 ~$ |( ^$ t
(modify_solid) z; K0 S5 B5 @6 K! c; K0 g
(setq pt3 (getpoint (list x3 y3 z3) "\nThird point: "))
# X# x0 B' n) X: @8 `' s) O6 i9 t (ver_pt3 1)
* {+ F E% X( z; J2 p: t9 H' @0 r% H (ddsolid)! v% b& w {; s& [
)& ^* a% b, {' M7 b: Q$ p! k$ t f7 b
)/ ?4 S, t- q& l8 M* |- @: J
(if (= dialog-state 6)! Z$ _. V6 {. E h7 p2 E
(progn8 [5 m6 T) O7 _+ H5 X- i* H* U' U
(modify_solid)
9 |4 X7 J! ^% h, H (setq pt4 (getpoint (list x4 y4 z4) "\nFourth point: "))
& \1 \ a: G: x1 o$ C, Z% G (ver_pt4 1)
/ Q" u! y; K0 d2 H" g9 L (ddsolid)- R* l: V( s% A) \
)9 C6 F' v: F# L8 E8 m
)
2 z5 R q8 p7 k, y. t4 j ); w0 _7 |# x$ `' n
;;% U4 o* F( A, v
;; Modify 3DFACE( z s M" ~3 j
;;
' h7 E! t! s5 F7 K6 r3 [ ;; Check visibility of edges
4 J- L/ H# G+ z" r3 W4 I0 L ;;
. I3 N3 F& g3 t G (defun edgetest (/ bit1 bit2 bit3 bit4)6 k% K+ F' t$ ~3 L" @0 @# d
(if (= edge1 "1") (setq bit1 0) (setq bit1 1))/ R7 M; _4 X N: v. B
(if (= edge2 "1") (setq bit2 0) (setq bit2 2))1 y' u$ S# ^! ~
(if (= edge3 "1") (setq bit3 0) (setq bit3 4))$ O) D& k- c ` y6 k/ W0 v+ b
(if (= edge4 "1") (setq bit4 0) (setq bit4 8))7 V9 u+ [- i& I( i
(+ bit1 bit2 bit3 bit4)! i8 E2 |0 D: j2 [" y- Y4 G
)
. |! l8 v) s3 d* N# m& L8 m; f3 i H; [# g& ~) l& n6 W {4 F
(defun modify_3dface ()
6 [7 {: I5 v: Y" M. T, k$ c (modify_properties)) ^' K6 G$ {% P
(setq pt1 (list x1 y1 z1))" `3 Y5 { q1 S& ]1 t, j: a
(setq pt2 (list x2 y2 z2))
, I* v+ K Z. W' k/ j0 a4 L# y (setq pt3 (list x3 y3 z3))
( d* [$ m% X/ @" ~; e: S (setq pt4 (list x4 y4 z4))! V) T3 q H# B
(tempmod pt1 10 0)0 r( F) |* _$ w' @2 S/ I: D
(tempmod pt2 11 0)
$ D& N) v% i0 V2 j3 w (tempmod pt3 12 0)
* i4 A' C) q/ c (tempmod pt4 13 0). N! d7 \7 W5 Y3 f
(tempmod (edgetest) 70 nil)7 v& [( G$ M* T- O# J4 O2 \
(entmod elist)/ Q& X$ \% a. L3 C$ O
)2 Z, S L6 y7 N d
) c- N3 L# X( ?- @5 h0 E1 B (defun dd3dface ()# o: Z6 U9 _' @4 R9 a
(if (not (new_dialog "dd3dface" dcl_id)) (exit))' y5 @& u& T: d+ c9 ^, N! E& n
(set_tile_props)
% |9 U* l9 w. Y8 U (set_tile_handle)3 P2 y0 e2 l* i7 X' b+ s0 Y
(set_tile_pt1 0)' B" v0 @; ~# _. T+ _ D
(set_tile_pt2 0)( R3 z3 m5 b J6 n. L
(set_tile_pt3 0)
- [- W3 R6 u3 y' f! W5 L( U' t (set_tile_pt4 0)
; A, n$ u6 t6 Y5 L1 k p, A (set_tile_edges)* x5 J) [ o: h0 b
;; Define action for tiles+ k* G/ {# y# } h6 l" |4 g h$ ^8 S
(set_action_tiles)3 z3 v) Y% u$ u
(setq dialog-state (start_dialog))
! |# E( l5 S& ^3 g. J3 U' k, V( @- \ (if (= dialog-state 0), W Y, D5 m+ Z' Q
(reset)
& R+ r7 C A9 W+ L+ ~2 I )! P( C, V. j; ^5 L6 E5 k+ u2 F
(if (= dialog-state 1)
7 m3 {- Y& r* Q" Z+ C/ h (modify_3dface)/ _5 C' ~; h, W4 u! \
): A; W- Q* D( j9 _* W: k" I
(if (= dialog-state 3)- l6 p7 h+ @9 A0 u! O& R
(progn
# B: B( R3 n0 s& @. ]8 ^4 r (modify_3dface)
; r9 L- _# D7 h4 ]* e (setq pt1 (getpoint (list x1 y1 z1) "\nFirst pt: "))1 J Z- N2 r; I& h) h' H) ]
(ver_pt1 0)0 E" R, x: z! O8 q- R- X) p* g
(dd3dface)
$ m7 N7 \3 `" k0 i8 U )' S l" i& K& u! y) o
)1 d, s$ D: _; c, F3 i" z& i! b6 R; \* c
(if (= dialog-state 4)+ [! b, w9 z8 e. X# ]
(progn9 l: v' h3 W8 S+ v" V
(modify_3dface)) ^( e& ~( Q5 p3 |& a; G
(setq pt2 (getpoint (list x2 y2 z2) "\nSecond point: "))
, P3 \, n3 Y" w9 o4 F (ver_pt2 0)
1 n6 y" C9 Q3 S& E' p (dd3dface)' E0 t6 U' U9 j+ }! o
)
& L" g7 v7 ^4 R% R" _# m2 w )& S1 E' S' C% S" V
(if (= dialog-state 5)
4 o9 k1 u" D* R' T3 s$ E (progn
x) Q. D- I- p% x9 C (modify_3dface)
1 S `' x. `3 }2 {' v (setq pt3 (getpoint (list x3 y3 z3) "\nThird point: "))
% p4 r) w+ t& D0 b1 P- e- W (ver_pt3 0)6 u- w" d& |; T( y# z
(dd3dface)
5 E3 u2 C( @6 I7 G" j9 Z5 y )
: `) b& u' o% V/ L; o3 v! j )
' N/ q ]' f7 X) A% ` (if (= dialog-state 6)" R, D. v j* M% ~
(progn, n: W& o& H/ t( N/ Z
(modify_3dface)2 ]+ U2 q, w3 a4 y! K* O
(setq pt4 (getpoint (list x4 y4 z4) "\nFourth point: "))
6 h8 c- h% y6 p+ U8 s (ver_pt4 0)
$ O. i! G4 t- i+ {8 G+ A$ p( |" @ (dd3dface)
$ W8 a. r& K2 E. [: A )
3 e- ]% y# y& P2 J! R" F5 N )
# X: e6 t/ s2 R4 v# p( f )" A, G# ~7 _2 \% X# b
: O3 n8 H$ b2 P$ O ;;7 i' d# l8 R+ m7 R# P" [( g
;; Image functions
; j+ `7 a& j) |8 A7 ~* d ;;, x: b3 R; u1 ?- S; [
(defun image_scale (/ upixel en n userscale temp) S. m* C2 [9 m- K* n
;; Calculate the size of an image pixel in AutoCAD units
- D- x* T) x. U- Z! S9 {! I (setq upixel (distance '(0 0 0) (cdr (assoc 11 elist))))0 [7 Z2 W! k0 k& E: E$ _3 i
1 e8 n' U& i$ J5 Y. I' r ;; Retrieve the user scale
6 `6 P" h' N5 D* t. o$ ~ (setq en (dictsearch (namedobjdict) "ACAD_IMAGE_VARS"))
* f, j& h# O: {4 K2 ]% K) M* e; k% g3 N3 w1 w
;; Next, extract the image units and pixel resolution0 H0 M! P; @ G4 s, t. g
(if (or (= 0 (cdr (assoc 281 image:olist))) (= 0 (cdr (assoc 72 en))))
, G* y% W% b' e- O% M$ y2 g, e/ l (setq image:scale (* (cadr (assoc 13 elist)) upixel))
- y$ U5 X, M, F' M& T1 o2 Z (progn
5 J4 S1 Y1 l% n3 V1 ]$ C ;; Convert the user scale to the proper word
, W# P$ Z5 _ i p, L! g% c (setq n (cdr (assoc 72 en)))7 v! |( h3 q/ _: [8 T* A* p! V
(setq temp (getvar "LUNITS"))4 z; t: p p- Z6 a
(if (and (/= n 0) (or (= temp 3) (= temp 4))) (setq n 5))% ? D' Q% O0 \* p2 ^( \3 _9 o
(if (= n 1) (setq userscale "Millimeter"))
! W: f3 N/ P& j; z (if (= n 2) (setq userscale "Centimeter"))0 H6 p# ^* ?6 p. u$ k6 r: p
(if (= n 3) (setq userscale "Meter"))0 K( Q& h/ I& z, l
(if (= n 4) (setq userscale "Kilometer"))! i; H- r L: h8 r& R
(if (= n 5) (setq userscale "Inch"))$ X8 `5 B* Z4 y
(if (= n 6) (setq userscale "Foot"))
5 j# o( H" b+ W1 \: q( t (if (= n 7) (setq userscale "Yard"))1 K' Y7 h' z! {& ^; Q: _# C' _
(if (= n 8) (setq userscale "Mile"))2 F; c |; _: z; i- I
(setq image:scale (/ upixel (cvunit 1 "Millimeter" userscale) (cadr (assoc 11 image:olist))))
+ z- F. Z; L2 d' V )
2 D& s4 h! R# w+ e! }( N )
( F+ t- K8 ?) s* M6 A )
$ D& E: {8 c, t0 Y$ i" w: {% F! T3 h8 @( k2 w" a# D1 r
;;
2 ]3 {9 A* U* i1 _: e ;; Scale factors for block insertions
- c" u- B6 I: ]: U) f" Y ;;6 B6 H3 b; S2 K7 Q
(defun image_set_tile_scale (/ temp)( v& W+ h' _5 ?. C3 l
(setq temp (getvar "LUNITS"))
* ^6 o9 L( U$ P/ ]0 L& Z (setvar "LUNITS" 2)$ E: T4 x! z7 R# T
(set_tile "xscale" (ai_rtos (* image:scale image:mult)))
) G! j: J( G! h; [8 E (set_tile "wid" (ai_rtos (* image:width image:mult)))
+ d& g$ P6 B9 ]4 f( G (set_tile "hght" (ai_rtos (* image:height image:mult)))
5 ?8 c6 E1 C" Y; L (setvar "LUNITS" temp): s, a# I; U4 t$ N/ ~2 y) O
)
& K R' J9 {, E/ E1 }
0 a& x Q2 ^/ e ;;" M+ ^, j! c0 R
;; Set the scale, width and height values appropriately.
& p- o2 E+ J8 R+ w1 j) D) E) F8 C8 { ;;' U( W" V2 m ^4 Q) T7 d- W" E
(defun image_update (field value / orig_value new_value mult)
, R/ `8 k& R4 U (if (= field "xscale")9 S" }3 H8 [. u& k5 }
(setq orig_value image:scale)6 [, I7 H( W0 B% e
)
2 [. X" y1 d) N (if (= field "wid")+ b- T% x1 F ]" A% f
(setq orig_value image:width)2 W9 L Z( g7 l9 f1 x, x0 |
)8 [4 ~5 `5 Z" X5 m- q
(if (= field "hght")" S+ w0 g' I& s& a" Q% m3 P) g( g
(setq orig_value image:height)
# W+ I5 e( _5 U8 B" k )
- s% R' V M0 M (setq new_value (verify_d field value (* image:mult orig_value)))/ U; p9 R2 [4 z1 ?% E' W# e
(if (/= new_value old_value)1 u, F# N8 K3 a8 [4 M
;; Make sure the user has entered a sufficiently large value+ J9 y E8 m$ v4 O X
(if new_value6 A* {: g* T7 s$ K6 x
(progn
1 I" K. `$ C& l; x0 w! Y (if (< new_value 1e-8)
1 Z7 A" \: x) {+ X4 U& r (setq mult image:mult)
) e& m* w/ N( g/ b( Q- c; k (setq mult (/ new_value orig_value))# j) R3 P; D; b7 T1 d1 C/ c8 j
)
: X% j7 s# C j% {4 \4 n$ V (setq image:mult mult)
7 T0 H" w& n- Z5 N E: c* b* o (image_set_tile_scale)# r0 V* g) L, ]
)3 @( Y; X Q# J0 J; h( ]% J
). w. l0 v; ^/ w% e6 A6 z
)0 d: z4 I7 Y/ X. Y1 d# N
)
# ~: z% A# |% }) b; @# f l) a
2 z6 c, O" U" ` y6 j (defun image_disp_opt (bit)2 {" Y1 l3 t* I5 V' i/ n7 U/ j
(setq image:options (Boole 6 image:options bit))& P: `1 K# Q' @
)& n0 T" i% ?% W: ~ Q5 w: v; ?# |& v
' ^7 h5 o5 S& [& A, m1 X" U+ m
(defun image_modify ()0 D0 c& B, W2 P
(modify_properties)
; f& |& @1 d5 {* R (setq pt1 (list x1 y1 z1)): _0 V3 {! _3 r$ {7 _
(tempmod pt1 10 0)0 d1 O. c: M4 \5 L, h
(entmod elist)
* {: s5 C9 r0 R0 r+ e )/ M' O7 G+ I# B% p' m8 v$ ~/ S& h
3 s! J6 M& k! g7 U7 {0 L( w
(defun image_clean_variables ()7 ^$ L/ R2 n x, k6 ~. h
;; Clean up global variables used here
8 j+ j' n, G& I" @$ O+ m (setq image:scale nil)
3 m) |3 X( F! [5 | (setq image:angle nil)) q$ o. m2 B5 g: f' ~
(setq image:width nil)/ H- j! F# R) `4 g
(setq image:height nil)
. K! B j" W& I4 O' b6 L( Z" J1 z% u (setq image:options nil)
9 z$ c) ~/ O. ~6 f7 Y (setq image:oname nil)
" e* z3 \% d& Y8 N9 b, s$ k: q (setq image:olist nil)
0 b5 O% |- q0 f4 X1 |& I) N (setq image:mult nil)
; L U5 Q* y8 _+ H# I7 O1 ~6 r5 r (setq st_ang nil)" ~( o. y! y; f) s( p, O5 d
)
. T+ l, j9 L. X- M- L3 `+ A% \8 m/ S4 M8 n' ?
(defun image_scale_vector (v1 value)+ H0 L* ]% k) `" w$ m' Z: M% a
(list (* (car v1) value) (* (cadr v1) value) (* (last v1) value))+ V9 q# i4 s- V8 G/ Y
)
$ V* I5 d" w2 r0 |1 {( N+ {: m# t" x% b7 F
(defun image_cross_product (v1 v2 / vx vy vz)
E$ B9 P5 g" M# M$ u8 U; p/ p! ?% N (setq vx (- (* (cadr v1) (last v2)) (* (cadr v2) (last v1))))/ u/ w. E4 o) V; r# }6 D
(setq vy (- (* (car v2) (last v1)) (* (car v1) (last v2))))1 k2 \9 ~. r2 e1 m
(setq vz (- (* (car v1) (cadr v2)) (* (car v2) (cadr v1))))# w+ Y$ o& O1 }8 O
(list vx vy vz); f5 J) B9 v& R F$ V9 ]6 \' }6 u
)
5 ?; O- X$ H% q6 c
1 [, f. i/ C, _ C (defun image_dot_product (v1 v2)
: S1 _4 N' l3 y3 O: E (+ (* (car v1) (car v2)) (* (cadr v1) (cadr v2)) (* (last v1) (last v2)))- v3 ]+ d8 e! \( C
)' }+ ~% M5 p$ G0 \5 [# s, h$ [
/ w9 q$ r3 j9 ?5 m (defun image_add_vector (v1 v2)
' U& q/ p4 [$ v# s0 ~/ q, O+ ~ (list (+ (car v1) (car v2)) (+ (cadr v1) (cadr v2)) (+ (last v1) (last v2)))
$ P9 j! w. U3 s* D5 q/ } )' C, s, [, Z, \- X
# Y4 Z; h H: _* i4 t (defun image_subtract_vector (v1 v2)
v, b# G/ r [9 p (list (- (car v1) (car v2)) (- (cadr v1) (cadr v2)) (- (last v1) (last v2)))2 S3 u$ {) F8 k1 p% p8 }
)
: P0 l2 H# C4 O+ s4 g7 j4 r% B: A8 U) b+ @/ y' x' y8 c9 n
(defun image_normalize_vector (v1)
+ @+ F, |7 X% U, e (image_scale_vector v1 (/ 1. (sqrt (image_dot_product v1 v1))))
) a+ S; O& Z3 d0 c* n )
% Q* [% Y( e1 v! F' x# e. G' W) g$ e( G; N& {, u8 N
(defun image_rotate_vector (vector angle axis / along_axis axis_x_in_rot_plane axis_y_in_rot_plane in_rot_plane)
" h" U l. B" i' r ;; Normalize the axis& a y1 v5 P% b1 [8 r' p* ]! k
(setq axis (image_normalize_vector axis))
1 w" V4 K; F/ i/ H, I2 w$ ?, Y' Q1 ~ (setq along_axis (image_scale_vector axis (image_dot_product vector axis)))9 r6 @8 U" j. _ c$ m
(setq axis_x_in_rot_plane (image_subtract_vector vector along_axis)): D+ a! D a0 K U9 `% w, y
(setq axis_y_in_rot_plane (image_cross_product axis axis_x_in_rot_plane))
7 o( k- q g( q (setq in_rot_plane1 R; w3 { s+ C6 h9 g f
(image_add_vector
" P( D6 y# v8 y& U5 e (image_scale_vector axis_x_in_rot_plane (cos angle))
' m' D9 h/ e0 j: T. e* U (image_scale_vector axis_y_in_rot_plane (sin angle)): A e. ?# I8 ^: {
)
- T {/ N' ?8 {! [ ~ )
4 d0 _( ~6 w4 [. u+ S (image_add_vector along_axis in_rot_plane)' h- b( ]5 A! R1 z% ]
)" I0 i6 w! E2 [3 X
8 _/ }! b( Q" k9 Q) W m5 u% _ ;;9 C$ Y8 F1 Z' C' b7 y$ u r; D8 D2 Q" t
;; Calculate current rotation angle if appropriate.
2 R! ?- c% x1 _3 h- v# R: D+ m ;; If not, grey out the rotation field.
* k3 s3 b7 |0 _8 L( p3 {8 _+ [ ;;: v! U8 C/ [* j
(defun image_rotation (/ normal rlength zlength sqrt_tolerance)
. o8 N# q* \- q4 R ;; Determine if image normal is codirectional with
5 r) X. b! a" z/ z ;; the current UCS Z-vector.
. Y6 v. Y' |; @1 e0 r ;;: p1 u$ \2 k a& C' ?/ {
(setq normal (trans (image_normalize_vector (image_cross_product (cdr (assoc 11 elist)) (cdr (assoc 12 elist)))) 0 1 1))
1 x" Y# O1 l$ l2 R% C4 l: m2 [' y (setq rlength (+ (* (car normal) (car normal)) (* (cadr normal) (cadr normal))))
( M" D N; G6 B# i8 @ (setq zlength (* (last normal) (last normal)))
4 A# d) R( g! a2 C6 R* J ;; Note that the value .0001 in the radians is approximately 0.0057 degrees.
( {, u; G. k* @# i8 J6 ]3 G+ I ;;
5 [3 T8 V& W, W- I ;; cos(.0001)^2
& j% d( ?) q# b; a2 t, | ;; Tolerance = --------------' l' w2 s3 A6 q1 U- g
;; sin(.0001)^24 D) y( v$ F* p
;;
" m5 ^/ T: A3 s" j: f5 c( @+ [ (setq sqrt_tolerance (/ (cos 0.0001) (sin 0.0001)))$ ^& x- c$ D( U1 I( U H+ G
(if (and (< (* rlength sqrt_tolerance sqrt_tolerance) zlength) (> (last normal) 0))
' k( x) |) s9 X9 q' I4 K (setq image:angle (angle '(0 0 0) (trans (cdr (assoc 11 elist)) 0 1 1)))/ s( z7 p/ k) L# B0 M
(progn* a9 b7 O. {- O! r4 E. C
(mode_tile "st_ang" 1)0 n3 X" B z$ B, {* ]
(setq image:angle 0)
2 c& j. L( d/ t# E, c$ u )
7 M$ g: m( X5 i' \6 _5 N )
" ?: I* d5 t6 `! m# s- B7 V! P )
" ~; q! q& h# W- O/ j, u1 X; e
;;
$ F' x- l( k+ B' t3 v ;; Modify Image2 `( y3 v" d# v- C
;;5 h' N" R0 e/ p0 X
(defun modify_image (/ u_vector v_vector z_vector)3 c+ B) \9 }- X% y9 g* \5 D
(modify_properties)6 }! B8 l/ g! C( I% S5 ^2 t; z" I
(setq pt1 (list x1 y1 z1))
1 m$ ]. o1 u4 O3 g( K4 ?7 Z (tempmod pt1 10 0)8 ~( N+ |: u' v4 ^# \
;; Make display option changes to image1 y" z: g2 L% L- G. k/ r
(emod image:options 70)
: f, k! [1 a) C s% _( T8 | ;; Get the u and v vectors: B+ I+ i, c' g
(setq u_vector (cdr (assoc 11 elist))). B1 t# }( K. M8 s/ D& I& x. i; z
(setq v_vector (cdr (assoc 12 elist)))
* Z; J# T% N( U
) e E; r' ^' ~ ;; Make scale changes to the vectors
# W0 y, g& a$ Q2 V) ] (if (/= image:mult 1)7 B+ d! s: W, _
(progn
; e# m4 H3 U2 J. J3 m (setq u_vector (image_scale_vector u_vector image:mult))3 Y) c' |. ^! f, e7 K/ k/ O: ^
(setq v_vector (image_scale_vector v_vector image:mult))
( c$ e. S% p* B! N7 E9 f )
7 ]) _* \( m7 ] )
( E3 H' }2 D9 j+ X* k ;; Rotate the vectors9 X: J+ b2 r w8 D
(setq st_ang (- st_ang image:angle))& W0 D& `' w1 R: T3 E
(if (/= st_ang 0)
6 {/ E) {# Z( r: L7 u d* x (progn
+ S" E8 q7 @! B1 E! a: A (setq z_vector
; d" h' e& M0 L* f (image_cross_product/ Y$ E7 `8 M7 g+ x c) ]
(image_normalize_vector u_vector)4 ^0 I I9 b2 o, X" g4 W
(image_normalize_vector v_vector)9 c, S, b4 y4 I
)) X( d: t( K& k) B3 t: L
)
& y& z. n E$ G( |, p* m (setq u_vector (image_rotate_vector u_vector st_ang z_vector))2 R) B8 n) ^1 F9 [1 C F2 W
(setq v_vector (image_rotate_vector v_vector st_ang z_vector))- m4 V0 J4 D4 X( ]. m8 r, b
)8 |, ?+ M' M; C( i
)
) P2 [$ R+ r b: k# d (emod u_vector 11)
) s0 Q) `/ s3 ~, B3 t/ v (emod v_vector 12)
# J1 v5 j% E6 G% J% k (entmod elist)$ H. r+ z/ d" A1 H& b1 t" t% `" T
)' N/ \7 v' C4 y' A3 s3 ]' Q6 C' v
0 X! r6 Y" A; p ;;
' X# [$ t3 G# o! Z0 z ;; Run imageadjust on given entity, working around possible3 U+ G) P' n" H: F
;; re-entrancy problems
5 o8 K: m4 t. |& {5 @) X, W ;;! e u; H- w f
(defun image_adjust (ename)- k3 M. w2 U' R$ W& H1 I5 D/ @
(verify_arxapp_loaded "ism.arx") ;; make sure it's loaded...
* ~$ z, d! G" c+ G/ [ (imageadjust ename)( F' c8 `3 l+ f/ e' l" ]$ c; h
)1 W7 D+ ?# ^! r4 P1 L( E. p4 m0 b
) B* v: W; p' G
(defun ddimage ()
- Z; ]& \& D, y' C) ]# h (if (not (new_dialog "ddimage" dcl_id)) (exit))2 Y) b+ @5 w s" R' A% J. j
! V$ S) H5 Z5 |5 Z
;; Grey out the thickness field.
2 D" A1 @8 z: L' `- N# x; j (mode_tile "b_thickness" 1)
; M* X4 ?3 r3 b3 d; k0 j* X( n (mode_tile "eb_thickness" 1)0 B g/ d1 r5 q @& n2 z- a
9 T) Y1 c7 v. h) m
;; Get the associated def object.
1 |: _2 }1 E% T! J) l3 I4 P (setq image:oname (cdr (assoc 340 elist)))
9 T' M7 E2 [7 o. S6 B8 J (setq image:olist (entget image:oname))
; z! L" }9 T. Z7 s
$ k+ S' A$ O3 R ;; Set initial tile values
1 T! C$ k* i9 e$ ^- p7 y7 R (set_tile_props)7 r; o* j8 l5 ^9 u# O9 r' n
(set_tile_handle)
6 I/ E' b0 m6 y/ j (set_tile_pt1 0)
4 ^6 B4 G$ H9 X (setq image:scale (image_scale))
: C5 \& M1 Z3 ]; r0 B (setq st_ang (image_rotation))
$ g1 j7 c, h; N1 a/ r: s) ~ (setq image:width (* (distance '(0 0 0) (cdr (assoc 11 elist))) (cadr (assoc 13 elist))))
! [- B: U. P% B3 A6 I o (setq image:height (* (distance '(0 0 0) (cdr (assoc 12 elist))) (caddr (assoc 13 elist))))4 |/ q! z# E t7 l8 F
(setq image:options (cdr (assoc 70 elist)))
7 {( H- ?; L" G" P$ }4 z) F5 L3 c5 W
;; Record the last multiplier for use in image_update function9 q* ?$ q5 x0 }5 `5 I1 n0 z' n
(setq image:mult 1)
* h: }, h) R1 M' v# ]9 q
; x8 j7 U4 _$ v8 t ;; Retrieve the image name
, Q; w! A' b% a, K (setq fn (reverse (dictsearch (namedobjdict) "ACAD_IMAGE_DICT")))5 S/ Q/ m5 P4 J N) m4 C9 Y
(setq flag 0)- b. i K/ O' z J
(foreach n fn
6 o2 p$ |! U1 [2 s (if (= flag 1)8 W! R" g/ U( [) i
(progn, q# \& `( a: r+ h. Y
;; Display the image name
$ ~3 p3 D, \" N. N( S, ]2 \ (set_tile "image_name" (cdr n)): H/ D" t |! U! f
(setq flag 2)9 z4 j% M1 o( M) {" `# Y
)
' v1 c% R# B# _& ~4 S( s+ H0 b )
8 _; d1 j& k% `- A" F (if (= flag 0)% ]$ b) q9 A1 D% c, w4 I+ E- S
(if (equal (cdr n) image:oname) (setq flag 1))9 D* C) j$ p' W8 @* a0 N. z. E
)+ }4 b: K# G X" M2 j0 P* z7 j
)
5 O% q+ Q3 {( s( J% i/ \* y: X6 L
(set_tile "image_path" (cdr (assoc 1 image:olist)))4 c$ ]6 |! Z1 Z5 T1 Q. h
(set_tile "st_ang" (ai_angtos image:angle))
. g$ Y$ k M: @: v/ y0 a (image_set_tile_scale)
, @4 n) O% J. t$ b9 p+ {4 u
7 g0 {. S+ p8 M# S% M9 R7 Y ;; Check the appropriate boxes
6 G$ Q0 U" ?8 E; V (if (/= (Boole 1 image:options 1) 0) (set_tile "image_show" "1")): c2 p6 _9 X' D1 e" ~; T4 ^: J
(if (/= (Boole 1 image:options 2) 0) (set_tile "image_non_ortho" "1"))2 Z/ y2 C: I. Y+ ?+ p! }; e- q; `5 W
(if (/= (Boole 1 image:options 4) 0) (set_tile "image_clipped" "1")), D1 e1 I5 C$ ^% T1 L6 y" |
(if (/= (Boole 1 image:options 8) 0) (set_tile "image_transparency" "1"))# T0 H3 q: C! v
+ ?0 o- Y5 B. n" v ;; Define action for tiles' ^* v( m# k z7 _" n
(set_action_tiles)
% `" o" d) n1 ^8 s% t" k (action_tile "xscale" "(image_update \"xscale\" $value)")
4 T* x. r* F* b7 d$ S- } (action_tile "st_ang" "(ver_ang1 $value)")2 h: q; g% `9 T$ T6 w
(action_tile "wid" "(image_update \"wid\" $value)")
6 R, P0 ~- O0 w (action_tile "hght" "(image_update \"hght\" $value)")
; ]) F: \: t. l2 ], y (action_tile "image_show" "(image_disp_opt 1)")
2 K2 @- H% Y: ? (action_tile "image_non_ortho" "(image_disp_opt 2)")( Y. L# Z3 ]2 d3 D
(action_tile "image_clipped" "(image_disp_opt 4)")0 R! a1 O2 G+ k' }
(action_tile "image_transparency" "(image_disp_opt 8)")
/ H/ C& ~# K0 } (action_tile "image_adjust" "(done_dialog 4)")( b7 J/ w% w. }
1 D9 g/ q& s4 L. K2 | (setq dialog-state (start_dialog))
1 F5 ^4 O' i8 v9 p9 s8 {% g( Z m (if (= dialog-state 0)* R. Z& w( f& I, X0 _
(progn
0 ?2 R0 S' u3 C+ P1 I4 [2 |9 j, u (reset)
7 R' y' S1 i* O# x% o (image_clean_variables)
9 {, u5 [' r- A, H- e )3 k. L; r8 v; L' t3 p5 h/ Q# }
)
) n& x- x1 i9 Q K+ L (if (= dialog-state 1)
( K z; ]* \2 K' V; t4 j; [ (progn( q# g+ K% N2 j
(modify_image)( `) j$ j# R9 o5 }
(image_clean_variables)
3 a* Y/ K3 X7 l8 \, l# n4 n ). {9 t3 N# H+ s* i, q
)- ~. c9 ~5 s a/ U$ n. i3 ^
(if (= dialog-state 3)! E/ }7 o7 n9 y% M; v, {; g
(progn
# M4 K1 ~0 B+ B |( J4 @; T (modify_image)9 S: j3 K0 } Z( _
(image_clean_variables)3 X1 i8 v5 x; r3 J* B- q
(setq pt1 (getpoint (list x1 y1 z1) "\nNew Insertion Point: "))% N& z2 ]) D" U: [3 e
(ver_pt1 0)
+ v# U! ~. j* i" i f (ddimage)" {1 ^2 o1 x# I# D2 P1 d- ?+ v
)
4 w$ U( U/ V- }6 j )
- k7 \' p. o& i2 w6 v! D r (if (= dialog-state 4)
# S, y4 s$ m8 w x, [# t (progn
6 i% l+ q& a( d. y$ B6 P, ^ (modify_image)
5 H; m0 S! W8 Q0 K. k' f( _2 C l (image_adjust ename)
4 W3 w5 j; E3 i+ c1 N (setq elist (entget ename))
: \1 s$ ~) ^, `, j) O (ddimage)
% Y' }% c/ _$ j )6 v$ H( Z" V& F/ K6 ~4 k
)
2 @' i! ?/ k, Y! Z' } P, {2 i, m% d ); _/ u) _% a5 ~+ }. B4 Z/ N
# B" |/ t* D) t! Q; [; Y ;;1 @2 _9 |, Y8 j$ N6 U& p$ I
;; Modify BLOCK (and its Attributes, if any)
S; \- S* I0 b, K2 ~. a ;;
5 o$ K# c* |) _" X4 Z (defun modify_block ( / el en2 p1 p2 oldp1 oldp2 new_hgt old_hgt attr T/ @) |% E4 v L7 k, v
new_wid old_wid old_rot scaling old_scale
* h0 Y9 X2 f5 e8 N xdelta ydelta zdelta xbase ybase zbase ipos)) b% m5 N) u/ Q6 v
(modify_properties)! C, {$ E' j7 _8 q
" D; i7 v$ D b% S1 i: I ;; First, translate and scale the Attributes, if there are any.
. ~9 k% Z L" _, F# h( x (setq old_rot (cdr (assoc 50 elist))6 f# l- M6 Y6 F2 \ }5 {
old_scale (list (cdr (assoc 41 elist)) |( n; _$ H. M- T; Y; S
(cdr (assoc 42 elist))2 `9 X; ^5 w: p! W
(cdr (assoc 43 elist))
! R2 O4 X" ?3 [: M0 B )
* b; B' O7 q U' a8 o scaling (or (/= xscale (car old_scale))7 U; ~6 N0 A( d1 U' `
(/= yscale (cadr old_scale))
9 {# s4 Z, h7 g8 T! p8 w (/= zscale (caddr old_scale))- [/ x5 B' W1 J+ c9 o" r
)2 p! z+ H' j( O; O3 {
attr nil ; No Attributes modified yet
0 d' B% S% `! J! m# p )% v' F) [" j- w
(if scaling+ Q1 B, q: e( E: o. g. L" }
(progn
/ v6 v: i9 G. a: n& a' n' A6 K (setq xdelta (/ xscale (car old_scale))
# l3 S) J0 g9 B& n, s- U ydelta (/ yscale (cadr old_scale))
9 f9 h5 ~/ c. B( [) o/ B8 | zdelta (/ zscale (caddr old_scale))% y( l" `1 `8 ~9 j" [
ipos (cdr (assoc 10 elist))
9 T$ g" i$ l7 N$ J xbase (car ipos)- g! \4 M$ O+ v5 Q, \8 B& G
ybase (cadr ipos); r( Q+ K6 K( Y8 y' Y# j
zbase (caddr ipos)
5 l0 H: H- t0 M) p2 c6 v1 _ en2 (entnext ename) ; First Attribute: u L: g9 O5 R$ f0 z
)
- n$ x) X+ Z4 w7 X P# ?7 A: ^. f
* y* p) @0 G, t6 V ; If the Block is rotated, temporarily un-rotate it, along
8 I$ b/ V' _% F0 e+ _' w5 a9 o0 B ; with all its Attributes, so the scaling/translation of the
0 K: b6 s5 Q1 N. Q# ]0 E& B ; Attributes won't have to take the Block rotation into account.
6 Q: _7 `# T: _( o V( C (if (/= old_rot 0.0)% h) w2 p, q8 u+ d3 ?
(progn
& V9 R2 [" u% L3 k a (command "_rotate" ename "" pt1 (ai_angtos (- old_rot)))
2 Z7 e, r Q1 f4 G% e6 r (setq old_rot 0.04 |8 s. U/ |* N
elist (subst (cons 50 0.0) (assoc 50 elist) elist)
; V6 e ]) J, e4 \' @ )/ F3 ^* U$ T, b$ p* G p3 |0 ]
)
) A" Z5 \% S2 c1 s, E+ r, Z ); w. u- R% S( T) R& |& k$ _2 f
, G3 I8 Y# Z+ |, |& v1 I' b- s
(while en2
8 U9 ^! z2 i2 x (setq el (entget en2))* M/ W* A# b6 ^8 f N
(if (= (cdr (assoc 0 el)) "ATTRIB")) @; ?0 J- h1 W/ k1 x: W
(progn
* n7 v9 {6 _6 G; N* U (setq old_hgt (cdr (assoc 40 el)) ; Height. _3 q3 ^" k2 T$ q% k* | W4 ?
old_wid (cdr (assoc 41 el)) ; Width-factor( p8 B; \6 W0 y
oldp1 (cdr (assoc 10 el)) ; Generation start point
3 C: }; I6 |" d8 H- ~; i& X3 Q oldp2 (cdr (assoc 11 el)) ; Optional alignment pt/ l7 ]1 l$ a( d9 }' g7 N+ b1 [! Y
ha (cdr (assoc 72 el)) ; Horizontal alignment
2 a& y. N* \. s; I% A va (cdr (assoc 74 el)) ; Vertical alignment
% g; k ^/ p& x% A) w( h [% u. n1 Y5 [" ]
; Translate gen. start point& X7 K: Q6 g0 l6 D
p1 (list (+ xbase (* xdelta (- (car oldp1) xbase))): _5 W K' B% B; l
(+ ybase (* ydelta (- (cadr oldp1) ybase))): _( q% i; c0 R1 t
(+ zbase (* zdelta (- (caddr oldp1) zbase)))
3 N f8 Z: ?0 p3 e )3 z! M8 ~% W' ]+ E
el (subst (cons 10 p1) (assoc 10 el) el)/ v' h, f* H3 r
)7 O, Y8 F" p( a T0 @
8 x4 F: L% u/ B: u" o! t; r3 D" n) E ; Translate alignment pt similarly, if present and applicable
( {5 P; M% n8 c2 i/ E (if (and oldp2 (or (/= ha 0): L S6 A( _2 x! i" U+ r& q
(/= va 0)% t. C) g/ a2 _1 A" b+ t8 c
)+ [' s* Q: Z4 I8 d! i' m% b- k
)$ X/ @+ }4 |; X. f3 T A. ]2 R
(setq p2 (list (+ xbase (* xdelta (- (car oldp2) xbase)))+ C0 @6 O# n( @' n" Y
(+ ybase (* ydelta (- (cadr oldp2) ybase)))
" R( u0 p, f1 T& Z (+ zbase (* zdelta (- (caddr oldp2) zbase))), x. M7 V0 [% `
)- r7 G9 I5 `9 {1 U: I" u$ m( N% p
el (subst (cons 11 p2) (assoc 11 el) el)
! q; F: O/ ]" u4 C; t )
; @1 w1 E& { A+ d: v )
% D& n1 X& G$ q2 s4 `5 V8 q
/ }3 C. r0 H; u* {% s |0 m6 V5 T ; Each Attribute's height and width-factor were computed
' Y8 z: v9 w1 z; F6 C6 M- s( A ; based on the Block's scale factors. Adjust them now,
2 o7 s( V( l7 Z* N ; by first reducing to values for 1x1 scale...% z* y5 u- c* u/ b+ D! S3 w ?
(setq new_hgt (/ old_hgt (cadr old_scale))
. R& `$ I4 ^" g, @- ~ new_wid (/ old_wid (/ (car old_scale) (cadr old_scale)))
/ l; T. |' t/ @3 T; J4 c )" m1 d9 r" X p
; ...and then rescaling.
B4 q1 Y; _+ N1 F; J% \, [ (setq new_hgt (* new_hgt yscale)
5 H6 V" `* q; d2 e5 u new_wid (* new_wid (/ xscale yscale))) R3 d& p6 _. d6 _3 j R
)5 B& ~) w7 b! Y. J# R0 \
(if (/= new_hgt old_hgt)
) e p% C# g) T8 i (setq el (subst (cons 40 new_hgt) (assoc 40 el) el))) o: w5 ^. M* K( X, {) \- b0 G
); k3 }# Y9 f/ H: s$ V9 `- z
(if (/= new_wid old_wid)5 ]$ Z* M' ]2 t, `8 ^8 X1 t
(setq el (subst (cons 41 new_wid) (assoc 41 el) el))
6 O& v( f( \& t4 F3 z )
P/ C0 a! n, z9 b5 s' A* A; l (entmod el)
, P- n2 F* T+ c! S4 C( Y0 ~ (setq attr T ; At least one Attribute modified
+ @* [+ S0 q* I8 j# l en2 (entnext en2) ; Next Attribute
' w& Q9 }: v, a1 T7 Q )
4 W4 Y. G" i6 S4 k6 r% D )4 i% [4 L; q$ y3 W& C( i3 @! M
(setq en2 nil) ; No more attributes
" i K4 k! d1 C )& Q' s: C6 a5 x6 f% n# R9 a
)1 e: r; L% w6 d9 k
). a' l( f% r X
): \5 c8 ]0 X0 D# E+ f1 A
! N/ Y, F3 k& n) }; F) l# v/ x+ }
(setq pt1 (list x1 y1 z1))
# ~; r/ A/ O- T7 v (tempmod xscale 41 nil)3 D7 o9 R3 @0 W9 [" P
(tempmod yscale 42 nil): r5 p M( j* X& ]
(tempmod zscale 43 nil)( a+ W1 z3 l4 F) Q
(tempmod col-sp 44 nil)
# d; P8 p" F% |2 d z" } (tempmod row-sp 45 nil)6 F; M! S- ]6 K. h' E6 z$ z8 P+ m
(tempmod columns 70 nil)
8 \, S5 T; a0 F' K) l (tempmod rows 71 nil)
& U$ K7 `# O7 ` (if (= xclipmode nil)( b# u. P8 B! k Q& y
(entmod elist)
, p7 a* r6 w. F5 C- _& Q. P (setq xclipmode nil)
, c! y, a2 C/ a1 E, H )9 s8 M+ f6 L g
(move_pt1 1)
5 T" y. t8 X7 Z3 h
% z( L+ y" |) V% D" h( q3 S* @ ;; Now do the rotation with the ROTATE command.
X1 \4 E2 p7 Z1 y& L& _. q (if (/= old_rot rot)
: ?1 X7 E8 \8 q; w (command "_rotate" ename "" pt1 (ai_angtos (- rot old_rot)))
5 B5 y) {2 ]: r* F (if attr ; Else, if attributes were modified,2 T4 S; E. ], [) [
(entupd ename) ; just regen to force attrib display5 f6 z; Y- Y% x- W- a/ M' e2 k+ [
)
6 k. a* J# f* C8 c( _ )
7 S" V2 G2 h5 u$ h9 d1 } (setq elist (entget ename))
1 ^0 k, F' z. h& w )
% \* m3 n% O: g0 _; n( C: \ (defun ddblock (/ temp temp_xclip newhatch blkname blklist blktype program xrefpath)
2 v! }/ @3 H- o& ~ (setq newhatch 0)
$ n/ ?+ G0 K" C" o2 Y+ f2 k (setq blkname (cdr (assoc 2 elist)))
* s2 C, r4 B; q' L, X/ m2 s (setq blklist (tblsearch "block" blkname))
& Z, A) x; ]' L (setq blktype (cdr (assoc 70 blklist)))
( a1 d8 U2 q$ l$ z+ ~8 { (setq xcliponoff 0)
, m* P. k5 m2 m. g (if (or (= blktype 0)(= blktype 36))
( P, I& C- ~! D' T, O# P1 f3 t (progn
7 h: y" e# V. _* ~8 T (setq xcliponoff (xclipon elist))$ }& @/ A8 l/ [* D$ @* \) W. E
(setq temp_xclip xcliponoff)0 H6 a2 S& G3 `( n0 e8 j, u3 Z
)
1 ~* W5 V0 {' K, v )( G5 x+ j: X$ P! e% G& M2 I
(if (= (logand blktype 4) 4)
" Y4 _1 a+ p: u! | t3 N (progn
: h7 n/ [0 k# t* Q (setq xrefpath (cdr (assoc 1 blklist)))$ a+ Y0 Z' Q9 k0 X; k. w! P8 @2 e
(setq help_entry "modify_External_Reference_dialog")) Y* [' N( a* {, [9 H7 t3 T( H; x
(if (not (new_dialog "ddxref" dcl_id)) (exit))
$ u7 I8 q3 _0 Z/ a( u (set_tile "Bl_name" blkname)
8 V4 I9 X' _- V& d9 O (set_tile "path" xrefpath)
" r4 e2 b) ?6 g" r ): F7 _7 g( l; r
(progn
2 i, ~7 r9 z* | ;; Get program name for use as Xdata app name, f: |6 T( H) d/ h
(if (not (setq program (getvar "program")))
2 N2 z- y( |5 L6 Y (setq program "acad"), N- e9 ~$ N0 e% U l
), `$ g+ g' M, L2 z! Q
(if (and (setq temp (assoc -3 (entget ename (list program))))
# M1 Z: X9 R( L, h& z5 N1 k (= (cdr (assoc 1000 (cdadr temp))) "HATCH")
# |9 a! K! T3 a4 o- Q) C (assoc 1005 (cdadr temp))/ h U) ^: O9 t
)" x0 k, v7 p! A7 t% C
(progn7 J" b; F& [" `
(setq newhatch 1)
/ P# _" d5 [+ @" W (setq help_entry "modify_Hatch_dialog")
2 n1 H1 G; R" _1 a8 u ;;; convert the object into a new hatch
( N: W7 x0 p# z; M6 e (ai_undo_on) ;; enable undo7 b; x; d! x/ `9 s, O
(COMMAND "_.UNDO" "_Mark")
R4 a! g' S& V (COMMAND "_.CONVERT" "_Hatch" "_Select" (cdr (assoc -1 elist)) "")" n. d/ [+ x- c) H7 H& T/ q, Q
;;; suppress nasty message from convert command$ Y# k1 l1 q- S' u
(princ "\r \r"), k4 P+ T' v$ x
(setq elist (entget (setq ename (cdr (assoc -1 elist)))))) O/ W- @+ c4 C' c# w1 X* d# H
(setq old-elist elist)
' x5 w1 Y7 ]4 [+ U! @. _' n) K ;;; If we have cancelled ddmodify
( ]' Z" M2 N( `2 m) S. l& f (if (not (ddnewhatch)) ;;; (ddnewhatch) returns nil for Cancel or T for Ok% c1 b) K4 X$ I7 v9 M0 z8 N
(command "_.UNDO" "_Back")
1 ~. Q L2 e. J" S; f )! J$ c% k m, {. ^" x0 l ?
(ai_undo_off) ;; restore undo state( s9 l t7 Y1 C& }6 i
)5 J1 H8 `5 r& v- [+ e; u
(progn
~: h" ?7 v2 u3 K" @7 E$ p9 n g (if (not (new_dialog "ddblock" dcl_id)) (exit))3 Q: {& t& P$ l9 J
(if ( = "*" (substr blkname 1 1))/ D- G1 U4 Q5 q0 b$ A3 ^+ `
(set_tile "Bl_name" (strcat blkname " - Anonymous block"))8 L0 e- s, N2 W0 k2 d9 @
(set_tile "Bl_name" blkname)
! l$ {) }. x! m* \ )! a( z% s6 t! J5 e& {! R/ }
(setq help_entry "modify_Block_Insertion_dialog")! L U+ F, q0 }# s: M8 R
)* C: g t. ^0 k/ ~* ^ S8 u+ f
)
9 m$ [$ e. g' ?( {- N* m )
/ E+ N$ ~6 y; r W0 g9 \ )
* X5 F. D8 H5 E v (if (= newhatch 0)
6 S1 U, w3 a; T2 t (progn
0 Q I1 }. @" D2 Q; \( @4 h! ` (set_tile_props)
$ @4 f" _+ b2 |: G3 X: J. \" o (set_tile_handle)
; p; i( C$ V7 O& j2 r/ t (set_tile_pt1 1)7 K- p6 b F& q1 \% B4 c5 ~9 Z
(set_tile_rot)8 H1 k1 x" s( P6 S4 T/ a$ I
(set_tile_scale)9 P) ~( Q* f: D; H4 _4 D
(set_tile_rc)
9 ^( l8 g/ `: z& l+ b( V; @! c% x# w (if (= (logand blktype 1) 1)$ x9 U& Q: ]6 K1 ~9 w# v+ d
(progn$ e4 ~2 c& B' t+ c M7 N
(mode_tile "xscale" 1)
( @* i6 U4 c, t$ Z3 | (mode_tile "yscale" 1) a4 p6 X+ U) F: z- d
(mode_tile "zscale" 1) d7 T4 H% r8 b
(mode_tile "rot" 1)
5 H( Y( J4 W- t6 X7 n L8 e (mode_tile "columns" 1)8 x4 x. F0 r! k! t0 z8 _
(mode_tile "rows" 1)
- s- d7 Q5 x2 F. Q+ p9 \) G (mode_tile "col_sp" 1)0 p7 A0 \; Z: m, e
(mode_tile "row_sp" 1)# c8 Z5 N- q+ @! O' B
)
* g- c2 b/ p* C )2 C6 z+ R0 m8 ^4 n0 L) k( n
;; Define action for tiles
$ `' `4 D; {' i7 s/ [! N- j7 P (set_action_tiles). T( Y8 I8 a* U) [" ]6 w8 l
(setq dialog-state (start_dialog))' b9 r% `9 K8 U7 z/ c
(cond
Y; t; M I4 E: k* W C5 W ( (eq dialog-state 0)" I7 |4 m; K9 q+ u: |6 ~
(setq pt1 (trans (cdr (assoc 10 old-elist)) ename 1))
2 t& _# z5 s. c (move_pt1 1)* ?; o, a& O/ p4 }/ \% s
(reset))
" e+ T# V7 r. n, _" U4 A ( (eq dialog-state 1)
* R. t2 u1 t2 W5 l3 H9 d (if (and (/= temp_xclip xcliponoff) (or (= blktype 0)(= blktype 36)))3 m" M) A( ]. t, h3 ` |+ I
(xclip)
$ q( r4 B% p5 F; Y# H6 ? )
" [$ J8 g0 _5 |7 H4 ? (modify_block))+ R0 Z7 U: L" b0 {6 M4 {* e
( (eq dialog-state 3)6 ?* S0 [' k# @+ L- _) _$ W9 z
(modify_block)* Y) X( X/ h0 W" [4 X0 L
(setq pt1 (getpoint (list x1 y1 z1) "\nInsertion point: "))9 O* \- ^$ ]1 T! j/ c; V* i, N
(move_pt1 1)
* U* y3 J6 |7 ~: Q" [6 x8 E% E (ddblock))( O$ j4 t* |4 j e: X+ [
( (eq dialog-state 4)1 i; u9 z0 R% Z4 T- J
(modify_block)% M( E+ @1 n$ B4 I* R4 Z- W) T
;; Get current handle.; G) ]# O t) g" S% B
(setq hand (cdr (assoc 5 elist)))
, L T; s5 c' F# L4 e- @ (command "_hatchedit" ename)/ l2 G* E4 f- J: K4 {1 m' z: X
;; If OK in hatchedit, a *new* entity is created and the old one' J1 d( t. K% q9 u0 H
;; is deleted. So if the old one exists, it must have been a
9 r/ }0 h8 U. J, Y0 M; l ;; so rest the entity.. J/ k1 E% X i, r; h- f
(if (entget (handent hand)) (reset))
9 _! J, Y" m' N( U2 n: | )! K$ K9 X4 z1 G9 R& ?7 ?( J) y9 g% \
)# _' f. F6 a9 y N
)9 n$ z4 D, W$ \8 r) R" @3 `
)
& a- C' K3 W6 Y9 p @ )1 F" ^8 f( T; z( l7 i
;;
/ \' B0 k+ {; x/ t( { ;; Modify SHAPE
$ |& \2 p& o l v8 }1 K ;;7 B. k, i: Y& t
(defun modify_shape ()
# ?5 z' x+ Z2 m! T6 J2 r( r1 }$ {$ ~ (modify_properties)
6 l$ R& k8 D- m# J0 v (setq pt1 (list x1 y1 z1))) M3 \4 l/ Z$ l- [# M4 U8 U4 k: D/ m
(tempmod pt1 10 1)
( p$ W9 o* E$ |' [3 F (tempmod hght 40 nil)" C& }9 |2 i3 e, m8 I: Z- }+ o
(tempmod wid 41 nil)8 Q m2 F8 ?5 x3 P8 g
(tempmod rot 50 nil)
, F: v4 V% K- w2 T% }3 e; T4 H (tempmod obl 51 nil)
1 ]4 { C' t4 U: |% D6 o0 G2 M (entmod elist)
3 S7 u" T1 K& y )$ c3 P/ U# r4 _2 p( J
1 s. w1 h. Z7 }" p/ L/ A (defun ddshape ()! v' h9 ?1 ]1 b1 m
(if (not (new_dialog "ddshape" dcl_id)) (exit))4 b8 i) v9 S% E, [1 c
(set_tile_props)
- P$ L5 `- A0 K/ p (set_tile_handle)8 Z) P$ R7 I+ ]7 G0 S3 X
(set_tile_pt1 1)
5 p3 d0 V$ K- g5 i (set_tile_rot)
* k# }# F- B0 T1 t, I5 T (set_tile_hght)9 w& z: z& Z# w) X0 Z8 [
(set_tile_wid)6 U( q. V2 K w! O0 Z" q
(set_tile_obl)- Z9 m" n, K( E8 _7 C
(set_tile "sh_name" (cdr (assoc 2 elist)))/ P. v5 t; S3 u0 X2 P! I
;; Define action for tiles- \3 ?0 W$ O- v$ ?" o. h+ c% w
(set_action_tiles)1 f/ { {9 f1 D8 j) g( t
(setq dialog-state (start_dialog)): j$ J* t* w7 @- o$ [1 M0 R
(if (= dialog-state 0)
$ ]3 J8 f- `% h# {4 ^( i (reset)$ F4 i/ v8 Q' P4 a: Z; d
)
% G3 N e% E p0 c _ (if (= dialog-state 1)
$ z( x, c7 z5 | (modify_shape)' ` ^# Q6 |+ h3 U+ N% A+ \
)
+ W8 O7 U5 W/ m# k2 U (if (= dialog-state 3). N! x3 b6 Q0 p- G5 F; ]
(progn
# y n% [0 H6 c6 r (modify_shape)- ], r8 |. Y: M% m7 B( o
(setq pt1 (getpoint (list x1 y1 z1) "\nInsertion point: "))
- {8 S' {4 Z( A4 s2 f* ?' n (ver_pt1 1)
+ P# L; b% V; B C1 k5 e7 _+ Y (ddshape)
& @' G4 z4 @- a b# S! ~$ ~ )
/ D) W) m* @4 H5 U! A )
& b1 V* o/ Z+ V* [+ r" ~1 n ) D5 x% \4 L; ?
;;
6 g5 C, J1 Y5 r ;; Modify TEXT or ATTDEF' W4 \ Q% _6 p9 }, { N
;;
! w% S" r! V8 w* A% _* w ;; Set bit code for upside-down and backwards setting" s5 S$ x' c5 G* k t0 D
;;( }4 A" z6 D8 q0 ~& N6 c$ x
(defun code_71 ()
; F# U* _) e0 M) o1 T9 T (cond ((and (= bkwd "0") (= upsd "0")) 0)6 i' }2 ^4 D/ w
((and (= bkwd "1") (= upsd "0")) 2); T5 C' y: s. W" j8 x5 W! X
((and (= bkwd "0") (= upsd "1")) 4)! k+ s' Y( q" O8 ]
((and (= bkwd "1") (= upsd "1")) 6)1 B$ M, I! I+ F; f2 o8 k
) J" \' W# Z7 i) y9 v( h4 T2 `8 p- \
)
! S: w% r4 Y& a ;;
. Z% E( N- ]1 f6 E& V ;; Style action. Reset widget values to style defaults
, B( A4 g: A& b0 o; b3 R- j: ~+ E% ` ;;
e) T( @7 P0 [( T$ c: N (defun style_act (index / style-list)
1 L9 C3 ^5 r8 R {0 W (setq style-idx (atoi index))
1 C7 g! c, g( b- Q3 _1 x& }, p (setq tstyle (nth style-idx slist))
1 F k4 W0 {1 l9 N5 W0 W) y. m (setq style-idx (itoa style-idx))
: n1 U8 d: h8 G (set_tile "style" style-idx)5 B% K+ q0 B" e
(setq style-list (tblsearch "style" tstyle))
' T: f; Y: @2 @( Y (setq shght (cdr (assoc 40 style-list)))0 M- q% E4 L M& Z7 ?/ s! e4 q
(if (/= shght 0)1 ~: [+ D- o2 O% x! o* ]) o
(progn2 v# D: I1 }; D4 U/ k9 Z: g" a
(setq hght shght)
( n/ t u# } K: {1 Y (set_tile "hght" (ai_rtos hght))+ I8 h3 ]1 s' x- U$ h" P
)
8 Y% X% P+ t- \' J )
# _! F) h! J I- R4 G2 m" s6 H (setq wid (cdr (assoc 41 style-list)))4 L% r& A: x8 N1 ~
(set_tile "wid" (ai_rtos wid))1 x+ |; u. J2 u3 [
(setq obl (cdr (assoc 50 style-list)))( {5 h6 {1 v# ^' x8 D7 d1 S
(set_tile "obl" (ai_angtos obl))
' b3 M# n3 N' T: H1 R' Q; Q (setq bk-up (cdr (assoc 71 style-list)))
9 n) g; a8 I N7 b6 { (if (= (logand bk-up 2) 2)
; b: b( L3 G5 b* t! h% u7 { (set_tile "bkwd" (itoa (setq bkwd 1)))
6 i* j2 T3 T$ P; c! [! O (set_tile "bkwd" (itoa (setq bkwd 0))): V9 q6 u$ Y- H+ y2 |1 T. |) V
)
# j3 Y. w* p/ H: M; d1 P, Y X (if (= (logand bk-up 4) 4)2 \# q8 \) p, ^5 L& B
(set_tile "upsd" (itoa (setq upsd 1)))# m( F: _6 N# W2 w* F7 ~
(set_tile "upsd" (itoa (setq upsd 0)))1 ?% P4 T2 ^% p$ {) Q
)
2 P, V/ P4 _( ?) m )
% _4 s. b2 ?& A$ w O* x6 }; Z! p ;;
( q( p+ W; Y: c, |5 |. D" ` ;; Justification action. Set vertical and horizontal alignment variables,/ c5 p) ~2 I' [6 E6 L: K. b
;; grey out rotation and height if alignment = "aligned", grey out rotation
" \2 `/ L4 ]) b' O ;; if alignment = "fit"., W3 g+ N8 ?; Q s
;;& S- k$ [# u' D( \
(defun jlist_act (index / templist)
9 t# E2 E) h( k+ }4 @% p+ v (setq just-idx (atoi index)); h* c8 Y' i( P% ?3 @
(cond+ ~" g) o2 t- `$ j1 t! ?
((= just-idx 0) (setq va 0 ha 0))
) |/ Y6 L& ?3 {8 e. I$ V/ t! X$ t ((= just-idx 1) (setq va 0 ha 1))
; A. `$ S3 s6 R$ |& | ((= just-idx 2) (setq va 0 ha 2))
7 V3 V. i1 r$ k. D l% R, t ((= just-idx 3) (setq va 0 ha 3))* V& l7 n _( ^
((= just-idx 4) (setq va 0 ha 4))
' \! C% Q A& b3 a+ M1 M) O ((= just-idx 5) (setq va 0 ha 5))
' W2 A" m4 W* E- k8 v ((= just-idx 6) (setq va 3 ha 0))
2 z' M8 a- ]" G# F5 }$ x5 k ((= just-idx 7) (setq va 3 ha 1))
1 q) U) b: d6 \% D! \ ((= just-idx 8) (setq va 3 ha 2))) P7 Z7 B- p* n- w( }7 l
((= just-idx 9) (setq va 2 ha 0))3 g" E& S" u. t$ e
((= just-idx 10) (setq va 2 ha 1))
8 y1 I1 m8 v, t7 a [# q ((= just-idx 11) (setq va 2 ha 2))
; ? k2 c7 n3 R% R/ E" h ((= just-idx 12) (setq va 1 ha 0))) R+ |1 m5 t X: U! ?- @
((= just-idx 13) (setq va 1 ha 1))* E, R! \" u- z; f
((= just-idx 14) (setq va 1 ha 2)), ]) X$ m7 d6 U( J( ]$ V
)+ p: j8 i" H; |
(if (or (= ha 3) (= ha 5)) ; If Aligned or Fit text+ a: P: ?# b, T# Y3 Y
(mode_tile "rot" 1)
- w9 R8 a5 Z, J n% B (mode_tile "rot" 0)2 H* ]: ]: X* |
)) O1 I# \% t- y
(if (= ha 3) ; If Aligned text3 h2 {7 J- c- l" ]3 B
(mode_tile "hght" 1)
! E6 U) m: A0 P# J (mode_tile "hght" 0)2 ]( o, b! E0 j/ u
)! I+ z5 } t4 @6 [% f K; F
(if (= ha 5) ; If Fit text% X$ s' U9 [$ k, r+ ?2 G' O7 S
(mode_tile "wid" 1): o2 V; Z A+ W0 o! p9 z( _* x- g$ S
(mode_tile "wid" 0)
3 v9 U' u" k0 X7 K )
: K/ y% ]8 ]! } J) c7 K4 f. J. m ;; Reset rotation and height if changing from aligned.
8 j# j7 p- X/ E (if (and (= ha-prev 3) (/= ha 3))0 {" |, m% U0 x# V
(progn7 V4 R1 J- {% g; _9 ^6 x4 O
(set_tile "rot" (ai_angtos (setq rot 0.0)))
( J# u3 @; v$ F0 G* S (set_tile "hght" (ai_rtos (setq hght 1.0))). \/ y" F/ Z- b, G" x$ v/ m
)) s4 ~" U* d$ H! l: O3 _
)" U" z. ]' o+ _9 W
' i2 {7 T4 K+ ^
;; Reset rotation and width if changing from fit.% P P- f& j! Y: l, A: _
(if (and (= ha-prev 5) (/= ha 5)). ]( L) r- a) u# r
(progn- d) S J0 i* L1 r i
(set_tile "rot" (ai_angtos (setq rot 0.0)))8 r b! N/ a& J% G: m
(set_tile "wid" (ai_rtos (setq wid 1.0)))4 v/ F) T% x- j+ u9 N
)
/ ]+ R7 @8 [, W& A: v& { )
9 k8 h4 j4 u& k9 Q% {/ P! X+ U. K i
(setq ha-prev ha) ; update ha-prev for next time3 [. P" t, m& O. L# `' r4 }
(setq just-idx (itoa just-idx)), \8 Z! k- X o( C5 j& H
)8 p$ F& J4 W: E4 v1 O% g" ^
;;. @1 W( C, b& e! j- |0 h4 j5 _
;; Set intitial alignment setting based on vertical and horizontal alignment
$ o. {$ ^6 Z# D0 ^ ;; bit codes.
4 i. K) h9 @1 T2 T9 i% j ;;
, n! _7 c$ I# I (defun set_just_idx ()2 B4 U. P# x6 `- P' b# m
(cond+ P$ {+ A+ d t' o& J
((= ha 0) ; Horiz alignment = Left$ u- C; W& q' m) V0 M
(cond2 C% u+ F& b" m2 J- ?
((= va 0) (setq just-idx "0"))7 W0 G, u8 d$ p. \( |" w( a
((= va 1) (setq just-idx "12"))
0 @( c' t e3 e2 c! e ((= va 2) (setq just-idx "9"))
# \6 e- ~3 ?) V; W3 E4 o8 p ((= va 3) (setq just-idx "6"))
' w/ z2 m. o% g# } )
3 F, ]" h( x# u )
( U' h& c: j, Z" [' n3 {! B3 Z; j ((= ha 1) ; Horiz alignment = Center: i* c& D; X& ?* k2 B+ @- K8 w; Q
(cond
6 M# h- r. n% s ((= va 0) (setq just-idx "1")); J" ^) T( P$ C" t
((= va 1) (setq just-idx "13"))! M8 |$ I V v' L- Z O3 e
((= va 2) (setq just-idx "10"))0 h! A( A: m7 `: \! x7 g$ R. e0 M
((= va 3) (setq just-idx "7")) h% d9 f: R; _. |4 D& Y; u. U
)' `" H0 i. F* J4 u
)- E7 c2 f$ m' t% [, M
((= ha 2) ; Horiz alignment = Right( W$ ?* l5 Z' F8 [
(cond
- k4 G# ?4 o) c _) e% @# l ((= va 0) (setq just-idx "2")). J0 S8 s- K" t) ~& s5 h' i. E
((= va 1) (setq just-idx "14")); |- g; ^0 h- [7 c+ g. _ C, Z1 e
((= va 2) (setq just-idx "11"))7 A' h1 z& o) t: O
((= va 3) (setq just-idx "8"))
- l5 h0 g( F, O$ o0 M# T )
0 w2 X; Q& R! s3 d4 V- i )
. t+ G. u. q! ?) w/ K. \: r ((= ha 3) (setq just-idx "3")) ; Aligned$ W/ ?1 K- z! p& ^
((= ha 4) (setq just-idx "4")) ; Middle
* u5 w. k+ H- o. c3 w) o" a& ~. L ((= ha 5) (setq just-idx "5")) ; Fit
, K; M9 f* k. D+ Q6 u A4 r (T (setq just-idx "0"))! g+ P+ e' R. u& r& }0 L* x8 v
)& H( s* B d5 `3 Q+ T* Y
just-idx( y: l: s- x; `
)
% T7 B. g x! k* n% C j
0 [# ?* s- E. i- C9 z7 c (defun modify_text ()2 V6 z2 c- o; i" R
;; insertion point
/ h1 W- i E9 s6 x (setq showpt (list x1 y1 z1))
) K! w/ Y# Y. M. b1 m0 f (setq bit-10 (trans showpt 1 ename))
! r3 n. ?+ E: p ;; alignment point" g. {* J# z" \& x( k+ k( F
;; for 'Aligned' or 'Fit', alignment point must be different* p. x: k# ~: z2 Y
;; for all others, use insertion point5 I3 K' O) @/ n; U. j6 P& }
;; (ACAD will recompute insertion point). w: F4 E! T7 F0 y$ }
(if (or (= ha 3) (= ha 5))* q5 W1 O2 Q0 Z8 \& _5 q1 R
(progn! x+ a9 m; b( W
;; if no alignment point, fabricate one
+ e2 f4 n. l1 n; k, m; M (if (not alipt)# L) J e/ V( j/ S, o, z) S
;; add text width to insertion point6 u( @4 e8 j9 B. F
(setq alipt
" w3 f4 H3 R" D3 [0 o- y) x/ ~2 { (list (+ (car showpt) (car (cadr (textbox elist))))7 {% O0 P* _4 y! V: j
(cadr showpt)8 q+ q! k& z9 t$ z$ N0 k
(caddr showpt)
6 M. I a7 C! s )! R- n# K2 T2 g$ c1 z6 R
)3 e& B$ ]4 q/ ?6 H9 e
)
/ h: Q$ u; f( J) i (setq bit-11 (trans alipt 1 ename)), y$ X* O) k8 b+ i1 i) J
)4 J. Q9 l+ w6 u. P1 |
(setq bit-11 bit-10)
0 _7 q9 o. t6 [- ~( i% ^ )
8 r& C/ H4 h9 C1 T" n (modify_properties)
7 C! b2 B3 @3 [2 i (tempmod tstyle 7 nil)
) W+ T3 H# v' O3 S' H" Q (tempmod bit-10 10 nil) o4 c q8 B! i( w3 }
(tempmod bit-11 11 nil)
2 s( T `0 l- Z1 H, H% u0 m (tempmod text 1 nil)4 ]5 i& c4 T+ r1 X; c* K7 @& U& U
(tempmod hght 40 nil)
( Q4 m7 N, k. m: s (tempmod wid 41 nil)8 S2 g- }) l# j8 J4 c) J& @2 ]
(tempmod rot 50 nil); G; S& |& T( O; X, J& c/ r
(tempmod obl 51 nil)
3 k; C2 p; F O8 m (setq bk-up (+ (* bkwd 2) (* upsd 4)))
6 h7 y1 c/ v: T U% W; f (tempmod bk-up 71 nil)
' r8 E% J+ t" v5 P/ J/ n (tempmod ha 72 nil)% \8 \! \+ r) Z! d3 a* A
;; Attdefs use 74, text 73' O' o9 ~+ B# q! m. n0 k" \
(if (= etype "ATTDEF")! i+ d% n; Q$ f
(progn
, G9 ]7 ]1 c5 v4 d# a5 b (tempmod attag 2 nil)/ p8 y8 I* }9 v0 R. w
(tempmod atprompt 3 nil)% A; U6 D2 v F' p
(setq icvp (+ inv (* 2 con) (* 4 vfy) (* 8 pre)))
; Z0 `/ b0 C O* I3 @9 j (tempmod icvp 70 nil)) q/ M7 z8 O0 t9 n% {2 `/ _
(tempmod va 74 nil)
# ^4 e# |0 Z+ W2 i! g$ p )
+ M8 D U* X' r6 |( _ (tempmod va 73 nil)
2 |2 S" Q& m1 Y4 ]* z )2 D$ _$ G9 v3 ^' l) L1 P8 z7 |( I
(entmod elist)# b/ k% Z3 L, I% |. k* F- f! }
)
% h: s7 ^: B4 b) ?6 K- D2 o/ n" p2 @2 E3 u: h4 b& U9 U9 Y/ h
(defun ddtext (/ 2ndpt slist i)$ K( n. N7 }& b9 M
(if (= etype "TEXT")+ J. r9 Z- h& D7 H. B& i. Y
(if (not (new_dialog "ddtext" dcl_id)) (exit))
) V d% x" F5 F! v2 F& w4 L (if (not (new_dialog "ddattdef" dcl_id)) (exit))3 x6 U* R. @; N. G( b( \
)0 o' \7 N l! R2 D
(set_tile_props)
; I' q3 B/ d: x3 R0 L& p: K (set_tile_handle)' m6 y& e/ D# u" _+ A/ g
(set_tile_text)
8 w2 a9 R' e$ n [: F (set_tile_tag)$ S" w F- n5 a* U8 c2 ]
(set_tile_prompt)+ _7 }9 _9 M X& i
(set_tile_hght)
/ a/ m0 ^/ u. r (set_tile_wid)
( F# @. O) |3 J( ?/ f! I$ P. z' \ (set_tile_rot)3 u1 C5 l, S" U" [. ?
(set_tile_obl)
7 V6 q R4 \- f8 x! v5 V' l (set_tile_bk-up)/ z0 F6 F3 n; C# _
(set_tile_icvp)
( M7 a% H* u1 k8 a2 k (set_tile_style)3 T* b$ k8 C! k# K" x" x9 x
(set_tile_just) G5 r. `" U: w: a
(setq pt1 (trans (cdr (assoc 10 elist)) ename 1)), e+ U! V: W: Y' @0 k% o' [ _
(if (not (assoc 11 elist))9 R) \8 C( L8 a: [$ n2 F
(progn (setq pt2 pt1) k7 C* f" b+ c( P
(setq elist (cons (cons '11 (cdr (assoc 10 elist))) elist )), r7 W. W0 u3 v" M, O, r7 M; i
)" I; J$ n) [8 F. T; q: e
;;(trans '(0.0 0.0 0.0) ename 1))4 |, |, r8 v" H
(setq pt2 (trans (cdr (assoc 11 elist)) ename 1))
* v, s0 [( w+ Q7 l9 ?, [* @ )
$ J6 t3 v& c7 A% M: [; l (if (or (and (= ha 0) (= va 0))) L: p6 f# K, Q6 U
(= ha 3)$ O5 n) z& {4 s8 M% H8 g
(= ha 5)+ p, Z/ K) |! I2 {: d- n. u
). w1 y3 J/ @& [$ O R) A7 I+ m
(setq showpt pt1)9 e( R% r- h0 ^) M
(setq showpt pt2)
- `2 E. y9 i" A! \5 J* @ )4 f. n+ M; A5 \" Q
(if (or (= ha 3) (= ha 5))
G8 c& w1 @% @9 C; c2 m (setq alipt pt2)$ i3 q( _( L: B8 N; M) Z
(setq alipt nil)3 h8 \% c6 ^% n: F8 }
)) F9 C0 ^6 o& j/ {& |/ L
' l* c7 {, m; H2 o% I4 | (set_tile "x1_pt" (ai_rtos (setq x1 (car showpt))))
/ A/ u( R( j# v L) o% q6 z+ f (set_tile "y1_pt" (ai_rtos (setq y1 (cadr showpt))))
, }& G* L! t& k; a0 s/ @ (set_tile "z1_pt" (ai_rtos (setq z1 (caddr showpt))))
7 o2 ^ a) V" }2 C# t
7 z) ? j! h( {, W- j ;; Define action for tiles/ V' V% |. ~3 t3 }; G" n! c/ q
(set_action_tiles)8 h% ?6 a, O7 O% `
;; Set focus initially to the text edit box.
+ o% j* V( i2 C+ b8 c* v m (if (not i) (progn (mode_tile "t_string" 2)(setq i 1)))
" y X( f# U `! n( V (setq dialog-state (start_dialog))" F+ n3 }5 Q+ N7 O8 |4 E. m
(if (= dialog-state 0)
$ r. n% h6 _+ L" | (reset)
, U+ b7 J4 s' \6 L! C% i+ d3 K9 @ )) P9 B1 L, r) E- o6 `
(if (= dialog-state 1)
! a+ P" K1 u1 I, t+ r8 i: M$ O (modify_text)
" \) Q3 R& z% q8 j& R )
3 ]/ \) N: v- X( I2 Y (if (= dialog-state 3)
3 @/ y- m3 R( [ (progn1 A; ^% b/ A5 l; d* v+ c
(modify_text)& i9 k& c A! P% L
(if (or (= ha 3) (= ha 5))3 F8 e. |& Y, j: E4 i: R9 O% \
(progn
' {3 h/ ]& \/ t3 L! o0 B (setq showpt (getpoint (list x1 y1 z1) "\nFirst point: "))
* z& \# [0 w' ~! r3 p2 W6 } (if (not showpt): U) W& `& H1 _) b6 T( x
(setq showpt (list x1 y1 z1))# c* Y) X7 V2 N. t! r
)6 S2 g5 k) s4 M% V f% J, U
(setq 2ndpt (getpoint showpt "\nSecond point: "))
) ~5 h- Y- `$ T; v; V5 d; y (if 2ndpt
3 Q8 R, A1 D6 W+ r' i (progn
7 [/ X p9 T0 h0 S0 q8 h (setq alipt 2ndpt)
; F9 `# P/ @- [/ I& m& u4 R- d4 ` (tempmod showpt 10 1)
/ m! Y6 |, B: @ P (tempmod alipt 11 1)9 |% l: [; P* z. T @+ j9 _
(entmod elist)
2 ^( e( t* c% l2 }5 X; p2 { )
2 z1 F) ^& w. g2 e% [# [ )
' Y4 I" g* R6 V9 v: v- X (setq elist (entget ename))
$ H$ ?6 b( F7 g2 T )
7 G, ?) \! E% x( L9 z3 u2 |2 B (progn
+ t: [/ u( |% ]/ U) X2 D) Z4 } (setq showpt (getpoint (list x1 y1 z1) "\nInsertion point: "))
# r+ P& o& O2 x/ D" T' @7 a, M (if showpt c$ b# \9 M1 n6 F9 B
(progn
% _- N: o, |7 D (if (and (= ha 0) (= va 0))( J8 K7 N. E8 ~7 u5 H- Z
(tempmod showpt 10 1)" L# h' c; K. k" }6 z1 ~
(tempmod showpt 11 1)
8 y- c& _5 f! W7 E )% D4 j i. L& S8 l7 f
(entmod elist)) L- z s6 J7 A' {* g/ _8 R
)5 G3 i* P @5 H' w
(setq showpt (list x1 y1 z1))
1 C& |5 c: T: Z& u: d% z )+ _) [" ]# y; L# i
)
8 T$ I& M! p8 ~ )3 X' Q7 I9 Q# w1 @4 J) t
(ddtext)
. C, Z) ?) |4 g9 T8 O9 e' r )" q2 o6 r( g. B4 r. ~1 G
)
: j1 t8 ~& @/ B% {1 s )
& ^: v0 U0 f* P9 N0 R# U1 {* T/ }* H% {! D! `% x
;;/ J6 a, a/ c4 K! D
;; Modify MTEXT
- N. g4 M5 N5 e0 u# d ;;+ |; Q4 ]" y7 o
(defun modify_mtext ()) I. v% M( F. Y. d5 [+ G
(modify_properties)* E c3 j5 |+ H! L) u& y+ Y$ X
(setq pt1 (list x1 y1 z1))
( M# H) n- I1 D$ Z (tempmod pt1 10 0)
6 `+ J% p; l; W$ j" W' N (tempmod text 1 nil) r6 y! b3 g0 e; h/ N
(tempmod tstyle 7 nil)
/ D; d" F4 n1 _ p3 V( n (tempmod just-idx 71 nil)( N5 @& G# i, K1 x5 d5 Y! Z. [
(cond
8 S1 x( k: ]7 Z ((= dir-idx 0) (setq dir-idx 1))
( e* ~4 w/ {* z( G9 ~% M ((= dir-idx 1) (setq dir-idx 3))
. `9 B6 X5 U& \9 |4 m- `9 o0 s( N ((= dir-idx 2) (setq dir-idx 5))
$ x$ L* }- T0 _, O ~% a (T (setq dir-idx 1))) j# S$ p7 ~3 ^) h: G( u
)0 ^( d3 B1 _' K2 Y7 P. W6 p
(tempmod dir-idx 72 nil)6 A; X& u. W6 i q0 t3 J- o
(tempmod hght 40 nil)
6 m$ D+ ]. r3 c8 C (tempmod wid 41 nil)
$ _0 [! ?8 L8 f. @ (tempmod rot 50 nil)7 O) q9 t4 e8 a- \
(entmod elist)6 z3 }# _3 s0 r* @: B. B
)
$ w2 C# D4 ^( j" T3 {, i+ l0 L: J/ q5 p
;; Set MText text style8 M" d4 p& _" {+ P# G3 B; Q
(defun MText_style (index / style-list)2 W: l' q+ D0 E* ^6 w: e/ |0 m9 J
(setq style-idx (atoi index)); J9 d7 s4 j0 e# b" Q3 W
(setq tstyle (nth style-idx slist))
& |# _6 P, F/ p1 z (setq style-idx (itoa style-idx))/ w3 i7 C8 M; R
(set_tile "style" style-idx)
7 a; c1 f0 f: Q (setq style-list (tblsearch "style" tstyle))2 E( a$ V/ |) M7 A) i
(setq shght (cdr (assoc 40 style-list)))
. S9 b! d! E% E: o4 p/ s* j6 I (if (/= shght 0)
4 r6 `( Z/ F$ ^* I4 m (progn' U; l) J- E+ {8 J$ @- z8 O( }
(setq hght shght)
9 a" q- ~% }! [! l. G$ a (set_tile "hght" (ai_rtos hght))' N! N6 \4 _* L( x Z4 u! Q M
)& y4 v# D0 B/ s1 d8 H; `
)
6 e. \# i& u3 M# H1 z- v: E$ R )) M" h1 @0 B' e0 z
" F& w: m% V* ^& x, N$ n, ` ;; Run DDEDIT on given entity, working around possible re-entrancy
; }4 ?" l6 [; C; h- ~ ;; problems with MTEXTED
- B @2 ]# m; v (defun safe_ddedit (ename / orgMTextEd work)
]( Z% F. G' y- L (setq orgMTextEd (getvar "MTEXTED"))$ o; v$ s# ~, |( _/ k2 Z4 @1 P
(setq work orgMTextEd)
& A2 c7 J" A2 T, f3 _ (if (= ":" (substr work 1 1))1 H4 B- W7 i5 m( a/ v/ d5 y
(progn
* o( N5 i1 K, s+ g (while (and (< 0 (strlen work)) (/= "#" (substr work 1 1)))
/ O- d/ ~1 S+ V; h4 } (setq work (substr work 2))9 Z- i$ E* l! C& l
)
7 U5 B, |8 x: f) D) P" a5 p& g3 ^ (if (= "#" (substr work 1 1))# f; N9 @* F; X A) t9 A$ O4 J
(setq work (substr work 2))
: R# h1 J; S l0 X9 K; q: P2 L! [ )* I2 u8 @" n" [' y& f
(setvar "MTEXTED" work)
! n" {/ Q9 u: d- U )+ y# S' {# ^8 H9 G
)
) m; X' [* g8 j- t' g+ ~, g (verify_arxapp_loaded "acmted.arx") ;; make sure it's loaded...$ _7 ~# |5 m0 j* y' {5 T
(command "_DDEDIT" ename "")+ m4 Z) r# P9 \& b& z
(setvar "MTEXTED" orgMTextEd)
^! j. E, @3 r- X: g )( a8 n0 I4 u% w2 K7 W0 l+ R
Z# ]8 `( G3 R) P' ?% X ;; Verify MText object width
5 E& N% \. b# j (defun ver_MtextWidth (value)/ S2 [7 |9 e. A8 s5 N
(setq value (distof value))
, t) n; U9 U( S( k6 `% b, M( r9 [4 M (set_tile "MTextWidth" (ai_rtos value))- k5 @3 Q% U8 [
(set_tile "error" "")
* b& w1 t. A% X (if (< value 0.0)
6 ^) X+ z* x! b; l (set_tile "error" "Value must be zero or positive.")
2 Q7 D+ d( u$ _ f; b (setq wid value)5 F; R# H1 D) Q$ e! [6 A
)/ u. k' N! W0 Z; ]+ n
): q4 R+ q- Z1 s+ |; Z7 U
, G- `# o' f. D1 ~/ i/ D" [ (defun ddmtext ( / gc3)
0 `- W( C0 N8 ? ;; Get dialog& ~- X( R. f" w, y
(if (not (new_dialog "ddmtext" dcl_id)) (exit))
' ^6 F( a( o2 P! X+ G! k1 A0 l' B" l+ H1 Y5 D; h, e4 c9 B5 v# ?% _
;; Load list boxes- k* C# R( p: M8 S
(start_list "MTextJustify")
+ s3 s4 O2 A3 { (mapcar 'add_list '(
; l' z- r0 V/ Z7 p# O/ ` "Top Left"
) k2 Q5 n7 N% {" { _5 x4 x, m. s "Top Center"/ D/ ]/ u& C/ d; P$ V" I/ x
"Top Right"
: F: K2 O: d7 W$ s "Middle Left": T! X6 [ M3 Q
"Middle Center"
: w; t# \/ R/ S0 `0 [1 B "Middle Right"3 z% ? m0 F' Y, X# T
"Bottom Left"
* \, f9 O6 {9 I( E3 H "Bottom Center"+ q2 E9 [! B( ^4 z2 L' c
"Bottom Right"; k. U% c; w3 ?1 C1 e8 I/ [- G
): O: _! ^) C% n5 u
)' C1 F" F* @2 V% g) _
(end_list), N! D' K1 P0 c' m% r
( H6 E/ _! @6 c" }1 ` (start_list "MTextDirection")
! q0 j. Y- q1 u) Q (mapcar 'add_list '(
% d" |4 u" i3 B5 C7 Z "Horizontal"- J* \7 H( l% _+ |- T: W \
"Vertical"9 f' M! \* V; I5 `. a
"By Style". N, d2 ^1 ?% D, h2 p, C, B* E
)
7 t) o4 m( V" P- F# T )
, b+ b) S( J7 P, {6 C/ @" q. G (end_list)
) F$ o( X6 a& H% P6 C+ r( |6 N5 y2 g- ]$ B% n0 {7 u
;; Set initial tile values
, j7 S- {( ? ?; v: j3 K$ g (set_tile_props)1 G- \; ~3 m2 F; C
(set_tile_handle)
4 u% `" k9 d, y* }/ A1 k t7 n (set_tile_pt1 0)) W# c' \- u# \1 k. M% E
(set_tile_style)- [# | \' Q# D' g6 ^$ q, g- L
(setq just-idx (cdr (assoc 71 elist)))
6 S. x7 @9 V2 e1 Q6 I. Z9 E/ A (set_tile "MTextJustify" (itoa (1- just-idx)))
# ^0 h2 G4 L0 Y) g8 l (setq dir-idx (cdr (assoc 72 elist)))' k! k' i% h* ^8 d& M
(cond
- b5 J ^/ j# \ ((= dir-idx 1) (setq dir-idx 0))
+ g6 a& u$ [ F5 e4 }5 i0 q ((= dir-idx 2) (setq dir-idx 0))
1 J7 ?9 r1 ]- J/ x+ u4 H! w1 B ((= dir-idx 3) (setq dir-idx 1)). l; r1 o9 x/ B0 e/ X9 u0 s0 m
((= dir-idx 4) (setq dir-idx 1))/ F/ C$ F$ o4 C& g
((= dir-idx 5) (setq dir-idx 2))
% w% ^9 |8 o, Z6 L/ C7 i (T (setq dir-idx 0))+ J3 A6 I7 p8 u3 v
)
6 |: A& W0 Y* k (set_tile "MTextDirection" (itoa dir-idx))
0 U' a! P& l% i4 c6 l L5 Q (set_tile "MTextWidth" (ai_rtos (setq wid (cdr (assoc 41 elist)))))
. O1 ]4 _2 ~$ i/ H3 T; p (set_tile_hght)
1 ?; h% v; M, |5 s (set_tile_rot) Z8 Y9 _5 D6 T, m# |
7 s, M* K! M# I
;; Set edit box, disable if too long
; ^( Q% j- p7 p1 e; t (setq gc3 (cdr (assoc 3 elist))* J9 ^8 `, \4 z2 I7 x9 l
text (cdr (assoc 1 elist)))
0 |4 X4 y1 t+ M7 E (if gc3! F( S% i7 {* @2 d3 m/ }
(progn ;; Text is over 250 chars, disable edit tile4 Z; @6 ~2 [% K5 e0 t( C5 e
(set_tile "t_string" (strcat (substr gc3 1 25) " ..."))0 ~4 C- o4 P1 j9 j5 R
(mode_tile "t_string" 1)
$ v) o$ F! Y8 T9 c! g$ O )
4 M/ S# V' X4 d: b3 @3 c (if (> (strlen text) 80)
% {7 q9 S, O. F3 s (progn ;; Still too big
) E# E. u# e$ I& P (set_tile "t_string" (strcat (substr text 1 25) " ..."))) K# W9 R' f4 A5 b, ^. f: x
(mode_tile "t_string" 1)
7 G5 z3 V7 P7 y7 {, Z( b# M )
3 q1 z! i8 {; z7 }. U1 S& A (set_tile "t_string" text)1 h, |0 h- j; D/ o
)
- ?0 K# n O. A" @6 o )) c& \: Y5 L$ F( k: \+ M* H% O
4 {0 _0 G2 @" B5 Y" L4 W/ I
;; Define action for tiles! Y3 _2 Z8 h9 I5 l* F. z
(set_action_tiles)
0 t2 i9 j/ j+ M4 s7 h (action_tile "style" "(MText_style $value)")2 O, S! S( h1 x9 K' N
(action_tile "MTextWidth" "(ver_MtextWidth $value)"): f# N4 ?2 L7 b1 B7 {: |) d; j
(action_tile "MTextEdit" "(done_dialog 4)"): a. H! O* T6 i9 I% Z- _
(action_tile "MTextJustify" "(setq just-idx (1+ (atoi $value)))")" q( @2 c* E8 D9 L/ Q A, j- {! D+ y
(action_tile "MTextDirection" "(setq dir-idx (atoi $value))")
% W6 v. D$ z2 E8 ^/ H: Q! m7 _
. R1 W: e, i. V Q: {) ^ ;; Set initial focus to text edit box.3 G- d' v& v- j# x
(mode_tile "t_string" 2)* D2 _8 A0 b! v
+ E- i0 a) {; X; h8 V ;; Run the dialog# G0 [1 H, x8 i( {5 K0 K( j; r A8 s
(setq dialog-state (start_dialog))# s; J' {- Y" `1 d2 b" [; B/ J; \* ?# C& P
(cond& P7 \9 N! }7 n2 j/ m( \
;; Cancelled - restore saved data; [( |1 o$ }0 a& I+ ~/ t
((= dialog-state 0) (reset))/ E0 z+ i) H, `* }; B
;; OK - save new data; e5 i# l# N* F5 {9 b
((= dialog-state 1) (modify_mtext))
5 `- _% W, _, r0 C" H m" C ;; Pick new insertion point4 y7 x9 b3 x# l* f! J" c" v- [) ?+ n
((= dialog-state 3); a* R1 {/ y+ F7 y T
(modify_mtext)
8 R6 t. \+ T5 c4 B% y' [- c1 d, ~ (setq pt1 (getpoint (list x1 y1 z1) "\nNew Insertion Point: "))- H1 q) @% n: l# H _/ H
(ver_pt1 0)
! n$ R( s& T# v+ I3 e (ddmtext)# `$ l4 s2 A; L; a) w4 i0 D
)/ y1 ]3 x' D. y2 }- l6 j
;; Run full editor
. `. b4 D8 a/ { ((= dialog-state 4); C3 ~+ l; t) h- Q% h, e
(modify_mtext)0 L' O: G" p: X& H5 l
(safe_ddedit ename)1 `; t# w! O! J7 o+ ?
(setq elist (entget ename))4 b, K0 [5 s" G3 a8 x
(ddmtext)$ L8 [2 V3 x |8 s
)$ E6 d6 T6 @9 Q, s; C+ k$ j
(T nil)* S1 K$ E, D% [% |5 @& B; q
)1 D- r/ I! S3 X7 J% n
)
3 N) A% w, F/ K9 y9 O' _
3 c3 n4 k: ]$ [9 Q% | ;;
* ]: m! v( Q+ D' Z' K3 E ;; Modify VIEWPORT
) V: g: C D- x8 ~& b ;;
* x) f `5 i5 n% e
- N" H* G F/ H0 U (defun ddvport ()4 n c9 l5 Y7 S1 x* F& c
(if (not (new_dialog "ddvport" dcl_id)) (exit))
$ N' R! `. A8 R$ }3 F& s2 c (set_tile_props)+ H( A7 M+ v$ o2 {8 e
(set_tile_handle): U. U/ a# [4 ^6 _
(setq vpt (cdr (assoc 10 elist)))2 v5 v2 ?/ U4 s0 R) D7 O0 O( E
(set_tile "xtext" (rtos (setq x1 (car vpt))))
8 c3 h/ @; I9 E( e L Y0 P (set_tile "ytext" (rtos (setq y1 (cadr vpt))))- c+ P" N5 X7 z4 i; ]2 l( ]
(set_tile "ztext" (rtos (setq z1 (caddr vpt))))
+ F! o7 g% q* Z4 R# L$ S+ e (setq wid (cdr (assoc 40 elist))): Y. `- H6 L" c, S- `, X. q
(set_tile "wid" (rtos wid))1 o. D- I0 I' w
(setq hght (cdr (assoc 41 elist)))
& L" E9 ~( Q( m: o5 {7 ~4 i* _ _$ F (set_tile "hght" (rtos hght))
' f, Z5 r9 X1 d! Z4 @ (setq vpid (cdr (assoc 69 elist)))' S6 W- x+ S. D1 q% p
(set_tile "vpid" (itoa vpid))& ~1 I2 a/ m7 d0 T* k
(setq on-off (cdr (assoc 68 elist)))
+ o* u: G5 {, l/ ^ (cond" W( w% q1 X/ e* _% ?6 U
((= on-off 0) (set_tile "on-off" "OFF"))
- V+ Y8 o7 c% A: B: p- x ((> on-off 0) (set_tile "on-off" "ON and Active"))6 F6 B+ C; p* J5 D% m
(T (set_tile "on-off" "ON and Inactive"))
" P" |1 O% h4 w! G )
4 k& r- r/ m2 V1 J2 n& y/ x+ X$ T7 m' f J! ~# _2 T' A/ `
;; Define action for tiles! L* t) g' }( ~3 C1 m/ L
(set_action_tiles)0 f c! L5 m3 o* n
\; j3 l& y( [3 f: q2 Q
(setq dialog-state (start_dialog))
4 K$ K A/ ]6 }0 `* z( v (if (= dialog-state 0)$ |8 Q/ {+ `5 U3 j' _$ J4 T
(reset)( D2 l- [0 ^/ I5 I
)
9 {5 I$ g5 N& x+ r1 }/ V (if (= dialog-state 1)
6 h, K7 X6 `" t; R, n- f+ ~- ^ (progn& `: E5 o ]5 o
(if (= ecolor 0) (setq ecolor "BYBLOCK"))
- e9 K- ]* {8 m (if (= ecolor 256) (setq ecolor "BYLAYER"))$ }0 U" o* s! [9 O* v
(command "_.chprop" ename ""$ n4 }8 K& Y8 M) A
"_la" elayer
' ^/ G1 e) i) W5 d; J+ a0 x "_c" ecolor ""
& m l; B8 R, A- \ )
0 n# x- Z% f' b e% j )5 I! X' ^ p& C- v. p5 w6 c
)
" t" d7 g7 [- D' L1 a: @ )
6 @! v; I6 B* H2 z4 y! W ;;
J3 D2 Y! {% ^! i* Z X1 s ;; Modify POLYLINE
7 P* r1 ]7 \+ C ;;
8 _" S" i+ D+ g' d1 J (defun modify_polyline ()
1 n( j! i# _# e7 S2 g# u5 ?! |/ t (modify_properties)( t0 U) O7 L V) O2 s" t; [$ I
(if (= ltgen "1")
; g) S0 b, e. Z, v/ G (if (/= (logand bit70 128) 128)
" d( t* w1 R) _+ W9 F3 D (setq bit70 (+ bit70 128))! ~9 m# _! q7 x3 h
)
& x2 d* I. Y' Z" @. v )
8 o. q1 ]; \; W9 ^ (if (= ltgen "0")
% o! F; p- N1 g6 L) G0 c! P, b (if (= (logand bit70 128) 128)
/ P$ _" W0 p q (setq bit70 (- bit70 128))
7 B) |4 U) d1 ?4 g' k )
9 b9 d E6 i/ R0 ]% v' W )! O e% `+ }2 D
(setq elist (subst (cons 70 bit70) (assoc 70 elist) elist))4 g& K8 l( M4 `
(entmod elist)! {. O; @1 v" ]6 [1 c9 S
;; Added to take care of updating Vertex information for color: F$ N4 f/ g# {4 J" h
;; and linetype.8 {% l0 _, A! _. L
(setq save-ename ename save-elist elist)& v) U! R' \5 b+ o' ]
(if (= (cdr (assoc 0 elist)) "LWPOLYLINE")
3 D2 C# {. N& Z7 A, H+ t (progn% P7 d$ K r7 R. m& H. }
(emod ecolor 62); S2 w8 `- y/ U
(emod eltype 6)
' D }* q# q( y- ^6 S (emod eltscale 48)
4 u/ l# u8 Y4 O (entmod elist)' \; G* v m9 \8 a; j/ Y& O) x
)
$ ^6 l, k$ f ^, L$ B (progn
? ?, a6 l% P( R( U (setq ename (entnext save-ename))! r* |7 J$ ^0 l( A1 Q8 `
(setq elist (entget ename))2 R& A7 H1 ]- [* n; c
9 c* ]# U& C4 M; w (while (not (= (cdr (assoc 0 elist)) "SEQEND"))
% i4 e8 X+ p) ]1 m- T (emod ecolor 62)/ T" l( s1 h) H1 U% k- V' ~
(emod eltype 6)
6 K! f' G( C* x1 w6 [, A+ q (emod eltscale 48)
" O8 t2 R3 }- |+ `. s' M& m (entmod elist)
& { q, B0 p$ I (setq ename (entnext ename))
- a% C2 f/ O& {' m0 ~+ t# V (setq elist (entget ename))
. q" Y2 P- L8 ^+ j )
' \% B. p0 H- Y- S' d) `$ l! u; z- k )7 z8 ?* R5 R( B9 U6 `
)8 P( C& A, N# m4 v/ M! u
;; Update the SEQEND2 T, S+ {; t% ]# F
(if (= (cdr (assoc 0 elist)) "SEQEND")
" E q5 y+ N1 l7 T' o: q7 Z! u (progn
- a$ J+ D- ]; Q5 E3 L1 u" G& d (emod ecolor 62)! Q5 p9 R! X: s4 B6 z2 n6 z
(emod eltype 6)
- ^9 t* L, ?5 y. G: U, m/ r; ` (emod eltscale 48)% L6 g& T5 h7 g8 R0 \
(entmod elist)
% w; ]! D: A$ d )
5 s5 h3 w+ ?# `: Z )
" C6 R I- I3 }; e- c- T' A1 l ;; Go back to header.. e; c! h L) ~& Y# ]+ H! N& [2 I
(setq ename save-ename elist save-elist)$ y* A0 u7 _# _) O% z4 ~8 q
0 m0 x7 }6 w$ l (entupd ename)" d6 {' H& S) w, e; ]* a6 K( W
)3 m7 n0 O% U) l9 |
4 S# D9 A4 q& j, } P. @
;; Increment vertex. Set tile values to next vertex% ~4 P5 \% N3 o9 J+ k
;;
) v. w! C5 E2 X% k3 ?! x, f/ V (defun next_vertex ()
" R a5 f" z. a( F" t (if (= (cdr (assoc 0 vlist)) "LWPOLYLINE")
3 G l* J* e& ] (progn
3 b1 u) k' K3 c8 k" G5 r# I3 Y ;; If the counter reaches the number of vertices,0 R) M9 ]0 A+ z& h2 W8 ]. R6 [
;; roll it over to zero again.
) Q A' b4 O, Z( K (if (= ctr (cdr (assoc 90 vlist)))
: @- x9 P9 j# M# Q* I8 J0 {3 m+ y (setq ctr 0)
, T$ k( q7 x0 v )' w2 q( w c& w
(set_tile "ctr" (itoa (setq ctr (+ 1 ctr))))
( T4 v( U! K( G. u2 e0 g& E a (set_tile_vpt pointype)9 J1 f: G4 w* {8 a
), x9 K5 Q/ I7 L: ^: b, h
(progn& r B7 c9 C/ S3 J
(setq vname (entnext vname))1 t% ]) h" J/ r' P% K4 M
(setq vlist (entget vname))
$ @8 O. k$ S4 o! m2 o: F (if (= (cdr (assoc 0 vlist)) "VERTEX")
& I4 N6 k- A; t+ m% q/ I (progn
, ` R% M: F5 K8 O6 Z9 h (set_tile "ctr" (itoa (setq ctr (+ 1 ctr))))
) v$ O$ x3 @+ R; w (set_tile_vpt pointype); @4 G) `+ n/ }- C' I7 j& l
)1 q! k! K" H R$ {
(progn
/ \( |! k+ m9 m# N (setq vname (entnext ename)); w8 ^4 {2 v; I. J1 S+ B
(setq vlist (entget vname))
& R! T% H% m/ x2 b (set_tile_vpt pointype)
; x7 H! [( K- H1 } (set_tile "ctr" (itoa (setq ctr 1)))
: m7 I; n( L" X' T$ i& r1 p )2 D" {1 `& k+ j) ]: q8 B
)1 s1 h. m% q4 j5 k5 o* C
)
: R" h! l7 l* W+ u7 q )
5 \6 ?6 { ]* ?. V3 G7 z )$ U% {) _' C( x0 B& p7 F! u
" [9 Z# M, y" Y& `
(defun ddpline (/ oldecho)
; M" l1 E, h4 c# ^$ h (if (not (new_dialog "ddpline" dcl_id)) (exit))
+ `( c3 u l) G- _ F# ? (set_tile_props)
1 }% [& Q6 q: A8 a: i (set_tile_handle)
# T* _ I- [5 r5 h3 n! Q: W (setq bit70 (cdr (assoc 70 elist)))
% ~. E- ]) L5 ~7 F8 p1 ~. e (setq bit75 (cdr (assoc 75 elist)))
; p: Z: k/ q4 v (cond
7 f$ b+ M% r6 }' P ((= (logand bit70 8) 8) ; 3DPOLY2 m) v2 j u* I6 a5 r
(set_tile "ptype" (setq pltype "3D polyline"))* A2 q4 f) U7 b/ C
(setq pointype 0) ; WCS or ECS point values. V4 v7 X! U- L, B# X6 N
(mode_tile "fit" 1)2 h1 n+ w( f2 }4 a0 t
(mode_tile "mesh" 1)
7 x+ y* L/ g5 [4 S/ Z8 {6 j (mode_tile "bezier" 1)% ?' w$ q& s# w2 F- \( m9 N
(mode_tile "ltgen" 1)- z+ v/ E5 x$ K
(set_tile "none" "1")
/ N0 \0 v, d- \: } (set_tile_closed)
2 a! |' |8 _8 s3 E8 N9 J (set_tile_fitsmooth); c3 d/ |9 O) P5 c9 u$ ~
)
; W5 y1 o0 X9 S ((= (logand bit70 16) 16) ; 3DMESH: I; w8 r# I0 E# K
(set_tile "ptype" (setq pltype "3D mesh")), ~- f! B. z/ r, B* P1 m
(setq pointype 0)8 t& Y, Y0 ^, k( F3 H
(mode_tile "pline" 1)
; x* L7 x: C1 U( R d' K/ g7 r (mode_tile "fit" 1)
# v& |1 X" _3 E3 h' U" E (mode_tile "ltgen" 1)
4 j2 a2 |' {- D (setq m (1- (cdr (assoc 71 elist))))9 f2 ?5 x6 G* w. C$ r: x
(setq n (1-(cdr (assoc 72 elist))))
3 G* I+ X3 T6 }" l2 q6 o: h (setq u (1- (cdr (assoc 73 elist))))/ L4 ` d$ {* t" w7 D" Z7 B
(if (< u 0) (setq u 0))3 J2 x5 [9 v& `% f6 R8 R! L
(setq v (1- (cdr (assoc 74 elist))))
, q! w d7 |9 G0 ?- l (if (< v 0) (setq v 0))0 G! G6 Q# ?( e. i& w
(set_tile "m" (itoa m))
& B( h$ S' k1 _" {* k( K (set_tile "n" (itoa n))
% ^7 D' a0 C% u9 X! G2 q5 Q (set_tile "u" (itoa u))
`+ D% e6 t9 e: H (set_tile "v" (itoa v))9 O* V( ~1 s3 s$ W' S, A& g
(set_tile_closed) f, Q) h$ y+ I7 L! k% d4 O5 d. z
(set_tile_fitsmooth)
9 @" L) p# ?4 U9 m5 ?" I )
- _. H; g" X! ^ ((= (logand bit70 64) 64) ; POLYFACE MESH
: }/ k5 _: i5 k0 H$ Y: e (set_tile "ptype" (setq pltype "Polyface mesh"))
: n9 i1 g0 P2 _- I; n (setq pointype 0)' {/ Y) @* R0 D
(mode_tile "f-s" 1)
5 d5 r( I, T3 l2 R3 L- U (mode_tile "mesh" 1)+ H2 u/ v5 ?7 @6 @9 m4 W
(mode_tile "pline" 1)
0 p3 f% M( Y6 o) j4 S3 F )
, O5 N& w) a s: o; T2 S2 p (T ; 2D POLYLINE' j0 o( O( g7 c- S! B1 I
(set_tile "ptype" (setq pltype "2D polyline"))& H" S7 i: _4 F+ j* s9 K7 N/ J
(setq pointype 1)
G7 c; M$ O2 J6 p: P5 T: ?% W (mode_tile "bezier" 1)7 J6 o* Q. t1 c
(mode_tile "mesh" 1); ~+ R' V4 S4 W* ` T
(if (= (logand bit70 128) 128)% K# e% C: I1 k# p0 B ~; z
(set_tile "ltgen" (setq ltgen "1"))
+ Z- O% |7 j! \/ t+ q1 | )! H0 [6 V, F! ?/ A5 \
(set_tile_closed)
1 S" q/ W+ w6 m* N# T (set_tile_fitsmooth)+ n; W; p8 b5 a
)
_! O3 \* a$ S# I )
' w) T% R5 L# ?& n5 ~! e% D' q" K& Q! x/ Y# s# Y4 A
(if (= (cdr (assoc 0 elist)) "LWPOLYLINE")
4 c, C0 U$ k$ Y) _$ N" \ (progn* o* @# Y3 E4 f- }
(if (not next) (setq vname ename))8 p- y0 D2 @& f
(setq next T)
% h8 o1 T1 D& v# n (set_tile "ctr" (itoa (setq ctr 1))) r$ a' p' C3 n7 i9 z
(setq vlist (entget ename))
[, p" D" c \: H5 _, c )
) \+ d/ O9 n# t$ N: ]4 e( b (progn) B2 p0 H- l- h* U/ Q
(if (not next) (setq vname (entnext ename)))6 M1 X' q, V7 ^) V, I
(setq next T)( p" f9 W- ^' N) }6 Q6 _- n
(set_tile "ctr" (itoa (setq ctr 1)))5 D! U) V( p' K
(setq vlist (entget vname))2 n+ C$ T, r" {
)) {# C2 \+ h2 G- M% J3 k
)" ?, r& t' K; x1 L& O
(set_tile_vpt pointype)
( N0 q" `4 o# T" ~* X ;; Define action for tiles V* B# c- U6 i/ {
(set_action_tiles)
0 r7 j' e2 Q% h6 P (setq dialog-state (start_dialog))
3 e1 b8 x, x4 y2 h, a/ s
& F( h; n) j4 ~8 W (if (= dialog-state 0)
A( A5 J8 f! ? (reset)
B3 N7 X9 t5 F& N) ?! P/ x4 J5 ` )0 _9 p9 V4 F- M$ x/ E1 `* Y
(if (= dialog-state 1)2 a e2 h9 J, \1 A9 p2 f
(progn
7 ~- n+ }5 `% s; R/ e* P T3 ? (modify_polyline)
9 l& G& ^& B, N/ P (if (or (= pltype "2D polyline")
( I6 f* D9 v+ D3 i# e+ D' m% `4 p (= pltype "3D polyline")
) y* E/ B: }5 _( P2 m }7 A, E )
6 }- E3 _2 S4 Z5 W/ ~) X4 F (progn
0 u G" m8 \' N' L (command "_.pedit" ename)
0 h! `7 z6 `4 R! f (if (= spltype 0) (command "_d"))
2 |+ F+ y+ _- C6 w2 W; r" b (if (= spltype 1) (command "_f"))
8 k& f- ]5 R: d+ t! s3 N' N (if (or (= spltype 5)
1 |& v1 [: L* \& E* R; U$ j$ ? (= spltype 6)
1 @/ t H6 H% N( t7 Q, ~. {4 E0 \ ). c/ J2 g X$ W+ z
(progn
2 Q/ Z0 m" e, A4 }* }$ n3 I (setvar "splinetype" spltype)
4 n: ?# r% i( ~0 z% |; c (command "_s")/ e2 e! e' t# j- ^0 U( V# H
)8 t# H! \/ J* n3 C9 p$ i1 T
)1 G3 \: M+ h8 o
(if (= closed "0")) w5 ~7 g: w- d
(command "_o")- [: t! B% Q3 b/ E8 a. e7 M) {, l9 A8 j
(command "_c")% r% C& \& z5 z! f4 e4 [
)$ n9 e9 J, J- t) {( Y8 ]
(command "")
- Y9 h: q% b, ^2 S
9 @" Y8 v" x8 X% e L (if (= spltype 0)
3 s4 {6 q) M% A (progn
$ ?" C, X1 G0 J+ i, r' i (setq oldecho (getvar "cmdecho"))8 G+ t1 {) R; G# A& [
(command "_cmdecho" 0)
' |- \9 G7 X- f9 @ ] (command "_convertpoly" "_light" ename "")3 I! E- p, T4 y: J9 T; U q* f
(command "_cmdecho" oldecho)- x' v4 @/ `5 l j* ^
)0 p- T9 z, D/ ^# v+ \
)$ {/ A+ n# c; S% n
)
( R' a% ]% z6 V )
; n" ~( ?% J. J& J (if (= pltype "3D mesh")
7 M" W) S/ n& |! Z; U. V5 ~ (progn l, i: C: u& d8 P/ J' R5 {
(command "_.pedit" ename)* l' W. C% ^% g$ @, H
(if (= spltype 0) (command "_d"))# p7 [0 K# d6 v
(if (or (= spltype 5)$ J c1 n% m) F! ^# A0 c" ]
(= spltype 6)2 C" v& ~2 |' E& `7 n
(= spltype 8)" N' E, x" _6 Q( S
)
7 f1 R' }9 S; T1 \" S7 H (progn F6 B4 H$ V1 A2 g2 K
(setvar "surftype" spltype)
. m: C! v* b; e- q0 R, I (setvar "surfu" u)
1 M- a1 C' ^ D# l4 j% G# I (setvar "surfv" v)$ e% l7 u# G+ v) y
(command "_s")
2 e- V; B: y+ _ )
" ]# i7 h1 C; l, A1 J8 w )
0 b2 ] |6 r3 S' ?" K( ], @/ c" z6 r (if (/= closedm old-closedm)
! B+ V$ r& m' ` l( ?& }# [ (command "_m")& ~# Z% ?* O- z# }9 @7 e& U
)8 X3 V5 q- O2 z, `" n
(if (/= closedn old-closedn)
" h; | g/ u% h" \ (command "_n")$ S R4 W* V2 R# r
). @0 \1 Y d7 R& @1 {% i" P v
(command ""); x& w' t. K& k; i8 b
)
* k9 R3 e$ O" x. C )9 c( ] W v$ \6 x
)) }+ G9 Z, h8 S# ^% E" E+ p
)6 @7 y: G1 d5 \% z. H' Q' z
)( g, W# O7 A" p( _9 w8 C% R
;;
6 E! C+ L; W6 L1 B ;; All the spline data is contained in a single elist. We must do some- ?; h! p7 }( b& }& P" |9 J' q
;; tricky list processing to loop through the elist in order to display) w$ ^2 ^" T! z$ g5 T8 o b" G
;; all of the control points.
: S) ^0 V7 ~2 ^+ ^ ;;
$ `' M3 E# d. A ;; The structure of the elist is different for rational and non-rational
- X& K' S* |9 J; h6 l. v. M7 v ;; splines. Therefore, we check the rational spline flag.
. j$ S& u' K* g9 G, X ;;
- I: }4 z8 V; R (defun next_cntl_pt ()3 G$ {1 ^" C) `: ?1 u
(setq elem-no 0) ;; elem-no = element counter
4 Y i* ?9 o% \3 F (if (= first-10-time 1) ;; If first time, find location of first7 F6 ^" m! P; {9 ^
(foreach list_item elist ;; cntl point element in elist* B4 \; J$ S* C; r* z& \! u
(progn
' x8 {0 O3 U7 Y) a, l (setq elem-no (+ 1 elem-no))0 K# h( R% a2 V" `! T7 |3 g
(if (= (car list_item) 10)( m1 e+ A! ?& E+ U4 C" n+ f- u
(progn
$ Z; N1 E. r7 ]0 I5 Z! w (if (= first-10-time 1)8 M5 k; g5 e& J; L& W- x
(progn
) }) v# o+ b2 z/ g' @* |+ Y (setq first-10-rec (- elem-no 1))0 T: ?$ y8 v. ~; y
(setq first-10-time 0)
$ J" p7 H$ k+ A$ U (if (= rational_spl_flag 1) ;; if rational
7 _/ P' j3 \; K: y (setq cur-10-rec (+ elem-no 1))1 H4 f: }( ]5 `* U( } c
(setq cur-10-rec elem-no)6 m2 X4 K5 r% A" }9 C1 B
)
9 i9 j! ^- w% G; n: r )8 ?& p- m( k0 P+ W: A( m
) j3 f& w1 Z. T; j& T
)' B/ O: |8 x6 ]- c
)% a# Z7 x6 c7 W! G
)
9 v# u6 F1 B6 Q ~9 R: Z )" Q' b; n i. k/ M: @
)
6 K9 d) }, ]! Z* M ;; Now we know the location of the first "10" record; it's stored% P; R' a/ E$ V) ~
;; in first-10-rec. The first 10 record was already displayed when
4 x- ?/ u) e/ O6 k0 t4 C F& @ ;; the dialog first came up so let's display the second one when q' X6 N0 o- W& Z3 W
;; the user presses the "next" button (the first time through).' E/ L4 v* S" l5 I. D
;;
+ ]( w7 Z2 s0 T' S# {; n* @ (setq temprec (nth cur-10-rec elist))0 m. M( z# D" W2 Z$ `9 r
;;. ^+ _1 j9 ]; m9 l6 }
(if (= (car temprec) 10) ;; if 10 record
' | a) y6 D& \) x* } (progn
6 N x: W" }' @2 p( O (if (= rational_spl_flag 1) ;; if rational spline5 z& }; z8 }- G# w e! l; `
(progn
. ~4 C. B; ?7 R9 x- Q. X (setq tempweight (nth (+ cur-10-rec 1) elist))
8 S5 v0 e/ M' k! P% \0 k (setq cur-10-rec (+ 2 cur-10-rec))
- h& i( c! D% C7 V; J+ p5 c )# M% Z! F5 E) C, q/ n
(progn ;; else6 M2 y: E+ y# u7 K- [6 p F- ^
(setq cur-10-rec (+ 1 cur-10-rec))1 Q! `( ?) B) q% v
)
- Q1 D _1 M G5 P& p$ ~/ V )' {6 o2 n/ U7 b$ \
) ;; end if rational spline, z' m4 @/ L# ^! c
(progn ;; else reset counters
3 A+ |. r; o3 p1 b (setq temprec (nth first-10-rec elist)) ;; get 1st 10 rec
b3 Y2 r$ Y5 f0 C (setq tempweight (nth (+ first-10-rec 1) elist)) k# H( _ c. C- O' B( ?; g
(setq cntl-pt-indicator 0)
# n: {/ h6 f: i, G4 {) h0 t (if (= rational_spl_flag 1) ;; if rational3 X! o6 G; `) Y$ n2 H% t4 Q
(setq cur-10-rec (+ first-10-rec 2)) ;; point to 2nd 10 rec' E3 c; U4 v P. B7 s/ O
(setq cur-10-rec (+ first-10-rec 1)) ;; point to 2nd 10 rec, J8 H' d2 o+ W0 C8 g9 D
)9 `3 i; [" h& V5 a& N
)$ E# b: X0 _" i
) ;; end if 10 record6 {9 u/ t3 T, V: v: b1 G- w
& w# S7 L3 n! z! C q8 t: g& G' s4 o ;; Display cntl point, weight and ctr. Increment ctr.. c8 D$ R" k/ N5 k( @1 ^
(setq cntl-pt (cdr temprec)). O+ Q7 A$ ^3 z4 k1 G
(set_tile "xtext" (rtos (setq x1 (car cntl-pt))))- y1 T' h3 @5 X1 i% l9 h7 B
(set_tile "ytext" (rtos (setq y1 (cadr cntl-pt))))
* Q2 V3 l; D* c8 m+ ^1 N5 \: a (set_tile "ztext" (rtos (setq z1 (caddr cntl-pt)))) P5 d/ I; M6 T7 p; y& M
(setq cntl-pt-indicator (+ 1 cntl-pt-indicator))
2 |- k/ M) I% n) m- U (set_tile "cntl_ctr" (itoa cntl-pt-indicator))
, J& `: s) V. l0 X$ l! M( S' z (if (= rational_spl_flag 1) ;; if rational0 s2 O* i8 a3 g$ {0 b. I+ T
(set_tile "weight" (rtos (cdr tempweight))) ;; disp wght h$ l5 X- A+ ?8 W: T- r- q
(mode_tile "weight_text" 1) ;; disable wght
, Q* p( Q" _" e4 I0 Y3 K& B6 ^% l, P )% ^ u8 C, B' M" G; s+ J
)
! o6 d0 @, P; B- ]# |4 A! N2 b" | ;;9 S [ \8 r, Y; n1 q
;; All the spline info is contained in a single elist. We must do some) l2 M. V6 T+ S
;; tricky list processing to loop through the elist in order to display
0 z% R; W4 R9 W$ `; J ;; all of the user data points.* S8 m7 d. [0 s
;;
$ T: c. g5 ]5 D( l (defun next_data_pt ()
8 q3 h. O: S6 H& m (setq elem-no 0) ;; elem-no = element counter
; G; r$ a3 B1 _2 C4 v (if (= first-11-time 1) ;; If first time, find location of first
0 A0 H$ T1 ?: ? H9 { (foreach list_item elist ;; data point element in elist
2 A6 j0 b2 A, k (progn! \0 w9 b/ ^% }
(setq elem-no (+ 1 elem-no))+ i2 K# |8 o8 a! [6 L
(if (= (car list_item) 11)+ N I$ q$ Z4 O4 I# a- b2 I& K
(progn
8 j U2 X- j5 _ a: J/ T _ (if (= first-11-time 1)
/ x: t% V% x* o- H6 { r. S (progn T3 a4 g; N9 V7 I$ O& x$ k" E
(setq first-11-rec (- elem-no 1))
0 i9 t3 q& q, x, f4 d8 d2 S6 d3 U! f9 k (setq cur-11-rec elem-no)1 ~! s7 B* L, `& b7 ~0 K
(setq first-11-time 0)4 V7 o+ m# p/ h( V5 O
), P$ r9 g/ h4 J4 l" o
)9 p; j2 `, S! A/ ^, x7 f0 v% l6 d
), Y. I3 J2 X9 F2 l; w( o) O
)
8 l0 X( j7 @# a/ J, ?2 k )
! J6 e _# G" |3 B$ x2 x )
- \0 ^7 ?: G4 [0 z )
- x% v! O* o% p0 l3 W4 | (setq temprec (nth cur-11-rec elist))) j) y0 @6 w& M* |5 p/ t
;; If it's not a DXF "11" element then we've gone past the last) l; h1 k% i; ]8 ~+ `
;; "11" element. Go back to first "11" element. Reset counters.
; W& ?8 t; v6 k! g) W/ Y (if (= (car temprec) 11)
* ?' D6 Z) r! S/ l1 e3 D (setq data-pt (cdr temprec))* y0 S9 f+ N C3 Q* O: v3 t9 T
(progn ;; else' s! R- l4 V, y; J( E3 M- r |
(setq data-pt (cdr (nth first-11-rec elist)))
; t) l( B# B: ]7 | (setq cur-11-rec first-11-rec)+ S- C$ x& I! q( T& w1 n
(setq data-pt-indicator 0)
: H# A' L9 P/ Y( u )
$ n4 c, h" _- R )
' v3 m0 ^- Y3 Q# m0 \ ;; Display data point and ctr. Increment counters.* |/ I% ~6 l1 p
(set_tile "dxtext" (rtos (setq x1 (car data-pt))))
6 {& e+ ~$ B! K" b3 b3 v7 a (set_tile "dytext" (rtos (setq y1 (cadr data-pt))))& t+ _) V& v$ ?& _, y: s9 H
(set_tile "dztext" (rtos (setq z1 (caddr data-pt))))
' V4 e& R# ~; Z (setq data-pt-indicator (+ 1 data-pt-indicator))
* g: N3 ~5 t6 E# M* p& a/ Y& ] (set_tile "data_ctr" (itoa data-pt-indicator))4 S8 _- n2 S, |5 i. t! }0 Q
(setq cur-11-rec (+ 1 cur-11-rec))
5 B' P) Z* N! O+ @0 h7 u( ? )4 L; ~; v9 e/ ?, i" T
;;
! v7 c2 X: h+ D: C# G6 N+ w0 d ;; Modify SPLINE6 E0 k: V' r" _& y
;;/ Q2 m. O. k" Z" N( ~
(defun modify_spline ()
2 y* k; F; Y. r (modify_prop_geom)3 y) C4 R3 S% e. M( I7 z; |
(entmod elist)
) d9 \9 ~4 k9 [ s- d( k9 y! c- V ) ~4 l& y0 w& N, E
! f' B! I4 B' g( b
(defun ddspline ()
2 c5 Z6 t8 m9 }+ l6 o (if (not (new_dialog "ddspline" dcl_id)) (exit))! p4 G, K* G2 k L3 _5 V3 F
(set_tile_props)3 d6 Q5 W: _# C% P$ ]) m* m
(set_tile_handle)
s/ J7 c. j2 i/ {) I (set_tile_spline_props)7 g J) B: D3 k" D
;; Display first control point: V# q/ K8 ~" f" Y
(set_tile_cntl_pt)
, |6 Z- e, d( e% m' `& o ;; Display first data point
2 R& X# K5 y5 u5 \0 m) k1 _, b (set_tile_data_pt)
/ B0 p& ^& {8 z) E$ q, @2 |2 R9 x+ u& U9 Q, v
;; Initialize flags to indicate first time through the dialog.& O9 | _3 ~& \& @2 q% m
;; For control points and user data points the "next" buttons
0 q! Y% |' [/ Y! Y+ x ;; in the dialog call the appropriate functions.0 _2 {1 X. R3 W3 X6 e& Y
(setq first-10-time 1)' ^ W7 p4 t1 L/ E4 v9 p, _
(setq first-11-time 1): C) q9 M: @" q6 `# ^
;; initialize control point number counter, q0 C# O" j/ ~" D$ Q( N3 t
(setq cntl-pt-indicator 1); x! y0 V; X* \4 t* l0 r
(setq data-pt-indicator 1)7 @+ R; E, M. }. r/ r( F5 b4 M8 t$ C
(set_tile "cntl_ctr" (itoa cntl-pt-indicator)), i0 c+ ?# b% o% ]" E7 z
(set_tile "data_ctr" (itoa data-pt-indicator))- l3 ]7 J+ G4 V5 h# s6 r( L2 Y, X
(set_action_tiles)
U8 |/ L* S1 I5 k/ |7 V (setq dialog-state (start_dialog))
( Q3 y& |$ X! @2 l8 Q i% Y# _6 x: l; s4 t' Y
(if (= dialog-state 0)
& H3 }( ~- N) \$ N4 R (reset)
4 c8 }% _7 J' |* S9 A* b )7 a+ Q1 }( K+ v
(if (= dialog-state 1)
$ u, F9 Y7 {- r (modify_spline)
- D' f: |: `$ _4 q) R- [5 i )
+ t6 x' J% i+ t3 p8 p g2 ^# U ); m. x' d U1 ]3 ?0 h
; u4 k+ [% z7 V) N
1 g7 D; q2 Q+ Q7 p
/ m0 z/ p$ b6 G; |3 A# O! _ ;;
- L( I( Q# K# Z! O& Z' i% V ;; Modify DIMENSION
3 R' f* e. c7 }0 s( j0 m ;;- Y# l5 ^: w8 l6 B# I- G
(defun ddimen (/ dtypebit blkname bename sublist a stname n dimtbl4 ?; Z6 {9 M. u, h) P; n& ~2 a# j
dimsty dimlist dimtext svtext dimovr sv_dvlist stlist3 ^* `- b& Z6 _1 z6 M/ e
dimtype dimsvcurset)1 j4 m3 P1 `+ i! U5 o
(setq dimtype "DDIMEN"
. i7 H- V0 x, _6 X dimsvcurset (ddimen_dimsty_restore)6 f+ b$ X/ `$ ? g/ f% L
)
+ a$ a" u& {1 O' a% ^+ G U (if (not (new_dialog "ddimen" dcl_id)) (exit))- W2 P& Z' o. l3 P! G B
(set_tile_props)
4 \% a0 ]" q- z; f, m2 f6 |3 G3 | (set_dimen_props)
, q) v3 f$ ^0 s+ D8 K; P (setq dimtext (cdr (assoc 1 elist)))
5 T6 b4 T5 L% M (set_tile "t_string" (if (= "" dimtext) "<>" dimtext)). |6 r: T6 J; j3 M
(set_tile_handle)2 Z! L4 X& ]( Z. r: p! O
;; Define action for tiles0 R7 r4 B G! }) e
(set_action_tiles)
6 c8 Z: H9 K# x( |/ |) ?# O' k6 u
% E5 h6 _1 L$ E; J. p ;; Set initial focus to text edit box.
7 c7 `) P8 F, o2 F! U# W$ v' x0 Z (mode_tile "t_string" 2)
% Q( J u' T$ A$ j2 m7 U; U, `0 Q6 k/ V: b0 z* m& M& u! F
(setq dialog-state (start_dialog))- f- k5 e- H( y- J) k/ D
(if (= dialog-state 0)$ V O( ]$ N' b- _' x
(if (= ddimmt 1)
: i! e- ]/ m" D4 h (reset)
+ H3 G F7 g5 m X' p )
' n: Y1 c- ^6 Q0 V+ b )
% M- E; ?9 k: o# T, N2 j5 \ (if (= dialog-state 1)
9 q7 @4 E* v6 s6 W1 B, U (progn) B* E" F& { v3 ~( i' Y1 a( ?
(if (/= dimsty stname)/ u/ ]6 D Q8 [) f$ H; i
(progn
. D9 T/ k7 q7 \; j) |( H ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case0 Q# l% h. [- H! m. k
; doesn't have it.
. R, `2 R7 ^/ x7 n (if (null (assoc 3 elist)): _) p4 N' T8 j3 B
(setq elist (append elist (list (cons 3 dimsty))))
- o7 ?- P9 p! U. ~0 W ; else just replace it.7 M. k1 F% l" l/ n9 b* c
(setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))
0 l' z2 R* F6 K0 I )
l; x/ b) T, g4 r5 h5 f ; refresh sv_dvlist with new dimstyle.
1 @& z2 G6 W! ~& e0 z (setq sv_dvlist (tblsearch "dimstyle" dimsty))5 q, O( ^ d, Z
)
" I( K- i; ?8 N$ E) K5 k2 `5 G )
) V6 q1 k( B9 ?8 E, O+ Z (if (not (null dimlist)) ; attempted to change dimvars+ a& W+ j) A) q+ v/ _, S$ Z
(ddimen_complist sv_dvlist dimlist dimtbl)) w0 T: j1 ]. @& U
)
4 w7 ]. k) }- I& e! u# e" x# M ; Modify dimension text: g9 E' g+ g8 {! W5 s; w
(if (/= dimtext text)7 H3 g. k; q/ V) ^: Q2 G% [# n
(progn
; n9 G7 L# B) W1 J9 H, C (setq dimtext (if (= text "<>") "" text))
, v6 [' `4 _ x5 ?9 t! ] (setq elist (subst (cons 1 dimtext) (assoc 1 elist) elist)); W3 T P0 z; q: a
)
! g' F. m& r! ]; [$ x )8 n" X) M; ]/ E1 X; a. V" L
(modify_properties)
8 c! c: d" i& Y (entmod elist)
; e6 H" p3 `" \; [- J1 d) W4 a )8 r1 F$ k+ z: H! V5 L
)/ _ c7 _* S- m8 l7 v. M
(if (= dialog-state 4)
- [: W' ]1 c) X+ j (progn1 v) [: O2 f0 O6 \
(setq ddimmt 1)% J+ ^+ X" J& u3 `
(if (/= dimsty stname)
% j+ L5 {& x0 }' t5 \. j% ~$ T (progn
$ X" {9 N! E i2 S7 M ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case
# O7 r# L1 `4 P, Z ; doesn't have it.) j e5 O' j, c
(if (null (assoc 3 elist))( w; v( @" |6 d3 O1 ` Y( `1 s
(setq elist (append elist (list (cons 3 dimsty))))! O. z i9 a0 @5 ~ L: d& D& l
; else just replace it.
7 E/ r" W+ v2 \8 ^# h (setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))4 L3 y6 f; _0 }( d* C
)
7 _% y7 z* x) @, _: t( W. O ; refresh sv_dvlist with new dimstyle. L8 D; y5 m6 Q0 \( n
(setq sv_dvlist (tblsearch "dimstyle" dimsty))
' T1 e4 k* }8 c0 @( i2 n( T )
4 {! O1 q! }% h. G )8 U( I3 Z& i1 u0 O) L9 K
(if (not (null dimlist)) ; attempted to change dimvars; v% F& w1 ]& ~! ]% h7 t) m
(ddimen_complist sv_dvlist dimlist dimtbl)
V6 r# |' v+ A8 H )0 p* l! g$ T1 H) m: E, D& j
; Modify dimension text9 ?! h) f2 a( ?$ f
(if (/= dimtext text)
/ I, c4 X- H5 f5 B+ i! _$ n (progn) a, R8 O5 J$ y
(setq dimtext (if (= text "<>") "" text))6 H) b) h8 o) g+ U/ x
(setq elist (subst (cons 1 dimtext) (assoc 1 elist) elist))" N( J: B$ Q+ `' ~
)
[6 Z9 n+ `6 U3 Q3 c )
# r) j6 U$ D [5 Q3 o. s+ b (modify_properties)) j3 K* L4 ?% N
(entmod elist)8 O3 G7 m# s$ _2 S: ^
(safe_ddedit ename)
3 I5 P* q# r' b3 f9 B (setq elist (entget ename))
- }: Z% X' r i4 H (ddimen)2 S C( Q( {% ?. `
)
3 P1 l3 x1 o, {5 i1 N- @ )* V3 z7 P, v" l3 S' C* m
(ddimen_setvars dimsvcurset) ; Prepare to exit4 {+ u# f$ I' L, S0 C* _
)) E3 \. ]- `( Y$ Y4 j+ Z
* [+ p3 x# x2 O& t: I ;;6 E! R3 b1 J- ^% p8 @
;; Modify TOLERANCE
8 W) k* `6 u: k9 n. ~4 |* r" x ;;9 [) y* f7 R. |
(defun ddtolerance (/ a stname n dimtbl
, {( J) ]$ ^- ?4 D; u( x& M$ {1 F dimsty dimlist dimovr sv_dvlist stlist dimtype
( a( E& ^) l9 N7 V3 E: K dimsvcurset)
6 z/ I+ A$ F% r6 U# }) } (setq dimtype "DDTOLERANCE". s1 N7 p. e% x# G6 [
dimsvcurset (ddimen_dimsty_restore)
+ H; z7 o6 h2 Q* p" A ). m! X; L- N) S4 f ?1 \8 w
(if (not (new_dialog "ddtolerance" dcl_id)) (exit))
" N2 A+ \0 `' N% j; v4 I (set_tile_props)
* Y6 @- V7 J* [5 z8 i: p (set_dimen_props); {/ n/ v& z! } x4 |; r2 C& |( D
(set_tile_handle)
5 [" F. S3 m8 e% r" U, D (set_action_tiles)
8 D- `! C- @* \2 E8 Q (setq dialog-state (start_dialog))3 o/ I" R- G) _) Y- ?& \& V D. X
(if (= dialog-state 0)8 s) f( d* B8 x4 L) o$ B; g
(if (= ddimmt 1)" w$ v4 ?0 V; u* ~, ^' ~
(reset)/ Q2 l( ^6 H! C d$ y: _
)
: V/ g" v8 s, [: i )3 h& |7 d( [1 l. o" |+ ^2 v
(if (= dialog-state 1)
( G. \7 g4 M5 Q' x6 } (progn N2 y. i2 U. E- l
(if (/= dimsty stname)
% k" U& A! t" A4 x/ l7 L/ E (progn2 H5 s. w1 ^5 F) b% y" N5 ^: _
; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case5 Z1 d) L# j3 L
; doesn't have it.9 e# A+ z3 E- p0 o% o
(if (null (assoc 3 elist))+ u3 f! n& X: d: U
(setq elist (append elist (list (cons 3 dimsty)))): h' \4 K( F# i1 _
; else just replace it.3 K$ _ _1 }$ N/ b1 y
(setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))( b: y( V3 _7 G/ K; ?
)+ ]7 T0 v: l5 ^+ k8 c5 l
; refresh sv_dvlist with new dimstyle.5 y" `4 e" g3 h" f
(setq sv_dvlist (tblsearch "dimstyle" dimsty))5 }( `; k$ K1 X6 m; E
)( G( u# v$ ~8 W& }7 D+ h
)
" B5 V5 w+ U! S: e+ ?6 X# u, `8 Q9 _% ] (if (not (null dimlist)) ; attempted to change dimvars
' }$ r1 @$ Q2 k" b4 G1 P0 h! P. H (ddimen_complist sv_dvlist dimlist dimtbl)5 s. M0 ] c/ c0 I: }$ P" S
)* J5 c# _3 s+ b5 i6 n1 ?( ^3 ^
(modify_prop_geom)1 [4 J0 f$ r6 p8 e6 M
(entmod elist)
, s3 x1 w4 {- i) a: E! { )( u; ?$ ?. \( I! u H" S8 b1 F
)
) p. t$ T! Q) M+ L6 t (if (= dialog-state 4)
9 k8 P# X4 |, N7 j* A$ m4 V (progn
6 m( o. O7 s# F8 K7 s (setq ddimmt 1) S* i! ?/ @' K( E6 ]
(if (/= dimsty stname)
9 M9 T8 E" Z% r7 s8 h9 e0 [1 L (progn
6 K' C# ^& T4 `6 i- `' K' x ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case
: L) W. d$ |/ ^/ }; K ; doesn't have it.+ V: N) Z0 M2 A' F
(if (null (assoc 3 elist))5 F' p+ q! r) E0 i, ?9 m
(setq elist (append elist (list (cons 3 dimsty))))# ^6 ^' L" I- Z7 ?' X
; else just replace it.$ P: w w& O: J/ o" Z0 e! N
(setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))
( g; O) E3 o/ ^ )
! B, }3 ~5 \: D: P3 y ; refresh sv_dvlist with new dimstyle.
5 \. U7 P8 o0 J9 Z8 d( r# M- I7 l (setq sv_dvlist (tblsearch "dimstyle" dimsty))0 _, E# F" a8 ]2 t& _
)& v& }: C! M- M9 P" ?8 }: J) k
)
2 Y. l5 m2 B" O0 m3 l! j (if (not (null dimlist)) ; attempted to change dimvars+ w% X) F& q3 c2 s
(ddimen_complist sv_dvlist dimlist dimtbl)
! m' Q. D# k! c) J )! U6 e5 m$ }% T$ { G
(modify_properties)
& A- I$ z8 m) p: L (entmod elist)% k7 x* C6 [! S1 {4 `
(safe_ddedit ename)
3 Y6 h R$ h$ g/ ^ (setq elist (entget ename))6 U& B& X' I8 l0 I4 r' Y
(ddtolerance)% O- d- @( Z4 q/ ^) E9 j n: m, O
)
" @1 A$ m7 w% C: K7 [1 k6 O ). L3 n; Y, B6 V# b6 w
(ddimen_setvars dimsvcurset) ; Prepare to exit
" A5 f" a5 @& B, N+ t7 i) s5 B" _)
7 [$ Z! N- {# s! y( Z9 Q% C3 N8 h: J
;;
# q6 D: q9 k# j: f ;; ddimen_dlg - jump to ADS ddim module
- y+ @* Q: c4 \8 b! ^ i ;;) R! M9 X, {+ L3 _* b( k
) u, W" |7 t/ t+ i- G (defun ddimen_dlg (dimtype tile dimsty dvlist / dimlist)3 U) \! E5 D3 a8 O* d0 U6 Y/ D
$ }0 w* Y) ?$ x" o/ w3 U: q6 C% _
; Jump to DDIM with overrides if any.! Y7 \1 W- J: N3 F; i
(cond ((= tile 11) (setq dimlist (c:ddim "DDMODIFY" dimtype tile dimsty dvlist))) ; Geometry
, @8 {+ t) G0 X( @+ d+ v( j ((= tile 12) (setq dimlist (c:ddim "DDMODIFY" dimtype tile dimsty dvlist))) ; Format
3 b* B% q& X/ Q- C& p; Q ((= tile 13) (setq dimlist (c:ddim "DDMODIFY" dimtype tile dimsty dvlist))) ; Annotation5 g- W- S% W9 g" k) A7 Z
)% R. N2 A8 z) o" q# ^/ U
)
, T+ H* Z$ x3 C' `7 O
3 @! [6 @+ r6 a& m" E- } ;;
9 w1 v9 b' s+ S+ L ;; Dimension variables updated are stored as overrides.6 Z3 g, F9 H- ]! m3 c& p, i: o5 |
;;
$ J, p; `- U# P4 i+ h7 p% k% [4 a5 ]& h1 F) R2 Q
(defun ddimen_complist (dimolist dimnlist dimtbl / i odvar ndvar
/ b0 ?% a0 l/ [" G" s1 s8 m& n dv dime commandIssued)# g# D5 h. ?) E+ h& r4 p! M- a
0 l: Y& D/ Z6 u1 } ; Here we skip the following first three items:
: d* U+ ?7 t8 x5 l3 [, c$ m ; (0 . "DIMSTYLE") (2 . sylename) (70 . 0). d- B/ i: |& y' ? X+ Y2 r# z) L
;
) }/ |' g( ^& r6 B2 m; ~ ; The list comparison immediately begins with dimvar.
( U2 P; y/ i0 {- V& A5 s7 Q ;
2 V- h: o5 h8 `, w9 |6 {) l, z& N ; dimolist - original states of dimvars
) x& B$ [& }* l8 Z& ?: ^1 ]7 P) q ; dimnlist - new dimvar list which is of the resbuf's
' {3 a( ~9 l' V. L ; dime - entity name for the dimension5 v- r J* p0 m8 f& D
; odvar - value of dimvar for the dimolist+ E2 H; I' S; }; w1 k
; ndvar - value of dimvar for the dimnlist' k, B+ W% H' G
1 |: p; @( W9 F* i( ]* ]/ w
(setq i 39 W' e/ F# ^6 T: q3 |
dime (cdr (assoc -1 elist))6 m6 \( x W# V- D
)
6 i9 I' u/ L" H, P/ d5 d5 @3 O (while (setq odvar (cdr (nth i dimolist)))
) P2 a3 y9 y% d' ]. ]9 o (progn
' }0 D# H9 Y) x6 n (setq ndvar (cdr (nth i dimnlist)))5 T, g# V0 v7 ?. b8 L- G& N7 O! B
(setq dv (nth i dimtbl))6 ~ Y& W3 A3 s9 z/ u1 l' i
(if (eq dv "dimtxsty")
8 T/ O% t, o( S (setq odvar (cdr (assoc 2 (entget odvar)))
' D' ^+ k s+ I" B6 f% s4 D ndvar (cdr (assoc 2 (entget ndvar)))% A' _4 `& ^4 ~
)' T/ A# ]+ F2 o7 f+ T
)6 d, {) K1 L% c: A! X, t; Q! i/ I5 `
2 W4 `: ~: R- P% C- F4 K! w ;) I' D3 o# L7 m6 R( q2 A8 A$ b( Y
; In order for DIMOVERRRIDE to operate correctly with string g2 @% I8 _$ M! t; ~
; based dimvars, we must pass "." versus NULL strings.
d* o! l; q o# K/ }! c ; In this case ndvar is the new dimvar value the user wishes3 w! R* _2 ^+ `9 }# ^7 Z m
; to update on selected dimensions. x: |$ \9 v- V; R5 R
;
* i0 n# B. T6 e2 X (if (/= ndvar odvar). d* u/ L8 x: w* a3 j
(if (= 'STR (type ndvar))
$ H4 v; a& ^% L; v+ P2 q+ g7 P (if (= ndvar "")7 D; L' I# m. T1 q, b) D
(setq ndvar "."))))
! f" }" J6 q8 ] i! N
, m( e" m# G7 e. P" i1 y8 h( E2 c, m (if (/= ndvar odvar); b( A8 }7 _. v4 M1 C0 C( W% g
(progn$ t0 N* r. a: w9 q( N: w2 ?
(setq dv (strcat "_" dv))& j- z. V! K- M% `5 D$ u
;. d! Z* z q3 ^. C! C5 ]
; Start the dimoverride command
3 \2 ^! o8 _& y `0 K ;
* x" {) g3 u, V+ U (if (not commandIssued)$ ~" K, ]; {: W
(progn
" `% x8 t" |6 C# U0 t8 o1 K (command "_.dimoverride")
1 y- S. n- Y1 o! v8 ~) ]7 P (setq commandIssued "T"); E$ h7 }$ f5 r" [) r
)
: |5 `2 B& r- P, W: s I, @4 W )
/ m% @( k F2 ]; m) C, k, J; @ ;( _: ~8 F0 n1 h/ b7 N9 F* D
; Issue dim overrides% K* w2 A. `# f1 D; g; j1 Y
;' U# j8 z( n& R. [0 A$ B, q
(if (and (or (= dv "_dimclrd") (= dv "_dimclrt") (= dv "_dimclre"))
- h! p8 Y8 q4 F. M (or (= ndvar 0) (= ndvar 256)), u1 ~5 ^9 \( H5 a. k3 D
)5 I, U6 R& @5 u$ f
(progn
# J! f Q1 M8 I% K ~6 S0 e0 Y (if (= 0 ndvar) (command dv "BYBLOCK"))
% X A6 p8 J- P I9 L (if (= 256 ndvar) (command dv "BYLAYER"))/ r9 P6 c0 t W5 x- F# u9 L
)
7 t2 A& d% N2 c: ^. b (command dv ndvar)/ Z( m: L( Q$ I0 N7 C, j+ R
); @) b" K0 [, i5 h/ x7 v- i
)
' c! s) b) d$ S4 R )2 ^3 P2 J+ q" \* I9 {9 v! E; S- p
(setq i (1+ i))$ P l+ `5 }% t0 z1 w
)
3 p$ ^; B% d& \3 u# d2 t )5 B; D( `! m9 Q3 |! Q
;
2 G7 f7 J6 p( q% t5 j& B* H8 n ; Select Entity and terminate command
5 n! Z8 g& p5 _" g" D' e7 ]5 T ;' V# @2 t) W9 ?) H, h: Y
(if commandIssued
6 ~4 ^$ v% F& a (command "" dime "")" x) C4 T. ^" N4 P7 ]
)6 f6 _; f2 \- G, J
)
$ u6 y7 W3 p9 O, S. K' J& Q
5 v& P- Q, Y% W) W5 P ;;3 g! |3 i/ h) c9 ]8 W; b2 P+ S% P
;; Get style name currently selected style name.
: [3 g' V+ N( J4 w ;;
/ u& M% Z q E* n7 e
/ _3 T: t4 U* Z6 q; n( W; P (defun ddimen_style (/ dimsty)
3 l0 P# D( C1 l8 f: v. q9 _1 Z (setq dimsty (nth (atoi (get_tile "mod_style")) stlist): ?% w9 N5 y$ ]2 {
dimlist (ddimen_getdimvars dimsty)4 O7 l, N0 ]7 R# w4 B/ `
)5 d% ^0 j5 L; i( j5 l
dimsty' T% u% g. M+ p- @
)
/ P; P" d% @# k+ R$ b6 V9 Q
6 ?( o& M5 t, y' W8 L7 ]) n$ J/ \: Z ;;: \( t U/ T8 |
;; Set dimvars+ C. I9 b, i# |) o9 P
;;2 ^9 G' |2 S$ s# p( u8 `( c' W
(defun ddimen_setvars (dimsvcurset / dv i)+ l3 X& s" U/ M' B) m7 J
(setq dv (cdr (nth 1 dimsvcurset)))* b# j' }0 R5 O, F+ N5 M) t
(command "_.dimstyle" "" dv)
, ]: G1 ~& K* n0 b/ \9 w2 S3 z (setq i 3)1 `# S, u1 C- [5 A
(while (setq dv (nth i dimsvcurset))
" v8 r3 X* F% O! h% j7 x2 k (progn
" l; ?9 _2 M, e; g5 p1 p (setvar (car dv) (cdr dv))% \" c- ^) a& P6 d' O
(setq i (1+ i))
P0 |8 q$ R4 F )
6 ^8 r% f b3 k )
; ?+ ]9 x" t1 x |8 j) O: ?% ? )
2 Y9 `1 I4 t" ] ;;
) L" X' y2 p/ c ;; End-of-dimension
' t% A* [. b3 ~$ ~% c1 ^3 D# B ;; ==================
0 Y9 }0 ~ K% M+ y; {0 Y! A$ r
5 k* A b- H) b# Q3 ~: s! f ;;( A) l9 s+ k6 R5 ]
;; Sub-dialogues for properties. Common to all object dialogues
: N, O* X1 [3 j ;;# T4 C0 @ T5 N+ u6 U
;; This function pops a dialogue box consisting of a list box,image tile, and7 \! Y* Z; ~, Y; E
;; edit box to allow the user to select or type a color number. It returns
8 F3 U/ e5 z7 t8 B' D ;; the color number selected.
. j- Y& `, R: V/ {4 _' t (defun getcolor (/ old-idx colorno cname lay_clr)2 c. C, P5 r9 Y) B
(if (= (get_tile "error") "")8 o% k% g: X/ N$ W
(progn0 F% i' E: {6 K: A
;; Get the color associated with this object's layer, for use
* B6 c% } Z' E" A \) b* d) _ ;; in the color swatch if the user selects color BYLAYER.
4 j' I) g1 t7 h7 w# v (setq lay_clr (cdr (assoc 62 (tblsearch "layer" elayer))))4 F. G$ B: d: r5 Y, `' ?( E
(if (numberp (setq temp_color (acad_colordlg ecolor T lay_clr)))
$ S" b' p2 U) `7 ?6 F" y: [ (progn
+ v' K5 U! `# K; ?0 u, J) ` (setq ecolor temp_color)
' v* d1 G( I9 T! c8 k$ V (setcolor)& g. M; Z: T4 m
)( f0 A- D% O0 G1 s
(setq testcolor temp_color)/ m) S1 c7 s/ I% w, L0 M5 b: h$ V0 ^
)
$ b' u8 A* B# I" i% O \3 S* n& K. ? )
! j% j& K& P( W& h* j )
$ t0 P0 Z! H3 i ecolor0 t- ]; u4 `; y% e5 y! R) N; i
)
1 @) \# b# z& ^3 i# y ;;
: {2 B( x( u* U- i( z0 Q0 F ;; Function to set the color tiles.7 R& \7 _8 B F1 T; {% e
(defun setcolor()
- L0 m7 L, d, a- p) \ (cond" |/ x8 G1 J. F8 [1 _2 y# S W+ P
((= 0 ecolor)7 K" u+ n3 h" S
(set_tile "t_color" "BYBLOCK")
# J7 T3 p6 m4 J: G) g, | (col_tile "show_image" 7 nil) ; show BYBLOCK as white
% ?5 M0 [* h5 X )
. M5 O* K( R0 s+ n6 v ((= 1 ecolor)
6 f3 y. c- q: V" R (set_tile "t_color" "1 red")
' V. @/ }# W$ g6 E1 O p (col_tile "show_image" 1 nil)
3 G; Q* x) q. R; h L3 E6 `* \- z ). ?0 Z9 j" E8 d ]9 J8 N
((= 2 ecolor) ?% I' o9 `/ \, Z5 v
(set_tile "t_color" "2 yellow")+ H( O7 _; |. [; X
(col_tile "show_image" 2 nil)" n: U; Q6 t, u; l! h/ M! i
)
; o, z, ]) b$ n. H: o ((= 3 ecolor)
3 P. z0 b- h. C; M4 ` (set_tile "t_color" "3 green")# J9 {4 b# s* R
(col_tile "show_image" 3 nil)
, Z! Q5 W7 b( K3 E: R0 Z4 }! r )
3 D# x% z `7 L, A; X7 V% B( V ((= 4 ecolor)
. H( |5 D E: ~$ t/ i# e (set_tile "t_color" "4 cyan")8 I* B" S# L5 Y/ h& M# f+ t1 r
(col_tile "show_image" 4 nil)& \$ v* K" `6 [( [- r& n: s
)
9 @, J6 H4 s, D3 a ((= 5 ecolor)9 h4 {/ |" |7 g- S! w
(set_tile "t_color" "5 blue")
/ ^# Z& m2 V5 c' U0 s& f (col_tile "show_image" 5 nil)4 d. `/ ~- L$ W/ K- T8 ?3 e* y4 Q
)
0 S! \: k L; l$ @ ((= 6 ecolor)
9 |# s1 K4 R$ O; K( @3 @9 `7 T (set_tile "t_color" "6 magenta")
$ C% N, C. |& C M$ W8 k (col_tile "show_image" 6 nil)
$ D! G5 c0 D8 [" n )
7 L R) i1 W" b2 L; P5 m$ U ((= 7 ecolor)
$ D4 | U+ S+ a& x) t+ Q! S/ @- q (set_tile "t_color" "7 white")6 u1 L. d5 a, h3 n7 M" n
(col_tile "show_image" 7 nil)& h0 p$ Q1 H! X
)
6 R! g% h2 q( z% \9 {5 S1 L" z; J ((= 256 ecolor)1 Y) j l `5 k8 a3 F4 |: _
(set_tile "t_color" "BYLAYER")
+ P- O; w% i& u: u: ^* }5 V1 _0 U) h$ ^ (col_tile "show_image" (bylayer_col) nil)% v9 t+ W+ a7 B4 A& Z
)5 Q r$ W& t3 G" K- i7 I7 S
(T
( Y2 t. N+ ]6 b+ Q* i (set_tile "t_color" (itoa ecolor))
) U+ O2 N5 Y' o (col_tile "show_image" ecolor nil)# S. ^ i6 \+ d5 q# F" T+ w8 D
)
& Z( p8 Q# S. B! a4 o9 w3 c% ^ )
' c' M+ j/ H \3 h )+ G2 Y( Y# W$ b y" i
;;
+ z; B& e Z! b* J% G ;; This function pops a dialogue box consisting of a list box, image tile, and7 V& f! o6 u: q* L; @1 o& d$ F
;; edit box to allow the user to select or type a linetype. It returns the, i+ ~# ?) h v& B! V- _
;; linetype selected.
; C: S' M3 }1 f3 Q# c ;;; |0 I7 Z" T1 }* o5 ^
(defun getltype (/ old-idx ltname)# t$ m' ?) K" E- N
(if (not lt-idx)7 N, M8 R1 ] k, e# ^
(progn8 G. d7 Z7 }8 s1 V
(make_lt_lists) ; linetype lists - ltnmlst, mdashlist. U2 T# u6 O* O v/ A6 }- t
(cond
: {' R) Q8 s2 Q" V6 K ((= eltype "BYLAYER")5 }+ ^" P# `! m' t }2 n5 D+ y/ P% z
(setq lt-idx (getindex "BYLAYER" ltnmlst)))- [9 o5 R6 W2 q. s7 Q8 p
((= eltype "BYBLOCK")
, k1 A! a. {, \/ } (setq lt-idx (getindex "BYBLOCK" ltnmlst)))
4 ~. A2 z0 A. q) ]9 [ (T (setq lt-idx (getindex eltype ltnmlst))): l# D4 T' h4 P: q
)
5 t( k0 C5 k! d0 Y. J8 W9 _7 L )
6 m$ A8 q5 P6 c, w! W& }; g7 t )
7 ~( q/ W5 X5 c% q: R7 N% l
& B' I6 c, h2 Y% f (if (= (get_tile "error") "")
$ M: o" J! w: v$ ~, ? (progn
# z+ k+ M0 D. Z. u (if (not (new_dialog "setltype" dcl_id)) (exit))' H) L' e# l9 I: z) H( y' E& h5 `0 t
(start_list "list_lt")
2 q% ^) j* H8 u! ?; J; \, x) j2 ` (mapcar 'add_list ltnmlst) ; initialize list box4 {" N# T8 i% X! w9 h1 Y
(end_list)
' R, \% ?3 o- U: h9 q+ _ (setq old-idx lt-idx)
+ |! F" `1 y8 D* N" A6 r: ?( ]5 M (ltlist_act (itoa lt-idx))# ~2 y7 t% k Y8 Y" p
6 U/ w1 N, ^# ^( p, W
(action_tile "list_lt" "(ltlist_act $value)")
5 B: N6 i1 n, k/ \ (action_tile "edit_lt" "(ltedit_act $value)")
6 l& p/ Q7 [. e2 X (action_tile "accept" "(test_ok)")0 m8 ?5 @/ h1 R) r: _/ B4 \/ e
(action_tile "cancel" "(reset_lt)")& @ Q, F$ q4 r5 R
# X2 @, I5 m3 A0 V (if (= (start_dialog) 1) ; User pressed OK
' Y0 W* R) N2 k. A ^8 H1 c: z (cond
# L2 g+ S1 a# X* P: q4 u% m* | ((= lt-idx 0)8 F2 U* q7 h |* _. `
(set_tile "t_ltype" (bylayer_lt))
4 d+ ~# e9 K) M "BYLAYER"4 H, W: o r q& G, v) q
). h5 a. t7 a- {" l( Y
((= lt-idx 1)
* E: L, z8 ?' X8 O' X: U0 s (set_tile "t_ltype" "BYBLOCK")
- p' |! p# T9 f( \9 s& s& E( { "BYBLOCK"% \9 G: K# M# ]$ ~! W
)
: K8 _4 I! d- H/ m- N% T (T (set_tile "t_ltype" ltname) ltname)
/ o9 {" Y+ e ^& k, E )& H" j( z& Y* k& k: g5 H; T8 R
eltype# [* D! ~. n3 o, X1 I5 L
)
* T+ f# |0 W" G/ t2 c )4 W- v7 ]# d$ y. J8 z0 F
eltype9 ^3 u5 S& U/ p8 n7 K! O
)* G: Z) k. i0 t6 m& h" p# b u
)
- {; n: N* p3 j/ _! t+ \8 X' m ;;9 j t$ I4 B, s) @
;; Edit box entries end up here: I* h& }- V% a
(defun ltedit_act (ltvalue)
( M9 ?) p I# B' Q5 m4 ]8 r" Z! E; T (setq ltvalue (xstrcase ltvalue))3 O2 r6 a" y5 E7 p
(if (or (= ltvalue "BYLAYER")6 o: Y; ~" W$ M7 W
(= ltvalue "BY LAYER"))9 D4 V* k8 d @% Y$ P5 T
(setq ltvalue "BYLAYER")
, A$ e& V& M1 g; @' I )
$ U9 U8 k! d" h: A) ^ (if (or (= ltvalue "BYBLOCK")
, M* n- O1 V6 U (= ltvalue "BY BLOCK"))1 }8 ^) m2 a4 f; ?
(setq ltvalue "BYBLOCK")
7 C; u* F! u3 a1 X: U4 \- _+ [) q ). y) u% i* u6 y" |6 J$ L7 D* S% f5 I
(if (setq lt-idx (getindex ltvalue ltnmlst)): ]8 }5 i1 u5 Q1 y2 a
(progn2 h( g7 f2 e$ P7 M9 k
(set_tile "error" "")2 Y2 p) [, n& H1 m: r0 E
(ltlist_act (itoa lt-idx))
) V( L( G$ A2 Z" I, p ): q+ Y8 B/ W, |
(progn
4 E6 `$ ]# I |3 F* }; m (set_tile "error" "Invalid linetype.")( H6 J" d3 P: Y; [' g
(setq lt-idx old-idx)* b( |$ }, E; i- X8 i
;; (mode_tile "edit_lt" 2)
9 ~& Q- e8 z1 R8 g' |$ m! h$ J;; (mode_tile "edit_lt" 3)
9 u% R( D+ A _' g )$ \0 q7 d' x9 H' W: D4 S/ g
)' o. O# \, f4 ], H/ Y$ ]
)/ q% v- s/ k% b3 S B% U% W5 c
;;/ o; G8 y) r; {" a6 {
;; List selections end up here. Update the list box, edit box, and color
2 g. ?0 E$ E$ e2 Z' | r. X ;; tile.2 j1 U2 y+ f8 h4 l; K
;;% K* }, @# `3 W% M/ I2 |% n% n6 Z
(defun ltlist_act (index / dashdata)& O+ S+ Q# Q7 ^. ~' z7 ~
(set_tile "error" "")" u7 y/ R+ @1 O1 H2 r6 I/ Q
(setq lt-idx (atoi index)). G5 b3 ^$ f; J) ?* r* r! [
(setq ltname (nth lt-idx ltnmlst))
' z* N4 v7 w D1 y- g (setq dashdata (nth lt-idx mdashlist))
1 Q8 ]0 q9 V5 o# Z4 s' ^& J) d2 S- c (col_tile "show_image" 0 dashdata)8 K1 e; n. I+ Z. N) ^: W. O N
(set_tile "list_lt" (itoa lt-idx))
% k4 _3 o8 l5 @0 M# e2 J, L7 K (set_tile "edit_lt" ltname)
: J. |8 |% I Y0 u3 U4 J )
$ @" i! U2 R; p5 a ;;. v' ?. I& H0 d- M
;; Reset to original linetype when cancel it selected5 H. P& B+ S8 N7 y4 K# \
;;
# K" e; J' a8 u$ A (defun reset_lt ()
: B( X: V* }/ P+ p% ` (setq lt-idx old-idx). J, A+ F) L3 u
(done_dialog 0). e" h# b6 ^+ l2 f% }3 B# l
)3 g, z5 U/ l1 d8 A# W2 ?4 m0 a
;;2 r6 p- ^% @5 s, ^* P8 }. Y' b( d
;; This function pops a dialogue box consisting of a list box,image tile, and2 R5 K. G* E; Q; V
;; edit box to allow the user to select or type a layer name. It returns the
$ E3 a( L6 h8 _" s7 \' R ;; layer name selected. It also has a button to find the status (On, Off, ~' D& B! n% ^( M) \( v
;; Frozen, etc.) of any layer selected.
# ]2 D7 S3 ?# e5 Y ;;$ x8 e7 B- p- Z0 W9 R
(defun getlayer (/ old-idx layname on off frozth linetype)
0 @ F3 P- E/ v- ` ;; Create layer list the first time the layer
, R ]# q& i7 S6 E: h ;; dialogue is called.* v, L4 _4 ?* Z2 B/ P
(if (not lay-idx)2 T0 d* k' `2 n' r) I+ n
(progn
' P7 n c u" h! } (make_lay_lists)
4 Q3 m' t/ f' v+ n (setq lay-idx (getindex elayer laynmlst))
4 b2 ~% H* n5 ^0 f- G )
" n0 ]; h; o4 z# k$ Z )
! h. d. U w+ a; G Q
; v2 |9 O* P" B8 X5 ? (if (= (get_tile "error") "")8 _& o" z _2 u% R. p! U8 {! v) ~3 [
(progn
: s( N% O/ g' p! d (if (not (new_dialog "setlayer" dcl_id)) (exit))
% Z) \0 P( q0 L+ }0 ?* m2 c2 J3 F (set_tile "cur_layer" (getvar "clayer"))! |, q# J( `- ?2 \- b+ J/ m: ~% V
(start_list "list_lay")! s- R* d' D; x Z
(mapcar 'add_list laynmlst) ; initialize list box
# Y4 D# y4 N" r6 g9 T" } (end_list)
; h; _0 i; \) ?$ D2 _ (setq old-idx lay-idx)
* x/ H/ l! P, X( ~, ^$ D (laylist_act (itoa lay-idx))
; c) t; c7 {4 v6 b2 c! C (action_tile "list_lay" "(laylist_act $value)")
6 e+ h8 d* e! R; m B& W/ @ (action_tile "edit_lay" "(layedit_act $value)")/ I* l- U7 A- n0 T p6 N' `
(action_tile "accept" "(test_ok)")
" D2 V& o1 t3 } (action_tile "cancel" "(reset_lay)")
4 o V' f! N0 P Z2 T8 F; ~ (if (= (start_dialog) 1) ; User pressed OK
5 ]7 g* `# E- d7 ]" Q3 D" t/ E (progn. G8 C0 f( n% V1 i
(set_tile "t_layer" layname)
' j* a! ?% a1 r/ C (setq elayer layname), J2 H5 Y& D; O$ ~, A
;; If layer equals bylayer reset color tile
4 d. A. p8 l2 l (if (= ecolor 256)
* A, T7 _0 P6 |& u1 U6 d (col_tile "show_image" (bylayer_col) nil)
) k8 u4 b3 }7 T1 z& G* A4 Y" N5 r' D )' n$ j1 f. M. U( _ C: x; ]
layname
, z. e- m3 N# {* l )7 x$ Y/ a- e: @5 G. ?3 ]
elayer) {& Q% F* N: w. |) l
)
5 e4 K9 m$ N3 b `1 |! j7 [; a )4 Y1 t& f; L( Q
elayer
" z, w3 U$ A" X# r3 w1 k$ \ )6 s8 R2 l! I7 v* E0 k7 j- H
)/ t6 I# p5 T+ U
;;
$ i Z0 F6 i# O ;; Edit box selections end up here. Convert layer entry to upper case. If
) Q$ N8 e1 [% x6 V `2 w8 k ;; layer name is valid, clear error string, call (laylist_act) function.6 m" u( g6 M g6 ?$ ?0 K
;; Else print error message.
0 g( f8 h! I0 D3 ]2 z. j* g: q5 C ;;' P2 E7 h4 |. [$ Z, y9 v/ V8 G
(defun layedit_act (layvalue)
! i; Z! T( W- X+ U! F (setq layvalue (xstrcase layvalue))$ \7 _6 y& M! R1 d. ]0 S
(if (setq lay-idx (getindex layvalue laynmlst))
6 u3 G F) C: E9 C* L a (progn0 ?& F: A" x2 D6 x" D
(set_tile "error" "")
" D- |! `( M# }1 E6 W (laylist_act (itoa lay-idx))# }8 b1 }6 y W: p5 ?- F! }8 Y
)
" e7 O' i5 Z0 {2 t" ^% I (progn3 t8 w5 P6 r- s1 g9 t1 U$ N3 W Z
(set_tile "error" "Invalid layer name.")" W3 |5 v: e4 Q7 b. |* F" S9 i
;; (mode_tile "edit_lay" 2)
4 [% k2 L. h/ H9 i- Y% f;; (mode_tile "edit_lay" 3)
2 S, |) ~6 w- `0 i% U, \1 s (setq lay-idx old-idx)( A4 s/ x; I% J( y w: p: J
)
( L8 f+ O2 d: J& x )
, O& ^9 s5 Y0 q. B# ~ ): B6 y$ D X( {
;;7 h# B1 `" A/ |6 C. u9 l- w
;; List entry selections end up here.0 D- t' M! a% z, O( }# p, o- w, b
;;
) V7 a/ }. }, T. T( c (defun laylist_act (index / layinfo color dashdata)6 b. r* w+ h, o+ z0 ~# }2 i
;; Update the list box, edit box, and color tile.! s R& W) W$ w, ], L S
(set_tile "error" "")
7 z2 ~' a o- ]* J2 e( ~ (setq lay-idx (atoi index))
! o1 r' u+ D5 e3 H0 w ~ (setq layname (nth lay-idx laynmlst))
3 }- C6 r1 q( n; h6 Z" p (setq layinfo (tblsearch "layer" layname))
e( F' V6 n3 _' I (setq color (cdr (assoc 62 layinfo)))
9 P8 W" @" a& T' q (setq color (abs color))
, d2 t5 \& t1 { v$ x( \ (setq colname (colorname color))
- S1 \7 \ S/ i3 r7 j5 @: R (set_tile "list_lay" (itoa lay-idx))
5 m$ ]& ~+ y! ~ V; i (set_tile "edit_lay" layname)- l( @ t- |: O5 L& N: }: p
)
; M8 p# |" _! X+ y e: } ;;
- D8 g3 s7 z2 e, B$ t4 Q ;; Reset to original layer when cancel is selected.& {& Q9 G5 w% p2 r
;;
; Q7 L1 d* P" W1 L# T# O (defun reset_lay ()
+ R% E3 {" g3 F4 Z- q7 S }, p2 M2 J (setq lay-idx old-idx)0 M$ r; d" O3 g" C% K5 H4 G
(done_dialog 0)5 c' B J/ I. }2 [& E
)
- W3 W! g$ @% f( c/ Q: \: C9 ` ;;* T3 k- E$ B! i2 M, g& z; }- }4 O
;; Checks validity of thickness from edit box.8 d4 O+ t: B9 z
(defun getthickness (value)
" d' x5 j/ P8 G% Z2 @/ D (setq ethickness (verify_d "eb_thickness" value ethickness))7 y2 F7 L8 x ^7 F! K8 n* L. X/ z
)) `% W3 Y& L+ |: R( r9 l3 S
;;
. e. j0 V$ I' W& U- ^ ;; Copy of (getthickness) for ltscale. If more, make this function
( g1 F# R# A9 k/ |" p, a+ W: U) p" x ;; generic.
" x4 `5 k" `9 n: f- t( |; U (defun getltscale (value)
9 p$ M! w' y7 P J (setq eltscale (verify_d "eb_ltscale" value eltscale)): x/ k" {6 S k
)" W/ [3 m- P5 u; d, Q
;;" K. C' f* {9 Q4 q( P+ {- ^
;; This function makes a list called laynmlst which consists of all the layer C% r( @: @6 A$ i8 \% K# Z
;; names in the drawing. It also creates a list called longlist which; H# J: L4 [) p- X/ ~
;; consists of strings which contain the layer name, color, linetype, etc.7 J! }# V& c6 H. e, ~
;; Longlist is later mapped into the layer listbox. Both are ordered the
" f! ~, p- `/ Z, y; v) X ;; same.7 ]! }$ m& H1 Q3 ^ I8 k
;;+ k! E& H$ W+ U
(defun make_lay_lists (/ layname sortlist name templist layer_number)
# m5 r* _7 V: o3 b3 h0 i (setq sortlist nil)
( w1 a9 [ o" C4 b3 z& Q. U$ O (setq templist (tblnext "LAYER" T))
) W+ R7 @4 \+ i7 S Q0 E (setq layer_number 1)# v' T1 y! I9 p; e
(while templist
- e( l, f" m8 S, Q9 M, p ;; No xref dependent layers, please.
, C& T* U4 z/ l+ I) m (if (/= (logand 16 (cdr (assoc 70 templist))) 16)$ [- @: H/ q3 o0 I
(progn
/ _$ d5 b0 O1 N( z2 d (setq name (cdr (assoc 2 templist))). @% t& K6 y- T7 t. o) j, m4 L [
(setq sortlist (cons name sortlist))) x' R$ Y) b: f
)/ b; M8 m) z) F2 r; q
)
4 w; d( Z( l; I- d; C1 g" S ; Get the next layer.
+ _/ P }* M* k/ K7 j (setq templist (tblnext "LAYER"))
( G6 [" E7 W* @5 T( g ;; Not dead message..., H8 z1 ?/ ?4 w+ L
(if (= (/ layer_number 50.0) (fix (/ layer_number 50.0)))4 N# T( B0 x" t# u
(set_tile "error" (strcat "Collecting..." (itoa layer_number)))
6 r' n' ?( }+ i$ w K; f, o! D )
' \% H" Y4 ]4 d1 D7 ^ (setq layer_number (1+ layer_number))
! Y3 [6 r2 Q7 H+ l) E& F )
" L# D S4 u+ @- F2 b j (set_tile "error" "")+ z% \9 K5 L& m0 ?8 |
(if (>= (getvar "maxsort") (length sortlist))! x' _$ i! t$ X s% w/ ^( R
(progn# ~3 h- r# @1 g
(if (> layer_number 50)
`: c: S# U3 B4 L8 Z) } (set_tile "error" "Sorting...")
5 J6 T; `2 F- T ), [) z; v, J$ k( o
(setq sortlist (acad_strlsort sortlist))
$ f( l; l, i# J6 P! D& A+ R3 ^6 h ): L. a1 @# [% U3 B
(setq sortlist (reverse sortlist))
L4 W- e/ G* g3 X% ^* R ) m/ r; f' w" l6 F2 F) u
(set_tile "error" "")7 d$ C5 W8 T4 }' J$ S
(setq laynmlst sortlist)* P' `( S7 O6 \$ N( ~1 ~4 c9 @( g
)0 `4 {1 u1 B# V2 Z2 ]
;;( t3 N/ d* {. S5 Y
;; This function makes 2 list - ltnmlst & mdashlist.
5 }: Z+ K' [& J) b) ] ;; Ltnmlst is a list of linetype names read from the symbol table. Mdashlist, `) F: G4 T# f. y$ C7 E$ w
;; is list consisting of lists which define the linetype pattern - numbers
! w. I- x* A4 z- S% ^3 G% A9 O4 r ;; that indicate dots, dashes, and spaces taken from group code 49. The list
. n% p8 `! J- L8 J: I) D, _ ;; corresponds to the order of names in ltnmlst.4 V5 s$ c* p2 x$ P* B
;;8 t# h% m# j8 Y7 {8 }
(defun make_lt_lists (/ ltlist ltname)
" l% r( Y9 B6 d (setq mdashlist nil)
9 D2 Z: V9 E% [6 i W/ A' l8 C (setq sortlist nil)0 `! c2 J& j: j3 _& G6 b- k
(setq ltype_number 1)4 m# `5 b h% g8 C
(setq ltlist (tblnext "LTYPE" T))
* O+ I' t, p4 g7 w3 w6 ? ;;(setq ltname (cdr (assoc 2 ltlist)))8 F0 p/ r E0 f8 T ]
;;(setq ltnmlst (list ltname))$ y( b, l" o% z$ D
(while ltlist
& e0 [7 h# I" ~/ q: O ;; No xref dependent linetypes, please.3 u6 V; ~7 O0 k3 s
(if (/= (logand 16 (cdr (assoc 70 ltlist))) 16)
; {% {! y) K0 b: H0 n0 E (progn
- G& I5 E# W& W (setq ltname (cdr (assoc 2 ltlist)))! E6 [* w* x" K d8 o
(setq sortlist (cons ltname sortlist))4 B7 a) U$ V' o4 \6 g
)
) Z+ j+ a" b' F; P4 h: p )
! K5 N7 C' _8 M5 K9 z- I ;; Get the next linetype./ g) d6 X7 e* d' R$ ]' G
(setq ltlist (tblnext "LTYPE"))( g# F# K/ P9 D
' I0 m8 c1 w1 y- T" C- c9 _
;; Not dead message...( X9 T- {) [1 F1 m3 |( i9 _
(if (= (/ ltype_number 50.0) (fix (/ ltype_number 50.0)))
. a t, P! H$ L* d5 ` P (set_tile "error" (strcat "Collecting..." (itoa ltype_number)))& x) V3 w: _2 E$ J
)' C8 q- m% z' ^! |; H
(setq ltype_number (1+ ltype_number))7 f+ K* t" _5 q; F
5 ^7 H" R& U! o1 o; g% V5 ~
)
# l: y7 E3 a" F9 G
0 R4 C( x/ H) }: m& y: _/ M ;; Remove Collecting message.$ m; Y' f% d6 N4 A. u* j2 @
(set_tile "error" "")
# ^6 v* p1 }: Z1 z8 G* y7 q" v
- @& V4 A- N' \% R+ G: | ;; Sort based on maxsort.% E5 Q. [( B. a5 n6 s; V: t
(if (>= (getvar "maxsort") (length sortlist))( v5 r. h( H% c6 i9 `
(progn/ I' p% Q/ Z8 S2 E L& l6 T; x2 A$ u
(if (> ltype_number 50)' c l6 ^/ |, X3 u2 [# f
(set_tile "error" "Sorting...")3 L/ J; ^4 s5 `7 _3 o% P' H
)
' m5 R* d, O. u/ ]; X, Z* Y7 g; g (setq sortlist (acad_strlsort sortlist))
/ k6 b6 f- K: t4 W5 R0 R )) Y) m0 `7 J& I) ?1 H! \
(setq sortlist (reverse sortlist))# M; M0 r2 r. u6 z; e0 c
); I" L: ^' G7 f6 P4 z
(set_tile "error" "")
. }9 k( W# x7 d" D# {' ^7 R! R (setq ltnmlst sortlist)0 k% y9 e+ _: J" i ?. F" U% v& |
0 f% A0 P) z* J3 W: C$ p l+ q: O4 ^
(foreach ltname ltnmlst
: G/ {0 I! M" F: t+ ~% L+ x" [9 ^. ^ (setq ltlist (tblsearch "LTYPE" ltname))
0 t1 T$ h3 U9 q1 S& w (if (= ltname "CONTINUOUS")9 v6 N1 _7 ~' t% U9 Y* x9 W/ q
(setq mdashlist (append mdashlist (list "CONT")))
2 F1 I% z4 {3 u* v0 G (setq mdashlist8 {' _: m0 E+ P8 @, Z H, z
(append mdashlist (list (add_mdash ltlist))). H. a) \: D6 `
)
% c2 |; l; \- t {9 g/ p( g ), `8 e6 m0 q+ ^, S( y
)
2 o% x2 g5 [6 V$ a( k) l4 W (setq ltnmlst (cons "BYBLOCK" ltnmlst))
1 E0 T$ C7 |0 i1 H3 J! T (setq mdashlist (cons nil mdashlist))
) ^0 @; c8 u. B/ V) @- O) E: ^ (setq ltnmlst (cons "BYLAYER" ltnmlst)). {. }, `, j" E8 n% F: S* h
(setq mdashlist (cons nil mdashlist))7 l% Q/ J( c9 m
)4 u; R0 Q7 i1 a
;;- n$ k5 |, |: |. {1 A6 p1 A
;; Get all the group code 49 values for a linetype and put them in a list& v9 @/ l+ y: I5 \% P5 e. N; ~4 v
;; (pen-up, pen-down info).- ?6 h' w4 u* o: s
;;1 {" }6 l% D: Z% D0 G3 p
(defun add_mdash (ltlist1 / dashlist assoclist dashsize)
; }* I+ @& M$ B7 Y( j (setq dashlist nil)( Q+ A6 H# Z. Y m# b. Z& \, r7 H
(while (setq assoclist (car ltlist1)), C# O& `; Q0 o0 F# i( f4 L! a
(if (= (car assoclist) 49)
3 V( J9 C4 D1 l: m* D# K (progn( m4 B/ H* W+ p4 _
(setq dashsize (cdr assoclist))
6 M5 _3 G# o& I# [; t4 m (setq dashlist (cons dashsize dashlist))
( e# W- S" P* k5 W! Q )
' c& e. J3 {& U5 f) B/ ]. ~( r# q )2 s$ n- N0 Q; ?+ q
(setq ltlist1 (cdr ltlist1))/ h9 e8 _0 B% U3 h3 k8 s9 Z
)% b4 q5 t! s1 T8 R( G
(setq dashlist (reverse dashlist))
. e+ k" T4 i0 W& d7 M0 f )
) k9 u6 L* M4 H5 a# O- | ;;: H$ U# `0 z0 b) m& \- f
;; Color a tile, draw linetype, and draw a border around it* c4 c/ |+ M! T k9 R) }
;;6 Z3 ~4 b3 }8 u( L/ p. J8 L" f+ ?
(defun col_tile (tile color patlist / x y)
/ h$ ]- c5 x) p x& o" S7 H0 @ (setq x (dimx_tile tile))
7 p: W2 Q$ O1 g+ O9 p' j0 R (setq y (dimy_tile tile))
& R. W8 v& n4 f, W" s( o (start_image tile)
% n9 V" s+ s* D; f- O& A (fill_image 0 0 x y color)
# \ x, G- C; b/ |( g (if (= color 7)) a. |# ~; F8 L3 q& h0 S
(progn
k* I7 C1 n8 [+ t8 Y (if patlist (drawpattern x (/ y 2) patlist 0))% {: X! m9 B& [7 ~4 m# l
(tile_rect 0 0 x y 0)
) @) i# E$ L, K7 p5 q )- H% q( u) C9 T* t
(progn
7 X. O9 j/ ], M+ ~" ]- z (if patlist (drawpattern x (/ y 2) patlist 7))) u; _. V- ~* I$ M! v$ K p4 F
(tile_rect 0 0 x y 7)
3 i$ _" {1 L6 T )1 i- ~9 n: E* i2 F& C
); f5 O% r& R4 K1 O% v7 q3 V
(end_image)
: x$ m+ x9 p( ^7 l )9 g( s+ U4 N! N3 I* u
;;
& e0 v, }% Z6 j7 D ;; Draw a border around a tile# C# U$ e. K7 L1 ]9 D" f0 _
;;) o+ \3 r z" }$ t9 u3 {' r
(defun tile_rect (x1 y1 x2 y2 color)- k0 s+ v; S% R, {* k+ I9 @5 U' w) {
(setq x2 (- x2 1))
4 F* k) |1 R* Y8 @ (setq y2 (- y2 1))
0 M! g. o! |% x' N. z (vector_image x1 y1 x2 y1 color)' L: @# n! F; B- B
(vector_image x2 y1 x2 y2 color)
6 Q: s" ]$ i: M0 A+ } u" h: u (vector_image x2 y2 x1 y2 color)( V5 z4 @0 f6 G9 O2 Z4 R& n8 M. ~+ }
(vector_image x1 y2 x1 y1 color)
0 X# m/ J4 |' S8 Y" A ): l4 F1 r% V: D0 }
;;
7 t0 ?+ t4 Z' H" O7 p8 e) M ;; Draw the linetype pattern in a tile. Boxlength is the length of the image" |& U4 p' y9 z+ o$ c
;; tile, y2 is the midpoint of the height of the image tile, pattern is a
$ w$ l4 v4 j2 w ;; list of numbers that define the linetype, and color is the color of the
- } Y; q; G: u9 N/ q4 m ;; tile.
/ u- c) G/ F1 l6 V8 `; Y ;;
( C% z W1 ^. m" r1 o (defun drawpattern (boxlength y2 pattern color / x1 x2. ~. q# `. y0 N* i) M, I
patlist dash)
8 J I6 h; I: l0 n+ ], i (setq x1 0 x2 0)5 Y: m; \+ G7 S9 |
(setq patlist pattern)+ v+ Z/ v( C# i: a6 d1 F7 _
(setq fx 30)
- T9 N0 e$ M f" j; p1 s (if (= patlist "CONT")) b0 E. H1 o) z+ t: ]
(progn (setq dash boxlength)" O* l: B9 d H
(vi)
# A9 _1 P6 m0 r- ]7 J2 @ (setq x1 boxlength)
; n2 y" x! j' z, S8 k7 `" C )* ?1 s. [: n% _2 O0 i$ W8 W5 u: m
(foreach dash patlist
5 Y- c0 ?+ D. a6 | (if (> (abs dash) 2.5)' j4 Q% [& }0 M
(setq fx 2)
! M$ |5 i$ u9 e6 w+ V )
4 O/ x5 v5 I8 f- i7 N )! ]0 H1 ^; h" i( @% _' ^
)7 C. ~# n" L1 J! V. }5 A
(while (< x1 boxlength)
|0 d- b3 k/ s$ j$ g8 t (if (setq dash (car patlist))
' K+ `: f: I9 r/ P (progn+ i7 h1 Z; R r
(setq dash (fix (* fx dash)))$ b" \5 |4 u) \+ K# h' r
(cond
' I' h! s2 M( e H" Y2 X ((= dash 0) (setq dash 1) (vi))
9 t. c2 @8 p5 p( `9 m ((> dash 0) (vi))
9 P* n2 x: `! |! B: x* }# Y (T
+ t ~3 C: n% X% x7 ] (if (< (abs dash) 2)
; h ?! N I9 T3 U7 L2 t6 l (setq dash 2)
. n. H4 I, ]& f- n* z/ U; Y )' U) ]; d$ A, l2 O! m1 G
(setq x2 (+ x2 (abs dash)))6 V T% ~7 E( D: T( k0 R @! G; c7 B
)
+ K% C. H6 _% c6 W )
8 `% }0 a E& d" \( |! O5 N (setq patlist (cdr patlist)). n& D* Q' p2 Q9 x: z% f, i
(setq x1 x2); C/ h3 Z/ K( t
)
# w* t& _4 U. y( L. N (setq patlist pattern)
* }0 v, N3 k8 h% e9 |- t- a )
: [9 W0 d& |# n* U )
- x+ |" P. W) Z- E/ {" `: H )- v' X/ }7 H7 L& `& I# s
;;
9 A/ _$ D( |* ?8 ]: F ;; Determain state of xclip. J& K- T, \1 N# H$ |5 G
;; Returns the group 71 value of the spacial filter dictionary.
; z1 N$ a" \! x7 s- h; g ;; If the entity doesn't have a spacial filter dictionary, this
+ n3 e' }) K2 z) t- }0 u2 h ;; returns 0. If it does it will return 0 or 1 depending on the
3 p4 N8 j4 s. E9 [* W ;; current setting of the state of the clipping visibility.
) k* C. M! m# b$ F$ E% Z/ v ;;
# f# U4 L8 ?0 |' V5 E/ b (defun xclipon(elist)
% r4 h3 Z7 r" {# P1 \ (setq hasclip T)3 p" X1 e) n9 D: S- f5 G
(if (/= (assoc 360 elist) nil)
9 U$ \! n. k2 z4 C* n (progn
4 W5 h1 H8 k/ s+ R" {# f9 j (setq tmp (entget(cdr(assoc 360 elist))))
( ^6 u9 `# `) Z L# I. G+ s (if (/= nil (assoc 360 tmp))' M4 t4 I1 G$ |5 B
(progn5 R r0 t! j5 Y3 ^' t/ t8 E7 L
(setq tmp (entget(cdr(assoc 360 tmp))))9 J1 r1 R6 T. B3 X6 P0 H( S
(if (/= nil (assoc 360 tmp))
$ x, C- P- B! g0 Z! y& R1 } (progn
5 e% Q7 X$ X* t$ y B (setq tmp (entget(cdr(assoc 360 tmp))))
) S' O$ C/ r1 e5 q (if (/= nil (assoc 71 tmp))8 f0 H+ S, I0 g- M6 v
(cdr(assoc 71 tmp))$ \1 ]* P' |* e+ [$ H+ s0 j9 v* U
(progn
- p' H8 \1 P) b6 A (setq hasclip nil)7 ]% [" U+ ]' F9 X; v* A" r' ^: J# q* J
(eval 0)
1 I) v, p$ ~& ` )
9 ~" O( Y- g- P' e4 \) h )
8 E: X3 ^( D L; Q( @0 o )
% ?3 M4 A- ?( M: F) R: G (progn
1 w% h! H' g, Q, F. O; B (setq hasclip nil)
' S$ Q- }" k& M0 _9 U; c9 h (eval 0)
7 q- E( ~* j7 ^# {) K/ k )/ i4 ?- A. W* t" x. {+ V
)0 I3 q/ d' y4 k- Q& z3 Q* t7 |" m
)/ J S9 \0 k3 h7 B' ^) B+ k0 p
(progn 3 X! T, r$ K. R7 D
(setq hasclip nil)
2 ^+ X( {: D( F$ ~1 n (eval 0)
# e5 o3 A, u( [$ T )6 J0 M, d1 J2 J1 i8 Y
)& Z5 y, H5 L: G1 d7 o% H
): w, D+ n( n- ]& t5 f; A
(progn J M! e# V! T2 v
(setq hasclip nil)
1 c- ], o) W2 y; A' R- | (eval 0)
% ^* Q( m$ S2 ^5 b- Z3 e$ _6 i, f5 u )
! O+ |: G* E9 S) T) J/ V )/ v' G: k+ e$ G o
)# N x- i3 u- k+ C, M$ A
;;- d3 b: G) p( C# X
;; Draw a dash or dot in image tile a% F7 k4 x# C6 y+ \' E
;;
( c) f2 D" R1 e (defun vi ()0 y# k8 b8 z/ y& \8 _5 j9 G8 p
(setq x2 (+ x2 dash))
$ h0 s" e# V8 t* Y: t9 y (vector_image x1 y2 x2 y2 color)
) b, W" O' n+ V )
0 ]6 i! c; @% X1 F4 z" g0 l ;;
& b( S/ p) k- N1 U0 ^# {# p9 n: c ;; If an item is a member of the list, then return its index number, else
- |, r5 G. C# X. G# R3 P- C ;; return nil.
& n* u6 h+ w# Y& l ;;
6 h& f/ a+ L. p1 V9 ]& k (defun getindex (item itemlist / m n)8 O$ n: |# R, q9 @5 ]1 j7 j
(setq n (length itemlist))5 M0 e* B" S; q) v3 \
(if (> (setq m (length (member item itemlist))) 0) h l1 A2 Q! }9 C" S3 O
(- n m)
! I0 ]. A( n" y nil
4 X# y) i' p2 {8 l5 s9 _ )6 \7 e1 P7 M: y( N: G% D
)/ s' W; N5 H% o5 Z1 A! W& ~" q
;;
4 `4 |* k7 h( J4 f7 a ;; This function is called if the linetype is set "BYLAYER". It finds the
/ v" p* m) K4 `5 c3 T& } ;; ltype of the layer so it can be displayed beside the linetype button.+ W5 k& g' H" \$ n8 t5 r8 y G/ _) O
;;
7 w6 C2 `8 D( h- Q9 ` (defun bylayer_lt (/ layname layinfo ltype)
& y: l: }' U5 `( X3 t (if lay-idx
/ V- r& i6 I% [; J7 g (progn
7 Q! |4 w( ?- F R: ]" X2 \# r5 a (setq layname (nth lay-idx laynmlst))5 B4 ^) S8 g# W$ {6 X$ A
(setq layinfo (tblsearch "layer" layname))
x' k8 |1 |. u$ w; W' I% @: E6 G (setq ltype (cdr (assoc 6 layinfo)))5 w) f0 k9 f) O- K
"BYLAYER"% G5 P4 A) s! [1 O6 [# R4 H, W
)1 J. J( w: t7 o. y1 r( }; ^
"BYLAYER") T2 M# a) G+ q# Q o9 \+ _
)
2 y4 F1 T# h6 T; E5 q+ J )
' P" a) b% t5 x. ?6 Z ;;, C( H5 i! a) S& u# [: d7 y; \
;; This function is called if the color is set "BYLAYER". It finds the color
. r: F1 V/ Z+ D7 R7 e1 J, s ;; of the layer so it can be displayed beside the color button.
, y4 @; J% p ~* \: o* S1 R K ;;; J+ r' z" v+ n& }
(defun bylayer_col (/ layname layinfo color)
" ]6 v2 o: Z3 i T (setq layinfo (tblsearch "layer" elayer))( M8 c; c9 O# v/ W6 f- T) _, m
(setq color (abs (cdr (assoc 62 layinfo))))
0 n4 W- R2 r' J. t% [* h )( K! Q, f- G4 ]
;;
; g9 Z1 M5 V! ~. q/ m ;; Used to set the color name in layer subdialogue.: W. L, O* ~ h+ M M
;;
, ]6 [2 G" j2 t+ E- u9 N" B (defun colorname (colnum / cn)
& y8 E/ M# j, Y0 h1 H- k/ _ (setq cn (abs colnum))
9 t' l+ {- x4 W1 m; r6 t (cond ((= cn 1) "red")
+ Z% q$ ?# _. q ((= cn 2) "yellow")7 |' O* P4 }; l' T
((= cn 3) "green")
5 A8 B' l* a) C. J& P' | ((= cn 4) "cyan")
" P5 x4 f, i( K e ((= cn 5) "blue")
2 Y' ^, {+ z/ ^) o* [$ c ((= cn 6) "magenta")& y2 T/ }/ `# C
((= cn 7) "white")2 Y& x7 S. }& r# L! O; v
(T (itoa cn))
B+ X0 u+ e" q )
/ P7 J5 K6 I# K )$ T! h! G% k% `8 a1 |9 x
;;
- Q: L7 q/ k5 c# l# X: `. V ;; If their is no error message, then close the dialogue.
/ G+ q3 B7 u& C& A& D ;;$ I! r+ }. H+ D' J
(defun dismiss_dialog (action)
! B: {! ?* M3 f; {. Y4 l (if (= action 0)
# z) F7 z! r4 z6 E5 O5 n% }9 Y (done_dialog 0)+ ?; q D# H: |2 [2 Y
(if (= (get_tile "error") "")
8 W2 b5 ~4 |' O5 h4 b (done_dialog action)2 S/ p" O7 c' z
)
" e( z8 {/ s6 ]. m )
- R, t' M) b3 @ ), ^+ n1 l% t3 a& f+ R. C1 j# z! {
5 C0 B6 m/ v5 t% k! D* f- E8 y3 w
(defun test_ok ()
% p0 y* K0 X+ X/ g* r4 H5 W8 c (if (= (get_tile "error") "")
# ] ?1 v& f9 `: \! O5 ?! |- T (done_dialog 1)$ X4 j7 w, @# {$ T! a' i! [
)# L: y2 I t4 X4 ^
)5 Y8 K% b, \" @- l, m, o
6 ]' m% S x, j [5 _( F (defun cancel ()4 f4 U+ v8 A! ^3 ]( a0 [
(done_dialog 0)
/ } T4 I! |/ p. J$ W/ n )
, R9 L! k/ E3 B+ H7 A# I) O7 u2 ~1 ^! ^/ u) T
;;; =======================================================================. R9 g V3 j, j3 ^3 Q
;;; SETUP layer and linetype lists for application, and initialize all
2 x) l: ^) @$ y9 T- I5 ~, m' `7 l& s;;; program variables.
8 y% u7 S/ { S; u$ z
8 {8 }7 d0 z- K* ^* Z$ X+ t, k (setq elist (entget ename). a, t+ [: i5 |! J, I! c
old-elist elist
8 U+ R6 ~+ p) j& B modlist elist
9 [2 n0 {, z$ b" W2 W( O etype (strcase (cdr (assoc 0 elist)))
" j8 ~9 ~# A0 ]/ l2 I/ K! u+ Y. l ecolor (cdr (assoc 62 elist))
* ^- e5 T$ k5 f0 \) Q, K' }% O elayer (cdr (assoc 8 elist))
* N: h; v+ q6 G! O Q6 z1 R1 ? eltscale (cdr (assoc 48 elist)); `! v& I# D% G* C, K
ethickness (cdr (assoc 39 elist))9 I/ `7 N! @3 {1 H9 f" q0 I5 b8 u
eltype (cdr (assoc 6 elist))
+ p2 h' G& f4 Y3 C t8 R )2 m3 H: H4 {* U: @* a
(if (= (assoc 210 elist) nil)
& Q9 L& U, m3 ~2 A8 U. k% r" | Y; t (setq extru (list 0.0 0.0 1.0))1 N2 Q9 X% @6 x, Z0 L% v
(setq extru (cdr (assoc 210 elist)))
" h" P& s0 J# [) E, i ) R' b) Z! F; _4 I
* L5 ], t7 N# l (if (not ecolor) (setq ecolor 256))
, D$ p2 M1 ~: `8 _6 R6 d, E( n0 `' [ (if (not eltype) (setq eltype "BYLAYER"))
7 h# u# u6 d5 A3 h0 t (if (not ethickness) (setq ethickness 0))
- r& \7 ]3 a6 N& |4 E1 z/ t (if (not eltscale) (setq eltscale 1)) K( N c& T8 q- Z" s
) ; end ddmodify_init' ~. n( l: N' [, g) q
3 V8 q; \9 S4 n, a2 y3 O. c, R
;;; --------------------------------------------------------------------------9 H- L4 I" L6 S0 z
;;; Function: DDMODIFY_SELECT! Y/ o9 r2 ?0 z
;;;
0 ^3 e+ H. c3 b0 I* M. X;;; Object aquisition function.
1 }; L2 x; N x7 g" ?3 a/ S! p;;;
+ @0 m4 R7 ^" \& L! k" d;;; (ddmodify_select)& `+ y6 e8 W3 |
;;;
$ j: {- \! V$ O4 \& b;;; Obtains object to be modified, in one of three ways:
- v% T( V, c$ L# }+ |- h;;;
4 J9 s, { c! c" Y9 V( H1 x' b; u;;; 1 - Autoselected.
: F1 G2 a. `( m2 n* r;;; 2 - Prompted for.& {' o, \( d& b* s
;;; 3 - Passed as an argument in a call to (ddmodify <ename> )
( J; a" f# g! k;;;* S& H1 [/ B. @* j+ m
;;; The (ddmodify_select) function also sets the value of the
2 h1 n+ V0 n, b" S( Q;;; global symbol AI_SELTYPE to one of the above three values to& m2 F- l# A* j |
;;; indicate the method thru which the object was aquired.
3 f p6 h; E# X, a/ f! x& w;;;$ J9 {" h6 b; Q
;;; This value can be useful to applications that want to RESTORE
* J. M* P, K4 n9 N; m! [, _- I; v;;; an object that was autoselected to its previous selected state
2 V9 Y7 ?1 d. z* g, ^9 H) x/ @% B f;;; when they terminate, although there doesn't appear to be any8 A- K, ~; L' q+ I( b' z) \9 J4 Q
;;; way to do this right now.
2 d# t4 q ?$ K7 J
0 r( g$ x! J c+ p(defun ddmodify_select ()
2 G# ?* Y9 V1 Q3 _, d' h (cond# S7 Y6 |4 C3 Q& [. |
( ename ; (ddmodify) was called6 ^! m1 U% b6 v& z! O
(cond ; with an <ename> argument
. i- r+ w: V( i/ w! n ( (entget ename) ; If object is non-deleted
7 b" L- h& ]* y# @1 f6 z3 a1 p (setq ai_seltype 3) ; then return its ename.
9 w# G% A5 x6 Q# A2 _ (ai_return ename))))- G7 \# H/ n$ T+ M L3 g9 a+ p
, L3 |2 r$ w1 m9 r( j- X+ `+ ]9 R ;; return auto-selected , see ai_utils.lsp: i2 f* ] J2 A8 e O' P' B: q" P- R
( (ai_autossget1 "\nSelect one object to modify: "))
8 D P% n& k- ?7 P; r3 }
( u3 ]4 n) A1 {% S" x! e2 f (t (princ "\nNothing selected."). l6 s6 @3 y* n, `' ^# Q9 ]
(ai_return nil))
$ a- X7 y. w' x' z* g1 q2 V* C )7 O- q# o; I, m# P/ j/ B! P
)) t/ a' m2 q3 y8 c
5 }6 T( `. L- s( b- D8 Q# ^;;; ============= Command line interface function =======================# h% @0 j3 J* I" L
! _2 Y3 U8 c: \5 e3 P1 U
(defun C:MMO ()
* y$ I" A8 e( e' Q' T% _ (ddmodify nil)8 M, `$ K0 ~! y. }6 j' T; u
(princ). D" K- Q6 ?- C2 Q. z' d# B# l
)8 j8 X8 W8 S" \7 V6 M
6 {# Y. n" A$ H( i;;; ================== (ddmodify) - Main program ========================
; s' r' C# `$ _( q8 n( z;;;* k/ x: H1 v" _, D
;;; (ddmodify <ename> )
8 f3 C' o6 v% X, H;;;2 R) S0 }) j6 N' n
;;; Main program function, callable as a subroutine.
9 G8 h! ]" N m* z;;;
6 U. ` J; q8 R# J9 A' D* b' Y;;; <ename> = object name of the object to modify.# `! ]6 J& ~6 X/ r2 z& f# Z% b
;;;
; z6 N t, C# i& U% n9 d;;; If <ename> is nil, then user is prompted to select
- C4 a7 w- X/ d- ^6 i' [; w* I: T- k;;; the object interactively.$ N7 v( [+ j, o
;;;- \9 V* r" ^5 ^/ O2 s/ }0 j
;;; Before (ddmodify) can be called as a subroutine, it must
4 j; K% R1 w3 I;;; be loaded first. It is up to the calling application to
" I2 N2 o' ~, l;;; first determine this, and load it if necessary.
% l F4 y. N' q0 `! a2 @/ ?* \
6 i4 [6 J: O% A- m1 J2 H! ?' d2 W( {6 O) v& G7 F% m3 I3 K
(defun ddmodify (ename /
+ V0 z1 \' S9 o2 [) O3 o2ndpt ell_calc_area move_pt1 templist9 w( S& I7 F. A# l2 t3 ^) m
add_mdash ell_tile n tempmod
% ?& S+ }3 W9 f. j# J. k+ zalipt eltscale name tempst_ang+ f' {0 [: y. I
ang eltype newpoint test_ok
) c5 E% q& f1 G! q0 \arc_calc emod next text/ a, h* c, R" ]) |
arclen end_ang next_vertex th-value8 ?. c" b- p+ P. d+ R( c2 O
assoclist endpt obl tile
6 x# d) V8 \9 ]0 o ]atprompt errchk off tile_rect
1 g. x) B# ~) o- t; W. M$ eattag ethickness old_majrad tilemode" n0 Z% P# b6 U" |# M$ t9 x0 O2 t
attprompt etype old-closed totang
/ n- m o% y0 W/ Z- g+ Hbit extru old-closedm tstyle
# i. S9 z$ {7 }3 j V. T4 l- Y8 ibit1 fchk old-closedn u/ x8 S6 A0 h, M
bit-10 first-10-rec old-elist undo_init' J: o& p1 B1 X3 L+ t9 X: Y
bit-11 first-10-time olderr upsd
! r, F4 S( n; B! Qbit2 first-11-rec old-fit v
- d3 Z$ h. S0 |: \- R/ s1 H- O) lbit3 first-11-time old-idx va2 g' J }" N) m E9 ]6 ?
bit4 fit oldlist value/ n% B6 r$ d! k- L9 A2 S
bit70 frozth old-spltype ver_4
1 }; s4 O" H5 z+ t: w+ @bit-70 f-vis old-u ver_ang1* P- T- M3 e- ]' Q% P4 `, T
bit75 fx old-v ver_ang2
, X2 v* Q; N# q2 N8 Pbk-up get_color on ver_col
% N$ T" A8 z% _) x. B- U- \. tbkwd getcolor onoff ver_colsp0 I/ d4 Z$ v* N3 i
boxlength getindex on-off ver_eangle% K# A8 a4 L4 v' \; R5 ?
bylayer_col getlayer patlist ver_hght
a- X' ^# c1 mbylayer_lt getltype pattern ver_majrad& Z) j/ S0 }/ ^. h
calc getthickness pltype ver_obl7 u: g7 Q3 T# B U6 @ K& G0 l$ H
cancel globals polytype ver_pt12 ?" D0 H9 ^7 R+ {4 x1 Q+ Z$ [
cir_calc ha pre ver_pt2% u4 o( K! D R/ E- l2 \
closed ha-prev proplist ver_pt3, Y: h+ { T, ]7 a
closedm help_entry pt ver_pt4) X- U7 |/ T7 u" K9 g
closedn hght pt1 ver_rad" C- {. _4 x. H+ n
cmd icvp pt1_eq_pt2 ver_rot
2 L5 r+ L! M/ h" _) h8 g. pcn image_add_vector pt2 ver_row. V3 S/ M, d* ~/ V$ t3 b0 N
cname image_clean_variables pt3 ver_rowsp
0 s) }2 D: Z3 V; e$ F" ecntl-pt-indicator image_cross_product pt4 ver_tag* n) {9 o- }+ g6 d2 ?
code_71 image_disp_opt ptype ver_u0 C. p. R5 U$ ~% j# f+ t
col_tile image_dot_product radius ver_v
# l. n+ v& R3 H+ S# E0 W0 bcol-idx image_normalize_vector rational_spl_flag ver_wid
& ^5 ?1 A% p6 x! Tcolname image_rotate_vector reset ver_x1
% F7 b* O t* V/ J8 }$ Hcolnmlst image_scale reset_flag ver_x2
1 {3 S2 L9 y5 q# `colnolst image_scale_vector reset_lay ver_x3
5 f. D0 c' n+ X4 ?) F2 J/ @colnum image_update reset_lt ver_x4
, ], j9 A5 Z/ ^color index reset_uv ver_xline_pt1# P9 f- X& n# u" g3 a# p+ Z4 j
colorname inv rot ver_xline_pt2 c% F* R. a- S2 Q' g( v
colorno item rows ver_xline_x1
, i: f! K! p4 F* f3 C+ B; Vcol-sp item1 row-sp ver_xline_x2: h+ u/ ~% q) L2 b% K) P
columns item2 rrat ver_xline_y1" O# V6 B3 a* Z+ C3 n5 E, Y" J. Q
con itemlist s ver_xline_y2
! @9 [( C: K+ ~8 Ccoord jlist set_action_tiles ver_xline_z1
8 G6 r; I# v: B! c8 uctr jlist_act set_just_idx ver_xline_z2
3 S5 r. @: h. o0 O9 ?: tcur-10-rec just-idx set_tile_bk-up ver_xscl
2 }& I3 {2 ^- l! H4 Rcur-11-rec layedit_act set_tile_cntl_pt ver_y1( W2 X8 H4 D) C" a- V( m+ C5 A
cvpname lay-idx set_tile_data_pt ver_y2, C$ G! [2 [% r" F
dash layinfo set_tile_dirv ver_y3
% A( z2 a6 v Q6 T0 gdashdata laylist set_tile_edges ver_y4' J. b( M f* }8 N0 a
dashlist laylist_act set_tile_endang ver_yscl
" f! D# p2 ^/ udashsize layname set_tile_hght ver_z1
, l% S: ?/ U9 u, a K: ^ }4 n ^data-pt-indicator laynmlst set_tile_icvp ver_z2
R/ n: ]0 H& Cdcl_id layvalue set_tile_just ver_z3
3 }# _! a0 f# |' E! Mdd3dface line_calc set_tile_obl ver_zscl% m+ I: D6 r2 p. Q" n6 L1 z8 x
dd3dsolid linetype set_tile_prompt verify_a
: \- ]8 i" [* M) Oddarc list1 set_tile_props verify_d
( N; Y+ U" G5 Z" S, y0 R' A! Q! }ddblock longlist set_tile_pt1 verify_i
! s& r* w1 l2 f, w. D4 W+ ?ddbody ltabstr set_tile_pt2 verify_xline( b! p+ y' [1 V
ddcircle ltedit_act set_tile_pt3 vfy
; }( { }0 x: [7 t" uddellipse ltidx set_tile_pt4 vi5 c& c" v) p4 E
ddgetprompt lt-idx set_tile_rad vlist* N8 q& k" J5 h4 F( ?
ddgettext ltlist set_tile_rc vname; l5 U+ f, b. z4 U; i( {
ddimage ltlist_act set_tile_rot vpf
& S" H& ~; f6 @7 Y8 Oddimen ltlist1 set_tile_scale vpid% o+ h% G& J# }2 J3 ?! ]* e
ddleader ltname set_tile_spline_props vpldata
% O5 v4 r; u& S a( V9 mddline ltnmlst set_tile_stang vpn
$ Z4 i1 I6 u# ?ddlist ltvalue set_tile_style vpt
1 H i* J2 I' F3 pddmline ltype set_tile_tag which_tiles
2 } y* A, s; xddmodify_err m set_tile_text wid
% a" f' o. k; |) ?$ a0 J t5 zddmtext majrad set_tile_vpt x
% q6 D6 s4 m6 N6 Z* yddpline make_lay_lists set_tile_wid x1
: F$ D2 N' o" V1 n$ r& Z! cddpoint make_lt_lists set_tile_xline_pt1 x2% l: }+ d W" ]6 Q: c
ddray mdashlist set_tile_xline_pt2 x3
2 P/ {1 ~% A5 j4 |ddregion minrad setcolor x4
& L- w3 f" D! d; dddshape modify_3dface shght xdlist( T3 H( f* E" M( X: q0 G- U' p
ddsolid modify_3dsolid showpt xline_pt1
, A4 s! L0 z6 M( uddspline modify_arc size xline_pt2$ I# F- j- o& f: q* w, S
ddtext modify_block slist xline_x1
5 k) U) o5 q& |* b/ Oddvport modify_body sname xline_x2
3 k! X' _; \/ {' z) ], }; V* f7 q' }( nddxline modify_circle sortlist xline_y1
" T$ a' w$ }0 g. o. g2 [+ o' [* L" l& cdenom modify_ellipse spltype xline_y2
. W9 k) H) G% Q* T9 P+ udialog-state modify_image ss xline_z19 F/ f# G/ b2 |9 F) x% z+ V
dir_pt modify_line st_ang xline_z2
4 v1 `2 I6 G% G; G- J$ \5 O* Y; idir_ptx modify_mline stpt xscale. s/ X* y- v- U$ D
dir_pty modify_mtext style_act xx
. v6 R/ ]/ C+ b1 s- g' pdir_ptz modify_point style-idx y/ E7 _; U Y, Y% m8 V
dismiss_dialog modify_polyline style-list y1( q5 y& L/ x+ E9 E- R( `6 g) x
drawpattern modify_prop_geom tagval y2+ v; H5 M/ y' h/ c' l) D# R6 y& c
echo modify_properties temp y3& l2 q$ m1 c6 u2 \2 [
ecolor modify_ray temp_color y4 x/ p* A7 y% o3 b/ o
edge1 modify_region temp_dir_x yscale
: N. e' }3 `) b. pedge2 modify_shape temp_dir_y yy
6 x' d! e g% W _: u- L: \edge3 modify_solid temp_dir_z z19 ^, `% R# W# j: V' _9 k
edge4 modify_spline temp_xline_pt1 z2
/ T& [4 _% b5 n B4 iedgetest modify_text temp_xline_x1 z3
' K# L0 U2 ?- N4 |4 y' R5 f$ melayer modify_vport temp_xline_y1 z4
& F2 o' H+ [% @; oelist modify_xline temp_xline_z1 zscale) k9 N9 E2 l' Y9 ^* J8 v: g
ell_calc modlist tempend_eang zz4 V# e/ i" n5 I
dir-idx safe_ddedit ver_MtextWidth xcliponoff
* F- v4 Q: y5 k0 K' q3 w; WMText_style3 f* \) y h5 A. [1 D
)
. ^+ H# w0 i! Q" u) I- G3 a
, e) K9 `$ R( i" j. d6 W (setq old_cmd (getvar "cmdecho") ; save current setting of cmdecho
( U: i3 G& {; N. v old_error *error* ; save current error function
, P/ h, n. ]4 Z+ O1 ?9 j *error* ai_error ; new error function
, s9 W7 V, F, d2 `) Z4 d )
& I# V" Q8 E+ A$ u/ w4 R8 a
* p# T: k$ ? H (setq old_pickstyle (getvar "PICKSTYLE")) ; save old pickstyle
0 g( F1 s$ K% d" D& f6 p (setq new_pickstyle (logand old_pickstyle (~ 1))) ; turn off group selection
( _. j7 v- U9 [2 \7 c (setvar "pickstyle" new_pickstyle) ; bit and set to new value
3 K) v7 f% Y+ g0 c' A% X
" [) { X$ f$ t( `; c (setvar "cmdecho" (cond ( (or (not *debug*) (zerop *debug*)) 0)
4 M2 V0 X6 N3 K, ] (t 1)))( z/ D) W% U! @% H# T! `
(cond, {& w8 b) B$ p9 B/ X; G* T0 p
( (not (ai_notrans))) ; Not transparent?
k# Q2 V+ ?& P i( g ( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
+ O a {3 V' g ( (not (setq dcl_id (ai_dcl "ddmodify")))) ; is .DLG file loaded?
$ D& c8 f# [, R# G K ( (not (setq ename (ddmodify_select)))) ; object to modify?+ q- s. k4 W5 y1 M5 I/ P* X" `
. {/ k* M; i- V, M: P
(t (ai_undo_push)
. O2 R% u3 s& Q7 F1 E& o) K5 ~ (ddmodify_init) ; everything okay, proceed.
( n5 Z% l3 \: r0 ^ (cond
( Q) W$ y8 I [ r0 e1 m4 { ((= etype "LEADER")
0 J6 F2 ^: | C: r (setq help_entry "modify_Leader_dialog")% m D: h8 z3 C3 s! S1 K. Q, e% d
(ddleader)
- a# |! y8 ]$ Q W" i8 i )$ o$ _! R" F5 l' J
((= etype "ARC")
0 |% @) U3 k0 y! L0 X (setq help_entry "modify_Arc_dialog")& s9 X. N7 r% Q: |/ l/ \
(ddarc)
; t. \$ y$ Y! k3 w" n )8 e2 p" z1 d7 M3 _, j
((= etype "ATTDEF")
+ A* p. G% ?6 R (setq help_entry "modify_Attribute_Definition_dialog")
P4 l0 R Z, P/ Z0 L3 P (ddtext)
4 f" R4 W9 I+ z2 g- \: q4 v: t )$ A5 z& i4 L$ W. g; f
((= etype "CIRCLE")' _/ C- i6 c$ f. U, h! L
(setq help_entry "modify_Circle_dialog")
0 y) ]- X |' O/ I5 Q (ddcircle)
# _# j w9 [. y/ ^, K )3 G# E! |/ m. U7 Y2 l
((= etype "ELLIPSE")
% U" y1 M/ C- I/ m0 ~+ I, X' D (setq help_entry "modify_Ellipse_dialog")
6 E1 e9 Z2 Q- z- w! A% } (ddellipse); A" y# \; v7 {6 s5 g
); x9 l. H3 L" }
((= etype "3DSOLID")4 w5 D% w* ~6 [- @' E
(setq help_entry "modify_3d_Solid_dialog")
{- X9 Y* h2 |' N (dd3dsolid)
b) Q, G4 v$ {! w9 p) b& }; w8 ] )
8 f+ I) h2 c: e; Y' ^3 N8 {5 @ ((= etype "BODY")
1 n5 M- `+ ~ m9 Y% W4 q0 j (setq help_entry "modify_Body_dialog")' O; E8 d+ d' F* B/ M
(ddbody)% r1 _& c) [6 c5 U; b4 F
)
& @" N+ m0 d, X9 P: b ((= etype "REGION")% g- L6 N2 O6 @
(setq help_entry "modify_Region_dialog")
8 V+ q4 J# T$ ]( p) I' V (ddregion); H* |, u. ~6 P, H+ E/ z
)
( ^/ a, e8 D" C( W. t* Z ((= etype "HATCH")$ X& e. G- b f: @3 j
(setq help_entry "modify_Hatch_dialog")
# O3 P6 e) c, u( k7 k (ddnewhatch), ]; D/ |3 r7 i, B Q$ C
)9 o. W1 Z- F j+ H7 r: K
((= etype "SPLINE")
( j, Q3 X& P3 C7 g! i5 A (setq help_entry "modify_Spline_dialog")8 X* g$ W# D- l" {/ u' k) \
(ddspline)
h5 N9 ?/ b8 x )9 g4 o: c. l5 e
((= etype "INSERT") ; see ddblock for help_entry
( w6 J/ K6 F: v* o- w (ddblock)
0 Y J0 a' ?8 V. }. F1 J )
* `- b1 h, p5 [) H6 T/ D% O ((= etype "LINE")
: h8 b) d& I2 ~2 R (setq help_entry "modify_Line_dialog")& ^& o4 d ?% }+ `- S) C
(ddline)3 o6 X7 Z! F( F
)) R8 }3 L* K4 p% d0 ?+ c
((= etype "MLINE"): ?/ Q8 c) P% Y
(setq help_entry "modify_multiLine_dialog")
& r' T- ?9 A; I2 k7 t1 I (ddmline)$ l0 ^- v* F; F% w# `
)
( F( i1 n! x* H2 k( \ ((= etype "RAY")
0 f$ m# S' S' F) N1 c (setq help_entry "modify_Ray_dialog")
, l' i1 D0 D2 h( A H7 N9 H (ddxline)
1 _; j4 u5 @* R! g; ]$ N ] ) d3 {# Y- q: ~
((= etype "XLINE")
* |# b; _' z/ g0 d (setq help_entry "modify_Xline_dialog")+ R5 u' Y1 R ~. u& W$ s0 c& J
(ddxline)- U1 y$ m& U( H
)) U- [, _# R6 M {- c$ w0 R. p) c( P
((= etype "POINT"). E4 s; ]7 z6 K9 |" b
(setq help_entry "modify_Point_dialog")' R: V, h3 H/ F0 j+ U$ @
(ddpoint)( ?, _2 [ ~# w0 M
)& S& E6 [6 r- B' B# Z6 {3 N
((or (= etype "POLYLINE") (= etype "LWPOLYLINE"))
. Y( P6 j, g% f" f, R: X3 ]1 o# p (setq help_entry "modify_Polyline_dialog")
# w0 ?$ \) U) S V ;; If a 2D pline, check to see if it is planar to the current
9 H3 m; n+ S- v2 e% U& ^ ;; UCS, reject if not. To see if the pline is parallel,
% }% m: ^0 n0 b' s$ y- \6 | ;; the 210 group (WCS) is added to the current UCS origin (WCS). h ]+ ]1 z1 W4 q6 N4 i% x
;; and then converted to the current UCS and checked to see if# M- U( I' M1 M/ c/ b0 p6 F- y# D
;; it is equal to (0,0,1).* x% A* Z2 B7 }* l8 s4 l) x
, B% ]) G! K+ d* N A/ Z; C ;; Incase the 210 is default and not in the dxf list.
* ~$ |# E; w4 N (if (= (assoc 210 (entget ename)) nil)
3 b- I t9 T8 u9 @ (ddpline)) V/ Y* `+ T& C6 J& u0 ^# I1 H# f% M6 }
(progn! a! I+ @# J, W/ _
(if (and (zerop (logand 120 (cdr (assoc 70 (entget ename)))))
$ Z. G* N% [ x, E6 O (not (equal '(0.0 0.0 1.0)4 r% V' y1 T$ P% F4 C+ B& H
(trans (mapcar '+
; S- H3 d: t6 q& X (cdr (assoc 210 (entget ename)))8 `9 ~2 W5 m6 l. g
(trans '(0.0 0.0 0.0) 1 0), w0 L" {, I/ y- T
)& a/ M7 O3 n; Y0 @
0 18 }. v$ P8 F' s6 b( l5 u t
): m$ q% s/ q5 p+ D
0.0000000001 ; fuzz
- f/ Z: p/ ^$ l )8 \- B* ]4 s" o# K5 P/ k6 L2 Q
)5 {4 t1 ]8 R) ?1 L7 {7 g U; `
)1 R: p8 {6 {0 ~1 U. A+ G
(princ "\nThe 2D Polyline is not parallel to the current UCS.")
% f% T- G; v% L9 T5 E: x$ y (ddpline)4 U- u0 S0 \" {; K/ W5 x! J# h# A
)
2 f _, R" t' r2 C- |$ g" S; ` )
' d+ p* N1 w9 G# x$ ]1 D1 c* V )
, y# P5 a" D" D0 T9 h9 j" ] )' N5 a" ]) M0 [0 g4 p# j; ~/ t
* _. k5 _9 x+ |. h8 Y
((= etype "SHAPE")
3 O0 N8 }+ W- `( u: B# ~ (setq help_entry "modify_Shape_dialog")% X4 A: V2 e6 l b) i
(ddshape)7 f; f8 ^, z9 J2 V1 h$ C
)
# y8 l9 U6 q) z0 b- p8 V ((= etype "SOLID")
( a; w7 h" Y3 O& n (setq help_entry "modify_Solid_dialog")
; [; W: O( V$ m2 s8 z# \, |6 p (ddsolid)4 q: H) P! D# @$ T% i
)& Z( w; E# H3 K+ j% o" R
((= etype "TEXT")
; Y' D" z, C' b, C( i7 b; ~8 ^ (setq help_entry "modify_Text_dialog")6 I2 T3 c2 I( Y2 d" [: B
(ddtext)% ]8 ?/ w' n: s% g) E5 T" r
)7 z5 O% `3 p: P. ]% n; m# B
((= etype "MTEXT")
. d: \6 r5 `$ c" |0 ]; j' p (setq help_entry "modify_MText_dialog")
- T* `1 s+ E* S' v (ddmtext)
* y0 a! B1 g2 F7 r H )
4 j$ t5 n; _6 a/ T4 i ((= etype "TRACE")
# R ]! x/ U& C% K# I3 Y1 J' A1 T (setq help_entry "modify_Trace_dialog")4 P1 b# P. [/ R: {0 q
(ddsolid)
! J0 D* l$ ]$ D$ g0 G5 f )+ K% z) U* \3 G4 i. w9 R3 @
((= etype "VIEWPORT")
7 s$ k+ ~. n3 z r9 o+ I$ u (setq help_entry "modify_Viewport_dialog")
7 ^- g8 `0 o5 w+ c (ddvport)
& K6 ] c1 C9 `5 @7 r- t )
" X e8 r. O+ E! W# i% C* A ((= etype "IMAGE")
5 t; R3 d' F9 W6 u (setq help_entry "modify_Image_dialog")3 m- O k, K$ [; J4 s8 O4 H
(ddimage)
- c2 ~) |* S1 J" T6 a5 _# U )! B4 ~% T1 H# s& R7 C5 V
((= etype "3DFACE")- `! p* @' `6 A, y4 ~9 [
(setq help_entry "modify_3D_Face_dialog")5 `; _2 y) g: Q/ W+ ]
(dd3dface); M+ j. _) |& b' ^$ F+ Y
)1 r$ i; R6 e/ K! F' K/ v3 X
((= etype "DIMENSION")0 w/ M( f; B$ c$ _% ~
(setq help_entry "modify_Dimension_dialog")
3 X2 @8 c5 Y; O- @% }* d (ddimen)8 @3 y: l6 D# S' x0 A
)
* Q# `3 z, f$ ~& G q ((= etype "TOLERANCE")3 t$ @8 v+ X( f: S9 i2 e3 m
(setq help_entry "modify_Tolerance_dialog")
+ ~. f( T5 d3 w, E9 v (ddtolerance)# p' D# c3 _8 ^
)
1 @. I0 O" [6 z6 H7 T5 ^;; Fall-through condition changed by MCAD for MDT 1.1 release.
0 h' b1 U6 J2 c1 W- b- u ]( e1 w; v;; This allows DDMODIFY to work on any custom object or any new object type2 q; y2 |% ]3 `3 O1 A
;; that isn't specifically handled above by calling the more generic DDCHPROP.
& j5 X8 H+ Q: p6 v+ o% Q; x N (t
) e( D$ y. {% b( [8 X9 q3 g (if (and (not ddchprop) (not (load "ddchprop" nil)))
7 a4 J! t2 P9 r1 h; y (princ (strcat "No dialog support for object type: " etype ".")))# H" V( ~* y! [* ^
(progn( B! u$ M" f& b" C/ E/ @
(setq tempss (ssadd ename))
6 J% O0 ^. o0 S0 \ (ddchprop tempss)
, ?7 v! o4 S" `. z7 ]7 B (setq tempss nil)5 ]2 l2 X- p5 ]9 j, S9 H* _, M
)4 ]8 k, E W( Y0 y* ^9 g
)5 A. t! O5 x' R- A9 P' g
)
4 F0 _) H u; ]5 Q+ Q* N;; Previous fall-through condition.; u2 T, c! A3 X+ a/ O
;; (t (princ (strcat "No dialog support for object type: "
2 G2 g$ U8 K8 D$ \: P, j;; etype "." B9 A7 I" @9 i
;; )6 u% a: f) |* k/ _- t
;; ) f) R$ Q$ O* b) M$ \2 q
;; )6 k2 K$ t- Q, I8 [9 g
;; )4 w0 d3 C7 E; c$ l9 N. g
(ai_undo_pop)9 E9 E% j: k5 ?+ B
)/ M) @9 D9 O, V, ~
)
7 n* F7 ]" o5 j: s$ u4 G
- {( n' ^- ~% r: A) Y/ A (if (eq new_pickstyle (getvar "PICKSTYLE")) ; if user didn't change pickstyle2 q0 X" F% d. Z
(setvar "PICKSTYLE" old_pickstyle) ; transparently then set it back
- D Y, t5 Z; r ) ; to what we started with& v" J4 [. c3 T% O: `) p
6 T" Q9 K% C1 l" ]7 T6 I% \1 b
(setq *error* old_error)$ i$ K' o7 B: \) W
(setvar "cmdecho" old_cmd)
, ^. S7 @9 K8 ~/ K (if (not reset_flag) ; if object was modified, then( P/ t8 e u0 { e! C
(ai_return ename) ; return it's ename to caller
; P3 E" T$ h% S )
3 n+ j- z$ k0 W)
+ W* S2 ^2 a4 V% R0 D4 {1 n
, S& I; k- F/ _0 ?% i(defun checkForLockedLayer (ename)5 F9 z+ ^* U) G& {, J& p4 e/ D! _
(setq layername (cdr (assoc 8 (cdr (entget ename)))))1 `' |5 R" }8 h& k/ w% Y; k8 s
(setq layerflag (cdr (assoc 70 (tblsearch "LAYER" layername))))
6 M) t& N% ^' z4 d" d (if (= layerflag 4)# r+ ]. J% n( ~# Z% K8 P
T
9 |% F1 O! @8 L1 p: u5 k! [5 ~ nil) x% D% g2 {1 a( v
)
; q" B4 a* q4 q8 E, }( \)- X2 G+ w; l5 g2 B$ c! [
* r: @+ R! _1 D, H |+ w2 v: M(princ " DDMODIFY loaded. ")
% P% m8 w v1 S0 T/ N(princ)
; o# M ]# O& E! o;;;???;;;---------------------------------------------------------------------------------------
( ~1 u) ] v% q, H% J+ a
4 [3 w4 w' G4 Q% L$ L1 u* _; Next available MSG number is 8
0 b- Y5 `& C: M" e5 W+ H( _! D c; MODULE_ID DDUCSP_LSP_, U0 ?6 M8 w$ N
;;;+ l v% F" d: C3 R1 Q( G1 C
;;; dducsp.lsp
8 s Z/ R- I: f& I( w9 }* o;;;" m" x5 k [0 ~3 f7 ]
;;; Copyright 1992, 1994, 1996 by Autodesk, Inc.5 g0 K$ e% r& K
;;;
8 c0 Z3 e u0 k; c;;; Permission to use, copy, modify, and distribute this software& M7 w3 F+ {5 K: v& i
;;; for any purpose and without fee is hereby granted, provided) f( S6 X+ C" |* S' j0 N, e- Q' G
;;; that the above copyright notice appears in all copies and5 b: }2 h; S3 X E4 Y. L4 h4 y: e
;;; that both that copyright notice and the limited warranty and
0 ?( q! v% t' O# \% t;;; restricted rights notice below appear in all supporting
& }. ^- T# ^ s: p6 z& |;;; documentation.
i' g# V' R4 R;;;: v6 p5 G- R) W
;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.3 X- K2 I7 K) E! k2 d5 K# [( H* g
;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
; ~! K2 p/ {# Q; J3 a( X. s/ e( {;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
9 i0 n% K, N& z4 a$ e) W! _& ];;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE+ }$ v& y e6 j0 z# T+ [+ H
;;; UNINTERRUPTED OR ERROR FREE.2 a' b2 w$ {$ o2 `& Q! ?
;;;4 ~3 ?1 D9 n+ `. b/ e
;;; Use, duplication, or disclosure by the U.S. Government is subject to5 q- @; ^! Q9 v) i0 B
;;; restrictions set forth in FAR 52.227-19 (Commercial Computer$ r1 z% B# l, e- p9 Z8 t
;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
/ `. L4 f- H, i; w# c;;; (Rights in Technical Data and Computer Software), as applicable.& r9 m% Y; ]( E0 M% s
;;;
) W; H2 P- A) _" c# @' v0 ]+ R( {;;;.! \. h* x1 L4 N
;;; C:DDUCSP - User Coordinate System presets dialogue.' F2 L$ j+ \: e8 |. V" f# n9 G* ]
;;;
4 P3 E- l6 [; v6 b" t! J- e;;; Uses DDUCSP.DCL for the dialogue definition. The
' c# h& [9 b1 Y: ^. s;;; slide images are in ACAD.SLB.
3 s( c% n% J- n8 H; C;;;
2 b9 h% |1 Q4 X& A1 v7 h4 W6 E: B;;; ===========================================================================* I/ r( g6 `6 e
;;; ===================== load-time error checking ============================% t% }8 ~9 ^9 V8 K2 c, H
;;;+ p n0 V* @. O7 G7 g
, n/ w( B& w$ X, l4 a; @# Y (defun ai_abort (app msg)3 C* T# O6 V8 L; H7 i
(defun *error* (s)
% A" {- |% M* d0 q1 m1 y (if old_error (setq *error* old_error))( K( t3 o7 x( {) f6 u
(princ)
+ i0 F, Q6 n- k5 a )) Q5 x/ Y& e1 V4 t
(if msg! \* o/ @7 z8 f! I6 t/ e9 a
(alert (strcat " Application error: "3 a% S) I7 X# ]7 p. a" C
app
3 g2 l4 m% n6 k0 ?3 Q " \n\n "
- y6 a* q- L+ j; ?$ V msg
% z; v' Z1 r9 ~ M4 _9 a " \n"4 Q; v3 k# ~/ ]
)
4 `( h# I# [8 f- Z5 j' c )
& }, v5 [& q E9 q2 @) G )6 x& R4 q4 J% E" [% C
(exit)3 y; T8 r5 [- }, X' D, t4 C
)% U8 d8 ~$ a0 @7 r3 ]# q
R! W8 U' F5 d- |+ E! T0 d! ~
;;; Check to see if AI_UTILS is loaded, If not, try to find it,/ B& B5 ~) Y- u+ k# ]
;;; and then try to load it.; x1 h f- I" h
;;;( ]6 n0 c* v( o0 \" e& A4 K
;;; If it can't be found or it can't be loaded, then abort the& ?9 X6 r1 a% c4 _
;;; loading of this file immediately, preserving the (autoload)
; X0 ]/ o, Y0 S7 X! x* s& B- X;;; stub function.
. e8 G8 _4 I" J1 n" d1 ~2 `& b( z* u" |* v+ |; p$ X# J
(cond: q4 Z8 S; I& @ `% V0 k T$ n5 \
( (and ai_dcl (listp ai_dcl))) ; it's already loaded.
0 n( w6 ^) o" k+ M( C4 A2 j/ w; ?4 }& X, D0 H G/ T7 {
( (not (findfile "ai_utils.lsp")) ; find it k: C4 Q* O( o5 R, O d
(ai_abort "DDUCSP"0 G8 | k6 F* {$ t* [' y
(strcat "Can't locate file AI_UTILS.LSP."
0 e+ d# M+ z0 c$ q "\n Check support directory.")))
8 \" H$ [& d ^" u7 a4 I; D1 ~( j/ h1 M
( (eq "failed" (load "ai_utils" "failed")) ; load it
; ~6 A3 O6 X* F4 U( N0 b/ {, ^ (ai_abort "DDUCSP" "Can't load file AI_UTILS.LSP"))
$ ^+ U8 z4 c" i. H! x$ U) M ) M1 o* }; c1 |& P* s9 I5 Q
1 a6 T2 `& g' `- ~% [1 v
(if (not (ai_acadapp)) ; defined in AI_UTILS.LSP1 }. d, l0 |! h5 u
(ai_abort "DDUCSP" nil) ; a Nil <msg> supresses
0 P+ T3 Y3 H* B& O# H2 }: M ) ; ai_abort's alert box dialog.
: U0 c# |0 j; Z; r, w1 Q8 ~+ a) @# ]6 U
;;; ==================== end load-time operations ===========================* c! F" G3 O& w8 N, U1 T
4 a! A8 Q5 G5 Z- `" E2 G(defun ai_ucsp_start ( / program)- C/ P2 ^% O; J* ]6 D2 {. [
;; Get program name# o9 z% E$ B# i7 R
(if (not (setq program (getvar "program")))
( A ~0 r" l& P- F; u$ l (setq program "acad")
. C: B: c* c# D )
2 n5 @0 H+ ~. `6 z9 ^ (foreach v0 '("world" "left" "cview" "top" "front" / z; H6 |7 \5 t- n. w# a6 O8 Z
"bottom" "back" "right" "prev")
" Q9 L# k& h* \! L (start_image (strcat "ucsp_" v0))
/ D/ \7 ^# [& @2 z (slide_image
1 U& V f0 k- V* ~ 0 0
4 A6 m; p5 I! S0 E3 n( ?/ u (- (dimx_tile (strcat "ucsp_" v0)) 1) (- (dimy_tile (strcat "ucsp_" v0)) 1)
+ ^) t5 J5 o+ N" \4 P (strcat program "(u-" v0 ")")
& C/ \5 I1 l' ~ ). F8 m: ]: }9 B7 ~
(end_image)
( v* E4 _8 b/ z! o# d )8 ^9 a7 V6 J* `3 n4 B( e0 D
)% v8 L8 B# P3 ^1 [
6 i6 n& r2 t% L1 b(defun ai_ucsp_set ()+ j+ \. I7 Q. A
(if ai_ucsp_sv
4 ^# z7 k* i1 F D( S7 f r7 p, Z1 k (command "_.UCS" "_V"). j& j& U2 i2 F D0 ^! ^
(if ai_ucsp_prevs
- d3 O$ J1 m' P7 M (command "_.UCS" "_P")2 X# Z. z6 s3 p& ], j
(if ai_ucsp_chg6 e5 A% p h0 x& a+ I2 @8 X {
(progn/ H' [4 |8 b1 |
(if (/= ai_ucsp_a "*")" Z% B0 e* w3 e. q# t- d( J( e
(setvar "LASTPOINT" (trans (getvar "UCSORG") 0 1))' c( `1 @6 O6 N* w; E! a
)5 h/ q! l8 O1 b
(if (< ai_ucsp_pick 6)
% p0 a6 T/ H( m# L6 s' ` (setq ai_ucsp_set0 "@")
' L3 V# H1 X& ~% ~. ? (setq ai_ucsp_set0 "*0,0,0" ai_ucsp_a "*")
3 d8 g' I3 O) |. J )5 v1 E; @4 q9 D: k" r
(cond ((= ai_ucsp_pick 0)
1 v+ Z/ v% q4 b7 H8 A6 s (setq ai_ucsp_set1 "0,-1,0") R; {2 G& n$ o% V# {3 {5 a
ai_ucsp_set2 "0,0,1"4 s2 V9 {( r+ _+ a: ]5 `
)
- U4 h$ h8 R( G" `- M D5 O/ H )0 m; ]) [8 E9 X( X
((= ai_ucsp_pick 2)% |3 b( Y4 n; C- m+ M
(setq ai_ucsp_set1 "1,0,0"
- n8 F0 w+ f' X: y" r ai_ucsp_set2 "0,0,1") {& a5 H% @* A& P
)
. l& x2 d( m6 a2 ~8 Y )
* _( p+ y+ e: a8 H ((= ai_ucsp_pick 3)
- G q" X+ x/ p/ y1 l (setq ai_ucsp_set1 "1,0,0"
: p/ \7 u( H$ A+ d2 _5 R* Z4 H0 z ai_ucsp_set2 "0,-1,0"! n( Q! R, p! p2 Q. b8 t5 K8 `
)7 g5 S0 y+ t2 \1 a* l3 }
)
; {# a* |5 M, E) M ((= ai_ucsp_pick 4)
$ |8 g. D* z8 n8 L" D (setq ai_ucsp_set1 "-1,0,0") v* p* _: e0 U2 k% k
ai_ucsp_set2 "0,0,1"
+ P# q. u: {2 e& b* j% h2 C )
4 f& a& Q1 W5 v+ K7 y3 @' m% ] ), b8 o( O1 t+ Z8 m; o. [: S
((= ai_ucsp_pick 5)
# w7 k# t# W8 d (setq ai_ucsp_set1 "0,1,0"* b* A9 w9 V% p0 g
ai_ucsp_set2 "0,0,1"
) _+ K3 I' p( a% W) Y5 x )
( |6 H( P8 ~4 f* ^7 M, b$ X0 H )' d" d( _5 X, N3 D. l2 L+ |$ @
(T
& J& L5 g% a% j/ h$ F0 l) I (setq ai_ucsp_set1 "1,0,0"5 {. [/ p% x) a
ai_ucsp_set2 "0,1,0"3 X0 s6 ]' Z/ K! V' `
)
6 n: I2 c1 p- f) u6 }* {) W: d )
- R( o4 C4 h' I )
; D6 U6 [ L5 l8 [3 K( L (command "_.UCS" "_3P" ai_ucsp_set0
/ x2 O; V! ?4 ^6 H& ?& o" @* Y (strcat ai_ucsp_a ai_ucsp_set1)
# j. n. @, o) _% H: j9 _ (strcat ai_ucsp_a ai_ucsp_set2)7 u4 S4 `. ^7 u& M2 P
)
- ~8 q& c! D7 V3 J; H6 G )
1 ~. ^: i) z! ^* P1 w2 F% f )
, t Y- d) d/ a% ~" d ). I4 ^! I% Z! ~+ Y! k% ?4 y2 O
)
; W7 a6 J$ j* p). X: {5 h! S% B) X3 ^% W
! S, i# }9 d, f) ?7 _
(defun ai_ucsp_p (val currtile)
3 [5 g1 w0 a- Z0 T (mode_tile ai_ucsp_currtile 4)
, I) J( Q- k: V# e (setq ai_ucsp_pick val& w: t9 C/ `7 o% t
ai_ucsp_sv nil) n- F; ]8 W' P* ? M# j
ai_ucsp_currtile currtile u& \- @, S$ ~ j( F; T6 v5 O, ~ S% D1 ?
)
9 E, r2 ]3 d/ K$ y$ B (if (/= val 1)
* T/ N& {& F d (setq ai_ucsp_chg T)4 u# `7 e0 \7 s# c" x/ n$ b7 b$ V4 W
)+ @& w5 V+ Y9 G& r" C" U
(mode_tile ai_ucsp_currtile 4)$ v2 @& H) p A# p5 u' h& r! s
)* ~( B v7 o5 r( B; {$ ~! e
$ P# h' s- u: t J+ C0 @(defun ai_ucsp_swcs ()
( W7 e% @ L/ S: b (mode_tile ai_ucsp_currtile 4)
2 j' T+ n# b0 I1 D3 C (set_tile "ucsp_a_wcs" "1")
4 g7 \: U* _# p (setq ai_ucsp_pick 6
, g' N) @; |# f ai_ucsp_sv nil; A# c: @/ O4 ]+ ]
ai_ucsp_currtile "ucsp_world"8 c* k/ h/ B6 [- }( l
)
5 ^/ f1 G$ ]# n% a; f3 E6 l$ D (if (/= 1 (getvar "WORLDUCS"))* J( c. H2 w7 ?" |- Z
(setq ai_ucsp_chg T)
3 x2 I" ^8 ~9 [7 x0 }9 P (setq ai_ucsp_chg nil)
( h9 Y; a7 @! g! J4 f )
" ], E0 Y" Q. H! ?7 c (mode_tile ai_ucsp_currtile 4)
F3 K3 x; Z8 }8 b)4 P1 o0 ? J$ y; H& y4 q, ~; L0 T
" j+ y8 n, S, C$ c* h
(defun ai_ucsp_cview ()
: B& |5 n) N1 ?" K) i5 o8 o (mode_tile ai_ucsp_currtile 4)
W7 ~- t9 t/ s! Q (setq ai_ucsp_sv T
" j1 M& a9 y% @+ ?5 b/ A" G+ S* c" q ai_ucsp_chg nil
' W5 s, Z$ F8 I$ a' Z$ l! ]5 c ai_ucsp_currtile "ucsp_cview"' I2 v# v6 _8 _& g4 C' J8 }+ T$ I
)% ?( [& U' Q' t& ?' t6 B
(set_tile "ucsp_a_wcs" "1")4 S5 j. X2 f7 N( x& {
(mode_tile ai_ucsp_currtile 4)
7 s6 G' }4 X: |9 E)/ o$ F$ `. Q- n9 A4 a
' ?( C0 {7 W* f2 y! r- u6 Y
(defun ai_ucsp_rucs (typ)
6 |( w( I7 K" `: q6 H. o* B (setq ai_ucsp_a typ)
% X3 m' p- [5 ?9 H- M; L' h (mode_tile ai_ucsp_currtile 2)+ C; @# w: g6 f9 J6 M3 y6 r
)9 O1 P: A2 O' e
/ H! ?7 Z# Z9 X7 O: C5 S* W(defun ai_ucsp_prev ()2 u0 k3 @- w: T5 q9 o
(mode_tile ai_ucsp_currtile 4)
* t5 w2 L z& |' s& |" I (setq ai_ucsp_prevs T
9 b6 J: y3 P( i5 E. D+ Y- L' z ai_ucsp_currtile "ucsp_prev"
, b; }0 V+ S7 E* {3 F )
! y- H$ a; d+ K& P J (mode_tile ai_ucsp_currtile 4)
; y+ u& q6 V: ])0 Z( k3 {) |( t
, d5 D" F) ]/ y& ~( [1 u(defun ai_ucsp_main ( / ai_ucsp_pick ai_ucsp_sv globals)4 z$ h4 Z* q$ k) {6 v/ H
(if (not (new_dialog "dducsp" dcl_id))
1 ]7 z8 I" W, H8 E (exit); n) q& X- `0 I/ e
)- x. e2 O8 @5 d3 r v% E
( `& r$ P4 W: b
(ai_ucsp_start)$ Q* ~" `8 V& ]+ i( a1 a
(setq ai_ucsp_a "@" / e+ B4 x, e2 E' d
ai_ucsp_pick 23 ]7 B9 w# w! Y9 [4 s I
ai_ucsp_currtile "ucsp_top"
4 f2 E( i9 X. O: \4 a+ }' H5 i )
+ T, ]( N% c- R (if (= 1 (getvar "WORLDUCS"))
- l! a$ A- z5 C6 G (progn; Q) d- J; F& {/ D. J' A. S1 W
(set_tile "ucsp_a_wcs" "1")# d/ y0 t* O0 ?9 |- a9 |
(setq ai_ucsp_currtile "ucsp_world")
' [! l7 r0 q q+ n2 H7 [ )
, J* L% o3 h9 b d2 [ (set_tile "ucsp_r_ucs" "1")
3 i% k. s' U% W7 q )% B! S1 e* n3 G- |5 Q; E P
(mode_tile ai_ucsp_currtile 2)
1 d1 c" ^9 C1 g0 _# _ (mode_tile ai_ucsp_currtile 4)4 |& z9 o2 o. X8 C
(action_tile "ucsp_world" "(ai_ucsp_swcs)")
+ {4 @8 H; y/ q+ P3 p. d% C2 m (action_tile "ucsp_cview" "(ai_ucsp_cview)")& ^$ m) y1 i8 P0 E) b, M" G
(action_tile "ucsp_left" "(ai_ucsp_p 0 $key)")2 g7 p; `& I- y1 D4 @0 g. [- z
(action_tile "ucsp_top" "(ai_ucsp_p 1 $key)")) M$ _, `* ]" P
(action_tile "ucsp_front" "(ai_ucsp_p 2 $key)")
1 ^1 l0 k9 N+ `5 m7 T% |8 B6 V (action_tile "ucsp_bottom" "(ai_ucsp_p 3 $key)"); B: N( m0 N x
(action_tile "ucsp_back" "(ai_ucsp_p 4 $key)")
$ @: s! X. }: D. z (action_tile "ucsp_right" "(ai_ucsp_p 5 $key)") P4 s( c( P8 Q+ X+ t3 _; A
(action_tile "ucsp_prev" "(ai_ucsp_prev)")% i& j. L5 Z( |7 J
(action_tile "ucsp_r_ucs" "(ai_ucsp_rucs \"@\")"); ?8 u4 j% g; d
(action_tile "ucsp_a_wcs" "(ai_ucsp_rucs \"*\")")
2 G) j4 m) P9 f# t" [, z' Z ` (action_tile "accept" "(done_dialog 1)")! I: u( G) P7 U' p; S" O' T
(action_tile "cancel" "(done_dialog 0)")
- [8 P& c8 m$ J+ X- u (action_tile "help" "(help \"\" \"DDUCSP\")")
; L" i; N9 ~1 Z+ A% q* y (if (= (start_dialog) 1)
* B6 R, J4 x9 n" j (ai_ucsp_set)
( e9 Y# I% B4 X0 p' R: ^ )+ r1 k; V+ M1 Q; i
)% v* f2 n% E# ^
; _4 w' \6 Y6 o' z(defun c:UUS ( / app dcl_id old_cmd old_osmode ai_ucsp_prevs
) D* {' J# ?0 r: @/ A ai_ucsp_sw undo_init)
2 X a; t! Z: T* \/ d
( J1 {6 [: J; s- \. Z3 M% _9 a ;; Set up error function.
2 U* P6 v6 i! }4 M (setq old_cmd (getvar "CMDECHO") ; save current setting of cmdecho! |$ b3 r; a( h9 M) e8 l7 i* H3 W. z
old_error *error* ; save current error function4 r I2 ]/ f- U" X/ `
*error* ai_error ; new error function8 I/ v6 ~* V3 O6 ]% S2 @2 T
old_osmode (getvar "OSMODE") ; disable OSNAP for duration2 U. G* E! X; t- ]+ z3 [' F
)7 @" g, C8 T) [/ C% J
% Z0 d3 [! B" F+ H' q) K (setvar "CMDECHO" 0)
+ l5 A5 d( @: n0 v2 Q: f$ N" e8 u& S; @# I
(cond( B; d6 z6 W8 p. V& q
( (not (ai_notrans))) ; transparent not OK9 _" B. K3 S. f
( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
" D8 ~- S9 M( m4 k ( (not (setq dcl_id (ai_dcl "dducsp")))) ; is .DCL file loaded?7 w h' e- R: D8 ~0 K
(T (ai_undo_push) F! j8 ^: d6 F3 ]8 {, E+ w1 c
(setvar "OSMODE" 0)
8 p' ` w' Y) s (ai_ucsp_main)4 }) e- H; V4 Y) G% W* T* ]
(setvar "OSMODE" old_osmode)1 a! A( [- |6 \8 u3 W$ h) n2 J
(ai_undo_pop)
, u6 F2 u9 G4 i1 F8 U3 F )2 B' }. w4 }0 Y# Y; L( L
)1 k9 L( n) {* S
6 E& e4 z3 i: y, j" m
(setq *error* old_error) # Q" F# L1 I# ~7 n( x
(setvar "cmdecho" old_cmd)/ D s( ]% C% a. _
. m u7 o8 [0 T9 B
(princ)( d+ i* L- A/ |5 ] H: l
)
d) a$ U9 M1 E1 Y2 z- h+ y+ g7 j" }; V4 J# r
(princ " DDUCSP loaded. ")
, ?$ W& S. J- e+ V7 k+ L' Y6 Q(princ)* n+ Q5 j! M* p
! W% X6 w( |5 S7 D: N S;;;???;;;---------------------------------------------------------------------------------------
' `/ e& c: s/ i
, x0 B8 s; T/ b6 D( N/ D! R& H;;;----------------------------------------------------------------------------
& V; Y+ V9 d L# i' };;;
7 c! i3 J# V* o" i;;; EXCHPROP.LSP 7 R+ V# \. P/ b$ S
;;; Polyline and text modification capabilities added by " |2 v9 W4 m2 C# q
;;; Randy Kintzley
+ _" P. G$ i) w( u3 z: U% e;;;
/ o# G4 r+ c6 c$ m& };;; Copyright (C) 1997 by Autodesk, Inc.; A$ H% }+ G' @3 S" [( W0 J
;;;
* D9 L0 H9 b) m+ Z2 |; q; w# E;;; Permission to use, copy, modify, and distribute this software
/ v* n ~6 p% \% M8 a& G* v( i$ |3 S;;; for any purpose and without fee is hereby granted, provided
5 t5 Z u( _. [- h/ l! I0 S;;; that the above copyright notice appears in all copies and
1 ^( e- Y; l. ]2 h* P% z;;; that both that copyright notice and the limited warranty and/ e+ ^ x& H- m! T+ k+ U @
;;; restricted rights notice below appear in all supporting# j+ a. W4 J* Q4 K% y8 S1 |
;;; documentation.
s% d% \- d1 Q;;;0 A# i" O, c9 T/ {3 c! a+ s" a r; N# [
;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
7 ~, ]6 ]- A! n;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF+ k' ` R* @3 \5 C
;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.+ c! c; [% a' f1 h
;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE& j, g/ U) u8 i9 q
;;; UNINTERRUPTED OR ERROR FREE.
6 e& ~# K, q4 r. [;;;
4 B: O- D9 o/ a j0 t;;; Use, duplication, or disclosure by the U.S. Government is subject to y9 ?6 W- k/ n" D6 o
;;; restrictions set forth in FAR 52.227-19 (Commercial Computer s, n) [0 `6 r& i6 F, i4 w
;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)8 `" Z6 P$ p+ ^9 y% Z! L! A3 p
;;; (Rights in Technical Data and Computer Software), as applicable., n# k; [9 @% i% H% h% ^! y+ f
;;;8 W- Q( P3 o' z; w
;;;.
+ O$ Y& `" k4 m;;; 28 February 1997- r9 J' C/ k# l6 H6 d+ i; Q: `
;;;
" P& F2 f* F S) u4 x. u" w;;;
% H1 m4 [8 o* M4 A* P;;;----------------------------------------------------------------------------* n& j# [4 N$ J1 r& V% x
;;; DESCRIPTION
& i" N+ `9 N8 U+ o5 o& G;;;----------------------------------------------------------------------------8 l+ k% d6 w2 m/ |
;;; C:EXCHPROP is an extended or enhanced version of ddchprop. This 3 h& \) n4 E! o9 W; a' S
;;; command gives the user the abilitie to change several characteristics
) ]% e) j2 M" o+ I& M5 B! ]7 };;; of selected polyline and text objects. 0 h7 J9 o/ ~! b9 \9 y3 h5 O3 n+ c
;;; The style and height of selectected text objects can be modified + y' O/ y& T3 \$ i
;;; (including text, mtext and attribute definitions) as well as, width and
& Y* n7 N4 f( f! k9 m, I' v;;; elevation characteristics of selected polylines (includes lightweight and ) R! o; h" z! L: A1 S) d$ \
;;; traditional polylines.)
. R& o7 q% D( {0 E;;;----------------------------------------------------------------------------
( G6 I. X# q1 f' O;;;----------------------------------------------------------------------------
1 B3 l* n! }% I;;; Prefixes in command and keyword strings:
4 y- `) w5 }$ l( |7 H4 n;;; "." specifies the built-in AutoCAD command in case it has been
' x; _0 a. Z, C+ Q;;; redefined.
2 d4 r; v( H4 _2 \. Q;;; "_" denotes an AutoCAD command or keyword in the native language
3 t9 H+ S' ?: }7 u" p% p* Z# q;;; version, English.: |2 Z6 z5 I& v8 Z
;;;----------------------------------------------------------------------------
! j" R# `; \+ t' D- U;;;
: K7 M! m P& E! z. r;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
' a& a1 d& s5 ~$ [9 l4 s. N;;;;;;;;;;;;;;;;;;;;;;;;;;;;GLOBAL INFO.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;) G, S: y6 R5 {
;Functions created as result of loading file: exchprop.lsp
) |& m ?1 w3 i% r9 q3 C! Y; DDCHPROP2
1 \) I( s9 T' l0 j4 E1 j; DDCHPROP2_INIT9 S) S* X) c; [2 {/ n0 [/ Z
; DDCHPROP2_SELECT
5 U- c9 P1 Q9 \) @;
7 h+ T9 K, q4 {;Variables created as result of loading file: exchprop.lsp2 @4 Q w3 k% ~& _ F
; OLD_ALLOC
8 @) T+ M5 K) o;6 I2 s. C8 e4 P P8 u
;Functions created as a result of executing the commands in: exchprop.lsp
2 |+ m1 s! Q1 h9 t! };4 L( g0 K. P, b a! h
;Variables created as a result of executing the commands in: exchprop.lsp& E2 q2 I4 e u, i. M% s3 o
; AI_SELTYPE
3 l, H% | S' C; BONUS_ALIVE
% b/ t' L9 m" T9 b& I. d; BONUS_OLD_ERROR
; E8 t) A" e2 \" n) Y;;;;;;;;;;;;;;;;;;;;;;;;;;;;GLOBAL INFO.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
/ W3 f6 o0 s) J! b$ I. m;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;) {3 B9 ~5 [& w) V# H% E
7 W4 L% G8 B0 M8 H8 G
;;;3 b4 ]0 n0 Y5 c) ]
;;; Avoid (gc)s on load to improve load time.8 t5 S1 \6 R& o6 Y1 C2 d
;;;
2 v% ~, y. H* O& N(defun do_alloc (/ old_allod new_alloc)/ }2 D7 T" i6 f, A& b* f
(setq old_alloc (alloc 2000) new_alloc (alloc 2000))
( x# _3 T/ o: f5 L9 M( Q (expand (1+ (/ 4750 new_alloc))), J" T1 m$ p/ x
(alloc old_alloc)
) j, k" B! w6 M# v: x2 |# d6 E0 J);defun
" W8 t: J3 C. z
# c7 ?8 S) L0 p$ Y' K! L: [;runs at load time - rk
) g f5 o. o" F* ~(do_alloc)9 e$ ^9 d' }4 u$ V
(setq do_alloc nil). @4 ?/ J% q; n8 ^
;;;
' b3 g; h9 G; Q1 y;;; ===========================================================================
$ |2 v" H" c! E, ]" ~;;; ===================== load-time error checking ============================
8 X# q" H, i, r7 @7 j;;;' u" G4 \. I4 K0 [5 t
2 B. ]# Z0 [2 ` j% A# l1 U (defun ai_abort (app msg)
- r+ g5 x/ j6 N9 t (defun *error* (s)3 h( o- J. m3 V) x v
(if old_error (setq *error* old_error))
, X2 u. z, r2 T% V# { (princ)
# O% ?( k& t/ h" R );defun
4 Z0 s! ? I$ {; [. l4 E% }8 ? a (if msg
1 P6 `% ?9 ]! }: I. U (alert (strcat " Application error: " i: Q: s7 }, {, Y+ k$ Q# p/ ]( } E0 m+ e
app( ^7 G# {( L, ^8 k: I4 @8 D4 i
" \n\n "
- \- m- H5 x2 ?7 z7 T1 B' M5 P msg
5 Z% p" k9 p. C7 l; ~% E# X " \n"
r, l, K5 a# h! ?- g )4 ^4 [* R: F# a6 \
);alert
, l x5 P! @$ H$ J );if% P% V% N& {2 b u
;(*error* msg)
8 U, n* [! W' O, m7 [4 b# o" J (exit)
3 u7 w% Y' Q4 |) p );defun ai_abort
+ Y/ ?$ N2 f! h5 F0 p& A
/ t3 G8 m4 b* R1 `/ h' D/ A7 ~5 q;runs at load time - rk
5 }. W: x' u( @;(if (and *error* ;added the if wrapper around this - rk.! b; Y4 Y+ n D5 E2 s
; (not old_error) & N% t7 R% |; J p8 ~
; );and
: ?. x/ v$ Z! n3 R8 ~' |2 A$ g& c; (setq old_error *error*);setq3 t* z# p! z2 ]- ]1 h! O+ e2 \
;);if
8 T# c% g) q, i. w4 a" R; f9 e, _9 k: n$ W4 ~" |; ^
2 f9 o; }& X% }4 @+ u4 Z, I5 I;;; Check to see if AI_UTILS is loaded, If not, try to find it,. C* [/ u) Y: f" _* Q7 Y, C
;;; and then try to load it.
8 h5 x1 c$ q/ [' h7 t# M4 ~;;;% G7 P6 Q& u( `
;;; If it can't be found or it can't be loaded, then abort the
; P4 ~9 }1 j. R- X. z! t) \;;; loading of this file immediately, preserving the (autoload)
$ Q' G7 j+ j1 j% D8 k;;; stub function.
7 i: G; `: V) F3 I
( r6 n. u% U2 h; h7 @+ j;runs at load time - rk., S0 M, S* l* g* R1 v& G7 `! A
(cond
$ ? R; W' U y; t# ^ f ( (and ai_dcl (listp ai_dcl))) ; it's already loaded./ H2 H7 g3 M# ]
( (not (findfile "ai_utils.lsp")) ; find it# a* Z$ [ ^* ?! O3 c) c
(ai_abort "EXCHPROP"% O$ s. W" b8 T v+ U
(strcat "Can't locate file AI_UTILS.LSP."
& [8 s9 j d- d1 @ O) z; p "\n Check support directory.")5 N* @/ p2 \" {/ m8 u1 y4 ~
);ai_abort
/ O' q @+ l* a" A8 Q7 D )
) I3 @# P3 g* D& O8 }! z- @) f0 }6 ] ( (eq "failed" (load "ai_utils" "failed")) ; load it! u; e# p7 v# s! @
(ai_abort "EXCHPROP" "Can't load file AI_UTILS.LSP")1 T9 Q6 z7 J# T! t+ X
)
4 |" h: k. l! ^4 K. f- w);cond close' i$ Z: P; U4 s+ U4 f$ ?' V5 k4 D7 j
0 U9 `) D2 y6 `/ r+ K# o(if (not (ai_acadapp)) ; defined in AI_UTILS.LSP
* O: Q% B0 F* U! R ? (ai_abort "EXCHPROP" nil) ; a Nil <msg> supresses
) ]- q* J B' X6 O& a a; t2 }! r);if ; ai_abort's alert box dialog.
g& d0 `6 ^. A: S; J0 p% N# C/ E# r: Y8 f% G1 y, ]
;;; ==================== end load-time operations ===========================
5 u+ J! K% _$ v
* P* Q/ M+ e9 l;;; Initialize program subroutines and variables.) ?1 Z. K0 z& p% P0 B# ?1 ]! s
' r1 p! o6 f: i, G6 l6 ]8 P5 D- f(defun ddchprop2_init(): m( B/ f, \+ i6 q. w1 {
- \' ?0 c, e0 N& q& M R- C
3 F2 P q1 u o5 v6 ] I
# n+ x5 d' i4 J- a- p3 @8 f5 W ;;' C6 x/ p) x) w- t, l
;; Define buttons and set values in CHPROP dialogue box+ K3 n5 `/ y1 M
;;
* h$ j2 b1 p8 _3 p (defun call_chp2 (/ cmdact p1 p2)
, v% N) m0 m* j5 p+ k
" u- R+ j( R" @9 j1 I: _, t (if (not (new_dialog "ch_prop" dcl_id)) 2 t2 k+ T b8 @. X1 b8 O
(exit)7 ~. E9 ?, K# `( m: h. `
)5 ]) d% D- k$ k5 D/ f
! j5 X4 X) m" \! Y& ] (set_tile "error" "")
' S& W* q2 l6 X$ e ;; Set initial dialogue tile values
. `' ?# y6 c* E& y (set_col_tile)
. c6 Z/ l% _1 T! { (set_tile "t_layer" elayer)+ c! W) i8 `2 R1 `
! Q3 B: x) a; l! S; A2 }3 }4 R (cond" \3 e: d$ N" G8 F0 X9 d4 I2 Z
((= lt-idx nil)
2 Z% Z( `8 W+ q/ P. l0 N( V& N (set_tile "t_ltype" "Varies"), b1 c! j. Q9 O, ~. ]% W2 S
)
% B n# S% g3 j ((= lt-idx 0) ; set tile "By layer & layer linetype"* u6 e/ @. b" V& Y' n- p3 }# h: E+ g
(set_tile "t_ltype" (bylayer_lt))8 z% y ]5 e- k8 e4 c3 u& H
)
: w x$ J: v3 i; i/ X" N, e) ` (T
+ a5 D4 j* V5 ~6 H& m: D" y0 ? (set_tile "t_ltype" (nth lt-idx ltnmlst))
: l3 z! D$ A& g" [0 Y )
; K3 U( f& X8 \0 }9 a) L )
! Y8 V, ~$ U/ b3 l+ ~8 Q% z7 z( V# W! g& Q$ J* c) D
(if (or (= ethickness nil) i* b" V" _. ?2 o- t( I
(= ethickness "")
$ d E k% F4 o& l% Q+ k; \ (= ethickness "Varies") 9 e; X# C$ B2 |6 H& B1 D5 [
);or
7 h! J' ^) ?4 s (set_tile "eb_thickness" "")( ^/ @. H6 Y8 S [3 g
(set_tile "eb_thickness" (ai_rtos ethickness))
9 }6 l. v: z! v4 {* { );if' [$ r; ~0 d4 L% M
(if (or (= eltscale nil)
, q E0 y1 v4 F2 s% p (= eltscale "")1 c" z7 P: E( s; k9 J+ {; i
(= eltscale "Varies")
/ s- w6 Y/ v1 ~) T% W/ c8 k3 ]* [6 R2 S/ T1 W( u2 a
)
. `. U* }4 A9 S3 n3 S+ x (set_tile "eb_ltscale" "")$ x$ ^ ?! p3 `$ a2 l' r) c$ Z
(set_tile "eb_ltscale" (ai_rtos eltscale))
' R' C+ ^6 P$ l) I )
9 s9 A: f* s: q! K (if2 t' F) `/ d% R: i7 x9 Z& m
(numberp ewidth)
& y2 _* l# g2 R0 |$ f (set_tile "poly_wid" (ai_rtos ewidth))
* N3 Z+ o! e& T- W0 R1 [6 Z (set_tile "poly_wid" ewidth)
1 D! e1 a' H7 z3 Z$ J/ | )
3 W+ @7 `( Z' x6 t$ U5 n (if
, k& [" ^: ?. o. I0 i4 u8 L9 w (numberp eelevation)
& B8 |6 B% H. o8 O: V0 p3 e5 `5 u (set_tile "poly_elev" (ai_rtos eelevation))
2 C1 ^2 `" ?9 e$ t G1 U' d# O5 t (set_tile "poly_elev" eelevation): k; }8 P& v/ @2 I6 ]
)& b8 D$ ?' M, m9 U- J
(if3 R# W! E$ j2 ^# o; W! X+ A, M
(numberp eheight)6 `- w4 D+ s+ W
(set_tile "text_hgt" (ai_rtos eheight))
" A0 M. ~* Z- k! g' v) F( n% `2 g (set_tile "text_hgt" eheight)3 a- Z" E3 G+ B0 j
)$ Q$ ~/ U8 S; V* H* K
(if (not estyle)
8 O; S. m/ N; T& N& P+ T. | (setq estyle "")
2 f& E3 P; Z6 s; Y );if
- ^+ p+ J; C6 V2 t (setq hair_style_list (tnlist '("style" 16)));setq4 c( x7 r) _ a6 |- ^( m7 c
(if (not (member estyle hair_style_list))4 I4 u7 R/ M. t0 d/ m2 W8 u/ A9 J; O
(setq hair_style_list (append hair_style_list (list estyle)));setq# B/ ?0 N2 v. m
);if
) r! A: n9 X) S3 E( p0 v- o
! u3 t) E* n/ e1 O7 M$ ` (setq hair_style_list (acad_strlsort hair_style_list));setq" n, `) G: B+ q/ K& T4 o
(mpoplst "text_style" hair_style_list)
/ y4 L& o7 G, m) A$ M1 b4 q' }) a (set_tile "text_style" 0 l! U0 b$ G" X
(itoa (position estyle hair_style_list))9 C" d# E1 L/ r0 F& s4 N, @
);set_tile
! o; I. d: a" I- D! |# q7 ~) M
5 s1 i" H& h# i% ]/ N4 ] ;; Disable tiles if need be... ;@RK4 S. _4 R/ N) f& u% L4 u0 N( J
(setq a 0)
/ `* J& O; F. G6 {) C (while ( < a (sslength ss))
5 p' M) d! q4 }& w6 l) b G (setq which_tiles' G2 j' t. L8 F( D0 b
(ai_common_state (cdr (assoc '0 (entget (ssname ss a))))))' W/ v0 @6 X* J* h5 Q1 @
& X O8 S" ?0 u* X
;; If all fields are enabled, don't bother checking anymore.; E7 G' P/ s0 N/ e3 v f' q8 E
(if (/= which_tiles (logior 1 2 4 8 16))
3 D. K" k( q& X# _0 B (setq a (1+ a))6 o' U- E5 Y Q" U
(setq a (sslength ss))9 S8 t; p% v3 R4 e9 y
)
/ @! P4 l9 c7 N )
( A5 Y: {; W1 ]' R: X# ^& J ;; Layer Button and Text Field
! h. q$ S$ Z6 }0 s0 I/ S
" g/ s# f+ W" V6 a' _' F0 Q* s. W (if (/= 1 (logand 1 which_tiles))
$ L% a- _* C$ t. u" W (progn
: L% F; G1 M+ S6 L$ C (mode_tile "t_layer" 1)
, {' f! W& o2 c7 A) s9 z (mode_tile "b_name" 1)
" `& ?+ a8 s- y+ ~ )
6 r2 u) ]: f7 r/ s. W ), l) t6 z2 h" }* v. x
& g- v4 B4 X" E( l! x
;; Color Button and Text Field
' L a, @- E& x J9 y (if (/= 2 (logand 2 which_tiles))
- z& D) n2 b% q5 `8 r9 x2 h (progn
* t8 R: _9 q6 x; r (mode_tile "t_color" 1)% z9 D" t% L$ K$ \$ B7 y0 i
(mode_tile "b_color" 1)
* S7 ^; I( Q$ y9 M0 i7 T& A (mode_tile "show_image" 1)
, k$ N z4 T* v( E- `0 K )
7 a6 [- P# d' N4 u% _9 Q ). P5 H# g6 l2 ]7 b$ c* O
;; Linetype Button and Text Field0 o0 A$ b8 T' d& O* ?
(if (/= 4 (logand 4 which_tiles))
7 @. i& p/ A) h- S. q1 w/ u3 a* z (progn; j/ L! ?( [. ^: w
(mode_tile "t_ltype" 1)
' q+ G' P+ W4 u0 e0 A. i* _6 a (mode_tile "b_line" 1)
5 j4 y7 q6 u& Y3 n6 h4 [ )8 a! T$ p5 a9 s/ ~
) f" b8 ^2 b; J# _* J
;; Linetype Scale Edit Field
6 c3 C/ D$ F0 P K( v/ h (if (/= 8 (logand 8 which_tiles)). d) \8 f) v0 o6 S0 y
(progn
! C1 A( G( K% Q B) n (mode_tile "eb_ltscale" 1) p+ k M5 R4 F$ X
)2 ? b a7 F7 \# E
)/ E' `7 m: z6 y- Z; r% ^4 }" S
;; Thickness Edit Field.
! {3 j1 `2 Q8 L# u (if (/= 16 (logand 16 which_tiles))
6 S. J! h F6 T' w3 ~' d (progn5 W+ S8 Y% R6 |) y- `
(mode_tile "eb_thickness" 1)
4 C- r2 `# `. Y& _ )
' ~8 y4 X u3 p7 ^2 R; o )5 r/ |: k& T2 q+ S% f) h" Y/ G
2 b( B5 |/ T- i8 F" A, d ;; Polyline box and tiles @rk 10:05 AM 1/30/97
6 u- Z {0 J/ h! X: S; z' U) A (if (not (= 2 (logand 2 eflag)))9 A4 \: c J$ ?' p4 z+ G
(progn, \% B9 Z/ [/ k5 m
(mode_tile "text_hgt" 1)3 K: s1 p+ Y$ j1 o# U, g2 R" E
(mode_tile "text_style" 1)$ M+ R0 {0 ^+ v9 C7 \" _
);progn- {7 }/ ^$ W; x4 t
);if& n, K+ }0 K" Q1 V' |9 V" R6 l: o, f
(if (not (= 1 (logand 1 eflag)))1 Q) z+ D& U i/ I% I
(progn 9 E# C: C) m# w( j% O/ u0 v) y
(mode_tile "poly_wid" 1)) u2 K( w8 ~, B" q
(mode_tile "poly_elev" 1)
! t/ B# h# {( k) J );progn then disable polyline fields
. C- L( \2 E3 P& s0 U# o2 d );if
; f$ X) }- W% {4 u5 i: a$ N! [' Z+ y- s" q" |' }9 g
;; Define action for tiles, N1 H" a; k2 I3 S4 p3 p
(action_tile "b_color" "(setq ecolor (getcolor))")9 `, E/ S3 g: K( L! |' s
(action_tile "show_image" "(setq ecolor (getcolor))")1 U0 ?/ z4 l4 `8 b# {, V
(action_tile "b_name" "(setq elayer (getlayer))")
2 x# I: Y; }! d9 z; u, f( P (action_tile "b_line" "(setq eltype (getltype))")
3 \( V% `3 w5 F! V% B. l1 J2 e (action_tile "eb_ltscale" "(getscale $value)")
9 _8 B7 B* M6 Z# Q$ c (action_tile "eb_thickness" "(getthickness $value)")% H* ], A1 Q' p! b4 J
(action_tile "poly_wid" "(getwidth $value)"); ]1 L9 a) l9 N: y% s, z0 m
(action_tile "poly_elev" "(getelevation $value)")
6 T) f7 Q4 N9 r" v) p/ E (action_tile "text_hgt" "(getheight $value)")$ v( T7 O- S' [- S# |
(action_tile "text_style" "(getstyle $value hair_style_list)")
( ?" S ~5 Z# J9 [# ~# W1 `8 _ (action_tile "help" "(help \"AC_BONUS.HLP\" \"EXCHPROP\")")3 o$ c+ ]3 ?, m! l
(action_tile "accept" "(test-main-ok)")
& X+ s i9 H7 r; G; C) U, ]& S' N8 F# q' n( \ o+ S! X o
(if (= (start_dialog) 1)$ T2 X8 c7 Z3 [, ]/ E
(progn
% B3 U h; r- |6 u ; Update special properties for polyline and text selection-sets.# F B# ^0 i* r
" c6 T3 M' O7 @! l" K9 Y (if (and (= 1 (logand 1 eflag)) ; polylines rk chprop) N3 h! D6 j* D: O$ @6 ~" X% U
(or ewidth2 ^6 z$ ]* r4 Z
eelevation: P& q& B3 E- l) @6 G# {% p
);or
5 A: G0 Y- i P8 _ );and. d$ X( n5 t9 N6 |9 H+ x
(progn# u+ l4 u+ T& w, e) s' Y
(setq ss-index 0 2 o( }' s7 `) m) H7 e0 U( j4 Z
ss-length (sslength poly_ss)/ Y& T9 F @! X# K4 B: C7 s
);setq
0 W9 ~# j: g* e0 o (while (< ss-index ss-length)* e; A6 Z0 r( y: A
(setq ename (ssname poly_ss ss-index)
# M$ ^+ _( g8 c7 `8 ~ elist (entget ename)
7 d" p* n) `9 `" A* \/ B );setq; _ \. t& g! j2 \* E
(ucs_2_ent (cdr (assoc 210 elist)));this function lives in ac_bonus.lsp
4 \0 m/ d4 D9 }, V6 C7 Q+ V (if ewidth : x$ l2 k7 Q4 ]" P6 U; U# a0 y( [
(command "_.pedit" ename "_W" ewidth "_x")
7 u' N% [; w+ R# k' E! U7 L: K );if 5 R4 X0 M K5 F: G( Q/ }6 Q
(if eelevation
8 r3 U3 ~6 @6 m1 e3 r" | (progn
1 [! P3 K( ^' ]' x" @6 N! ?. C5 g (setq p2 (list 0.0 0.0 eelevation));setq- f; ` H! z9 u- r3 h$ F
(if (equal (cdr (assoc 0 elist)) "POLYLINE")
+ d3 G- x2 {5 e: Z% `+ F1 V. @ (setq p1 (list 0.0 0.0
& w! C4 A) ~# a- f (caddr (cdr (assoc 10 elist)))
5 K& b- u- l& m );list
% E6 y. n* F3 r1 C+ w5 w );setq# x, Q+ F8 M7 P A s
(progn
) [: e( B. M9 U1 A! B3 J; L (if (assoc 38 elist)
: N3 l4 j" i, s5 I+ k. K (setq p1 (list 0.0 0.09 s/ z# ?7 F# q. O" h
(cdr (assoc 38 elist))6 }! x7 ^0 f' o; G6 k" p g" n
);list
. {$ [9 }! I3 a! S; C' x );setq; t& ]! Z# j6 l! a, H
(setq p1 '(0.0 0.0 0.0))
0 O$ a8 S9 g: Q );if
, r" [' B/ y1 s( ^" _ );progn ! P: H# f* j6 a
);if
1 b' m( e' y! h, T (command "_.move" ename "" p1 p2)$ c/ Q) a, u" Z3 l+ N7 P& S
);progn then change the elevation of the polyline
9 A- r k, Q3 ]0 q" r2 ^ );if
) G1 [5 [+ ~2 a1 }/ Z: G& } (command "_.ucs" "_p")3 R$ e+ K4 j$ `- K5 d
(setq ss-index (1+ ss-index))
# c' V) H3 r( `9 b );while* F5 ?& M. ~4 K3 @" A1 E
);progn then polylines are in the selset7 o& K0 [% W; l( N7 j1 d2 N) ]
);if3 E: \' W( \$ g- j3 i7 U
(if (and (= 2 (logand 2 eflag)) ; text
3 ~0 s- n7 o% C, \% o, ] (or eheight ' { J2 y9 h0 b0 a" O; B3 U
estyle
2 l; N. v/ ~0 M( {' r3 v );or3 l3 v* e( p- g& Y' a9 d, U1 S
);and! Q: ?! m$ w$ o6 ~ _ H3 Y
(progn
& T" I- y8 K* @% H+ V+ G/ r9 q (setq ss-index 0 ss-length (sslength txt_ss))
( l9 \$ U4 H2 j6 D5 ^ P (while
' t, e9 p+ R1 }. Q (< ss-index ss-length)
: U W, p: v+ ?' c+ m F- Z2 C* x (setq elist (entget (setq ename (ssname txt_ss ss-index))))
' P8 r3 b- A+ a/ b5 ~ (if (numberp eheight)7 B" X5 h! Y( s1 K5 e& @/ w
(setq elist (subst (cons 40 eheight)6 ]0 S+ `$ O/ P3 b4 E5 N/ I
(assoc 40 elist)
$ O6 T0 `) ~0 L' ]' Z+ R elist6 Z; w! R" k* {# }) W
);subst( Y+ T' ?7 ?0 O# {4 d' M7 [: I
);setq
$ w. j# u. M$ x );if4 \ B5 v1 |9 l) \( b3 L1 d: v
(if (and estyle ;(not (equal estyle ""))
/ G- t& U! @3 ]/ x (not (equal estyle (cdr (assoc 7 elist))))
% m& h4 Z" U) G; u );and3 h9 X7 o4 g5 H- m7 N2 m
(progn
& z: c# _9 M# P ;rk. This needs to be implemented as per mtext font issue in ; ddchprop_notes.txt ! e1 U! R+ G' r1 s
;(if (equal "MTEXT" (cdr (assoc 0 elist)))) h* e+ | s5 S. f% ^
; (setq elist (fix_mtext_fonts estyle
% I# c: g" ~& t% B ; elist- |' d- {" O8 r: j6 B6 F" |: K
; )
5 z# o. {- Q6 F- P7 d# v! M ; );setq then# y. D5 e; P7 W# h7 e- r
(setq elist (subst (cons 7 estyle)
! Y% k# q9 N3 y9 G. N (assoc 7 elist)# k4 y( \2 m. D' d
elist, f; L/ b) Y; ?5 M( E& |! H
);subst
/ d* `9 ^$ }) n/ I+ Q, @ );setq else8 q F+ ?/ @1 b
;);if 9 f! x9 t( [ X Q/ O& p1 o
);progn
! O0 I) E& y$ U7 I2 v! A );if+ f% p0 K0 Z7 E: q3 M" C H
(entmod elist)
* F) B" M* D" A0 r (setq ss-index (1+ ss-index))% I9 @9 I2 b- c- {# V6 N
);while7 ~1 V* V7 S( b, t7 K+ x' c j: N
);progn then
2 A7 ]7 U- N; o2 G* d );if; I9 B0 c6 o* P- U
1 {( P- |. [2 K, d3 i9 X (setq cmdact (getvar "cmdactive"))
" r/ e; L3 Q! g4 I8 I (command "_.chprop" ss "")! B' H# {& w$ a2 T
(if (/= cmdact (getvar "cmdactive")) ; Is CHPROP actually running?
& U" P; {5 @% z (progn
$ d K7 h6 M$ T (if ecolor
9 y. v( ^$ Q2 g8 j4 o1 d% s, F (progn
: l4 G. L1 r8 V* ~ g; ?% I* | (if (= 0 ecolor) (setq ecolor ;|MSG0|;"BYBLOCK"))4 H! ]+ K& g5 T/ J* k; s
(if (= 256 ecolor) (setq ecolor ;|MSG0|;"BYLAYER")) ^' N; H: F$ J) S. t
(command "_c" ecolor)4 x1 A7 q) N- p+ P7 O) Y/ a. _: e
);progn then
3 ~" ^1 N H' ]/ A3 Z )
8 i3 p1 X5 ]5 ?4 G9 t (if (and lt-idx0 i4 `6 k; b4 D! c7 @
(/= eltype ;|MSG0|;"Varies")
) e2 l' T7 u8 W% i. l$ J, O# M )# |/ r. t* X1 w8 n* y
(command "_lt" eltype)& o. a R) m! k6 L2 l
)% c0 s* U$ I$ U: O
(if (and lay-idx " m3 @! ^* B. t* R
(/= elayer ;|MSG0|;"Varies"), J; l1 n2 Q1 N( `6 E
)8 b0 k' b, Q& k. p
(command "_la" elayer)8 j6 Z1 O) }/ ^6 s T! K6 `
)6 u1 U: Z6 V. J+ x6 S4 q: {! M
(if (and ethickness ; F- a* [' `, I- T
(/= ethickness "")7 M2 P9 k- n9 @
(/= ethickness "Varies") 6 S3 u0 T+ H3 L1 p5 B0 u: o6 [
)
& V# h. c$ R: G6 D (command "_t" ethickness)& a) n1 s6 s1 m
)1 m" M% w7 P5 j2 w3 h. ~
(if (and eltscale (/= eltscale ""))
. Q, |7 q, A* [& M; v$ ] (command "_lts" eltscale)9 x7 ~. [; Z" h7 F# i1 b
);if9 A3 }: K* I: @ G+ R1 C
(command "")4 z; S M. Q! u1 [- q$ O
)
+ M+ ?8 u" p1 D (princ "\nProperties unchanged") ; CHPROP didn't like our SS set
; `8 Y$ }" |, U1 x, [- r) d. H )4 B; g# D/ S8 t; x
/ o+ y0 b( X+ R' R! s7 `
);progn then OK was picked in the dialog.
0 {; i5 ^/ o q) s ?! f5 {8 X7 _2 M
;; Fred GERBER - 25-AUG-94' ~/ F$ [5 c3 r3 H! c( D& ?
;; Don't print the "Properties unchanged" message when the user cancels
6 J8 u8 r- k- W2 |. x1 w3 s: g ;; the dialog because he knows that already (otherwise he would have
( _; u5 x; \9 G% |: _% j$ F0 S ;; hit the "OK" button). Display the message only if CHPROP fails for+ @( C4 `; D3 z" _9 D z. Q
;; some reason, because it is not the expected behavior of the command.- @0 \5 G% D8 m/ C! ]& ]# M$ J
;;
`/ p% \) W0 j- ^ ;; (princ ;|DDCHPROP2_LSP_8|;"\nProperties unchanged"); m7 b" W, o5 V v5 n
);if
+ U8 M( y) o4 n8 l" ?; C4 C7 M (princ)
! X ?0 J3 v4 }2 r- ^$ K+ a+ v% e );defun call_chp2
$ J8 L- S/ O7 r! a( S, g# Z ;; ~! `9 t) s- p1 B& B- F3 g
;; Function to set the Color text tile and swab to the current color value.
+ l0 H8 C' @+ P& k% f$ F ;;2 @9 X6 I& ~( h; u4 b, j
(defun set_col_tile()
& R ?9 p+ a' A/ l# B2 f (cond; n8 T% M$ h% C8 `( y+ L$ z: _
((= ecolor nil); @$ ~3 i4 b, e* w# q1 f+ o7 T1 o& _
(set_tile "t_color" "Varies")7 e7 ^ z; i! C w* `9 w) j. z
(col_tile "show_image" 0 nil)
1 I# q: |4 I, N0 u q7 \; v )- f6 Q) A4 k6 }
((= ecolor 0)
3 C3 ^0 Y6 H3 Q5 ?. y6 r3 D (set_tile "t_color" "BYBLOCK")
8 ^* F6 i7 z+ |& `! v (col_tile "show_image" 7 nil) ; show BYBLOCK as white
9 d; I8 n/ N4 g& n/ j )
; I1 b; [0 f* N: G: b% e' N( W# O ((= ecolor 1)8 `! [: q; E% t' @& y4 F
(set_tile "t_color" "1 red")) \' M. I% a& `3 h! F9 Y) w. M
(col_tile "show_image" 1 nil)
0 A) \' [2 y- e% _% d, m; K& S( P! P )
) P+ k' G/ r9 T7 M# F* i3 ~ ((= ecolor 2)
8 g) v- n' _& x+ B8 V% K0 l (set_tile "t_color" "2 yellow")
& W$ i0 K1 ?. M" ~% g (col_tile "show_image" 2 nil)
. {. A$ L p- l4 E1 G- l# h9 g )
5 m- w. q& o0 C5 o+ k: _5 ]+ i ((= ecolor 3)
' M' n2 ]% o1 U% Q" c (set_tile "t_color" "3 green")0 _ H$ r, L6 \
(col_tile "show_image" 3 nil)
3 E$ \6 f9 o8 A8 V6 ^ )% W. L; p# o9 h" X+ h& f9 E9 ]
((= ecolor 4)
' c3 m3 [* e3 N U5 ~# i7 W8 Y (set_tile "t_color" "4 cyan")" W/ i( k- S. D9 ^ d) N+ D/ t1 B
(col_tile "show_image" 4 nil)
, L! T$ a6 t, T1 Q )* A$ i$ {& L5 a" T; @5 Z
((= ecolor 5)
5 P N4 T `+ @- S% j (set_tile "t_color" "5 blue")
, f9 s$ E# W% Y (col_tile "show_image" 5 nil)
/ Z+ y8 c: F; z u0 x8 v )
0 [) g F! L8 O3 ]/ G: H ((= ecolor 6)% {( E' B0 l9 z7 s* o5 o
(set_tile "t_color" "6 magenta")
3 g7 [2 U8 [) A7 n/ V0 G (col_tile "show_image" 6 nil)4 X, u$ C5 U, i9 u# a3 P
)& m# G# ]6 K2 ]
((= ecolor 7), L; {6 L( u/ K" Q% z
(set_tile "t_color" "7 white")
7 M& B# [# z8 F5 Q4 ` L$ k (col_tile "show_image" 7 nil)8 c9 f1 \+ |% R% c: o. {
); |6 T f/ r: V, Y1 I5 y
;; If the color is "BYLAYER", then set the tile to
1 Q9 X9 ^- X/ V2 U, F ;; show it's set By layer, but also indicate the+ a* m) P! g$ y" D7 N, Y. i5 ]
;; color of the layer - i.e. By layer (red)9 a. V! x6 H3 @- |1 j$ }; K* a
((= ecolor 256)6 U1 L& m7 U) Z/ k T& A% G( e$ W
(set_tile "t_color" (bylayer_col))
+ R+ b; {+ I; c- d (col_tile "show_image" cn nil)
' T, j, s/ m7 f! Y0 N )
. J: j7 o) _; | (T
! u/ J* C z6 A% m. [' a4 K- E (set_tile "t_color" (itoa ecolor))6 U. P6 |0 E; K# w! l3 Q" ?
(col_tile "show_image" ecolor nil). V" o2 A7 q! c( V; a5 M: m
)
* y: y% V- U T. p3 g/ V6 g/ s )
4 O8 V- T5 | K )/ Y( ?9 _1 Z& z. S
;;7 x5 S/ e, `& X# K0 T: X
;; Function to put up the standard color dialogue.' e$ w# P9 X7 ~/ ?5 O% X
;;
1 w# k! s8 A' n: S (defun getcolor(/ col_def lay_clr temp_color)& A& }$ u! ?2 f9 N( q T4 P
;; col_def is the default color used when rq_color is called. If ecolor! d* a7 ^$ o( h3 m+ X
;; is nil (varies) then set it to 1, else use the value of ecolor.6 E% T( ~9 u6 B& e( t
(if ecolor/ U' f8 W: Q L( I8 Q8 X6 o
(setq col_def ecolor)3 U' N# z2 N8 W! @/ Y: J; @
(setq col_def 1)
) ~. S2 A+ ^! b4 q )" {3 M/ d% |+ j) o5 k
- r5 ^$ ~/ W+ O) l% C2 b
;; If we're working with a single layer, get its color
; f+ w* ]; B1 M. S$ l ;; for use in the color swatch if the user selects color BYLAYER.$ D( Q& V/ W3 I4 ]7 B. `9 s
(if (/= elayer ;|MSG0|;"Varies")# p" Y& t# L, `% V2 x
(setq lay_clr (cdr (assoc 62 (tblsearch "layer" elayer))))
. t' ~% }* K2 L; | (setq lay_clr 0)
( O$ m$ E9 I- C/ z6 }% o4 K )% Q0 W- u( w1 M3 ?, X
(if (numberp (setq temp_color (acad_colordlg col_def T lay_clr)))" Z% n9 h/ g/ ]# o$ s! p7 V
(progn
( i* m s: k v( d2 Z+ m8 |' E (setq ecolor temp_color)% d8 F/ K+ i- N( X
(set_col_tile)
0 ^5 v6 E$ p/ h' ? ecolor
) X3 c6 v! G( z4 ?9 H! N& D( B )
, U: H9 \. j( W; ]1 t0 j3 c ecolor
) w# z" l/ S$ m5 A7 {, d: n )
, f. o" f, e! }% {: m0 Q% j _5 {: U )
* m% {7 R" @! Z ;;: t) S- F/ _! q1 Y/ m
;; This function pops a dialogue box consisting of a list box, image tile,6 t' e+ r: K2 W4 \6 p
;; and edit box to allow the user to select or type a linetype. It returns
( |" V% T1 J# \, `( X% m( B ;; the linetype selected.
3 ^; B% u, R3 B I$ r% R% m7 N ;;
! k- ^6 P6 } X q (defun getltype (/ old-idx ltname)/ S# L; Q1 {0 b& L
;; Initialize a dialogue from dialogue file
$ c9 n/ \& M7 P* f (if (not (new_dialog "setltype" dcl_id)) (exit))$ Q- t6 }3 e/ w, ~4 U3 }; U
(start_list "list_lt")
9 y8 C/ W% J; {9 H (mapcar 'add_list ltnmlst) ; initialize list box- w. V( t1 s9 y4 C O6 i3 S: h. e
(end_list)% I3 Q9 _- J! U+ `& |
(setq old-idx lt-idx)
: h) E/ x& Y7 X/ j+ ]0 y ;; Show initial ltype in image tile, list box, and edit box/ y* b; ~+ ^6 }- E" |: p
(if (/= lt-idx nil)" ~1 P/ @* J8 T' Q- e
(ltlist_act (itoa lt-idx))! [5 p0 h. i; S0 }" A0 ^
(progn
. M) M( o$ d/ K. i) n) v+ K; F (set_tile "edit_lt" "")3 y5 l$ H" |% q- r' @
(col_tile "show_image" 0 nil)! Z3 P' h4 `$ ?
);progn else
! X/ G$ B1 G+ |1 O7 `6 H* {8 c );if
& q' f3 \0 _4 ^! t3 [ (action_tile "list_lt" "(ltlist_act $value)")5 f* r' F: _) W( _7 ], _
(action_tile "edit_lt" "(ltedit_act)")0 y0 ]& T* R) |* E% y
(action_tile "accept" "(test-ok)")) D: g1 t* e! ~+ I) g8 ^
(action_tile "cancel" "(reset-lt)")) U. d; E1 b5 G* W" |1 ^
(if (= (start_dialog) 1) ; User pressed OK. ]+ D+ v4 F/ z: P2 {
(cond
5 H7 `- e+ y& f0 r5 O2 n ((or (= lt-idx nil)% v$ R! C* X; z+ R* f
(= lt-idx (1- (length ltnmlst)))
" U# |8 _: X& C# D: @. A );or
$ k1 ~+ R; ?4 A; x" v (set_tile "t_ltype" "Varies")
) S& D! f* U0 }; Z& w' N* y% t! Z ;|MSG0|;"Varies"4 ] W" K0 J3 e' o% v
)
8 i ?4 V; L7 y5 l ((= lt-idx 0)7 P8 h2 p# X) o! e$ ]& \
(set_tile "t_ltype" (bylayer_lt))
! @7 ^& C8 w: F5 @- @) i; v v ;|MSG0|;"BYLAYER"+ B* K2 D' ]6 L- P$ i
)& i( z, f# V& w5 K
((= lt-idx 1). i: c) ?3 h/ \/ e4 P& Q5 ?1 U
(set_tile "t_ltype" "BYBLOCK")
! l9 L Y: h0 [& N ;|MSG0|;"BYBLOCK"- { _& |. l: s- ? M
)0 G4 { [* l I9 [
(T
. Y5 O/ t1 `8 _9 ~3 ?& K (set_tile "t_ltype" ltname)
: K1 n% O9 C. t7 U' l3 |3 j ltname
) F4 Q( O( k% z5 C: l0 m' b1 Y$ r7 G )3 @5 v# H6 ?7 T6 W0 d
);cond then* g' u. n3 R* ~. R* l
eltype
7 b2 v4 G+ u6 c6 p1 H- a& u );if
/ d9 E* @' t, k7 w5 p/ R );defun
% T( P+ Q7 e& M, ?& j ;;
! ?, E3 _# Z# ~1 S" I. |6 @ ;; Edit box entries end up here( ]; w3 Y L) E1 k4 y" o7 \1 F) D
;;3 }. G0 S6 R, R2 ~* }1 e
(defun ltedit_act ( / flag)8 v/ L6 T2 V1 j$ c$ S
;; If linetype name,is valid, then clear error string,6 N5 h1 F: K0 U6 I; x1 x
;; call ltlist_act function, and change focus to list box.
& v- _) U; ^/ Z& T z( M ;; Else print error message.
. X2 x# x- [6 |9 ~ U8 ?* V
6 `( C3 d9 s0 |& v% ~ (setq ltvalue (xstrcase (get_tile "edit_lt"))). ]3 @/ L: w( b" C5 g- `8 H
(if (or (= ltvalue ;|MSG0|;"BYLAYER")
* S; ?! G2 A5 {& l (= ltvalue "BY LAYER"): m9 k/ t, O; ~9 A$ N' S
)
) |9 L; W! Z5 u" e5 m (setq ltvalue "BYLAYER")
# Q! g1 G" M* y) N )1 R4 x4 g: B+ r0 ?0 K
(if (or (= ltvalue ;|MSG0|;"BYBLOCK")& x. N' S {. N
(= ltvalue "BY BLOCK") B; X& a% O1 E' Z5 O8 c4 c$ f9 T+ V
)7 i; C5 @& A, ~
(setq ltvalue "BYBLOCK")
5 F; `! B2 i8 d# Q4 N" o )
! f. Y- q# w) [2 W, {8 @0 z- C (if (setq lt-idx (getindex ltvalue ltnmlst)); D+ B. \$ }3 J4 p& Q+ H) Y
(progn; n% V v# u7 A6 q* a
(set_tile "error" "")
, B1 A* M2 t ` Y (ltlist_act (itoa lt-idx))
/ d2 M4 D: C3 q" ? ;(mode_tile "list_lt" 2)
) B( o. Q* g) ~. B8 p6 ^* @8 e );progn then
( }* [2 B) D+ L5 u. d3 j* u (progn
2 R$ i" a& P& @! ~# Q (if (/= ltvalue "")/ s. O3 |# I& r; N! c& S+ X% @
(progn
3 t5 t& |4 t# n; R# j (set_tile "error" "Invalid linetype.")
. h. A3 K- P0 p% Z9 `9 e (setq flag T)4 d, ~6 u K$ [/ O7 E( {
);progn3 m7 m% V! u& ~; n/ [6 a3 B
) P) D5 ^5 M) ?. N* m8 |) u- y6 L
(setq lt-idx old-idx)
7 {% L# X' |! J0 R5 [1 ] );progn else
- z7 [# R( K5 `+ K& \) k );if7 ~ p6 u2 t; t j& ?% O
(if (and (not flag) ;added so a return will take you out of the dialog. l0 O3 e- p/ P3 D/ h! ~' Q
(= $reason 1)2 o- Y2 r t' @& F6 L. }, y
);and
1 |9 X* N, X3 p5 D) L (done_dialog 1)
, N l' l& K, B' t2 N7 j. ]9 J );if
. m" ]5 D% i* V5 ` );defun ltedit_act) C8 X9 h: `3 z7 f0 U
;;
% o2 y4 k' s* U3 `2 j" Y ;; List selections end up here
$ q& o8 K3 m0 a. I8 U ;;
2 p6 ?: z& x! D3 T (defun ltlist_act (index / dashdata)3 m8 X! [6 b; ]! Z" n
;; Update the list box, edit box, and color tile. L3 d. d2 _1 C, e) p
(set_tile "error" "")
2 u5 N; m0 m" ?( f; L (setq lt-idx (atoi index)). }7 d+ r9 o1 `/ }9 g' j
(setq ltname (nth lt-idx ltnmlst))8 b3 X9 v" E& l! m
(setq dashdata (nth lt-idx mdashlist))% L+ Z4 j* I; \+ [8 h& N1 Q
(col_tile "show_image" 0 dashdata)
( M. I( V9 t8 R6 e (set_tile "list_lt" (itoa lt-idx))
; d( @1 G a9 o. A- g: K4 T0 {# H4 c (set_tile "edit_lt" ltname)& X. R: Z" |% \6 N& S2 ~$ t2 |
) Z: X# h, |1 g3 z* f0 P/ w
;;
! I, f; v/ W* h2 C ;; Reset to original linetype when cancel it selected
8 Y4 J3 {% K, b% c) ~5 p# _2 @: P/ N ;;
4 G; i2 G/ U( G$ L' \) f (defun reset-lt ()
! a% v5 I* r) U4 n6 C7 n7 o' v (setq lt-idx old-idx)
8 L4 ~& z: p; ~+ `+ N! Y (done_dialog 0)% A2 p' P, C2 \
)' I7 R% P9 k5 g9 q, x0 R( {6 R. x& S
;;+ p2 `7 d* D6 x. [% d
;; This function pops a dialogue box consisting of a list box and edit box to( |9 ?) _4 ^. o( g
;; allow the user to select or type a layer name. It returns the layer name( d _) ~3 @6 g4 s0 ]
;; selected. It also the status (On, Off, Frozen, etc.) of all layer in the
m% M* p' C" g) E ;; drawing.
. W2 |7 l5 g5 {$ L- y3 `0 W ;;
+ `1 ?, H, z6 F, Y: C! r4 g! G, ^ (defun getlayer (/ old-idx layname on off frozth linetype colname)
& n) |; k! H4 W9 `' l ;; Create layer list the first time the layer
o; [8 C6 L! I' H+ s% s( s ;; dialogue is called.
3 b3 u, N5 M9 ^* k (if (not lay-idx)
0 K. T3 h6 U$ D% F; m (progn4 o7 K! b4 s/ ?2 L& H" _
(makelaylists) ; layer list - laynmlst' J2 P5 }, J$ J6 D
;rk2 v! r8 S& L! h7 k
(setq lay-idx (getindex elayer laynmlst))) F( i% R; N" d
);progn$ B9 i% T2 Z" Y' D" c+ T* {
);if
3 h4 ]; ?( W! R: y
) r/ F. E9 m0 J2 B& h6 K. _' M, J+ E ;; Load a dialogue from dialogue file
; x* I J6 g8 y8 T (if (not (new_dialog "setlayer" dcl_id)) (exit))5 t; g& f& K/ ~0 f- z
(start_list "list_lay")
6 ?4 J* q' J9 a, e2 `9 O (mapcar 'add_list longlist) ; initialize list box2 W2 F8 K8 l4 B! r# Q4 f% c
(end_list)7 x& T7 v1 P) t" u* `: B. N, O
;; Display current layer, show initial layer name in edit& q- N' e5 E0 c1 o% P
;; box, and highlight list box./ ?) Z& N# ^: B1 G3 A N$ |
(setq old-idx lay-idx)9 b3 F# Z7 I5 c4 K
(if (/= lay-idx nil) (laylist_act (itoa lay-idx)))/ \# r; R% `' D: f
(set_tile "cur_layer" (getvar "clayer"))
8 V, X& L* V+ J8 E (action_tile "list_lay" "(laylist_act $value)"), }7 g7 t; Q' H3 E8 |; i! K6 |
(action_tile "edit_lay" "(layedit_act)")- V c+ H3 c: ^; h1 W: k
(action_tile "accept" "(test-ok)")
7 {: e" ~( J) n4 Y2 J (action_tile "cancel" "(reset-lay)")
1 m3 {" W* x8 t3 ] (if (= (start_dialog) 1) ; User pressed OK) a7 x5 f5 z0 [. Z" H; u
(progn& k" P4 ?5 u& ]0 _8 E
(if (or (= lay-idx nil)
) t: r. I& z8 H! w/ J (= lay-idx (1- (length laynmlst)))
" a% A, s5 x! Q: B h );or8 I s* K6 r; W# T1 `- V
(progn
" }6 V- C8 W% u4 r" ^; G (setq lay-idx nil) ( p' l. }6 L" J7 W
(setq layname ;|MSG0|;"VARIES")
& K: e+ ?: [. Z1 c- N. H3 S (set_tile "t_layer" "Varies")
0 b7 e9 z* Y& i! b& I4 h0 J (setq layname "")% U h) m- o8 q
);progn4 L6 o! i d3 P( o3 T/ l
(set_tile "t_layer" layname)
% ?5 T) B2 x( {8 u9 j6 l );if4 u% S4 ]4 q( K) j0 ^* @( k
; If layer or ltype equals bylayer reset their tiles1 e. b9 V. j; q5 a0 W0 M
(if (= lt-idx 0), ~& U$ S3 S. T( `$ L4 w0 O; l
(set_tile "t_ltype" (bylayer_lt))
4 e& T% T( q6 |+ D% ]) v9 e );if
0 s, ?5 l" R: _3 E4 H" G: m' S. g/ C (if (= ecolor 256). o6 B, f9 I( |, _
(progn( j1 P# H" X' X' b" y
(set_tile "t_color" (bylayer_col))
; @& j% h& |4 O6 J4 U! o" ~ (col_tile "show_image" cn nil)
) v8 C+ {4 n1 U )& s( e c7 W: R( f; t8 a
);if
1 e% |7 n+ J" r, W/ a layname8 C" ~9 Q7 {4 |4 c4 g Z
);progn; A9 M$ S e5 f5 Q2 a/ L) @
elayer
K) \! [( V* {$ U6 ^' T );if
1 K/ J$ K- S5 v$ `. Q' b )
( }# R+ t5 L9 q- X8 P' \* U$ v. o ;;( A+ x$ f4 c* f
;; Edit box selections end up here
+ J% H+ t8 k. M6 z% g ;;
. s. D6 g. m2 d" m5 E" v (defun layedit_act()6 X' Y. l8 t* k5 s1 |4 p
;; Convert layer entry to upper case. If layer name is2 `( S3 u( Z9 \; T3 q L
;; valid, clear error string, call (laylist_act) function,
6 o. R2 [% h% l5 W0 F, |4 J ;; and change focus to list box. Else print error message.; |0 t7 j0 }/ n2 p6 F1 X; r
(setq layvalue (xstrcase (get_tile "edit_lay")))
* \- r4 r3 \) t4 f" v y- x1 X9 j: Y (if (setq lay-idx (getindex layvalue laynmlst))
g' N+ Z$ `6 K" P2 M. I9 J (progn
1 P, y) J( L1 ~; u# \) l! S6 m (set_tile "error" "")
/ ]3 U* ?! A/ O& r5 M+ R4 } {1 \ (laylist_act (itoa lay-idx))
+ i; U- Y, a1 W' M8 Z )+ P$ |% }1 K) ~/ h: F4 g1 c
(progn( `6 h! g( u q" K- L1 I
(set_tile "error" "Invalid layer name.")
; l5 U+ F- G! F1 y" D) V (mode_tile "edit_lay" 2)! b5 m! A2 n4 d4 A% X! S3 h0 L) W
(setq lay-idx old-idx)
6 Q _) z9 Z( P )
: j8 z7 Q/ P% s) |( A );if
: A* L- h) T! m+ ` );defun1 i8 x% G; s% L
;;. u- o7 H5 H8 ^ ]
;; List entry selections end up here
3 U" \' i0 X, u ;;
j; a2 ]& Z8 c; }6 w0 { (defun laylist_act (index / layinfo color dashdata) x( i7 J; A8 T' b# o k2 i
;; Update the list box, edit box, and color tile/ A7 X9 I/ Z; J5 V
(set_tile "error" "")
. K2 x3 {) i q* \9 Y# Y4 m* _3 W (setq lay-idx (atoi index)); O( y! j- B/ M" o: t& T$ B
(if (not (equal lay-idx (1- (length laynmlst))))
c; v6 U Z, z m8 X9 ^: `( L/ F (progn
4 _/ t+ `4 {4 s9 J/ @ (setq layname (nth lay-idx laynmlst))( u* b+ R6 w4 i- u8 L
(setq layinfo (tblsearch "layer" layname))
+ s- t* y( ^" o) A2 P, {* ] (setq color (cdr (assoc 62 layinfo)))
2 D4 W* X: s3 t (setq color (abs color))
# Z" y; `5 \; Q5 `" v (setq colname (colorname color))
; ?" e' ~# ], V9 i- N- T3 U (set_tile "list_lay" (itoa lay-idx))/ i4 l+ S3 h7 X! j$ l
(set_tile "edit_lay" layname)* a7 N+ D# {0 _# t
;(mode_tile "list_lay" 2)
G" m/ A( R: _- n, x+ Y8 r );progn then
S6 x+ t2 \- w/ b1 p" u. m (set_tile "edit_lay" "")
$ N( R4 S# c+ e$ B5 Y9 z' l7 k# R. X );if + J: B3 s) j2 Z1 j5 t% f; D4 h
);defun laylist_act, s# d" q! E* ?% D" V ]" Z( X
;;9 \/ p1 w, H: N0 l* |
;; Reset to original layer when cancel is selected) L+ m; r" X: y% }. H; M4 u3 R0 L
;;1 d8 `% c4 k( L" s5 f$ m! d8 g
(defun reset-lay ()
. F0 X0 C5 n' b- T! h (setq lay-idx old-idx)
5 [+ X* B, k1 e: \9 z (done_dialog 0) N4 M% c! C: t j' N
)4 R3 F2 _2 \: S9 K( C+ [
; n' V0 q2 c$ G& ]' A4 Y
;; Checks validity of linetype scale from edit box. It checks to/ }* ]- b; z3 F' |
;; see if the value equals "Varies".
; u& K9 P$ ~8 Q: \: ]& n# b
0 R# p! e( a/ {3 j0 I (defun getscale (value / rval)0 z6 s0 h h/ F+ ^: J
(setq value (strcase value)
7 U, Q% r# f# d) c rval (distof value)7 S3 g" W$ k- v7 Y
);setq
3 u6 N. G3 m$ }. d1 K (if (or (= value "")
/ ?+ E4 t: x7 j (> rval 0.0). }6 T6 H& o# {5 b
)
7 `8 E: D: B- u) t( J0 w; E (progn7 |# B) l+ q2 w& W
(set_tile "error" "")" X3 O& y9 ?' F+ M9 z9 p0 j
(if (= value "")
" o5 }/ [! G1 Y7 W0 Y4 r9 ~ (progn
* c1 b- ?" Y V/ e, Z, D (set_tile "eb_ltscale" "")
# j6 Y' q* `! Y* o (setq eltscale nil)& b0 r8 u0 J0 b5 Z5 I0 ^/ p
);progn then& {$ v2 s& X) V1 X+ n. T+ U
(progn, P# y; m3 ]8 ?- t
(setq eltscale (distof value))
5 h' p4 z! Z' h3 H: A (set_tile "eb_ltscale" (ai_rtos eltscale))
" E9 i+ D7 w7 b1 G: o8 Z: v9 d) K eltscale
6 Z3 P5 t/ S( o$ | );progn else
; `6 d- K7 }) ^( Q. F) r. I );if$ S$ \( M0 j/ o1 k+ K) G8 D7 C
);progn
; P5 I- f, b) j( S7 j (progn; @/ g2 ?8 B$ Z/ Q4 D
(set_tile "error" "Invalid ltscale.")
2 H) s, m9 ^8 \ nil/ z' C3 [, d Z( k) f
);progn else2 J ?$ @) E8 W* ^1 z6 q( Z" Q
);if3 Q+ Z) S8 P% ^1 f2 ~- [9 S) }
);defun
; _ c$ @" c. f6 K2 j ;;: z, ^5 X6 }8 p# v, E" I
;; Checks validity of thickness from edit box. Since (atof) returns 0 when a4 D N/ L: y- `
;; string can't be converted to a real, this routine checks if the first1 }" |3 d" y: m4 X: L8 [2 D
;; character is "0". It also checks to see if the value equals "Varies".
( h$ K) h" y, e4 g1 L5 _ h- Y. @% Z ;;
. m- J3 f- X1 r# C7 o (defun getthickness (value)
* p# b4 q3 a9 J (setq value (strcase value))
) B! d: a9 E G9 B& _ (if (or (= value "")
3 d/ M0 h, m3 v1 }' l (distof value)
" o' t: V+ R3 s& G );or/ E3 u! y( O: C6 m6 G- ]8 l$ _
(progn9 Q s9 @ u9 R2 j4 b* O
(set_tile "error" "")- ?- g$ Z$ D$ }! c( Q0 `
(if (= value "")6 ^: g4 r/ A; t; w+ j4 U: q5 I
(progn
; x+ e4 z/ g$ i4 K (set_tile "eb_thickness" "")- q, p. T" C" |& H0 T- {" ]9 Q1 T- I
(setq ethickness nil)
; [! Q, p: g' \% d- v3 C3 D! Z' v );progn
% h* _7 B% {$ I6 @8 d( Y (progn. s0 z% |4 B! Z: M# M
(setq ethickness (distof value)) a; R# f) a& Z7 U4 ?
(set_tile "eb_thickness" (ai_rtos ethickness))
* k3 S& K! v, `* y- b, a ethickness
. S/ H9 u, z6 Y! X8 y* S );progn4 E* @9 O! F; R# o. r) _( x& P7 x
);if. c9 C) ]- G9 T2 z- N& l C
);progn3 D1 r/ I: I8 W" C
(progn) L x0 x9 W; X& C# N2 F9 k. p! f2 E
(set_tile "error" "Invalid thickness.")
' o, O$ G$ K7 @- q- R7 ~' { nil
/ i5 p. ~1 h; v$ ]: T2 K9 J! c );progn
9 h9 Z) }2 ^. ~! J1 I' ?4 k );if2 J7 {: s6 A8 @
);defun
& Q3 k8 A* G* i6 V0 ]% W ;;1 b! d" r: V2 o
;; Checks validity of polyline elevation from edit box.# \0 S" B$ l% D0 d/ r: K
;;
, f8 i$ e* O# Z1 O% ?2 Y$ j7 k (defun getelevation (value)
- B) o/ p+ v/ v& R" ` (setq value (strcase value))
9 b6 j. U; x1 b (if (or (= value "")
8 y+ R& ~7 t# p" s (distof value)
# O% Y) p0 U( t2 ^6 s" N )
* R" q$ i: a6 b5 x! @; Z (progn
; `- B1 p/ f1 ~9 b% k; k* E (set_tile "error" "")* [$ G3 P" {% x' M" p, {* R' p
(if (= value "")
* C. m6 w+ L0 | L (progn
" ?- U5 S5 H+ ?# ?7 ? (set_tile "poly_elev" "")" `+ q) m% @ v0 y) A
(setq eelevation nil)
; z* |* h% K$ f& B0 q1 C( [ );progn- Z9 Z3 c8 e' X
(progn
6 M5 m$ A2 x6 [+ A' `2 @ (setq eelevation (distof value))% x# r* B4 \- ? o. o
(set_tile "poly_elev" (ai_rtos eelevation))' ^& Q7 ]3 Y0 Q* i2 V( {9 ?
eelevation5 Z" V u7 n, p _5 f8 P
);progn
9 v2 j+ U0 x5 a! t0 Q$ L );if2 t( Z+ r( G: E" \5 B+ X5 ?
);progn4 u' U" t$ n; O
(progn
& ]! c; C, K; o- z: [ (set_tile "error" "Invalid elevation.")
9 r/ X% Y! q$ F" ?' c nil. G0 ~ J6 t9 Z9 q) V
);progn
$ j0 v, [7 ]$ ]& q: X/ H" g* C );if
; F% q$ [- u7 n/ i& G( y );defun
. c4 f; t2 t. ^9 l* q5 F ;;
" Z; `1 L! G) t7 k+ R7 _2 ~; w ;; Checks validity of polyline width from edit box." X/ q1 k! S" c$ y6 j. Z; H1 `
;;
, v# [' ]6 ~: d1 C( e (defun getwidth (value / rval)6 G1 k+ g! b, v
(setq value (strcase value)
- A* \- u0 N2 X4 P# s! V2 Y rval (distof value)
1 Z2 I5 g* `+ v. x( N$ ~ S) L5 H )
6 T% O; b" y: z( ]% G' q (if (or (= value "")
; d3 H+ |% w ]* g (>= rval 0.0)
. [6 N3 {4 ?( A! |; c6 s )
% ]/ a- g+ Y, P% ^ (progn2 @$ R% |8 }- U" R1 C
(set_tile "error" "")2 s) V! n, @/ I1 a. i8 L
(if (= value "")
( E" j* D/ v* S/ P7 l* H, } (progn7 J7 `$ w6 C) I* c1 ?4 C6 C
(set_tile "poly_wid" "")
* x$ e3 `4 ^5 {9 c9 B+ G# l, o (setq ewidth nil)- T6 R' J$ [! l' v
);progn
8 H, K v |! ^( d. T (progn
7 W" T4 Q* E. q5 V (setq ewidth (distof value))
4 S9 z5 P1 F* Y6 n Z (set_tile "poly_wid" (ai_rtos ewidth))5 l( N- l" t3 T9 Y7 o0 v
;width
6 c7 i4 A2 r4 T/ S! C W/ o );progn/ x" v4 t9 A3 k) X R
);if1 O c/ t! ^( x+ u
);progn
) ]1 W0 i7 c4 j+ y' ] (progn7 w6 t* @) l# L
(set_tile "error" "Invalid width.")
5 F0 o7 H1 d( p0 u* E# k$ _& P ;(setq ewidth nil)0 x" F4 X( E. X/ P k/ A0 Z$ m
nil
2 W s) g! b O8 t! Z8 c; e );progn4 v! r* \, X: }8 i/ o2 x+ s% x
);if
5 ] q {( X9 Y; J );defun
/ b0 r1 A6 g. c8 Z6 T2 l ;;
( g3 n8 I" _1 M% q* l: u ;; Checks validity of text height from edit box.# l' q& s7 e9 Z4 g) u0 X
;;0 [1 c. ~) I' E& ?
(defun getheight (value / rval)8 N7 |' u- s# Y" c H
(setq value (strcase value)
1 N4 x/ g" j" G5 u8 K! t. J4 o0 O rval (distof value)9 ^$ t @' A/ G0 i$ D
)7 ^7 Y, d( N. G4 [2 S
(if (or (= value "")
3 I0 [- L( D) u# V) s (> rval 0.0)& ~8 U1 D2 W3 Z1 X/ V6 J1 E1 {
)
# u3 `7 d8 v4 m! x6 d) g6 o8 L% `3 a6 k (progn. f5 j4 _' m, J" I8 w6 N; p- a
(set_tile "error" "")4 F7 J `2 }- D/ R* X8 x
(if (= value "")6 H8 B1 }9 L0 ?* U, J- j5 n
(progn
* X* w0 [. z, I' F (set_tile "text_hgt" "")
) {6 W) i* J6 | (setq eheight nil)& g, f* |4 K* w3 e0 `" [: T4 K
);progn, I( w O7 |5 v" e1 u3 y$ S
(progn
! p/ p7 A* C1 p Q [; j$ C (setq eheight (distof value))
. W0 I! c+ i, I# Z( B# Z6 T (set_tile "text_hgt" (ai_rtos eheight))
* |3 Y/ U6 K, j1 K; F. x* c eheight5 F2 ]) ?, g5 K2 T" ~/ k$ R
);progn
! K e+ Z! [0 O );if
A- }! Y6 t; A$ e+ ^* o; T9 u2 H );progn/ K* J5 s/ Q& ]7 J( J" o
(progn
! h7 U- R3 K) z) Q; Z" {: Q! e; V+ t (set_tile "error" "Invalid height.")! S) U+ L: x& \; o
nil: Q$ T* a$ b/ F
);progn: \, r% j& A- q4 }
);if; V! v s3 F. e7 r9 o7 K- s6 s
);defun; q. [4 t9 h& @) Y$ B* |3 _
/ B: V; ^/ S9 S+ E$ o$ z. z
(defun getstyle (value lst / rval)
7 Z- H( ~% o8 r; I8 ?; H! \, p! [0 k, h ;(setq value (strcase value))
0 S; J6 Z/ ^: ] (set_tile "error" "")
% j/ R0 K2 a% k4 S4 \# W, O (setq estyle (nth (atoi value) lst))
# L5 g* T7 l- H- O2 O$ w (if (equal estyle "")
, V" I, T! S1 n' e7 v: f (setq estyle nil)
; U/ e& H1 I7 ?+ f );if% ~# M- Z y' z% \8 T/ x
+ S0 P% J/ y- A: k" J; a- C& ?5 p );defun getstyle0 ?" R/ Q" M( C& T
1 N! x- \) K6 |) z2 g. x( h6 K
;;
9 N# w: c0 H% ^6 k$ U6 d1 _! K ;; This function make a list called laynmlst which consists of all the layer
7 u' T% i+ r- J3 S1 i ;; names in the drawing. It also creates a list called longlist which( a' w& {- P: \$ v9 X/ Q" [2 b0 h
;; consists of strings which contain the layer name, color, linetype, etc.& m3 s0 X* N/ w0 ^( x5 L
;; Longlist is later mapped into the layer listbox. Both are ordered the$ y0 H2 X* v& q3 [/ B; [
;; same.& q' O4 g, H0 I q; E% T* e
;;+ q- f. S- P8 U) x9 l2 i
(defun makelaylists (/ layname onoff frozth color linetype lock vpf vpn ss cvpname
6 q5 a ~! y/ h xdlist vpldata sortlist name templist bit-70
; I7 g, {2 P5 N# ^. o, F layer_number
5 Z+ F# e5 \ u )
g. S4 [. V5 D' o5 J3 n9 ] (if (= (setq tilemode (getvar "tilemode")) 0)) K( c0 z# N R8 v4 P6 g
(progn9 @% ^) J2 M* @6 ~2 G1 ~+ n
(setq ss (ssget "_x" (list (cons 0 "VIEWPORT")
3 l8 k6 ?% p: x (cons 69 (getvar "CVPORT"))$ Z. K/ G9 h1 t3 d u4 _ F
)+ J% B% E* d. Z7 f: A* d
)* l- s/ t$ j Y# ?' t1 Z: ]
)
2 n4 S' o6 N6 e ^! k+ M! n (setq cvpname (ssname ss 0))
: @0 c3 n6 c4 E$ }; T/ I (setq xdlist (assoc -3 (entget cvpname '("acad"))))7 I5 Q" R. T) c* t a! o6 O
(setq vpldata (cdadr xdlist))/ d" J' p8 t! D/ o' }
)3 W( o; d, |- [; x4 L5 u o
)
' H# p" t' B: F3 b (setq sortlist nil)) o" V, v2 g% ^' z7 t3 \( e, B4 u
(setq templist (tblnext "LAYER" T))3 E; _- m0 B8 \+ U+ z, |- m, o
(setq layer_number 1)
6 ^4 e6 Y& E) }) ~% u9 S( W7 W (while templist
) R* n# A9 N& P0 R" G5 f) N" `0 R (if (not (equal 16 (logand 16 (cdr (assoc 70 templist)))))
) k- y, k& g' }% f$ U (progn
$ }# Q' @: N" @2 `; c (setq name (cdr (assoc 2 templist)))$ ^5 P) j" f; K8 ~
(setq sortlist (cons name sortlist))
8 J- f/ W9 N! b" n$ H B0 D ;; Not dead message...& m* ^; ~) `) l! i5 }0 |1 U
(setq layer_number (1+ layer_number))
2 W; f' S6 i$ y4 z3 l );progn7 ^0 j: c! l7 T0 \* e* W
);if4 j0 e8 [0 D& S$ P9 |! _
(setq templist (tblnext "LAYER"))
7 j2 w# v6 Y; [) R (if (= (/ layer_number 50.0) (fix (/ layer_number 50.0))). ?) B$ z- p+ t4 D" m; R" V
(set_tile "error" (strcat "Collecting..." (itoa layer_number)))0 u+ H9 b- d6 B( y8 P' n
);if, t+ g: }8 X$ B$ P T
)
; T/ r% T s5 u& [2 ~# x" {- M# | (set_tile "error" "")1 x9 \" g7 c+ R* B5 _' A7 N8 L
(if (>= (getvar "maxsort") (length sortlist))
" I, |1 Q. ~' \. C' t. Z1 O2 ] (progn7 R! ]" |7 i- S& s( o H0 ]
(if (> layer_number 50)
6 |. n5 b0 v. t3 u: I3 e (set_tile "error" "Sorting...")
8 S6 y& n0 L; U7 B# a0 @4 Y )4 B9 Y$ G$ c- o1 } C
(setq sortlist (acad_strlsort sortlist))6 E* U: [% F1 F! s
)+ f4 Q( x- k% @+ {5 X; r! q+ k
(setq sortlist (reverse sortlist))+ F( x) D% V# G8 f% W, q9 r3 t9 O
)
8 {4 d4 ^) B: |# U3 o0 ` (set_tile "error" "")' Z* ]$ P+ C0 Y0 Y: Z4 k* k
(setq laynmlst sortlist)
8 k/ [/ k; A+ _: g ;rk 0 T2 l8 Q# ~8 V$ Q) N9 h; H2 |
(setq laynmlst (append laynmlst (list ""))) ' Q3 o: L. @2 L2 A( l9 J/ X
6 `: w' Z4 A4 ^! c4 Q
(setq longlist nil)
. O! h- i* o @/ S- T$ s- d (setq layname (car sortlist))
9 O o2 K+ b1 a' a% Y1 `9 Q# d (setq layer_number 1); H0 O& Y4 O. q" g/ d+ f
(while layname
! U. K1 o& G- H' T& h5 f# v (if (= (/ layer_number 50.0)
, H. B' j* a8 y (fix (/ layer_number 50.0))2 E& o, R* F$ O! f" M) O7 `
) f9 K k8 Z/ e0 I" r* ]
(set_tile "error" (strcat "Analyzing..." (itoa layer_number)))
% J0 r. S% S) L; a' I6 Q );if% T |. w- [# _$ j
(setq layer_number (1+ layer_number))
/ Y' t" S6 D1 ^" ], O- d$ {' \! x3 X (setq laylist (tblsearch "LAYER" layname))4 y1 l% H1 |8 v, g+ _3 y" X( |
(setq color (cdr (assoc 62 laylist)))& N1 O" r" z* L! i0 L
(if (minusp color)
' {! }7 w; P, a" D5 @) l4 P (setq onoff ".")
' d: }* @8 p( H! D (setq onoff "On")" P# k8 m2 x4 h5 j/ g
)8 V1 x& X- J" T, T
(setq color (abs color))
# R& l- n; a/ C- { (setq colname (colorname color))
* }, B; k# O I* b5 t: A0 L (setq bit-70 (cdr (assoc 70 laylist)))
s. M; i) }% h2 h: } (if (= (logand bit-70 1) 1)) `% h% z. g4 ~9 A' @- {
(setq frozth "F" fchk laylist)2 p k; |' j1 b( {
(setq frozth ".")
$ h2 B- V& E' \5 X6 r ): Z5 r& Z2 ?$ z0 [
(if (= (logand bit-70 2) 2), F! [( L4 B/ p6 z& A: e
(setq vpn "N")$ h# i0 e7 `/ A; c. D
(setq vpn ".")* W: Q9 ~5 ^) x1 V+ M' S
)8 P3 U$ X$ W- _: N+ o- F
(if (= (logand bit-70 4) 4)
/ n* [, [1 m' [5 x (setq lock "L")
j, M& K- W$ g* B, g% K (setq lock ".")! U5 @3 O- ?/ L* F) F
)
8 _7 Y7 l; w# ?. S3 f (setq linetype (cdr (assoc 6 laylist)))
, N4 _+ J; {9 V1 Q& v& _! ]' r (setq layname (substr layname 1 31))
5 q' W* c$ D+ F O, [ (if (= tilemode 0)
9 }, K/ I# H& S, @% \ (progn
5 [% S1 N+ G: l5 ]+ x) }! Y3 B, b (if (member (cons 1003 layname) vpldata)
" e$ C. D6 M s2 x1 ~& \8 X1 D (setq vpf "C")' G9 |2 F) F. U4 X u
(setq vpf ".")
6 e; z0 i3 y* M )
3 ^, }& A2 n- s& ^ )
; k+ F, \0 q; ~( u% f9 p7 i4 T (setq vpf ".")8 S5 G4 G6 p/ V: D6 O/ z
)- J2 n* f8 T- f
(setq ltabstr (strcat layname "\t"4 s: G. ^- i" y* ]4 O/ q t
onoff "\t"
' N$ a( |% d- {/ b4 s5 Y frozth "\t"" L' l5 c' X( f7 Y/ H
lock "\t"
+ _8 ~( G7 |2 l; t; t; m vpf "\t"% v) l7 E, q( u5 `% B' _, }
vpn "\t"
) n& l' ]/ L. v3 c5 O. d& R1 I colname "\t": n) e# d$ T5 y' l1 @& l+ C- q' v
linetype% e- B3 d; X; m0 R1 u# Q6 U! R
)
4 n* r8 W8 ~$ X* ]& j( e )+ z W1 g. e- b. P, @( t
(setq longlist (append longlist (list ltabstr)))
2 P0 ? H" b) y, J- J, A) p (setq sortlist (cdr sortlist))0 f% n$ O- G( g) e# _# W3 R
(setq layname (car sortlist))3 l: b# z8 q* g) F# s! V8 ]9 f
);while
, B( h# r- p" ]* ~* A9 W (setq longlist (append longlist (list "")))
' K% y" H2 y, I' K( ?. ? (set_tile "error" "")
% `: u" X8 e& x9 j9 T )
3 B, Y9 |0 i% Y# W ;;; ^- B2 d/ l# s" |% l, A/ ~5 D* [
;; This function makes 2 lists - ltnmlst & mdashlist. Ltnmlst is a list of' S8 d: U f7 N; X* ~! s' |1 H
;; linetype names read from the symbol table. Mdashlist is list consisting
# C, V, Q1 u2 D2 {9 m3 N ;; of lists which define the linetype pattern - numbers that indicate dots," ]2 u5 u# f* \) i( s) R
;; dashes, and spaces taken from group code 49. The list corresponds to the
: h! `8 `$ G. M4 V+ [% S, \3 q) a ;; order of names in ltnmlst.5 Z0 g, S R2 c
;;+ ?# [+ K4 ~/ W
(defun makeltlists (/ ltlist ltname)6 D& i- V2 N. W% h/ M! Y' I6 o0 o# Z
(setq mdashlist nil)
$ M% ?; k& J3 d9 |6 ~/ V: X2 ] (setq ltlist (tblnext "LTYPE" T))
5 I* _7 e7 G) }8 _ (setq ltname (cdr (assoc 2 ltlist)))
( b! G+ _) f* Y* \+ A; E" H (setq ltnmlst (list ltname))
$ o: c$ j% x- J/ n3 @6 L (while (setq ltlist (tblnext "LTYPE"))
6 S( L4 ~3 f4 x! M; r" ` (if (not (equal 16 (logand 16 (cdr (assoc 70 ltlist)))))6 Z q4 h' P' G) n( ^
(progn ! ~6 ^. A: J9 U: _2 l# ~! s, C
(setq ltname (cdr (assoc 2 ltlist)))
7 n- `# G R" u" O5 r% Y3 B) s8 k (setq ltnmlst (append ltnmlst (list ltname)))7 O& m, r' e2 ^; g) L2 n& r
);progn
& A5 Y0 N3 H8 Z2 ]4 y );if / k4 L9 F& S/ O X' e% E
);while
0 }" K3 V* @, `7 p (setq ltnmlst (acad_strlsort ltnmlst))& v. X# d% J% H% m; z
(setq ltnmlst (append ltnmlst (list "")));add by rk
7 O9 f8 b5 v" N; F: ?2 _1 v4 V (foreach ltname ltnmlst
. V3 T B. D- K' O3 S5 Z (setq ltlist (tblsearch "LTYPE" ltname)). ^2 E8 g; @9 e, V( O- m' a7 b
(if (= ltname "CONTINUOUS")
- \0 ]) H; N+ x (setq mdashlist (append mdashlist (list "CONT")))- y; q& n, Z1 s; h8 e
(setq mdashlist' y7 C* P( _( p0 ` k0 \8 H/ H
(append mdashlist (list (add-mdash ltlist)))+ R& R6 j+ u) O8 {+ A1 Y) s' L$ v
)
3 {1 w5 P9 h5 M0 d' |* V2 I )" P x* R7 |1 Z; g( Z. s G& S
)
$ N6 c/ o: `) ~9 E# h% v0 c (setq ltnmlst (cons "BYBLOCK" ltnmlst))
: n$ u( h* {6 I( C6 b (setq mdashlist (cons nil mdashlist))) Y. M! m2 g7 D4 P- _* w( P
(setq ltnmlst (cons "BYLAYER" ltnmlst)); Y+ b3 X& D7 r( h( \' a
(setq mdashlist (cons nil mdashlist))
; y( B& [, y. t1 H/ j7 |1 M )
5 Y; V0 O5 m: S% v ;;
9 b' l. N8 _3 ~ ;; Get all the group code 49 values for a linetype and put them in a list5 `6 \4 i: Q- k' Y/ L3 ^/ E% v
;; (pen-up, pen-down info)- b" @5 P7 I- S/ w
;;# k! {* t1 T' E }2 L
(defun add-mdash (ltlist1 / dashlist assoclist dashsize)
8 T2 E( I/ D! w1 ]3 p0 M; _ (setq dashlist nil)
& m+ c9 H) p, \' K& K. l (while (setq assoclist (car ltlist1))8 M8 I0 x/ ~8 t/ w8 I/ Q" T; W
(if (= (car assoclist) 49)
* v5 n0 H7 E- J- q" k! L& D5 {+ [ (progn- n, u5 n/ V5 V
(setq dashsize (cdr assoclist))" ?; B) D g$ r4 Z% [# z: T6 _( N
(setq dashlist (cons dashsize dashlist))8 D( n4 K+ p8 z W
)
7 f( ~, ^7 L' Y' ^, T ) u0 o% f0 b. D. W, m
(setq ltlist1 (cdr ltlist1))
/ s5 u J; `- n4 D) R8 s" |7 [0 ~ )
6 \3 U0 C5 n. p& V! Z2 a9 \ (setq dashlist (reverse dashlist))* A% O+ `7 U: I: v5 Z! s6 \4 ^8 \- q
). K3 w" {& v @. Z! ~
;;& E' ]' d; W% H
;; Color a tile, draw linetype, and draw a border around it( i6 @6 g# C; k8 r$ P
;;, Z) M; \2 [& K0 X. I5 v
(defun col_tile (tile color patlist / x y); ^7 z3 o# e& C# x( H- O5 ]
(setq x (dimx_tile tile))
1 T$ s7 _% a; u+ m (setq y (dimy_tile tile))
; G" o5 Y) l3 t i (start_image tile)
" E2 u) }% u- t y2 W& J (fill_image 0 0 x y color)
) y! Y' `! p. ^ (if (= color 7)
4 G$ [0 u6 t1 c& W1 K( X (progn
! T* X. j$ N# l (if patlist (drawpattern x (/ y 2) patlist 0))6 ?8 i7 y* b* Y( Z
(tile_rect 0 0 x y 0)( \& D, ?7 w" ~2 P8 S
)
- G0 A- e) j, J R$ L5 d0 x (progn- z' i: l, i! {" p$ B: O7 H
(if patlist (drawpattern x (/ y 2) patlist 7))
/ w! M6 E/ a4 ~9 q9 E1 c (tile_rect 0 0 x y 7)2 k: D, T, C% |
)) c; Z: K# l7 U' p& r) t1 o) I3 ^
)4 s* `& _1 u. `" A
(end_image)
2 s# W$ o6 Z8 o& w3 X6 I1 y )
/ |$ u; K, J( u6 d ;;
$ j: Q; ]: d5 G ;; Draw a border around a tile
' B# `# u, U9 l; M. X4 R ;;, x7 R2 v+ D* R( }1 M
(defun tile_rect (x1 y1 x2 y2 color)7 `3 t1 [ a8 p
(setq x2 (- x2 1))* n5 m( _& G ]% J/ e# C' h
(setq y2 (- y2 1))
/ X0 i- i, G8 A1 { (vector_image x1 y1 x2 y1 color)6 Y; z9 e9 P4 L. e. }: w
(vector_image x2 y1 x2 y2 color)
& V1 H* Y, X/ ?4 B! b, y5 X# K (vector_image x2 y2 x1 y2 color)- @3 N( v- | X7 H% Y/ {
(vector_image x1 y2 x1 y1 color)
8 O' I& Q& w+ V )
+ ~# M( k; h+ F: y ;;: _- ~0 F7 h3 H# }5 M
;; Draw the linetype pattern in a tile. Boxlength is the length of the image
( v% g( h' N0 f$ [: \4 E ;; tile, y2 is the midpoint of the height of the image tile, pattern is a$ I7 P9 O/ {' }7 J! E) Y l$ V; I
;; list of numbers that define the linetype, and color is the color of the ^0 _3 O' I3 o; X
;; tile.
, }" R4 h3 D/ k9 W) y ;;1 N# q1 u- S4 l6 R9 R% S
(defun drawpattern (boxlength y2 pattern color / x1 x2; c) S1 ^# m+ @% g6 Z# `, T: D2 c! e
patlist dash) M) |- f4 M1 g$ b
(setq x1 0 x2 0)0 _8 V& U7 D$ p& i
(setq patlist pattern)
0 r7 j$ Z( X0 F# V9 u! R5 s0 y (setq fx 30)
w% l# m( \2 U, x% q (if (= patlist "CONT")1 S% W6 s l5 \( x
(progn4 B) l0 d5 q, U6 E
(setq dash boxlength)$ A t# D, ]: G" S$ U; L) s+ |
(vi)
6 Z' ~8 h: G1 v/ {9 {7 I P" u I( j$ D (setq x1 boxlength)8 ^) y7 [* N9 h. L- g4 ~
); O! L: ^4 Z9 ^: w+ t# M
(foreach dash patlist# v4 b4 Q7 L) j2 P/ K4 c# v! f3 k2 ?) E
(if (> (abs dash) 2.5), W" o7 _6 C3 k: C8 d& C7 j) Z
(setq fx 2)
) M% a. r$ d0 h )) W9 O0 U0 }. V9 t
)
& i( Z: R1 G7 K0 N, v9 X )
$ l+ u) b+ P# |2 a. A0 p (while (< x1 boxlength)
; d- F: o3 T# y; r9 ?+ Z (if (setq dash (car patlist))0 c3 V7 V o' Z3 C- |4 {
(progn7 T; r2 ~" u' V* k" h
(setq dash (fix (* fx dash))), I* M# x' }, O8 b+ E8 c' C
(cond* L& e, a. x- i* e, e
((= dash 0)/ ]9 S5 f( c' @7 X- s0 T9 U
(setq dash 1)0 y* R% J( l7 ?" r: S }2 w
(vi); F4 U; @2 ^( ^
)7 I7 X$ m. u. p- w
((> dash 0)
- X( N) x4 a5 k (vi)6 x" _9 u& ~9 ]6 ]
)
7 W5 \# f0 O9 Z( a! A2 J5 I (T t2 {3 J1 V7 \& a3 K
(if (< (abs dash) 2) (setq dash 2))
5 ?/ c" M1 b: k5 s/ a (setq x2 (+ x2 (abs dash)))
, i) s/ D# z! M S# @9 h )
/ W' P: p: ?& k6 h' _ M$ E )0 ^: @2 D+ X: H/ t
(setq patlist (cdr patlist))+ h% T# H' Y* Q( K0 q9 J0 e, _
(setq x1 x2)
2 T& ]0 ]$ s9 n) D: m0 Y; ~" L( h- B )
5 `; }- m$ `/ A' s( u8 g* { (setq patlist pattern)
) y' k/ `5 q# N( b2 |, F( a' ] ). c( u; O! M* Q2 R
)
! c' O" ?9 ^6 T }2 f( [ )& b. G) T/ u$ ^6 i. {
;;
* A+ @. U" g# O; R+ E0 U ;; Draw a dash or dot in image tile
* v& W; ~6 d4 M# b4 O ;;3 {7 x* f4 D9 E
(defun vi ()
f8 y0 J0 }2 ^+ i: J (setq x2 (+ x2 dash))
3 e. M4 J( L& L (vector_image x1 y2 x2 y2 color)
3 Z* ?4 i; ?6 b1 ? )# B. s$ m2 J2 X
9 z) Y. L% \! I) |* K9 G
;; This function takes a selection and returns a list of the color,
% C- J m9 g9 K8 V; a0 h. w ;; linetype, layer, linetype scale, and thickness properties that4 |+ Y0 v( m8 ?$ l
;; are common to every entities in the selection set - (color
1 {- E- Q) r2 s$ o ;; linetype layer thickness). If all entities do not share the same- W" A) z' k: I" b
;; property value it returns "Varies" in place of the property
# _& S/ n g3 i6 c5 p. {" s ;; value. i.e. ("BYLAYER" "DASHED" "Varies" 0)
8 l% r0 H1 J! |1 B2 U: f ;; The last item in the return list is an integer flag for the
/ d% ? f- W: B' @ D9 l0 T. O ;; homegenity of the selection-set object types.
6 J% Z4 v( s9 Z8 A ;; 1 = All polylines
! {3 D6 n* n) r! E! i' D2 q: l ;; 2 = All text or mtext or attdef, or a combination of the three
l4 u, G$ Y; Q ;; -1 = Any other mix of objects
W" }# l) c+ `* T% k! j
" ?; L8 F- E5 S g2 Y+ ~ (defun getprops (selset / sslen elist color ltype layer ltscale thickness
! l G; F' z* v width elevation height go ctr
8 }( \$ g+ P0 ? eflag 4 N4 U) k! l! ~3 m
etype temp 0 E3 F; @0 Q7 B& t' x
txt_ss ;;;;rk 11:24 AM 1/30/97
; y8 ?+ a6 n$ E( L3 x. W tmp 0 V" L F V' [ T j1 q
poly_ss u" Y5 ~* l5 W$ q4 X
style; u+ f6 s. ]' [$ _
)/ Q% w, @, ~$ E! v. ?
( R$ d, E+ c0 m- f: g. n! o2 ]. P2 B
(setq sslen (sslength selset)
( t. m6 M; V8 Y; ] elist (entget (ssname selset 0)) `/ E' X" |" F1 ]0 l7 E
etype (strcase (cdr (assoc 0 elist)))' J# @7 R4 G$ Y Q
color (cdr (assoc 62 elist))
7 e- e% ]% t! s. v ltype (cdr (assoc 6 elist))" @9 |& ^8 }9 K
layer (cdr (assoc 8 elist))
/ z; }# D" |: p, i thickness (cdr (assoc 39 elist))
! k4 [) v. |% I7 d! Q( K2 X; m0 z ltscale (cdr (assoc 48 elist))
, X* x @( m5 U' N );setq! s' c" ~ P% o( ]
' m. V$ e( `0 d' X" T (if (not color) (setq color 256))
6 U1 ~4 L1 U" _% {1 Z (if (not ltype) (setq ltype "BYLAYER"))
& d, k4 c! n4 V6 L s! Y# X7 u (if (not thickness) (setq thickness 0))2 B& V0 k% t7 K- r6 j K& U
(if (not ltscale) (setq ltscale 1))
% s6 X/ n. L4 z9 U" L& m5 R. z1 G6 E; f P. ^* D# G8 G* y
(if (not width) (setq width ""))" }6 H0 ?' ]5 C0 y% F
(if (not elevation) (setq elevation ""))
! `% G+ _; D$ y% {4 H( V6 H" W. M (if (not height) (setq height ""))
- l4 o( u- c" g) z7 K) Q( L& t) o5 q2 {1 H
(setq go T
/ _9 ^0 ^9 j, ` chk-col T
+ E* x [+ ?. a chk-lt T 1 a: e$ ?+ w8 E2 s
chk-lay T ( J7 Q: F- t0 \1 N. n( I) ?
chk-lts T
! }5 i/ l* J8 k& r8 c. g chk-th T 5 R! T% [ A! e1 b! w3 ^$ V5 K7 f. I: Y
ctr 0" L5 |$ L) u( H" a& I j
);setq
' t3 ^$ c' L! G, ~- G5 A
+ i: Q& I6 a8 `, K0 t& w ;; Page through the selection set. When a property5 q2 d6 Y. W7 k. a
;; does not match, stop checking for that property.
: Q9 |2 U% k# ]! ^ ;; When the selection set is not homogenous, stop checking.
n9 O4 ^( q l$ Y, B q& H ;; If all properties vary and the set is not a type 1
( b; Q& Q0 U0 I0 t! O/ o0 ~ ;; (polyline) or type 2 (attdef/text/mtext) set, stop paging.* B% x0 {5 t* G6 ]4 g6 a1 x$ m5 C
" t ]" f% L6 ?$ J7 ?3 K/ }1 L. j
;Lets set the eflag so we know if the selection set includes any
# z7 w3 v! c6 \9 p: d ;combination of polylines, lwpolylines, text, mtext or attdefs.
/ I! N* f0 l# L# P' e3 E7 h* V" F, p2 c& X& B1 Y8 Y
;watch out for 3dpolyline and 3dmeshes here! @rk 10:17 AM 1/30/97! r Z4 ?2 y1 d& r4 Y* A4 T8 w6 X
(setq eflag 0)
' E" S e3 u9 k# Q2 u" B (if (setq poly_ss 4 H9 {' Q% F$ h [6 }3 k; L
(ssget "P" (list '(0 . "*POLYLINE")
/ L m. X; k* C4 x3 _; U X4 e '(-4 . "<AND") / H \8 H4 J* g J& l1 X
'(-4 . "<NOT") '(-4 . "&=") '(70 . 8) '(-4 . "NOT>")
* R- }7 E4 a1 Q* s '(-4 . "<NOT") '(-4 . "&=") '(70 . 16) '(-4 . "NOT>")
& N! D, q' i7 E '(-4 . "<NOT") '(-4 . "&=") '(70 . 64) '(-4 . "NOT>")" J5 B* v+ ?' Q/ M' w2 ^. D2 T; q
'(-4 . "AND>") $ F1 [/ l- W/ N0 G* P1 b/ n/ a
);list9 a+ e* V! h% Q
);ssget get 2d polylines (legacy and lw)* ~ C" z% p. J9 N
);setq+ c( Y/ l4 l6 \- {4 G8 i* _
(progn$ u- v$ r$ y) w. Y' u! e. b
(setq eflag (+ eflag 1))0 t/ [$ `) U! ~' b) ~1 G1 R
" ?; t6 l; v, Y$ v (setq tmp (entget (ssname poly_ss 0)));setq
1 h# A' O! I. ? Z* v2 k3 G8 m' j
8 ~( q K3 m! Z, b) [4 @7 o (if (equal "POLYLINE" (cdr (assoc 0 tmp)))
9 o; O8 i/ [" Q C7 ?; h" w (setq elevation (last (cdr (assoc 10 tmp))))
; v3 Q( l1 w. E (setq elevation (cdr (assoc 38 tmp)))
7 P/ ?( ]! P+ N2 x1 y );if
- j8 h7 |& b9 b2 @- c (if (not elevation); N3 k G' Y3 d" B! y
(setq elevation 0.0);setq
$ x5 Y" A W. S9 S! @( r );if
1 g; m( Y l0 s1 W4 e3 `
5 _9 u' ]+ M9 t/ | (setq tmp (ssget "P" & ]1 |, m5 W; i x0 G2 e
(list 1 b7 z" O; ?# q2 x
'(-4 . "<OR")% J+ T3 z$ [. i) \
'(-4 . "<AND") 3 `. `8 E. T1 o7 P+ d4 \
'(0 . "LWPOLYLINE")) B$ D, z5 z& A/ n
(cons 38 elevation)' S% P3 U7 c6 J: `
'(-4 . "AND>")
9 Y7 T& Q" I9 v/ g9 N& Y( | '(-4 . "<AND")
$ \" t) C$ U3 y9 T. J3 ~1 t0 i '(0 . "POLYLINE")
% w' b+ P2 m0 ~6 x" D/ v8 u. Z '(-4 . "*,*,=") % Y) G1 |) h1 K+ H. O/ d
(cons 10 (list 1.0 1.0 elevation))
7 N* D' T: g) X2 e' [ '(-4 . "AND>") - Z0 ?. F' C/ v
'(-4 . "OR>")
4 @! S' a) ~8 x/ X );list% _* Y" ?8 i# _+ X& E
);ssget
% p' S. ]9 J- P: q0 Q$ i );setq
' j+ G K7 Q) W# J: i! ^
+ o6 D! ~& i8 y; I3 | (if (and tmp " H! z3 B6 P+ ~0 l
(equal (sslength tmp) (sslength poly_ss))% o( ?1 x9 ]: f9 N1 c. A% X
);and* X) U9 \! o$ ]1 ?& d
(setq elevation (ai_rtos elevation));setq
* G; K8 @+ ^. w* ]( _6 ^+ z (setq elevation "")4 ~9 {& I' `. P$ y/ A: o
);if
9 V+ r( [, A" v8 W, d! E% q- z# t* j! n( ?% N8 W% z
(setq width (pl_width_getter poly_ss));setq
% }9 H0 M$ j5 U0 F" B4 f. L9 y! Y* b% h) O8 }) z
);progn then 2d polylines and/or lwpolylines are in the HHHHHOUSE!, r2 e' |' R( E1 C, f
);if- A( ] j m E* c, D# ]
(command "_.select" selset "")0 [) ?. `7 [# E$ D& ~4 Y; |
2 i' H" [0 m# c$ B% K
(if (setq txt_ss
5 G9 y% O% J, \* H) r (ssget "P" '((-4 . "<OR") (0 . "TEXT") (0 . "MTEXT") 6 u8 O* r# g+ |+ ?( u: G
(0 . "ATTDEF") (-4 . "OR>"))$ y( c' K* v( e
)
8 |* s& _8 E9 B" V );setq. P7 U3 o, j) o. t% V2 D
(progn
& P- z( D7 J( z" m! Q( ^ n6 P- } (setq eflag (+ eflag 2)); f0 _* D. p5 s; b/ K _* p
(setq height (cdr (assoc 40 (entget (ssname txt_ss 0))))
& Q) Z5 v; C2 g, |$ s% t# R tmp (ssget "P" (list (cons 40 height)))
3 L, Y7 {7 ^7 a m );setq
9 a" B6 ], p( q ?+ Q (if (and tmp2 Y6 ]( [ Y/ a5 C' m: X
(equal (sslength txt_ss) (sslength tmp))
* Z$ p( R: ^$ i3 _ );and
0 k) e4 _2 M8 O# P8 p (setq height (ai_rtos height));setq ;@rk need to translate from float
2 Q! d* _# H& D8 P* X5 R8 P) Y ;to string and back again easily
# }, ^. f- q V- Q& h5 r (setq height "");setq else the height varies
. W1 Z" e. D F+ y );if7 i9 C5 n: E( S) n7 ]5 N1 p
(command "_.select" txt_ss "") - x* V" D! Z, g8 V! B& R
(setq style (cdr (assoc 7 (entget (ssname txt_ss 0))))
6 u4 a/ `+ C+ U, y% m# { tmp (ssget "P" (list (cons 7 style)))
8 z2 b) e |# p' Y/ Z );setq # _& E! y, w% S% D& R l
(if (not (and tmp
7 e- a7 F* ~3 z9 _$ f7 b (equal (sslength txt_ss) (sslength tmp))
3 d/ |6 O" w; F- H );and
8 A. }# k! @) o8 f; d );not' B+ M5 ? m# R! m" ?4 E5 `7 V" M6 e
(setq style "");setq then the style varies
+ v4 C' C8 E/ I: c );if. p5 M$ Y* z/ H5 u2 I7 O$ w: X2 ]
);progn the text type objects are in the selection set: o: C% |2 N2 \4 e% D
);if Z% T0 ]- U- Q) p1 }0 L
(command "_.select" selset "")
6 V3 R' Q4 C% P- F9 r1 w3 Y' u: [2 \: u( |& v5 _5 b
(while (and (> sslen ctr) 8 O- X9 D4 I% d( L; @3 f2 Y2 c; w
go- K8 ]9 r' r3 @$ U) b
);and" e Y5 Z/ L/ Z
(setq elist (entget (setq en (ssname selset ctr))))
, H/ [3 v* k/ }$ G, O- t; R9 L3 W
: Q1 @) z/ r4 v: x: j (if chk-col (match-col))
' s, _# V' \7 u$ F! G4 [( p9 F (if chk-lt (match-lt))
3 _% h: v3 v3 l, k0 D (if chk-lay (match-lay))
2 C% K7 K9 }+ i6 J (if chk-lts (match-lts))' g# V# q3 c0 O9 V
(if chk-th (match-th))
3 R( C: V" N+ v V0 W" e ]/ S5 l, t/ d6 \; h k, k
;(if chk-etype (match-etype))
6 m: x/ _! s+ D
8 k( U/ u, a$ i$ ~4 L (setq ctr (1+ ctr))" o% L+ I& W+ |7 c
(if (and (not chk-col)8 T5 v1 L6 p3 `4 h4 \5 ~/ |0 c9 `
(not chk-lt)8 z$ A4 X: D7 e' g4 H
(not chk-lay). z+ A7 g7 k( O" X3 Z$ s; u2 V
(not chk-lts)
" d6 x9 P2 ]4 e (not chk-th)
5 D! i0 Y- W7 E6 }& ~1 K# C X ;(not chk-etype)
0 j( O* ~6 M4 A' E4 F0 i' a );and
; n" ^& E5 ^( Y' C (setq go nil)0 R7 ?' q1 w% ^# R5 d
);if% m0 j% P* L" N S0 d* F2 @' Y" v$ j
);while
$ R/ f$ N$ k! r$ D1 _& p% M9 b6 x/ m% U- D4 C( d& D" C
(list color ltype layer thickness ltscale) n9 P7 C$ p, m# Z( C+ T9 i
width elevation height eflag ' A2 f4 P) [; j$ a! P; H
style poly_ss txt_ss
) A; Y6 d! m( c0 t )
, G% K# B! A6 v3 W" ~ );defun getprops
3 L# t- V u- [2 D
" e' b" d$ F3 ]6 @" }: O ; This is a speedy little routine to tell whether the polylines in
( e& V: C$ e. R9 a6 X ;the selection set argument are of varying width or a constant value.
/ Z& z+ \+ x/ I3 z2 x; U9 ?" ~$ e# R ;Looping through the vertex's has to be done for old polylines when ( m9 g* |9 D1 t6 N9 V( B
;the polyline header has width values of 0.0. Basically, in this case,
8 h$ |5 l. y" H% c( q; i ;information in the polyline entity header is abmiguous. Width values " p5 U- {9 B; I% L. F5 M
;of 0.0 in the header entity could mean the polyline has a constant ) E* g2 R4 }& h" ^4 }
;width of 0.0 or it could mean that the polyline has vertex's of varying ) j4 a; F2 W+ `% R/ |5 Y
;width.
/ c, ~# v" n4 E) h K _ ;# x4 B( y( ^+ ^: t/ F
; It's all in wrist. Err a.., I mean it's all in the 'if'2 E& d, _$ C0 ]8 u
;;3 b* p' Y! p4 u. ~) L; e
(defun pl_width_getter ( ss / ss2 ss3 n na e1 width width_a width_b flag flag2)' O& y: A: L4 @' P
# g7 z5 I, ^) x (if ss
& n L' Y% A8 c8 w- n7 [9 e (command "_.select" ss "")# \. z* T+ b5 C& `- M
);if
$ z! X% u& p8 @+ C W, ^5 c (setq width ""! l' U6 V1 c6 M5 {( T
flag nil
" r; z; k! C1 \" m5 h/ Y flag2 nil
' d6 W3 O- p+ X& V );setq
+ I4 ^( C e5 n7 D0 n% V7 \ (if (not ! L5 w0 u- c5 @+ t- `8 t, H' D
(and ss
% ?# }9 I) W9 I l6 e (setq ss2 (ssget "p" '((0 . "LWPOLYLINE"))));setq
3 [% q9 B) A( R6 a) C2 B (setq na (ssname ss2 0)
- h' r# Z5 M. I* s3 l width (cdr (assoc 43 (entget na)))/ L$ e' n2 u/ [# I4 w
);setq# F/ }& R* G& A( P
(setq ss3 (ssget "p" (list '(0 . "LWPOLYLINE")
# n. P5 y; x# }9 y2 A (cons 43 width)
- [: m- v, x* C; `' l3 c3 a% z5 Q );list
) H. ?: {4 w; m e' U );ssget
3 O% \* B3 R" D! L1 A );setq
4 W' V7 R) @( @5 f8 Q2 T* X1 A9 }; M (setq flag T) $ e0 w+ q. q7 {. i4 f8 g4 d
(equal (sslength ss2) (sslength ss3))( o* P4 I% G S) @3 g/ w
);and
2 d9 B B. G' @* ~$ Z9 i. g );not
( C# ?1 L6 V3 y. f* `0 f) A (progn
% a8 R/ B% i4 U: ^ k (if flag
, S5 `, p, g' U8 S: T+ O (setq width nil)
% x% l5 \% H. l' T* t );if* b4 [7 b3 |" m" F! T( F
);progn3 V! k7 R2 A, f' x7 F# `3 @3 @
);if
, F7 H) m7 J; ^' a+ n9 d9 l1 ^7 F( W
(if (not
2 O2 H/ G# P1 u/ e (and
* @9 O$ f- I. p6 }( o Z' Q0 P; w ss
* p- m# {3 G+ U$ @ (progn (command "_.select" ss "") ' }8 r$ Y6 n7 @
(setq ss2 (ssget "p" '((0 . "POLYLINE"))));setq6 c5 n4 G- T7 z2 Y8 o& Y8 W0 `
) # S; m& }% b9 D2 o+ s) H
(setq na (ssname ss2 0)
6 k% ?6 p: k0 }. d5 n e1 (entget na)
' i9 }3 L( A$ n5 S! I width_a (cdr (assoc 40 e1))
' z0 }) ~( U5 @+ f3 P width_b (cdr (assoc 41 e1))8 D g3 W( f4 \& R$ z
);setq
& K3 k [) z0 ]% Q (equal width_a width_b); L2 G) j1 J, {# i! i) Z
(setq ss3 (ssget "p" (list '(0 . "POLYLINE")9 v& Z) v4 Q+ v3 P
(cons 40 width_a)8 N# A9 V* C; e) h. h/ n1 h: k
(cons 41 width_b)6 t1 r! R2 K' F# B+ I
);list/ b$ ^: N1 ^* @5 Q
);ssget7 G- d; j! u8 s' E3 G
);setq+ g9 e4 Z* m8 m5 E% [: Y3 F
(setq flag2 T)7 Z% `' b* m) X
(equal (sslength ss2) (sslength ss3))+ ?; t) _) [% ~* }
);and
v8 r: C8 G6 o l# a4 a );not U& w: f( z( e8 T3 g
(progn! Q: [# n4 H& c0 `. D/ U) q
(if flag2
8 y, w8 o6 v1 J, e" k (setq width nil);setq
: I' w; p+ z" f );if$ h+ y, O; v: M1 Y4 @
);progn then
( t3 D! Y% h; ^! S (progn
* `3 t( }. r" q+ p (if (or (equal width "")! G$ p( g- {: f- M$ H0 ]
(not flag)0 T0 \6 k3 @$ s5 i( F
);or3 m& B+ W9 M8 r0 V( e! T
(setq width width_a)
# y) V! E; {/ C. p7 n# f, K9 q (progn
, u; s6 B4 ^- o, [& y# e) P% m0 j (if (not (equal width width_a))
, E% H# L+ D* U4 r (setq width "")8 e) N% [& k2 U4 M- W/ U
);if ' s4 s2 N9 X5 q1 l" H1 d
);progn
7 k; U5 Z: W* M );if
$ _% L8 `# U5 R: Z );progn9 C8 X6 u, n+ @- B) F( |- B# K
);if( ]% m/ t7 `6 g- j8 T% t% Y
: a( X6 K+ b& p
4 a, y# H( N( V, Q8 d" q d7 G$ y
;now for the special handling for old polylines
( h& z8 N( R( c( v4 [7 J1 @) U (if (and width ( t* z0 v' D) ]/ X8 n% o* }3 e
(equal width 0.0)! U9 h9 c7 k+ s7 L4 Q! n
flag2
3 h6 F3 n# D! O );and
/ x/ y; d( L r! M (progn e1 b1 u( J$ E8 o' d# K$ t
- S! h1 L1 L E2 V% X/ l: i0 K
(setq n 0);setq. ^/ b, n, u5 x/ h
(while (and (equal width 0.0)2 P2 d6 T8 O$ e# `5 k2 C
(< n (sslength ss3)); a! ~1 Y3 f# X" Q8 q0 x6 c
);and$ @; Y/ ~; i# ]8 Z5 ~
(setq flag nil8 `$ H. g! b3 z z% R7 Q; H
na (ssname ss3 n)
! T9 s$ j' e; |6 Q na (entnext na)9 `/ I2 M7 S! A
e1 (entget na): N3 w7 Q3 J' x; k6 E
);setq: F6 {" G) H$ \4 f/ o
(while (not flag), D( x) ~* B6 {4 b! `
(if (or (equal (cdr (assoc 0 e1)) "SEQEND")+ n) b! N1 ~( i9 r. i4 [
(not (equal (cdr (assoc 40 e1)) 0.0))/ P' e4 d2 ?% Z! ~6 }
(not (equal (cdr (assoc 41 e1)) 0.0))
4 z$ t t" A" b; w" F );or
& D# `! h0 i0 F/ f2 { (progn0 s6 ^1 M& @) x9 Y+ b* g. F9 o
(setq flag T);
0 o! R; c h; p$ O8 M8 q (if (not (equal (cdr (assoc 0 e1)) "SEQEND"))
7 X G' s* ?) ^3 V (setq width nil) 7 s! N4 \0 i: O$ h' a6 y
);if% V! m8 W. i( u( Q4 Y
);progn then jump out of the loop) |' C2 P. {% j, Z/ f
(setq na (entnext na)) X2 d2 G: u6 N7 [
e1 (entget na)* r1 y4 |( ?) a" D B' p# v
);setq
: N4 i3 c0 B& K( K4 g );if
( J- {/ m0 A8 \- [% I' i );while. z- K7 t4 v l' O- U7 r4 C# K
(setq n (+ n 1));setq * A) [+ N6 Q! Z6 m1 U
);while
9 r* b& i# n( h7 ]+ X1 @$ e7 X- C" s
);progn then it's a legacy
5 ~* g! I* X! c( G1 D2 ^6 T9 y );if ;legacy polylines that may have varying widths
( L9 L) F& c6 g: u ?5 U
- J* D" J( s; E! c+ R6 R% X% T (if (not width)
9 D4 J' v& L1 S$ E5 }, Y9 b5 Y2 c4 ] (setq width "");setq+ e* T( X5 j5 J
);if, X/ }/ F5 P+ c% }, D3 `9 z
(if (not (equal 'STR (type width)))
3 ~) a/ e, {6 z3 } (setq width (ai_rtos width));setq
: i$ f w7 o4 B& [- r+ S( p );if 3 D4 v- r0 k& @5 u# S
6 j5 D% H* t2 f/ E width - p' a& i( Y7 a; A2 r
);defun pl_width_getter( H) W$ W4 W8 ]) M( D9 D2 ^
2 C5 C/ o8 C f8 [
! J# V: O8 X A8 g (defun match-col (/ ncolor)
8 |/ V8 s, @! H9 i* n (setq ncolor (cdr (assoc 62 elist))) m0 g' a7 | o- l
(if (not ncolor) (setq ncolor 256)): I* j( z! q2 x+ X
(if (/= color ncolor)
8 R6 h2 z) f! x/ t8 o7 e (progn
+ ^! k2 A- Y: x0 g/ E6 ?& n (setq chk-col nil)
, v9 l, o& h/ N2 w+ Y( f$ S5 v (setq color nil)
6 R7 E, G5 k8 O1 b4 c )
$ b( h' X& Z, C )
0 @& e- ~2 r8 w5 b# N7 X& W )
. ]4 C3 h# B# D2 M _. ~ i m" r; e
(defun match-lt (/ nltype)
1 B+ H/ Q3 d8 L+ f& d (setq nltype (cdr (assoc 6 elist))): h) L& K7 S8 f$ ~3 F5 p
(if (not nltype) (setq nltype "BYLAYER"))
: y2 U- i$ Y5 P (if (/= ltype nltype)
8 ^! _! q, \; n' J0 O (progn! r& c- K( r9 N: t u
(setq chk-lt nil)
! ^% p) |( k0 E0 _* ^# a1 F q (setq ltype ;|MSG0|;"Varies")- U# ~1 x% _. B
); C3 L5 S* D3 N+ C0 _8 i
)
0 ^$ M/ H) x. w: Z )& h8 A1 [' Q* m7 F
/ _6 j7 T' R% H; B1 T9 ? (defun match-lay (/ nlayer)8 q) }1 g0 |& q' G2 N& z
(setq nlayer (cdr (assoc 8 elist)))
3 Q: T2 p7 M0 N4 v# v (if (/= layer nlayer)
$ }9 j+ ~/ j: D+ z1 k (progn( j" }+ V3 }- g A+ N
(setq chk-lay nil)
3 I' E" ?. _; a (setq layer ;|MSG0|;"Varies")
9 v$ j' M( \7 P )$ A F9 S/ _- m* B8 Q
)& ^9 l' v$ a7 F4 g$ x X, ]; j4 l
)
7 K$ s- b6 a* v9 H6 E/ z
- n) }; h) l2 e# M8 B. p3 Q' d (defun match-th (/ nthickness)
' j! X2 V- s- r& Y# f E7 R (setq nthickness (cdr (assoc 39 elist)))
" ^: Z7 @- U+ k ]9 \ (if (not nthickness) (setq nthickness 0))& q. t, z- T8 N
(if (/= thickness nthickness): e& N- ]( c0 { k2 l3 V
(progn
7 ^: Q5 s( W! m% ~ (setq chk-th nil)
! I7 D: Y" `3 g/ M b: q (setq thickness ;|MSG0|;"Varies")
3 i% j) i. h3 ?$ J' p )
7 ~) o" a6 [2 z' e, L )
4 l; f) c- x" R ): g1 U% G* k( y/ c2 G+ r7 B8 i
4 Q* P, ]3 X+ G$ B
(defun match-lts (/ nltscale); X, t0 e! a9 i. B6 g" K0 |
(setq nltscale (cdr (assoc 48 elist))): z T& A7 j# `, S6 W) h2 D- Q7 Y3 \
(if (not nltscale) (setq nltscale 1)). f- e4 L2 a+ i
(if (/= ltscale nltscale)( L3 z J9 r- E% ^) I" H/ z2 {+ k, L
(progn( E4 C+ j7 f; C% @5 k* \
(setq chk-lts nil)/ T/ B0 `: z6 ], h D
(setq ltscale ;|MSG0|;"Varies")
5 W- Q7 q$ Q: I4 j$ [* f1 i/ W )
+ `8 @, G& n7 W )! T. M( k) N, M( W5 ?0 j
)" i1 h0 @) E4 V. ^. }
3 X& p4 | E4 g# e6 x& t
;;
} x/ ^3 M9 y6 S2 {7 g+ v ;; If an item is a member of the list, then return its index number, else
% F0 K& R( U" A& Q2 P+ N1 s ;; return nil.2 Z8 B9 m2 P4 P! X
;;
9 l ~& _! `) c2 j! [ (defun getindex (item itemlist / m n)
! m- W5 V7 c/ c' e, k (setq n (length itemlist))9 G% o3 t4 h" ~' Q
(if (> (setq m (length (member item itemlist))) 0)5 M# E F7 G v: A! F" {. u5 }
(- n m)4 A0 I7 b# b. m; k& z* J, g
nil
" w. j5 ~3 |2 A2 l1 J )
) E2 }7 ]" @/ p; q: Q& s) a, F )
% u2 x7 @( e) z, w. P% ]; B ;;
$ M0 t6 G& x5 M% l7 \' k4 f ;; This function is called if the linetype is set "BYLAYER". It finds the/ h" O0 ~5 Z9 F% X y; g' P
;; ltype of the layer so it can be displayed beside the linetype button.
0 d( M$ t, x1 I6 U8 C" u7 s" e ;;- q( M& Y% N) a# D# r
(defun bylayer_lt (/ layname layinfo ltype). H! s# P- v+ C0 V$ ?0 V6 ~! m
(if lay-idx
% b6 `( w0 r/ t! ]7 m$ M (progn
- {$ W6 `* Q- p- I (setq layname (nth lay-idx laynmlst))
( w) {& l0 V7 P B4 s (setq layinfo (tblsearch "layer" layname))% n4 P' m" y3 x
(setq ltype (cdr (assoc 6 layinfo))) W. z# U2 h4 F" f1 P4 x2 v d
(strcat "BYLAYER" " (" ltype ")")( N5 n- _6 S1 W
)- B& u' ^) q9 |7 d$ ^3 {5 l
"BYLAYER"
0 O8 u" \4 g M. ?8 G0 N )& O5 ?& w6 y) G) [3 o; Z: g0 U9 q# D
)
: P5 o. {' O; r P/ F4 ]: ] ;;
5 U; ]2 r& }3 |" C ;; This function is called if the color is set "BYLAYER". It finds the& t& P5 j9 ^5 h3 _+ K
;; color of the layer so it can be displayed beside the color button.
; X9 R. A9 }$ ` m# ]* R6 _ ;;% K0 {$ C* s/ a1 b
(defun bylayer_col (/ layname layinfo color)
$ m4 O' j2 z# T: w/ P& D2 c (if lay-idx$ x1 w. t/ R8 D- [ K6 U# A$ M
(progn
! k4 D* e- c' |& w# e- Q2 N: a (setq layname (nth lay-idx laynmlst))
9 U) R6 @9 C* a: n9 _' {- C! ~6 U. o (setq layinfo (tblsearch "layer" layname))! A7 v3 @. P! z: t9 T0 ^
(setq color (abs (cdr (assoc 62 layinfo)))), m0 n8 P+ }& a3 i6 Z& U
(setq cn color)# k1 X: m3 `1 l) Z
(strcat "BYLAYER" " (" (colorname color) ")"). H9 t! C# }) n3 T4 K
): Z6 ]. ~ U+ e/ i- h5 G5 r
(progn* p, H, Y0 b) V% d
(setq layname elayer)
$ T% C9 R1 M$ c (if (and (/= elayer "")
( M4 d! p5 x; b* V4 G+ R( Z. p (/= elayer "Varies")
8 K, [! t9 |: z );and
# v3 Y; q5 q+ |3 \* G7 s (progn- U! j+ K/ L* m Z7 K# n. |
(setq layinfo (tblsearch "layer" elayer))7 V0 D( n, y/ I% ^8 m
(setq color (abs (cdr (assoc 62 layinfo))))
0 M( c' F% d4 u0 }" z, k (setq cn color)
& G! s1 s4 t' F& p; s% G, @0 I (strcat "BYLAYER" " (" (colorname color) ")")
, F" `& v6 j$ d; q) J )
) Z5 b/ l* ]9 L& W3 ], ~* ^( X9 I (progn
6 S. [6 J- L7 D (setq cn 0)
; D7 K3 Z5 c6 D+ I1 i- G* d "BYLAYER". s+ C: S+ w1 s
), h V+ T" @: u2 B7 z
);if
3 ]1 N( K7 j4 V );progn2 A1 `5 _; D& y1 v! ~
);if
6 l( ~' r' O1 J& f7 b# h* W )/ c- e3 z$ F1 o6 c) k
;;
# ]3 i2 H% V- L" j% q+ a: o" k ;; If there is no error message, then close the dialogue
, Z1 k6 h! |8 h5 r ;;
0 A4 }, ~; X2 T* V7 g6 c' y ;; If there is an error message, then set focus to the tile, m& R* w0 \% q: ]1 {
;; that's associated with the error message.
/ r* p- ]2 M8 f! `1 ~ ;;
% o( C" | Q/ c; t8 k (defun test-ok ( / errtile)- k( U8 Q- u% X9 `. C |( Q
(setq errtile (get_tile "error"))0 V- [* ~ f% @% L, f
(cond+ q& p$ a3 O8 Q R' \: k/ E8 w
( (= errtile "")5 w4 R; |3 n6 N( ]9 `* h9 K# C
(done_dialog 1))
) d& f& l' W' D4 X' Y4 B ( (= errtile "Invalid thickness.")% ]& i4 Z( ^; B4 d. P) q
(mode_tile "eb_thickness" 2))
6 W. B* P; s4 p3 f Q" z )
7 G6 U. @) m0 x: d! d0 f) H )( S4 V V$ p r
;;0 N: g5 K: D8 G" B9 w0 f/ a. q
;; OK in main dialogue.
9 h. G0 s4 d. n/ @: D. z% f9 D6 \; f ;;
) g. y5 u. _5 I% ?! W6 B (defun test-main-ok ( / flag)" t( F4 K7 J# w
(setq flag T)
5 l1 [ E! Z3 K* E+ O5 m" \ (if (not (or (distof (get_tile "eb_thickness"))
% z7 ~& Q4 L+ [ (= "" (get_tile "eb_thickness"))
1 a6 w1 A' R E3 h+ T( l );or
) X* ^1 T# q. Z );not3 P8 Y3 z! \9 c1 X7 V& P
(progn
; \8 m/ h! h& |- l$ O4 o (set_tile "error" "Invalid thickness.")8 S8 x5 N8 M6 i2 B
(mode_tile "eb_thickness" 2)+ E3 o1 j' ?6 h4 w" D* O3 h
(setq flag nil);setq2 \1 n( F" L+ f$ j5 R/ k6 b
);progn
Q& u, h6 h, h& O! \& c );if% |! p* t: `2 P6 s+ T5 C( R7 T! B
(if (and flag
$ b3 h% X4 m+ a# z) [ (not (or (< 0 (distof (get_tile "eb_ltscale")))
9 w" Q. {5 F" m' y* H" Y (= "" (get_tile "eb_ltscale"))9 T4 j5 k/ L" S y+ s
);or
) ?$ b% O3 [! ^0 m6 S8 V );not/ R$ y7 W; N, O
);and 1 M! G: r7 [: Q1 Y7 E
(progn) p# Z' _( f: o6 a
(set_tile "error" "Invalid ltscale.")
8 ~( L& [+ }9 ^8 @ r (mode_tile "eb_ltscale" 2) P2 M* d) L/ G8 l9 F5 A& @/ [
(setq flag nil); 7 z; X% w# D) l# D' i! A) }
);progn then
7 w3 d7 P. ^9 ~3 Z9 H );if
% z. [' k/ F# z( y (if (and flag
4 p/ d6 w' |, |# ]6 J0 ^1 D5 p' ] ; Don't test the tile's value unless it's enabled.& S9 N3 L" M5 d! q7 _* ~+ \. d
; We're not set up for the display-only value5 R1 o* ~/ \8 R. i
; of "" here in the error handler.! ~. V6 l. m* b1 V
(= 2 (logand 2 eflag))$ p$ Z+ ^' ?' ~# h
(not (or (< 0 (distof (get_tile "text_hgt"))); Q+ L/ {$ K3 ]) {6 u0 g
(= "" (get_tile "text_hgt"))
& a/ G' F7 c. Y) |1 @+ }' I2 S );or
" G: \ ^( A: G" Z5 s );not
. c3 I( Y- F* d* r );and
' _$ \9 F+ E- G$ `0 C8 I4 p (progn
9 O. C1 u/ z" N- V (set_tile "error" "Invalid height.")
" o2 e [5 b7 T+ X2 L9 U (mode_tile "text_hgt" 2)
1 L! q% M J( b( j (setq flag nil);
+ g# e' |- ]# L r" s% V7 w );progn then
8 U! D; ^7 x/ H0 j* a! A );if
0 E& x' e; \+ N# M, D (if (and flag
5 R/ e# Q0 P) T+ k8 M, i' r (= 1 (logand 1 eflag)): L# J9 B' s9 b1 I9 w1 I
(not (or (<= 0 (distof (get_tile "poly_wid")))
8 x$ ^( N- F1 H+ B, o (= "" (get_tile "poly_wid"))
" X& u. j0 ~6 @7 Z3 Z$ n; v1 F );or9 d/ Q0 X4 `7 M% P# q k6 Y. i
);not
; E1 i, F6 s. d );and
0 v+ v" w% b" M+ v1 ^6 X) D% ]# Z (progn/ l; B! A& Z; w0 A
(set_tile "error" "Invalid width.")
9 i7 w9 A8 z% j (mode_tile "poly_wid" 2)
: \. [( N/ I8 G (setq flag nil)
% `2 ^4 y/ [. B: p% k1 k1 d );progn then2 `( h+ k! X3 ~ y& A6 f" S
);if ( L9 M5 n! d4 H% A" w) l# k1 q9 ]
(if (and flag* v3 d: M5 |, Z1 ~
(= 1 (logand 1 eflag))
. ?9 c7 f% x* q6 y/ l (not (or (distof (get_tile "poly_elev"))
. b( ?) j. R: i; m (= "" (get_tile "poly_elev"))
( u9 d( M" R* x0 |: D% l );or( R% Z2 e( P% \; K+ Y7 U7 x
);not% b) u6 _# v) u
);and
# K1 r+ V' F" T8 R (progn3 e7 I- ?9 y w, P8 F1 F8 T1 C
(set_tile "error" "Invalid elevation."); {3 T' K0 ]3 f, I# T% S
(mode_tile "poly_elev" 2)
$ ~* t- q) `/ j3 K/ S4 b/ R (setq flag nil)8 R) a3 A s' E# ?
);progn then7 f" E x$ Q5 a$ ]
);if . {/ b7 ]5 w( ]4 v3 O4 `
(if flag ; ~( P, ]# E+ v* ?" m
(done_dialog 1)
: |) |$ {( j5 j, L# B; u );if
0 E4 y' D. Y. C3 f$ [0 K) `, P- P );defun test-main-ok
6 A' l/ `" M$ q& S& d: D! H. |' B% u1 I0 @, @ M" C$ X
;;
/ m% Z2 j: b- D5 D ;; A color function used by getlayer.
. c3 O& g0 H* D ;;
# l x9 r# V1 H5 I3 K$ Y. j, j (defun colorname (colnum)' m9 u/ C3 E! h9 F0 j0 R
(setq cn (abs colnum))
# J2 k9 \& j& `- H& C (cond ((= cn 1) "red")/ G7 u! S6 n" Y( w2 M, Y
((= cn 2) "yellow")
7 ]5 v+ r* G, F3 m ((= cn 3) "green")" _& }2 [3 C' D; c
((= cn 4) "cyan")
4 e8 R1 W& E6 w; W; Q( r- y ((= cn 5) "blue") e: J Q1 W- F* q) p# g6 X
((= cn 6) "magenta")
0 j' s6 i2 d$ e8 s& A# q ((= cn 7) "white")
8 J# G# d" @8 s' i4 _ (T (itoa cn))8 O( ]3 y: Z ~* [& D* R- F6 u
)' f/ ~2 v, ?' c/ H& \3 Q
);defun
2 y2 d3 c1 h% |
2 w& H, \ u* ~& A6 l$ t! C;;; Construct layer and ltype lists and initialize all
& w, q0 C6 S4 e6 R# S% J3 G- P;;; program variables:) @" F( i: M0 w3 w5 T( T: g
" A# F5 G+ S7 G# c: k3 c: }; (makelaylists) ; layer list - laynmlst$ H5 W9 Z% t7 P" Q
/ A V% j4 w/ I+ I
5 B9 T" t, O- x2 Z
(makeltlists) ; linetype lists - ltnmlst, mdashlist
0 f2 q" t7 A5 ^4 P8 K
- ^4 L( f3 _+ z) S ;; Find the property values of the selection set.; Y1 \* H: o6 s$ H, c
;; (getprops ss) returns a list of properties from6 Z* d! M1 H& L. h8 @! m
;; a selection set - (color ltype layer thickness HEGHT STYLE WIDTH).
/ \/ F0 Y$ B1 ?! ~+ J7 W4 U# v$ [" ^- E7 |2 L
(setq proplist (getprops ss));@rk interesting things happen here4 B% g1 e# S6 ?' [3 Q6 y
/ j; m4 ]3 m, i" Z2 O: x2 K, C
(setq
* C5 m4 l- {( i8 [7 m1 P7 B' w. s) Z: C ecolor (car proplist)
# r: Y1 i- y& z4 c. R) x; q U eltype (nth 1 proplist)
9 G- t# d+ k* Q7 E+ u elayer (nth 2 proplist). g: _, K2 b: L! ]; |0 w! ]
ethickness (nth 3 proplist): p; {7 A! w2 P8 S! z
eltscale (nth 4 proplist)! q: z- e7 l/ d5 C" p5 t; i) x6 G' W
ewidth (nth 5 proplist)
3 h9 d, E2 g' \" \/ O) r5 t eelevation (nth 6 proplist), |' A) j: G: R8 S9 u! _
eheight (nth 7 proplist)
G4 K4 l2 q5 N& e' J ;etype (nth 8 proplist);commented out and replaced with the line below. RK.2 Q! j( ?1 _# Z: X! X% {
eflag (nth 8 proplist)
3 M) e$ w6 |2 y8 M) W estyle (nth 9 proplist)
5 S: C) F: u/ ]* W y: i poly_ss (nth 10 proplist)$ T) d/ ^- B y* t- J/ [# b8 n5 ^
txt_ss (nth 11 proplist)1 w2 A0 |7 s) h: y3 C# r/ e+ L! Z
);setq
% o, l; D( Y5 w/ N! Z% W+ `5 _" k- |. n
;; Find index of linetype, and layer lists
+ f; j: `$ W$ x" v& c. K4 x8 K( }0 ? (cond+ G$ y: }# J: b* V' l$ |+ Q
((= eltype "Varies") (setq lt-idx nil))
" ^% p* y j( x2 z1 Z; a ((= eltype "BYLAYER")
# c5 j4 k Y1 U (setq lt-idx (getindex "BYLAYER" ltnmlst)))0 D9 A& }* k. f$ B. g6 v! f
((= eltype "BYBLOCK")7 M! Y3 B8 U! Q& q* v1 _
(setq lt-idx (getindex "BYBLOCK" ltnmlst)))
; m% K; x& n% V* j) y) ` (T (setq lt-idx (getindex eltype ltnmlst)))) _8 s1 N- ]- |! C! {! [
)
9 m& d% V8 g' J (if (= elayer "Varies")7 z! z9 g O f+ ?5 Q/ F4 W
(setq lay-idx nil)
6 _1 Q9 s) v1 I% u$ t) @$ y6 q (setq lay-idx (getindex elayer laynmlst)): x) I, |$ }9 V
);if
* e, b" ~6 ?0 w" C (if (= ethickness "")
6 C0 I. r9 m$ J5 b (setq ethickness nil)9 J4 V4 n3 n) W' c5 J7 n
);if0 ~ h+ W" n* i: B" P3 I7 s5 [# h
(if (= eltscale "")
1 x8 V8 @1 I0 j8 q [6 w; L/ b7 s p (setq eltscale nil)2 D3 S" P8 Y7 p3 H" w
);if
3 Z! _/ a& c2 x2 i8 a4 d3 q3 @- d1 Y5 S- E9 v( D! Q8 Y( R
);defun ddchprop2_init ; end (ddchprop2_init)
* u; h( i( E2 Y7 y8 w2 J+ _; [ M9 q" z1 a, ^3 j
;;; (ddchprop2_select)
, w ~$ g4 L4 e! {) U;;;1 Q2 y3 M/ Y+ O; i
;;; Aquires selection set for DDCHPROP2, in one of three ways:
5 l% o4 P: J6 C3 @;;;6 p# s) w8 h+ P% R
;;; 1 - Autoselected.
/ k9 P, T1 p* i- @2 G;;; 2 - Prompted for.( E6 \$ f6 n; p0 l" l5 |# X
;;; 3 - Passed as an argument in a call to (ddchprop2 <ss> )/ x6 ]- P2 _# X, c& K5 o5 M% }
;;;% D* k& R$ z8 V+ L
;;; The (ddchprop2_select) function also sets the value of the2 {. e4 Z# z, |) k7 E
;;; global symbol AI_SELTYPE to one of the above three values to" p K7 E# \4 b% j$ B
;;; indicate the method thru which the entity was aquired.
3 M' @6 M; H( a6 p. V! v: O+ r b! Q4 H' E, D7 P& u; _
0 G; C" M! ~5 h& c& a0 O: S(defun ddchprop2_select ( / )
9 t4 W5 ~0 j- ` z' j; {2 Z, Q6 w% n' R, e9 @
; _6 F- j- A; l: A/ f
;returns only entities in ss that are in the current space. * U8 q' a& `9 N2 }) y
(defun ss_in_current_space ( ss / a cur_space ss2)
$ k9 d. _/ e9 n
- c+ h2 A- F ^7 ~2 y* M (if ss! Z: @7 V/ y7 t& E
(progn
! h7 l; q \/ h% y, | (if (and (equal (getvar "tilemode") 0)
+ H: D- @3 s: c" |4 X6 |, Y1 t7 S (equal (getvar "cvport") 1)8 p! w0 t o i+ h5 ]0 v
);and & [1 g) s- S A0 c
(setq cur_space 1);then paper space is where we are.; P6 U. |4 m, H) f- W) R; f: |, ?
(setq cur_space 0);else model space.
2 R7 @6 o4 d# l6 f5 }$ N& q );if7 n( q- w1 t" b
(command "_.select" ss "")" V% M/ w$ ?! ` g$ H
(setq ss2 (ssget "p" (list (cons 67 cur_space))));setq
9 `! T1 G. V2 b4 \- m (cond ;;;;;tell the user what's going on.! ?1 Q8 a$ A( E; m0 d$ K$ Y9 `
((not ss2) (princ "\nNo objects found in current space."))
) l1 @ F/ Q$ q; f+ B' a, V4 _4 t ((not (equal (sslength ss) (sslength ss2)))
8 P$ ~! v: w4 g: X (princ (strcat "\n" (itoa (- (sslength ss) (sslength ss2)))
5 y0 n5 e. ^& k* ] " object(s) were not in current space."4 n& o2 b1 F/ ]
); M. u/ S; S0 w: e% A8 d9 w
)
+ x4 L3 h' C& } i ) 1 B( F' k' R9 I. b, i' ]) L+ v
);cond
# X; l7 u: H1 ]+ h );progn then/ S1 n+ k. U5 x
);if 9 ]3 m7 @* a: o8 t7 F5 ~0 ?" f2 @3 F
ss2( @% W: z5 e9 s
);defun ss_in_current_space+ Y+ N2 f" w3 s& f
# Q6 P. N* n3 T
3 ]8 S/ E+ z2 b3 j9 D( G$ @' G2 j;;;begin the work of ddchprop2_select, u% a! s$ a( q9 ~& l( z
- T+ ?% Y! c @" Y5 _
;; temporarily restore original highlight setting.0 H- k3 M6 P' [; m& m ^" M
(b_set_sysvars (assoc "HIGHLIGHT" (car bonus_varlist)))
% j& O% m4 M C- C; s- O/ q# I1 g7 [ (cond- c' {4 R6 o1 b* v: `$ O# c9 o% E
((and ss 8 s s7 h# r. S- j4 U
(eq (type ss) 'pickset)9 T j G/ I% b) C
) ; selection set passed to
4 f2 n' D* b: |' | (cond ; (ddchprop2) as argument
; R0 X% h3 N4 Z0 U$ g! j3 s- o! @ ((not (zerop (sslength ss))) ; If not empty, then+ {1 Z/ U! C+ F! i+ J1 k
(setq ai_seltype 3) ; then return pickset.
: v$ `. q- T! k (ai_return ss)& g/ O5 Y* t6 T5 _. x$ T9 ~! q, }
)
6 |) G. Z3 O0 X% t0 m ] );cond close+ H6 a3 ~- f; d8 u# n7 i- B
);cond #13 t b( m+ E7 A7 c# `
((setq ss (ai_aselect))) ; Use current selection: y; D9 ?1 }. L J# i% i6 B7 |
; set or prompt for objects( J5 Q7 \6 k6 }
(T (princ "\nNothing selected.")
1 E. s$ q+ z; T$ d" X (ai_return nil)/ }, h0 u, Y+ H" }7 Q: N: m2 a5 u+ Z
)0 G+ t4 t" z {5 g* K
);cond close( q% {7 p& i; F( t8 o0 c, q
(b_restore_sysvars)
% L' }6 r; n& o2 g: l' t$ K; |& c8 j9 p$ h
# ~5 e1 u0 g* e ;(if ss3 N. o, t" V/ v: P
; (setq ss (ss_remove_locked ss)) / u! z! x$ p+ e! ]$ N7 k
;);if
* m F; w7 a8 m5 X (if ss
t6 M. C+ F. v3 D6 R4 Z (setq ss (ss_in_current_space ss)) q8 V l/ V# z1 B3 _5 ?
);if
" `. K: [ D9 w( W- g
# G7 H/ U7 X$ t8 h6 i ss! G0 C- h3 |, u3 p
);defun ddchprop2_select7 d* H& B9 n, H
- `8 y& H, y( Z8 `
' M# [- V. y; n& p; G0 r: Y;;; Define command function.
" ~5 s7 h s+ O: C0 e(defun C:CCH ()7 |5 W! ]# f4 F. H u' A
(ddchprop2 nil)7 \ h' Z4 f+ Y# Z
(princ)
7 \' \# y, i6 M: Q! O);defun
) l. ]. T/ S5 N: S2 o$ B
7 t& x2 b6 G2 u# \" k; P1 b# V' p$ Q. _7 w
;;; Main program function - callable as a subroutine.
5 f$ m' [5 e3 S;;;
- l- {' T1 x, |: q;;; (ddchprop2 <pickset> )
, Y6 `$ I" m0 Z8 d( H;;;8 ~3 `% N0 f6 Z' H
;;; <pickset> is the selection set of objects to be changed.
8 V0 p3 h6 i: T7 Y% N. F;;;- Q; u( B0 i3 d( v; [
;;; If <pickset> is nil, then the current selection set is( H' ~& G5 Y$ R' h
;;; aquired, if one exists. Otherwise, the user is prompted
- H: Y4 p& c* z7 N0 |7 P) U4 |0 b6 Z;;; to select the objects to be changed.
5 z; c6 a5 f: Y- [ g;;;
; K4 c& h# { U9 a# l;;; Before (ddchprop2) can be called as a subroutine, it must0 V# G* I) ~8 z4 ]% c
;;; be loaded first. It is up to the calling application to, |6 u+ d; e) d& l: {
;;; first determine this, and load it if necessary.! G/ @# {7 J, b
3 E) } ]% b% P, j
(defun ddchprop2 (ss /* I' C! B N( k2 f
3 s) `7 L# M, N1 L
a
9 H- m5 O4 h. t& g! k8 I add-mdash" m6 e0 ?# @ ^8 z- D, [& M
assoclist
- q9 J: t( B. w" b6 _ bit-70
" v+ |- [& k( a boxlength' C/ _; B! E% N* _8 j3 h1 w* k
bylayer-lt
n9 w/ x( E3 U x+ Y& x bylayer_col) |& s# a2 i% A4 C7 [! o7 F
bylayer_lt: ]& m, S1 R5 z) l
call_chp25 V$ U5 g& M7 J, X& _) d! ?# e$ S [
chk-col5 T& S _8 u6 z$ Q! h: z6 O3 m
;chk-etype ;var removed by rk
+ x5 U) u& T$ `! R chk-lay
: [0 x4 @+ @1 d$ j" d0 j! _ chk-lt/ g9 t3 F6 {6 M* X+ \( u2 I
chk-lts ;var added by rk
& f) x% n5 m$ R/ j% Z& W/ P/ t chk-th( ], w+ w' g! C; _# C
cmd, A5 Y; g8 T8 {/ }% y( o$ o
cmdecho
: o7 k$ e4 G: ~6 ~ cn: Q# @" U8 D4 j+ ]7 y+ @5 g* j
cnum8 ~' ?5 l i( b. ^
col-idx+ q+ f+ m: u8 \2 e( Z1 U
col_def6 i b' R; K. `' H
col_tile; [0 B$ C$ b2 k* j9 T5 h/ v- M
colname( L y ?) E2 O. I3 _# }+ G1 c3 }
colnum E: E5 L4 J0 A
color
0 Q/ i& _& L8 J: Z0 N4 B2 W colorname2 Z8 g% w( c1 |7 R! b
cvpname
$ w+ ]0 D2 |7 \; {! X* y) f4 ~3 D" l0 r dash
" `. i/ E8 Q8 {3 j) s dashdata
! U1 M) W; U3 ^, x dashlist* j- F' N/ X0 H
dashsize
5 w, J# i7 q- {. ~0 \ dcl_id. |" N/ X5 p9 k' b) }
ddchprop-err
( K2 t0 L! l$ r0 B. Y$ [2 V# v drawpattern
3 {$ k" w0 g! `' E: {6 n! T ecolor
% C2 z" E6 d" x; w1 x( E eelevation3 M) X8 P. t4 t5 S
eflag1 q7 L1 _3 Q; G2 O
eheight- _7 D) L1 e/ \, X9 Z* A, o
elayer
q* t6 b; X" e4 i1 ` elevation
! D/ l4 ^2 g8 _2 u elist3 Y9 ^- f6 i/ {3 A+ G6 G# M
eltscale% @; a4 x* K$ S7 V3 c( S, a
eltype
* ?' j( u/ y8 [- B) s4 K9 | en
$ a" ?7 T. _3 f9 F' r B ename6 W4 ?5 ]2 o$ t/ _ N' u
ESTYLE ;var added by rk* e$ p# r% H, u- |3 E: S
ethickness( E2 ?5 @$ R" Q+ z8 n; b
;etype ;var removed by rk3 ?' k [: q( d" h/ ?0 ~8 n
ewidth( \& E: W' k1 {3 B9 C9 u
fchk
: S: O1 a1 r9 }$ D frozth
9 O$ i/ W$ ]7 z. N fx# Z# B; E/ N( u5 `8 P
getcolor
+ e+ w6 E$ x7 |6 S. M' ] GETELEVATION ;function added by rk
+ i& F! O2 x1 b& t& J/ J- a GETHEIGHT ;function added by rk; j- L6 h' Y& E i; C l/ ]+ ~
getindex1 E2 A ~ K& b% ^8 b1 R+ g
getlayer- ]' a4 P; k) N( L" C
;get_locked_layers ;function added and then removed by rk
9 A/ R/ X! R7 Z8 | getltype8 w0 {) H- X4 a. x# l7 K$ h
getprops. ]5 u9 Z# S4 C, p
getscale ;function added by rk; r* S) p$ ^3 T+ }2 M) {
GETSTYLE ;function added by rk- b1 b. n6 [4 \, }* y. [
getthickness
+ P, H7 w, w6 }, ~0 B! C9 q; M# _ GETWIDTH ;function added by rk1 t0 H7 Y4 Z) O/ I+ M
globals+ ] {8 T+ j3 Q( Z# y" [* \/ G
HAIR_STYLE_LIST ;var added by rk
/ g! G" Z( H6 z$ M! O; m* f height9 r; } u5 J. [% \) ]/ Z- h W/ c
index
: a, K& h4 h) @3 g' Y0 ~ item
; V5 E3 m+ D. q" _5 q# S- ` item1
# Z- h) A+ `; U item25 K3 L% @5 a0 X* E& m( u5 m
itemlist- V6 i- c* l( i
lay-idx, I* X+ A( d# g0 ?1 f6 T7 j5 {7 y2 `
layedit_act
) W4 f* T# W. ]0 T3 T layer
$ E5 ]5 B1 L% H layinfo ~4 v1 @/ r+ k5 ]9 E2 \9 Q; A" s
laylist
, g: Y2 O) u# d8 n laylist_act1 L$ v5 o! z. D2 E
layname( B0 `1 I% M1 u
laynmlst
( U- G& Q+ R* W! ~1 ?7 S1 E layvalue+ n3 m5 d! ~: v- _
linetype& K N* N Z, t: j5 p" ?
list1% r% d4 K7 }" h# t* z
longlist
4 K! N) z' g, A1 Z1 b6 A lt-idx, \ G1 S2 ~$ j3 y7 g% X2 x
ltabstr
& h& Y7 D1 P. d, ~+ k4 P ltedit_act4 i) |$ q1 ?" Z$ m7 z/ @+ i! a
ltidx
2 e2 s4 _6 ]/ E1 H) R0 m ltlist
; q. R/ Z4 z& _3 Y/ l9 ]: t ltlist11 b, t8 B" ~( V$ P% i
ltlist_act
2 w7 r# l% l/ x* N) K8 a3 Z3 Q ltname
# @* n" A* K9 j+ d1 b7 L! E6 \ ltnmlst+ E! G/ C- G( D/ W$ z0 c
ltvalue
) ^' R V) g N! W* I' H* O ltype
8 }0 V/ D) I: d2 o h/ J m
2 e% n- Y/ E0 r! q& ` makelaylists" W( x4 A0 r0 u' [7 O
makeltlists
0 f: p7 E% ^. `$ O/ D+ W+ t! n match-col2 X v. D+ T( X+ K4 j
;match-etype ;function removed by rk
, Y& [. p/ b/ Z4 {0 X U; W match-in9 I; J5 D8 ^8 r# j5 y
match-lay
9 f! @, u4 @4 g7 f o0 a* N; M match-lt6 L+ r. Q, d6 X
match-lts" Q, G$ T; m, `9 T. z5 V
match-th
6 j! r; U7 J4 A h match_col
% k* | Y/ ~2 i- z mdashlist
" c/ P3 l* s! F) N ;MPOPLST ;function added and then move to ac_bonus.lsp by rk/ L" c2 M. w+ \2 z
n
8 l9 V3 B x4 q5 R4 Y name
4 B8 N; h& s' {+ B ncolor
+ c! m0 A# n) A8 b. a! L nlayer Y; h8 Y: T3 K m+ i
nltype
. ~" i. z) o5 h+ l+ x8 O nthickness
3 u L. L8 p) c$ h2 q" \ off
, H* H6 b8 z% X: Z( U old-idx- L2 {# e& Q" ^& ?
olderr
* u5 C3 W- k. @- t) P0 b) z on4 q; k3 U* z* r$ W# L" E
onoff
1 d3 {8 u1 [( S2 x! A, g6 _5 q6 I patlist& k( \) k/ \; h* g5 `9 u4 u0 ~
pattern
L: _7 K1 Q- b& x9 i PL_WIDTH_GETTER ;function added by rk' b/ m3 z' N" U# f/ ~6 G* h$ o
POLY_SS ;var added by rk* } i0 s/ b0 B- o2 Q3 p
;POSITION ;function added by rk and then moved to ac_bonus.lsp
1 Q+ D3 |6 W+ | proplist+ f- X6 u2 x- A. w
reset-lay0 R( @/ ?; |* }- K, d1 S9 W$ j- j
reset-lt" h0 B/ h) d3 d' x7 a/ Q' ]( W }
s
3 r; T! v5 k' T selset- h. q+ b7 r. W4 X; f6 v2 {5 Z
set_col_tile, |; i5 _1 r0 q
sortlist
1 h; f% \1 K5 ^ ss
: p% T$ u0 q- J) e7 g( M ss_in_current_space ;function add by rk.1 g- F* b6 V7 K0 w N3 e+ y# Y
ss-index
$ u* C& M0 n9 q7 b# Y. X' j8 U! U ss-length
7 w! K- a2 _* `7 W ;ss_remove_locked ;function added and then removed by rk.
) r$ l2 D% \$ W! H sslen4 C9 R8 s" Y. ]- k
temp_color
3 Z/ g% c: s9 m% T templist
7 d3 g/ h+ } O) [ X test-main-ok! B5 i9 C) @+ Z8 n8 `- ] j
test-ok( x- V* i5 |# }- `! g7 J( g! @8 v3 }
testidx# g/ }; d5 Z5 T! ~4 X0 O
testlay
) o# K0 T5 {: S7 r th-value
" B" m* z0 C2 F; w% c$ d' S thickness5 p9 v* O9 Z+ l: s: j6 E
tile
! N- M `. b* z. U1 ` tile_rect# r* z/ w. P- I d0 y0 D. T
tilemode( o) g6 J, f: n: d: x
;TNLIST ;function removed and moved to ac_bonus.lsp by rk
. @" g- U& k% [& k TXT_SS ;var added by rk6 k; `. w4 E. K9 W5 r
;undo_init ;removed by rk.
4 ~, p9 l; u* @- E' D3 ?( \ vi7 V/ g; S. S) J; {/ B6 ^
vpf
: A* ?, v. S) j# K/ @4 ^ vpldata
3 c7 S# n( u3 x! H$ D vpn
: {0 Q: G( G; J" X which_tiles
2 x- {% c: X: M5 ~ width Z1 C6 j8 ]. @# O) s3 v# A
x& B, ?- ]! x6 R; `7 S) n. |+ ^" }
x1
! E# y3 Z6 d- X% r) A x2: G8 }! F" U( Q( h9 \
xdlist1 y# q' \: I' U! {
y
+ Y5 H! j9 e0 Z) Z( w5 H8 U y1
! s9 y3 T" ]6 Q+ d+ |- c y2
0 D9 a8 W6 g; U0 E2 S )3 O( T4 O7 {2 D" j7 i
; O, ]/ m7 Y, D. O6 a. L! |% l
(if (and (not init_bonus_error)
* ]9 O9 C ^/ a$ J5 ^2 F (equal -1 (load "ac_bonus.lsp" -1))
$ t1 Q8 I. M4 n5 M, Q: | );and
4 k, ?5 f' y5 c! _0 y' [& i5 { (progn (alert "Error:\n Cannot find AC_BONUS.LSP.")(exit))4 Z, w5 U9 _& D. C8 I* g
);if! R! l6 k0 N8 G5 e0 H& y M7 ^
(init_bonus_error (list
2 D- i# J* Y6 G) j6 J9 z (list "cmdecho" 0 0 x. K- R8 e9 E9 r
"highlight" 0
# @1 G8 t; W* u "regenmode" 1$ H$ ?" W( c* h" j7 a i% M( a
"ucsicon" 0# `& T$ U6 R a) D" b- f: x
)
0 S! Q! A {) b% X. S T ;flag. True means use undo for error clean up. & G+ G1 i- {8 _
);list 2 D0 V( R Q) Z% Y" ^+ R, l% j% C: I
);init_bonus_error. Z& P8 e! L( }1 G7 }
% P$ p0 u8 Z3 x3 }& X0 \ (cond3 o6 ^; q0 \+ y
( (not (ai_notrans))) ; Not transparent?. u- X, |/ B7 m$ @
( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?/ n$ q. L8 G, e( S& Z( v4 D& q9 F
( (not (setq dcl_id (ai_dcl "exchprop")))) ; is .DCL file loaded?8 t/ l! |) i. w$ p' h
( (not (setq ss (ddchprop2_select)))) ; objects to modify?
. H) b3 h- |+ ^- r5 [ (t ! F% o; o: W* G9 Z5 S" H9 f& \$ j
;(ai_undo_push)- r% ], F* h2 f! Y) Y
(ddchprop2_init) ; Everything's cool,
2 j) j0 M ] ~4 r5 \: p4 j1 p' @ (call_chp2) ; so proceed! I- k7 Y, k$ G! u7 d4 b
;(ai_undo_pop)9 @ X# _) V. i" Y
)4 [5 j% ]. [5 n X& x% ^1 e) P
);cond close
+ j/ M: o! d- B$ p6 F$ ?8 q9 [8 Q9 O* l: U) C
(restore_old_error)
( A. M. g h) x5 a4 ^7 n. k+ s# W$ M3 e7 e
(princ)5 g; c+ g- |6 T7 T
);defun ddchprop2
- n$ `2 S6 z$ _+ \+ O s, L0 u1 V( a B
7 L3 C# A7 I( o" \0 h;;;----------------------------------------------------------------------------
$ d* @" K8 i& F8 `( ~# r
! h/ p7 j1 _. O( E/ }3 h3 N# z(princ " EXCHPROP loaded.")
; B1 i, A H4 S1 t0 ~) s. c( I(princ)
8 \/ x. C* j Z9 J; z( J
3 {# ^, T3 b" ~6 g) F1 s. B- S) X# j;;;----------------------------------------------------------------------------4 a! n* Q+ h; i
;;;---------------------------------DDCOLOR_LSP--------------------------------& w$ v8 }! z6 d X
;;;----------------------------------------------------------------------------8 o: o1 h/ I1 G% }; d- w
2 s$ d$ [3 m% ^0 s3 Q% V
; Next available MSG number is 24
7 O) u# J: `; P/ b; e5 `# o9 Z; MODULE_ID DDCOLOR_LSP_% }7 O) y$ M) J$ E, G
;;;
$ t) {1 P% I5 i$ B9 f9 P1 a4 R, D;;; ddcolor.lsp1 E4 z0 h4 Z7 @+ \
;;;
) d) ^: Q4 H: A; y! L% |;;; Copyright 1990, 1992, 1994, 1996 by Autodesk, Inc.. W5 n# D- N4 O; ?- Y
;;;
, U, t0 x5 q9 {; @, H- {;;; Permission to use, copy, modify, and distribute this software6 c$ O( F! \2 o- k o
;;; for any purpose and without fee is hereby granted, provided
7 M: q+ @8 J! z& ?& X/ R6 _;;; that the above copyright notice appears in all copies and
' ~6 x# J5 m9 s+ E. ?2 r; K) q;;; that both that copyright notice and the limited warranty and l: \, W& F5 h8 }( p
;;; restricted rights notice below appear in all supporting
, s% \2 V8 g( ?6 u* |;;; documentation.# W; S! M# O$ t, m
;;;
. X( n% R! z V6 Z$ d% {6 r;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.+ y5 M3 ^5 J) H& I
;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
# S( ^) n4 z. I9 Q. O6 S) D;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.+ O" L" Y. m3 G8 j+ P* I
;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
; l6 ~* k! w; t- F+ y4 H;;; UNINTERRUPTED OR ERROR FREE.
$ `' @/ {9 j# o; T( ~;;;9 q5 b6 E) T: G7 x' s
;;; Use, duplication, or disclosure by the U.S. Government is subject to: n3 u+ o* O d+ ^+ l
;;; restrictions set forth in FAR 52.227-19 (Commercial Computer
' f5 a. T6 `! h% \' L! G: U4 m;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) - b! c+ I, C" y9 l& Z8 K! p6 M3 }* z
;;; (Rights in Technical Data and Computer Software), as applicable., f0 ]7 q, N# G! i3 u" M
;;;! F0 l* I/ O( c: Y" |8 o
;;;.' T& |1 `& |& S X" j7 t
;;;
5 v8 {0 @! l5 e( I;;;----------------------------------------------------------------------------
/ d- k. h- |$ X/ \, B9 D;;; DESCRIPTION
: t) O1 U) {- [;;; 8 p( U: A7 {3 R
;;; Chromatic Pallete style color selection dialog.. G/ f" k* a! S2 b8 |" J: v, ]
;;;
* _( X7 d' E+ K+ ?4 A;;; Globals:4 h! S# Q* U9 W6 P
;;;
2 j% C" v0 @# B8 q4 h" ]" x;;; chroma_color - Integer color index. The last value selected3 C# ?: }, v$ G- }3 j6 h( B( ~* p
;;; by the user in chroma dialog. It is not cleared or reset8 t# r6 ?; b( O; b1 W
;;; by a cancel. Only used for communication between callback
# U5 ?9 ^1 K# _' @' y6 o;;; functions and the (chroma) funciton.# ?) W, B( I1 D' W# _
;;; , H- b: R. _# K' N
;;; Depends on the definitions for the dialog provided in chroma.dcl.
0 B4 N3 T1 d$ e7 r, C' b% s4 K;;;
) t! M& I* Q! S# Y0 e$ c;;;
( w4 t/ \6 v6 P @ Z* u7 N;;; C:DDCOLOR -- Dialogue front end to the CECOLOR sysvar. Uses the chroma . R8 m% v7 B5 a4 @
;;; pallete style color selector.+ v( J: c* l. T) S# T8 E0 Q8 K
;;;) d* b7 B$ B) o; L$ F( a5 u
;;; =========================================================================== p: y# {# u1 D6 N( W4 n
;;; ===================== load-time error checking ============================
3 Q( y3 P- ^) v- [5 @;;;
1 v0 W2 X% |8 s7 F! Z4 [8 R1 a8 f0 b
(defun ai_abort (app msg)# V# c- B k5 h/ g/ @
(defun *error* (s)
* D v1 }' n, b; i9 F/ B (if old_error (setq *error* old_error))
& K/ j# n2 r1 K9 T$ s0 g# C: Q (princ)1 V6 i: Z/ J' O
)9 z: ?3 r& a1 w) N N+ i. U$ v
(if msg: @' e& k7 U; S+ i
(alert (strcat " Application error: "
$ {: X1 H3 t7 ^2 t app
2 I, k$ b0 O+ A' }1 W " \n\n ": @2 g5 g8 u5 K# r( N1 N, I. L( L, w
msg
+ J% D3 E1 m3 |3 v$ O. A3 @* x% B " \n") J* @( n* o' C! A7 J& \
)
# X% O- F! ?5 R9 p2 c ): u/ F* e/ }) U) J: {' n
)4 o5 C- L$ ?: S( |8 t E
(exit)
! m7 o7 H4 @, j; n! b) Z) f. I3 @ )
7 m5 \# O5 n; p1 N, A$ V* e D1 n% @7 f, _+ q* a0 p2 v! {. j
;;; Check to see if AI_UTILS is loaded, If not, try to find it,
9 ^4 P7 c) R$ x/ v# X;;; and then try to load it.
' U0 Q+ o8 ^( C6 _$ D;;;+ s4 m9 q4 P; P* \( U. R' I
;;; If it can't be found or it can't be loaded, then abort the
# O% L6 P! `0 ]0 Q+ i" o/ z: G;;; loading of this file immediately, preserving the (autoload). n1 D& [4 y- H- g, @, J
;;; stub function.
' B- z9 f9 S# R& u2 `1 h0 \& k* q9 b' i4 P4 d: M/ i% A4 R1 f
(cond" s8 H" `! c! Z3 z2 j" S+ Q5 I
( (and ai_dcl (listp ai_dcl))) ; it's already loaded.( s3 @8 }& u# N3 @
4 w3 S* _9 a8 B0 F
( (not (findfile "ai_utils.lsp")) ; find it
4 {7 L- i. @/ T5 j) Q (ai_abort "DDCOLOR"9 e/ t, V7 d2 \$ I7 s# a% F3 K) N5 i
(strcat "Can't locate file AI_UTILS.LSP."
* E; ]& s h( h' N6 o0 n "\n Check support directory."))): E) p J0 x, H
( {# j3 K, I) i- C8 C7 x
( (eq "failed" (load "ai_utils" "failed")) ; load it
) n' t3 t9 j1 | T2 n! c (ai_abort "DDCOLOR" "Can't load file AI_UTILS.LSP"))
% T. N6 j; i- r; S% @) k9 S9 ~ )
3 I) M4 s1 q5 t& Y: i8 J' L, ^5 l& e2 w( [: P3 f
(if (not (ai_acadapp)) ; defined in AI_UTILS.LSP3 E& `/ r9 l/ ~2 c8 r7 v
(ai_abort "DDCOLOR" nil) ; a Nil <msg> supresses
7 m0 O' S4 H+ i0 ~ ) ; ai_abort's alert box dialog.
, ^# P6 [( e" O/ H' g# i! ~4 N4 _3 c( G% u* |6 D# \5 W
;;; ==================== end load-time operations ===========================4 r6 u/ U* T8 ?. X3 e8 J
) U5 H. O: L. n' p0 s [(defun c:ccc (/ co_oce clrx co_err co_oer lay_clr)
& A2 ]1 S0 t$ o0 Q+ Q5 [# H+ @8 L$ P0 ^7 m- H7 p( v1 [3 R
;; Main Color function, called by setup code.& O: \! j7 l2 T& z5 K$ y* p5 g7 n
(defun ddcolor_main()
j2 [- h; N2 o4 B# B) h5 x( N) ]% X8 ]
(graphscr)7 R; \0 \8 e: P6 b8 I1 @1 U* }
* D% s9 A5 V& S7 o: A1 m ;; Get the color of the current layer, for possible BYLAYER color swatch.
6 T2 v7 t# e: Z3 E s (setq lay_clr (cdr (assoc 62 (tblsearch "layer" (getvar "clayer")))))7 X# |; n" i7 I' W6 t
4 k7 E: x: m' r' o
;; Call the dialog here...
1 S7 B- u# d; p7 s" m9 l (setq clr (acad_colordlg (cstoci (getvar "cecolor")) T lay_clr))' W" r! F X% Q- N
9 g! U& P% D6 K0 A" g' n; J! L (if clr
' J$ L; k# s* D- A+ s* R (setvar "CECOLOR" (citocs clr)))
; z# i! H5 k3 _! O8 M2 F )
& [- `$ x4 `& i) J) C. M. M1 F$ J( C3 m, P4 m+ B- i
;;;
8 W0 Y9 q7 Q9 M+ F ;;; CSTOCI -- Color string to color index+ L" G+ {8 ~3 W
;;; Convert an arbitrary case string into a color index.8 J' u& d) z' a# t
;;; Returns nil if string is not a valid color.
d, _5 g% f+ `' C$ ` ;;;
/ h( B3 t ^. D4 ?& P) {# b' w (defun cstoci (str): G8 U8 |) q/ d" k+ D2 ]
(setq str (strcase str))! O7 I# e5 b" C1 \, w
(cond
4 `' f/ s; S& P( l. \/ n ((= str "RED") 1)
5 G2 J) \5 o/ b4 y% Q/ }( l ((= str "YELLOW") 2), ~! k* B" @* g# r; N
((= str "GREEN") 3)1 z0 \" g4 t+ t6 i* n" V
((= str "CYAN") 4)* [0 w c! D2 O9 ], L7 J
((= str "BLUE") 5)
3 e: a/ e: h0 [' h% Q ((= str "MAGENTA") 6)
& I }/ U: N- E7 H4 I ((= str "WHITE") 7)
( Q& D$ h0 N8 K7 _$ t) H1 d9 J ((= str "BYLAYER") 256)
8 U! T; T3 s% g ((= str "BYBLOCK") 0)
1 [' C# u) ?: b" C. W( c ((= str "BY LAYER") 256)1 A2 d1 Q. ?# ]; ^% g" a' \
((= str "BY BLOCK") 0)1 C. V7 e1 S2 n* s
((and (< 0 (atoi str)) (> 256 (atoi str))) (atoi str))0 C* }) S; ^! m9 `4 S1 I
(nil))4 ]& X: D* j1 n" F0 k: D
)/ x0 q6 U P+ J2 s
/ b$ `2 V1 M4 G! \$ ]8 W( s2 p* v) M
- e1 i# {8 @7 s ;;;
. P8 s9 k( |1 w: c ;;; CITOCS -- Convert color index into standard color name.9 P7 j% d- P( o6 f
;;; Will return the standard and logical color names as text
/ Y, @) X+ s8 N ;;; strings. Returns nil for out-of-range color indicies.3 c1 v8 e) i1 y. h
;;;
; R* t: e7 @$ Q (defun citocs(i)
# F4 e1 S4 Z2 a y \ (cond7 ?5 U0 x8 m3 c& |( i
((= i 0) "BYBLOCK")! [9 D4 |% A4 h3 ~6 ]3 i
((= i 1) "red")8 v# H0 y. C" e1 w- L4 r7 k. y
((= i 2) "yellow")7 I& u$ A0 Y) N( L: V
((= i 3) "green")
4 _, m; m. R5 ]& C) l2 q ((= i 4) "cyan")4 I1 E9 F4 p0 d6 [. Z c7 I* B
((= i 5) "blue")9 K. t4 A! W9 [: t" S1 Q1 D5 o
((= i 6) "magenta"); g1 a7 ]: _& ~
((= i 7) "white")
$ N/ n( ]9 F) H$ N2 R ((= i 256) "BYLAYER")# d( \3 i; H7 J$ C) D. `
((and (< 0 i) (> 256 i)) (itoa i))8 f* D, e& z4 V, x
(nil))
+ W% p& w' V% h! x1 W% P )" i' n' M* U) P) U& e, F' e
# j8 \, O. s1 K6 D) P3 u ;; Start of ddcolor {3 U3 r3 u% E9 t
(setq old_cmd (getvar "cmdecho") ; save current setting of cmdecho1 }# {7 m V' Z: B6 {- m+ y
old_error *error* ; save current error function
6 U- v0 E1 g( ^4 F5 p! c *error* ai_error ; new error function
+ w. ^& O1 C+ c; {; F& ~2 W8 B )% k# A9 m8 c2 \* \* _
) k! u7 @; q& N4 `2 k/ R (setvar "cmdecho" 0); ?; [9 A$ a( L6 b9 J9 S! I6 } i
! [0 Q& d) @) C% k" O
(cond) x2 t' ]" F j
( (not (ai_trans))) ; transparent OK
+ ?" `9 |! B! y ( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
/ h4 w4 h8 a0 K6 F: j6 g
! a+ N7 L9 t) g4 S9 M" } (t (if (and (/= 1 (logand 1 (getvar "cmdactive"))); M% p( m# h/ N4 a& y8 ]
(/= 8 (logand 8 (getvar "cmdactive")))
5 \* N0 A6 B o# T )
- y/ u' @8 z' c( ]) j (ai_undo_push)
6 |. Z8 m I6 g( {$ O. q7 `6 L2 ? )
2 Y3 H; p) X8 s2 n
& S9 z: ?6 i4 L# q2 L (ddcolor_main) ; proceed!
0 [1 }% T* D3 H& v, } B
8 Y- v* w0 \, a6 J: L (if (and (/= 1 (logand 1 (getvar "cmdactive")))
& m! L3 G* z/ r) R( R (/= 8 (logand 8 (getvar "cmdactive")))
( E2 M0 a5 ^" _: N1 \ )3 y- l- x: K9 N' p' J. u
(ai_undo_pop)% ` m4 ?/ a( O v( r
)
V! h2 G2 i+ q )' h' i) c3 L; ]
)! I* u$ u# _3 x; c9 U' ]
0 e$ F! j8 I4 q7 T. D* Y$ O/ j (setq *error* old_error)
. U. o) r: n, T' y5 ?+ M- c' @ (setvar "cmdecho" old_cmd)
% S5 @7 u0 N3 o0 K6 p/ K' m# t+ g (princ)
/ a- H4 x+ r: X; C1 Q; Z6 k5 w7 b; ?) x
)
3 s( u8 o" e; \4 N; W" X+ R+ b) \& i$ E
;;;----------------------------------------------------------------------------
0 {$ y2 U) ]5 V) h" ^
& k' V, R' G* F E9 O+ T$ \2 F" z(princ " DDCOLOR loaded. ")
5 B2 l/ e3 I5 [4 }! n+ d(princ)
6 H; `9 M1 j2 ]2 } X* D! i- b' Q) }! Y' Z2 P( |
;;;--------------------------------------------------------------------------;9 n% O5 R0 m0 `3 A' Y9 z/ z
;;;---------------Chon NHANH Nhieu Doi Tuong GIONG THUOC TINH----------------;
& D# L1 w1 a3 ~0 t0 H( o;;;--------------------------------------------------------------------------;: P* t2 t& r; c
;;; ssx.lsp, ]3 W+ d" w# k7 {" e
;;; Copyright (C) 1990 by Autodesk, Inc.( C* w' n V Z/ i9 r& l- X
;;; Copyright (C) 1991 by Control Systems, Inc.# ~6 r. W x' r& F Q$ ~) _
;;;
9 @7 k" V7 k# o% l# \3 C;;; Permission to use, copy, modify, and distribute this software and its& i6 o; p: f; r7 g8 f7 s. j
;;; documentation for any purpose and without fee is hereby granted.
. t% n& i' d+ V8 a;;;6 V: a3 d/ }2 m" K" I8 F% P
;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.* d& R! G& P" Z' G, }
;;; ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF) P( s; R" Y+ ]3 {, n. @4 s6 u0 r
;;; MERCHANTABILITY ARE HEREBY DISCLAIMED.
* N) k2 A! b% ]4 p* W;;;
0 v7 p, L0 x2 u7 ^* ]: \! \" }( g;;; Larry Knott Version 2.0 7/18/88
" b* r7 m5 ^8 u;;; Carl Bethea & Jan S. Yoder Version 3.0
" h; l( }8 M% R0 W* ~;;; Enhancements to (ssx).
" S$ L* f. P7 Y$ b! l' l;;; 15 March 1990
( s. @' z/ D" D) y, S;;;. c! w% r/ @4 O/ X
;;; ARTIST Software, Inc Version 4.0 December 19910 P8 X3 R( b* Q& t
;;; Modified for FLEXICON usage. If the variable FLEXVAR = 1,: j1 o. u7 O/ d. Q6 f' c) x' G) S
;;; use Flexicon menus$ r' o; o. N5 I: x7 R, k
;;;- i: s! @! e) o" } y; P% M
;;;--------------------------------------------------------------------------;
8 @5 v% Z$ U0 @4 d( Q4 ~' U# w;;; DESCRIPTION3 R# z7 t# a% E, n. s7 j
;;; SSX.LSP * b) ^+ r+ H. T4 Q2 i" K
;;;
2 O# z/ i* g6 X3 Q9 M' f1 ~;;; "(SSX)" - Easy SSGET filter routine.
8 @2 D: G. ?% C! k. Q: i;;; ' _( X1 L, a- F5 k+ D
;;; Creates a selection set. Either type "SSX" at the "Command:" prompt
9 f. i. }4 U# a6 @;;; to create a "previous" selection set or type "(SSX)" in response to
, Z! L) h4 E% ?. E& b( a5 z;;; any "Select objects:" prompt. You may use the functions "(A)" to add - d1 \) j; p' ?0 R, T f) ?
;;; entities and "(R)" to remove entities from a selection set during 6 u* i( s. Y* e
;;; object selection. More than one filter criteria can be used at a & x0 T4 q( y( c, ^! V; q
;;; time. / W7 K! M$ v: N& u6 I @$ s
;;;
" f6 ]3 d( R, f/ l- U" K;;; SSX returns a selection set either exactly like a selected
3 N- S. R' U& p! R;;; entity or, by adjusting the filter list, similar to it.
$ e. E9 l# j- k/ [7 S' L) z, };;;5 d; q$ V; V* [# i! @! H- i1 S; Y
;;; The initial prompt is this:
) [0 S. K) h) D! \+ w;;;
% U* M& C- Y# P+ p1 s9 Z9 L8 E;;; Command: ssx
( j' Y) @$ ^. X/ c) c;;; Select object/<None>: (RETURN)
7 u6 D1 f( Q6 Q4 ]. b;;; >>Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector:
' O8 p9 a u1 W' j3 }' B;;; % n/ W9 i9 e2 I2 P4 X% z
;;; Pressing RETURN at the initial prompt gives you a null selection
! O) N& W% e. j' a& R% _* p;;; mechanism just as (ssx) did in Release 10, but you may select an
5 u- Z, V5 K2 s, T3 ?. b$ k;;; entity if you desire. If you do so, then the list of valid types ( l5 }! D, f3 r# l; @
;;; allowed by (ssget "x") are presented on the command line.
: w; v3 c; B% H6 s4 d;;; ! D2 b1 x! x# E, m6 Z e
;;; Select object/<None>: (a LINE selected)* t& T# ]) G" h% ?7 @
;;; Filter: ((0 . "LINE") (8 . "0") (39 . 2.0) (62 . 1) (210 0.0 0.0 1.0)) ) y9 M- v& _: _7 }; O& z' }! G
;;; >>Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector: ! D# T7 I0 J$ F3 f c# q! Y
;;;
6 X. i0 U. e3 t9 y2 y( u+ l& y- p;;; At this point any of these filters may be removed by selecting the ; T3 I) |* ` ?* ^/ m7 [1 F! q
;;; option keyword, then pressing RETURN.+ U/ j6 J+ ]% w
;;;
7 m+ K6 n. j5 {$ t7 H5 G' _+ |;;; >>Layer name to add/<RETURN to remove>: (RETURN)
; b. b: I c. g3 M6 X3 y;;;
- k% H( E7 P' z$ a+ H: `/ J7 I; {;;; Filter: ((0 . "LINE") (39 . 2.0) (62 . 1) (210 0.0 0.0 1.0))) y. C3 q" I! g, Y }
;;; >>Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector:
. k& j0 _/ Z. |- ~- R* N+ E7 N;;;
1 ?( n4 A% m2 L" j# z;;; If an item exists in the filter list and you elect to add a new item, 4 f0 ^% ^ K& S! ?, S
;;; the old value is overwritten by the new value, as you can have only + w/ p$ B' w/ D7 g
;;; one of each type in a single (ssget "x") call.
4 D) }! z l! S# ~1 O- e$ Y7 w;;;
9 N# @! C! W# m* T: D;;;--------------------------------------------------------------------------;
* w b& t' ]! f) t: r;;;
) @. n, P0 w9 y3 _ f2 L, O;;; Find the dotted pairs that are valid filters for ssget
" ?0 n5 M/ S4 A% p;;; in entity named "ent".
8 Q. N4 I! w/ [3 F0 O* K. {;;;
( J. Q: \) J- L5 B7 f+ U" V% O0 S;;; ssx_fe == SSX_Find_Entity* `9 H" m6 h& }& e" N) D9 L# v
;;;
]+ Z) t7 _) C4 H( M. C; W(defun ssx_fe (/ x data fltr ent)
% i( N* @& Q' _/ t9 Z (if (and (= flexvar 1)(/= t2 "Pick"))
4 A% H5 D$ j! }$ P! N (setq ent nil)
& h. u# z u" D; u (setq ent (car (entsel "\nSelect object/<None>: "))). ^- p+ k# X# T$ m& w* d0 Z' Q
)/ R+ P+ j# y! ?: l$ Q) c- x, B
(if ent
4 R- \7 Y( L. `( a: ^ (progn
$ M# k0 k# J! Q8 B& n% `2 F; N (setq data (entget ent))3 X3 O6 l( b" w2 ^7 b
(foreach x '(0 2 6 7 8 39 62 66 210) ; do not include 38
! t, f% E L- E H, G! r (if (assoc x data)
/ ^7 |- Z* \( j9 Y( D (setq fltr ' G! d, k$ P# T! i% v/ C! b/ [
(cons (assoc x data) fltr)& @' w$ D+ S9 j/ T* p3 p4 l
)
$ l* y8 M7 j5 ? t$ H' H: s( e! [ )0 ^0 @$ m/ }, j5 G* w6 Q$ n y% ~
)
4 @; T% W7 y- o6 f' ^% u (reverse fltr)5 }% _7 h1 g# T) k% ?2 ]
)
; W3 i8 K/ M" W# Z" k* P ) " y; X7 ]' Z" B( @* {$ o: Q
) _( j' j! \% ?& z' q: w3 X/ c$ r
;;;( E! A. ]/ a4 ]
;;; Remove "element" from "alist".
3 t$ F1 l& A8 C;;;+ C3 ^6 p- G6 z& ~0 Y* ?9 P5 A
;;; ssx_re == SSX_Remove_Element
1 t4 o: ^ M J6 h3 [2 b, w" @;;;
8 s) U" u% \; q/ e6 w(defun ssx_re (element alist)* @; k' ^# m) c( c$ k5 h
(append6 t2 B$ A+ G$ M9 y6 o# A, @* r; S
(reverse (cdr (member element (reverse alist))))* H0 \& w( {; Y. y; [; M
(cdr (member element alist))
% v# [$ N: ]4 s$ ^3 ] )
; y- [4 m I1 P)2 @3 u c6 @2 ]3 K3 w
;;;
/ X- j# ~% }7 l5 D& Y;;; INTERNAL ERROR HANDLER / U* U, J- _; R1 h- X
;;;1 v$ q, _1 `; W6 v+ a3 ?
(defun ssx_er (s) ; If an error (such as CTRL-C) occurs
- F) v2 i% o7 B! _' l" @2 W5 T ; while this command is active...
5 F( a7 _+ \7 F# |4 R' b (if (/= s "Function cancelled")7 d, b/ S3 D/ Q4 v6 V
(princ (strcat "\nError: " s))% g1 J+ S3 E! z
)
; J: j3 ~5 V6 x8 h5 l0 i, B+ U4 ~ (if olderr (setq *error* olderr)) ; Restore old *error* handler
! M9 G, m! D m (setq flexvar 0)
/ A" d* F$ p) g/ J) B% O1 @. d (princ)
, f- D' k5 [* W, q)
* |* n1 }8 C D; ^8 M;;;' n+ E h @- j m8 Q3 l
;;; Flexicon call routine6 b! R0 O3 V6 D7 C: E
;;;& z: A" C: @: U- m5 R3 X
(defun flexmnu (a)' d* ]" C$ I$ K9 N
(if (= flexvar 1)
$ L2 [0 a% d' |# O- \" i (command "FLEXICON" (strcat "FLEX" a))
2 E6 ]. X& ^" F0 {6 r: J ), Q" F0 P- H" N
)
4 n8 K4 ]" Z& |& d1 e
5 F# }( B+ ]; e/ `! N' J;;; # v2 a; E6 j; Z. k
;;; Get the filtered sel-set.
2 N! s5 |! e ?$ w& s6 n;;;
, f% C1 ]7 _* E;;;
3 K2 V7 T( A) h3 }. @7 c" U+ D(defun ssx (/ olderr)0 e2 u* Z! T! N
(gc) ; close any sel-sets
+ b' @5 o. @+ ~& Y) a2 t (setq olderr *error* ( k0 w) t) `; b3 A& B+ t3 Q
*error* ssx_er 6 m. y w" ^8 b" g
)
\" i2 l- B! x9 N% j" b/ t6 H/ X (setq fltr (ssx_fe)) ) L u: m1 a { J4 |6 O8 R7 Y
(ssx_gf fltr)
}4 n8 m. T4 g. V1 R (if (= flexvar 1)- |+ g) b3 p; Q8 Z
(progn# r% P/ H2 f+ j" V
(prompt "\n \n \nNow select the required EDIT command and (P)revious.")* j0 w5 U/ c7 ]- V1 ?6 O h
(flexmnu "EDIT")
. I) [( h7 i0 O- b( u% u) `! ?* O- A )
/ |5 I/ }, T. P/ k: A# S6 J (command "p"); ]* z+ w# w; Z5 K% O! x
)
) E: m* e; m2 R! Z! R% L4 ~- P (princ)
! o- c2 |6 ^- k+ i)
% R0 Z x9 R+ M' P;;;
4 h: P9 j9 l1 \5 _ M;;; Build the filter list up by picking, selecting an item to add,
3 P2 j- o1 o( g0 B4 f;;; or remove an item from the list by selecting it and pressing RETURN.
& x# G. W" @, i& a) p2 K) W3 v;;;
7 q: D7 }# h0 I, {4 Q;;; ssx_gf == SSX_Get_Filters
3 s) A# b) a5 g4 v2 W y;;;' m6 E" e' a7 _6 a
(defun ssx_gf (f1 / t1 t2 t3 f1 f2)2 M4 a2 d3 |8 n M- @/ ~
(while 3 ?0 t; V2 Q; O& K4 `& G
(progn
) W/ W- U( \: ~! W (flexmnu "SSX")
O3 r. |: g* Q1 o% w (cond (f1 (prompt "\nFilter: ") (prin1 f1)))9 W3 @, V6 ~! S
(initget 5 R+ E% H) ]4 n! J9 H0 Z2 T' j9 i" I
"Block Color Entity Flag LAyer LType Pick Style Thickness Vector")
9 V) \8 }7 E6 Q+ j6 g5 Q (setq t1 (getkword (strcat! T& e# J# X' W
"\n>>Block name/Color/Entity/Flag/"
4 E1 b- |4 ]" V4 e) L "LAyer/LType/Pick/Style/Thickness/Vector: "))) : y3 Y ~. h: e6 u
)
1 e2 }" @3 L: ]7 N (setq t2
5 v4 \0 n* w& z% }3 O& B* O1 |% b (cond
/ Z2 R+ J1 y! _- l4 M ((eq t1 "Block") 2) ((eq t1 "Color") 62)
% n2 o" \$ U7 l$ S, }2 T8 { ((eq t1 "Entity") 0) ((eq t1 "LAyer") 8), w @% v/ V, Y. V! w8 }/ ?
((eq t1 "LType") 6) ((eq t1 "Style") 7)7 U6 C7 D+ i* O+ q
((eq t1 "Thickness") 39) ((eq t1 "Flag" ) 66)
) B }6 S1 W- p3 S, T ((eq t1 "Vector") 210); o6 H3 d3 l0 U% W
(T t1)4 |, n: H1 i5 _2 L) p! |
)
2 F; M5 k% W0 K& ^ )- p# S; r+ t0 Q$ S# `6 O; \; o7 g7 C7 r
(setq t3- k! N' p z O, ?9 a% x- E* K
(cond
* x8 P1 n4 x% O% ? ((= t2 2)
% h& V7 @2 @& ^ (if (= flexvar gtads 1)$ R$ z- f/ G* _8 Y& K0 f
(progn
7 D7 F2 A( E Y: l+ Y8 h: C% M (prompt "\n>>Block name to add/<RETURN to remove>: ")' |" l# \% y U9 j* L& p
(gttable "BLOCK")/ h) \3 g8 k, E& d6 s1 C. w1 _
)
0 l# x/ }6 H% `# v7 d (getstring "\n>>Block name to add/<RETURN to remove>: ")
, K' u6 R4 C" y )3 J" ?+ f. V) o
)/ I3 Q" t& c1 ]% q m/ g
((= t2 62) (initget 4 "?"), a1 F3 ~5 a! i) ?4 c
(cond0 s6 }4 q$ G; W
((or (eq (setq t3 (getint * z6 k6 {4 ^" p2 O8 v! H5 [
"\n>>Color number to add/?/<RETURN to remove>: ")) "?") ; Q2 I: }4 s/ E8 [! {
(> t3 256))6 j" R1 e% b$ O
(ssx_pc) ; Print color values.7 g$ P5 @% ]* x0 ]
nil
# ]$ E) y" ?9 {/ | )0 L$ @+ H& @3 L+ m; f
(T
0 `8 g2 o' y9 W! K0 ~! G& U t3 ; Return t3.1 Z1 B! u3 Q+ C. J% q! K8 o- A
)
" W8 \9 s a' }' K* R$ W3 U )& ?+ W, b& c0 C8 G. J& C9 g) r
)
( }+ ^* B0 u2 v% A0 z* E ((= t2 0) (getstring "\n>>Entity type to add/<RETURN to remove>: "))* _! b! T7 X& D% Z
((= t2 8)
/ U! M( |3 x. n8 Z! y9 q (if (= flexvar gtads 1)4 V! z: g& f; g& G, I! {0 R( C
(progn
, ~4 \& W5 b5 Q5 d3 g: A) F1 S7 y (prompt "\n>>Layer name to add/<RETURN to remove>: ")
; Y9 L! A4 [4 x5 F7 S (gttable "LAYER")
% h8 w* W' `7 V4 E$ s- v, m )
$ g; v5 o) ?' Z' a% r2 i (getstring "\n>>Layer name to add/<RETURN to remove>: ")
7 D# ?/ {" R$ C* v )6 A2 Y0 h0 M' F0 Z' K o
)+ ^, c( r7 V+ P
((= t2 6) & T! ~/ q0 B% n
(if (= flexvar gtads 1)* T" m4 ]% s: x% _5 F2 L
(progn
) o9 F: E# c1 V4 S (prompt "\n>>Linetype name to add/<RETURN to remove>: ")
3 C! k y0 p- V6 n9 o. S (gttable "LTYPE")
( o3 L. E0 a& S0 p) T )4 I: \% t: R2 D7 m# K( c% `
(getstring "\n>>Linetype name to add/<RETURN to remove>: ")
3 {7 a) D( d) P$ }: u( ^& n- W& b )
- d) `- g! n$ B; H )
, c" f! X/ \: o { ((= t2 7) * H! c9 v( x4 G& G( ~$ _
(if (= flexvar gtads 1)
, O# |; }% ]- c- h5 P (progn
* S, Y Q. Z$ z v. Z( o& {- p (prompt "\n>>Text style name to add/<RETURN to remove>: ")
9 {0 B, r8 L0 D (gttable "STYLE")
" _# d3 Y0 F- P0 ]. N( F% N& T )
" Q: K- c; x7 ?$ @ (getstring "\n>>Text style name to add/<RETURN to remove>: ")6 L+ Q w1 r5 B
)
& N$ z4 t4 }! T0 z; X# d )
" S) E. f5 u Z+ @ ((= t2 39)
+ @' k6 g4 G9 ?" ~4 o1 E (prompt "\n>>Thickness to add/<RETURN to remove>: ")
; O& w5 Y! l- T8 l& [ X+ W9 k6 [ (if(= flexvar gtads 1)(gtfnum"Thickness to add:")(getreal))" b5 `2 s: U9 S2 G F" ]. ^
)
3 ~& i2 `. e) q# l0 e, T ((= t2 66) (if (assoc 66 f1) nil 1))$ ~# a3 |4 z G# c1 @ c
((= t2 210) , H: W# d; f3 S: T! ~
(getpoint "\n>>Extrusion Vector to add/<RETURN to remove>: ")
+ {' [4 W1 ~' |+ T- O )2 ^. k) I# a3 N
(T nil)
8 B" t* o2 z5 W8 ^' _# h )3 C! V8 g0 y4 ]& c5 V" y
)0 t3 F$ g" ^- Q! J; `. w
(cond& E! J% N: Y L6 z4 E4 V
((= t2 "Pick") (setq f1 (ssx_fe) t2 nil)) ; get entity, n2 u: c* K- r3 P
((and f1 (assoc t2 f1)) ; already in the list
0 l, F* j2 t' x* n (if (and t3 (/= t3 ""))# W( ?" A' C) e" o4 {4 v T
;; Replace with a new value... 0 f3 k) }' s5 U* f& i0 L" B
(setq f1 (subst (cons t2 t3) (assoc t2 f1) f1))
# P% @$ \# A$ h9 J0 | ~$ ^6 @ ;; Remove it from filter list...& n' z( N% e* b2 O4 U" r1 B
(setq f1 (ssx_re (assoc t2 f1) f1)) 1 F+ f! G5 P' }. q; \* _# v
) / S6 v- q/ }9 l c, W6 b8 o5 ` [
)
$ h2 f! T+ X( _# \% ]; t ((and t3 (/= t3 ""))
+ A* [& |3 {$ q8 P+ T/ K- O (setq f1 (cons (cons t2 t3) f1))
) H5 o0 h8 u0 k2 @0 t# Z8 u4 o )( z( f3 T s& x. m) m$ L
(T nil)7 L5 Z/ ?" }! {/ o
)
4 I3 e3 w) Q4 I+ j" W& Z, p )9 H0 e8 c$ a( M& i9 F% O
(if f1 (setq f2 (ssget "x" f1)))
R6 E- {3 y6 {2 E4 O8 X6 o! N4 i (setq *error* olderr)
* l' \0 [) f# S7 U" x) X2 o, M( K (if (and f1 f2)
- ]0 K+ h Y T; Z u (progn
; w2 C# [; E- m$ ^! L% G7 P1 j (princ (strcat "\n" (itoa (sslength f2)) " found. "))
* Z, m/ F( @( T f2 3 C8 f( r( O4 {# \8 F1 l# S/ R9 A
)' {! X8 q; v& ?4 @' _ x
(progn (princ "\n0 found.") (prin1))+ P& S! ?' f8 l& M. O* ^* o
)4 g2 A/ _2 u/ v* z3 M5 P( q
)* \+ l2 @% K3 t9 H4 Z
;;;: Z" T0 }) s2 C. T1 m" e
;;; Print the standard color assignments.7 Q* A) G [ z) x6 e
;;;
4 H' t4 P' a) {! S3 x, k;;;
; h) P$ X& w" T, e(defun ssx_pc ()! C2 b1 X, ^6 \
(if textpage (textpage) (textscr))
2 J% K0 c0 E& y9 i (princ "\n ")3 T# u2 x; o- G5 |
(princ "\n Color number | Standard meaning ")
( h- x+ h5 B. f1 D (princ "\n ________________|____________________")/ {* d. L( Z) D+ ^: u: B# i ^
(princ "\n | ")
/ y7 ~+ F! d: u) I9 x$ W# S R4 Y+ P (princ "\n 0 | <BYBLOCK> ")
. p! ?& D1 ~' V/ R6 |0 \' \ (princ "\n 1 | Red ")& Y; K' r* ]: a9 @
(princ "\n 2 | Yellow ")- T" W$ c) L* b$ d7 C$ e/ l
(princ "\n 3 | Green ")
' ]8 K% D! y3 P: i, X (princ "\n 4 | Cyan ")8 e. T6 y. X: b/ G
(princ "\n 5 | Blue ")
2 _4 p1 a6 n/ U2 k' f/ Z (princ "\n 6 | Magenta ")) k: T" P! j$ X0 Z: a# E0 O- J
(princ "\n 7 | White ")- S \( j8 ^4 \; a' O. N
(princ "\n 8...255 | -Varies- ")
( V( d* o7 I, O2 b! ` (princ "\n 256 | <BYLAYER> ")1 Y$ a0 }- ]6 h; s( J( K
(princ "\n \n\n\n")% \& G+ F1 x" O2 X
)8 m! j) k: z- f* v
;;;- t* T. Q6 {8 `- c) r; _( \: Q
;;; C: function definition., d, i5 G/ l0 D$ g) k8 B
;;;, U2 F6 A& }1 x' G! y
(defun c:ssx () (ssx)(princ))
. t" S- Q# I/ E7 Z( {% S& }0 o(princ "\n\tType \"ssx\" at a Command: prompt or ")( J2 L+ X; W5 ]5 z2 B& J
(princ "\n\t(ssx) at any object selection prompt. ")+ Z5 c' |; I9 ~) X! d! f4 c
(princ)
9 [0 t, y; c6 r( u; ?
* g. P8 Y8 f9 s6 I;;;--------------------------------------------------------------------------;
, t9 J; `+ T* l* Z1 U6 p) u9 h;;;--------------------------------------------------------------------------;7 D. H+ p: S/ e
;;;--------------------------------------------------------------------------;
6 I& D( j( m# b! U- a9 ^5 e(defun S::STARTUP ()1 |* G0 y0 z( ]
(setvar "cmdecho" 0): X$ B- [/ R, S0 L3 w+ b
(setvar "cmdecho" 1)
7 j V( t3 p$ z; s# u( Y(setvar "LTSCALE" 10)3 y+ }; t& \' A ~. u, D0 o0 G
2 S8 ~# j( A# p1 g. a; A0 P% F: V
+ g6 ^% L1 P6 P8 B" ?& g0 y- m' C f;(command "_load" "chenKH.fas")9 L' Z% a4 N# B2 K
;(command "_load" "ctcot.fas")
4 i5 {& k3 j( C/ y6 m;(command "_load" "damdoc.fas")9 e. g" H9 i+ L0 Y
;(command "_load" "ghichu.fas"), Y4 n+ r$ \# w9 |2 v+ s
;(command "_load" "hamtutao.lsp")2 Y% \& W: v8 e) e- M
;(command "_load" "KHOITAO.fas")
' F7 ^# M( T. e$ e3 {- Z;(command "_load" "KHthep.fas")
9 x! e% W$ P6 P# f6 D;(command "_load" "mbmong.dcl")
& W( @4 o4 s9 Z: y4 x& k;(command "_load" "mbmong.fas")
: Z2 o' c; [$ V" L/ M;(command "_load" "mccot.fas")1 s( _8 F! G; k8 V/ g% J2 O0 w
;(command "_load" "mcdam.fas"), Z% [: J0 j) \% u
;(command "_load" "mcmong1.dcl")( Q# I: `7 l' n! b d* Z6 l) d
;(command "_load" "mcmong1.fas")
+ Y. H0 J! ]7 q% i/ e5 C;(command "_load" "mcmong2.dcl")
% S3 K. f6 T6 ` s; \;(command "_load" "mcmong2.fas")
. e6 D4 @" x1 |;(command "_load" "mcmong3.dcl")
% e0 z* H5 I; S2 D8 Y- l6 ^5 D;(command "_load" "mcmong3.fas")
, r, n( R G+ ^;(command "_load" "mcsan.fas")+ S9 _* l. }7 @3 n3 t
;(command "_load" "thepdai.fas")( Z4 N, ?2 w- S6 |2 ?
;(command "_load" "thepdoc.fas")
, }5 b( U( p# ~9 C;(command "_load" "thepmb.fas")% ?" V0 |# X& ~7 A4 P+ z2 j5 c
;(command "_load" "thepphbo.fas")5 v7 U8 m4 Z. @% `" K
(command "_script" "thongso.scr")! X9 m: [0 \7 e* {! g
;(command "_load" "thongso1.dcl")
1 z P* u, w1 x l9 ?' {0 C;(command "_load" "thongso1.fas")- ~# g) |- i' J3 t) d
;(command "_load" "thongso2.dcl")
( M: Y \0 C' O, A) x7 b" V;(command "_load" "thongso2.fas")
o5 [; i2 |. {* |# |# q4 U;(command "_load" "tietdien.fas")4 u6 X" M1 R, T$ I
;(command "_load" "vehan.fas")6 a' z9 k& S+ B, U" h
(command "_load" "phamduy782006htd.dcl")
5 u- v8 {9 R/ `8 S2 b(command "_load" "DDCHPROP.dcl")
: ^4 p9 k6 Y6 ^! {(command "_load" "EXCHPROP.dcl")
+ W) C6 e& {' m" J0 h' _* {" ?(command "_load" "DDMODIDY.dcl")
$ |6 b/ k6 H5 \8 a: C+ D1 H(command "_load" "TK.dcl")
0 R8 G7 `1 K/ g1 c7 [7 k# y2 p(command "_load" "TK_LIB.dcl")
. \ ]/ ]0 `7 y" s1 w(princ)1 m$ k; T- ]! f" B7 O! A
), `! U5 t& \" C2 T5 y: ]
5 z" @ }! `$ f$ S% q6 R4 S(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\DDCHPROP.LSP")
: C; g2 o: ~ ^' c* @. A* w0 W8 ^2 M( {5 x8 L1 M1 O
(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\SSX.LSP")/ Y! e/ ]7 K/ T# A7 i N
. U" ?1 W8 G/ C( T1 t
;(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\phamDuy782006_TKT_VNI.LSP")
+ g0 j# q' L8 T5 U7 x6 n, r* v; f* K;(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\phamduy782006ganhtd.LSP")- A( Q/ H. T0 P; K) P' I- H$ r5 B. U; {1 u
;(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\phamduy782006ganhtds.LSP"), i) g" T. ?: m2 h3 G0 f
1 ~: c% e2 n- i9 U! t(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\THONGKE-THEP\\TK_EXP.LSP")0 y* F$ [ l. l
(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\THONGKE-THEP\\TKN.LSP")
% g# ?# N( Y$ I- h1 K; R) q/ d2 K: V) }& B: j& V
;(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\ACAD iit insertTEXT - iiT.LSP")8 V' c" X# h2 R) V% e- q
0 u2 o b& a j
;(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\ACAD iit insertTEXT - iPT.LSP"): r. F3 ^/ z* L
4 T9 F+ C; T, H( u+ c0 G: {9 j
(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\ACAD insertPOINT - PTA4.LSP")" h/ O2 G# Q6 o8 |7 v# w/ z" Z! d
7 _6 {2 e H4 _$ T! [5 K
;; Silent load.
6 {' }8 g8 m6 Z8 ^6 U! v(princ)
' f0 q% z S& ?$ J) Y& c9 K, \3 G+ N7 k7 t
( W+ C7 x L" }+ L3 N3 @! C
;; Silent load for the Express Tools.8 p9 T5 y/ P0 M, ?# `5 P( [
;; Altering this line will affect Express Tools functionality
& b' F: e3 Q/ z8 v4 l8 Y(load "acettest.fas" (princ)); |0 i. E& t: @
+ v% E$ _. w8 `' |; g4 j$ b, p
;------BLOCK NAME Put The End because ERROR other LISP-------
0 T* r* z- _' u3 V3 q: u;------------------------BODER HATCH-------------------------
7 h" k, S0 N9 @$ x( ~5 L+ y' |
! _$ J% j; S5 G' {& c; U;;; HATCHB.LSP ver 2.5
& s% s4 g# x& B$ I* o4 d/ Z- }9 w5 Y;;; Recreates hatch boundary by selecting a hatch/ K& N7 b7 L) U" L9 V7 k6 E
;;; Known problem with some elipses and splines
. _; j. T4 a* o; t& [0 x;;; By Jimmy Bergmark+ F" w; o" g U) a! q- [" {
;;; Copyright (C) 1997-2008 JTB World, All Rights Reserved8 x( Q# }9 ]4 P
;;; Website: www.jtbworld.com' q" i: X( Y6 X6 i' S
;;; E-mail: info@jtbworld.com D) p) h& P* B' m3 U4 ^! i
;;; 2000-02-12 - First release
8 b9 f7 A' N$ ?' }: O;;; 2000-03-27 - Counterclockwise arcs and ellipses fixed
, ~1 l' K: k2 n- Z;;; Objects created joined to lwpolyline if possible
F! R; Q) K2 C$ ~6 I;;; Error-handling, undo of command
/ x/ E' F. i8 z;;; Can handle PLINETYPE = 0,1,2
7 N* O7 o8 I2 Z. t: b% ^;;; 2000-03-30 - Integrating hatchb and hatchb14( f- Q/ N6 o$ R0 `9 u7 u/ v( E, ]
;;; Selection of many hatches9 E1 F1 E; u4 X* a. v7 b& m! b
;;; Splines supported if closed. J4 l1 G. ^( `" o' t2 m9 P: f6 G
;;; 2001-04-02 - Fixed bug with entmake of line with no Z for r142 Y' z/ N7 M! I7 q' ^5 `: A+ k8 v" q
;;; 2001-07-31 - Removed an irritating semicolon to enable polylines to be created.
2 e2 }4 m1 u0 M% n9 B9 k( |: ~: w. s;;; 2001-10-04 - Changed mail and homepage so it's easy to find when new versions comes up.
. k+ q) F" c6 `% E0 H7 L;;; 2003-02-06 - Minor fix
+ j3 n k* y& B$ Z* J- Y4 K; F5 h;;; 2003-02-17 - Area returned if no islands is found since it's not consistant
: `2 A4 h9 X* Y+ S0 i' [;;; 2003-05-19 - Fix to take PEDITACCEPT variable used in AutoCAD 2004 into account( M; z6 t' b$ g0 X; o
;;; 2004-11-05 - Minor bugs fixed$ |- A% P; x- K9 v
;;; 2006-03-18 - Nothing changed from 2.1 other that it's been confirmed to work with AutoCAD 20075 t3 L7 c7 W9 A6 R
;;; 2006-05-13 - Create the boundary on the same layer as the hatch using the hbl command and
% h0 w E3 x4 e, e$ R3 t% D;;; on current layer/color/linetype using the hb or hatchb command k. c* x' f7 H' v! j; |- ^
;;; 2007-02-08 - Fixed a bug with the hbl command! s; x# u$ d. Z; N" m3 q8 q, B
;;; 2008-02-29 - Support for hatches in non WCS thanks to xiaocai
Z! v* F1 T& n% e4 |+ R8 @;;; Tested on AutoCAD r14, 2000, 2000i, 2002, 2004, 2005, 2006, 2007, 2008, 2009
% \& X" q1 q8 j, I0 z/ `+ d3 R;;; should be working on older versions too., N1 ~- Q4 Q4 |. p& g% g1 d3 X
/ p7 O7 O( U+ b9 {1 O( H/ {& _( p(defun c:hb () (hatchb nil)) ; this line can be commented out if there is an existing command called hb
/ \7 }. G2 Y" {! O! x(defun c:hbl () (hatchb T)) ; this line can be commented out if there is an existing command called hbl6 P/ e3 |; M5 o+ ?
(defun c:hatchb () (hatchb nil))
9 F# E' Z, E2 H) m8 q2 s(defun hatchb (hl / es blay ed1 ed2 loops1 bptf part% _9 G \3 \; i' ^ y( \- D
et noe plist ic bul nr ang1 ang2 obj *ModelSpace* *PaperSpace*
& P e2 ~& v: f+ t space cw errexit undox olderr oldcmdecho ss1 lastent en1 en2 ss lwp0 Y6 w1 [1 J2 m: h" p
list->variantArray 3dPoint->2dPoint A2k ent i ss2/ X/ @- q. { }" ~9 V) v
knot-list controlpoint-list kn cn pos xv bot area hst noarea/ N+ q, C8 x, D. l! P( n
). n5 z" f* i8 U6 i/ Z! ?
(setq A2k (>= (substr (getvar "ACADVER") 1 2) "15"))# L1 P! r7 R& I' y
(if A2k! @* } \3 _ p8 s# }# ]! V
(progn
$ k% K' B( b0 h0 H0 t+ n$ B6 z, U4 m (defun list->variantArray (ptsList / arraySpace sArray). S& {4 w" y, k6 l
(setq arraySpace
0 u9 d6 }0 u3 }/ R2 U (vlax-make-safearray
9 o8 d2 l/ R% I8 O1 A vlax-vbdouble. U, `3 W# ]+ t5 u
(cons 0 (- (length ptsList) 1)) c! F: [' j+ {& A( e6 G7 c/ z
)# D0 C1 G. c7 ]4 E9 O4 X# N+ ]
)( u& v" F3 C/ y' L9 U9 {4 N o5 @
(setq sArray (vlax-safearray-fill arraySpace ptsList))
4 `' @( [9 d8 O( s4 \+ H (vlax-make-variant sArray)
- k: ]& U: w" i6 M7 Q( h )
9 O- O; f% p) E/ I1 d, a9 R! l% x; G (defun areaOfObject (en / curve area), ~( s& J* ?1 \
(if en
0 u$ I1 e4 N2 s Y (if A2k
9 j, ^4 d: p3 D4 j2 l! f- J( `+ ~ (progn
7 O2 o5 L9 B' _) W1 k D (setq curve (vlax-ename->vla-object en))
; c5 }4 y7 s `/ ?& \9 [ (if, V& k9 |- M; u( _# u0 h- l! Q7 f
(vl-catch-all-error-p* P9 k1 P4 S1 j6 d" W! S6 H
(setq: ?( K0 k! y- B( c
area
! P7 \: T$ c. M' C4 c (vl-catch-all-apply 'vlax-curve-getArea (list curve))* ^2 e; c9 \( q* G
)# y w. |1 Q- d2 [9 s) Q. Y6 [
)2 V9 M6 C/ U& T
nil
j9 E2 f/ f) v- u V* ~# @ area# \0 q1 s4 ^8 t* j
)% E3 ^& ]& L7 Z+ v/ ~4 O
)
H; A, o" C {5 w (progn, G* ]; e3 ~; A6 U' h, p
(command "._area" "_O" en)# V5 K1 F; U* G4 e3 z
(getvar "area")5 q) ^7 }2 _1 `! _0 N9 k6 {1 e
)
& j1 g- ]% _, F v a9 S7 ? )
/ J9 x2 q" P3 S( `5 H )
' G1 ~1 ?9 r6 ]; B! Q: _8 A )+ f1 Y) F* u7 J+ Y5 ]7 A; L. m7 n8 M9 u
)
; `7 @; F9 n4 F" c c )8 m! `5 X8 w! n* F3 s7 B% s+ [
(if A2k# ~9 B& @7 X' A" w+ H/ Q* j5 q) x) k
(defun 3dPoint->2dPoint (3dpt)
( P' g& U# q( h. o: Q& Q/ f (list (float (car 3dpt)) (float (cadr 3dpt)))
& G$ l, ^1 _ V( N' i )
4 E3 x9 g t; U+ s1 o% j )
) t! ?( S. {6 V; Z# K5 i* q( c7 V. l% ?: X6 Q% A+ w! L; y
(defun errexit (s)0 _; Y# E$ Z2 ^7 ?; t* i
(princ "\nError: ")
& ?9 i7 w6 @; o( R (princ s)
$ C9 Z! w* l: ]1 Q( f4 Q% p1 N (restore)
" j) m% {6 Y: j )
+ m* u4 y3 w7 C( L6 B- s) S0 U' M
5 y4 `/ ?4 v3 z( Z! C1 S (defun undox (): H1 L' ?9 z6 f) Q
(command "._ucs" "_p")
( @# C, Y/ p( P8 L6 T7 K) [ (command "._undo" "_E"). v4 x, \, Z) d2 H4 l
(setvar "cmdecho" oldcmdecho)
& o: Z/ G6 n( S1 B; z2 w9 e) r# R (setq *error* olderr)9 P; V" F. B: C% i
(princ). I5 U- i: A. N. a, `! ]5 J7 h
)1 @) k7 a. W/ S: F: p
$ u' v. w% Y! p$ @ (setq olderr *error*: Y4 Z7 f. t8 B9 M9 z, Y; U) }
restore undox6 W" r% K. t: [# m& m' z0 ^6 ~
*error* errexit& m3 ~9 P) v& S" O% e; C2 }9 W6 o
)
8 R. R* N" k4 }& M2 E* a' I (setq oldcmdecho (getvar "cmdecho"))/ e- c' A+ c9 T- R0 l3 |
(setvar "cmdecho" 0)
& o d8 t+ z1 v+ B (command "._UNDO" "_BE")) J, }6 h6 [3 T( q
(if A2k (progn' k4 }& }+ W, [; V8 X: p
(vl-load-com)- q$ c8 I0 \; R- P
(setq *ModelSpace* (vla-get-ModelSpace
: _( l" b* m, p5 s$ J" t$ Z (vla-get-ActiveDocument (vlax-get-acad-object))
, [8 a3 I, H4 }% C5 p, V5 q" l )7 X9 H6 e0 c# Z" R0 Y0 C
*PaperSpace* (vla-get-PaperSpace
3 w5 W( @4 M7 x' W (vla-get-ActiveDocument (vlax-get-acad-object))
0 x* e3 A; e7 C8 k; I) \. o )
, L. ^( Q) R. P7 g7 u( O9 e; P ))! {% ?9 k- w1 w: |
)
: B; {* o0 W& Y4 h# ]7 ^' @+ G
' q K4 z) z* q6 Q8 z$ g) L# D* Y
8 k# z W q2 G1 B; Remove for testing purpose( i+ n( Q- `" F9 J& {# ~7 t
; (setq A2k nil)
& p7 K2 ^3 g) @* F' d
5 f m7 l6 j( Y- s (if (/= (setq ss2 (ssget '((0 . "HATCH")))) nil)) R6 W9 V1 p# Q
(progn
: e% n, l6 R" j0 q( h. N3 S3 k (setq i 0)% v" [# B$ M9 p, Q
(setq area 0)
$ h3 \( f" C S+ \) A) o (setq bMoreLoops nil)6 H) S7 c1 R) S. v3 U% ~6 O% ]/ A& l$ F" Z
(while (setq ent (ssname ss2 i))
: Q; Q. h5 e; g7 P, \+ g (setq noarea nil)
) |$ [" \- f; W% |; p5 E (setq ed1 (entget ent))- F2 R+ L1 ^) H! N$ R
(setq layer (cdr (assoc 8 ed1)))
- X E8 J4 y# y8 v; g$ m ; (if (not (equal (assoc 210 ed1) '(210 0.0 0.0 1.0))) (princ "\nHatch not in WCS!")) ;modified by xiaocai% D* U; a; `% r% w3 ^$ R# u+ p
; (setq xv (cdr (assoc 210 ed1))) ;modified by xiaocai/ m2 H. S: B2 m9 F/ [" R2 l! Z
(command "._ucs" "_w")- V- ]8 B0 N: Z* c5 s
(setq loops1 (cdr (assoc 91 ed1))) ; number of boundary paths (loops)
+ [1 F$ q) h" a" S* E2 m (if (and A2k (= (strcase (cdr (assoc 410 ed1))) "MODEL"))
% ~7 @5 j7 A8 z* q( c F (setq space *ModelSpace*)
: Q3 q6 r; y% m0 l1 E/ U9 l (setq space *PaperSpace*)! r/ i2 g9 ]; u& i" H. u, h+ e q/ j
)& }9 w6 p9 u2 G
(repeat loops1
0 Y! O" Y! x! o: R, f5 u4 @ (setq ed1 (member (assoc 92 ed1) ed1))" n* q$ c2 O$ h; w/ M' m
(setq bptf (cdr (car ed1))) ; boundary path type flag3 Q9 l; i4 \( q! ?. W
(setq ic (cdr (assoc 73 ed1))) ; is closed
' @# D( K5 X. b! c/ Y# O9 n (setq noe (cdr (assoc 93 ed1))) ; number of edges' g% }, |$ \9 T1 J2 l8 k& }
(setq bot (cdr (assoc 92 ed1))) ; boundary type8 ~9 Z- N' D* g' _$ V
(setq hst (cdr (assoc 75 ed1))) ; hatch style0 v2 S, q$ N0 S8 [; B. k
(setq ed1 (member (assoc 72 ed1) ed1))
" x# C: h" z- V' g( |' v+ ~ (setq bul (cdr (car ed1))) ; bulge
/ a, k- n, C7 h i9 w8 ^* H (setq plist nil)
1 }5 E3 E) E" `, O (setq blist nil)% t0 N. g. n$ C" n* Y
(cond0 D* r" E0 R. b! t5 W. Q: X
((> (boole 1 bptf 2) 0) ; polyline
. c4 B; J3 h" Q (repeat noe- K6 @" |0 A( ~ @7 y. T7 t! z# d
(setq ed1 (member (assoc 10 (cdr ed1)) ed1))1 Q. j& R" Z+ p
(setq plist (append plist (list (trans (cdr (assoc 10 ed1)) ent 0) ))) ;;add trans by xiaocai
! f3 S9 @. O8 V: n3 ^ (setq blist (append blist
, j6 t$ h7 T9 X+ _/ k. _ `3 r (if (> bul 0), F1 g, f8 E! k; R) w# X; I; s
(list (cdr (assoc 42 ed1)))
3 S1 p& m) l* D& y$ G nil ^. e. f3 _; i
)
) P' T. s8 M( z" `" o )
4 c+ A! T( @- E. x4 @* F" u$ Y )1 O/ R" A/ d0 d4 t4 b% J/ ?
)
: q1 ]' m; J6 S0 n5 H! R (if A2k (progn* {) \7 ^7 h' Z; ~+ T i
(setq polypoints
' `; W8 T4 }' Z& @$ f" P" J7 N (apply 'append
. w% `% {* ^9 K& [ |3 D7 O" v (mapcar '3dPoint->2dPoint plist)
3 O9 o5 [ o1 ^ )
/ c) k( R4 k1 u2 M )
! [' z& l& s. f7 } (setq VLADataPts (list->variantArray polypoints))
J4 p K% x* K) @; ]/ k: G% ?7 n (setq obj (vla-addLightweightPolyline space VLADataPts))& S9 ~$ G- V s' g
(setq nr 0)
, z* O. G, S4 H2 X5 s" t& {! [ (repeat (length blist)
2 B, y0 k4 |* r+ M# E% X (if (/= (nth nr blist) 0)$ e( ?5 u j8 K* i6 [8 x* b4 K+ R
(vla-setBulge obj nr (nth nr blist))1 c0 M1 V; J' I& W: e% F% B* s
)
! n+ ^) \$ S- N$ J4 t/ {8 w( }1 C3 A (setq nr (1+ nr))" ~1 l& R* @3 T$ j
)/ `9 P L8 \9 }; L& d$ Y) p( ]) a7 N
(if (= ic 1)
1 _6 w# H7 P2 ]. P& Y' F# Y2 P (vla-put-closed obj T)% z/ v5 c2 Q% i
)6 s$ c$ }& x! D+ n4 H* B* \( D
(if hl (vla-put-layer obj layer))
- g- Q" q, `5 A1 E% G )5 I f0 X: j# t! M
(progn: o0 ?3 v' w5 f- X) a& a' Y
(setq ne (append (list '(0 . "POLYLINE")) (list (cons 66 1))))( a; U3 k% w2 g6 W- k
(if (= ic 1) (setq ne (append ne (list (cons 70 1)))))
: L* G( k& i2 x( [/ E (if hl (setq ne (append ne (list (cons 8 layer)))))4 [: Q* E l3 G2 D' a: ^! a# u
(entmake ne)8 N; y X4 n+ r! j2 U. @
(setq nr 0)
2 X/ J9 z$ W. C$ V% ]* X. T/ e (repeat (length plist)
0 p% U8 B3 @; n2 A6 _9 N8 Y$ U (if (= bul 0), o7 a# n. e4 {6 \) c U' _0 ?& J4 @
(entmake (list (cons 0 "VERTEX")
, d' U1 x5 A8 |3 e (cons 10 (trans (nth nr plist) ent 0) );;add trans by xiaocai1 v, r- U m- S* Q9 F
)6 R# U% [% {& F/ k& a" J8 G+ v
): H9 y0 g7 {0 L! S9 B: E' h
(entmake (list (cons 0 "VERTEX"), r4 L% \& c6 f! @9 _! e
(cons 10 (trans (nth nr plist) ent 0) );;add trans by xiaocai+ Y. k* Q1 }; p+ x7 Q4 r) I
(cons 42 (nth nr blist))( _# Y5 O+ f7 E4 g* _4 C% r
)$ U* D7 C! y7 D- I3 s5 h3 D/ A
)
/ a! @7 z& V, `" m% Z6 p5 ]$ Z )% ?" q, Y( G, T2 ?* w4 c
(setq nr (1+ nr))
) |* K- |' t; V8 r" J7 X )
4 l+ ?/ d$ J0 }' d. E (entmake '((0 . "SEQEND")))
7 J; z9 W( w+ A9 y/ t. P. V8 } ) H- o- A( w( X/ U! o0 U" j% R
)3 \) w9 n* f, N5 ?3 W E
)3 k+ H/ p$ n; A" r
(t ; not polyline' c" p: ~9 [' I9 V
(setq lastent (entlast))
8 P! Y; ]4 u6 [1 D: s* I/ S1 D (setq lwp T)5 t" c! |- ~/ b+ o" i1 J0 C8 Z
(repeat noe
( L/ c% e* V! p8 R6 j. m I6 F (setq et (cdr (assoc 72 ed1)))- H) ]( k% |+ @# m9 |4 d6 i
(cond- N7 `! I z; R( p
((= et 1) ; line
% l: @$ Q/ X" X5 Z; V) `( J (setq ed1 (member (assoc 10 (cdr ed1)) ed1))3 q2 v& w8 R- w5 u+ \. N2 j
(if A2k7 X) c+ c/ O, T& t4 w
(progn& D. v* a8 c& U( r$ F/ ]
(setq obj (vla-AddLine; m7 [" z# [, T8 @' I d
space
7 `7 I1 V% _7 G" z! {' y; G! R! M (vlax-3d-point (trans (cdr (assoc 10 ed1)) ent 0) ) ;;add trans by xiaocai
" ]# \9 G6 Y/ U5 |: k2 n (vlax-3d-point (trans (cdr (assoc 11 ed1)) ent 0) ) ;;add trans by xiaocai
' @" y' F* h& A5 x- Y5 r ))8 U" f" i: V- c* n$ B
(if hl (vla-put-layer obj layer))
. p# a1 U( n8 P% P )
: U8 T( x! G* Q3 G# b0 m- v( K (progn2 o+ |" a8 D! L- d$ K2 u1 z
(setq ne (append (list (cons 0 "LINE"))
5 ?( k& T) F- E (list (list 10 (car (trans (cdr (assoc 10 ed1)) ent 0) ) (cadr (trans (cdr (assoc 10
! Q5 g( b1 `) k; b+ g% i
3 n0 T+ L O$ F- ^( G* Aed1)) ent 0)) 0)) ;;add trans by xiaocai
$ v9 w: i# A8 Z! Q- O0 M" T1 w (list (list 11 (car (trans (cdr (assoc 11 ed1)) ent 0) ) (cadr (trans (cdr (assoc 11 7 P+ i9 f* Y( f# T8 p) W( h5 D2 H
Z+ R+ O: x- ?# P9 K8 Z$ N
ed1)) ent 0)) 0)) ;;add trans by xiaocai
6 n+ @* U6 B( f: O0 P ;(cons 210 xv)
" t0 ?5 J( R) q )
. L- y1 j4 S" U/ j )
. x7 y( s. [+ [4 n& x; V6 G (if hl (setq ne (append ne (list (cons 8 layer)))))
" q; }5 F9 N3 t5 ^' ~/ F (entmake ne)
4 A/ K+ c+ p; K: ` ); _- t" A( b! M% `! b+ N/ Q
)
) H9 y6 \5 z* n# I (setq ed1 (cddr ed1))3 b5 u/ e1 e6 G. O, S7 W9 V
)
3 [* E4 m) V1 N" M9 x" G ((= et 2) ; circular arc
8 P2 a# q$ @) u- K) w (setq ed1 (member (assoc 10 (cdr ed1)) ed1))" v2 V6 ?" Y. E5 X. X6 z
(setq ang1 (cdr (assoc 50 ed1)))- V" {! R+ i L3 u5 x; M6 P$ L4 F% L
(setq ang2 (cdr (assoc 51 ed1)))7 q' ]; q4 n1 j) ~/ x+ O+ _
(setq cw (cdr (assoc 73 ed1)))" ?3 o1 s* m( Y* w4 y Y- C
(if (and (equal ang1 0 0.00001) (equal ang2 6.28319 0.00001))
& X3 [- z0 P+ H' t+ b6 Z (progn( w6 O8 H, S# y/ k0 ]6 J
(if A2k4 \- }- _+ M0 X5 g
(progn
2 p8 {) f. y1 P/ \ (setq obj (vla-AddCircle3 I" }+ `2 f1 @! U6 O
space
) `6 z- ], l, M, f- F D2 k4 O a (vlax-3d-point (trans (cdr (assoc 10 ed1)) ent 0) )
# h2 y4 [. C+ \9 p0 |) t& ?" s (cdr (assoc 40 ed1))
5 o; d) a3 b7 R" g ))- {; A% F) J: t
(if hl (vla-put-layer obj layer)): ^$ a4 S1 G r" _, ~; |6 F4 a! ?' e
)
, Z! \/ N7 |! B+ d5 s, j& K0 c2 R; Z (progn
v* S( T* ]$ A7 Q$ O# Z) t9 y (setq ne (append
, v* ^3 ]$ H8 q! i# ?5 Y (list (cons 0 "CIRCLE"))
2 t' r7 z3 G6 E (list (cons 8 layer)) x& D: M7 b V- U
(list (cons 10 (trans (cdr (assoc 10 ed1)) ent 0)));;;add trans by xiaocai
" l- f: C$ k* R! ` (list (assoc 40 ed1))8 W- f+ S- a$ Z4 J! B0 i
)1 `* E' P0 S& B8 p( R
)0 f- Y o2 {; L0 v3 E# @
(if hl (setq ne (append ne (list (cons 8 layer))))). t8 n) a. S! x/ M; a2 u+ R5 A
(entmake ne)
) \8 N4 O3 d1 j$ `6 C9 n )
3 p& F6 r) j7 I )8 y! F' H& \% A% g7 M# F$ G% h; B
(setq lwp nil)% a5 B& E2 a0 W$ e' X- j( ~* \, W
)+ A* L& z& [8 [5 _4 ~, U' S
(if A2k6 {) C1 r% d9 }0 T
(progn
4 V" Y, D+ O7 _$ K* D$ c( B( ?3 O (setq obj (vla-AddArc
9 H) ^7 r- c$ }" e) X space- }# g4 T# G9 Q. G* z
(vlax-3d-point (trans (cdr (assoc 10 ed1)) ent 0) );;;add trans by xiaocai# q5 m: @6 m5 i) r
(cdr (assoc 40 ed1))
/ C8 [2 B7 D! \7 b (if (= cw 0)7 N$ _1 g7 S8 c) X" u$ K6 G) w
(- 0 ang2)5 b. W, p0 `/ m' Z& I
ang1
7 j/ L. X" |9 T! w& x )! i7 K/ h; [) v" y! {/ J
(if (= cw 0)- F+ @1 ^ }$ l H. F. F
(- 0 ang1)& H) F4 s. p7 ]0 A
ang24 [ m6 O6 a8 g4 I+ _
)) F; ]7 L7 x9 Y% _" C
))
; D; P! X. ]# C/ v8 ?& ^9 Y (if hl (vla-put-layer obj layer))
1 t9 x% D% ~) c )! o7 V; X' ?5 z4 d$ @' ?( y
(progn6 z: u: z6 i# Z# ]# C/ @9 q9 v
(setq ne (append (list (cons 0 "ARC")). i) I8 b; g) e" f5 c4 P
(list (cons 10 (trans (cdr (assoc 10 ed1)) ent 0) ));;add trans by xiaocai
: ?/ d# F: ?/ |& J (list (assoc 40 ed1))
B" q1 M2 z- c (list (cons 50* P C1 G/ c$ ?, A* G
(if (= cw 0)3 E( c# A, H, N& D+ d2 V
(- 0 ang2)7 @" a3 \1 o% J# J( h& b; ]
ang17 ]1 e9 F5 e# d5 v6 _
)
6 f! @3 V$ R! z/ x ))
+ _' m2 \8 T1 d# S) g9 U (list (cons 514 J% q* F: f7 Y
(if (= cw 0)% g: z; o7 D5 Y' Y
(- 0 ang1)& w, [- _* t# d8 B: k
ang2
/ T/ k3 i0 B9 l) J7 a$ p )
; u9 `# k1 q: g& |# | ))
( o2 U. E" f+ q/ @. P% Y6 H0 o )1 V& a7 T; c( u$ G: d# \! n
)$ j% m- ?/ w+ p7 Q8 Z
(if hl (setq ne (append ne (list (cons 8 layer)))))
( \ A' s% V% q+ z" a7 S0 ]" y (entmake ne)0 D% s8 k- U+ I
)
1 D7 h% \2 R- q$ d )' m) L4 @2 x. {+ c& {( O* ]+ X
)
3 z4 a+ k# e; G, ?/ ] N (setq ed1 (cddddr ed1))) u3 j, W, D$ F- g( h
)+ `& R+ ?0 {9 e# l& a5 H( w6 @
((= et 3) ; elliptic arc& w W' J- Y. Z2 K+ I
(setq ed1 (member (assoc 10 (cdr ed1)) ed1))( @/ Q+ p9 I+ y& V* ~
(setq ang1 (cdr (assoc 50 ed1)))
( y1 s7 t8 ]6 G* @ (setq ang2 (cdr (assoc 51 ed1)))) b" K, H: F& q% j; j: P
(setq cw (cdr (assoc 73 ed1)))
7 ?, h2 ^" o% u% u! H (if A2k (progn
! p7 ?/ ~2 C, `9 t. K (setq obj (vla-AddEllipse
0 n* d5 x: k' M8 t8 I space
" X. R E9 X" o* u (vlax-3d-point (trans (cdr (assoc 10 ed1)) ent 0) )
- H! Z. U) @+ O7 l# v# Y( _9 s0 j (vlax-3d-point (trans (cdr (assoc 11 ed1)) ent 0) );;add trans by xiaocai; q* d5 R, f' Z6 ]! w* _+ ~9 U' b; Q
(cdr (assoc 40 ed1))
, n3 r' h o1 [1 B* p, T )
9 j5 a: c3 d6 | )$ e$ p0 P& f9 E7 R
(vla-put-startangle obj (if (= cw 0) (- 0 ang2) ang1))! }8 |8 ^4 p3 p$ d8 l, o
(vla-put-endangle obj (if (= cw 0) (- 0 ang1) ang2))& k/ _4 y; g' C% j6 o
(if hl (vla-put-layer obj layer))
; g4 m N& c% f4 A* C1 q )
& v$ P" R4 f; h. K- | (progn4 V: Z4 y/ {; |
(princ "\nElliptic arc not supported!"): O- a- x% w/ V) G
(setq noarea T)( M* B8 K" R6 I' a
)3 X8 V* j, P3 w
)1 Q' _$ V o$ }* M" o+ \& D9 X5 Z
(setq lwp nil): d- ] h! X/ E* \0 \1 n m. j
)
4 }! y5 V4 M6 g3 n/ a ((= et 4) ; spline
1 J9 \1 K( t( d1 J" l (setq ed1 (member (assoc 94 (cdr ed1)) ed1))
- ^& B) t: l: M. F7 p2 X (setq knot-list nil)
: V1 @; s# {0 g# ~* K (setq controlpoint-list nil)
0 ~& h; t; V$ U9 r8 v1 N (setq kn (cdr (assoc 95 ed1)))" M* `' v! j. \( X% s$ g1 {
(setq cn (cdr (assoc 96 ed1)))
+ r- W) ^ o& F0 q (setq pos (vl-position (assoc 40 ed1) ed1))2 z0 Y6 |' D/ S" x& I
(repeat kn
~" S7 v& T+ [! ~ (setq knot-list (cons (cons 40 (cdr (nth pos ed1))) knot-list))0 c6 j8 ~8 F- @4 Q- c; O
(setq pos (1+ pos))" P; |$ X1 z; h1 O% Q2 Y, s6 a
)
; _$ Q0 M! P6 b0 I6 H (setq pos (vl-position (assoc 10 ed1) ed1))
8 v' o: B* Z0 V5 ?% u% H (repeat cn
U( R+ v: @+ s/ Z; Q (setq controlpoint-list (cons (cons 10 (trans (cdr (nth pos ed1)) ent 0) ) controlpoint-. N- W( J& ?: b; o: w p% t6 A4 f9 P
3 S+ U8 {8 p; W2 F
list));;add trans by xiaocai
: w7 e1 O3 V9 H (setq pos (1+ pos))
0 {4 Y+ M; `9 U) [) Q1 c: c- u )
, f! z# K$ A8 E! U (setq knot-list (reverse knot-list))
& {+ @4 H6 ?7 o# A (setq controlpoint-list (reverse controlpoint-list))) G+ `3 B4 v: [5 v9 ] a/ Y7 M
(setq ne (append
) ?! R2 W0 ]% Q/ C/ ]2 G (list '(0 . "SPLINE"))- }0 n* l4 K, ^$ B& |% \" J+ R
(list (cons 100 "AcDbEntity"))
: k2 S# w2 |+ O (list (cons 100 "AcDbSpline"))
, \% e. \8 R1 w$ A6 k: \ (list (cons 70 (+ 1 8 (* 2 (cdr (assoc 74 ed1))) (* 4 (cdr (assoc 73 ed1))))))3 D- u( \* X' ~! ^ Y/ P8 E/ \
(list (cons 71 (cdr (assoc 94 ed1))))
9 q& b/ M% V2 s) B (list (cons 72 kn)) X0 `" t* _" b! r
(list (cons 73 cn))8 c+ u8 t' @7 R+ |
knot-list
, \& y! L# ~3 M2 a# o8 o( F% f* a/ x controlpoint-list
* E+ |( L3 b4 P" ?6 q/ G9 M ) i9 L2 T' X. W" E
)
) t2 N2 f7 i3 _8 M2 ~" {; l2 I: c (if hl (setq ne (append ne (cons 8 layer))))
' I+ z+ J! p& o (entmake ne)' R; {& b9 w* G9 R
(setq ed1 (member (assoc 10 ed1) ed1))4 |, S# n4 _- ~) W# r5 p
(setq lwp nil)8 Z. a0 U' F- M+ w6 W( N. B: D
)
2 C0 d9 [6 a- p) m ) ; end cond
/ ^3 ~+ h6 [8 W ) ; end repeat noe
* S, F! r; C# p* X+ V! Z (if lwp (progn
) N; F& G0 G/ D- T0 Q9 ~# [ (setq en1 (entnext lastent))
) K9 f( _ Z* c (setq ss (ssadd))
6 U+ M* s3 I* K6 F' B (ssadd en1 ss)* k: F9 @4 S, N* @! g$ ^$ p
(while (setq en2 (entnext en1))
8 l% F* f# u/ ?- E8 Y# p* v/ ] (ssadd en2 ss)1 p4 j( O+ V3 ]
(setq en1 en2)8 m% c( m$ ?9 ]; y8 i8 x0 q+ ]
)& ]2 l6 d' Q( h6 V$ |8 \( r
(if (= (getvar "peditaccept") 1)4 H H' j/ l! `* W/ e8 i
(command "_.pedit" (entlast) "_J" ss "" "")( v! v& l, m, r. ?
(command "_.pedit" (entlast) "_Y" "_J" ss "" "")) N; G }+ P4 x3 l, Z: H3 A
)" w; o: O' r. h- Z& J4 t# _& r
))
, S) w1 i( S; @: o% n0 L8 Y( ^
6 A; o8 b: v3 A$ [# D; U ) ; end t
/ ?* n% I& r2 Q' M3 \ ) ; end cond$ i5 U, Q- ^0 \0 @# l
; Tries to get the area on islands but it's not clear how to know if an island is filled or not
( E$ q+ I* n/ U: e9 S H4 s3 A" b$ ]; and if it should be substracted or added to the total area." C/ w: m9 a; ^2 ~' F2 k" }
; (if (or (= bot 0) (= (boole 1 bot 1) 1)) (setq area (+ area (areaOfObject (entlast)))))# R* F& p& l9 P5 F
; (if (and (/= hst 1) (/= bot 0) (= (boole 1 bot 1) 0)) (setq area (- area (areaOfObject (entlast)))))
5 ]; Y" `$ B7 r C; (princ "\n") (princ bot) (princ "\n") (princ hst) (princ "\n")" y8 Y" X" U! y8 h, _* o
; (princ (areaOfObject (entlast))), x$ ^% j' ]2 g$ y9 O0 p$ M; G' _
) ; end repeat loops1
& m6 c$ I! L" m; ]1 D (if (and (= noarea nil) (= loops1 1)) (setq area (+ area (areaOfObject (entlast)))) (setq bMoreLoops T))
2 {8 F/ z0 X, V$ Z6 v: \ (setq i (1+ i))
! `* G; W7 e& L5 c6 g$ V; m/ Z )
g9 ~8 I/ d4 Y/ h )
X% V# P1 K$ Z0 C )8 f, X, B1 a, I$ V( N0 Q/ g. e
(setq ss2 nil)
/ ] a9 x! t; X8 z$ b$ i (if (and area (not bMoreLoops)) (progn" j) Y8 J4 v! ^9 S2 y8 P3 R$ Q
(princ "\nTotal Area = ")
1 O& {8 Y* X4 [8 Z7 `: a; k (princ area)
+ ^$ l" q5 |# c. E ))
& x2 K6 Y4 X( t1 h0 t6 P: B) S (restore)
* ^' [4 O1 C- U" f i5 [1 U (princ)
& K5 C1 {/ H7 D2 p% v# K& }0 h0 ~){\rtf1}. ~- D5 A2 F3 x7 A) ~
_) x$ A" {( w' J3 M" Y8 \(defun C:BN ()
D# r4 T+ b$ Z/ |. O (princ "\nAdd block name to drawing.")
7 h* U$ t1 a9 ~ (setq pt(cadr(entsel"\nSelect Block:")))
- ~; H( A4 \. J1 f3 N8 W$ g (setq e1(ssget pt))
5 \, ~& S% @! n3 f (setq e2 (entget (ssname e1 0)))
B0 y2 d% n4 _ (setq blname (cdr(assoc 2 e2)))
" e' @% E# w: r. V2 U' U3 k (setq pt1 (getpoint"\nSelect point for block title:"))
8 d& L. ]5 j( l' S1 P4 o4 C( G, b (command "text" "c" pt1 "" blname))# ^8 n2 R V$ y
(princ "\nType BN to execute)) G- K9 v B' m! `, z+ C
�32 a0 O& M8 V5 g9 } b3 [: ^/ ?
2 U( a0 d! E9 h5 B! m/ t; U5 D
: G% g0 _( s j, x2 V2 d
|
-
2025-04-21 Plot.jpg
(70.6 KB, Lượt tải về: 358)
-
2025-04-21 Text Style.jpg
(42.87 KB, Lượt tải về: 339)
-
2025-04-21 Layer.jpg
(26.81 KB, Lượt tải về: 347)
-
2025-04-21 AutoCAD Message.jpg
(8.58 KB, Lượt tải về: 339)
-
Screenshot_20220406-091212_Facebook.jpg
(306.88 KB, Lượt tải về: 335)
-
00st Cách Thêm Menu & Lisp Vẽ & Fonts Chữ mở Gõ Chữ Administrator để G.jpg
(249.66 KB, Lượt tải về: 360)
-
Untitled-1 Da Xong Trump Putin 0 Hoi Xong Chua copy.jpg
(299.44 KB, Lượt tải về: 336)
-
-
RUN-2000.zip
1.11 MB, Lượt tải về: 5, Tải điểm: Thưởng -2 điểm
Zip
-
-
0st RUN-2000.zip
2.02 MB, Lượt tải về: 1, Tải điểm: Thưởng -2 điểm
Zip
|