|
|
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">
3 b1 V* F: Z+ b# i! m
Sao chép mã ********************************************************************************* P7 K+ v' z8 T% N7 j
* ACADLISP FOR AUTOCAD R.14 -> AUTOCAD R.2012 *; g. L, Y9 p F& L
* Tran Ngoc Thang DHXD-HaNoi41 from years 1999 -> 2015 *7 [5 u' m& s" y4 n1 Z/ x
* Suu tam & Soan *, p5 g& Z0 O2 @6 E( H) s0 r7 P5 J
********************************************************************************( b3 V2 _5 k0 {# }
' L; e( E! z5 \0 x* K9 h
; Next available MSG number is 104
: D# V$ T h# c; MODULE_ID ACAD2000doc_LSP_
3 m2 b7 W. @( A% A;;; ACAD2000DOC.LSP Version 1.0 for AutoCAD 2000- Q; W# t8 J6 x( E- I
;;;
6 B6 H; F" l, V* |;;; Copyright (C) 1994 - 1999 by Autodesk, Inc.
( c5 J- g+ y ]0 C5 R+ v;;;
[8 d' B2 Y( g: k! i;;; Permission to use, copy, modify, and distribute this software7 y$ [" v& B. B2 g4 f
;;; for any purpose and without fee is hereby granted, provided- |. O t" M4 k6 U4 D* E
;;; that the above copyright notice appears in all copies and
9 z/ `7 H% _/ A7 u5 c% m3 H; [, m1 e;;; that both that copyright notice and the limited warranty and
( u7 c+ W- X0 G& @8 i4 A;;; restricted rights notice below appear in all supporting. i& ?- }7 D, @$ L/ R+ {
;;; documentation.9 b' _' h$ V* I9 t9 J5 Z
;;;
/ h4 f5 u: C1 g/ P3 S0 e0 e;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.5 x+ u! v& L& W5 l
;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
5 \! S8 m$ s6 ~/ V( b;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.5 Y9 [/ ~5 S: }) t+ J8 W1 v
;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE1 `! C. ^$ E9 p0 b4 Z- s' s
;;; UNINTERRUPTED OR ERROR FREE.
% d- s' e7 x- @$ q+ ?;;;3 U0 w- p4 S$ Y; r. I$ o
;;; Use, duplication, or disclosure by the U.S. Government is subject to
- ]) A" H- R4 _6 P- C. Z) x0 `' ];;; restrictions set forth in FAR 52.227-19 (Commercial Computer
/ ?( i9 y/ \. G$ C;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
+ y( @, E( E5 _! B5 m* f;;; (Rights in Technical Data and Computer Software), as applicable.8 S! ~ D, g E- o: E& Q( T% k
;;;' l9 w1 Q, ~( N& x% v1 Q
;;;.
' y3 J% j# H: E3 z* A;;;
* O4 {) D; A2 W1 h1 {- X;;; Note:
- y2 o" E) n$ }6 v: I' `+ L* b5 g;;; This file is loaded automatically by AutoCAD every time ' z: ~2 l4 Y* s! w
;;; a drawing is opened. It establishes an autoloader and
$ j& J U% a8 {! M2 S2 B( u;;; other utility functions.* w0 y. d- I9 |- ?/ ^ I n
;;;
6 d# U1 P9 y" W" q! y;;; Globalization Note:
, ?0 X( h/ o5 H. M5 x;;; We do not support autoloading applications by the native
* m$ I. q: |1 v7 l;;; language command call (e.g. with the leading underscore; \+ c9 R, ~4 X
;;; mechanism.)% q9 ~* `2 G# X8 Z( k
7 N/ t. Z" Z7 L a: k
, R; k6 c8 x+ t6 C
;;;===== Raster Image Support for Clipboard Paste Special =====+ _4 k9 _! F2 p7 ]$ m6 J
;;
6 i$ ?) H- k I6 Z9 L* c8 Y;; IMAGEFILE
5 v, ?! I& ^ O% h. e" P;;
% P/ [1 |7 t* [;; Allow the IMAGE command to accept an image file name without
2 D# k ~) w7 `;; presenting the file dialog, even if filedia is on.0 ?. z7 a, y3 f. {5 z8 a5 ]
;; Example: (imagefile "c:/images/house.bmp")
2 ?$ Z M! S, X# J4 j! y/ j& d;;7 I( S5 x: ^0 }& h j: S l! i5 c; L
(defun imagefile (filename / filedia-save cmdecho-save), S' O* s( m- y c3 Z1 ]3 l: A
(setq filedia-save (getvar "FILEDIA"))5 _) s+ H" F* \ ^+ y5 _
(setq cmdecho-save (getvar "CMDECHO"))1 j% V& @/ i/ V- N3 v7 I h
(setvar "FILEDIA" 0)
# V) ^" l6 A8 P9 Y3 m (setvar "CMDECHO" 0)
Z6 N9 F, T" r9 P4 [* P (command "_.-image" "_attach" filename)
w# |7 W6 R$ a# F5 ]" a1 ^) } (setvar "FILEDIA" filedia-save)' z1 ]9 ]/ Y1 W7 F0 K' T* C
(setvar "CMDECHO" cmdecho-save)/ V3 k @- D: Q C5 a$ T
(princ)$ B/ p& S* B$ e$ O
)4 g4 a/ g z0 b3 H
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;# w2 B/ H! ^; {* ^8 W
; Next available MSG number is 11
# o' N! }* p, y* [2 R; MODULE_ID DDVPOINT_LSP_
. E+ _ |( J4 s;;;8 @) F1 g1 C( o5 r. B& g
;;; ddvpoint.lsp% A5 w- n E1 _) l1 r
;;;# J! y- e6 T" X( A; L
;;; Copyright 1992,1994,1996-1998 by Autodesk, Inc.0 q* z$ x. Q2 n3 _
;;;2 n1 ~' n9 k. K
;;; Permission to use, copy, modify, and distribute this software
: ^, G# a- G7 `+ i;;; for any purpose and without fee is hereby granted, provided
- l, R3 ] H+ w4 {, A0 ^- N;;; that the above copyright notice appears in all copies and
0 L }! E) `( {; {5 y" |;;; that both that copyright notice and the limited warranty and
6 s/ ^9 t) G( l7 n! ^- X+ H;;; restricted rights notice below appear in all supporting
8 n- P+ f* P& P; l0 W0 F;;; documentation.
8 T/ t* y. B$ a; b" `;;;
. j* B& p" x. |6 Q& D6 ]" f9 b;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.5 x) k- ] |# ~% O# ?: y
;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
1 Q9 }3 j6 g; ^7 m) G7 q C;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
! o$ o, Z7 n; D; z, m, K( |3 D;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
7 l* m% C1 f1 Z;;; UNINTERRUPTED OR ERROR FREE.# P( j3 J e2 t- N9 X* f2 H
;;;
/ ^! Q$ E+ n4 w' k5 t. q; u. m0 C;;; Use, duplication, or disclosure by the U.S. Government is subject to( V7 @, l, X, ?& I" c) v
;;; restrictions set forth in FAR 52.227-19 (Commercial Computer
) F: ~" X9 ^$ n+ y/ a;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
& D6 n5 @5 _ l4 K- a, D- Q' Q; r;;; (Rights in Technical Data and Computer Software), as applicable.
$ e9 v: a3 i- z6 o" p;;;( Y& r5 w( ^2 K L
;;;.
4 Y$ U) \1 K( K3 P& A. a0 m7 I1 r;;; C DVPOINT - 3D Viewpoint presets dialog.
2 v7 k) c+ L) h! ];;;
; \/ J$ s0 H; w+ D. w;;; Uses DDVPOINT.DCL for the dialog definition.
1 K# I# J9 f3 A0 r;;; The slide image is in ACAD.SLB./ Z: e0 q+ S/ b8 y: F! o& @
;;;. [. [# l% b( c' g' Q* [
;;; ===================== load-time error checking ============================
3 M. W- z* f4 q) x/ B ~( b! F5 n+ \;;;9 v1 H5 S! k4 b- k
1 |5 B0 j) c4 x1 [
(defun ai_abort (app msg)1 t1 c: U2 R- y" ]5 e5 i
(defun *error* (s)" I( I/ S5 n# X. W
(if old_error (setq *error* old_error))& r7 H* G+ h4 ^' _( m+ S
(princ)" L+ y7 t1 n% t
)& x9 X, G/ t' Q" a9 J
(if msg
3 M; R$ ~# U: l( K7 X g/ j (alert (strcat " Application error: "
) _/ Z& D6 e8 d$ J( ] app: O1 v; b7 B5 U/ w) @
" \n\n "2 h v8 m1 O/ x+ F
msg9 L6 W6 p1 x: |* c, H( s
" \n"
& _, Q$ E$ M; B$ t. ` )
; R Z% N4 U9 M7 H5 H5 q) V; D )6 W8 K& \( ]$ ~/ P
)
" @6 G+ D1 y5 { (exit)9 }5 }2 C! B# g, {) B
)
! f: E9 v; w/ g" {$ P( C4 B% S+ ^! D( Z+ l" ^6 ^( e9 w& U
;;; Check to see if AI_UTILS is loaded, If not, try to find it,
1 E3 }! R" A4 C$ J$ @' h. ];;; and then try to load it.
" ]: e3 |$ W. v' Z u u5 K3 B;;;
/ T% F$ y9 w( r% D/ Z;;; If it can't be found or it can't be loaded, then abort the3 U8 _' K( c* e T& k, z' K8 Y
;;; loading of this file immediately, preserving the (autoload)
- C) B, A( o. e* [;;; stub function.
7 M" a6 t& ]7 A+ f
, q: e6 H; n- q2 y (cond$ I6 c% W6 L9 D5 ?; s a
( (and ai_dcl (listp ai_dcl))) ; it's already loaded.4 q2 | ]+ G6 b2 C& m' i1 W+ p( X
4 [/ M% n9 s: M+ N7 q. a
( (not (findfile "ai_utils.lsp")) ; find it
$ }2 L6 s' V' P" g u" h# e. \; ^ (ai_abort "DDVPOINT"7 X/ Y6 f+ L. |5 T: X
(strcat "Can't locate file AI_UTILS.LSP."" j+ m: ^3 {! Q! W7 a7 Z1 v9 |; ?! c
"\n Check support directory.")))7 i4 i: q+ ~, e! v
! a( R( _ ^# v" S2 P$ n3 J+ T
( (eq "failed" (load "ai_utils" "failed")) ; load it; q3 Z& f8 z+ D) W0 F% [4 k, \; k! ^5 [
(ai_abort "DDVPOINT" "Can't load file AI_UTILS.LSP"))' q" [1 W% {- Q: Z
)
# _8 L" X6 E$ g, P
]* z6 d1 k% S8 f/ o (if (not (ai_acadapp)) ; defined in AI_UTILS.LSP& H$ e# }/ b, D5 {% |
(ai_abort "DDVPOINT" nil) ; a Nil <msg> supresses
( `8 l. L, u5 e5 F; z& N) g/ d ) ; ai_abort's alert box dialog.
% R- _, u' A% K1 C; n
% A9 r; ~5 Y) R4 p+ g;;; ==================== end load-time operations ===========================
- s% \1 | V3 i/ G: r4 n; q7 H2 H, |8 c# s6 W B
(defun ai_ddvp_start ( / image_x image_y image_h slide_x slide_y slide_h program), A" N* Z0 J0 ]1 K1 t
;; Get program name
5 d! j- Q5 ?. X (if (not (setq program (getvar "program")))+ h! Q5 q0 C1 }0 ~9 Z) U( R
(setq program "acad")
9 p% t: ~1 }8 T+ A' G' q* z )
+ v1 k% I4 @) X (start_image "ddvp_image")
& m$ `/ M5 ~" M! }) Y7 L (slide_image6 R2 f6 k+ P# f1 H- m; }
0 0
8 o& V& b5 h0 H4 L( T: _( b (- (setq image_x (dimx_tile "ddvp_image")) 1) / q v; B3 O+ \; y6 `1 B% {
(- (setq image_y (dimy_tile "ddvp_image")) 1)
+ G! [' C4 ~, V! m( @) j (strcat program "(ddvp3d)")2 n3 M. k# R1 T, k7 l0 ~% b4 B! W
) J f- k4 [, E Q; b4 k
(end_image)# [7 L: M; l* Z7 k7 |
(setq - H$ k3 p4 C1 J% r9 G& v
image_x (float image_x)
5 \8 u3 Z5 A L) u8 ]" Q+ A image_y (float image_y)
6 J0 b8 q# p/ u+ N slide_x 12.4265 C/ @/ K, i+ [' f7 B
slide_y 9.0
+ S& r/ m/ z/ X1 T q. ~8 D4 K image_h (/ image_x image_y)
5 U o3 o, g3 P( K( r- d slide_h (/ slide_x slide_y)
) o! _; Z8 h0 e$ f9 G0 k! P1 |+ T ~ )
: {0 n. ~% U L: r0 {3 w* b" X- V5 X1 T (if (< slide_h image_h)
8 d1 C2 v8 Y' T (setq slide_y image_y6 ^! C' v5 u; i) S& a# `
slide_x (* slide_y slide_h)! l7 X& s! k9 [7 y5 E% n( B* e
)8 e8 Z' j z# ~* d
(setq slide_x image_x/ z$ z- ?9 i( q5 F. t# B
slide_y2 (* slide_y (/ image_x 12.4625))/ z2 t; E5 r) t& ?0 g
image_y2 (/ image_y slide_y2)$ ^1 e- _0 q* t! ?, U0 V
slide_y (* slide_y2 image_y2). K) d4 w0 F/ X& Y
9 d% J8 [7 O1 m) ^7 p7 e ): h- o, x( m! g
)" @0 ^* R* j+ [3 d8 I
(setq ai_ddvp_bx (fix (* 0.295 slide_x))
# ~$ c# u6 _6 x" G# T ai_ddvp_ax (fix (* 0.65 slide_x))" A$ D# y! s' ?! D- N
ai_ddvp_by (fix (* 0.4875 slide_y))6 H/ I: m8 L8 ?
)% U& c `' z: N; t
)
* w" n. A9 p# _/ O; Q& L n- J5 A5 p4 u: Z" J5 ~* J& K
(defun ai_rtd (arg)
* y, }6 a f- ~ (/ (* arg 180.0) pi) L$ z& t7 x" ^8 m6 e3 o& \
)! M4 H4 i- h" e3 G# Q
3 f6 x$ K. k" R; _* w(defun ai_dtr (arg)
* u" }# Q: f/ \% H5 Q: M% Y (* pi (/ arg 180.0)): H; ~* M6 d7 ~$ ?- Y) D
)+ r0 d( D8 V& o! H
9 J( c; p$ P& b- K! f+ F(defun ai_ang3dv (v1 v2)
8 {: u' T3 u) n8 o (if (not (equal v1 v2 1e-12))& ]9 z0 B# s5 l3 i l( R' B3 \
(ai_arccos
7 q4 J- N0 k* M) W$ x. {& z1 \ (/ (ai_dotp v1 v2)
4 p( i! @' G# q' |; O (* (sqrt (ai_dotp v1 v1))* b$ O1 @1 T" ?9 f
(sqrt (ai_dotp v2 v2))2 m$ f4 N' v' A% W) H' g I5 f$ _7 L/ B% S
)
9 }: C1 m$ @0 B) K- g )1 Q! z' I. @8 I6 {% n6 I5 V3 Y( A- c
) `% r8 V9 H8 y+ R1 Q m5 D
(eval '0.0)7 B6 L. F- f; ~8 }: J# \
)
$ L3 C$ T6 t+ T! D0 t- I, E! H)
& H. c' g1 p9 `9 N1 D& N f
- M! a- r+ P Z(defun ai_arccos (ang)
# R+ c z% j& Q) @3 O' S: x (if (not (equal ang 1.0 1e-06))
' k# A' a! y r* y (if (not (equal ang -1.0 1e-06))$ {( _; j& ?: a3 Z, Z" U+ Z: n4 m
(atan (sqrt (- 1.0 (expt ang 2.0))) ang)' Z2 U( m7 _$ W8 n
(eval pi)
0 w* m4 h* V: I( E: ? )
0 T3 g3 r, X+ }* V (eval '0.0)
. U5 h4 d/ |4 b )* z$ e2 ` s& m" E1 h
)3 c" E9 t1 e7 C; d7 J. n$ Q
$ |. ^- Q t' k/ x2 k1 E
(defun ai_dotp (v1 v2)7 ?/ a0 L8 O3 E% Q* x0 E; n
(+
: h! ^& x/ R* C (* (car v1) (car v2))# j7 B7 z# G9 p$ a0 }( P
(* (cadr v1) (cadr v2))! P. m0 J9 j, B; k9 a
(* (caddr v1) (caddr v2))
+ N. P3 O3 D+ a0 p5 \ ). u( D9 F9 t( s7 _4 M( @# x8 O
)' J. v& B/ ?7 N) M9 ]
/ H# v* s. L# @; R9 s- T$ M# I(defun ai_ddvp_do ()8 E- ?& F7 e9 A8 H2 B) }3 {: A
(if (or (>= ai_ddvp_b_curr 360.0)+ T- L" Z; A+ e& O$ {
(< ai_ddvp_b_curr 0.0)
% O4 N U/ {' [( j9 r8 R. Z (null ai_ddvp_b_curr)
1 j: `& z1 X m )% n0 W+ @& _' F2 B- z6 K% u
(progn5 i+ p! Z9 s [! o( \
(ai_ddvp_drx ai_ddvp_b_last ai_ddvp_bx 0)+ A" n0 s2 K. j/ @. I6 w! r
(ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 1)
3 `- X" V6 d9 ^ (mode_tile "ddvp_val_x" 2)
0 @, X* w6 ~* X9 j) O (set_tile "error" "Invalid angle from X axis.")
- ?9 [" r( A; a* ^/ n8 u )
8 s' y' n! Y3 i' q) e2 C (if (or (> ai_ddvp_a_curr 90.0)
1 G$ }" }) { z. M (< ai_ddvp_a_curr -90.0)5 r* H- d# C- g) L
(null ai_ddvp_a_curr)
! k/ D$ j+ w I4 E# M- K7 a9 ^ )
3 ?) Z V/ h- R+ s; \3 X (progn) q' U- |; a {5 t! Z
(ai_ddvp_drx ai_ddvp_a_last ai_ddvp_ax 0)
9 b( X8 K/ ~8 n } (ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 1)
- X5 q; L' p1 A0 F (mode_tile "ddvp_val_xyp" 2)
! O+ ?' y9 o `8 ] }( q9 S (set_tile "error" "Invalid angle from XY plane.")
% T. d5 T; d& ?/ t0 ?1 c7 n )
! E, W- O+ x' @, r! `, i; [ (done_dialog 1)
* `! o7 x* u2 _( X& [1 p )
& a! w" _3 g" c. e4 F ): r8 L3 s8 l1 m: n1 p" ~/ p/ s
)/ p' \0 c5 E! f3 Y( o
# x. D L8 {; X0 X0 b/ d- |
(defun ai_ddvp_set_a (ang)
- y* z+ i) H, K (setq ai_ddvp_a_curr ang)
& N1 L2 W5 d6 @5 {. r+ `) N (if (or (> ang 90.0)
' Z# o5 z4 P0 I% @9 M8 \ (< ang -90.0): w; G Y8 d/ o7 s* T
(null ang)# Z" [% I8 ]0 k+ S0 _) X# J: h
)
5 s) ]' U" d/ ? (progn$ @# g1 a6 O- F
(ai_ddvp_drx ai_ddvp_a_last ai_ddvp_ax 0)* P) T4 K' h, T0 p
(ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 1)
$ f, M# @! b% ^7 H1 ]/ Z (set_tile "error" "Invalid angle from XY plane.")" g# `, g1 o% _0 W) K
)
6 S {& ^4 V. {& D Z. t (progn6 y) N8 u$ ]$ F# u$ W
(set_tile "error" "")2 t/ y) z0 I1 r, G6 X4 _
(ai_ddvp_drx ai_ddvp_a_last ai_ddvp_ax 0)
9 u7 z: Z# A' ?5 h: l4 j (setq ai_ddvp_a_last ai_ddvp_a_curr ai_ddvp_t T)
" K$ h5 p" Y+ T, |. f; ^5 P (set_tile "ddvp_val_xyp" (rtos ai_ddvp_a_curr 2 1))( C- Z- N8 V$ ~* D8 t ?
(ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 1)
5 k2 }, `" V9 z' L: F% O) u (ai_ddvp_drx ai_ddvp_a_curr ai_ddvp_ax 7)9 x/ `2 o% u9 [& {& h1 x8 @6 Z5 F" o4 M
)0 H) G# }+ d# L; m. ]
)6 j5 T9 B7 u {' W* ], A& g
)# I" ~0 L) j4 V& l0 d$ {/ l3 s
. r+ }! q2 d7 n: C- u9 k) b* Y2 [(defun ai_ddvp_set_b (ang)
/ Z' Z ?4 G, {( _1 A7 D2 Q: Y (setq ai_ddvp_b_curr ang)
+ e+ V: E s2 I' u6 z1 v& W (if (or (>= ang 360.0)
1 I* W1 m; I- V' x v' q (< ang 0.0): p& }' c8 M6 |! A9 W. t8 ?: @' e
(null ang)
* }( R' h9 O; b: U v )
: }, ~2 \5 g/ u) u b (progn
: ], J9 Y" x& w2 L (ai_ddvp_drx ai_ddvp_b_last ai_ddvp_bx 0)
5 i" O$ @/ Q9 @4 y! \+ C (ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 1)
) H m- D4 [1 z4 w (set_tile "error" "Invalid angle from X axis.")2 a; s) B+ m' ~8 d% h5 A4 T
)
2 S' N8 v+ Z$ p3 k% _ (progn
. G6 h" @& P% r6 f (set_tile "error" "")
" |7 b) W) \& L0 p6 v2 L" J (ai_ddvp_drx ai_ddvp_b_last ai_ddvp_bx 0)
- _2 G. p0 {/ n3 g$ \ (if (= ang 360.0)
/ T! B ~; P, y- V* { (setq ai_ddvp_b_curr 0.0 Q' `3 j+ z0 h* g% H
ai_ddvp_a_curr 90.0
5 N1 e0 E' _% z% } ai_ddvp_p T. u L0 v! \% e
ai_ddvp_b_last ai_ddvp_b_curr4 r0 S6 i/ _- B$ r: C
)& a! B8 y, I' O# X/ t
(setq ai_ddvp_b_last ai_ddvp_b_curr ai_ddvp_t T)
0 E6 k2 ^' x" m1 q P7 Z )) g2 y2 a! \# m& i6 \
(set_tile "ddvp_val_x" (rtos ai_ddvp_b_curr 2 1))
) a0 c) e9 N' c- g! W (ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 1)
& z9 d$ f1 Q+ z (ai_ddvp_drx ai_ddvp_b_curr ai_ddvp_bx 7)5 [2 V! ]0 ~9 I0 g
)
9 Y5 Q1 @% I& u1 `& r! j ); q2 t8 p+ R' t/ I* Z
)
& _" k# r3 K& E/ V; D( G5 F) o+ N0 p8 Z$ q% N( H+ T
(defun ai_ddvp_drx (ang x1 col / a x2 y2)
2 t, g8 p; o% G% D0 Y4 G (setq a (polar (list 0.0 0.0) 3 [( m) p8 {# r8 {- G
(- (* 2.0 pi) (ai_dtr ang)) % @0 l& W# ?9 D: U/ [, K
25.0
* x) d9 a, K5 g) V3 ?5 Y+ {8 v )
?$ _7 p3 t/ _8 I x2 (+ x1 (fix (car a)))
# S( G$ ~( _2 ]( v; i y2 (+ ai_ddvp_by (fix (cadr a)))9 U. O( j/ p7 ^9 S
)1 W. J$ K7 Y& n, Y* \, N+ b% N
(start_image "ddvp_image")+ p1 H4 w0 ~8 w9 _5 r5 ^; A: Q
(vector_image x1 ai_ddvp_by x2 y2 col)8 i3 d8 a- n2 z9 i' q6 `
(end_image)
& s3 S9 N9 ?, U/ V)- R6 b& Z7 x ~
5 q( C9 m6 @2 P/ p( `6 n9 i* A, K
(defun ai_ddvp_image (x y / ang1 ang2 list_xy list_axby list_bxby)9 s2 F% [( ~- {9 v4 F8 x5 m, t
(setq list_xy (list x y)
6 O! \: L6 L8 E6 J list_axby (list ai_ddvp_ax ai_ddvp_by)- H- B: V/ [. }3 A0 J# `1 }
list_bxby (list ai_ddvp_bx ai_ddvp_by)9 a0 \0 m/ n6 ^7 x3 _! K0 h& Q
)" T$ j H0 z }2 q0 F3 K% Y
(if (> x (- ai_ddvp_ax 1))
1 I/ S4 ? g8 _! ~' e2 h (progn# x1 R6 `" }8 p/ i2 U( E7 h
(setq ang1 (ai_rtd (- (* 2.0 pi) (angle list_xy list_axby))))
0 A& C, r2 @% d0 U (if (< 90.0 ang1). ~2 C: {; A. J l5 k
(setq ang1 (- ang1 180.0))& p; G. y# s J& `4 v
)( e, F, l! ~( W: d# J( c! a
(if (< (distance list_xy list_axby) 40)
Y3 x3 L. Z. S) V/ r$ O+ h (ai_ddvp_set_a ang1)
; ?( h! U2 k# i (if (< (distance list_xy list_axby) 84)" k v6 y+ a" Z6 I' G4 p; d% M
(cond ((= ang1 0.0)8 r0 @8 i2 R$ m7 t4 V% Q! ^3 r- E6 k
(ai_ddvp_set_a 0.0)
0 i7 H3 V5 B9 y4 v( V )
( `* r0 z" ?' ?% n! O. W* ` ((< ang1 -72.0)$ F! Y8 Y3 ]0 c& ^, I# J
(ai_ddvp_set_a -90.0)8 Y$ n. i7 F! q+ |, ?6 n# k
)6 W; j* n. ?4 x, O7 V7 O
((< ang1 -53.0)3 Y2 d$ `1 d- l" {8 J
(ai_ddvp_set_a -60.0)
V' @" v6 o+ }+ @3 V )
" N- B$ _& o# d7 X) b ((< ang1 -38.0)
4 F3 {$ f2 a& L1 a0 j, g (ai_ddvp_set_a -45.0)
) G' w* r+ W6 }" C7 O2 P9 o$ _2 I )
1 G" u( l' e- }% `" e$ W1 h# j. l" R ((< ang1 -20.0)
) V! i* ?( ~# K0 D5 J (ai_ddvp_set_a -30.0)
! x# B; s0 M: w$ K )% h& H# o( _9 d* f
((< ang1 -6.0)# v1 l% l% Q% C6 f
(ai_ddvp_set_a -10.0)
: R" N2 r/ M* ]& M+ W1 C0 \; ?4 s )
$ t( ?: L. p* E& f3 y7 ?$ W9 ] ((< ang1 6.0) W, n% u3 H9 X/ C: w1 Z5 v5 R- f
(ai_ddvp_set_a 0.0)+ a M$ M+ o1 D. W2 I8 [
)4 q. F v3 [! E0 m0 k
((< ang1 20.0)6 m# m0 h: p+ c; f
(ai_ddvp_set_a 10.0)
f2 Q( N; c, H- p ). r0 F' s" \% _4 O, L6 c; }" J8 K
((< ang1 38.0) M A& t% ~, w$ X3 }$ m8 R
(ai_ddvp_set_a 30.0)& p4 _2 l! J+ U. D2 P/ L
)7 {: q) w) f$ \6 z B- ?6 a2 i2 B
((< ang1 53.0). u2 r) |+ A6 G- }9 D: C8 F# I
(ai_ddvp_set_a 45.0)" h6 Q5 Z0 J! v9 D" {
)
# b: I( C* d2 Y% H" i ((< ang1 72.0)3 \% }8 u4 \5 s- s$ p
(ai_ddvp_set_a 60.0)/ U( A" W/ l6 p
)$ j6 h# z9 c+ [( f" d* ]
(T
4 Z& [2 ?* e+ G: X ]( v6 I: | (ai_ddvp_set_a 90.0)
/ g- l# B6 F$ A7 @/ L )1 p% K+ q- a" m% V
)
J# M$ T6 l0 B% Z2 X )
) |# e9 H" c2 T3 c9 V4 ~ )2 e) A2 }, f* ?# }' J
)
! i4 y( J) S5 I) I9 B% h, Q# f (progn0 o L: O5 Z/ ^6 ]0 c5 M
(setq ang2 (ai_rtd (+ pi (- (* 2.0 pi) (angle list_xy list_bxby)))))
( F1 G; H. ?, b+ K4 E- v& L (if (< 360.0 ang2)& M: i! C1 _' ^4 R
(setq ang2 (- ang2 360.0))
! L0 J, O3 h8 G9 O* F; a# M% p ). w3 v/ q( {1 p! M! |9 ~6 n
(if (< (distance list_xy list_bxby) 40)
2 v* o4 T. L" {, K% ^- w& ` (ai_ddvp_set_b ang2)
3 C: W( P1 b" s+ i (cond ((= ang2 0.0)& C4 T l- o* g
(ai_ddvp_set_b 0.0)8 C8 ?1 t8 C1 n
)
2 o. C! F0 O! D4 | ((< ang2 22.5)' F0 M& l5 V3 g
(ai_ddvp_set_b 0.0); N6 ^) j# R! m F
)
& n0 N. B+ Y6 C% K' a ((< ang2 67.5)
1 E2 M' C- O z O (ai_ddvp_set_b 45.0)6 e: L( F* ~, M0 x; e2 @
)3 n l+ M6 h5 H
((< ang2 112.5)
- F' u* z/ U, ~" e3 W E/ f! z (ai_ddvp_set_b 90.0)( d3 J) f$ B2 Q1 P& ]8 w
)
+ }6 b$ i2 Q! z, D! z" j ((< ang2 157.5); i9 x) j0 l" L% k
(ai_ddvp_set_b 135.0)
" h, n* Y, B% X, f* }) c ) f" ?7 p6 Q: m: n. L6 D3 W. W0 L
((< ang2 202.5)8 J' G: I# e2 @0 @* b( _$ L- X2 B! [
(ai_ddvp_set_b 180.0)1 ~. G# @/ k" p9 H
)5 i k% `. k1 O M# x" M
((< ang2 247.5)
& _: n; s! i; m( y (ai_ddvp_set_b 225.0) z1 Q- d9 }8 a7 O, R8 y
)* I2 i, x% P m9 {: Y7 g
((< ang2 292.5)
2 m1 Y, L0 ]8 n6 Q9 Z (ai_ddvp_set_b 270.0); c, t* h! N) W% G [
)
8 v9 a: r' V$ h* F4 g ((< ang2 337.5)
* K5 \3 o8 I2 ?- i7 @ (ai_ddvp_set_b 315.0)+ ` K( h% T$ q
)5 ?- v9 k+ p& x: F
((< ang2 360.0)
8 J, m1 W1 r# }: B" S (ai_ddvp_set_b 0.0)- `4 J% r; Y/ h) ^( d: f
)+ `: Z9 r8 l5 W4 w% S
(T
9 c0 T4 c0 e% D: i2 o (ai_ddvp_set_b 270.0)
$ q# i! X; T6 y )
# T! r! Y$ O5 E9 \ )
$ T0 D4 Z% p: w! C# v )! o/ Q* G, k6 \! |* E5 t
): S$ o+ y8 o" I5 `: u' J, [( Z
)* V+ h6 E/ `: H
)5 [! u/ b/ {. |$ G
+ J# @- a; g S7 i- ~. S0 p" d
(defun ai_ddvp_plan ()! Y/ o0 c P2 p. f' i
(ai_ddvp_set_a 90.0)
3 A( H/ a V3 T, v- P (ai_ddvp_set_b 270.0)1 J4 G1 {" C0 d1 R" }
)
4 d9 R. \% b& C% X3 p( w4 \/ y9 T# c7 W& [. O6 b Z. {
(defun ai_ddvp_setvdir (a b)
- U7 M) L+ C+ B4 W$ N7 F (list (* (sin (ai_dtr (- 90.0 a))) (cos (ai_dtr b)))( j7 a1 @* Y0 x2 g
(* (sin (ai_dtr (- 90.0 a))) (sin (ai_dtr b)))
/ W! N7 i9 H+ u) l: X+ |" ` (cos (ai_dtr (- 90.0 a)))
) K/ s# ^4 ]& H" } )
8 m& c9 j" b7 X; U)# U( O8 {, z" s( Z
, _+ [& e8 X* H, U% p. \' G
(defun ai_ddvp_set_abs ()7 J9 T. \9 D S3 m
(setq ai_ddvp_wv 1)! W. j# N; M( G0 L$ ]
(ai_ddvp_drx ai_ddvp_b_curr ai_ddvp_bx 0)
2 b/ y1 C& v2 M (ai_ddvp_drx ai_ddvp_a_curr ai_ddvp_ax 0)
4 b! N. E9 ]: l# b (ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 0)
8 E3 M, t5 e% }( [ (ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 0): {% u( _* w6 x6 e" A6 L7 ?) ]
(setq ai_ddvp_vdir_base (ai_ddvp_fixzero ai_ddvp_vdir_base))" c$ Y6 T: I; r. S) U
(ai_ddvp_setang (trans ai_ddvp_vdir_base 1 0 T))
2 C) E; i3 ~) e# }: D( G. c0 Y: H (setq ai_ddvp_a_base ai_ddvp_a
) J4 x# H4 O# W" W; p& \ ai_ddvp_b_base ai_ddvp_b+ {9 f( n% M1 J0 C
)
# Z5 H) ?3 ^1 f# U6 @/ k) v: O0 q0 d% ?, s/ ]
(setq ai_ddvp_vdir_curr
& u2 k& f( V a& ]; a, {8 ?" o (ai_ddvp_fixzero
2 t1 v9 b4 I6 u A T) |1 T (trans (ai_ddvp_setvdir ai_ddvp_a_curr ai_ddvp_b_curr) 1 0 T), w- L+ H! } S, t
)
: [' F4 l: h2 ^ )! K( A- F% `8 G8 P1 o
(ai_ddvp_setang ai_ddvp_vdir_curr)
W6 }' N9 M" m# E6 J (setq ai_ddvp_a_curr ai_ddvp_a9 z9 Z' k0 m- j! h. ]% C9 v7 c
ai_ddvp_b_curr ai_ddvp_b7 \( s3 v& U- r" }* l+ @+ _# ?
)# ?' V; D, H+ z
' I9 c# a5 k" S! K3 J) Y+ O P% | (ai_ddvp_set_a ai_ddvp_a_curr)
2 {* ]/ C! @6 _& M) J (ai_ddvp_set_b ai_ddvp_b_curr)
, H& N" r! [0 w7 k$ x4 Z( ])
" T! |3 P7 {, c+ u1 m
; V0 Q1 }4 E$ ^& \- M. ]
( j& c6 m' n- m R" w9 [1 c(defun ai_ddvp_set_rel ()
. S6 l) e: t' [0 _$ } (setq ai_ddvp_wv 0)
% t- H$ }& H6 f% @ (ai_ddvp_drx ai_ddvp_b_curr ai_ddvp_bx 0)
8 @% D8 o& [" j (ai_ddvp_drx ai_ddvp_a_curr ai_ddvp_ax 0)
& T. h" O8 a+ \7 N% \9 B5 P (ai_ddvp_drx ai_ddvp_b_base ai_ddvp_bx 0)
1 z& p- c) l' k* V+ Q (ai_ddvp_drx ai_ddvp_a_base ai_ddvp_ax 0)9 I; W9 s& q; n8 V
(setq ai_ddvp_vdir_base (ai_ddvp_fixzero ai_ddvp_vdir_base))
- C$ P1 H2 w# c# _* _& d( R5 p (ai_ddvp_setang ai_ddvp_vdir_base)! z/ y" `- H& z3 h
(setq ai_ddvp_a_base ai_ddvp_a
# U2 w7 M) z0 b. |/ P+ H9 W ai_ddvp_b_base ai_ddvp_b
* ^/ O' g& b9 g, t1 V& f& i )
( K, K* w) g& g. } (setq ai_ddvp_vdir_curr # U* j4 A+ \' E
(ai_ddvp_fixzero
: A: l0 y+ a8 a( {5 Z (trans (ai_ddvp_setvdir ai_ddvp_a_curr ai_ddvp_b_curr) 0 1 T)
+ T. ]* e1 K/ Z8 Y, j) W8 ` )8 e0 F/ K" G6 z5 a6 z3 H' \/ Q f
)1 R* F p, Q) u. B- R
(if ai_ddvp_init0 |2 j( K, a* V
(setq ai_ddvp_vdir_curr (ai_ddvp_fixzero (trans ai_ddvp_vdir_curr 1 0 T))$ O; B5 t( S& _) I, t" j. D
ai_ddvp_init nil
- D% X O# H5 W- b# z' E6 s b& { )2 H) |9 U5 b; r3 M
)
. Y7 Y2 \( t7 v, ^) p" G (ai_ddvp_setang ai_ddvp_vdir_curr)
, ]0 L7 R$ i0 C4 m* s (setq ai_ddvp_a_curr ai_ddvp_a
/ o" s( L: B; v3 z/ o9 _( c ai_ddvp_b_curr ai_ddvp_b
" g/ |( H6 E0 H. o4 X" \ )7 Z5 z5 ]6 p8 O: ?: V6 G5 A/ H
(ai_ddvp_set_a ai_ddvp_a_curr)
( X1 F4 E/ n+ B" ^0 G (ai_ddvp_set_b ai_ddvp_b_curr)
. j5 F$ [ g2 M% i Q6 R: k)3 t: [5 N0 J( C4 b! k4 }/ ^; A
+ L* ]# k2 V' H
(defun ai_ddvp_fixzero (vector / vector_x vector_y vector_z)( K, b/ b8 m& H" M% Z
(setq vector_x (car vector)6 ^. s1 p5 c6 R- V/ e! H6 y+ }
vector_y (cadr vector)9 ^8 m9 @9 B8 J: E
vector_z (caddr vector)
* Q7 X- k. c1 r- A7 m9 L D6 l )
. ?% w& C! }/ ^8 r* c/ R( }9 I/ A (if (equal vector_x 0.0 1e-06)
- G+ D* m$ v$ U# z. S (setq vector_x 0.0)
5 X7 G" h7 d4 C( c" z/ ]; e3 ` )
7 `* ?: m# P$ I X (if (equal vector_y 0.0 1e-06); K& d( d R2 V$ C/ y8 w3 V
(setq vector_y 0.0)
7 B3 `: F4 |7 F0 N9 ]$ x6 R5 H )7 _# t; T( G4 ]1 T. ^ n- S
(if (equal vector_z 0.0 1e-06)
. u' E* ?4 a/ @) {3 p+ X0 S (setq vector_z 0.0)/ F. v) w ~6 @% ]/ C E
)1 B) R3 [+ I- z- {$ b
(list vector_x vector_y vector_z)7 t: J. m0 o* g& ?
)
/ Q0 ?, J" I0 R R8 h2 M( W* ?& @7 i1 n1 L- ]5 p b$ J
(defun ai_ddvp_setang (viewdir / viewdir_x viewdir_y viewdir_z ai_viewdir)' i8 C9 s" \# @- o1 J
(setq ai_viewdir (ai_ddvp_fixzero viewdir)' s* F0 b8 ]% o4 t/ W+ g' @
ai_ddvp_b (ai_rtd (angle ai_viewdir '(0.0 0.0)))
" k" y" Z7 Z# p' I, ?8 x )
" ]" u* s* n; k6 m4 F (if (equal (list (car ai_viewdir) (cadr ai_viewdir)) '(0.0 0.0) 1e-06)
7 y' V% ^) ?' B( v. D+ l (setq ai_ddvp_a 90.0)# `+ }5 A/ I v& G6 R5 l3 k: N4 h4 G
(setq ai_ddvp_a (ai_rtd (ai_ang3dv & H3 ?; U$ T8 P2 c
ai_viewdir
# h! k( ^% G- z, _( X (list (car ai_viewdir) (cadr ai_viewdir) 0.0)* h% v# W5 b" C) e& {
)! B" k% f" W: ?# u$ i$ i7 M
)( [: G: z- D8 W( M& U
)
1 Y/ K6 n$ L& R9 d( H% l )0 T3 f" c9 r4 T8 b
(if (< (caddr ai_viewdir) 0.0)
3 A/ a1 ?" j( y) X: i' a6 A (setq ai_ddvp_a (- 0.0 ai_ddvp_a))( f! n1 F1 R! ?
(setq ai_ddvp_a (abs ai_ddvp_a))
6 w: i1 l: G: K0 N& k% q5 u& A )
" J; S4 a9 q; W, O# \! q (if (>= ai_ddvp_b 180.0)* O5 }5 t' B+ k/ i
(setq ai_ddvp_b (- ai_ddvp_b 180.0))
% Q+ ^' C$ l: `2 D (setq ai_ddvp_b (+ ai_ddvp_b 180.0))/ E0 o: V$ C: z7 I
)
4 _9 R0 L. @5 ?9 ?: ` } (if (or (= ai_ddvp_a 90.0) (= ai_ddvp_a -90.0))+ K- F0 T% ?6 H8 H
(setq ai_ddvp_b 270.0)
5 s( y+ C" M9 ]! Z )6 d9 y; U1 y! X( _" k# [
): i. o$ ^ {, O0 o/ f
1 Q1 [. @3 b0 X1 e! l(defun ai_ddvp_main ()
! W6 @. [6 l+ j9 ^ M8 L (ai_ddvp_start)
& i, k( I+ p7 F1 R* f (ai_ddvp_setang ai_ddvp_vdir_base)
6 R) m- g5 h: K) g& T' Y2 i9 G (setq ai_ddvp_a_base ai_ddvp_a
6 R- _8 k$ V* Q' i6 o ai_ddvp_b_base ai_ddvp_b& t7 `7 d$ L2 |% F
ai_ddvp_vdir_curr (ai_ddvp_fixzero
9 r; L q! \2 A o S# i; S (ai_ddvp_setvdir ai_ddvp_a_base ai_ddvp_b_base) f0 }4 D* Q) M) a' u
)
1 X) m: f2 S3 J2 V, Q )
& |4 R+ e% F! {# ] (ai_ddvp_setang ai_ddvp_vdir_curr); Z. |) ^; F! G( E0 J
(setq ai_ddvp_a_curr ai_ddvp_a5 g# [* o1 {8 j8 m
ai_ddvp_a_last ai_ddvp_a_curr1 L0 _+ r2 z) k( _ C$ E5 K
ai_ddvp_b_curr ai_ddvp_b% o+ ]) K8 G+ e1 V* R
ai_ddvp_b_last ai_ddvp_b_curr3 F; r3 S4 q1 Z9 Q- G4 b
)
; a8 a4 _7 t! T& `' W8 A (if (= 0 ai_ddvp_wv)1 v8 t4 N' e. f" W8 l% x, D
(progn0 H9 T; a1 B2 A& x r
(ai_ddvp_set_rel)+ o- v% i* d7 n/ t
(set_tile "ddvp_rel_ucs" "1")( Z. G+ O: r4 |
)
6 Z7 \& t' W" {4 J: M k9 j1 R" a (ai_ddvp_set_abs)
. ^6 P2 Q& [0 Q r: Y )0 l6 R" c8 O4 u# \ }
(setq ai_ddvp_t nil)
& A, m( b1 }; | (set_tile "ddvp_val_x" (rtos ai_ddvp_b_curr 2 1))
( x0 e; i: o# s5 w- a (set_tile "ddvp_val_xyp" (rtos ai_ddvp_a_curr 2 1))
, W6 @& \1 p7 H' g9 w; Z% O! o7 r (action_tile "ddvp_abs_wcs" "(ai_ddvp_set_abs)")
x W0 S# G( e, u (action_tile "ddvp_rel_ucs" "(ai_ddvp_set_rel)")
$ [" _6 C! P) V% z% F% \+ a (action_tile "ddvp_image" "(ai_ddvp_image $x $y)")
' i: J/ R. K7 i (action_tile "ddvp_val_x" "(ai_ddvp_set_b (distof $value))")
9 N# [' n/ d6 v1 _* x (action_tile "ddvp_val_xyp" "(ai_ddvp_set_a (distof $value))"); ~( p# l$ B$ Z1 F7 U
(action_tile "ddvp_set_plan" "(ai_ddvp_plan)")$ k, i5 Q9 d0 d& a7 n3 t0 q1 _! N! D
(action_tile "accept" "(ai_ddvp_do)")
$ H+ p1 a% W3 |: n$ ?* e: | (action_tile "cancel" "(done_dialog 0)")
8 h" x3 M% n7 p7 d" H6 o (action_tile "help" "(help \"\" \"viewpoint_presets_dialog\")")
1 C7 ~& P; @1 I (if (= (start_dialog) 1)3 V$ s$ c( @. ]: y
(if ai_ddvp_t# d7 w8 R8 Y4 _% G7 V, W
(progn: r i- Z6 }' [
(command "._WORLDVIEW" ai_ddvp_wv)
. h# p3 @& e; M4 G7 O, l z, | (command "._VPOINT" "_R" # ^) z/ x8 Z( u3 R( m( o
(strcat "<<" (rtos ai_ddvp_b_curr 2))
4 N! p! w5 H: G# V0 U# i; k0 F (strcat "<<" (rtos ai_ddvp_a_curr 2))
6 x5 c/ x' |8 G3 x+ S; f )1 D0 b: j% N, e
)6 c! ^, i5 L r4 I* ~3 R
), n6 }7 u( W. @, ?+ {
)
" p3 W V* N! B6 r) ?)3 m2 }7 R' ?2 x3 Q" _
4 j# \& x2 E7 d f) {3 j(defun c:VP ( / ai_ddvp_wv ai_ddvp_vdir_base ai_ddvp_vdir_curr F) Q# ~3 Q* R& i1 d
ai_ddvp_bx ai_ddvp_ax ai_ddvp_by ai_ddvp_a_curr
8 v* r0 R9 x" o. o3 B V8 H4 | ai_ddvp_b_curr ai_ddvp_a_base ai_ddvp_b_base ai_ddvp_p7 r& w( v. @& v. ^, h# }
ai_ddvp_t ai_ddvp_init ai_ddvp_a ai_ddvp_b
2 a5 I! f! V4 V7 A# T9 _ ai_ddvp_a_last ai_ddvp_b_last
$ |8 |+ L+ u& Z" l app dcl_id old_cmd undo_init * e i$ _5 e8 X
)
0 @5 d" V1 d3 G9 t m- n8 q
( c; }: e) ]' N1 c j& O ;; Set up error function.( j0 S- t' X" ?6 O9 N" }
(setq old_cmd (getvar "cmdecho") ; save current setting of cmdecho& y% `3 K, Z9 T* R: P# ?
old_error *error* ; save current error function: m7 [3 z& E& T3 G$ L
*error* ai_error ; new error function w2 \1 e, u- ]9 H) A$ h
)
}& U$ y* x% [8 E/ w3 f
+ F' E( t# [$ ?% u/ I# | (setvar "cmdecho" 0)0 N' N9 T4 x4 A& S8 O9 k# G
. n4 R. n8 ^+ ~; G (cond1 E) T4 e. o+ Z( b" f3 p
( (not (ai_notrans))) ; transparent not OK
. b" H% F- S( |7 N, p8 W4 p; K. f ( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
$ A5 w5 n% j1 `, S0 l* W, K; ^ ( (not (setq dcl_id (ai_dcl "ddvpoint")))) ; is .DCL file loaded?1 b8 c- m: t3 B7 R
(T (ai_undo_push)
; V! ]) d) r* f" X. e (ddvpoint_main) ; proceed!
a- e! u0 s0 y: t+ C (ai_undo_pop)- q* \/ y+ _& g- I- X! f
)
' A% q) f, v1 r4 }# }8 l2 |% z9 {! U )
) O1 Y. |2 [8 w& G6 R# F6 p6 N2 R) Q3 f
(setq *error* old_error) 1 W# A$ l q. x) ~( z
(setvar "cmdecho" old_cmd)# Z% ^: t8 b* ?- B4 Z! U
(princ)
+ g/ [7 E4 Z& `8 w+ R4 z)
! p* h2 D' u- B$ Y( @9 g
; H ` ]5 R. g(defun ddvpoint_main()/ S' V. Z: D5 T3 L9 A3 P' t3 r
2 P! [8 d4 v( _% H( Q
(if (and (= 0 (getvar "TILEMODE"))+ L9 O4 f' d9 i2 u" f. w0 G
(= 1 (getvar "CVPORT"))& ^! q# {* N0 f4 q2 ?
)
$ I# E5 o2 p# D* t( A7 Q (princ "\n** Command not allowed in Paper space **")! p' N$ W! F1 l$ ]& H
(progn1 R/ S3 ^/ s" ?6 N8 M* Q
(if (not (new_dialog "ddvpoint" dcl_id))8 C% E H% F8 h% T9 M
(exit)
8 e4 x3 v& k: o! a ), U- c% n A' }8 l2 ^/ i6 v$ _
(setq ai_ddvp_vdir_base (ai_ddvp_fixzero (getvar "VIEWDIR"))
q) Z! b5 }1 ~ ai_ddvp_wv (getvar "WORLDVIEW")
6 l! Y# ]& n9 X x9 \& }* j5 C ai_ddvp_init T
! `. C/ W5 Z+ Z1 _ | )
7 R' j0 m- g6 A, R0 @: v (ai_ddvp_main)
, c1 c8 c, q! f X2 n )
0 B/ ^& F" A% F, |; e )% J2 M4 W) Z) C& D% C) [# d
)! J8 O6 X# Z$ j: V& u% |
, ]3 R- M$ C0 \6 h5 h+ \2 k(princ " DDVPOINT loaded. ")
- X1 p- q5 ~ a L. v0 x7 u(princ)
. }/ _: b7 n3 n& T;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;' @7 k0 \+ z5 D# O
;============================= Tran Ngoc Thang =================================
9 c; w5 w1 t) n2 g. E0 B! f, \3 ?! I(defun c:zx () (command "zoom" ".5x"))
; e) v3 ~+ ^; O2 p(defun c:zz () (command "zoom" "p")): k7 { F& M# m: l; |
(defun c:za () (command "zoom" "a"))
8 ~/ j- @5 S# b(defun c:zd () (command "zoom" "d"))
5 k; K X8 E4 }" n2 b7 k) ?( C(defun c:ze () (command "zoom" "e"))& Z& N$ V& x! }( I" D2 g6 c9 x# n6 H
(defun c:zr () (command "zoom" "" ""))! c) L/ {# @' J. {: \
(defun c:vv () (command "ucs" "v"))
8 u9 _9 f3 l$ E(defun c:co () (ssget) (command "copy" "p" "" "m"))
- a- \6 o8 `/ e7 \, G- L(defun c:c () (command "circle"))
|0 A. D" G% T' c/ T# Y- R- \(defun c:rt () (command "rotate"))- M" I; H3 U* q) U: [+ O
(defun c:3q () (ssget) (command "_rotate3d" "ANGDIR" "value" pause (princ)))4 k9 \' e: p- ~* D7 y
(defun c:30 () (ssget) (command "rotate" "p" "" pause "30"))
% [7 c7 V$ b2 L2 _3 o: I- c(defun c:-30 () (ssget) (command "rotate" "p" "" pause "-30"))
4 g6 e/ Y- f. ~# m7 k5 x) W& R(defun c:45 () (ssget) (command "rotate" "p" "" pause "45"))3 V1 P! U" A% g5 J0 Y7 ?0 }2 }; Q. c
(defun c:r5 () (ssget) (command "rotate" "p" "" pause "5"))
3 W- E$ C! ?" H1 I/ e$ f7 U(defun c:60 () (ssget) (command "rotate" "p" "" pause "60"))
! O. @. s& Y2 K# G5 @(defun c:-60 () (ssget) (command "rotate" "p" "" pause "-60"))
( N5 V4 G9 m" }. p) O# Q9 ~5 n(defun c:90 () (ssget) (command "rotate" "p" "" pause "90"))# z0 B1 e" {& X. n" ^9 `) a
(defun c:180 () (ssget) (command "rotate" "p" "" pause "180"))" ^0 w* {4 [8 [% Q1 o+ \
(defun c:-45 () (ssget) (command "rotate" "p" "" pause "-45"))9 ]3 r* y8 P# ]% ~
(defun c:-90 () (ssget) (command "rotate" "p" "" pause "-90")). @1 @. Q' S, ^" _3 g) k5 r
(defun c:md () (ssget) (command "mirror" "p" "" pause pause "y"))0 b3 {- |) C5 M0 p. ^9 Y
(defun c:fd () (command "find" "p" "" )(princ))(princ)
2 D% _% g' a1 _) v$ i
- p: u! a, N4 M* s9 i. b2 r2 ](defun c:VNI () (command "-style" "VNi-AUCHON" "VNI-vauchon" "225""1""0""n""n""n"))(princ)
+ U2 ?$ q/ r+ `9 _: P- }1 F$ V) T# a6 q2 r
(defun c:romantdim () (command "-style" "ROMANT-DIM" "romant,vnh.shx" "200""1""0""n""n""n"))(princ)* v# H5 V% U' B
(defun c:romantext () (command "-style" "ROMANT-TEXT" "romant,vnh.shx" "200""1""0""n""n""n"))(princ)
$ S( _$ D0 e0 G( y# A& S7 U(defun c:vnhelvthuong () (command "-style" "VNHELVLT-Thuong" "vnhelv,vnh.shx" "500""1""0""n""n""n"))(princ)+ W, L0 O9 w$ N6 y& O
(defun c:vnhelvhoa () (command "-style" "VNHELVLT-Hoa" "vnhelvh,vnh.shx" "500""1""0""n""n""n"))(princ)/ E8 ?4 P! J& {% {
(defun c:truc () (command "-style" "TRUC" "impact" "0""1""0""n""n""n"))
" l- x5 K( U1 ^" U; ?' y(defun c:chu () (command "-style" "CAMBRIA" "Cambria" "200""1""0""n""n"))6 Q3 x; m7 ]; m8 p; [' E
(defun c:cot () (command "-style" "COTES" "Romand" """1""0""n""n"))" h! ]! g2 ^! _, b F
" Q* W' q$ m' I" v: I, h" R% T(defun c:an () (command "-style" ".AVANT" ".vnavant" "200""1""0""n""n"))3 _4 X) p7 e2 B2 c- x O2 L
(defun c:ah () (command "-style" ".AVANTH" ".vnavanth" "200""1""0""n""n"))7 `4 E6 u3 k3 ^' h
(defun c:ha () (command "-style" ".ARIALH" ".vnarialh" "200""1""0""n""n"))3 M8 t8 T- S3 \: {/ l" D
(defun c:na () (command "-style" ".ARIALNARROWH" ".vnarial narrowh""1200""1""0""n""n"))3 L+ f) Y$ e- O
(defun c:vn () (command "-style" ".VNTIME" ".vntime" "200""1""0""n""n"))3 c5 _, k9 o, f' O" y% I1 u
(defun c:vh () (command "-style" ".VNTIMEH" ".vntimeh" "200""1""0""n""n")), y6 C) h! p' n( W( q2 @4 D
! V5 p' D7 b. p6 R% P7 K% x1 p5 M8 y
(defun c:ps () (command " SOUT" "CorelDraw-import-Photoshop" "W"))(princ);export the current view of a drawing as an EPS file2 ]* Q' O* u7 }" P
+ C( X, y2 R( U5 d;free lisp by cadviet,cd2k44
4 r" L5 j* J% Q2 w" i; w' D;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830 H5 i; @" F+ J$ H! W$ ^
(defun c:FTEXT (/ ent tstyle )# o$ e$ a# J5 P# g0 J: P: Y( o2 m
(command "undo" "be")
4 U) C, h, U9 V- n/ [' _* U$ h(setq ent (entsel "\n Pick text :"))
# P9 A$ V* b! y! P) W' e, i- B(setq TSTYLE (cdr (assoc 7 (entget (car ent)))))9 n4 d( w1 A" |4 j: k; Y& k
(command "STYLE" TSTYLE "romant.shx,vnh.shx" "0" "1" "0" "N" "N" "n")8 n: G) r2 k; t7 t. f8 l' t
(setvar "TEXTSTYLE" Tstyle)
! }7 S8 h$ z; z7 K& {(command "undo" "end")7 o+ N2 l$ [3 i d8 I
)
f7 o1 ]$ V U7 r- @1 _" ]3 B;Cam on cadviet nhieu 27-11-2023 04h15p36s (thanks cadviet)
, j7 @. C& u8 x1 n8 X8 C, u* Q
" G' S4 I8 \+ E8 |8 S9 z5 a& ^7 U;free lisp by cadviet,cd2k44
% e& L3 o T$ _/ G;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830
, n7 e1 S) B( g# j) w(defun c:Fvnh (/ ent tstyle )
9 ~4 P# D1 V; v7 U0 i$ E(command "undo" "be")
- u* {8 F P, Q2 o/ v(setq ent (entsel "\n Pick text :"))
g: Y6 q, m& T# m% j(setq TSTYLE (cdr (assoc 7 (entget (car ent)))))
% a, ? c- b0 s0 @& e(command "STYLE" TSTYLE "vnhelvh.shx,vnh.shx" "0" "1" "0" "N" "N" "n")
8 ^' X. @5 |; p(setvar "TEXTSTYLE" Tstyle)6 B8 W. d* Y" o
(command "undo" "end")
6 \+ J3 Q+ S" P# B' o)3 C9 G9 v$ }5 J' B8 X* U( O
5 Y# k1 C4 L# D8 }! b
;free lisp by cadviet,cd2k44! W- v: [" p% }8 D$ H; S
;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830% Q, W* T! Y6 S6 Y: P- x+ |" s
(defun c:Chbg (/ ent tstyle )) w5 {9 b" i2 F! w
(command "undo" "be")
& ]+ g$ t0 N1 Q/ c3 g `(setq ent (entsel "\n Pick text :"))
3 Y9 P" J) h7 i, Z& f+ X(setq TSTYLE (cdr (assoc 7 (entget (car ent)))))
( }/ k2 ]) a* J! z5 {0 _* r(command "STYLE" TSTYLE "chhbg.shx,vnh.shx" "0" "1" "0" "N" "N" "n"); u( y2 }5 U! g9 L/ t4 S
(setvar "TEXTSTYLE" Tstyle)4 C: K! Q, V% {9 }
(command "undo" "end")
8 V1 m$ M" b: l& `2 A' r/ f0 U)5 ^9 f+ p( j, ~8 v2 F
5 d* Q/ _+ ^' ^) u& o;free lisp by cadviet,cd2k44
0 ^; D7 M. c+ y1 K6 F4 \- e;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830
3 S( s' {. L6 A4 N) c. l(defun c:Chsm (/ ent tstyle )
' P4 M4 y, X% E! _, @3 s(command "undo" "be")
3 {; R. @" v4 t9 y# W(setq ent (entsel "\n Pick text :"))
5 ]; g, c* A* f& p(setq TSTYLE (cdr (assoc 7 (entget (car ent)))))7 n. u0 v* y3 {7 l* Y
(command "STYLE" TSTYLE "chhsml.shx,vnh.shx" "0" "1" "0" "N" "N" "n")# O, K8 @- r: |6 y
(setvar "TEXTSTYLE" Tstyle)
& n0 p( x* W* q+ J- j(command "undo" "end")
$ F9 z9 O* F* r6 y) v)9 e0 U% L! d) e; W7 B
g, W8 l* o3 o! P8 ^/ r
;free lisp by cadviet,cd2k447 e$ \; P1 ], U- B( N! \
;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830
' }& U( j" K) H; O% c) O8 @(defun c:Fttf (/ ent tstyle )3 A, Y4 U+ W4 R5 x) G8 X3 Z
(command "undo" "be")* A5 B! @, u' g0 C3 M; O' {
(setq ent (entsel "\n Pick text :"))
2 d8 W3 z; J2 l v" m* b(setq TSTYLE (cdr (assoc 7 (entget (car ent)))))6 C7 P+ S5 [7 F+ r; l
(command "STYLE" TSTYLE "Cambria.ttf" "0" "1" "0" "N" "N" "n"). e' J% s2 K8 i6 H! ~3 J9 P8 w: {
(setvar "TEXTSTYLE" Tstyle)# D) @0 X, j- X4 @! w q+ E8 w- p
(command "undo" "end")
- Z+ V7 K6 E8 n8 m7 ?( E. n& n)
( Y& X! t9 F3 `$ H) x) L- S* s. U6 e5 U0 V5 N
;;; ============================================
0 [+ z9 N$ e% B6 u9 g9 u" ?2 p;;;
5 a3 s1 \, j+ \0 r! l. ?1 S7 `;;; LISP Creater Tao Duong Dan AUTOCAD2000
! J. f4 x: E- f( Y;;;, r; o4 e/ Q# {* y: X* M2 ]$ G1 U
;;; ============================================
- U3 p% B4 u# n- n$ S: y) h1 m$ o
;;; ============================================) _0 U/ g+ K3 N" u& s
;;;
9 w' G) k5 ?; B# K& t& _;;; CREATING FROM AUTOCAD2000
8 H4 n% C }, Y/ {- J) d# n;;; Tran Ngoc Thang - Sinh 03-05-1976; I7 e2 `; @. j! a. ^
;;; ============================================& m3 ^2 k% K* o2 I9 K+ o
8 g7 Z9 @& I: Q: A5 Z
(setvar "MEASUREMENT"1);Bien So SCALE Cua BHATCH! _4 _* V; n3 ~- X9 u9 t' y% o
;(setvar "DYNMODE"2);Bien So An Hien COMMAND LINE/ n) Q& V, `% M v( [/ C# Z% F
;(setvar "VTENABLE"0);VTOPTIONS Enable Animation for Pan and Zoom3 w v9 t' D# O8 g! C0 ^
(setvar "INSUNITS"4)
8 o' {$ [/ L6 |# i' L(setvar "ANGBASE"0), M) R8 _ M1 Y8 K! S4 i
(setvar "ANGDIR"0)
8 V& M" |9 U+ t+ P(setvar "AUNITS"0)
9 ]- s. N! A$ p9 t( c, u+ P6 l3 E- e(setvar "AUPREC"8)
9 }6 d! f* }5 H7 H% L' j(setvar "LUNITS"2)4 k2 j/ l( T7 q1 H& X: I
(setvar "LUPREC"8)
2 c& i9 ^' z# o2 M; [2 b(setvar "ACADLSPASDOC"1)
' a, P' i7 [* j4 |% e% B(setvar "pickbox"5)
8 ?* d) U& s" j/ I4 o$ u" P Z$ ~- C(setvar "blipmode"0)
$ c1 o* N( E3 w5 e4 P4 R4 i' Z(setvar "mirrtext"0)
& B5 J9 `4 N1 Y( s( }5 Q% s0 ~(setvar "cursorsize"100)* o+ [" ^( A4 i% ?
(setvar "ZOOMFACTOR"75)9 j' Q7 d% f- J7 Y
(setvar "LTSCALE" 10)
+ G3 P0 C! w. P; F) l& X& B9 B; P(setvar "lwunits"1)8 }6 P5 z4 i/ y/ Y6 U
(setvar "DIMBLK" "Closed")* h0 g: d- a& m+ G
(setvar "DIMGAP"0.0693)
0 d' {7 I/ \. K) \8 P# N) k(setvar "DIMASZ"0.20)2 M: l1 i0 n1 S+ z$ S+ l9 p5 R/ W
(setvar "DIMCEN"0.2)# N' z) d+ R) y& R
(setvar "DIMDLI"0.1)4 U$ t' f# t* U; k6 s6 Q1 Z6 j
(setvar "DIMEXE"0.0693)
8 y5 _1 k- f Y9 ^. j P! F(setvar "DIMEXO"0.25)
: u# K' Z# m% K7 E- k(setvar "DIMDEC"0)
+ x- O8 u! W$ |) L- ~! N# ](setvar "DIMTIX" 1). `) P# h ~- s1 k' M) F8 x
(setvar "DIMTXT" 0.099)1 X% _/ u( W3 Z$ S
(setvar "DIMCLRT" 7), z, p! w( R4 d3 ]' P/ b b R! c( r, [
(setvar "DIMTVP" 1)
* e* _. g, l8 Z5 ?# [(setvar "DIMJUST" 0), W8 G7 N3 x; C
(setvar "DIMTIH" 0)
5 A; s6 l" X) D1 y( v6 ^(setvar "DIMTOFL" 1)7 ]7 ^2 t9 t6 o8 g8 C
(setvar "DIMSCALE" 1111.1111): N% `; c8 z3 s& m; d" m6 C0 _
0 V/ f' u" ~+ p, G: y* f) }. s4 c5 i6 N9 m4 t, F: E
% g2 h' u9 e( B3 Z% C8 x: M
(defun c:zp () (command "'.zoom" "p"))+ H0 F- a1 R. @' [% Q9 s
(defun c:zz () (command "'.zoom" "p"))6 N+ s, D1 u- O; j( W
(defun c:ze () (command "'.zoom" "e"))+ Q" F7 E- Y* w* v. n
(defun c:za () (command "'.zoom" "a"))2 u/ [& E7 C! w5 j
(defun c:zd () (command "'.zoom" "d"))
5 c$ a' t+ x, v(DEFUN C:ZZZ () (COMMAND "ZOOM" ".25X"))
; g c+ E) C5 P+ x) q9 @(DEFUN C:ZX () (COMMAND "ZOOM" "2X"))
: e1 d; Q1 |* H' E5 i4 H(defun c:de () (command "ddedit")(princ))/ p$ O3 x X1 M; N, I
(defun c:dda () (command "Dimaligned")) S9 K0 _6 I3 B+ S P& R, q2 q/ k
(defun c:ddb () (command "Dimabaseline"))( `7 F: `4 a+ \
(defun c:ddc () (command "Dimcontinue"))% O7 @' d' d- B- K Y1 W; C
(defun c:dde () (command "Dimtedit"))
' `; m, N0 o: n# q0 ^# ]3 D(defun c:ddf () (command "Ddattdef")), Z& s4 ?) g g( E4 C8 g5 Q* w
(defun c:ddi () (command "Dimdiameter"))
f4 S$ Q1 c% b5 J6 U$ T(defun c:ddl () (command "Dimlinear"))1 v( ]8 v/ R+ L
(defun c:ddn () (command "Dimangular"))& U. `8 J/ `/ K! c! Z1 T
(defun c:ddo () (command "Dimordinate"))* @# G$ X7 x4 H
(defun c:ddr () (command "Dimradius"))( n/ @7 C+ W1 D" f
(defun c:dds () (command "Dimstyle"))
/ \2 M$ z$ C/ }! {
' r6 X% \2 r: @( y# j5 s: L(defun c U () (command "dim1" "up" "select" "exit" pause ))(princ)" v2 Z. G; v/ }* d) l b
(defun c H () (command "Dim1" "home" "select" "exit" pause))(princ)- C/ o9 m7 a/ f3 J
(defun c:UU () (command "dim1""update""all"))2 g1 N3 `5 ]6 Y6 J) n7 d" e
(defun c:ded() (command "dim1""tedit")); P" B% B0 ]& p- x$ n0 V: E* s
(defun c:da () (command "dim1""ali"))
# O8 N* ^% ]4 @! e2 l(defun c:dll() (command "dim1""l"))* f- t" H( w. H0 a- \( x
(defun c:dan() (command "dim1""an"))
) H6 b6 x" ` G& L( ?& ^+ o) z; j(defun c:d1 () (command "dim1""ra"))5 C# ]8 }5 l2 E0 t5 L- l, b# b: v/ D
(defun c:n () (command "dim1""new"))
# M6 Q0 J9 S% M2 D j. f% W; r, p6 k1 \) V7 a* p% I
(DEFUN C E () (COMMAND " EDIT"))
6 S4 x" N4 a% f/ r" F) e3 I J5 ~(DEFUN C L () (COMMAND " LINE"))
4 s" Y: ]' \( y# \# i* }$ [ b(defun c:dd () (command "dist")(princ)); m! t- n; A3 Z2 _& B8 i
(defun c:w () (command "pedit" pause "w" "au")(princ))
( I( d' z% a. C4 o* ~(defun c:pg () (command "polygon" "polygon")). q0 H; ^( k6 k3 \& ?, F0 Q
(defun c:el () (command "ellipse"))5 {2 F S( O: u2 u6 H
(defun c:xe () (command "explode"))
S- t% N8 F% Z9 L# k& {; ?) A(defun c:eex () (command "extrude"))
3 y1 p& y% }* b! e+ l(defun c:xg () (command "xline""a"))
- w& `, g$ H2 z n _(defun c:xh () (command "xline""h"))% j+ a/ k3 j* B* {; u. T) ~8 q
(defun c:xv () (command "xline""v"))" R8 F a! w6 k% N- k' I2 L
2 J: A$ N. s" W, n2 n(defun c c () (command "osnap""cen"))0 P; w N* n R' ^- Q
(defun c d () (command "osnap""nod"))
" a' O6 O4 r8 h0 h4 V(defun c e () (command "osnap""end"))9 r% P) F8 W2 q4 F; ?' {- u
(defun c i () (command "osnap""int"))
8 b* i& l$ [ s& F( C(defun c r () (command "osnap""per"))5 p! I. x* N- y3 X8 p: n
(defun c n () (command "osnap""none"))/ v/ R' m5 b9 S
(defun c q () (command "osnap""qua"))
/ F# g. w$ ?7 I9 [2 o( x1 B(defun c m () (command "osnap""mid"))% m- ?+ X& F3 I( N) \# F; k; t
(defun c t () (command "osnap""tan"))7 `) I$ w1 t0 K* B' X
(defun c in () (command "osnap""ins"))
. T- |# Y Y4 K& E(defun c:oa () (command "osnap""nea"))
! m1 L; w+ U9 P/ s2 T/ y( R(defun c:ol () (command "osnap" "End,Mid,Cen,Node,Nea,Int,Perp,Qua")(princ))
. { R& N, j5 A4 |, @, h4 m;(defun c:du () (command "dim1" "up" "s" "pick" "other")); K' i1 a4 q$ I
;(defun c:nn () (command "new" "y" ))) `4 S" t( s4 O0 U, G+ b- F
2 b8 ?. J5 r! m; u- o
(defun c:/ () (command "limits"))5 e2 H# ]" E' K# C
(defun c:`1 () (command "region"))% G. e7 O {3 M; R% [/ G
(defun c:`2 () (command "subtract"))
, l5 _$ L# W! \! L7 H1 t(defun c:`3 () (command "union"))
! N0 y' T" }- _. g(defun c:`4 () (command "intersect")); J2 g1 g, x6 j0 x) g; f! T* O
(defun c:`c () (command "cal"))
: N/ M7 ] D9 u. g* v4 B(defun c:`g () (command " olygon"))4 y8 A6 |3 h/ e4 }
5 w6 C- h2 T1 |$ u. G, |3 X(defun c:lmi() (command "LIMMAX" pause "" "zoom" "all" )(princ))
9 W- e* d% @& x9 ~. x+ T(defun c:drt () (command "DRAWORDERCTL" pause "Integer" "" "" )(princ))
1 s, v8 l2 R8 l! X; q(defun c:ip () (ssget) (command "print,_plot" ))(princ)
4 W* w. L& ]0 B# U9 t! W& v7 X- L y% N: G+ |0 O: ?: k! ?* B8 i) D
(defun c:ddm () (command "ddlmodes" pause))1 E/ ]( J4 _: X0 y
. H1 ^8 c% E) y u
(defun c:sha () (command "shade" pause))
; O7 h( b& ?. s# h9 @3 m3 K( ^2 h' q% |! _4 v
(defun c:sr1 () (command "surftab1" "p" "" pause))
B* c1 e% t! w* U1 i(defun c:sr2 () (command "surftab2" "p" "" pause)). S( o; W( f9 z u
, w% Q: [+ b# _; A4 I/ N
(defun c:ad () (command "audit""y"))
& ^2 v2 r' {& U* C' j& p# p(defun c:q () (command "quit"))
5 I7 R: J% a1 Z% D7 o$ M$ u7 ~8 ~0 b& {/ u- b: q
(defun c:30 () (ssget) (command "rotate" "p" "" pause "30"))1 X: v; L8 s9 H" a9 o
(defun c:-30 () (ssget) (command "rotate" "p" "" pause "-30"))! d" f: B! G( J" u7 z
(defun c:45 () (ssget) (command "rotate" "p" "" pause "45")), r4 y# q2 m* ?8 |! E) ]
(defun c:-45 () (ssget) (command "rotate" "p" "" pause "-45"))
& ^- L. L$ o& R( i2 }(defun c:60 () (ssget) (command "rotate" "p" "" pause "60"))
3 o' A9 c7 [. u1 u(defun c:-60 () (ssget) (command "rotate" "p" "" pause "-60"))/ s5 K* l r7 A- `
(defun c:90 () (ssget) (command "rotate" "p" "" pause "90"))
* _( h! X6 J7 K% S) t" S& K0 {(defun c:-90 () (ssget) (command "rotate" "p" "" pause "-90"))$ ]2 g; Q' [# T0 Q
(defun c:180 () (ssget) (command "rotate" "p" "" pause "180"))
! E0 ]6 @, G" U2 d6 X; s; e/ h, V
. `) I8 u7 A( }9 p(defun c:u3 () (command "ucs""3"))
) j; p- M9 w8 r, p/ ?0 `1 b% W(defun c:ue () (command "ucs""o""end")): D' W. j. @, i Y( \0 o# _
(defun c:ui () (command "ucs""o""int")), F% y' ]* `3 A! i) h- A% Y0 p
(defun c:um () (command "ucs""o""mid"))
, D$ w2 N% Q- x3 @3 j3 ?1 [# d" }) a(defun c:uc () (command "ucs""o""cen"))
2 i( Q8 ~' z7 Y2 r(defun c:uq () (command "ucs""o""qua"))
8 ^( ~7 a* Z5 Q0 z& b7 @& ](defun c:3s () (command "ucs""3"))
. K5 r: _- F+ z8 j) U J(defun c:sx () (command "ucs""s"))
$ N: a }" m& Y9 ^6 m' p* F(defun c:sf () (command "ucs""o")): F: { _; b5 Y, z
(defun c:sz () (command "ucs""p"))
. V$ v* G- B1 Q) l! w(defun c:sr () (command "ucs""r"))4 M, s7 ~+ d$ U" b! A
(defun c:sw () (command "ucs""w"))1 a5 [6 u1 l9 G9 F9 T$ `) y
(defun c:fv () (command "ucs""v"))
2 n6 z: q: j, H' _; N" j(defun c:ux () (command "ucs""x"))! }, m* C& i# L( V2 x
(defun c:uux () (command "ucs""x""90"))7 u3 I3 j9 v0 M3 n, u, w; k6 V3 A
(defun c:xxu () (command "ucs""x""-90"))/ f' ?; k/ s# n7 x! J' V) W7 I
(defun c:uy () (command "ucs""y"))% A) x) B4 b. u# v
(defun c:uuy () (command "ucs""y""90"))4 l! @7 R. z4 A& F K
(defun c:yyu () (command "ucs""y""-90"))* k' k; U0 i9 h' C0 z( o7 O
(defun c:uz () (command "ucs""z")) p5 j) \: ?' u' H3 f- v! T
(defun c:uuz () (command "ucs""z""90")), L) a/ C9 n K1 o
(defun c:zzu () (command "ucs""z""-90"))6 o* m5 v3 H1 s
(defun c:uci () (command "ucsicon" " roperties" ))(princ)2 B" }& u7 J0 ?# y
(defun c:ucm () (command "ucsman" ))(princ)( C" D \- P/ J# {" k
4 ^ H" U/ \5 `- f& f3 p$ w' ](defun c:sa () (command "vpoint""_non""-1,-1,1"))
" k5 J1 K8 u, T, R(defun c:sd () (command "vpoint""_non""1,-1,1"))
* l l% M3 V, O4 M; ~- i. f R, L# O9 k(defun c:se () (command "vpoint""_non""1,1,1")) u1 ]9 D$ H" m' `& h& h
(defun c:sq () (command "vpoint""_non""-1,1,1")); _% _" M) @! B* I
(defun c:vc () (command "plan"""))
4 g! }7 P+ }% n8 ]0 \2 v u% F(defun c:vd () (command "dview""all")): |! a# e1 w* }/ Q
# Y- J. k# S5 W& @: {: @5 i
(defun c:TT0 () (command "tilemode""0")): `; j6 p/ `6 ?6 F; ^
(defun c:TT1 () (command "tilemode""1"))0 n+ S' x& Z, {" V1 s
$ w. j" W0 ~% [& a/ u% o" i(defun c:vt () (command "vpoint""_non""0,0,1"))' S/ V" M. _4 S# d( r7 d
(defun c:vb () (command "vpoint""_non""0,0,-1"))
$ o* V5 L3 E( ^& S/ U3 l X! {(defun c:vl () (command "vpoint""_non""-1,0,0"))
# [' |5 D( ]6 r! f0 n! R(defun c:vr () (command "vpoint""_non""1,0,0"))1 o6 Z. j7 f$ f* h. a& l8 P9 v/ f
(defun c:vf () (command "vpoint""_non""0,-1,0"))
8 R. e1 O5 R+ D" s+ U8 d(defun c:vk () (command "vpoint""_non""0,1,0"))% D: N5 V9 {9 f
k, C, c `0 F: t. ~, ]
(DEFUN C:MM () (COMMAND "MIRROR"))3 i1 |# A4 I2 Q' j3 b! E2 ^" r7 c+ L
(DEFUN C:MP () (COMMAND "MOVE" " "))" |8 X* W- H" m4 V2 c3 {% @
2 l' x/ \& [( p" L) g5 X4 S/ u9 M5 ?(defun c:mee (/ a)
# o6 c* s# r5 l! ]$ f (setq a (ssget))(command "move"a"""end"pause"end"))6 A- F+ @. \4 {8 j" ?
(defun c:mc (/ a)) F$ t; d/ v7 B9 J2 a# k+ O% b
(setq a (ssget))(command "move"a"""cen"pause"cen"))
5 k) g9 [1 T8 \2 E* y# U) k(defun c:cc (/ a)% {2 |% [/ f- x! | f3 g; Y
(setq a (ssget))(command "copy"a"""m"))
; q8 b2 G1 K6 [0 S1 H% i: O/ Z3 I(defun c:ce (/ a)4 T' c; x& ?, U0 x8 ~
(setq a (ssget))(command "copy"a"""m""end"pause"end"))
% m- x, V! q" N+ C(defun c:cn (/ a)
2 {1 }# ^' a/ X, x( H (setq a (ssget))(command "copy"a"""m""cen"pause"cen"))
. W y6 _9 k# K* q* L6 n0 I(defun c:tl ()(command "trim""l"""))
$ f. }: h8 N" }6 U: X+ J4 ~ k& U(defun c:tf (/ a)
6 r5 D, ^# ]% \ R5 i (setq a (ssget))(command "trim"a"""f"))0 [! W2 K, d ?! X7 c
(defun c:el ()(command "extend""l"""))
5 c* z: c+ |# j5 ?(defun c:ef (/ a)3 L& ]( O3 x b+ `' X1 N$ }0 [
(setq a (ssget))(command "extend"a"""f"))8 v: [3 d1 B. {
, o9 e; L+ G7 [0 }
+ M7 s, L9 g) r! F9 N: g(DEFUN C:110 ()(princ "\nChon doi tuong can offset ra 110.......") (COMMAND "offset" "110"))+ r+ `' l; @) g% q
(DEFUN C:220 ()(princ "\nChon doi tuong can offset ra 220.......")(COMMAND "offset" "220")). z+ j: ~8 z% y* ?
(DEFUN C:330 ()(princ "\nChon doi tuong can offset ra 330.......")(COMMAND "offset" "330")). `0 N( @8 j( r
(DEFUN C:400 ()(princ "\nChon doi tuong can offset ra 400.......")(COMMAND "offset" "400"))/ R" T" b8 o, _+ B9 i- F
(DEFUN C:55 ()(princ "\nChon doi tuong can offset ra 55.......") (COMMAND "offset" "55"))
7 Y+ \6 n! z3 @9 x(DEFUN C:600 ()(princ "\nChon doi tuong can offset ra 600.......") (COMMAND "offset" "600")): l* ]% _/ \" Q. f5 y5 p! O
(DEFUN C:700 ()(princ "\nChon doi tuong can offset ra 700.......") (COMMAND "offset" "700"))4 d& M6 B6 l$ Y( V, ?) z' i6 a
(DEFUN C:800 ()(princ "\nChon doi tuong can offset ra 800.......") (COMMAND "offset" "800"))
" D. B6 |+ h; f% b# }" d(DEFUN C:900 ()(princ "\nChon doi tuong can offset ra 900.......") (COMMAND "offset" "900"))/ Q# p6 M! s, w, T& T) i: ^( f5 |
(DEFUN C:1200 ()(princ "\nChon doi tuong can offset ra 1200.......") (COMMAND "offset" "1200"))9 F T/ n! K9 ?! h) n3 E! A) p% w
(DEFUN C:1500 ()(princ "\nChon doi tuong can offset ra 1500.......") (COMMAND "offset" "1500"))+ M8 j! B0 U+ Z |: _* m! [5 H& j
(DEFUN C:1800 ()(princ "\nChon doi tuong can offset ra 1800.......") (COMMAND "offset" "1800"))
6 k, U5 b$ U7 C(DEFUN C:2400 ()(princ "\nChon doi tuong can offset ra 2400.......") (COMMAND "offset" "2400"))
- ]/ m+ w$ ~8 r6 K(DEFUN C:3000 ()(princ "\nChon doi tuong can offset ra 3000.......") (COMMAND "offset" "3000"))$ p+ G! a* A9 |9 s- J* O1 t* ?$ X
(DEFUN C:3600 ()(princ "\nChon doi tuong can offset ra 3600.......") (COMMAND "offset" "3600"))9 }; \# J9 P/ }3 B+ t' ]% q
(DEFUN C:4200 ()(princ "\nChon doi tuong can offset ra 4200.......") (COMMAND "offset" "4200"))( ?7 }( W' X% ^/ T# o1 T0 _' Z
(DEFUN C:5000 ()(princ "\nChon doi tuong can offset ra 5000.......") (COMMAND "offset" "5000")): a& k6 [* l4 c7 T
* l6 x" n5 _( i ]5 }$ X* [(defun c:mla () (command "-mledit""av"))6 e7 ~1 T9 v+ D2 p* D
(defun c:mlc () (command "-mledit""mc"))
% E- ]9 V- n. N. q' q6 Q(defun c:mld () (command "-mledit""dv")). ?: o- ]5 B! e: w! P0 t
(defun c:mle () (command "mline""end"pause"end"))
* }. c3 b! k4 k6 Q7 X- K- ]% u. d(defun c:mli () (command "-mledit""ca""int"pause"int"))
4 b) s6 f$ ^4 ~' H2 _(defun c:mlj () (command "-mledit""cj"))2 H, z' G9 a/ \4 H i' R" s
(defun c:mlt () (command "-mledit""mt")). ^' b7 _6 h z# w$ D6 X
(defun c:mlk () (command "-mledit""ca""end"pause"end"))3 b/ r% K& N4 F4 k- l
(defun c:mlw () (command "-mledit""wa")): @/ b8 A# P* A3 h2 p: I. ]
$ y, p; I5 s! v9 f0 B
(DEFUN C CA () (COMMAND "DVIEW" "all" "" "CA"))
3 [8 f( f& o, v(DEFUN C PA () (COMMAND "DVIEW" "all" "" " A"))
- C, @% J* N$ ^3 T& \(DEFUN C PO () (COMMAND "DVIEW" "all" "" " O"))$ ~" h& e* y* S
(DEFUN C DD () (COMMAND "DVIEW" "all" "" "D"))
: J' H8 T7 u% H! [( h6 g(DEFUN C Z () (COMMAND "DVIEW" "all" "" "Z"))% r a4 G6 J4 D. l- O3 E4 P
9 w( w' ]3 K0 s. A; M7 D- O
(defun c:p0 () (command "pline""""w""0""0"))' R6 Y% [, R# M7 S" a3 g
(defun c:ot () (command "offset""t"))
$ X) N! Y' A4 x: S; K2 p. a(defun c:t () (command "mtext"pause"j""bl""h"pause))
0 K1 T2 C% e- K(defun c:uo () (command "ucs""ob"pause))
6 H/ e4 k# J; x" T(defun c:f0 () (command "fillet""r""0"))" V& l9 z* E& d; ^& C8 y
(defun c:fr () (command "fillet""r"))
1 |8 o( P4 a9 y# G4 c$ ^9 m6 R/ G! t$ {$ v6 r2 N1 s
;CHAMFER
4 c6 f* N- S( O# j(defun c:cf () (command "chamfer"))) M2 w( l* v, K/ V' b {9 P
(defun c:cfd () (command "chamfer" "d"))! I6 H1 v& ~0 S6 K
(defun c:cf0 () (command "chamfer" "d" "0" ""))
' N$ [/ m9 ?3 z6 w3 f ^. W# R" w" ^6 m, w' ^
;FILLET6 y7 s# w* T$ j+ p% r0 I; P3 ^& i
(defun c:f () (command "fillet"))* z4 R1 O8 f6 z, \7 X/ H+ \1 {
(defun c:fr () (command "fillet" "r"))
+ ? V1 d$ T0 }& G" o: ?(defun c:f0 () (command "fillet" "r" "0"))
& ?( M1 k8 X9 y: e$ P A/ }: Y) D' i; R# F& Z4 g. s1 F
(defun c:OO () (command "oops"))" ^+ b: G3 Q: q3 h
(defun c:dln () (command "dimlinear")); M( ]+ o/ t$ ?* I% F, p; }
(defun c:dan () (command "dimaligned"))
* q3 k; e/ ^" P j7 U+ X(defun c:ddc () (command "dimcontinue"))
5 ]# `5 a- [4 E7 b1 K: B' K
u( Z0 C0 S# v1 l: [( B(defun c:sc () (command "scale" "auto"))8 p& n3 t1 m/ W% U' ?2 I9 V
(DEFUN C:XO () (COMMAND "snapang"))
( B0 b! z8 |0 ] {* ]: y9 F(defun c:cc (/ a)/ T' v: a9 U3 B
(setq a (ssget))(command "copy"a"""m"))' `! r. C2 _" j- u3 R- W
0 g0 l' q" e! i(defun c J (/ a)
0 H2 o8 |9 x; j+ G9 v1 z& k (setq a (ssget))(command "pedit"a"""j""all""y"))
i1 h! }% ^; n- v(defun c:JJ (/ a)4 s. E+ t: r8 Z5 C) L
(setq a (ssget))(command "pedit"a"""j""y")) R6 w* `+ o7 G7 d: w2 s- z
(defun c:TN (/ a). k$ C8 s8 ~6 m
(setq a (ssget))(command "change"a"""p""T"))8 u( N0 ^+ q( b/ ^+ \
% B. S; v1 I2 ]# ~+ ~8 a4 |, v8 i3 J# b+ I
;================== Tran Ngoc Thang - Sinh 03-05-1976 - Suu Tam - Tu nam 2000 - Hoc nam cuoi KTS . DHXD ====================
3 \7 C# }: M6 U8 y% f' X
2 p3 Z* Z! ]0 G8 ]2 @9 Y% b+ g4 H4 B) n" h(defun C:IB ()(setvar"cmdecho"1)
: i4 [$ o! X4 [; M (setq pt(cadr(entsel"\nSelect Block:")))( E1 S, d& h8 A
(setq e1(ssget pt)) ! [) a% I# X% ~, N5 I& c1 E
(setq e2 (entget (ssname e1 0)))
3 T1 t8 M3 G) K+ l (setq blname (cdr(assoc 2 e2)))% a' U( C8 z* L" J$ n
(setq oer *error* *error* err2)(command ".insert" blname))7 }7 J) e, A& H" q5 a$ e3 o
3 U4 N2 j+ H) s4 v2 ]# ^
(defun c:II ()
0 }7 U# t1 e5 m) s+ l% q2 U, O9 s (setvar "cmdecho" 0)8 Q- [; m9 |; ]: R" a& m: k6 @
(setq olderr *error* *error* myerror)0 k! v, w3 x9 C8 u1 Q1 c+ k6 r
(prompt "\nSelect objects: ")& ? a6 d: F8 k' o
(command "select" "au" pause)
3 y' K* I2 ]2 j* C (setq sstxt (ssget "p")' J9 v- z) ?1 M, t! h
sslen (sslength sstxt)
1 P* g& G' S G5 c4 Y5 W ctr 0& O; W& `+ {2 Z: H1 ` i3 V* d
); q) W; g- I; a3 q7 S- L
(command ".undo" "mark")5 o( m9 @$ A/ f( ]- B: v1 B
(while (< ctr sslen)/ r% ~! a1 Y D/ `
(setq listxt (entget (ssname sstxt ctr))
" L# A$ Y' v" X7 \! ? txttxt (cdr (assoc 1 listxt))3 h; F) l+ S# {$ W
enttxt (cdr (assoc 0 listxt))
A8 l7 h, N0 J; H) c, x* d )$ z/ }7 _( x, S) l7 G: j
(if (= enttxt "TEXT")
6 e3 X' {5 N) v (progn
6 D/ b1 q# d* n# C- f. c9 d( p (setq testxt (substr txttxt 1 3))
$ U/ X/ o8 U. R# n (if (or (= testxt "%%C") (= testxt "%%C"))+ n9 F7 K' T+ x( I) Y$ w/ Y
(setq newtxt (substr txttxt 4))
: J! [" t+ U! l) l! o7 v5 I1 v (setq newtxt (strcat "%%C" txttxt))5 j; K4 D7 q9 G9 m9 p
)* C" P7 s" U8 H1 O0 y
(setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))
( p- [ V9 Q$ u& |* {% E# Q( J (entmod listxt) r! u2 I3 z- ]& z1 B ?/ M
)8 ?) n7 ]7 o' @" a
)' S2 J2 k" ^6 K/ D! E! S
(setq ctr (1+ ctr))
* ?8 e" Y+ T6 L5 _# ` )
/ L. Q+ V7 D& ^; x) F5 e (setq *error* olderr)
$ z; R1 D/ M- C# C5 L4 W (setvar "cmdecho" 1)6 e/ h3 H, Z( b# W8 [0 A
(princ)9 g3 u$ P! R5 Y) ~" t2 z t
)) q0 E4 {3 a/ ^) u3 ^- l
( l* y& y) Q+ V" T+ l) B! `3 }
(defun c G () L: f* K4 s. }2 i$ N
(setvar "cmdecho" 0)( P4 `. j1 ]4 _# [
(setq olderr *error* *error* myerror)
( y5 V; u) X1 d+ J% c& B (prompt "\nSelect objects: ")# C/ j% w/ W& ~8 W: w7 ~
(command "select" "au" pause)
& l5 q( N0 l( J' ?+ V3 J3 ?" H (setq sstxt (ssget "p")' U# B1 E# x5 _: `
sslen (sslength sstxt)& p) F$ V% T, W5 r/ _3 U
ctr 0
. i: P q4 f/ @+ Q- P0 j4 \ )4 V! m- W' r+ p* z) O$ u
(command ".undo" "mark")/ |8 |0 e6 d' q6 d0 K5 T' R
(while (< ctr sslen): J$ h5 ~ e2 \9 ?! D3 y
(setq listxt (entget (ssname sstxt ctr))
' }5 Q* Z! f# W( A- U txttxt (cdr (assoc 1 listxt))
3 C4 A1 _0 O5 v) H- X9 V enttxt (cdr (assoc 0 listxt))
, [& H; B$ L2 }& E5 v ). O2 i& U2 j& D) U5 Q! s0 b! S5 z0 e
(if (= enttxt "TEXT")
" k- m: _, W f4 [) @5 d8 @ (progn: T; D. [8 W: s# @- M! G! e8 ]% T
(setq testxt (substr txttxt 1 3))
3 E2 d4 j6 D' [) v# t( F# ~* ^ (if (or (= testxt "%%d") (= testxt "%%d"))
. R$ \9 d( _) p (setq newtxt (substr txttxt 4))
+ _ Y+ @) g! t3 ]* X. z6 \ (setq newtxt (strcat txttxt "%%dC" ))/ h$ u7 n9 r9 @: O! m, _1 p
)1 W2 q: u) A7 Q& ?5 [# I6 W
(setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))5 g. X+ M+ ~! o4 Z6 c
(entmod listxt)
|" ^3 Z' ?: I; N- d- { )
/ E) b8 Q, F+ ]) P4 F0 Z )0 a4 x& m4 C9 T' L
(setq ctr (1+ ctr))
: n+ ?! I/ r% o( w5 d7 ` )# {* R5 h) ~' B9 E) x
(setq *error* olderr)1 u, l4 B- ^6 h% H* [
(setvar "cmdecho" 1)1 Y! j5 R7 I1 a& |
(princ)! Q0 s8 k7 K- {5 J0 C
)# h: n& ~7 @$ x% f8 N j r
- |4 k1 d+ f; {, k8 @# G$ C% `3 _(defun c I ()# f: y1 S( [" y0 G7 C* A
(setvar "cmdecho" 0)8 k) G' o/ l" h% d% V
(setq olderr *error* *error* myerror)4 e1 U4 X: x# U
(prompt "\nSelect objects: ")
1 b2 _8 o5 W1 x( I; W (command "select" "au" pause)
7 W$ ]: R! b; L5 U/ Y) Z (setq sstxt (ssget "p")
9 d4 {/ V, q' ^) _; a# n. B sslen (sslength sstxt)$ Y: v, o; x; G1 j3 G# X; }4 S
ctr 0
$ q3 p$ `6 \1 A* `1 S2 G )
z, m' s# s Y u6 H8 b5 N (command ".undo" "mark")
9 T5 A! i2 L3 V8 _+ z: T6 ` (while (< ctr sslen)6 u1 D) P9 z. P a) S: a
(setq listxt (entget (ssname sstxt ctr))9 e# d' S& r2 |+ |
txttxt (cdr (assoc 1 listxt))
: R+ ^4 m& M- W$ K enttxt (cdr (assoc 0 listxt))0 {5 \0 [& H, Q2 _6 N; G. b. H
)
+ M+ U7 H# |8 \0 V! c) \5 A H* M- ] (if (= enttxt "TEXT")
- T& ^% h5 f9 W8 Q' e8 e B (progn4 N2 j8 o- O- q* M9 m
(setq testxt (substr txttxt 1 3))9 \4 e* w6 \+ k( R
(if (or (= testxt "%%p") (= testxt "%%p")): {4 O4 }1 I h; I
(setq newtxt (substr txttxt 4))/ s# `* h7 b: U" K, G% @
(setq newtxt (strcat "%%p" txttxt))7 P/ h+ m0 c9 J3 F8 V8 Q4 T: |5 I$ T
)( n* T2 a; q9 S T4 z
(setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))' M! `% s- v4 I- U3 G- ?7 z
(entmod listxt)
! h% x8 p( n Z0 P2 p3 T( p5 ^ )
& ]0 z$ z1 s3 L$ C! h5 s5 ` )9 y. Q- P% h+ H# e' w+ j
(setq ctr (1+ ctr))
) }! y$ @: W/ F8 ^$ ` )
4 |! w# D% p Y0 _ u) J0 j (setq *error* olderr) x) t" ^' ?: L6 A. J
(setvar "cmdecho" 1)6 _: L. c8 Y' b" M
(princ)
+ j; B, y' M5 {1 i0 B)
2 f! X. E) H z# s) s& x( q$ Q, q- u0 m1 o; T
(Defun c:CB (/ a)* u: p4 p7 S1 ]. D
(setq olderr *error* *error* myerror)
. m& ?1 |; `8 _0 S8 q5 l (setq ocmd (getvar "cmdecho"))( |* a5 Q, X# i- d# m' u* ~4 Y1 h
(setq oblp (getvar "blipmode"))8 @1 {1 R7 W, @; }8 r4 h$ T1 A3 k
(setvar "cmdecho" 0)
4 p) h! H. x$ t7 ~; h (setq a (ssget))* k/ v7 o+ p' J+ I
(command "CHPROP" a "" "C" "bylayer" "")8 w% v- D7 r8 A! g6 L) Q( u, g
(setvar "cmdecho" ocmd)
9 n6 H# ~7 L" Z (setvar "blipmode" oblp)
7 u# Y* |9 C- O2 H3 a& W& b (setq *error* olderr)
! p5 g; l" s, B$ M1 u% D1 _. h& p* J (princ)4 y7 \2 S0 K% Q# M. c
)- T$ I8 v' C& m. }
# ^* i; j0 e0 ~& }1 V$ m, g(defun c CC (/ co43 obj23 la23)
4 ?; u* }5 u( }' G4 | (setvar "cmdecho" 0)9 w+ r K& y, q+ z
(setq co43 (getstring "\nNew color : "))2 |0 Q. h% e9 p& J7 H A
(setq obj23 (car (entsel "\nPick object on desired layer: ")))
7 ` `# f! @9 ?) ~: k+ d (if obj23 (progn
* y9 E% {& i' D3 w0 c# N (setq obj23 (entget obj23))$ [$ c0 _, Q1 f( G
(setq la23 (cdr (assoc 8 obj23)))
% b! [- f B+ D! S: j. y7 K; R (command "layer" "c" co43 la23 "")
8 Y+ J) T4 V8 c4 A% g )! r. T5 P$ N/ x3 z# e
)% R2 n7 R; p0 G% E
(prompt (strcat "\nLayer has changed..." la23))
. ?( e# y& f) [+ [ (setvar "cmdecho" 1)
" |7 N- m* q% L5 U1 B (princ)
" t2 E/ L M+ u8 c- F)
+ ~6 [3 z. v' ^& ?" p8 g* U* N6 E( [$ F* U3 X# R$ x4 }) d
(Defun c:RP (/ a)" j2 d: e; Z+ f2 F [0 s) C
(setq olderr *error* *error* myerror)7 J+ S& c, f1 [
(setq ocmd (getvar "cmdecho"))% L) V& h/ o" ]1 m
(setq oblp (getvar "blipmode"))
0 @$ L1 s `8 M0 @) t (setvar "cmdecho" 0)
0 J6 \+ Z- N! R* y) C6 u- W (prompt (strcat "\nUSE: Delete object(s) belonging to"
5 C0 \6 a& g8 X) r( p7 E$ }# c " the layer of the entity picked...!"))
6 D' O; m% t( \ (setq a (entsel "\nPick the entity with the desired layer to delete: "))
# q6 v9 p( B. V. |6 J% c7 p' {8 d; y (if (/= a nil)9 Z& d% _9 x( l9 I) @& m
(progn (setq a (cdr (assoc 8 (entget (car a )))))
6 g/ @; Z% b) O3 N c; _5 K (command "Erase" (ssget "x" (cons (cons 8 (eval a)) tempword)) "")). [- _, b7 v* ~+ h/ U& }
(prompt "\nNo entity selected!"))
1 ?/ ]5 P! r ^: X) j (setvar "cmdecho" ocmd)0 j, a) c3 ~$ `- {5 }3 @
(setvar "blipmode" oblp)- l4 |1 n6 e+ X0 `! N, i% S- p% o
(setq *error* olderr)2 E+ M% ]/ |+ Y8 B
(princ)
2 r4 B) a7 I/ T. c2 T4 S2 L)2 `/ o8 ~0 \9 ^' D' C. @
" ^) @+ z) H2 R. q(DEFUN C:WL(/ SSET NET SSL M)6 u0 F: N, d! s& |& r L& w6 ^
(PRINC "\nSelect lines :")
# G2 G7 d7 K! V5 ^ (SETQ SSET (SSGET))+ I0 g$ E2 o2 W$ j, q& z; g" g
(IF (/= NIL SSET) (PROGN
# T) X! G+ F3 u1 t2 j j, F9 M (SETQ SSL (SSLENGTH SSET))) O% G, @% e2 g5 c, K2 a
(INITGET 4)
, M; h# O+ h W# S1 X; v (SETQ NET (GETREAL "New width : "))/ C0 ?- ]. Q% W& R6 K- Q
(IF (/= NIL NET)
- u# I. G1 a2 _. p& X) X (WHILE (> SSL 0)
; J% s. @$ J3 d+ F7 M (SETQ M (SSNAME SSET (SETQ SSL (- SSL 1)) ))
0 x" G$ K1 C. b (IF (= (CDR (ASSOC '0 (ENTGET M))) "LINE")
$ J4 _ k" a9 b$ m7 H! o9 e7 ]1 n (COMMAND " EDIT" M "Y" "W" NET "")
, `3 [9 O& o/ C- Q( |$ S* ]* E' e )
5 I3 L' |+ K, n6 o )
( S0 v# X+ |- |+ R4 }: I3 l )))
* }6 U7 ?9 z8 _: ]+ Q, y (PRINC)
: d4 a0 t0 U) x M)) u6 } c8 y; M% T0 h5 l, E
- i' N0 ^% a4 z7 W(defun C:MML ()
0 P% s& V& Z/ t2 s3 s; ? (princ "\nSelect objects to move to another Layer.")! {0 D$ R0 k5 I" x1 E/ _; p
(setq ss (ssget))" ?9 q5 N1 W" s4 r' f
(SETQ UL1(GETSTRING "\nLayer to move entities to : ")). V; Z6 `% r+ B1 ^: f, o: }
(setq counter 0). H. F% k$ C M/ |3 X; i8 G/ s
(prompt "Moving to layer.....")(princ ul1)
) n m4 y: h' t4 d4 z0 w' M (setq e (ssname ss counter))) s, j: S% s: y: M* h1 [! C
(setq l (cdr (assoc 8 (entget e))))
+ B0 Z$ |" j# H$ x2 i# R (setq S (ssget "X" (list (cons 8 l)))): [1 V& d* [0 S2 r8 J% z
(command "CHANGE" ss "" " " "LA" UL1 "")
7 g8 p6 p# s4 F! I3 C7 {4 M4 u3 y3 x/ S/ j (setq counter (+ counter 1))
# C# B, [! ~. x( K0 y4 f(princ)( W$ r$ D- E) |1 Y6 a* ]- P9 \
)
4 i' t4 k' \; G+ D9 P/ ]1 v! [/ \- N
) X) P! ^5 r* m8 w;;; ================================ GHI CHU ============================$ N! B3 q* @( F. R9 @. b( i
;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========9 s9 e" ^8 |' _1 Z; w3 F5 M- ^
;;; =======================Thuong Dung Font Romant.vnh===================
' ]- k) B7 `* v" b' \;;;==================== Tran Ngoc Thang - Sinh 03-05-1976================
) P9 v/ j& ?' k% j% c6 I0 T% h$ f$ }+ w) |, i7 g. j
(defun c:RS (/ pta ptb ptc ptd X Y X1 Y1 rmsz pl1)
& v# r- [! U4 U) _8 K, c (setq oer *error* *error* err2)
2 ?3 u- H7 |* V4 ~4 Q t! \ (PROMPT "\n(VNI-TTF)(D)ining room. (S)torage. c(L)oset. (C)onference. (O)ffice. (K)itchen. (B)ath. (M)aster Bedroom. "); N5 f; Q% E) e( s9 k J4 e! S
(SETQ Cpt(GETSTRING "\n (RomanT.vnh)(DD).(SS).(LL).(CC).(OW).(KK).(BB).(MM). (Vni-SHX)(oD).(oS).(oL).(oC).(oww).(oK).(oB).(oM)."))# ]: \7 i$ n' f% ?' s! P4 ^
(IF(OR(= Cpt "K")(= cpt "k"))(SETQ CPT ' "Nhaø Beáp"))
2 m" z: `& B* } (IF(OR(= cpt "B")(= cpt "b"))(SETQ CPT ' "Phoøng Veä Sinh"))
& I4 f$ ]0 e: v, ^4 F9 }4 Q" ` V (IF(OR(= cpt "C")(= cpt "c"))(SETQ CPT ' "Phoøng Hoïp"))$ b# R+ w5 Y/ S+ t8 E v
(IF(OR(= cpt "O")(= cpt "o"))(SETQ CPT ' "Phoøng Laøm Vieäc"))5 Y9 A% Y- F" ]5 ?8 ?8 p
(IF(OR(= cpt "M")(= cpt "m"))(SETQ CPT ' "Phoøng Nguû"))
9 V9 p2 m2 D7 I. } (IF(OR(= cpt "D")(= cpt "d"))(SETQ CPT ' "Phoøng Beáp + AÊn"))
# x& S; f2 [8 S( S" ` (IF(OR(= cpt "S")(= cpt "s"))(SETQ CPT ' "Nhaø Kho"))
& b- G4 c& E }+ d2 ^ (IF(OR(= cpt "L")(= cpt "l"))(SETQ CPT ' "Phoøng Ñeå Ñoà"))
. K" G; ]" z+ i# \
3 ^2 s6 X& m. @; K" g8 r9 w" W (IF(OR(= Cpt "KK")(= cpt "kk"))(SETQ CPT ' "Nhµ BÕp"))
* {7 l! M2 Y8 L2 X @* K9 U- ] (IF(OR(= cpt "BB")(= cpt "bb"))(SETQ CPT ' "Phßng VÖ Sinh")) G; P0 L( K1 G4 ]& U! q& O7 C
(IF(OR(= cpt "CC")(= cpt "cc"))(SETQ CPT ' "Phßng Häp"))
6 |5 L6 @1 D/ B( I (IF(OR(= cpt "OW")(= cpt "ow"))(SETQ CPT ' "Phßng Lµm ViÖc"))/ f0 C2 l ^. a; i
(IF(OR(= cpt "MM")(= cpt "mm"))(SETQ CPT ' "Phßng Ngñ"))
" ~2 Y7 B9 {( @. _) t5 `( W (IF(OR(= cpt "DD")(= cpt "dd"))(SETQ CPT ' "Phßng BÕp-¡n"))
$ w D/ {5 N$ N8 y% t: x" ]" } (IF(OR(= cpt "SS")(= cpt "ss"))(SETQ CPT ' "Nhµ Kho"))
/ m$ Z$ O" t4 p) ^ (IF(OR(= cpt "LL")(= cpt "ll"))(SETQ CPT ' "Phßng §Ó §å"))
" b6 H L$ c+ v5 R. p% v, D. h3 p6 a, X1 j2 X
(IF(OR(= Cpt "oK")(= cpt "ok"))(SETQ CPT '"NHA/F BE/M/SP")) W& u1 ~4 Y e/ Q9 H
(IF(OR(= cpt "oB")(= cpt "ob"))(SETQ CPT '"PHO/F/NG TA/W/SM"))3 k0 D1 t; B8 y4 H( b
(IF(OR(= cpt "oC")(= cpt "oc"))(SETQ CPT '"PHO/FNG HO/JP")): l$ b/ Y& j$ r9 p9 T! P, W$ o
(IF(OR(= cpt "oww")(= cpt "oww"))(SETQ CPT '"P.LA/FM VI/E/M/JC"))
. C2 `2 r+ d3 V* o3 v (IF(OR(= cpt "oM")(= cpt "om"))(SETQ CPT '"PHO/FNG NGU/R")). u8 `. E: B1 R% l/ e0 `
(IF(OR(= cpt "oD")(= cpt "od"))(SETQ CPT '"PHO/FNG A/WN"))+ `8 M0 [7 V2 k: K3 Y h
(IF(OR(= cpt "oS")(= cpt "os"))(SETQ CPT '"NHA/F KHO"))
& i$ M! f' |# @/ G* D! d (IF(OR(= cpt "oL")(= cpt "ol"))(SETQ CPT '"PHO/FNG /DO/M/F"))) r, t6 I9 R+ o
(setq pta (getpoint+ u7 V0 u* I# t) A! `8 u7 p
"\nPick first corner. : "))+ E" M: S) ^# m% ]
(setq ptb (getcorner pta1 q1 s% K k4 L1 s- E: W
"\nPick second corner. : "))
- K/ ] i( f+ {0 x9 T (setq ptc (list (car ptb)(cadr pta)))) o1 H# O _* Y: ~+ H& y
(setq ptd (list (car pta)(cadr ptb)))& S$ g; ?( l9 \, a2 X, V
(setq ang (angle pta ptb))
0 M% @" s7 U* b& _/ B (setq d1 (/(distance pta ptb) 2))+ A6 h* X$ U/ a' O V+ E
(setq cp (polar pta (- ang (dtr 0)) d1))
3 s- a4 h$ p3 V3 B- s3 U. C' V (setq X (distance pta ptc)); Q' u# Y6 v8 u$ u( f3 j7 G, S
(setq Y (distance pta ptd))
2 ^; P/ E$ c) t% b (setq X1 (rtos x 2 1))
9 f" l. L) v# c; C' S. l (setq Y1 (rtos y 2 1))# a8 L% Z; @% V2 G8 f
(setq rmsz (strcat "(" X1 " x " Y1 ")"))
% a4 Q; _: K3 F+ h9 l. y (command "TEXT" "c" cp "0" CPT "ROMANT-TEXT" "" rmsz))
; p$ T2 L3 {1 O2 q, h2 w. X0 ^6 X (defun dtr (angg). y% S; M' l# D) k9 s' ^
(* pi (/ angg 180.0)))
4 |6 L: d. C+ q8 A9 h4 x3 b; w$ _& m2 I
(defun c:ZS (/ pta ptb rmsz pl1)4 M1 T/ U' T/ e
(setq oer *error* *error* err2)) F% Q9 L; U. _ x0 q& N! h
(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.")9 C9 F) ]1 \3 E+ \* t& S1 G
(SETQ Cpt(GETSTRING "\n (RomanT.Vnh)(LL)floorplan.(EE)elevation.(SS)section.(BM)planFoundation.(CM)foundation.(KC)Structure.(PP)perspective."))
) N$ _7 i$ k% w- d/ k8 a8 t$ G* f& T. e$ ^% V
(IF(OR(= Cpt "LL")(= cpt "ll"))(SETQ CPT ' "MÆt B»ng TÇng 1 : TØ LÖ - 1:100"))' V8 L7 f! x4 u6 I% q* |5 G
(IF(OR(= cpt "EE")(= cpt "ee"))(SETQ CPT ' "MÆt §øng Trôc ?-? : TØ LÖ - 1:100"))2 n' A$ L! r+ _5 Z) {: v; H
(IF(OR(= cpt "SS")(= cpt "ss"))(SETQ CPT ' "MÆt C¾t A-A : TØ LÖ - 1:100"))
( v+ e4 Q" ^& A6 I( @9 Y (IF(OR(= cpt "BM")(= cpt "bm"))(SETQ CPT ' "MÆt B»ng Mãng : TØ LÖ - 1 : 100"))8 S/ J/ b4 ?0 N# [7 {9 W
(IF(OR(= cpt "CM")(= cpt "cm"))(SETQ CPT ' "MÆt C¾t Mãng : TØ LÖ - 1 : 100"))
4 a# X( e$ {/ ~ (IF(OR(= cpt "KC")(= cpt "kc"))(SETQ CPT ' "KÕt CÊu Khung Däc Nhµ : TØ LÖ - 1 : 100"))3 r1 }- A9 ^6 l7 @
(IF(OR(= cpt "PP")(= cpt "pp"))(SETQ CPT ' "Phèi C¶nh Mét Gãc Nh×n"))2 I$ {. O1 Z7 P( W% ^% C! b% z
# [8 ]9 O7 ~) g8 n3 f
(IF(OR(= Cpt "oL")(= cpt "ol"))(SETQ CPT ' "MAËT BAÈNG TAÀNG 1 : TÆ LEÄ - 1:100")): G; m ]( ~6 S/ N$ |, o6 o5 q; Y/ z
(IF(OR(= cpt "oE")(= cpt "oe"))(SETQ CPT ' "MAËT ÑÖÙNG TRUÏC ?-? : TÆ LEÄ - 1:100"))4 l' ?. ?' [& B4 S+ T0 B! j
(IF(OR(= cpt "oS")(= cpt "os"))(SETQ CPT ' "MAËT CAÉT A-A : TÆ LEÄ - 1:100"))
' z( e1 H- i! j (IF(OR(= cpt "oM")(= cpt "om"))(SETQ CPT ' "MAËT BAÈNG MOÙNG : TÆ LEÄ - 1 : 100"))
9 R) `0 R4 E. k9 o; i (IF(OR(= cpt "oC")(= cpt "oc"))(SETQ CPT ' "MAËT CAÉT MOÙNG : TÆ LEÄ - 1 : 100"))7 M, K) }% @3 r$ g8 \* B
(IF(OR(= cpt "oK")(= cpt "ok"))(SETQ CPT ' "KEÁT CAÁU KHUNG DOÏC NHAØ : TÆ LEÄ - 1 : 100"))4 e$ e" F$ J4 @6 c" a
(IF(OR(= cpt "oP")(= cpt "op"))(SETQ CPT ' "PHOÁI CAÛNH MOÄT GOÙC NHÌN"))/ w2 Z) t3 O9 H
& P* G7 S) M: q1 L6 N: } (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")): @/ b+ C, L" \- {9 c! h3 D+ ~
(IF(OR(= cpt "E")(= cpt "e"))(SETQ CPT '"MA/W/JT /D/}/SNG TRU/JC ?-? : TI/R LE/M/J - 1:100"))
. G2 V: W2 ^3 a& [ (IF(OR(= cpt "S")(= cpt "s"))(SETQ CPT '"MA/W/JT CA/W/ST A-A TI/R : LE/M/J - 1:100"))
2 |& v) D9 h$ W$ { (IF(OR(= Cpt "M")(= cpt "m"))(SETQ CPT '"MA/W/JT BA/W/FNG MO/SNG : TI/R LE/M/J - 1:100"))6 C9 m- H( l! g& p# l
(IF(OR(= Cpt "C")(= cpt "c"))(SETQ CPT '"MA/W/JT CA/W/ST MO/SNG : TI/R LE/M/J - 1:100"))
7 ~( E$ N4 q* h( X (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"))
. j# y# C _2 r! r3 \1 y) p. J/ W (IF(OR(= cpt "P")(= cpt "p"))(SETQ CPT '"PHO/M/SI CA/R/NH MO/M/JT GO/SC NHI/FN"))
# W- J) ]7 ~+ b2 A' Y (setq pta (getpoint# F# ?3 O' D/ @& C% K' c
"\nPick first corner. : "))
2 n0 h) |4 {. O4 g (setq ptb (getcorner pta
' d' r4 O4 _: Z6 G4 u "\nPick second corner. : ")); w( q( Q1 M$ H9 y7 G' y
(setq ptc (list (car ptb)(cadr pta)))* T2 T" }9 |6 s2 a0 E) [) o+ w# h
(setq ptd (list (car pta)(cadr ptb)))
- e. }5 K7 w, ]. L+ C (setq ang (angle pta ptb))' J8 z$ E1 \; W6 h D2 I
(setq d1 (/(distance pta ptb) 2)), u+ I2 u8 J; N
(setq cp (polar pta (- ang (dtr 0)) d1))9 A+ m3 n9 m2 y& W' i3 f( J' X% F1 n" w1 }
(command "TEXT" "c" cp "0" CPT "ROMANT-TEXT" "" rmsz))
) L" u+ o3 V3 g, G, v- E0 M (defun dtr (angg)6 a& Q1 N: f% }8 C
(* pi (/ angg 180.0)))
( R( E7 \/ n1 R6 |; H$ n+ J/ k# Z
;;; ================================ GHI CHU ============================! O6 [: [1 n: J% I$ |* d- q
;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========
! O C/ F2 D0 N6 [9 V2 z7 ?;;; =======================Thuong Dung Font Romant.vnh===================3 F& d( ?4 q' ^5 U D
;;;==================== Tran Ngoc Thang - Sinh 03-05-1976================
5 `, M) b7 X. m2 }, F- ^1 V+ i6 h/ @1 H" ~( [
(defun c:RRS (/ pta ptb ptc ptd X Y X1 Y1 rmsz pl1)0 T o+ S" O, H& u- n# U
(setq oer *error* *error* err2)
( J: h; C5 ^+ n! z (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. ")+ L8 w4 M+ [/ Z% J
(SETQ Cpt(GETSTRING "\n(RomanT.Vnh)(M)aster Bedroom. (DD). (SS). (LL). (CC). (OO). (KK). (BB). (MM). "))
- T# F- e, W+ H8 X; ? N" D9 E (IF(OR(= Cpt "K")(= cpt "k"))(SETQ CPT ' "Nhaø Beáp")), |- n! p, ?- k; F5 M9 R+ ?
(IF(OR(= cpt "B")(= cpt "b"))(SETQ CPT ' "Phoøng Veä Sinh")), s: D' I' L; n! S; q
(IF(OR(= cpt "C")(= cpt "c"))(SETQ CPT ' "Phoøng Hoïp"))$ M' k$ ^2 M0 F' k0 f# ~
(IF(OR(= cpt "O")(= cpt "o"))(SETQ CPT ' "Phoøng Laøm Vieäc"))
2 N9 _9 W; D4 D* ^6 z \ (IF(OR(= cpt "M")(= cpt "m"))(SETQ CPT ' "Phoøng Nguû"))! S8 E" A# V" q9 [0 N
(IF(OR(= cpt "D")(= cpt "d"))(SETQ CPT ' "Phoøng Beáp + AÊn"))
; s$ C9 T9 O* t (IF(OR(= cpt "S")(= cpt "s"))(SETQ CPT ' "Nhaø Kho"))
: z: h5 E2 r/ l- w! M (IF(OR(= cpt "L")(= cpt "l"))(SETQ CPT ' "Phoøng Ñeå Ñoà"))9 [) E- _% a; { O2 Y
; Q( s o- @/ l
(IF(OR(= Cpt "KK")(= cpt "kk"))(SETQ CPT ' "Nhµ BÕp"))
8 @, W, o2 I: h (IF(OR(= cpt "BB")(= cpt "bb"))(SETQ CPT ' "Phßng VÖ Sinh"))
) V$ c$ Y5 @7 S (IF(OR(= cpt "CC")(= cpt "cc"))(SETQ CPT ' "Phßng Häp"))" k$ f5 `: u% R1 ]; x
(IF(OR(= cpt "OO")(= cpt "oo"))(SETQ CPT ' "Phßng Lµm ViÖc"))7 i: H! P9 R+ W9 R% `* g$ z7 Y$ m! {; F
(IF(OR(= cpt "MM")(= cpt "mm"))(SETQ CPT ' "Phßng Ngñ"))
+ Q$ }+ l7 X/ v6 ? (IF(OR(= cpt "DD")(= cpt "dd"))(SETQ CPT ' "Phßng BÕp-¡n"))7 [5 k- ]8 B- J2 [
(IF(OR(= cpt "SS")(= cpt "ss"))(SETQ CPT ' "Nhµ Kho"))
, `+ \0 |- w3 ~ (IF(OR(= cpt "LL")(= cpt "ll"))(SETQ CPT ' "Phßng §Ó §å"))- a8 f0 f$ W k* S
3 P" s! M( {2 b: s- P2 @ (IF(OR(= Cpt "oK")(= cpt "ok"))(SETQ CPT '"NHA/F BE/M/SP"))
: V1 V$ r, [/ Z/ \1 q (IF(OR(= cpt "oB")(= cpt "ob"))(SETQ CPT '"PHO/F/NG TA/W/SM"))
- C' e- h1 u% d (IF(OR(= cpt "oC")(= cpt "oc"))(SETQ CPT '"PHO/FNG HO/JP"))
& |7 p( w N, V (IF(OR(= cpt "oww")(= cpt "oww"))(SETQ CPT '"P.LA/FM VI/E/M/JC"))
( L8 c7 H( r- f2 [5 k: F" u (IF(OR(= cpt "oM")(= cpt "om"))(SETQ CPT '"PHO/FNG NGU/R"))
$ l5 Z! }, Q L L. V7 l! U (IF(OR(= cpt "oD")(= cpt "od"))(SETQ CPT '"PHO/FNG A/WN"))
( W; P' z* o$ u; P (IF(OR(= cpt "oS")(= cpt "os"))(SETQ CPT '"NHA/F KHO"))2 [+ o4 G# x) n
(IF(OR(= cpt "oL")(= cpt "ol"))(SETQ CPT '"PHO/FNG /DO/M/F"))
4 x' z- Z! E& p, s5 j5 u" o9 N- V+ h( r. u
(setq pta (getpoint
6 S+ }5 n/ V9 f4 [1 u) H4 o "\nPick first corner. : "))# Q: Q* z6 o9 D2 [9 S- Q' j7 P: ]
(setq ptb (getcorner pta
6 j# K' |9 G$ a N* Z( J "\nPick second corner. : "))
/ f) W6 r9 ?/ D (setq ptc (list (car ptb)(cadr pta)))- ^, w j' n7 P0 J5 s
(setq ptd (list (car pta)(cadr ptb)))1 p. S; q' D/ J5 ?* f g/ M" v
(setq ang (angle pta ptb))
, J9 Y* z( q; O* t8 B (setq d1 (/(distance pta ptb) 2))5 B0 j; I$ z; W. W2 @/ e5 s" O
(setq cp (polar pta (- ang (dtr 0)) d1))
: O' J' e; t. N" j7 I (setq X (distance pta ptc))7 ?* R, K6 Q0 }% W
(setq Y (distance pta ptd))2 v8 a e" z" h% p( m& r
(setq X1 (rtos x 2 1))
+ F1 C ?4 x& F, o+ U" O) v9 S2 s( y (setq Y1 (rtos y 2 1))
2 T2 q% t. e; {* M8 x: } (setq rmsz (strcat "(" X1 " x " Y1 ")"))
' { k3 p' H0 W8 N4 { (command "TEXT" "c" cp "0" CPT "text" "" rmsz))
7 J6 k+ M" [! ~( U% s/ Y) y (defun dtr (angg)
* k& ^5 x/ [; \' D$ t* {5 H (* pi (/ angg 180.0)))# ?' E# i/ B$ ^
6 T! _. [3 i0 C1 l
;;; ================================ GHI CHU ============================
% g! x% t' r' m( e( s6 @3 _/ A$ Q! z% i;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========
1 w/ [ _5 W( M3 R w7 j$ s;;; =======================Thuong Dung Font Romant.vnh===================
. `5 N- Z w& k& R+ w
2 f$ I. G1 L; q! W2 ]/ Z% r(defun c:GS (/ a b c d) o' N& E6 y8 k! ], h$ p7 W
(graphscr)1 X* S& ~) O% h" Y
(prompt "\nSelect text to set style....")
* b9 u6 H6 E+ b; I (setq a (entsel))! x5 d" A/ T# R
(setq b (entget (car a)))$ B" W& w8 h5 ]2 N3 p' b- p3 I# p1 Q
(setq c (cdr (assoc 7 b)))! I8 d8 q; R/ }4 }; n6 N, C* a. c$ E
(setq d (cdr (assoc 40 b))), L* l3 Z$ \2 ` e! T
(command "style" c "" d "" "" "" ""))! h; J" C" Q Z6 u7 y
(princ "\nType GS to set text style.")
% w$ G7 S2 T O, {3 V! h7 Y' I7 R% l
(defun c:RC (/ olderr ocmd oblp pt1 pt2 pt3 pt4 l w)& N5 D: a9 g$ x) C+ {1 d$ M- d/ x, ~
(setq olderr *error* *error* myerror)
6 I2 O+ Y$ m* V1 q; P, u' \ (setq ocmd (getvar "cmdecho"))
. c1 t, ^6 Z3 h/ p (setq oblp (getvar "blipmode"))
8 s4 [6 Q" B9 G4 f! u, K; `6 W (setvar "cmdecho" 0)4 \! C7 t: p6 O8 Q
(initget 1) ;3D point can't be null- E/ v: ]: E9 Z0 n6 }' [5 j1 Y
(Setq pt1 (getpoint (strcat "\nCorner of rectangle or square: ")))% C, T* p8 {& s9 N
(setvar "ORTHOMODE" 1)
* P) X! k P& k (initget 7) ;Length can't be 0, neg, or null0 N g5 w7 z0 S! r' F
(Setq l (getdist pt1 "\nLength: "))
( {: o" f7 {' v. [1 E2 ^$ _ (Setq pt2 (list (+ (car pt1) l) (cadr pt1) (caddr pt1)))3 R8 ]/ }5 Y& V
(grdraw pt1 pt2 2)
" |& _ K# l* v) O! M- m9 X (initget 7 "Square") ;Width can't be 0, neg, or null
! f6 u. X* ^2 I% r (setq w (getdist pt1 "\nSquare/<Width>: "))
9 F% n- c/ C( l (if (= w "Square") - v2 u- Z/ A; F# a* F# O
(setq w l): G& e8 c: o/ I* N" w1 g7 O
)8 z: ~3 \3 L% ` {
(setq pt3 (list (car pt2) (+ (cadr pt2) w) (caddr pt2)))
( m3 \' a8 P2 G4 e (setq pt4 (list (car pt1) (+ (cadr pt1) w) (caddr pt1)))
) t0 }5 P! f) ~4 h# @8 v (grdraw pt2 pt3 2)
( m& H9 Z+ {' ]$ ?8 h( U (grdraw pt3 pt4 2)5 S% R3 o( K+ X, A5 ]( P2 a
(grdraw pt4 pt1 2)
2 ^5 V l4 p3 { T* _ (setvar "ORTHOMODE" 0); d, b/ Z( F0 y& m
(command "pline" pt1 pt2 pt3 pt4 "close")2 K3 x( Z; |" {: v
(setvar "cmdecho" ocmd)
8 A( p$ l) }: j (setvar "blipmode" oblp)
/ `, a4 R4 D' o- Y6 v* L (setq *error* olderr) ; Restore old *error* handler! F" ]" t3 M. G1 v; |( }2 d& p" o; ~2 ~
(princ)* u v: N5 c9 B$ ?# L
)
/ I' b: M+ m8 n% z, R, o# z8 G* [6 f0 Z
(defun c:SG (/ ent pt1 pt2 ang)& X8 j1 X$ i; Y" G) r0 z' m
(setq cmd (getvar "cmdecho"))
* k0 x. y/ t& m4 V6 }/ H, T* B (setvar "cmdecho" 1)
& }7 h- K# @, Q, G# L+ u2 i$ O (prompt (strcat"\nSnap angle will be set to angle of line"))4 d5 q1 C. Q5 x* G. G
(setq ent (entget (car (entsel))))
) B8 R) r5 ]: n, q3 x9 \' Y5 B- l' d0 W (setq pt1 (cdr (assoc 10 ent)))
! V% ^, L7 z S) { (setq pt2 (cdr (assoc 11 ent)))
: l) _9 ?# v6 b# `2 }* s (setq ang (angle pt1 pt2))1 }% R6 `. U5 F4 t; q
(setq ang (/ (* ang 180.0) pi))4 ?0 } ^, b1 ~3 w% l
(setvar "cmdecho" 0)
7 a' F$ S! C+ G (command "setvar" "snapang" ang)% Z q* ^3 E# Y: B s2 V7 V% P
(setvar "cmdecho" cmd)
2 n4 D/ C3 h* ^# s)
0 O, _7 J) e8 J- t; \4 l# f3 ~- w3 @# X( C
(defun C:TG ()
* ~$ e+ ]4 Y3 H9 H* P (initget "Increase New"). b6 K2 o- N+ M. ^8 m* j& l
(setq ans (getkword "Increase/<New>: "))
2 b5 O$ r" x, m0 i (modang): {+ r5 S. S# u& |2 L; }) |/ c
)
, \2 Q; [6 H8 y4 B. c(defun modang (/ ang ss ca e na ssl)
8 v1 X7 k% H! } (if (= ans "Increase")
+ I3 ?/ @* w5 H$ e8 _: T! U2 j (princ "\nIncrease angle for text by: ")3 q5 j+ e7 C4 U# U8 \
(princ "\nNew angle for text: ")
9 p* L, `1 S! F2 B W9 x )
7 y* N; V; Q; p( c$ C7 V (setq ang (getreal))
: N8 I- _/ r( q: b, }9 H+ e9 H8 D. [! e (setq ang (* (/ ang 180) pi))
% U7 {0 ~' C; ]* l% I2 C (setq ss (ssget))
8 b& L4 Q3 W, j4 Y% Y (setq ca 0 ssl (sslength ss))
8 m, P: C' ^. \, [# A+ p u# H (while (< ca ssl)
/ S& C x- ?, F' ? (if (= "TEXT" (cdr (assoc 0 (setq e (entget (ssname ss ca))))))
- j" j* A1 D) K' |* S (progn6 U, @4 c; H. v+ V6 C
(if (= ans "Increase")
U6 d: Q& g* A& j (setq na (cons 50 (+ (cdr (assoc 50 e)) ang)))) c+ N, N+ Z1 Y3 A* O8 R
(setq na (cons 50 ang))/ i. N+ k7 j( q& Y, B
): k+ E* t( v7 M* v
(setq e (subst na (assoc 50 e) e))
) x* p: S$ M8 X/ K5 m2 L (entmod e)
* w z4 x M( ^) e (setq ca (1+ ca))
% R- |* _* t4 J, @ )
( ~! m) t2 Y. r) p6 | )
& k% J4 l5 h5 ?2 u9 w0 x1 H) x )
3 A2 A- m, J4 R3 U (terpri). ^$ m4 ~7 U+ W0 k' @( u6 q5 X2 Y
)
# c! Y& c c# h, ^
6 f5 u r; h4 U" X0 _2 I0 w
+ x2 y: O+ L3 P2 u6 ^(defun c:WL ()
1 X$ q1 e- H, U (setvar "cmdecho" 0)
, o: i' k. E0 d+ a5 ~: a (setq a 1)! M' U. Y2 y( l- H) ?/ ]5 V
(prompt "\nSelect Polylines to change: ")
+ l3 v8 c& j: m& G) z) i4 [ (while (/= a nil)
) z% Q3 ?' ^1 i! Z6 k$ ~ (progn
% E' X5 L/ _+ p) B* Y/ J0 Z (setq a (entsel))$ b$ o7 h; B) Z$ R( n5 ~; B
(if (/= a nil)& X/ e- w. [7 w5 l% {
(progn
* m A o7 H# P) Y (setq b (entget (car a)))4 Q* [( B; s7 O8 Y$ c
(setq c (cdr (assoc 40 b)))
. w) y2 U7 [/ G5 B& o: d# C" ? (princ c)3 L$ [) D1 A! u$ W. n- q8 w$ c1 }
(command "pedit"a"w""lw""")
. X' U0 {& [; t, J2 _ )))) 1 o( v/ _3 V4 a1 q& @; \
(princ)( z* z8 J/ O F g
)# l1 U# v; G" k, ^6 l
3 P. H0 m5 B9 O, W$ G K# ` R
;;; ================================ TEXT FIT ============================
9 k. j2 T2 a# X% t) O4 R
, b" _5 ^/ Z1 W4 J$ f) \(Defun c:FT ( )
1 @4 T7 u. ?3 @2 j2 D$ ^, s- X6 E (defun setsnapang (arg /) (setvar "snapang" (angtof (angtos (cdr (assoc 50 arg)) 0 8) 0 )) )
! ~, ?" ?; x6 c9 y }, ~" A O( @ (Defun LL-xyz (arg) (CAR (TextBox arg)) )4 Q- |9 p# X# f! q- k; |
(Defun UR-x (arg) (CAADR (TextBox arg)) )
7 y# k Z, S9 R8 v# B (Defun LL-y (arg) (CADAR (TextBox arg)) )" w- U+ h2 p7 C3 g
(Defun LR-xy (arg) (List (UR-x arg) (LL-y arg)) ) a7 J% t- G0 [( S3 `( @( G
(Setq ename (CAR (EntSel "\nSelect Text to stretch/shrink:" ) )2 o( F3 Y& y9 t& s+ p5 Z
Textent (If ename (EntGet ename)) )
8 Y0 M! P$ f7 k (If (= (CDR (Assoc 0 textent)) "TEXT")
3 B/ T7 O: l* g0 ~2 S; d8 z/ E" ^* c (Progn (initget 0 "Start") U4 o' R3 X1 ~( L) t; z& ]% X/ L6 n
(Setq NewEnd (Distance (LR-xy Textent) (LL-xyz Textent) ) ): A K# {$ R3 e+ K8 o$ Z) B
(setsnapang Textent) ;set snap along text entity0 F7 _& H: @; ^0 t
(setvar "ORTHOMODE" 1) ;drag along the text
" g$ M& h9 B# r5 _* D) c: { (setq . V3 W, @, X! K( ] D
TMP (getpoint (cdr (assoc 10 Textent)) "\nStarting Point/<Pick new ending point>: ") )
- r1 i# }0 a) }5 f! W (setvar "snapang" 0)
7 i/ a- M4 y" w" z X% t' Z$ o+ v (cond
' k- o% T% D! u9 B5 r ((= (type TMP) 'STR) ;;new starting point to be selected4 C% x2 }: Y N6 B
(setq Start (getpoint "\nPick new starting point: "))
8 d4 y6 C B9 F2 r! X% u (if Start (progn8 z/ W) U8 P. h, K3 }0 T
(command "_UCS" "_E" (cdr (assoc -1 textent)))! U% ]. h$ i5 z2 J. f
(setvar "ORTHOMODE" 1)8 ^2 P8 T. Z2 @7 o8 U
(setq NewPt7 g' D t0 D* @1 P2 ?5 G. \* q
(if Start
$ D% S- b, z# R; ?4 E) d2 _6 U (getpoint (trans Start 0 1) " ending point: ") nil ) )
5 o3 p1 K C O8 r/ l* G (if NewPt (setq NewPt (trans NewPt 1 0))): u) w& n; o5 }% D4 u: p4 C- d
(setvar "ORTHOMODE" 0)
( x j% O" y% c( [/ m2 h (command "_UCS" "_W") ) ) )
+ N& @5 G+ w: Q a: g2 @$ ?- X ((not (null TMP)) ;;new ending point selected
. g5 f. M/ v3 G K. J) O (setq Start (cdr (assoc 10 Textent)) NewPt TMP) )
: d. A6 w5 ^* M7 q& F1 D/ o (t (setq Start nil NewPt nil) ) )1 O! O# A/ \, N5 |- E: a
(if (and Start NewPt) (progn& s* x8 s+ s* L2 M6 A6 `
(setq Val (Assoc 41 Textent) ;;current width factor+ F* J0 d( p z
Val (if Val (cdr Val) 1.0) LTC_% ' |& G/ u: R! |
(* (/ (Distance Start NewPt) NewEnd ) Val )
7 U4 v7 b8 I3 C/ d2 e6 j5 H# O textent (Subst (cons 41 LTC_%)- b4 q' `: e0 O! \' o/ w
(assoc 41 textent) textent)
% l3 k5 d6 N7 J* X textent (subst (cons 10 Start) (assoc 10 textent) textent)
8 G; i( s2 q s% b: h textent (subst (cons 11 NewPt) (assoc 11 textent) textent) )% L5 e: P# B/ b h( z
(EntMod textent) (EntUpd (cdr (assoc -1 textent))))))) (Princ))/ h! G! @2 ?3 Y! u6 A0 p5 r% Z
8 N8 f: Z1 d+ |8 J9 A1 i& h, B;=====================================================================
" x( E7 G8 B/ ]' T3 l. D% h/ ~;=========================COPY + ROTATE ==============================
, z3 N- F+ w6 a, F& U. ~) Y;=====================================================================
7 G# C# [/ O# \& F2 t c6 y( P+ M6 W- {9 ^% ]/ E% z# U
(defun c:CR(/ olderr cm loop ss1 ss2 bp mult lent ss2 lp1 lp2)1 K S; u& E% W( s7 }# P
(setq olderr *error*( Q$ g. m3 P; `3 J
*error* croerr)( u9 q& X' O# c6 G9 i
(setq cm (getvar "cmdecho"))9 [1 u5 }8 l2 ~4 E
(setvar "cmdecho" 0)
# c d0 P* ~( z' }/ w (setq loop t)# p$ J2 O+ ~7 y6 W
(while (not (setq ss1 (ssget))))
: T( L0 v- O* `3 L$ N9 K (initget 1 "Multiple")- R# i& F. N: V/ O7 O, @
(setq bp (getpoint "\nBase point or displacement>/Multiple: "))1 L/ r4 Q$ E$ |
(if (= bp "Multiple")
n) Q w: g" q9 g4 t; r) G* V$ a (progn
( O( G6 j/ t9 c6 r3 R _0 C (setq bp (getpoint "\nBase point: "))& m: s* J* |4 u/ l/ @
(setq mult t): F7 Y7 t2 }# @9 R. w% h; }" k; B
)4 S2 {" l2 x% u8 A( J
)
& ]7 ^) ?& m- |( v- u (while loop
$ ], K* c; X ^0 j8 e0 G+ o (setq loop mult)5 X; l' ]# x2 O: U8 R" X
(setq lent (lastent))
% C' ]3 z, n& v- \0 F6 A (command ".copy" ss1 "" bp bp)
, `( w: a' x4 T" s5 \/ N (setq ss2 (lss lent))
W9 w9 Y4 j7 a (setq lp1 (getvar "lastpoint"))
) E/ `0 c; h4 i# C: _ (prompt "\nSecond point of displacement: ") W/ u9 ^1 P) j# }# U% W( Q$ P
(command ".move" ss2 "" bp pause)
) |7 K1 U0 @( B% V2 D (setq lp2 (getvar "lastpoint"))
G: n; O X$ O/ w (redss ss1)
/ d0 Z2 q ^+ L, w4 e (if (and (not mult)
0 X: n8 o/ o) j- C* T6 w (= (distance lp1 lp2) 0)
6 D9 p6 ~4 V B( f+ U! I( b )
2 f" _+ i: P. X: i) k (setq lp2 (getpoint "\nRotation Point: "))9 x+ i+ X% p9 d% Z* w
) p- D }6 _1 c- R H0 i# R
(if mult
! Z: I" C# x% ]2 c: U (prompt "\nRotation angle ")
& c3 Y2 f- D( q! R' I (prompt "\nReference/<Rotation angle>: ")1 O' s% j4 o, _: b) n& M7 J8 o. _) `% G
)6 _ R6 x) I( X* T% F, `
(command ".rotate" ss2 "" lp2 pause)# c5 R) }6 r3 e3 f* c; z9 p& w
)' _( R5 z9 ]8 n \3 |' d. {8 i
(setvar "CMDECHO" cm), X+ A6 V7 Q. j$ E
(setq *error* olderr)
4 f, r3 |7 S: N l (princ)
8 ?6 ?0 E! _% X) {+ _)7 b8 c/ {( R# q E
(princ)4 [' n/ b3 T4 P) u) j
(defun croerr (s)
0 N- F1 d' Y6 k: {5 B (if (/= s "Function cancelled") $ O ^# N `* h) `, D" i9 e
(princ (strcat "\nError: " s))$ h0 o& Y9 |6 |
)
( x$ \7 S& Q3 t" ? (setq S nil): I7 t! N; A( ^- D4 l
(setvar "CMDECHO" cm), c5 L: A; o4 ~; Q! D" ^/ k
(setq *error* olderr)# w {8 \2 y. r" p
(princ)
* K" r( E# C) R- _" b)2 Y% s3 @0 y$ b, ]# p* l" H( R; P: X
(defun lastent (/ a b)
2 b* q% o- ?2 i (if (setq a (entlast))8 m! p: Q# G/ }+ d+ m% H) i
(while (setq b (entnext a)): P$ D" y7 X$ o# V
(setq a b)
' s4 g$ U# L$ u* ]6 | )
: h, q: A% A% |5 F/ `3 ^ f; k )6 W' \3 `# q* J/ j9 s( r
a U* @( [2 y" N$ K4 N. j+ `7 r5 G
)
/ t9 F8 ^+ `5 F* z: O(defun redss (ss / en i)% R% e; ~& a" C9 r# s$ |/ N9 a: s
(setq i 0)
2 z& |0 O, v/ ^ O. q- c (while (setq en (ssname ss i))/ w2 w$ t- O$ W# n
(redraw en 1)3 B% r* T* ^4 ~
(setq i (1+ i))+ a9 W. ]9 P* n p w
)
! \5 {6 a* r8 c; e) N)
5 m2 G$ A4 v1 p(defun lss (en / sels ed)7 j O. H; P) Y- A
(setq sels (ssadd))
) f6 ^2 y8 q& y# \. h (while (/= en nil)
* Z! _0 ]: D" U8 T (if (setq en (entnext en)) (setq ed (entget en)))1 P; Y6 N; Z; i9 e; [
(if (/= en nil) (setq sels (ssadd en sels)))
& a7 W" a9 O, ~+ d; r (if (or (= (cdr (assoc 0 ed)) "Polyline"), K- U2 h6 ^. L1 j, p' X
(= (cdr (assoc 0 ed)) "Insert")7 }2 r3 ^: o9 e0 D- g0 O
)
2 P! w u4 [5 a* E (while (/= (cdr (assoc 0 (entget (setq en (entnext en))))) "Seqend"))' ?6 [# W% \4 \, k
)
" Y$ x6 v4 ?0 b r+ z/ V9 I, `; F )
4 L4 @3 G6 d6 C5 d n" k% R sels3 [: x- y! d; f- w3 [; T4 ]& ?
)
" d" u4 Z6 L8 O* C' e+ O5 o* z3 |9 v' F3 ?0 i5 A" J
;;;; ================== CAC FUNCTIONS DUNG TRONG ACAD.LSP ==================
2 l6 O# k1 m. W7 X/ }4 c;;;==================== Tran Ngoc Thang - Sinh 03-05-1976===================& I! ^* \* b3 f& b
G9 A+ R2 p9 t* F A( W" Y; s2 N
(defun c:00 ()(princ "\nChon doi tuong net Defpoints")(ssget)(command "change" "p" "" "p" "la" "Defpoints" ""))6 b) u# v* n2 c& i% `! o9 i" ~$ }
(defun c:0 ()(princ "\nChon doi tuong net 0")(ssget)(command "change" "p" "" "p" "la" "0" "")), |& v4 X( t2 G# r
(defun c:1 ()(princ "\nChon doi tuong net COT")(ssget)(command "change" "p" "" "p" "la" "COT" ""))) k( ^+ a3 K& `6 O( i
(defun c:11 ()(princ "\nChon doi tuong net DIM")(ssget)(command "change" "p" "" "p" "la" "DIM" ""))
8 f$ R: ^" ^ b# k" q q1 h5 ?# m: L(defun c:22 ()(princ "\nChon doi tuong net MANH")(ssget)(command "change" "p" "" "p" "la" "MANH" ""))
3 E! C* k) o+ V, l8 M% C2 Q! u(defun c:33 ()(princ "\nChon doi tuong net NETMANH")(ssget)(command "change" "p" "" "p" "la" "NETMANH" ""))5 U; Z( M- {% {8 Y
(defun c:2 ()(princ "\nChon doi tuong net NETDUT")(ssget)(command "change" "p" "" "p" "la" "NETDUT" ""))8 d# ] _" L& `% `
(defun c:3 ()(princ "\nChon doi tuong net NOITHAT")(ssget)(command "change" "p" "" "p" "la" "NOITHAT" ""))
7 L- P5 r, ^. R1 W3 \(defun c:4 ()(princ "\nChon doi tuong net TUONG")(ssget)(command "change" "p" "" "p" "la" "TUONG" ""))
: \+ z; u7 e2 }- L" [(defun c:44 ()(princ "\nChon doi tuong net KHUNGTEN")(ssget)(command "change" "p" "" "p" "la" "KHUNGTEN" ""))
4 i! |* _0 z; ?(defun c:5 ()(princ "\nChon doi tuong net TIMTUONG")(ssget)(command "change" "p" "" "p" "la" "TIMTUONG" ""))
( L; A, h& B; I4 }9 Q {7 f(defun c:6 ()(princ "\nChon doi tuong net CUA")(ssget)(command "change" "p" "" "p" "la" "CUA" ""))! @& j7 U: l' B7 M. P7 i2 l( M5 b
(defun c:77 ()(princ "\nChon doi tuong net THAY")(ssget)(command "change" "p" "" "p" "la" "THAY" ""))3 Y, x+ j' ~8 C% |, R& v% s
(defun c:7 ()(princ "\nChon doi tuong net NETTHAY")(ssget)(command "change" "p" "" "p" "la" "NETTHAY" ""))
. O5 o, A, {1 g" [, ~(defun c:8 ()(princ "\nChon doi tuong net HATCH")(ssget)(command "change" "p" "" "p" "la" "HATCH" ""))3 s4 _( d3 W6 m; Z- w) v
(defun c:9 ()(princ "\nChon doi tuong net TEXTTXT")(ssget)(command "change" "p" "" "p" "la" "TEXTTXT" ""))
- V' y0 d# g; d# _(defun c:99 ()(princ "\nChon doi tuong net TEXTVN")(ssget)(command "change" "p" "" "p" "la" "TEXTVN" "p" "C" "bylayer" ""))
2 o1 H4 n+ _7 u9 |& E(defun c:td ()(princ "\nChon doi tuong net THEPDOC")(ssget)(command "change" "p" "" "p" "la" "THEPDOC" ""))6 [; G$ D2 |- {: ?' p; F$ _0 d U5 \
(defun c:ddt ()(princ "\nChon doi tuong net THEPDAI")(ssget)(command "change" "p" "" "p" "la" "THEPDAI" ""))9 X' V( }2 _; k) w
* B+ z3 W! A' S! j9 L" a
;=====================================================================
+ h9 g% }/ Y. s8 P. Q;===================DAT Ti Le Theo KHO GIAY BAN VE====================% j3 y. }+ v; J4 _! ~8 G" T9 K
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================/ S2 k( }& U8 `# A8 m7 t
5 X3 n9 e- o8 K3 I$ Y4 F. t
;(defun c:SA6 () (Command "DIMSCALE" "111.11111" ))(princ)2 d: _0 @6 M, y; k, E
;(defun c:SA5 () (Command "DIMSCALE" "1111.1111" ))(princ)
7 C! j3 L# G* H; D3 O3 y;(defun c:SA4 () (Command "DIMSCALE" "1111.1111" ))(princ)
: X8 d5 H0 _% Z' E9 }3 a;(defun c:SA3 () (Command "DIMSCALE" "11111.111" ))(princ)0 Y" F# V# M1 A6 q
;(defun c:SA2 () (Command "DIMSCALE" "111111.11" ))(princ)6 j' R6 C7 C, O0 c
;(defun c:SA1 () (Command "DIMSCALE" "111111.11" ))(princ)
- R9 p4 o1 d9 x% {* K. O$ X& e! M;(defun c:SA0 () (Command "DIMSCALE" "1111111.1" ))(princ)
0 x& h4 a& R! C: k# _
* g0 Z) V/ P9 T# Q. a/ P! |& h;=====================================================================
' \ R2 @/ H3 d, n;===================DAT Ti Le Theo KHO GIAY BAN VE====================, r! I, z8 S6 R; o
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 ================= A; A! Y0 Q- j% L7 X! f. I7 M
* }" p- o. y# W2 X;=============== DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =============- C, [/ i0 @4 B
S5 e {, c- l6 C8 k$ T6 M
;=============== DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =============3 O a* d8 e6 _- u% F
, S9 M6 }& H. @- s% @(alert "Using the NetXuatAnh-[ 5940.00 x 4200.00 <pixels> ] command!")
+ x1 D1 ^5 e) L# Z(princ "\nEnter (DEFUN C:netxuatanh () to get to real LAYER command.\n") (command "NETXUATANH")5 v: {6 h4 p; O" g( B' T
$ f t! h4 z" f;=============== DAT LAYER NET de xuat anh JPG [W x H] [5940.00 x 4200.00] ===DRAW===
% E4 Y0 a% @8 k. p" s6 Z7 } k+ B: i, S4 [
;(DEFUN C:netxuatanh ()
# B* y# ?* M# x# Y9 r) G; K (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.6" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "5" ""
0 a0 K; V( Z: t- _* e6 b+ I "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "1.58" "") Y* `7 s0 N; Q) }3 V; e: ~2 h
"M" "MANH" "C" "9" "" "Lw" "0.5" ""
; {3 D" ]$ d& j9 k7 b$ w "M" "DIM" "C" "1" "" "Lw" "0.6" ""$ k8 P E# W# H1 h5 e
"M" "THAY" "C" "7" "" "Lw" "0.7" ""9 [: f. N/ M% V- @
"M" "NOITHAT" "C" "60" "" "Lw" "0.5" ""; r1 V& i* n/ t, u s, `5 \' B
"M" "HATCH" "C" "5" "" "Lw" "0.35" "". x; Z9 z* Y* ^) g9 O$ w
"M" "COT" "C" "2" "" "Lw" "2" ""* d6 g1 E/ P# i) Z0 K
"M" "Defpoints" "C" "7" ""; r; R0 A4 d5 s. {- _' z0 b" d
"M" "0" "C" "3" "" "Lw" "0.5" ""
$ z% h0 c* v$ k. V0 o. y; "M" "1" "C" "1" "" "Lw" "0.5" ""
8 h2 s9 U6 n2 L' ]4 M, F3 l0 m; "M" "2" "C" "31" "" "Lw" "0.5" "": X, F/ c7 j6 \ c, n I
; "M" "3" "C" "8" "" "Lw" "0.35" ""' Y8 i. M' P6 [3 }% C1 Q
; "M" "4" "C" "4" "" "Lw" "0.8" ""& \0 `' z" ]- A. {$ z' b
; "M" "6" "C" "6" "" "Lw" "0.35" ""
; R/ U( L& Y) w: P& _3 v/ n# o; "M" "7" "C" "7" "" "Lw" "0.4" ""
# A0 ^% \/ {7 h0 ?5 Z; "M" "8" "C" "8" "" "Lw" "0.35" ""( _- p# L/ \- V5 {
"M" "DAY-DIEN" "C" "3" "" "Lw" "0.5" ""
* o! X9 U: _: b C "M" "DUONGBAO" "C" "7" "" "Lw" "1" ""
8 h; g# p/ G6 a8 i; "M" "KE" "C" "8" "" "Lw" "0.3" ""
6 R% W: u' S O _ M0 I3 W. p+ B* N$ l; "M" "KT" "C" "9" "" "Lw" "0.35" ""
2 [0 |+ p; z9 z( j "M" "NETDAM" "C" "4" "" "Lw" "1" "": I# ~2 o" Y6 M( U) }7 _
"M" "NETTHAY" "C" "255" "" "Lw" "0.7" ""
' X; x8 [- V5 K, _. e& d "M" "NETMANH" "C" "43" "" "Lw" "0.5" ""
6 W9 Z$ Z O. B8 c# ` "M" "ThietBiDIEN" "C" "2" "" "Lw" "0.8" ""
6 ~7 A6 C% @' F2 Y6 z" U- P "M" "TEXT" "C" "7" "" "Lw" "1.58" ""
3 D8 A2 c6 M' p2 Z: p "M" "TEXTTXT" "C" "7" "" "Lw" "0.5" ""
( z. s: o i4 R* i* l M7 S# A "M" "TEXTVN" "C" "60" "" "Lw" "0.4" ""
) }! U7 Q: Y5 u4 w) V "M" "TEXTVNi" "C" "60" "" "Lw" "0.4" ""
* j E9 a( B# C "M" "THEPDAI" "C" "3" "" "Lw" "0.7" ""
X1 f5 p! }9 T+ N& J. t "M" "THEPDOC" "C" "2" "" "Lw" "1.58" "": h6 N% Y5 l9 D# C
"M" "CUA" "C" "6" "" "Lw" "0.5" ""! T1 T* h- u2 f. n! d7 V
"M" "CUAMATDUNG" "C" "6" "" "Lw" "0.5" ""$ C6 }/ N- z, n9 `, b
# f( u6 @7 E& `( F: F
;=============== DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] ===NUOC===! e$ M. R% |4 D9 H! m
1 H& }: U6 `: V5 H
"M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.5" ""
! i J6 B( Y" g6 q5 H g5 t "M" "4-WateR_IN" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE1" "" B+ V( o: M, u+ B# U7 g7 |
"M" "4-WateR_OUT" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE2" ""' d- N! U) ~0 n: ]
; "M" "250" "C" "250" "" "Lw" "0.35" ""
# j) N: r( h" S( p3 z. \2 G) u "M" "KHUNGTEN" "C" "4" "" "Lw" "1" "") Y' |. d4 {5 K/ M( W+ Z
"M" "TIMTUONG" "C" "5" "" "Lw" "0.5" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "10" )(princ): J, O3 ^' b! ?" x5 J: T, o
+ f0 H. l1 j: F& l;=============== DAT LAYER TEXT de xuat anh JPG [DIM] [TEXT] [GHI CHU]======
2 r$ z4 m) r. J K# y;===================================30|04|2024==============================8 G1 c/ e: o* I' i* `# R8 n* E. O
) c+ a0 a5 {! J& \' w/ e (Command "-style" "VNi-AUCHON" "vauchon.ttf" "225" "1" "0" "n" "n" )(princ)+ B+ z7 p+ N% ], }
(Command "-style" "VNi-COURI" "vcouri.ttf" "200" "1" "0" "n" "n" )(princ), P3 ?+ @' s1 I$ D
(Command "-style" "VNi-COURIB" "vcourib.ttf" "200" "1" "0" "n" "n" )(princ). U: J* B' O8 d! L, B3 g1 o0 ?
(Command "-style" "Vni-VietNam" "vn_vni,vns.shx" "0" "1" "0" "n" "n" "n" ). Q. e: N4 g$ V8 L/ {
(Command "-style" "Vni-ROMANS-TEXT" "vni-romans,vns.shx" "200" "1" "0" "n" "n" "n" )% h7 `- B. S+ H; a. t& N
(Command "-style" "COTES" "tcvn3italic,vns.shx" "0" "1" "0" "n" "n" "n" )
! ~0 z9 p5 M1 M9 D' b (Command "-style" "TRUC" "impact" "0" "1" "0" "n" "n" )7 d" M8 L- C+ U3 z- n$ N7 l% I' ~
(Command "-style" "VNHELVLT-Hoa" "vnhelvh,vnh.shx" "500" "1""0" "n" "n" )0 ^7 @2 A9 z2 z7 o' ~
(Command "-style" "VNHELVLT-Thuong" "vnhelv,vnh.shx" "500""1" "0" "n" "n" )
' ~5 d# v" _6 _. w/ m (Command "-style" "STANDARD" "Cambria" "250" "1" "0" "n" "n" )% a% F M+ a2 A/ \6 g; o0 R; e9 p
(Command "-style" "CAMBRIA" "Cambria" "200" "1" "0" "n" "n" ). ~* e }/ I& H* ]9 ^% f$ q
(Command "-style" "GHIKH" "romant,vns.shx" "0" "1" "0" "n" "n" "n")
1 [ J/ @0 ?! O (Command "-style" "GHISH" "impact" "0" "1" "0" "n" "n" )/ l8 @8 B+ j0 h& Z5 i4 C
(Command "-style" "ROMANT-DIM" "abcroman,vns.shx" "0" "1" "0" "n" "n" "n" )* Y/ Q6 e! c+ G
(Command "-style" "ROMANC-KhungTEN" "abcroman,vnh.shx" "200" "1" "0" "n" "n" "n" )
" N7 u' J) N0 F# F4 B$ E; } (Command "-style" "ROMAND-TEXT" "abcrom,vnh.shx" "200" "1" "0" "n" "n" "n")
( e/ V/ h8 }9 E* u (Command "-style" "ROMANT-TEXT" "tcvn3italic,vnh.shx" "200" "1" "0" "n" "n" "n" )(princ)
. @0 y4 N- d/ E) g: c u6 k: q. M& w, b2 E) J
;============= DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =DIM-STYLE=
- t% b! \2 F9 C;===================================17|10|2024===================================* e" o9 D& O& w: g5 b) \1 a
; r+ t; O2 f8 J9 H0 r5 B# X
(Command "DIMTXSTY" "ROMANT-DIM" )(princ)
* U. `0 e0 E6 {1 Y3 ?# R1 f (Command "DIMBLK" "Closed" )(princ)
5 x* F) j- n# F8 u
1 I' I) Z$ g8 \$ t;============= DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =DIM-STYLE=
$ J3 t4 z5 o1 O8 ^;===================================17|10|2024===================================$ T7 a2 a$ q+ n1 N! Y& r
: `& m7 a" d" o2 y/ W. x
;(Command "-units" "2" "8" "1" "8" "" "N")! Z& r" F$ r/ r" F& E' [
(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)
! `1 B1 r; o2 Y* Z! [3 p% N
2 M6 D0 H# E7 ~% e+ m;============= DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =DIM-STYLE=% `! h% n2 U; W
;===================================17|10|2024===================================
0 ]& j6 [( ^4 D
8 h6 O9 F7 Z5 Z. |;======== KET THUC - DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =====
9 V/ u7 H) f7 f7 a( i
: w$ B+ A6 }( A+ b- |;======================== DAT NET IN & TI LE BAN VE =============================
$ L4 o2 v* r: h5 {' Q( t& h$ @& d3 q) J& a
;=================LENH VE KHUNG TEN - Tieu Diet Lenh==================
6 Y6 t, p9 }, G! V( B$ W) J' j;=============== DAT KHO GIAY BAN VE - KIEU KHUNG TEN ================
) g5 r. Y7 z6 t- R* y' f/ L;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================0 E Z* W$ ^- \) B: [( {# \$ P9 L/ z
;=============================11|07|2025==============================8 V' {( C* }; _: F7 b1 I2 _9 `" x
;Ti Le Ban Ve - 1 : 100
$ `# @6 E$ N& q) v, _# j _- M(Defun c:kta4 ()
& T0 Z) t" h4 l: r (setq mv_sc 100);Ti le ban ve! E7 L# u, x+ X2 C. e
(setq x4 297)
7 t8 d8 d4 O, T7 _/ v (setq y4 210)
/ V2 _& O6 t# b (setq x4 (* mv_sc x4) % t) w M3 S/ c
y4 (* mv_sc y4) ); P, ]: M2 y% i1 V
(command
$ L0 L/ q+ m, A "LIMITS" "0,0" (list x4 y4)% c) `5 o( I. \; v
"PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C". L1 Q: ~, T; t3 \8 v
;Khung CHU NHAT Chinh B6 s( }& s$ z
"RECTANG" "500,500" "@28700,20000"- P2 Q3 Y3 C6 o- P& u# c, L, u
"RECTANG" "700,700" "@28300,19600"
" V/ I; f! l% U8 o! @;Khung Ten Chung
% [) C. z# b* C/ _ "RECTANG" "700,700" "@8000,1250"/ S4 ^( q: ~6 _$ y7 r$ ^ X5 m9 G
"RECTANG" "700,700" "@17300,2500"
+ l; U: p. J: J: u9 z- [;Ten Ban Ve1 N( C0 ?8 R+ w5 N# W* A9 `
"RECTANG" "18000,700" "@11000,1250"
) O, V7 F& v- F. y: t6 U "RECTANG" "18000,700" "@11000,2500"0 z. \! d" U3 a; B: d7 l' y6 o7 \
;Khung Ti Le + Ngay Thang Nam6 ]& A; [: @& ~+ r
"RECTANG" "22500,700" "@2000,2500"* d6 ^0 V1 c# V: o% r
;Khung CHU TRI: ?' ^1 p& T; P. [5 P( _2 D% _
"RECTANG" "8700,700" "@3800,2500"% o* T5 ^( G) R3 Z6 q0 _$ f
"ZOOM" "_a" ))
9 A. Q( r' a: B6 m: h9 p;=====================================================================
2 r. F+ f* n& j: h) q! t+ D- {;Ti Le Ban Ve - 1 : 100! N- O Z/ C6 b& H7 o" t; o
(Defun c:kt4a ()
# l; y1 G7 i) M! t3 \# [ (setq mv_sc 100);Ti le ban ve
$ ~3 t- W: Z: _0 F" V. e (setq x4 297)" [! q* z- {! l* ^" o
(setq y4 210)
* {0 Y% I# i4 Y5 A (setq x4 (* mv_sc x4)
u! ^4 |& \, X; t5 P* D: ] y4 (* mv_sc y4) )8 x. E# n N& j
(command
: h! k, A' C5 z z- a7 O "LIMITS" "0,0" (list x4 y4)+ _% [4 q' F& s
"PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
) F& m6 M8 K) X;Khung CHU NHAT Chinh $ ]5 l! O5 H: o" i
"RECTANG" "2000,500" "@27200,20000". i+ s! w8 I% X1 m
"RECTANG" "2200,700" "@26800,19600"
0 `" l8 n6 G7 e4 {/ M! I;Khung Ten Chung+ i% ~. w: n. \+ y+ q. Q: Y( Z
"RECTANG" "2200,700" "@6500,1250"1 k2 f3 R/ i/ @8 {4 w1 {" o- `
"RECTANG" "2200,700" "@15800,2500"
7 A5 }0 C0 D+ _" U2 r0 v! i;Ten Ban Ve2 G u, m2 i# s& h1 \' S* q1 G( u
"RECTANG" "18000,700" "@11000,1250"$ p; ^& j$ T; ^4 C m' c
"RECTANG" "18000,700" "@11000,2500"1 t" d7 O3 w' ?. e/ r
;Khung Ti Le + Ngay Thang Nam& k0 \$ [% q" x2 {5 ]
"RECTANG" "22500,700" "@2000,2500"6 e9 z% R0 V' G% h
;Khung CHU TRI1 h a! Y8 i1 q5 L
"RECTANG" "8700,700" "@3800,2500"
; A) |" k) U8 U. Q "ZOOM" "_a" ))
8 f: o! T2 d( z/ q0 S: f X+ s+ C, T6 v v% q/ z. }
;=================LENH VE KHUNG TEN - Tieu Diet Lenh==================0 g, l4 M8 t; Q! h
;=============== DAT KHO GIAY BAN VE - KIEU KHUNG TEN ================
, p+ ]; \6 R' B7 q;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
) I) i! z; ?: Y$ _3 Z;=============================04|07|2026==============================
& p; u7 `9 T& S" i4 C8 Z+ k/ {;Ti Le Ban Ve - 1 : 100* |8 Q% M7 P& ~( x# N. K
(Defun c:za4 ()
! a& D% ?( a' f$ `+ g: Z (setq mv_sc 100);Ti le ban ve# {! V r4 n% j
(setq x4 297)
" h" k/ i2 [. F; _- ~2 b5 L (setq y4 210)
1 o+ R/ ~. d& |1 z) X (setq x4 (* mv_sc x4) / |( z% Y& Q/ M+ y0 g9 q
y4 (* mv_sc y4) )
0 E) ~* ^1 }' x (command
& z* {. f% `( M8 r "LIMITS" "0,0" (list x4 y4)7 v8 U8 F0 C* p4 `& n8 }
"PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
, ?1 H6 h; Z& ~( _, h;Khung CHU NHAT Chinh 5 M4 r. [/ c% o
"RECTANG" "500,500" "@28700,20000"( ?3 V5 A# T: V
"RECTANG" "700,700" "@28300,19600"6 u+ X) |$ e' S- h% p
;Ten Ban Ve
8 b0 n7 ~. C2 n! L' i, K" I8 _2 M. e "RECTANG" "24500,700" "29000,1950"$ D0 w& J- \5 r1 ]/ h
"RECTANG" "24500,1950" "29000,3200"0 S# G: f( v, }3 s" \( U8 p* F
;Khung Ti Le + Ngay Thang Nam
8 }3 Z( D4 H0 S. R2 b @ "RECTANG" "24500,3200" "26750,4450"
! t; p& T' O- W/ { "RECTANG" "26750,3200" "29000,4450"
3 U. v' y/ U. c/ P;Khung Kiem Tra9 O _) q' x; I' y3 A
"RECTANG" "24500,4450" "29000,6325"2 f5 [: R" D" o5 Z' y
;Khung Thiet Ke1 P+ T1 {$ ^" B" a1 _9 W* Z
"RECTANG" "24500,6325" "29000,8200"
' j9 F( B4 \( P% a" |;Khung CHU TRI
% q7 X' B4 N7 U6 q/ b) b$ { "RECTANG" "24500,8200" "29000,10075"
& F, K5 `9 r! u9 M;Khung GIAM DOC
1 c! ^$ P: u7 v0 b6 j* y "RECTANG" "24500,10075" "29000,11950"/ B B X; r; j$ \9 v
;Khung HANG MUC
$ O. D1 i( S, n1 l9 K( U "RECTANG" "24500,11950" "29000,14450". D7 j3 D+ ]+ a3 X1 f- j. X" [- k/ a7 n
;Khung CONG TY
; d2 X" I" W& N, S" b3 { "RECTANG" "24500,14450" "29000,16950"
1 ]2 \7 M9 b& K; ~5 V2 m;Khung REPAIRE
! ]4 V) N+ W' u2 L8 @5 |; ~ "RECTANG" "24500,16950" "29000,18125"
) {- F; q! @( m7 D$ I "RECTANG" "24500,18125" "29000,19300": b8 A* `! R5 B) Z$ t# I0 }' n
"RECTANG" "24500,19300" "29000,20300") G/ h% X, K% f. N/ x; A
"RECTANG" "25500,16950" "25500,20300"* v/ X( H: \! e8 ?3 P4 o) g$ V
"ZOOM" "_a" ))8 f9 ]7 L% @' p7 j$ T
;=====================================================================) I- R+ }( P! D
;Ti Le Ban Ve - 1 : 100' K, Z3 M9 y9 [9 I$ I
(Defun c:zb4 ()/ T* a: p' j, |# @
(setq mv_sc 100);Ti le ban ve
& y9 @4 }4 j/ Q& b, V" j4 k. K" ~ (setq x4 297)
6 h. T: _) N0 U/ l: j4 ^ (setq y4 210)8 ]) s! S6 q% g
(setq x4 (* mv_sc x4) 1 i; i- Z0 [0 A7 k. K; m
y4 (* mv_sc y4) ): {' x; g/ C: Y h( J/ u
(command
4 o& S$ j: o* J5 o+ g1 F8 }7 A "LIMITS" "0,0" (list x4 y4)
$ Q1 m6 I$ R0 C9 A1 ^, C( D- C "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"4 z( A4 B% [- y7 ]$ j4 n! N1 G
;Khung CHU NHAT Chinh 5 e- t5 |1 _* P! Q8 @
"RECTANG" "2000,500" "@27200,20000"
/ J& L2 o4 F( O q2 E "RECTANG" "2200,700" "@26800,19600"0 {( m. d1 G- p" C. {
;Ten Ban Ve. V3 ~4 r7 n* e0 n$ J+ _$ @0 f* q$ M
"RECTANG" "24500,700" "29000,1950"
0 _( j- Q! O* {" a. |- B( [& z1 k "RECTANG" "24500,1950" "29000,3200"
) R6 Z. L! z7 A3 w;Khung Ti Le + Ngay Thang Nam G) ]& t3 x% e5 r" y% H. j
"RECTANG" "24500,3200" "26750,4450"
4 @. x# u3 C, Z "RECTANG" "26750,3200" "29000,4450"' _- I0 B4 P* y+ r
;Khung Kiem Tra
8 ^, ]- O* o' t$ p) N "RECTANG" "24500,4450" "29000,6325"
: J) P& w1 |2 o! i3 J. d;Khung Thiet Ke0 C0 h! t: U6 m$ Y- o$ J
"RECTANG" "24500,6325" "29000,8200"
. h( U* }2 S( {1 j% V, s0 x5 w;Khung CHU TRI, X- P1 F& f% K/ _; s6 @4 S, M
"RECTANG" "24500,8200" "29000,10075"
1 W* C; |+ Y: q* N7 F# k* d;Khung GIAM DOC
0 ?7 J$ R" ?' |. U. f "RECTANG" "24500,10075" "29000,11950"9 W3 K7 f4 K( W! Y/ {
;Khung HANG MUC
]' w; L! p1 ? y "RECTANG" "24500,11950" "29000,14450"* T' e& p1 a( ^: u1 Z4 m. r+ V3 n
;Khung CONG TY
( O7 X$ i+ @0 v! ^ "RECTANG" "24500,14450" "29000,16950"2 x/ L& j3 v6 V3 d0 j' V
;Khung REPAIRE/ o* D4 p$ Z/ F) n7 N8 }
"RECTANG" "24500,16950" "29000,18125"" L/ E% s( p+ ?% w/ x4 E9 ]
"RECTANG" "24500,18125" "29000,19300". i; V$ w: I' m
"RECTANG" "24500,19300" "29000,20300"
3 f5 j, c, W* H+ F' {7 ~/ s9 a, f# P "RECTANG" "25500,16950" "25500,20300"" ?* }* k1 L! }6 R9 f
"ZOOM" "_a" ))
: a6 r! H4 z6 {+ X r$ ^2 `( k
$ p1 A+ d- o% B* P;;; ============================GHI CHU Khung Ten========================& C; k! g3 [. C$ Z$ D3 B
;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========
/ t. U. v- _. O1 L0 };;;=============== Tran Ngoc Thang - Sinh 03-05-1976 ====================
6 f9 M6 ^3 ~: s ^ H7 \;;; =======================Thuong Dung Font Romant.vnh===================5 ^3 t# ]5 D% n3 r! i3 O4 U) f
1 Y- U+ Z0 s: B(defun c:GhiChu (/ pta ptb ptc ptd X Y X1 Y1 rmsz pl1)
/ ?- l6 C& d2 g c (setq oer *error* *error* err2)
+ L4 L f5 F" p# t) n (PROMPT "\nChuTri. ThietKe. KiemTra. TiLe. Ngay. HangMuc. QuyMo. KieuNha. CongTrinh. KyHieu. TenBanVe. Kts. TranNgocThang. "); ^5 q6 J3 k+ Q/ k) q1 k5 q) j" V
(SETQ Cpt(GETSTRING "\n(CT). (TK). (KT). (TL). (Ng). (HM). (QM). (KN). (CTr). (KH). (TBV). (Kts). (TnT). "))* \4 X3 b- n/ K- W) d4 E0 G/ f$ L, i
(IF(OR(= Cpt "QM")(= cpt "qm"))(SETQ CPT ' "Hå S¬ ThiÕt KÕ Nhµ D©n Dông quy M« :"))
6 H, p8 q% L2 ^6 y6 C/ A# n (IF(OR(= cpt "KN")(= cpt "kn"))(SETQ CPT ' "2 TÇng 1 Tum Thang"))
+ e- {- h* E% T (IF(OR(= cpt "CT")(= cpt "ct"))(SETQ CPT ' "Chñ Tr× :"))
4 C" y9 P' s; V( `5 D5 v (IF(OR(= cpt "HM")(= cpt "hm"))(SETQ CPT ' "H¹ng Môc :"))
, s/ G$ ?4 |# O' c: d" r (IF(OR(= cpt "CTr")(= cpt "ctr"))(SETQ CPT ' "Nhµ ë Gia §×nh - Nhµ LiÒn KÒ"))" f& k, l& D9 T/ D$ E+ u# w0 I! D
(IF(OR(= cpt "TK")(= cpt "tk"))(SETQ CPT ' "ThiÕt KÕ :"))
2 z! C6 Z) O4 n3 v (IF(OR(= cpt "KT")(= cpt "kt"))(SETQ CPT ' "KiÓm Tra :"))" ~$ u% f3 G; f6 T- P" y- ~5 {
(IF(OR(= cpt "TL")(= cpt "tl"))(SETQ CPT ' "TØ LÖ :"))
+ Q' [9 z5 {4 P- l (IF(OR(= cpt "KH")(= cpt "kh"))(SETQ CPT ' "Ký HiÖu :"))/ K$ E4 c; i. x
(IF(OR(= cpt "TBV")(= cpt "tbv"))(SETQ CPT ' "Tªn B¶n VÏ :"))* t7 ^0 n9 W& f
(IF(OR(= cpt "Ng")(= cpt "ng"))(SETQ CPT ' "Ngµy :"))
0 r, ?6 ]9 P, z8 T+ D8 Q9 b (IF(OR(= cpt "Kts")(= cpt "kts"))(SETQ CPT ' "Kts. TrÇn Ngäc Th¾ng"))
: |" H4 _& x1 b& x( { (IF(OR(= cpt "TnT")(= cpt "tnt"))(SETQ CPT ' "TrÇn Ngäc Th¾ng"))7 W D O E, R0 O
(setq pta (getpoint
% K% \+ T6 C! L5 ] "\nPick first corner. : "))
, Z+ x( U7 B# R! Y* P (setq ptb (getcorner pta- n" z- v5 @1 i
"\nPick second corner. : "))8 ?: I" \, \& v
(setq ptc (list (car ptb)(cadr pta)))
! H5 {2 b$ G0 h& b (setq ptd (list (car pta)(cadr ptb)))
$ a8 W! }2 h. @& X (setq ang (angle pta ptb))% K3 L" c9 L7 g. X" O
(setq d1 (/(distance pta ptb) 2))
7 D' H: U, F6 F5 X7 W (setq cp (polar pta (- ang (dtr 0)) d1))
4 V! @1 d8 k; \# | (setq X (distance pta ptc))$ J# Q ~3 j. Y3 o X
(setq Y (distance pta ptd))0 I" N! I& K7 H9 j; G* }+ {
(setq X1 (rtos x 2 1))& o2 x z. Z2 G9 E: ~
(setq Y1 (rtos y 2 1))
" @, S: I \; |+ @9 I (setq rmsz (strcat "(" X1 " x " Y1 ")"))
& w2 J% x: f% s! e1 k5 u4 S. [; i (command "TEXT" "c" cp "0" CPT "text" "" rmsz))0 x( H& ~7 {' V. K2 f2 E |
(defun dtr (angg)
; Y- v M) t5 t! _ (* pi (/ angg 180.0)))! x4 p, R# a3 u! k( [) T3 {
/ |. n$ [& Z. O9 Q* j
;;; ============================GHI CHU Khung Ten========================- h* B5 ]/ t/ d0 E ^
;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========( k3 q- B5 U3 [) E& `
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 ====================; v: G$ s! \: M
;;; =======================Thuong Dung Font Romant.vnh===================& V$ @0 P, K' d, f) W
# \' `# k+ t& a7 `) V
(defun c:iit (/ pt str pta ptb ptc ptd X Y X1 Y1 rmsz pl1); m: I, ~: z4 p. q. @
(setq oer *error* *error* err2)( z7 Q6 |1 N; l+ t$ ]3 s8 b
(if (not h_text) (setq h_text 250)) ; Kích thuoc chu mac dinh là 2.5
* _4 a8 g9 S& u+ B& h8 Z( e* e
$ h1 I2 j7 ~- |6 h( v8 E" k (setq ht (getreal (strcat "\nNhap chieu cao chu <" (rtos h_text) ">: ")))
u( J6 t( T( X/ w" U; M
Z' `2 g# [1 X# ~7 G (if ht (setq h_text ht))! r" `" T0 y% Z# \
( o; x0 F( e! j9 _: j& s" I [
) P: c3 Z3 y8 e4 Z. v4 X* C, f
(setq ang (getreal "\nNhap goc nghieng moi (do) <0>: ")). ?3 }% ]* Y+ w; o
* w+ u) M; y5 w5 \" L (if (not ang) (setq ang 0.0)); u% `5 j/ P( d& u
- V" L( s7 P" w5 v7 H) w& B
/ q' f A: C5 Y; n8 {
1 N) q1 Y4 B2 [7 h' L/ Y
(setq pta (getpoint4 J: r: ~# M1 g5 F
"\nPick first corner. : "))) X8 j% b/ y3 Z; U
(setq pt (getcorner pta. q( z! U+ P( s) r' r
"\nPick second corner. : "))8 k1 [2 v% a( E" Z( l
. |* v; J' B; O: [+ q0 c
P" M+ b' T$ j$ C! t* I
(command "TEXT" "j" "M" "4700,2575" "0" (SETQ pt ' "Hå S¬ ThiÕt KÕ Nhµ D©n Dông Quy M«") ) (princ)' }6 |: {/ N# w" N+ y1 p8 b7 W
/ _& O8 Q1 ^; {; g& T3 a
(command "TEXT" "j" "M" "4700,1325" "0" (SETQ pt ' "2 TÇng 1 Tum Thang") ) (princ)
! P: O0 p" M/ `( V; c: l/ b; W9 E# l2 _! h
(command "TEXT" "j" "M" "10600,2850" "0" (SETQ pt ' "Chñ Tr× :") ) (princ)3 t a% g: g0 c
+ P, J; m/ t) v5 M0 U" X- t
(command "TEXT" "j" "M" "10600,1100" "0" (SETQ pt ' "TrÇn Ngäc Th¾ng") ) (princ)# w1 A" o9 H! Q! U
& E" y. Z) {$ M (command "TEXT" "j" "M" "15250,2575" "0" (SETQ pt ' "H¹ng Môc :") ) (princ)- t2 v0 a+ e% z' r) n6 X, f ~
$ R" ^ a5 `3 z2 V (command "TEXT" "j" "M" "15250,1950" "0" (SETQ pt ' "Nhµ ë Gia §×nh . Nhµ LiÒn KÒ") ) (princ)" k1 h7 d# ^7 X4 F! Z
& O0 N3 u9 }$ v& \3 E
(command "TEXT" "j" "M" "15250,1100" "0" (SETQ pt ' "Tel : 09.76.89.12.94") ) (princ)7 d. Y3 L8 G, g- F1 K4 D
}1 r9 u8 F* M( u; p- _
(command "TEXT" "j" "M" "20250,2850" "0" (SETQ pt ' "ThiÕt KÕ :") ) (princ)
- A4 m( b+ ?- U. o$ K" Z% R
) a0 P- R' w6 y& P8 `. l' e (command "TEXT" "j" "M" "20250,2300" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)
0 T/ \4 t* i$ R/ B/ ~& d" P) F! f4 d9 `# @, K- ]2 k `
(command "TEXT" "j" "M" "20250,1600" "0" (SETQ pt ' "KiÓm Tra :") ) (princ)( x& o" ~- Y! E, u( |- }! i
8 x( m6 d9 Q" o$ [' q4 l* a* A (command "TEXT" "j" "M" "20250,1100" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)% K0 b+ W: k# _ ?% R8 Y R# j
9 R' X4 o1 d4 x! g6 y; S
(command "TEXT" "j" "M" "23500,2850" "0" (SETQ pt ' "TØ LÖ :") ) (princ)
; g. a% g5 K: B2 e/ G- m7 n
7 I1 E8 p* v3 @* b7 i (command "TEXT" "j" "M" "23500,2300" "0" (SETQ pt ' "1:75") ) (princ); o: a R: A+ b% `* [1 P5 D: F
% }# ]% F& D4 f& {, I (command "TEXT" "j" "M" "23500,1600" "0" (SETQ pt ' "Ngµy :") ) (princ)
. F1 t2 o7 L( ^" b5 c( m7 h; E* x2 n$ N/ o+ n2 Q0 ]
(command "TEXT" "j" "M" "23500,1100" "0" (SETQ pt ' "2026.07.02") ) (princ)
& Q3 i# D5 b' R8 C; T5 B( l) G( z. Y8 k4 j! {% J$ W0 J
(command "TEXT" "j" "M" "26750,2850" "0" (SETQ pt ' "Tªn B¶n VÏ :") ) (princ)
" m& p9 c! @+ ^$ z' J( H: I; o6 {) y1 T5 E% R4 B$ X
(command "TEXT" "j" "M" "26750,2300" "0" (SETQ pt ' "MÆt B»ng TÇng 1 + 2") ) (princ)
, b9 F1 Z8 A; {' I$ o) v2 Q" t! t4 w2 ^
(command "TEXT" "j" "M" "26750,1600" "0" (SETQ pt ' "Ký HiÖu :") ) (princ)
5 W% c! r; K4 j
% u2 {2 F- ^3 s1 J1 u (command "TEXT" "j" "M" "26750,1100" "0" (SETQ pt ' "KT-01") ) (princ)' w+ r' T( ~& T p: P" P0 Y
* G9 X% x9 E. b$ b' d$ m (setq ptc (list (car ptb)(cadr pta)))- Y; a" N* C5 x& t. v, `
(setq ptd (list (car pta)(cadr ptb)))& L; r, I6 j3 {2 o/ R+ |- Y
(setq ang (angle pta ptb))
$ G/ [+ J2 |) K! P1 w" \ (setq d1 (/(distance pta ptb) 2))
7 e2 N& o$ o8 N* Y7 C& n1 f (setq cp (polar pta (- ang (dtr 0)) d1)); U% g7 C9 I1 K# m5 R) m) R" G( k
(setq X (distance pta ptc))
& F1 H$ p7 Z# d; n3 v6 A (setq Y (distance pta ptd))& a2 h* C- X; `8 O
(setq X1 (rtos x 2 1))- L# l+ _- ]5 p4 ?) C5 l2 c# L. B# w0 a% K
(setq Y1 (rtos y 2 1))
$ h9 Z2 m- L' n) `! V9 @, Y (setq rmsz (strcat "(" X1 " x " Y1 ")"))
3 K7 R# K, i1 y$ W9 x& r8 V; ?4 I (command "TEXT" "c" cp "0" CPT "_text" "" rmsz))! k7 n* a" A/ ^& N$ u
(defun dtr (angg)" E1 C0 M$ q6 p# C
(* pi (/ angg 180.0)))
8 b2 \, o- o6 r/ S$ p$ N+ l: ~3 @4 q6 K& l+ ?
;;; ============================GHI CHU Khung Ten========================$ Z E% Y9 M5 ^0 I! C# \- g
;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========3 v3 X5 [4 i2 B' }* k4 x# U
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 ====================# v/ b3 T5 J' s u
;;; =======================Thuong Dung Font Romant.vnh===================9 F8 |# l, S2 }* I, k0 p, G
; G9 E& [6 F6 m
(defun c:ipt (/ pt str pta ptb ptc ptd X Y X1 Y1 rmsz pl1)
6 C8 V, D$ }* D3 f( K% f (setq oer *error* *error* err2)
2 E- `5 S* Z7 p$ M) N% c) ? (if (not h_text) (setq h_text 250)) ; Kích thuoc chu mac dinh là 2.5& m; V+ H X8 y& L2 z
4 G; I5 l7 S l1 D. a
(setq ht (getreal (strcat "\nNhap chieu cao chu <" (rtos h_text) ">: ")))9 A6 k/ f& t* C, c E2 d$ M
. D- v$ U: w: C9 X+ N" o) X (if ht (setq h_text ht)) \' }( Y4 Y, i7 q5 A
6 h. l6 D0 c% o5 G7 t S# |
2 ?; T* |8 W9 v4 K8 F3 t0 N C(setq ang (getreal "\nNhap goc nghieng moi (do) <0>: "))/ M5 T1 ~& b o6 m( O
( D$ [7 B# ]9 ~+ q$ q: ? C (if (not ang) (setq ang 0.0))
1 Z+ D& }* M1 u# B z+ c' ]; A$ W* J, g6 ]) h& C
+ A! i/ I# @# C3 T' _% f" i
! d" N4 ?; i( D- n: ]& Y# } (setq pta (getpoint; ], M% ^, e# P# K: A8 E
"\nPick first corner. : "))$ X% u* u" Y6 L! ?5 k% s, j
(setq pt (getcorner pta f6 G+ d4 D3 p3 V7 M
"\nPick second corner. : "))- B! N" T b. M% F0 {
' _6 G: A) t; |' i3 Y
, [5 ^; ~7 i' z+ _/ Z% {; p3 f' ]
(command "TEXT" "j" "M" "5450,2575" "0" (SETQ pt ' "Hå S¬ ThiÕt KÕ Nhµ D©n Dông Quy M«") ) (princ)8 |) `$ L( y" \
- I) T7 `+ L% S, p, m (command "TEXT" "j" "M" "5450,1325" "0" (SETQ pt ' "2 TÇng 1 Tum Thang") ) (princ), u7 W; X6 { b, x% l. k8 l, p
" u( c; `& o" a; p: K- J (command "TEXT" "j" "M" "10600,2850" "0" (SETQ pt ' "Chñ Tr× :") ) (princ)5 P2 B: d1 L/ l, F
0 j5 ^9 l5 x( t3 f. a7 |
(command "TEXT" "j" "M" "10600,1100" "0" (SETQ pt ' "TrÇn Ngäc Th¾ng") ) (princ)0 D$ u t D" E$ Y
; Z" b3 @8 ~6 Z) [" ~; j
(command "TEXT" "j" "M" "15250,2575" "0" (SETQ pt ' "H¹ng Môc :") ) (princ), J' d( Z, ]2 H2 Q1 Z
O6 Y( w! e! {$ ^5 V$ Q (command "TEXT" "j" "M" "15250,1950" "0" (SETQ pt ' "Nhµ ë Gia §×nh . Nhµ LiÒn KÒ") ) (princ)
$ b# |5 X J, x/ m6 C8 Z% P
/ `; D6 z1 Q) y7 }( t) x4 \ (command "TEXT" "j" "M" "15250,1100" "0" (SETQ pt ' "Tel : 09.76.89.12.94") ) (princ)
8 L- ^0 n. I6 s5 g! ^: d" v8 `: ~% Z" U' X+ G/ r1 J
(command "TEXT" "j" "M" "20250,2850" "0" (SETQ pt ' "ThiÕt KÕ :") ) (princ)
7 h/ ]6 c! w+ n$ @, q8 Y& a" a- }( \4 z9 M$ `& x
(command "TEXT" "j" "M" "20250,2300" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)
$ C* g4 K; [( }! N! Y+ N% C: {
0 N# T d6 u3 [" m (command "TEXT" "j" "M" "20250,1600" "0" (SETQ pt ' "KiÓm Tra :") ) (princ)2 W+ L8 E, C8 q% _
* D1 r& W# J4 I/ |) ^" B
(command "TEXT" "j" "M" "20250,1100" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)
% N2 Z0 b6 u( ~* C! ]& L* R [- [; R% Y0 p0 ?9 p/ Q6 `9 O
(command "TEXT" "j" "M" "23500,2850" "0" (SETQ pt ' "TØ LÖ :") ) (princ)
) V, Z3 J' ?5 b2 s& N4 d
8 K1 f- [8 w# j1 e6 R Z: p7 I. g+ D9 m (command "TEXT" "j" "M" "23500,2300" "0" (SETQ pt ' "1:75") ) (princ)
5 i9 f \: c. U6 v m( O5 M! h
(command "TEXT" "j" "M" "23500,1600" "0" (SETQ pt ' "Ngµy :") ) (princ)' q& [; z% ^0 C. n
/ ~$ w Y3 u5 e5 c. r( x1 e
(command "TEXT" "j" "M" "23500,1100" "0" (SETQ pt ' "2026.07.02") ) (princ)
+ }' c- r/ n( V! b& X0 e* e8 |" x5 g1 s8 n" S
(command "TEXT" "j" "M" "26750,2850" "0" (SETQ pt ' "Tªn B¶n VÏ :") ) (princ)! k; G0 e7 W# B/ T# n
' X1 p9 W, W5 j6 Z* n5 b; m
(command "TEXT" "j" "M" "26750,2300" "0" (SETQ pt ' "MÆt B»ng TÇng 1 + 2") ) (princ)( ?8 e4 p- g# l2 w5 `+ S; J
8 e0 C1 }" J' x: t7 t# i" j6 a ~ (command "TEXT" "j" "M" "26750,1600" "0" (SETQ pt ' "Ký HiÖu :") ) (princ)* g6 I; Y5 O- h- m. l1 o
+ K8 ]- n/ f( y6 X (command "TEXT" "j" "M" "26750,1100" "0" (SETQ pt ' "KT-01") ) (princ)
- o) d# K4 H5 c) N6 x# r3 k! a; O2 h8 h% a
(setq ptc (list (car ptb)(cadr pta)))1 `7 {4 B/ H; J; N# ?
(setq ptd (list (car pta)(cadr ptb)))
, ^. \: s6 h. ~6 m: o2 k' X$ [5 D (setq ang (angle pta ptb))
8 f4 ~ L6 G T2 p5 s; Z: ?" T8 } (setq d1 (/(distance pta ptb) 2))$ I* Z+ v) p2 D3 W! I# }$ Z# ]
(setq cp (polar pta (- ang (dtr 0)) d1))
& g9 D0 w7 @, z7 | (setq X (distance pta ptc))+ `: b2 a; f# R, N/ r" a
(setq Y (distance pta ptd))7 q* q* R7 V0 i5 F# H, |3 k* j
(setq X1 (rtos x 2 1))# _; i1 [: e9 u9 G, @7 w+ ~0 Z; y
(setq Y1 (rtos y 2 1)). e& y d2 R8 ^5 p, d: e' H/ C
(setq rmsz (strcat "(" X1 " x " Y1 ")"))% L5 g0 k. v/ G: \
(command "TEXT" "c" cp "0" CPT "_text" "" rmsz))1 L9 Q, ~. z7 w9 j$ L5 ] I2 ~
(defun dtr (angg)
- i5 q6 ^4 L; } a u) u3 I (* pi (/ angg 180.0)))
* Z3 K, o/ R' g8 X% i& I( N9 I0 A+ {( [0 i
;;; ============================GHI CHU Khung Ten========================
1 r5 |3 ]7 k: w" i;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ======== N; y% m: O2 b5 h1 i6 m, |, e
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 ====================
$ g' C* x( b. A;;; =======================Thuong Dung Font Romant.vnh===================
) }7 N, |$ y2 T
$ P8 w; q7 r9 _, G" @0 f' o(defun c:iza (/ pt str pta ptb ptc ptd X Y X1 Y1 rmsz pl1)
& G; u9 ~" Q4 J! v (setq oer *error* *error* err2) j7 x. r2 V( ^$ S7 ]' g. A6 V
(if (not h_text) (setq h_text 250)) ; Kích thuoc chu mac dinh là 2.5
" U# {$ s$ |9 `3 v5 L: H9 z) q4 U8 E6 Q/ g
(setq ht (getreal (strcat "\nNhap chieu cao chu <" (rtos h_text) ">: ")))6 {- e8 L6 H: G+ |' B6 Y4 b
+ j; D- I6 _% r- o$ x
(if ht (setq h_text ht))7 v5 u0 q2 B/ n3 k4 |0 D# N, K' |# b
3 ?7 v. ?, @6 p& n3 X
0 g7 X; }* {- C/ F7 i(setq ang (getreal "\nNhap goc nghieng moi (do) <0>: "))
0 Z3 n9 }% Q, \( n2 j7 M( m; P9 i0 u% G( U; U6 ]' {
(if (not ang) (setq ang 0.0))
; Y+ C% s& ?1 U4 Y& X( ~2 X" t7 X% M/ g, {4 Z" C8 O% M
2 X! [: @ r1 g% q) ^" U% [1 ]
4 b& h' y. k' x
(setq pta (getpoint$ O: g( ?1 d' l1 c1 q
"\nPick first corner. : "))
8 q5 e. X( \: H# @0 e (setq pt (getcorner pta3 y4 ]; g* ]5 m* Z o
"\nPick second corner. : "))5 `5 ]- [) ]0 Q; L( k- R
1 u5 P. ?# z( N2 v# j
8 J. k% a4 d& y1 G% E
0 h! P7 e+ h; a# A' Y: ^% X9 @ (command "TEXT" "j" "M" "25000,19800" "0" (SETQ pt ' "STT") ) (princ)
" ]- i# }5 }2 h1 s& c) Y; |# w0 Z. L4 B- M5 V- a4 H! F
(command "TEXT" "j" "M" "25000,18712.5" "0" (SETQ pt ' "1") ) (princ)
4 _2 M( U x9 l. @7 m3 {! n3 D* _6 F3 S$ _
(command "TEXT" "j" "M" "25000,17537.5" "0" (SETQ pt ' "2") ) (princ)
) X2 ?. ]0 Y5 u1 D; l* _) I* i2 o3 u- T1 V
/ R/ B$ n1 E6 s1 {3 L6 a/ z% S (command "TEXT" "j" "M" "27250,19800" "0" (SETQ pt ' "Ngµy Söa Hå S¬") ) (princ)
2 _- a ?4 i& s
8 F; d& s* t! O# p* G* T3 V0 } (command "TEXT" "j" "M" "27250,18712.5" "0" (SETQ pt ' "15.05.1997") ) (princ)9 R) u& m. L, I1 b5 }" S
3 |2 W z8 k" f' U" u7 p
(command "TEXT" "j" "M" "27250,17537.5" "0" (SETQ pt ' "04.07.2026") ) (princ)
, i- C: B) e& F8 o; r. q' d9 G. {7 D
* A, g4 ~, f6 h2 u5 K# @ (command "TEXT" "j" "M" "26750,16600" "0" (SETQ pt ' "C¤NG TY - Corporation") ) (princ)4 i! v8 f: T w
" ^7 K2 K5 g% j, ~( W% n( d& P9 x G( ~
(command "TEXT" "j" "M" "26750,16016" "0" (SETQ pt ' "ZENNI.S.Z.T.K") ) (princ)1 H5 e( ?5 a) l9 y4 e
6 I4 R1 s0 \0 ~$ e7 f (command "TEXT" "j" "M" "26750,15433" "0" (SETQ pt ' "§Þa ChØ C¤NG TY") ) (princ)
x t# c8 T3 S! z' i0 B9 g# B' M! C2 K2 B* D* }4 e
(command "TEXT" "j" "M" "26750,14850" "0" (SETQ pt ' "§Þa ChØ : 00.00.00.00.00") ) (princ)/ j' u, B# V. H/ B/ L
0 n% i6 [, t Q6 o6 ?
: ~4 A( K- Y7 O! Y3 x# ?' m7 r (command "TEXT" "j" "M" "26750,14100" "0" (SETQ pt ' "H¹ng Môc : Part Project") ) (princ): k+ n3 e1 E6 u `
0 A# ^0 N5 X' r2 {- K
(command "TEXT" "j" "M" "26750,13516" "0" (SETQ pt ' "Nhµ ë Gia §×nh") ) (princ)5 X, D/ G% R$ C+ d' J2 x, s5 f; ?
5 m5 z5 [* L& q, O (command "TEXT" "j" "M" "26750,12933" "0" (SETQ pt ' "Nhµ LiÒn KÒ") ) (princ)8 B! N: @- b* ]' z3 a
% B- k4 ]2 ]/ Y. n8 ?
(command "TEXT" "j" "M" "26750,12350" "0" (SETQ pt ' "Tel : 00.00.00.00.00") ) (princ)4 e m& ?9 z% P" H" _
: h! H# N5 j. G N
- _, `( ?+ ~" ?( y7 l% t# f. U (command "TEXT" "j" "M" "26750,11600" "0" (SETQ pt ' "Gi¸m §èc : Director") ) (princ)
& @5 u5 D0 M! j, p3 y8 p2 L6 s- b* t& I) }
(command "TEXT" "j" "M" "26750,10475" "0" (SETQ pt ' "ZENNI.S.Z.T.K") ) (princ)' o; h- U5 V( f$ V3 w
& C0 i2 e* r; S H1 T/ f* T (command "TEXT" "j" "M" "26750,9725" "0" (SETQ pt ' "Chñ Tr× : Main Project") ) (princ)
% Y# e* _. N0 j/ H+ m, N
3 S' b# z. N, R- a2 U# Z (command "TEXT" "j" "M" "26750,8600" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)0 c$ H+ F8 }! Z& z
2 L s5 o6 F% c& h% t. q1 M0 j (command "TEXT" "j" "M" "26750,7850" "0" (SETQ pt ' "ThiÕt KÕ Vµ VÏ : Design") ) (princ)- j% D0 h$ l1 L4 R. x; r
3 D4 x9 G( p% ]: z' g! q. |
(command "TEXT" "j" "M" "26750,6725" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)
+ E* w$ [$ @. T# N+ q O3 C% D+ d/ N3 r0 M8 v/ l9 b$ V
(command "TEXT" "j" "M" "26750,5975" "0" (SETQ pt ' "KiÓm Tra : Checking") ) (princ)
! R2 o2 c; s: c5 q" Z4 h) m9 j
5 g3 ^4 m* {4 l: r4 N0 N (command "TEXT" "j" "M" "26750,4850" "0" (SETQ pt ' "Kts. TrÇn Ngäc Th¾ng") ) (princ)
D0 b' E/ [1 O8 g
/ Z+ X" p$ E3 G7 x& b- C: o. }! P' }0 r$ P/ X, C! q
! B$ R/ K9 G8 U, }) D
(command "TEXT" "j" "M" "25625,4100" "0" (SETQ pt ' "TØ LÖ-Khæ") ) (princ)
$ @8 [. n0 [1 d1 Y+ B
5 B7 H8 U7 W% f. }0 r (command "TEXT" "j" "M" "25625,3600" "0" (SETQ pt ' "1:75 - A4") ) (princ). w5 ~) m! y9 L. f: e5 U: S6 _
! U" d6 {+ ?8 a3 k
(command "TEXT" "j" "M" "27875,4100" "0" (SETQ pt ' "Ngµy Xong :") ) (princ)
! t* f0 k9 O; T L% n0 q( E8 b' M6 v# H
(command "TEXT" "j" "M" "27875,3600" "0" (SETQ pt ' "2026.07.04") ) (princ)
3 O% G# n) w( A" h+ [0 n$ \/ Y- J C, k, c$ \
(command "TEXT" "j" "M" "26750,2850" "0" (SETQ pt ' "Tªn B¶n VÏ :") ) (princ)
6 V8 l0 z4 Y- ?& K7 y5 @! D0 r0 ?% ^( k' d$ c$ p3 m
(command "TEXT" "j" "M" "26750,2300" "0" (SETQ pt ' "MÆt B»ng TÇng 1 + 2") ) (princ)
$ @' p; w6 i6 C' x) m
: ]3 Y' R0 t' c2 o1 M (command "TEXT" "j" "M" "26750,1600" "0" (SETQ pt ' "Ký HiÖu :") ) (princ)
$ T( ]- }- N! Z g. b4 V( X
- ^ x0 x' p. o, N (command "TEXT" "j" "M" "26750,1100" "0" (SETQ pt ' "KT-01") ) (princ)6 b, }. J" X' U; {5 S' r
5 @6 `) [5 ~( \1 |9 a; D" C (setq ptc (list (car ptb)(cadr pta)))6 X+ w# S1 s$ f1 ^' W8 A
(setq ptd (list (car pta)(cadr ptb)))$ `# i# T' N n1 R/ T8 n: d) K
(setq ang (angle pta ptb)). j) t+ w5 h" v& C, f
(setq d1 (/(distance pta ptb) 2)): J. E/ E# g0 t x# @
(setq cp (polar pta (- ang (dtr 0)) d1))9 I f- g$ B/ t" @8 J
(setq X (distance pta ptc))& f3 n$ p; d4 z7 S
(setq Y (distance pta ptd))
, n! i6 f( E# B+ [, _ (setq X1 (rtos x 2 1))3 A8 W6 K& N' A- V$ T, ?/ i
(setq Y1 (rtos y 2 1))
9 G) `' W; Z! }8 i" _ (setq rmsz (strcat "(" X1 " x " Y1 ")"))
2 B2 {# C; v8 T4 E% d) [ (command "TEXT" "c" cp "0" CPT "_text" "" rmsz))
0 o2 j# e$ A9 Z- a, n% @. T$ i/ { (defun dtr (angg)
0 ]: n! F5 ~: w4 \ (* pi (/ angg 180.0)))
3 G; T) n9 n$ D, i+ N- m' O* O9 i# K3 b
1 \0 ^" C& K) ?) e;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========
1 B6 d. |1 D6 q;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 ====================
1 O0 l( z# ]7 k! @- A, ~: ~;;; =======================Thuong Dung Font Romant.vnh===================
- l* f9 o' P5 k' ~
7 u, x2 {3 w4 [, w s& e(defun c:pta4 (/ pt str pta ptb ptc ptd X Y X1 Y1 rmsz pl1)
, f: L- @- I7 A( k+ @1 O" z (setq oer *error* *error* err2)
; C. _ C, _, [9 t( x (if (not h_text) (setq h_text 250)) ; Kích thuoc chu mac dinh là 2.5- z$ E# ^) y: w
' s- z' I5 r; Y. ?$ d
(setq ht (getreal (strcat "\nNhap chieu cao chu <" (rtos h_text) ">: ")))
, d5 w0 @ O% {: C& A( f$ J* R# C2 [9 s* q2 Z5 Q
(if ht (setq h_text ht))
1 X6 @- Q/ h5 v, T0 ~( c5 q3 e8 w$ w/ Z+ i3 e0 X
( d* V9 d+ R" N, @3 o! p
(setq ang (getreal "\nNhap goc nghieng moi (do) <0>: "))
7 ^4 q, X. ~8 [8 g
! b1 _/ f/ j! }1 q: ^. Z) t (if (not ang) (setq ang 0.0))* w, u8 _6 a# `8 b' |9 `
; R- C1 t4 X4 |, b5 H
' T1 C2 N5 P: o% v5 D# J( ^" L$ i
" T& F& W& E" V (setq pta (getpoint6 Y2 R/ [8 f$ C5 g/ A8 d
"\nPick first corner. : "))# u9 ^; I) u5 s5 @
(setq pt (getcorner pta l7 \1 x* o5 o* A# |
"\nPick second corner. : "))
) ?4 j0 }8 M0 G& ~( b
8 E: N- R9 \5 ~- R: v5 r' I+ n8 U) c2 C8 L; b2 O9 v
(command "POINT" "4700,2575" ) (princ)
; M" ?3 S- H$ R6 X
. |4 m4 t- [. P, g6 K) G! X! G' W. ^ (command "POINT" "4700,1325" ) (princ)" X. O) S1 \9 t2 N2 W( \
( L) q" X& V X8 R. c
(command "POINT" "10600,2850" ) (princ); g8 e( k& V2 A7 K
9 d4 A' ?$ ^' ]! S6 _9 E* z
(command "POINT" "10600,1100" ) (princ)
) J/ v+ h% W3 d2 P, |' O8 y
. k; J0 P3 D4 ?$ l. r. O (command "POINT" "15250,2575" ) (princ)
& ~* N" {( N. q/ Z) s
' \3 P S( D/ o( |% v (command "POINT" "15250,1950" ) (princ)
% G, ~! _ V6 m% D7 |+ V p# K( g( [* I+ Q& `, _
(command "POINT" "15250,1100" ) (princ)5 H+ f* r; b- U+ ]6 j
% u6 y( R( |! h$ k# d (command "POINT" "20250,2850" ) (princ)
8 ]8 d* Z& D; r( S; A% @2 A8 v- J7 B1 ~6 }' n9 N+ K
(command "POINT" "20250,2300" ) (princ)0 d; x# E! O/ c3 @ `4 G
3 ^* {' p3 m F7 U) A! z0 P" ~3 c
(command "POINT" "20250,1600" ) (princ)
$ j$ ~7 T' Q; k2 {* T, G2 Z
$ e" Q7 d; y! j/ a9 @ (command "POINT" "20250,1100" ) (princ)) r( V5 c5 \* P- h6 Y- s5 b$ g! \+ ]' G
1 P, T$ i# e. D (command "POINT" "23500,2850" ) (princ)
* ?1 D. ^6 [5 o U9 K; H
$ R# q. x- ~9 h1 ~* t2 _ c! Y (command "POINT" "23500,2300" ) (princ)2 _. ?3 n% ? s2 p
0 d+ u7 |5 f9 W e
(command "POINT" "23500,1600" ) (princ)
& F5 g. z9 y( ]
/ s1 s: J& y1 o6 B0 l3 [/ v (command "POINT" "23500,1100" ) (princ)& i8 D' y# R6 I' ?9 a: I
. C/ _2 A) m/ I3 x (command "POINT" "26750,2850" ) (princ)
' n. g' N; T( Y e( y
! r1 Z" o" O3 P* g- h* M0 t% _ i (command "POINT" "26750,2300" ) (princ)
# }5 |5 q2 E1 m7 p/ e1 T
3 J! Z4 ]5 ]3 o p% f$ W" V! { (command "POINT" "26750,1600" ) (princ)% G+ s% S- ?9 A6 w
( p/ G r( W( i0 G6 f# W (command "POINT" "26750,1100" ) (princ)
# i7 @ w& g3 `' |) n+ p5 h3 f/ Z* y# _
(setq ptc (list (car ptb)(cadr pta)))
* Y& u( f$ @9 e* k7 M( @* t6 A (setq ptd (list (car pta)(cadr ptb)))5 ?7 z$ B* ?# d# ^6 n3 }2 Q$ {) j
(setq ang (angle pta ptb))
4 y+ x6 j. S; g9 L* o* C- k (setq d1 (/(distance pta ptb) 2))6 J% ^ X! q' |4 C
(setq cp (polar pta (- ang (dtr 0)) d1))1 S3 p! {4 t6 I' P% Z f
(setq X (distance pta ptc))
6 `8 t5 h9 b# [& Y/ b" j2 e (setq Y (distance pta ptd))
# i5 g0 }- ?2 ~& m, l (setq X1 (rtos x 2 1))
8 _& x$ m! D. w, n8 | _2 }0 [ (setq Y1 (rtos y 2 1))1 r5 B) a, y$ Z" t
(setq rmsz (strcat "(" X1 " x " Y1 ")"))
# r1 |6 Z5 n+ U& F( Q8 z( U (command "TEXT" "c" cp "0" CPT "_text" "" rmsz))8 J- w8 z" N' p8 C7 v% r5 x& U
(defun dtr (angg)
8 X) L" {3 o8 H, o8 l (* pi (/ angg 180.0)))# N6 y i) W# \4 J) b0 J
" S# F" C& ^# ^. `5 W2 K) g+ _2 g% }
;=====================================================================
5 a# [. H; G0 J% m;====================DAT KHO GIAY BAN VE - KIEU 1=====================
1 j" q6 `$ T p;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
$ N5 `- m e+ N5 e1 K' {" P
1 _7 ^# P9 [5 [4 z l(Defun c:a6 ()& F/ x2 _7 l3 f) ], J
(setq mv_sc 100);Ti le ban ve
! k k/ m% b' c- m6 @- q8 Y, z% ~ (setq x4 74.25)
, r* }- O3 _( k (setq y4 52.5)1 s6 @& R; g* P5 J# x; X' w/ X8 l
(setq x4 (* mv_sc x4) $ F2 q" b% `/ }* K1 c8 o
y4 (* mv_sc y4) )
% S$ N: u5 R. p& c2 \9 n$ j" Y (command 8 H2 Q0 S9 E2 k/ c. a
"LIMITS" "0,0" (list x4 y4)- X% n- ?. V; `0 h. l
"PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
. W9 j( r9 d- I0 f' j "RECTANG" "125,125" "@7175,5000"
8 k, P% m3 X4 D. ~6 ? "RECTANG" "175,175" "@7075,4900"5 P+ T% w: ~ ~* Y$ n6 Y
"ZOOM" "_a" ))
/ `5 t9 O T' R; Q4 S+ w;=====================================================================
9 `- E$ o% @% d$ U) j(Defun c:a5 ()
2 G9 p- W- S9 {% E1 S3 S (setq mv_sc 100);Ti le ban ve" m6 L9 c( m( ?7 O, Q( E6 p' L
(setq x4 147.5)
$ F' X% a; ] m (setq y4 104)
6 Z0 |5 p5 P/ g0 P: I4 w: M; S) I (setq x4 (* mv_sc x4)
: w. s/ H- d1 e- k y4 (* mv_sc y4) ), K5 _. K; f) r; T; N: G
(command
, c; x$ R0 \8 u "LIMITS" "0,0" (list x4 y4)) D: P. k( M, q; |* e7 C. E
"PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
# ], ]! s- z' `. N "RECTANG" "250,250" "@14350,10000"
# @2 B- Y& p% S "RECTANG" "350,350" "@14150,9800"# g, i) A9 ~4 D8 F
"ZOOM" "_a" ))
U+ N* t3 H2 b1 g# q% i3 };=====================================================================2 }4 l% E5 _' ^3 {' P s
(Defun c:a4 ()3 V; A* R) m x- _9 h+ x+ \
(setq mv_sc 100);Ti le ban ve
3 ~ j2 {; w3 C$ k7 K, H (setq x4 297)
7 x2 i' K& u! b" L (setq y4 210)' v* S. [9 x% p2 R) W* E, k! I; z
(setq x4 (* mv_sc x4) 3 r$ _. F0 l% Y; _
y4 (* mv_sc y4) )
; C) _$ u# i# W5 ? (command : R; ^$ J# O' t+ Q
"LIMITS" "0,0" (list x4 y4)% m) F p5 O% ?' q7 n9 a) ]
"PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
, f2 F4 `$ j- q7 X "RECTANG" "500,500" "@28700,20000"
5 G7 {8 B# t3 V" g# Q }3 F. T "RECTANG" "700,700" "@28300,19600"- s' e& g3 j2 b7 l
"ZOOM" "_a" ))( D* e& Q8 {. @6 N; Q
;=====================================================================/ [+ Q$ o. ?( t W" h6 l, W
(Defun c:a3 ()
v% E1 q8 {" W( ?0 x2 W# k (setq mv_sc 100)
+ J9 R7 U! X" C b) o6 E" s (setq x3 420)
: Y% J( ]% I8 c' } (setq y3 297)
) J( Y5 X; O+ `4 z# h5 u (setq x3 (* mv_sc x3) . e9 m5 ^6 M" L8 [5 |* G& g
y3 (* mv_sc y3) )
- d; s5 _9 V+ j( T% A+ ?" Y, w (command
& S W% P6 \+ g9 C& E "LIMITS" "0,0" (list x3 y3). \+ A0 _) C- F' f2 {
"PLINE" "0,0" (list 0 y3) (list x3 y3) (list x3 0) "0,0" "_C"
% a6 u" U3 D2 A, c/ |0 q "RECTANG" "707.14285714,707.14285714" "@40590,28285.71428571"; `3 v) ]/ s; n2 v- Z
"RECTANG" "990,990" "@40024.28571429,27720"
4 e4 d8 S& U1 V2 a "ZOOM" "_a" ))0 B7 ~- ]4 p( t/ N9 }5 e' G
;=====================================================================
# J& r. L$ R6 U/ q v(Defun c:a2 ()
- D; W5 |& l: E- z3 s7 f (setq mv_sc 100)
) Z6 t3 G0 E9 l7 N i2 A' C (setq x2 594)
$ x+ G& N) O7 M+ w$ p- F (setq y2 420)
( D9 G' {- b2 Z+ b- L8 M (setq x2 (* mv_sc x2) & }# M* h! K! e/ ^
y2 (* mv_sc y2) )
* I, P! @2 v/ r& r# \8 T (command * T/ p* |0 i t2 ?! k( y; j7 r& O
"LIMITS" "0,0" (list x2 y2)4 \/ d* o- j; r4 M# I
"PLINE" "0,0" (list 0 y2) (list x2 y2) (list x2 0) "0,0" "_C"/ _2 L; j- F2 o( X' [5 c4 a
"RECTANG" "1000,1000" "@57400,40000"/ u( e4 _) S* ~$ _5 l: g, @
"RECTANG" "1400,1400" "@56600,39200"8 ^/ o# v, p m! P- k$ P
"ZOOM" "_a" ))
% R% n3 I' E2 ^# k3 o' S;=====================================================================: ?& f8 z7 m. F/ ^4 m
(Defun c:a1 (); x9 a) o) y$ ^( }6 ]
(setq mv_sc 100)
) A& _% U' X- |1 H (setq x1 840)( y! A; X$ O8 |) S4 D
(setq y1 594)
5 ?! V7 }; E: \# B4 z5 M$ }' e" \ (setq x1 (* mv_sc x1)
7 k# N, m" L' w' D6 x6 M- Y3 K0 v y1 (* mv_sc y1) ) O( W) ]. `3 J3 A F" ]
(command
! u( [$ i: s- b# x$ @$ X "LIMITS" "0,0" (list x1 y1)
; U2 _) v d$ J( _/ B+ e "PLINE" "0,0" (list 0 y1) (list x1 y1) (list x1 0) "0,0" "_C"" R o2 L6 C* _& \
"RECTANG" "1414.28571429,1414.28571429" "@81180,56571.42857143"
) K) H1 E& }( @$ W "RECTANG" "1980,1980" "@80048.57142857,55440"3 ?! l0 G8 |# U; F% l( G
"ZOOM" "_a" ))* Z0 }1 K' M+ N% m, B. N% z
;=====================================================================* _- G7 k+ }0 s: N# A3 T& W/ b
(Defun c:a0 ()
4 F! _" O8 B- Y$ [- I+ j (setq mv_sc 100)
' u8 t+ }* G. k6 `3 H (setq x0 1188)
4 R6 k! G( M% Z: J% L- k1 O- l (setq y0 840)
* J; M5 A/ I( Q( S; I! s" ~ (setq x0 (* mv_sc x0) 5 K+ S: ?* u4 _; r8 g; O1 U
y0 (* mv_sc y0) )( T k9 D! N2 u5 P3 N& e" r
(command
& Q! s1 {: S) b) [- D "LIMITS" "0,0" (list x0 y0)
: x! W% I$ G! I" _6 ~/ ^ "PLINE" "0,0" (list 0 y0) (list x0 y0) (list x0 0) "0,0" "_C"
7 p% J) j1 \ z1 |- k, I "RECTANG" "2000,2000" "@114800,80000"
, V6 M. M* b- I, w2 ~3 a "RECTANG" "2800,2800" "@113200,78400"
8 b* `+ p, Z" q( |! [ "ZOOM" "_a" ))
& ?* f& I6 T5 k# L) p4 N* E$ I! F B' G1 ?
;=====================================================================
% j* Q# t! N3 H. M- t;====================DAT KHO GIAY BAN VE - KIEU 2=====================% D; S2 S% k* N0 P3 K5 o
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
1 _" {$ q& O a5 ?0 X- v# _( H2 [& N# }* ~2 k
(Defun c:6a ()
, h3 C( b/ F/ [, x+ L4 x. B (setq mv_sc 100);Ti le ban ve
7 q' E/ ^! t7 p* i0 r& |. g (setq x4 74.25)
4 E0 Y. Y- m2 d- A/ O (setq y4 52.5)
6 w4 ]6 ], T7 V8 g4 n- k# V _ (setq x4 (* mv_sc x4)
5 m4 Z- @+ n" |3 V( k y4 (* mv_sc y4) )
* H0 L0 R# }4 ^6 V8 g$ b' w5 O q+ j (command 7 V6 f1 Q( d0 p, [( d
"LIMITS" "0,0" (list x4 y4)
1 B) p2 c* U/ k; |. f% c "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C") i: A O, w4 n, t
"RECTANG" "505,125" "@6800,5000"
% O3 _1 [% X3 u0 p1 c "RECTANG" "555,175" "@6700,4900"9 G2 S! B9 P. J! d
"ZOOM" "_a" ))
. c! \# q& k j( R& v6 I;=====================================================================
) @; q* B% B& v3 U+ S- O(Defun c:5a ()
# X: h0 k( F- O/ @9 B8 }1 m8 Z (setq mv_sc 100);Ti le ban ve
0 p$ \3 S6 S& \$ \ (setq x4 148.5)7 B. F' M1 `: x6 g% M& W, p- o& }
(setq y4 105)3 v) s# r ~5 a4 a
(setq x4 (* mv_sc x4)
; L% g# \& @1 F& h l- p( m' z# z y4 (* mv_sc y4) )$ n8 F% U9 }# c2 ^' U$ L
(command % Q" r9 }' C8 K. j& {7 M- j
"LIMITS" "0,0" (list x4 y4)% i a4 |' ^2 N
"PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"7 L# a) `& D. i: w# {4 V- U
"RECTANG" "1000,250" "@13600,10000"( e, Q5 r4 W" \7 ~3 p& v- s" ^
"RECTANG" "1100,350" "@13400,9800"6 d7 O8 ~" e! u2 \! O
"ZOOM" "_a" ))4 w. V' c' F) |; l5 J
;=====================================================================
) N, Z* w. a2 U; Z; d& c1 a$ J2 V(Defun c:4a ()5 B/ t* s* W. s8 p- f
(setq mv_sc 100);Ti le ban ve
1 N$ J1 B4 x% p' A, e& m (setq x4 297)
9 L5 s0 {/ O- c6 m( }" E i L1 r& q (setq y4 210)
& r( d* U3 {8 ~9 C+ m1 A6 D1 t* k (setq x4 (* mv_sc x4) ! Q$ f* A8 H# [" h5 `
y4 (* mv_sc y4) )! ^% J) ^% f) H
(command " F& O0 w5 p& z `! E- H( U: Y) Z4 Q" I
"LIMITS" "0,0" (list x4 y4)1 g5 T1 L" p; g4 C+ u
"PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
9 n I/ q* i% Q, t! | "RECTANG" "2000,500" "@27200,20000"5 t* F0 K, l- w; |2 h) I/ K4 z, @
"RECTANG" "2200,700" "@26800,19600"3 c# v( }# ~% d: m
"ZOOM" "_a" ))3 F# v6 ^2 [$ n/ w3 U
;=====================================================================# N3 ^: f8 N+ T# y X( N
(Defun c:3a ()* L' V! k, v# Q& q. p# f" X# V% T
(setq mv_sc 100)) S: u( S$ o1 @3 F5 \7 i5 Q5 j
(setq x3 420.0428571429)
$ K" Z4 g$ k; O! e6 G (setq y3 297); I- ~- Q( X2 {# `
(setq x3 (* mv_sc x3) & h3 s' z1 t. V* C; f, A
y3 (* mv_sc y3) )
" V B7 t: q- q' T# n" W) G (command
' g7 g& J1 I0 a "LIMITS" "0,0" (list x3 y3)
" o5 ]! w$ Z6 f6 {- K7 f "PLINE" "0,0" (list 0 y3) (list x3 y3) (list x3 0) "0,0" "_C"& k, J8 n4 w# p( {" {5 r
"RECTANG" "2828.57142857,707.14285714" "@38468.57142857,28285.71428571"
( o/ T2 c6 e0 Y "RECTANG" "3111.42857142,989.99999999" "@37902.85714287,27720.00000001"' ?( ^( b) n, y: y% j& r, ?. K3 r
"ZOOM" "_a" )), y' q. N' ?7 J" b9 G
;=====================================================================
% W! p8 t9 k% e(Defun c:2a () g( j9 @3 r& Y# m
(setq mv_sc 100)7 Q4 e$ f1 F% Q7 e
(setq x2 594)
& N# J7 a5 ?- [( l (setq y2 420)
4 Q- r; B' ^. t' G) t1 W; G (setq x2 (* mv_sc x2)
5 N. x% b# I1 B y2 (* mv_sc y2) )" s% A% E: m! f" c4 c" c
(command " r, D' x% L: V, G" Y6 ^! \
"LIMITS" "0,0" (list x2 y2)* F$ {" ], v& ] u% m) v
"PLINE" "0,0" (list 0 y2) (list x2 y2) (list x2 0) "0,0" "_C"
! a. ]" V4 l/ D( p+ s# I "RECTANG" "4000,1000" "@54400,40000"
% G4 x# ^ K- e/ | "RECTANG" "4400,1400" "@53600,39200"
/ I) A6 ^: `* D: Q) Y/ \ "ZOOM" "_a" ))( _. q8 e! {4 x7 [
;=====================================================================1 q& N6 `1 J/ u: _+ A% R
(Defun c:1a ()
9 Q% h+ {- K5 G" t( h; U (setq mv_sc 100)5 o; O+ S* c6 h% A5 e! X( k1 r
(setq x1 840.0857142857)
. M1 d. q" \8 L/ C k8 z9 C0 l (setq y1 594)! }1 Z! P/ x, c7 ]* d/ E& p
(setq x1 (* mv_sc x1)
6 F4 |: S6 n# s* X y1 (* mv_sc y1) )$ H N' W! R; U9 @
(command
4 h; [( G5 E* u "LIMITS" "0,0" (list x1 y1)
; w2 X4 D4 ?' @/ K% T9 f5 i "PLINE" "0,0" (list 0 y1) (list x1 y1) (list x1 0) "0,0" "_C"
, q: ?$ b; j9 D "RECTANG" "5657.14285714,1414.28571429" "@76937.14285714,56571.428571436"
! h0 ?/ l1 f& O# ^7 }2 |% i0 { "RECTANG" "6222.85714286,1980.00000001" "@75805.71428570,55440"1 T3 z6 ~! B! I" _: D
"ZOOM" "_a" ))' w5 K( s3 b) L% s
;=====================================================================
Y, F- v8 L# G- q+ F, d- a(Defun c:0a ()
% P) Z( U, v" }5 ~; j (setq mv_sc 100)* w8 P: U9 a7 t1 ?
(setq x0 1188)
0 M. b( w% Y' s* w4 K* U8 J (setq y0 840)
9 @2 s+ d( @! ^ P* w+ n& A (setq x0 (* mv_sc x0) $ a/ g! C, U- V) _
y0 (* mv_sc y0) )4 {3 x; P+ _# b
(command
$ z% P) u. z" i8 X- S& } "LIMITS" "0,0" (list x0 y0)& I8 y( k) X0 h3 M& y
"PLINE" "0,0" (list 0 y0) (list x0 y0) (list x0 0) "0,0" "_C"
# _2 ^+ [5 k' `7 u9 j% A "RECTANG" "8000,2000" "@108800,80000"
7 Z+ A$ F# S6 r "RECTANG" "8800,2800" "@107200,78400"
+ J( k( U1 a `# I" e# U "ZOOM" "_a" ))8 W0 [: r0 ?) H$ r5 k9 |; q
" q' J# P" Q2 o% ]* K* a: _& q7 O
;=====================================================================
- k" h( I4 G* {;==================DAT KhoGiay Theo KHO GIAY BAN VE===================$ b2 r" J& `9 N# l5 c" J
;=========================== Nguoi Khac ==============================
" h# a T7 H. `/ o(defun c:khogiay (/ oldlst a b c d e f g h kho TL)
8 ^9 Z% J5 g! B( N( z(command "undo" "be")) ]5 O$ I8 \6 G! L4 i" U' N
(setq oldlst (mapcar 'getvar (list "CMDECHO" "OSMODE" "cecolor")))
9 d0 @5 i/ A: X7 }% i(setvar "CMDECHO" 0); {* k2 j& h- o: r
(setq a (getpoint "\n chon diem chen :"))
) }# l6 B |2 Q B(if (not TL) (setq TL 1.00))5 S% J$ Q1 l F6 N; V0 k4 z6 R: `
(setq TL1 (getDIST (strcat "\nScale <" (rtos TL 2 2) ">:")))) K T8 N- U6 c& v
(if TL1 (setq TL TL1))6 x* M8 s: r# U+ l5 v
(setvar "osmode" 0)# G4 \* z! ~0 I* W7 Q/ j! i
(if (not (tblsearch "layer" "Defpoints")) (Command "layer" "N" "Defpoints" ""))
/ Y) I- t/ F U6 o: W# g z; ^(initget "0 1 2 3 4")) T! ~' H- S5 j, _( f9 V& u
(setq kho (getkword "\Kho A0 _ Kho A1 _ Kho A2 _ Kho A3 _ Kho A4 [0/1/2/3/4]? <0>:"))* g3 k3 e3 O1 j: P" V
(if (= kho "0")
" J& F5 Q+ ?: D: u (progn" y. D+ G3 m0 V8 `: ?" _3 u6 D
(setq b (polar a 0 (* TL 1189))), [: u2 ]. Y, V" d/ y$ X
(setq c (polar b (/ pi 2) (* TL 841)))& y! S' ]: g1 |/ U& B3 v8 l
(setq d (polar a (/ pi 2) (* TL 841)))
* ~# K, W( Z1 d4 }9 |+ m4 u# w (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 12 12)))))4 z& z8 N9 ~) g; }: g) }5 r+ O# @
(setq f (polar e 0 (- (* TL 1189) (* TL 24))))3 _) `, m9 |. I9 N/ H! G* f
(setq g (polar f (/ pi 2) (- (* TL 841) (* TL 24))))1 B0 z) |1 V8 I. P* g2 _
(setq h (polar e (/ pi 2) (- (* TL 841) (* TL 24))))
' F' q9 P( y; ^6 k% `* E (command "Pline" e f g h "c") / N: O# j N% l( f- {; ~3 N: V
(command "change" "last" "" "properties" "layer" "0" "")
" X) u7 e) ]! N) o: C! j" R(setvar "cecolor" "4")
) N" B0 h; C1 K- f- D (command "Pline" a b c d "c")% u2 q4 M+ l; C3 |/ E( O7 r
(command "change" "last" "" "properties" "layer" "defpoints" "")))
1 p" B9 {" C5 ` w/ v9 P; c5 G (if (= kho "1")
5 j4 T2 _- C4 G4 d) l* k- m( O' o+ T (progn
5 A4 S. L2 V0 Z: t0 h9 P (setq b (polar a 0 (* TL 841)))* m. b6 ]# y( s$ ^9 U( }
(setq c (polar b (/ pi 2) (* TL 594)))1 H9 p2 d0 ?. B
(setq d (polar a (/ pi 2) (* TL 594)))# F% C1 r' u8 g! s. \+ C
(setq e (polar a (/ pi 4) (* TL (sqrt (* 2 12 12)))))
/ R( I& J4 i3 C& i4 i# y) N" l) g (setq f (polar e 0 (- (* TL 841) (* TL 24))))
# X6 C) @5 J, p (setq g (polar f (/ pi 2) (- (* TL 594) (* TL 24))))
# _* ~: G% i. ^3 D) c (setq h (polar e (/ pi 2) (- (* TL 594) (* TL 24))))
7 |- ~$ T1 G( C' Q+ r$ x (command "Pline" e f g h "c")
' e) q6 A( s/ s; z(command "change" "last" "" "properties" "layer" "0" "")
# l1 P% E1 w6 N(setvar "cecolor" "4")
% c1 H- o$ E: d* m (command "Pline" a b c d "c"); z/ ^, \0 Y) y. M) B2 h6 h% ?9 s
(command "change" "last" "" "properties" "layer" "defpoints" "")))5 T5 _3 X* A% C7 U' }! b' ]' o
(if (= kho "2")
0 x: c4 }6 X9 C1 e (progn
) m1 R! Z/ C7 s! l (setq b (polar a 0 (* TL 594)))
* ^$ i$ E6 i/ t) ]' S (setq c (polar b (/ pi 2) (* TL 420)))
" r, I' u1 k# X' [! G (setq d (polar a (/ pi 2) (* TL 420)))
5 |! F% ~. k$ X2 s l8 q$ ? (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 100)))))0 w1 `* Q5 e/ q- r+ ?5 M
(setq f (polar e 0 (- (* TL 594) (* TL 20))))
7 R4 M" {5 A( w* b+ Y9 t (setq g (polar f (/ pi 2) (- (* TL 420) (* TL 20))))
( N5 H+ O( |' N) ]6 O7 h! m- j (setq h (polar e (/ pi 2) (- (* TL 420) (* TL 20))))
7 _# H" p; \- _+ B U (command "Pline" e f g h "c")
) g6 U7 g, b9 y, b(command "change" "last" "" "properties" "layer" "0" "")' Z" T) D4 Z5 H, g8 }* f
(setvar "cecolor" "4")
9 C- |( p* S2 a, E (command "Pline" a b c d "c")
- }$ U" y1 c: \) I6 K(command "change" "last" "" "properties" "layer" "defpoints" "")))2 r6 B/ @. f! e0 [ |* b0 }
(if (= kho "3")
$ O: s9 `7 Q3 D (progn& h9 o: W _/ l/ Q: u0 i. o/ g
(setq b (polar a 0 (* tl 420)))
7 U* x6 I" _5 _! i+ t, o; X8 b (setq c (polar b (/ pi 2) (* TL 297)))8 a1 V# R: y6 ?
(setq d (polar a (/ pi 2) (* TL 297)))
O& h8 ~; x: z" X" M h: p+ ?4 q. B (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 100)))))
- T& r4 ?; r8 e S- c% { (setq f (polar e 0 (- (* TL 420) (* TL 20))))/ [" U1 D" o/ {( m# r" B
(setq g (polar f (/ pi 2) (- (* TL 297) (* TL 20)))) T2 {+ a7 o R) \
(setq h (polar e (/ pi 2) (- (* TL 297) (* TL 20))))! [: B! p5 Y5 j6 f* k! ^2 \
(command "Pline" e f g h "c")% G0 J, f4 v5 ~
(command "change" "last" "" "properties" "layer" "0" ""); }/ L) G7 \! k( f6 j7 P. [" p
(setvar "cecolor" "4")" P) Z% J$ q( p6 U) ?
(command "Pline" a b c d "c")
& j, a. D: I$ R2 O7 s$ U8 P (command "change" "last" "" "properties" "layer" "defpoints" "")))
' q& a( Y% U3 | (if (= kho "4")* c3 c B" q+ H, {0 F, w
(progn
8 b, |# \5 H, l! x% M (setq b (polar a 0 (* TL 297)))
9 _# B* |' M( N/ R3 d (setq c (polar b (/ pi 2) (* TL 210)))- I: K9 t' a6 V3 x& c
(setq d (polar a (/ pi 2) (* TL 210)))
, g$ N N2 }; Q; ]# @5 g' Z (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 81)))))
5 u6 \2 a2 I; x8 p5 q (setq f (polar e 0 (- (* TL 297) (* TL 18))))
3 S9 Y4 \) V4 a' ]# j* y, T6 j# L (setq g (polar f (/ pi 2) (- (* TL 210) (* TL 18)))). R G7 z( ~- r' a4 z$ N
(setq h (polar e (/ pi 2) (- (* TL 210) (* TL 18))))
! Z$ l* u; U; S5 F& N (command "Pline" e f g h "c") 2 x) u/ b$ ?$ y
(command "change" "last" "" "properties" "layer" "0" "")5 Z& m! H) c) m, Z- h" N& V
(setvar "cecolor" "4")8 }+ w) Q7 B& ^; w8 }
(command "Pline" a b c d "c")0 `, ~4 P$ s2 L$ T, [' @& g7 {3 |4 b4 l
(command "change" "last" "" "properties" "layer" "defpoints" "")))& n5 Z# _" `3 B, b9 Q5 [
(mapcar 'setvar (list "CMDECHO" "OSMODE" "cecolor") oldlst)
4 }; ]: w" M2 M# n/ r+ E(command "undo" "e")
: L' M& M) E- L" N# O" g(princ))
- B* M" F ]! L! h4 a! L;=====================================================================6 S M! y3 q" G* @( t4 H' @! g* {
;==================DAT KhoGiay Theo KHO GIAY BAN VE===================5 {6 {7 Q0 c0 ~- F
;=====================================================================
4 z# Q1 j+ d4 L9 k& Q
8 X. R+ X* P3 ?, ];=====================================================================
7 m2 f4 \3 [0 ^, A;===================DAT Ti Le Theo KHO GIAY BAN VE====================% |/ }2 i8 @4 `2 M5 ~
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================8 k, Q) _& v- f" n1 R( C
8 ~2 A! b- H" o7 U3 t ~
(DEFUN C:SA6 () (setvar "DIMSCALE" 411.11111)
% \' k4 n/ i& ~+ p (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.1" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "5" ""' f7 L2 r3 N% A2 c9 R6 h
"-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.3" ""
3 ~7 L7 Y4 Y% @" K; Y+ J "M" "MANH" "C" "9" "" "Lw" "0.1" ""
- T1 |0 B B- x "M" "TEXT" "C" "7" "" "Lw" "0.12" ""
2 f' L: c/ \ s3 ?& ^3 C "M" "DIM" "C" "1" "" "Lw" "0.12" ""
0 M- K( v$ {/ Q+ |4 A4 ^ "M" "THAY" "C" "7" "" "Lw" "0.2" ""/ |% e5 J( A0 Q/ g; a
"M" "NOITHAT" "C" "60" "" "Lw" "0.12" ""* J& \3 K# N( a/ U) _; C* H
"M" "HATCH" "C" "5" "" "Lw" "0.1" ""
+ m4 n4 _ D7 D; j0 ^0 F. }+ J "M" "COT" "C" "1" "" "Lw" "0.3" ""& i6 b( \! Y8 [$ o
"M" "Defpoints" "C" "7" ""8 n$ v; u! y4 Q( o& Y- s$ z
"M" "0" "C" "3" "" "Lw" "0.12" ""/ e/ U8 D9 J% Q- P6 J
"M" "CUA" "C" "6" "" "Lw" "0.12" ""# G2 z! C4 c. M: q+ c7 o
"M" "CUA MATDUNG" "C" "6" "" "Lw" "0.12" ""
: o, V' s5 F& v! G2 J" ?8 | "M" "DAY-DIEN" "C" "3" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"9 p( T7 U. b8 J" M
"M" "NETDAM" "C" "4" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1": C% y3 d: Z+ k4 s$ V
"M" "NETTHAY" "C" "255" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"5 ?: {8 B: M, b
"M" "NETMANH" "C" "43" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"% R: ~9 X/ j8 O
"M" "ThietBiDIEN" "C" "2" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"
E4 J: O& s- @3 r "M" "TEXTTXT" "C" "7" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"# \( B5 p& W) D* z q
"M" "TEXTVN" "C" "60" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"' I* r. w+ w0 G h1 A [. v/ R
"M" "TEXTVNi" "C" "60" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"; x w4 M3 C( z+ F7 b) p
"M" "THEPDAI" "C" "3" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
/ K7 u2 U a2 l) u "M" "THEPDOC" "C" "2" "" "Lw" "1.20" "" "LT" "Continuous" "" "" "LTSCALE" "1"/ l1 j( {1 a; i4 Y$ m9 K+ S
"M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.3" "" "LT" "Continuous" "" "" "LTSCALE" "1"
5 m- u+ U( S* q s( R1 Q2 Y "M" "4-WateR_IN" "C" "4" "" "Lw" "0.4" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2"
& [; i8 V2 k t) b, R- {; I "M" "4-WateR_OUT" "C" "4" "" "Lw" "0.4" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2"
( a$ @& B' f6 A "M" "KHUNGTEN" "C" "4" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
" P* | r" m7 `7 Y& d "M" "TIMTUONG" "C" "5" "" "Lw" "0.1" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "3" ""))(princ)5 u) Q' B) N6 y# ? I. j+ u {
(DEFUN C:SA5 () (setvar "DIMSCALE" 611.11111)
5 ^- s" ?1 t9 S; G T (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.12" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "10" ""+ g7 t0 y. j# H
"-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.4" "", x- Y4 q% M7 Y
"M" "MANH" "C" "9" "" "Lw" "0.12" ""& l7 m% @6 B+ P5 S
"M" "TEXT" "C" "7" "" "Lw" "0.12" "": J' `! P. W$ r0 n% j/ i
"M" "DIM" "C" "1" "" "Lw" "0.2" ""
; K. w) {# O! M "M" "THAY" "C" "7" "" "Lw" "0.2" ""
8 l" w5 C1 S' g' C# v# k "M" "NOITHAT" "C" "60" "" "Lw" "0.2" ""
4 ~3 R8 `4 O% t% S+ h5 j3 n* d- ` "M" "HATCH" "C" "5" "" "Lw" "0.1" ""
3 }6 O6 ~9 f3 A6 K5 s- j "M" "COT" "C" "1" "" "Lw" "0.4" ""
9 Y9 h5 x8 i0 F "M" "Defpoints" "C" "7" ""
: g" V2 |8 Z' e; b "M" "0" "C" "3" "" "Lw" "0.2" ""
& m) @, u1 Y4 K( y9 J- N0 @6 l# V "M" "CUA" "C" "6" "" "Lw" "0.12" ""' @. }0 |! u, C
"M" "CUA MATDUNG" "C" "6" "" "Lw" "0.12" ""( Z: K/ V, O z7 I0 t
"M" "DAY-DIEN" "C" "3" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"
) B s0 o8 b% P! F% g$ }; T "M" "NETDAM" "C" "4" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"
, l- o+ l$ f" \: |+ c "M" "NETTHAY" "C" "255" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"0 V8 m5 T6 f8 F+ V; J1 D' M2 q
"M" "NETMANH" "C" "43" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"( L% v- h0 P; e2 A+ s6 u @
"M" "ThietBiDIEN" "C" "2" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"% L3 g8 S) k3 X) L k( M
"M" "TEXTTXT" "C" "7" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"
# _0 V8 X8 i5 c# q3 D "M" "TEXTVN" "C" "60" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"
7 H4 r/ u( }! X& \ [: Z l7 d "M" "TEXTVNi" "C" "60" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"
5 j2 U) h! I1 D( }- x* d3 V( m- d "M" "THEPDAI" "C" "3" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"
5 ` j; ]8 Z4 `4 |+ z, N( { "M" "THEPDOC" "C" "2" "" "Lw" "1.40" "" "LT" "Continuous" "" "" "LTSCALE" "1"
: c7 z; g* `' w1 I) ? "M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.4" "" "LT" "Continuous" "" "" "LTSCALE" "1"
9 n! i1 j9 l7 ~6 L! t) x8 `! f9 y "M" "4-WateR_IN" "C" "4" "" "Lw" "0.5" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2"
/ _5 ~7 N- s2 f "M" "4-WateR_OUT" "C" "4" "" "Lw" "0.5" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2"' V) o$ L6 J% X F! q9 r/ A
"M" "KHUNGTEN" "C" "4" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"
/ s4 T+ i. r) R/ t2 f; E5 v9 `- ` "M" "TIMTUONG" "C" "5" "" "Lw" "0.15" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "5" ""))(princ)
2 j; [6 @( d* s& ]+ {9 j(DEFUN C:SA4 () (setvar "DIMSCALE" 1411.1111) L) m4 a [6 K# G% g& N
(COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.2" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "20" ""
7 Q X7 V. M9 v "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.6" ""
- ^) S! C' T$ o. R! D6 j "M" "MANH" "C" "9" "" "Lw" "0.2" ""
6 w1 ~8 q% [2 H' v/ `. ?8 u "M" "TEXT" "C" "7" "" "Lw" "0.2" ""
; K' j R7 L W p7 g* S& `+ l) V "M" "DIM" "C" "1" "" "Lw" "0.25" ""& c U% n/ c+ o! W- w: p
"M" "THAY" "C" "7" "" "Lw" "0.35" "" N) a, k+ A X9 b; d! Y3 l |6 e
"M" "NOITHAT" "C" "60" "" "Lw" "0.25" "") g7 N: i& Q1 q* Y, u
"M" "HATCH" "C" "5" "" "Lw" "0.15" ""- j" Y# ^. A: `1 L8 u* Q
"M" "COT" "C" "1" "" "Lw" "0.6" ""
M" d# a* b% F2 J "M" "Defpoints" "C" "7" ""
8 h- b3 d/ H2 C2 h+ t "M" "0" "C" "3" "" "Lw" "0.25" ""
1 a/ I; [5 p* w& D K; r* { "M" "CUA" "C" "6" "" "Lw" "0.25" ""7 j, N- n* t! G! x3 K( p
"M" "CUA MATDUNG" "C" "6" "" "Lw" "0.25" ""
# T8 e8 A! O5 r "M" "DAY-DIEN" "C" "3" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
, u4 k9 W4 |5 Q4 | "M" "NETDAM" "C" "4" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"7 y$ V* p* k+ T. n5 j: ~# G
"M" "NETTHAY" "C" "255" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"5 |( }; x4 K# x0 j2 }
"M" "NETMANH" "C" "43" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1") g6 ?& T- M7 h5 w
"M" "ThietBiDIEN" "C" "2" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1": J o4 ` u: g8 L0 y5 G" B
"M" "TEXTTXT" "C" "7" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
, u* x& P5 }* t( t# @0 q: N "M" "TEXTVN" "C" "60" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"; ]' f( M9 o. d9 A
"M" "TEXTVNi" "C" "60" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"3 R, h0 p$ u, s8 U9 I& |+ J0 }# D8 l
"M" "THEPDAI" "C" "3" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"( I8 x) z f: ], M; O9 z% u* V1 {
"M" "THEPDOC" "C" "2" "" "Lw" "1.58" "" "LT" "Continuous" "" "" "LTSCALE" "1"
}5 f: z$ T! v0 I0 U "M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
- d- i+ J3 Q7 g. B8 e5 h, ]6 R "M" "4-WateR_IN" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2"
$ k% T" N0 p$ n3 C/ ^ "M" "4-WateR_OUT" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2"7 D1 V1 h0 M: f( o, e9 Y& e
"M" "KHUNGTEN" "C" "4" "" "Lw" "1.00" "" "LT" "Continuous" "" "" "LTSCALE" "1"" E$ x" [# Y5 o7 c- A8 q, v6 @
"M" "TIMTUONG" "C" "5" "" "Lw" "0.2" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "10" ""))(princ)$ F5 Q! n/ F1 `% N, H$ S; |- g. p
1 |8 p% e H* x
(DEFUN C:SA3 () (setvar "DIMSCALE" 1611.1111)
: v+ \3 g. I( ?* |+ S0 f0 l (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.35" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "30" ""2 \8 M7 i4 L8 F7 f c' G6 O$ w
"-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.7" ""
# C- N( R' N5 [, S "M" "MANH" "C" "9" "" "Lw" "0.25" ""
! @7 k5 ^- _( J+ Y/ u "M" "TEXT" "C" "7" "" "Lw" "0.2" ""
+ q' J# V& G! e7 x* B "M" "DIM" "C" "1" "" "Lw" "0.35" ""# U8 M& h2 y/ D8 |; {) q- ~ O
"M" "THAY" "C" "7" "" "Lw" "0.4" ""
/ d* l9 q+ m) t/ a; j& P, l7 O "M" "NOITHAT" "C" "60" "" "Lw" "0.25" ""
1 T4 c6 n) C, q4 t7 u "M" "HATCH" "C" "5" "" "Lw" "0.2" "", d; Y9 [+ A. r5 V$ h
"M" "COT" "C" "1" "" "Lw" "0.7" ""0 N+ q! F: W9 T' f$ d% g& m% _8 N) E
"M" "Defpoints" "C" "7" ""
; e# Z: X) l& O1 } "M" "0" "C" "3" "" "Lw" "0.25" ""
% x+ H* L2 m5 _4 T: n "M" "CUA" "C" "6" "" "Lw" "0.35" ""
: }0 z% j4 @5 [0 Y; N "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.3" ""
5 K; h# k- R% y "M" "DAY-DIEN" "C" "3" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
X# ?2 T0 s4 Q0 [' g8 S "M" "NETDAM" "C" "4" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"' t- l+ n$ A3 w9 k! M1 E$ N+ X* p
"M" "NETTHAY" "C" "255" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
% V# r4 m9 S) O' R% |# c "M" "NETMANH" "C" "43" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"5 {" k7 z0 D2 x. i
"M" "ThietBiDIEN" "C" "2" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
* Y6 U; `- k# l& n: i "M" "TEXTTXT" "C" "7" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1") I5 z- g% S8 b
"M" "TEXTVN" "C" "60" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
, M/ t% S: Z% R5 @0 v: t "M" "TEXTVNi" "C" "60" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"7 z: y' C% E, b- D1 X2 F9 s% p
"M" "THEPDAI" "C" "3" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
* E: u3 a$ {! Y "M" "THEPDOC" "C" "2" "" "Lw" "1.58" "" "LT" "Continuous" "" "" "LTSCALE" "1"
: t# ], a' l; ]# \& a$ z "M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.5" "" "LT" "Continuous" "" "" "LTSCALE" "1"
( a! ?0 m0 N$ H- v "M" "4-WateR_IN" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2"- B: B1 d! V. F9 {* `. }# I
"M" "4-WateR_OUT" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2"
5 U. h3 V# O. V "M" "KHUNGTEN" "C" "4" "" "Lw" "1.00" "" "LT" "Continuous" "" "" "LTSCALE" "1"/ f- _8 N7 e& O3 ]" F7 H, @0 P
"M" "TIMTUONG" "C" "5" "" "Lw" "0.25" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "20" ""))(princ)
2 z* k; @8 K8 e7 z; _& j6 Z5 ~/ M" U4 b: E2 i& e
(DEFUN C:SA2 () (setvar "DIMSCALE" 4111.1111)2 s: X1 f$ {1 B8 K7 J1 u
(COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.35" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "45" ""
$ E* P: h: i6 P* q0 k "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.7" ""
/ e; a2 {2 Z! u4 r6 B "M" "MANH" "C" "9" "" "Lw" "0.25" ""
6 F. h& ?2 k- V0 i2 ?& b "M" "TEXT" "C" "7" "" "Lw" "0.25" "": V" K2 f% c0 a- A# Y% z, _* q
"M" "DIM" "C" "1" "" "Lw" "0.3" ""+ V2 |2 ?% @! c" m
"M" "THAY" "C" "7" "" "Lw" "0.4" ""
& Q0 L/ G0 W5 r5 T2 Y9 E1 u "M" "NOITHAT" "C" "60" "" "Lw" "0.3" ""+ D! \, L8 B8 |& P2 K0 U/ H
"M" "HATCH" "C" "5" "" "Lw" "0.2" """ t6 n: D* H1 J# o6 E( ~1 a+ U
"M" "COT" "C" "1" "" "Lw" "0.7" ""* d1 l7 P ^8 v& I
"M" "Defpoints" "C" "7" ""
+ s& X& E5 L0 J$ l; a "M" "0" "C" "3" "" "Lw" "0.35" ""
- [8 m8 P _) l' g6 c "M" "CUA" "C" "6" "" "Lw" "0.35" ""- { {' j- c- d1 G4 d
"M" "CUA MATDUNG" "C" "6" "" "Lw" "0.3" ""
; z5 Y, q/ G! M# {. A: | "M" "DAY-DIEN" "C" "3" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"9 a3 y/ S$ K0 V7 j
"M" "NETDAM" "C" "4" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
3 e, }( a" p1 o: T% u' E "M" "NETTHAY" "C" "255" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"+ ?% c: y/ e/ r9 D
"M" "NETMANH" "C" "43" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"
% g! c9 ^4 \9 W+ D$ x "M" "ThietBiDIEN" "C" "2" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"
; Q6 z9 t: m" o7 L9 n "M" "TEXTTXT" "C" "7" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"
4 T6 U9 K. k0 T4 @ "M" "TEXTVN" "C" "60" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"; q6 k$ q) V/ A0 m# L
"M" "TEXTVNi" "C" "60" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"
2 T- N5 u1 b% j& a8 j "M" "THEPDAI" "C" "3" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"4 y5 l, t3 X0 ?9 b+ g Q
"M" "THEPDOC" "C" "2" "" "Lw" "1.58" "" "LT" "Continuous" "" "" "LTSCALE" "1": K$ L6 g+ E; b. ?: H
"M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.6" "" "LT" "Continuous" "" "" "LTSCALE" "1"
h. O7 T- x: [. X8 J "M" "4-WateR_IN" "C" "4" "" "Lw" "0.7" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2"
/ b3 K8 L: A, I; V& D "M" "4-WateR_OUT" "C" "4" "" "Lw" "0.7" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2" e4 V" J y: i, s1 B! g' P3 R
"M" "KHUNGTEN" "C" "4" "" "Lw" "1.20" "" "LT" "Continuous" "" "" "LTSCALE" "1"
7 F2 U& k2 s* a( ^' y* ^) G- h "M" "TIMTUONG" "C" "5" "" "Lw" "0.25" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "30" ""))(princ)% ^" k3 I. p$ {( h! v
6 w) j- B2 i, l5 P(DEFUN C:SA1 () (setvar "DIMSCALE" 4411.1111)
$ w, z% g A0 G9 ?( c& e4 U: }* a (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.4" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "60" ""
. ^# S1 D; e& X4 I9 T "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.85" ""
, f! B! U. _9 S" N9 q0 f! j3 w "M" "MANH" "C" "9" "" "Lw" "0.35" "", b# A- ]; }- b. J7 m* b1 I2 \
"M" "TEXT" "C" "7" "" "Lw" "0.5" ""
4 n, P! Q1 E) r) w0 [ d "M" "DIM" "C" "1" "" "Lw" "0.35" ""
$ z9 g* R3 I) k; Y2 ~( q" d, ~ "M" "THAY" "C" "7" "" "Lw" "0.4" ""
9 }( L) x% K6 @4 L4 I "M" "NOITHAT" "C" "60" "" "Lw" "0.35" ""+ B/ K; ^- ]; l5 T/ d0 s( _
"M" "HATCH" "C" "5" "" "Lw" "0.25" ""
8 I/ K+ J# x8 e6 j9 S& w/ ]2 z "M" "COT" "C" "1" "" "Lw" "0.85" ""
' ]. @2 H' R+ [: {3 u "M" "Defpoints" "C" "7" ""+ } V h/ x. G5 c. n, P, j! m* X
"M" "0" "C" "3" "" "Lw" "0.35" ""
1 S; Y3 u# Q/ Q" h+ H2 [ "M" "CUA" "C" "6" "" "Lw" "0.4" ""9 q L3 U7 y! i" ^8 f/ Z% @6 |
"M" "CUA MATDUNG" "C" "6" "" "Lw" "0.35" ""8 f2 C2 [! J, n5 Y# i
"M" "DAY-DIEN" "C" "3" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
* g/ X+ n% P! }, b- U, C4 U "M" "NETDAM" "C" "4" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"+ q! P: q0 @5 z
"M" "NETTHAY" "C" "255" "" "Lw" "0.9" "" "LT" "Continuous" "" "" "LTSCALE" "1"; D9 a, G* S9 x& E0 X( o; k
"M" "NETMANH" "C" "43" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"6 z, a; M, ~ u& `
"M" "ThietBiDIEN" "C" "2" "" "Lw" "1.0" "" "LT" "Continuous" "" "" "LTSCALE" "1"
& o* r r) m; E- B! d9 ? "M" "TEXTTXT" "C" "7" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
, D6 h5 {7 |1 ~% b# u "M" "TEXTVN" "C" "60" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"' V9 v5 b6 L0 a' O* [
"M" "TEXTVNi" "C" "4" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"
% G! k- o2 r2 o! K9 q" H M6 S "M" "THEPDAI" "C" "3" "" "Lw" "0.9" "" "LT" "Continuous" "" "" "LTSCALE" "1"" n+ j" C- v' a. P' R
"M" "THEPDOC" "C" "2" "" "Lw" "2.00" "" "LT" "Continuous" "" "" "LTSCALE" "1"9 z4 j! z, w' r/ X. v2 e3 l! Q
"M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.7" "" "LT" "Continuous" "" "" "LTSCALE" "1"# D. X8 q# M/ H
"M" "4-WateR_IN" "C" "4" "" "Lw" "0.8" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2"' L& f7 C# I, D/ `" B( F
"M" "4-WateR_OUT" "C" "4" "" "Lw" "0.8" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2"" G& m2 a6 [) A2 g9 z+ ]8 N
"M" "KHUNGTEN" "C" "4" "" "Lw" "1.40" "" "LT" "Continuous" "" "" "LTSCALE" "1"1 h6 t$ G, F3 A$ ]( i- A
"M" "TIMTUONG" "C" "5" "" "Lw" "0.3" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "40" ""))(princ)
/ Q0 r) {/ s, G# z& D4 l& o 3 q) W8 _, I# z
(DEFUN C:SA0 () (setvar "DIMSCALE" 6111.1111)
: F5 g' A+ w d) T3 { (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.5" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "85" ""
" Q( S. A. H8 u, M" `& h6 b# a "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "1" ""& ^: J% i# U+ `' m! T$ @2 K
"M" "MANH" "C" "9" "" "Lw" "0.35" ""8 y# i5 e, [9 X/ p! T% b
"M" "TEXT" "C" "7" "" "Lw" "0.5" ""3 p: @$ l; L; F6 R' C0 i
"M" "DIM" "C" "1" "" "Lw" "0.35" ""$ Y u/ a% e: P3 r8 }
"M" "THAY" "C" "7" "" "Lw" "0.5" ""
: ?* \; q1 o+ y "M" "NOITHAT" "C" "60" "" "Lw" "0.4" ""
2 a" U3 _4 L( o- u "M" "HATCH" "C" "5" "" "Lw" "0.35" ""
$ J! \9 d" Z; O6 o$ u "M" "COT" "C" "1" "" "Lw" "0.1" ""
9 r6 A. L2 v8 }/ G) A1 a: V "M" "Defpoints" "C" "7" ""8 @$ h8 Z- }8 x! a
"M" "0" "C" "3" "" "Lw" "0.5" ""
% B" k- c0 s6 k3 y, i0 e "M" "CUA" "C" "6" "" "Lw" "0.5" ""
$ K# x* ?9 f5 Y% K. S0 O# v @ "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.4" ""; w* [& F% b5 q/ V- K4 H- d
"M" "DAY-DIEN" "C" "3" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"2 a, r. k. R, p/ R0 E( N. U- c
"M" "NETDAM" "C" "4" "" "Lw" "1" "" "LT" "Continuous" "" "" "LTSCALE" "1"
' a8 C/ c; k3 B# K& x* \* ] "M" "NETTHAY" "C" "255" "" "Lw" "1.00" "" "LT" "Continuous" "" "" "LTSCALE" "1"
9 t2 y I; E B" g* C "M" "NETMANH" "C" "43" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"9 A/ \; Z( R5 o
"M" "ThietBiDIEN" "C" "2" "" "Lw" "1.20" "" "LT" "Continuous" "" "" "LTSCALE" "1"; {# v6 u- F) z2 F9 L! x1 N a
"M" "TEXTTXT" "C" "7" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"
4 }& U7 G$ B( K ~8 S "M" "TEXTVN" "C" "60" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"
, T n3 H$ x/ [; D, I "M" "TEXTVNi" "C" "60" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"
- g' u. a3 d6 L# E/ o8 ? "M" "THEPDAI" "C" "3" "" "Lw" "1.00" "" "LT" "Continuous" "" "" "LTSCALE" "1"
& h- E4 r7 R* z" M: C- ~; F "M" "THEPDOC" "C" "2" "" "Lw" "2.11" "" "LT" "Continuous" "" "" "LTSCALE" "1"( S& A& x% }+ D$ S, F
"M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.8" "" "LT" "Continuous" "" "" "LTSCALE" "1"# d1 y; t" S9 w$ J
"M" "4-WateR_IN" "C" "4" "" "Lw" "0.9" "" "LT" "FENCELINE1" "" "" "LTSCALE" "2"0 u6 d# k! t1 ~* W; ]
"M" "4-WateR_OUT" "C" "4" "" "Lw" "0.9" "" "LT" "FENCELINE2" "" "" "LTSCALE" "2"
- y* I' S# p# X1 s$ C "M" "KHUNGTEN" "C" "4" "" "Lw" "1.40" "" "LT" "Continuous" "" "" "LTSCALE" "1"6 M# _" o" R* V4 b
"M" "TIMTUONG" "C" "5" "" "Lw" "0.35" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "55" ""))(princ)
6 ?* I8 Q; F' F! s7 x7 c0 Y(DEFUN C:O () (COMMAND "OFFSET"))
* ~7 f, W8 X% M$ O! n- d(defun c:s1 () (command "surftab1"))9 k0 L4 o- |) A" T# o4 s
(defun c:s2 () (command "surftab2"))5 l6 Y; \8 P+ r* c* z s* s( t
(defun c:ep () (command "explode"))
& o( N3 Q: D9 o! c(DEFUN C S () (COMMAND "AUDIT" "Y" "purge" "all" "*" "N" "QSAVE"))3 L( ]3 I4 i! T
(DEFUN C V () (COMMAND "QSAVE"))
* q; Y: ]' Z$ Q7 s0 K$ B5 `7 b5 n4 _, K(DEFUN C:S () (COMMAND "STRETCH" "C"))2 d; J4 ]# r( J3 ?
& p7 J/ T9 t8 f5 T/ i6 f. o;************************** CAT DIM **************************
- c; F$ r m/ H0 N8 D
1 r2 @) `6 \8 F9 j" `+ i7 D' z(DEFUN C C (/ CMD SS LTH DEM PT DS KDL N70 GOCX GOCY PT13 PT14 PTI PT13I PT14I
+ T0 J( o) l+ ]) x: p4 |# R, y PT13N PT14N O13 O14 N13 N14 OSM OLDERR PT10 PT11)+ q9 H/ d' ?" T0 C, B$ X" q
(SETQ CMD (GETVAR "CMDECHO"))9 R. {$ S3 E! q1 H* O- F
(SETQ OSM (GETVAR "OSMODE"))
! L' ~. @/ c) A7 T. P0 u(SETQ OLDERR *error*$ l( l8 d A8 w) k: m' p
*error* myerror)
( G: P9 Z/ y9 ]/ Z. L, `5 e7 ?(PRINC "Please select dimension object!")$ s/ U2 Z' g' k# _
(SETQ SS (SSGET))4 @3 M+ K: _/ w, B J9 ~4 d
(SETVAR "CMDECHO" 0)) h, x! q5 U! m- _1 F z+ q
(SETQ PT (GETPOINT "Point to trim or extend:"))* N+ M+ F& C/ ^, N& s9 J$ k7 K O
(SETQ PT (TRANS PT 1 0))3 Y6 j3 \% U( A: Y9 E( ?8 x
(COMMAND "UCS" "W")
1 b8 M, v) |: H0 S @(SETQ LTH (SSLENGTH SS))2 s& `, s: j: [7 S/ |/ z' C
(SETQ DEM 0)) J/ M1 j; w3 g9 U9 V3 T& Q" H
(WHILE (< DEM LTH)% X p$ ]$ j" b0 N. A# s
(PROGN" H" h f5 u8 l
(SETQ DS (ENTGET (SSNAME SS DEM)))
: U* [3 V# g4 a$ t; h) \ (SETQ KDL (CDR (ASSOC 0 DS)))9 m! Y4 D- |, y; C! b
(IF (= "DIMENSION" KDL)
6 L; L3 a( T' V: f (PROGN. X: t+ d0 o% a$ c+ _4 J8 S1 ?
(SETQ PT10 (CDR (ASSOC 10 DS)))7 S( m0 B9 ~. M
(SETQ PT11 (CDR (ASSOC 11 DS)))
! h" u. L. ~9 x0 V! g3 w& p (SETQ PT13 (CDR (ASSOC 13 DS)))8 [0 e" B& S4 Q* a( N5 n r' y
(SETQ PT14 (CDR (ASSOC 14 DS)))
7 w! q4 Z3 L$ P+ | (SETQ N70 (CDR (ASSOC 70 DS)))5 Z0 Z! G$ n |$ m0 O* P: F
(IF (OR (= N70 32) (= N70 33) (= N70 160) (= N70 161))
* D" K+ a- x) p* y# x+ @; T/ {9 z ^ (PROGN
9 m2 W8 t5 l, I C, } (SETQ GOCY (ANGLE PT10 PT14)) n. R8 K8 l J8 X! Z, e
(SETQ GOCX (+ GOCY (/ PI 2)))% Y, i* ~8 ^/ C2 B# m
)
# O$ y6 O$ W0 o$ `+ {, Z; t4 j4 [9 _ )
& j% J1 x) r" O4 h (SETVAR "OSMODE" 0)
4 K1 Y5 Z J8 p8 w8 Q (SETQ PTI (POLAR PT GOCX 2))( X& t, {7 i, `! q
(SETQ PT13I (POLAR PT13 GOCY 2))
, q9 J& N' G& s( e/ Y (SETQ PT14I (POLAR PT14 GOCY 2))
G$ h4 j7 N9 w! E; e* j& x (SETQ PT13N (INTERS PT PTI PT13 PT13I NIL))
) s+ s" t T' N: n7 k' k0 w( B (SETQ PT14N (INTERS PT PTI PT14 PT14I NIL))
: k2 q$ N8 s) Y) H5 l (SETQ O13 (ASSOC 13 DS))7 q& y0 t" s! C+ W) d
(SETQ O14 (ASSOC 14 DS)): y! \; U7 p5 Q& M. t- u. ?+ A2 w
(SETQ N13 (CONS 13 PT13N))
; e, R f) S4 j (SETQ N14 (CONS 14 PT14N))+ @' h/ h" q3 r0 ?* V
(SETQ DS (SUBST N13 O13 DS))
2 V8 p1 S0 ?* v6 R: T& {/ F" A5 ? (SETQ DS (SUBST N14 O14 DS))3 q6 E2 X, X9 G& J. E6 Y$ D
(ENTMOD DS)
- X$ }, X( m; l ); I' r% }2 U& w# N3 W
)
9 s4 b3 {# V6 q. b& ^* m/ c: Q3 o, w (SETQ DEM (+ DEM 1))6 P" I2 g5 }6 P' T
)
" F7 L! u; R5 P+ }$ ^0 v)
. `, c. O) ~. ?3 b(COMMAND "UCS" "P")
. V8 D9 W' o9 @) ^( E. V8 m+ V' T(SETVAR "CMDECHO" CMD)0 ]! g* m# h6 E" W# Q6 u
(SETVAR "OSMODE" OSM)
" H* \* Q: z+ K! p(setq *error* OLDERR) ; Restore old *error* handler' b- j* W, E" Y6 z# X
(PRINC)0 Z1 H6 `1 q+ p& Q6 b% y" u1 {. ~
)
8 f# [2 }. e) N: k- A) V1 P/ r6 A
, d+ g3 _. o# M0 m$ _(DEFUN C:BD (/ CMD SS LTH DEM PT DS KDL N70 GOCX GOCY PT13 PT14 PTI
+ E" v d9 J) m# a0 \. {* i PT10 PT10I PT10N O10 N10 PT11 PT11N O11 N11 KC OSM OLDERR)
1 `2 I, w1 p5 L4 f8 X) k(SETQ CMD (GETVAR "CMDECHO")): o1 i1 f! U3 m$ |$ J5 g) h8 C+ X3 L4 C
(SETQ OSM (GETVAR "OSMODE"))
3 z8 i$ Y6 |" ~! m: Q(SETQ OLDERR *error*6 A% e# l6 ~! U8 v
*error* myerror)5 L) i3 U' L2 L1 I' T6 K8 f
(PRINC "Please select dimension object!")
: |8 E- k0 c3 H1 `( \- m4 q r6 K(SETQ SS (SSGET))5 R' T' B. y0 a* g
(SETVAR "CMDECHO" 0)+ V n6 b+ s- @, V) A) y
(SETQ PT (GETPOINT "Point to trim or extend:"))
1 [4 q, M. Q& n8 [; p(SETQ PT (TRANS PT 1 0))
8 j8 m5 q/ G }- Y(COMMAND "UCS" "W")
1 F" i3 p; o. S+ k6 g3 E(SETQ LTH (SSLENGTH SS))7 v# X) |8 A% X5 v& p) i
(SETQ DEM 0)9 G/ W+ D2 y0 \* d
(WHILE (< DEM LTH)$ m: I& z2 `* C! ]: T
(PROGN
. e4 [/ @% t8 ]* ^8 u. w G1 ] (SETQ DS (ENTGET (SSNAME SS DEM)))% |# r9 c U2 h, B# X
(SETQ KDL (CDR (ASSOC 0 DS)))0 M: z( v) v' o
(IF (= "DIMENSION" KDL)
) @8 j4 e1 F7 L! P+ x2 x (PROGN. h. {1 Q' q9 L
(SETQ PT13 (CDR (ASSOC 13 DS)))
7 s3 p& o. o- E8 n (SETQ PT14 (CDR (ASSOC 14 DS))) E( T! O3 d: B* L+ r% ]$ h
(SETQ PT10 (CDR (ASSOC 10 DS)))# C! T8 l* I' f8 d6 \. S
(SETQ PT11 (CDR (ASSOC 11 DS)))
; U0 e' {5 T, L4 F9 l9 s+ ]$ O (SETQ N70 (CDR (ASSOC 70 DS)))0 e) S( s% L) g$ m' g# e
(IF (OR (= N70 32) (= N70 33) (= N70 160) (= N70 161))- t' V/ w& B1 n. ~
(PROGN8 U0 e; H) A8 b& Q
(SETQ GOCY (ANGLE PT10 PT14)), x+ z* v. l/ V: B4 ?9 w( o
(SETQ GOCX (+ GOCY (/ PI 2)))/ c) Y- K9 p+ T+ `( H1 N
)
2 C" s" K- _# t0 U )# e% ~7 U& n; E; H% I7 S
(SETVAR "OSMODE" 0)* p* \& A4 |6 _% h9 m1 p8 a, e, H" o
(SETQ PTI (POLAR PT GOCX 2)), U3 |" {9 f9 w/ l1 g
(SETQ PT10I (POLAR PT10 GOCY 2))* t z$ r$ R9 c) B! T1 T7 t
(SETQ PT10N (INTERS PT PTI PT10 PT10I NIL))( ]+ w# h! o& I
(SETQ KC (DISTANCE PT10 PT10N))
: f. J0 Y/ U. m6 v, H, j: O- z6 U (SETQ O10 (ASSOC 10 DS))
/ l9 B- e/ P% n- I1 B (SETQ N10 (CONS 10 PT10N))
: s1 @. L/ S6 {0 ~1 H) S (SETQ DS (SUBST N10 O10 DS)) a- i+ }, |- t, x( N3 d
(SETQ PT11N (POLAR PT11 (ANGLE PT10 PT10N) KC))6 ]! U& M/ ]; {. ?" C% I1 @
(SETQ O11 (ASSOC 11 DS))
/ D" V5 o6 X2 \1 Q" n (SETQ N11 (CONS 11 PT11N))+ j# G7 W- b2 z4 D4 t, \
(SETQ DS (SUBST N11 O11 DS))
6 C$ K3 n" L" F: y3 u! t (ENTMOD DS)' D. B0 g" G; }$ _, F. c! c
)" _/ I9 j6 ?4 ~ F$ J- V: v# T
) v1 _ s9 ?/ ?" D5 s# d" O6 P
(SETQ DEM (+ DEM 1))
5 T* L& i+ c' X3 w' n& K )
# `5 t3 m3 ^ S9 ^) k- s; ~ f7 X0 w' X0 y" h/ o
(COMMAND "UCS" "P")
1 Y! m: r+ d! g. A v(SETVAR "CMDECHO" CMD)& l+ O2 X6 y& I$ z0 `0 v
(SETVAR "OSMODE" OSM)% t% J ~% w8 P
(setq *error* OLDERR)
$ I4 a9 `; ^ e# Q' V( y9 A(PRINC)
. |# j- s( W0 e& V, K: F9 R): G/ m9 E( e! N- _
* t5 g9 U! B( h
; I2 u( v! {, S5 j+ h, B8 \;;; ================ BAT - TAT CHE DO GACH CHAN TEXT (TU) =================
g3 S- k1 R7 N
2 X5 e+ M- ]' Y$ R! J# g& }6 ]* V! }(defun c:tu () (setvar "cmdecho" 0)(prompt "\nHay chon dong TEXT can gach chan "): S- b0 [( `: B
(prompt "\nSelect objects: ")(command "select" "au" pause)(setq sstxt (ssget "p")
5 O6 {4 e" e0 [# V0 S8 C. W1 S sslen (sslength sstxt) ctr 0)(command ".undo" "mark")(while (< ctr sslen)(setq listxt
* _9 ?' {7 y, J (entget (ssname sstxt ctr))txttxt (cdr (assoc 1 listxt))enttxt (cdr (assoc 0 listxt)))
0 I2 a, P @; Y6 {6 G (if (= enttxt "TEXT")(progn(setq testxt (substr txttxt 1 3))(if (or (= testxt "%%u")- A3 F& X& S. r0 X
(= testxt "%%U"))(setq newtxt (substr txttxt 4))(setq newtxt (strcat "%%u" txttxt)))
+ ?4 c# ?) G5 E/ V' y/ |, X( T (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))(entmod listxt)))
+ D" ^/ h, a5 _( v (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))! [1 g- n% |; a- t+ B; _6 R
% o: m% B z/ s& }
;;; ================ CHEN COT (TUU) =================
$ n- [$ y* `. U( ?' I9 E* B" h$ X4 y+ E
(defun c:tuu () (setvar "cmdecho" 0)(prompt "\nHay chon dong TEXT can chen cot "); U! T$ O1 W/ ~6 u+ l" K" l
(prompt "\nSelect objects: ")(command "select" "au" pause)(setq sstxt (ssget "p")* ^$ {8 D$ d3 q! S
sslen (sslength sstxt) ctr 0)(command ".undo" "mark")(while (< ctr sslen)(setq listxt
( W5 f$ d( D/ ?3 k) R: G" P (entget (ssname sstxt ctr))txttxt (cdr (assoc 1 listxt))enttxt (cdr (assoc 0 listxt)))4 k! Y6 ?4 |" M& n: @2 {
(if (= enttxt "TEXT")(progn(setq testxt (substr txttxt 1 3))(if (or (= testxt "%%p 0,000")5 y5 r6 @( h( B8 T2 b
(= testxt "%%P 0,000"))(setq newtxt (substr txttxt 4))(setq newtxt (strcat "%%P 0,000" txttxt)))
: N1 Y+ x: v6 v: Y; |( `. t a* [ (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))(entmod listxt)))" M2 T2 u5 `( h( h% ^. W
(setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))
& m) A. t, D$ G5 ?: W8 ^* G* ]
3 F8 D' ^2 h/ X6 m4 c;;; ================ CHEN KY HIEU THEP (TP) =================# K1 U+ A+ c/ {6 @: c3 ?
5 m% }0 T0 Z' c9 \(defun c:tp () (setvar "cmdecho" 0)(prompt "\nHay chon dong TEXT can chen ky hieu thep ")7 K8 ~; K1 s l8 u' R X8 E
(prompt "\nSelect objects: ")(command "select" "au" pause)(setq sstxt (ssget "p")$ E, q' m' z6 z0 c
sslen (sslength sstxt) ctr 0)(command ".undo" "mark")(while (< ctr sslen)(setq listxt
1 r# l: N+ G+ [/ v0 h8 O (entget (ssname sstxt ctr))txttxt (cdr (assoc 1 listxt))enttxt (cdr (assoc 0 listxt)))
; o; g# f) J# o* ?8 K+ p (if (= enttxt "TEXT")(progn(setq testxt (substr txttxt 1 3))(if (or (= testxt "%%c")- B- E' F; D; M% p3 b
(= testxt "%%C"))(setq newtxt (substr txttxt 4))(setq newtxt (strcat "%%c" txttxt)))) T* A& m1 }& f
(setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))(entmod listxt)))/ z; i w: ^ |& J! Q* d7 J) Z
(setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))7 |+ {: H: P0 O
, V5 W$ l; @/ o" E6 f7 A9 g
;=========================== TAM TUONG (TAM) =================================
f# P' V5 f$ R: P" _
# _! }- w. U1 k& [3 i& }/ I: M(defun c:tam(/ data_m)* ?+ r4 _% n! e% @ r
(defun import_data(/ i)(setq data_m (ssget))(if (= nil distan_m) (setq distan_m 110.0))
* m1 C7 g. ]8 L8 D" [ (princ "Distance (")(princ distan_m)(princ "):")(setq i (getreal ))(if (not (= nil i))
. n$ w7 q6 D& l! W (setq distan_m i)))(defun process(/ ent check)(defun p_check()(setq check 0)7 c3 ^' Z5 @/ f2 R! H
(if (= "LINE" (cdr (assoc 0 ent))) (setq check 1))(princ))(defun p_d_offset
- \2 R+ ^- A0 `" y4 L& V8 L (/ p1 p2 p3 p4)(defun makeline(/ e2 e5)(setq la (list (cons 0 "LINE")(cons 5 (cdr6 i5 s; H) \3 q
(assoc 5 ent)))(cons 8 (cdr (assoc 8 ent)))(cons 10 p3)(cons 11 p4)))(entmake la)(princ)) k" a3 ?9 p" `) }$ W: M
)(setq p1 (cdr (assoc 10 ent)) p2 (cdr (assoc 11 ent)))(if (not (= p1 p2)) (progn (if7 v6 i: z1 c* J+ v! s* Q0 D% z- v
(< (abs (- (nth 0 p1) (nth 0 p2))) 0.000001) (progn (setq p3 (list (+ (nth 0 p1)' N2 \7 o `. F6 w6 F) `" L( @
distan_m) (nth 1 p1) (nth 2 p1)))(setq p4 (list (+ (nth 0 p2) distan_m)(nth 1 p2)
9 z) n0 {) e g. k1 y3 _$ x (nth 2 p2))) (makeline) (setq p3 (list (- (nth 0 p1) distan_m) (nth 1 p1) (nth 2 p1)))
& L# X2 K8 P+ J- h6 z( W k (setq p4 (list (- (nth 0 p2) distan_m) (nth 1 p2) (nth 2 p2))) (makeline)))(if (<
9 `, a: w2 x' Z! j. M (abs (- (nth 1 p1) (nth 1 p2))) 0.000001) (progn (setq p3 (list (nth 0 p1) (+ (nth 1 p1)
9 l. `0 B5 U2 ]7 X- ] distan_m) (nth 2 p1)))(setq p4 (list (nth 0 p2) (+ (nth 1 p2) distan_m) (nth 2 p2)))4 w/ [: I* k7 A4 q* O! W; O( |
(makeline) (setq p3 (list (nth 0 p1) (- (nth 1 p1) distan_m) (nth 2 p1))) (setq p4
7 v+ q+ |& Q5 D$ { (list (nth 0 p2) (- (nth 1 p2) distan_m) (nth 2 p2)))(makeline)))))(princ))(if (not3 Q5 q/ g! B4 r% [$ T7 h
(= nil data_m)) (progn (setq i 0)(while (< i (sslength data_m)) (progn(setq ent (entget
6 w: R1 {; G3 Z* l/ I: t2 q% N (ssname data_m i)))(p_check)(if (= 1 check) (p_d_offset))(setq i (+ i 1))))))(princ)): v: a0 z2 s3 B( }) ?
(import_data)(ai_undo_push)(process)(ai_undo_pop)(princ))
3 _( e4 O( w0 a( G1 q* o, e" t$ z: D! _" U
;============ GHI CHU PHI (T1) ================
- d$ @' b {0 C, Z
. q9 C& [% R5 f3 g/ Y(defun c:DuongDan ()(setq D1 (getpoint " Diem thu nhat: "))(setq D2 (getpoint "Diem thu hai: " D1))
7 R6 L( g }/ y% N5 k) M5 [* h (if (> (car D2) (car D1)) (setq D3 (polar D2 0 16)))(if (< (car D2) (car D1)) (setq D3
8 q5 h3 D" `8 J3 F (polar D2 PI 16)))(if (= (car D2) (car D1)) (setq D3 (polar D2 0 16)))(if (> (car D2)# w, C$ ~' m/ K8 S; |
(car D1)) (setq D4 (polar D3 0 3.2)))(if (< (car D2)(car D1))(setq D4 (polar D3 PI 3.2)
. g: o7 K# f A ))(if (= (car D2) (car D1)) (setq D4 (polar D3 0 3.2)))(if (> (car D2) (car D1))6 w4 d# `/ `( w0 T) h
(setq D5 (polar D2 (/ PI 9) 3)))(if (< (car D2) (car D1)) (setq D5 (polar D3 (/ PI 9)
7 t8 E y; k6 E" m 3)))(if (= (car D2) (car D1)) (setq D5 (polar D2 (/ PI 9) 3)))(command "color" 1)
" }, I2 t: }) o3 m0 z (command "line" D1 D2 D3 "")(command "circle" D4 "3.5")(command "color" 7 )
! ]/ s# p4 y4 ~7 \2 [9 B' C3 E( N1 g (command "text" "m" D4 2.5 0 "1")(command "text" D5 2.5 0 "%%c6a150")8 G/ |8 B/ K) J1 u/ q% J- g1 P( x9 @4 _1 v
(command "ddedit" pause))6 {# y1 v6 ~- R- M
) U/ w m1 {- E) J3 n;;; ========================== Join (J) =================7 G, W+ F1 r o( C. a
( X( D0 u& E8 ~6 l
(defun C:J () (Setvar "cmdecho" 0)(setq m:err *error* *error* *merrmsg*)(setq sset (ssget)) X' s+ N6 V1 t+ U
(if (null sset) (exit))(setq kt (getstring "\nJoin all (Y/N) <Y> ? "))
2 N0 I0 v2 p7 f* L" B4 i: K, O (setq ssl (sslength sset))(setq temp (entget (ssname sset 0))etype (cdr (assoc 0 temp)9 x' F! n7 ?$ b4 W9 H
))(cond((or (= kt "Y") (= kt "y") (= kt ""))(progn (cond((= etype "POLYLINE")/ p! `- ? H: o: y
(COMMAND "PEDIT" sset "J" "all" "" ""))(if (or (= etype "LINE") (= etype "ARC"))* S/ j% f5 ^+ O7 w
(COMMAND "PEDIT" sset "" "J" "all" "" "")))))((or (/= kt "Y") (/= kt "y") (/= kt ""))
8 H6 c Q8 e+ J3 h/ x (progn (cond((= etype "POLYLINE")(COMMAND "PEDIT" sset "J" sset "" "")) + J9 ^. T' O8 y. _, p
(if (or (= etype "LINE") (= etype "ARC"))(COMMAND "PEDIT" sset "" "J" sset "" ""))))))" p$ u8 Y- Y6 d+ h0 j% A% A0 O
(setq *error* m:err m:err nil)(princ))
5 A) v* D* @% Y7 g; X1 P5 W
9 T* S+ ~! n, S;=====================================================================. X1 b+ g# ]5 r
;;; DOOR.LSP 1.0, Copyright (C) 1998 by CAD Department, HUCE.
% y ? W3 j) E# c;=====================================================================
+ i6 m% s. \1 e3 [* c1 t$ f( i& E
* r: Y P: M Y: T. A1 e(defun C:D1 (/ p1 p2 p3 p4 side dis wid ang angsile old)5 \% ~5 t. N' o3 P `5 s
(setq old (getvar "OSMODE")) b) P6 ~( s8 o
9 s {) l' X% z& C2 p8 Q1 { (setq p1 (getpoint "\nStart point:"))
7 [/ ]1 p! }8 g8 B1 Y) ]% j5 p (setq p2 (getpoint p1 "\nEnd point:"))8 y( Q5 M7 W0 r& h7 @3 u: L
(setq side (getpoint p2 "\nOpen side"))8 N$ h% L: l$ _; r4 i7 w
2 e' b/ c: l0 @" r( ?+ K. y (setq dis (distance p1 p2))
* z# I( I' J1 K# |' v- E6 e (setq ang (angle p1 p2))
! y# H; y+ ?; h- a0 p, k- p6 B (if (< ang (angle p1 side))+ o# b; Q: `' ~
(setq angside (/ pi 2) )
, c0 L9 l" [% C9 N5 E8 z: ]" P8 i (setq angside (- (/ pi 2)))
8 q+ @4 o* N3 r5 D )
9 ?# g1 A U4 y4 a5 s. q (if (>= (- (angle p1 side) ang) pi) @5 q Y) O9 L* R7 N" J2 k
(setq angside (- (/ pi 2))), j* E: g! ~. l& ~
)! `4 G3 r: N1 y# j V% B. O
(if (>= (- ANG (angle p1 side) ) pi)4 l0 I% i% Y) ]5 q: p
(setq angside (/ pi 2))1 s3 \/ H0 L! T3 }4 { }; g8 j
)5 Z8 G4 k; p8 Z* s# @) e: U
. S6 M: T. C7 D5 F, A: z
(setq p3 (polar p2 (+ ang angside) dis) ): t! i7 {8 u7 Z/ U* Y. z
(setq p4 (polar p1 (+ ang angside) dis) )
) S0 w8 ^; G$ P j5 C: W (setq wid (/ dis 15))
9 G6 d: y; L* }* u
' b3 |; N8 ?9 K) l. K4 B" a ?8 \ (setvar "OSMODE" 0)
, a3 {1 c+ _' W! R J4 B6 q
8 V* }, U Y1 D- x% j) W (command "PLINE" p1 "A" "D" p4 p3 "L" p2
# P/ q" K3 {/ s; u (polar p2 (+ ang pi) wid) ; G% g. B M8 [2 T, [* G$ X* m: N
(polar p3 (+ ang pi) wid) 3 u+ g" ~4 V+ X/ M
"")" v0 ?0 V$ x( W# o; v) Y, P! A& q
! K" O9 e3 x( i! ?7 \
(setvar "OSMODE" old)6 Z+ ~& q5 o. F/ x
(princ)# |. Q4 C) z2 v& I2 Z" S9 |
)
' `5 S c. \! B. }6 b1 x# l/ U- O- T9 b# F4 X2 E
;=====================================================================
. V; \! A+ O& _0 f- B# V/ ^
8 f' ?: ?+ I, o$ z(defun C:D2 (/ p1 p2 p3 p4 side dis wid ang angsile old)
7 n$ F3 g$ Z# K3 ^ (defun cua1 (pt1 pt2)
) @; k' H* _. l: B1 S# K" Q; Y (setq p1 pt1% W& h) k' A+ d- `' }: B7 o
p2 pt2)
, M7 p$ N" o: L; S& v
0 O5 H; N1 V" l) _8 p, @ (setq ang (angle p1 p2))3 F( P8 {+ L8 p' ]
(if (< ang (angle p1 side))- z* H4 h7 _4 J6 k+ I6 r( W
(setq angside (/ pi 2) )7 G5 S2 q' A4 S
(setq angside (- (/ pi 2)))4 W# N4 b, ]7 d
)
9 c1 L, m7 Q- s (if (>= (- (angle p1 side) ang) pi): o, O/ ~0 U9 I1 f/ m
(setq angside (- (/ pi 2)))
7 @4 j8 k/ a8 X7 h, h )
' l, T3 e3 z& t, R (if (>= (- ANG (angle p1 side) ) pi)2 a3 ]( I' w/ y: l
(setq angside (/ pi 2))+ r* {, F4 D; d0 X
)
$ J/ i4 v9 A. |
* |; \* ]/ q7 e+ P. B! } (setq p3 (polar p2 (+ ang angside) dis) )2 m7 C/ a% s f
(setq p4 (polar p1 (+ ang angside) dis) )" M: _/ U4 l" y8 S* s/ l$ S5 Q5 C9 k
(setq wid (/ dis 15))4 |' W$ y* m" x0 d6 N3 p
8 t$ S, T6 B: n j- L (command "PLINE" p1 "A" "D" p4 p3 "L" p2 u+ ~- X5 y2 Z) g/ t
(polar p2 (+ ang pi) wid) 8 `9 S6 B! F; a' F. n
(polar p3 (+ ang pi) wid) 6 c- s8 l( ^+ e9 t8 P3 w
""). Y4 n2 V* O* p; C$ M
)$ c& m6 X; X3 ]$ U
;=====================================================================
7 A9 o( `; |9 Y f0 {2 } (setq old (getvar "OSMODE")) ! q' C& s. w/ Q% t
" F- ^9 [/ i# h2 N1 [# ~ (setq p1 (getpoint "\nStart point:"))
8 M; q2 z, D" \% @ (setq p2 (getpoint p1 "\nEnd point:"))
& B5 v" P1 i& f' r* H (setq side (getpoint p2 "\nOpen side"))
3 `8 u' R; ~9 y
% K( G/ @7 G# l* @! X9 _ (setq dis (distance p1 p2))6 P& F9 v! Z/ j/ N
(setq dis (/ dis 2))' u% g) X1 M3 `$ x7 j
4 g1 E- h3 D7 x3 w+ L. k (setvar "OSMODE" 0)
- B5 N: | v- V3 m
4 n4 ~# v" q1 Z5 w% ] (setq p1 (polar p1 (angle p1 p2) dis)), \! D% n, S" B k: ]" @
(cua1 p1 p2)
& g' `. B/ r# H9 A
. S( ?# ~, F% G (setq ang (+ ang pi))
8 s1 ?; Y% [3 ?" Y0 Y2 W0 G (setq p2 (polar p1 ang dis)) K& a! L4 d1 _0 v/ [
; (setq side (polar p1 () dis))
: G6 S; F) C& g* d, g: `$ P (cua1 p1 p2) " |! Q, R O) W% s& b
6 `8 g' @ s! {3 H (setvar "OSMODE" old)
& j4 b! f D) m" Z3 O2 r' q (princ). A O# n# `9 R, `; e# C9 v: }
)$ \ P& J0 p7 D/ Z( V9 W( L+ N
% H9 H4 ]4 R) w% C# b, G. x;=====================================================================0 L# a- o) f( }1 J
;"Glue" text strings. All adopt first's properties./ ?0 B/ h5 o+ O! A! s7 U# D3 Z
; Author:* z3 m9 p6 [- D5 E
; Henry C. Francis
% e5 j, L+ k8 K; 425 N. Ashe St.
& A# I* d% N7 p- E K% M; @; Southern Pines, NC 28387' `1 m( O; e1 E! U: }( v
; http://www.pinehurst.net/~pfrancis. g: I$ i- D0 @- ^2 O2 o+ H! h; r6 `( t, N
; e-mail hfrancis@pinehurst.net1 |1 h! _8 ?1 J0 q1 ]
; All rights reserved.: i3 f# T% Y4 g9 G. v! a
(defun c:gst ( / ename ent1 ent2 old1 oldsl old10 old11 old40 old50 newstr newsl new1 new10 new11)/ y# p. g L( A6 ]9 L
(while; A: k+ E* L3 F9 Q$ F/ M: f
(not
( ~5 F7 C$ r/ Z$ p* }$ Z: Y% K' u (and G9 q, L# A3 [) \4 W
(setq ename1 (car(entsel "\nSelect first text string to join: ")))1 o; A& R0 _! {0 R0 s
(setq ent1 (entget ename1)); N' f' O& P9 Q0 A2 Q+ z. i8 T
(eq(cdr(assoc 0 ent1))"TEXT"), O2 G- z# Y6 W* ?* X' f
);and
; g, v. j! j* O+ y );not
7 R. H" F$ X! h. b* C- E);while1 U' A+ k9 V+ Q) e' J9 ~+ R( [6 s
(setq old1 (cdr(assoc 1 ent1)))
) B5 F. \& I+ y! F: k(while
" W1 Q7 @) D K1 h (not A5 L: c; ^2 H8 j9 W0 C% Y
(and! ]& T. C& h* M/ \
(setq ename2 (car(entsel "\nSelect second text string to join: ")))
6 s1 z1 P# `6 }$ _$ u (setq ent2 (entget ename2))
- X9 [$ \- t. X5 _ (eq(cdr(assoc 0 ent2))"TEXT")* F0 ^" Q4 _. Q) D+ ~( \7 L5 R) X& n
(not(eq ename1 ename2))
8 h r5 b# I+ q P. I& { );and
/ ?$ @" a5 U) O- A) I );not$ Z& ]% m0 W; }: ^9 M5 g
);while3 V7 L; ?4 t/ D4 q
(setq old2 (cdr(assoc 1 ent2)))
9 _* x; K1 s5 H$ E7 k& j(setq new1 (strcat old1 " " old2)
) J' w; z2 ^+ V# M& G- N3 n+ M ent1; y) Q T( s$ Z( f
(subst (cons 1 new1)9 i$ @1 F9 l5 v: l3 P- \. {# h8 v
(assoc 1 ent1)0 \1 X8 I T" z: F/ A* s9 k3 E
ent1)" Q7 k* c/ ?& {9 n) Y. I
);setq
) Y6 f1 @* r" j* c" j; n(entmod ent1)% M2 ]3 @& o, U7 B4 J0 A" ]3 g
(entdel ename2)3 G: \0 F0 _+ ~1 r+ ? b
(princ)2 a, T7 Y. ^, [5 h- U) q+ a
);defun$ x+ B& ]8 N. F* D3 Q! b( C
" V& y$ U% {0 g( J7 T" H+ A+ [;=====================================================================
9 k4 q3 R m; C- [$ W0 V3 z$ [6 r: T* }" Y: f1 W2 o! p
(defun c:nt (/ g1 g2 ss1 olderr nterr l i temp e1 e2 new old dd dc)
" P% n' u9 _. h- i) ^+ r6 _& f: G3 D; v: r, ~' {
(defun nterr (s)
7 g* n) }0 v( D (command "_.UCS" "" "_.UNDO" "E")& X7 u# p# ]( l. d9 r
(setvar "cmdecho" 1)# s4 Z2 d6 v, t$ Q. r
(setvar "blipmode" 0)
8 F+ }8 w& a) ?8 J" h8 O& P# o$ | (setq *error* olderr)
- z0 W; a0 k0 S6 k (setq g1 nil g2 nil ss1 nil e1 nil e2 nil olderr nil
4 m" V1 g- i/ z. [ nterr nil temp nil i nil l nil new nil old nil dd nil dc nil)0 y" M: ]# {" d& d2 o
(princ) f8 R. w d8 w' `$ U
)/ n P% o' R1 s+ e& Z
% T- x$ ?* B$ N) k2 O! I1 F (defun tim_in (dt / p01 p02 ktra)9 ]& Q7 \. \: }$ e
(setq p01 (cdr (assoc 10 (entget dt))))
( e2 T2 K5 t$ E& V (setq p02 (cdr (assoc 11 (entget dt))))
8 s) Q; R% _* n' Y" c! S (setq ktra T)
( |$ i. N% T: p4 j! O/ I) G0 I (if (and (> (car p01) (car g1)) (< (car p01) (car g2)) - x( b$ B7 `4 Y4 Y9 I8 ^! T8 \
(> (cadr p01) (cadr g1)) (< (cadr p01) (cadr g2)))
3 |& L- y/ ~, @9 G+ p; { (setq ktra nil)( z4 P. v. ~- A3 c! _3 W, |
)
4 I8 i+ B' Z1 Q9 O! C. A V3 C (if (and (> (car p02) (car g1)) (< (car p02) (car g2))
& n5 M3 R/ i# s (> (cadr p02) (cadr g1)) (< (cadr p02) (cadr g2)))
1 A: ?- A: M/ J# [5 G (setq ktra nil)7 d5 V* E4 H- @6 G* I
)& I! v! |6 F: h) H- W$ @
ktra" `* R# R$ Z) ~+ g% E; T# G
)* K2 h$ |# u2 s0 l/ P" a! {
( ?) _3 f/ U+ Z
(defun timdt (dt1 dt2 / p01 p02)
' d3 S# a, N/ p% [6 i# X( W: }" o& m (setq p01 (cdr (assoc 10 (entget dt2))))
3 ~; {- _ [- r$ K+ S (setq p02 (cdr (assoc 11 (entget dt2))))
. g5 I- T, Q( l/ C (setvar "ucsicon" 0)
' f0 o% A: F( u1 x T (command "_.UCS" "E" dt1)/ M. L4 i! z1 ?/ q
(setq p01 (trans p01 0 1))9 W ~5 R* x9 u5 Q3 m# n
(setq p02 (trans p02 0 1))
1 {. N! e7 o, o" B& ]. I- e& K (command "_.UCS" ""). `: r- v9 Q& {8 L
(setvar "ucsicon" 1)
5 U/ q! Z2 y, D( ^+ d4 N (if (and (equal (cadr p01) 0 0.001) (equal (cadr p02) 0 0.001)) W% ]7 G' s5 w" I; F
T9 K5 Y5 D+ _* B
nil
X1 h9 C- G0 a( B6 ] )
! d& O; P( @ P+ g- g& i1 t ); `2 k" P. O d( }3 g6 K
# t+ o3 `! Y: J! \# I$ n1 B5 ?, e$ _( a
(defun tim_out (dt / p01 p02 kt)8 r- `4 P" f, j5 l& |! l5 e4 x
(setq p01 (cdr (assoc 10 (entget dt))))" y1 F! [! e7 e; Y2 _( ], W. h" {# a a
(setq p02 (cdr (assoc 11 (entget dt))))
: ?# ?# s: q2 j (if (and (> (car p01) (car g1)) (< (car p01) (car g2))
p; S' c! B( }3 i0 i" I (> (cadr p01) (cadr g1)) (< (cadr p01) (cadr g2)))
. j$ e' Y4 l. C# R% M: {8 i (setq kt p02)0 A; r9 s+ t9 [8 H1 h5 [, e. U# S
)/ s+ `& n) Q6 S D+ v7 D
(if (and (> (car p02) (car g1)) (< (car p02) (car g2))
; g/ ~6 }$ y3 z6 H& y$ k* S; L; V# k (> (cadr p02) (cadr g1)) (< (cadr p02) (cadr g2)))
2 E5 k% j7 F' P* g (setq kt p01)
% u* _' ?6 r* T4 h4 r )9 H; w( y& _0 a7 a
kt
. Y. n2 k& w* v c' o5 z )4 L' I& N+ J3 O( Q3 s
* b+ u- m3 |; z( r (setvar "cmdecho" 0)
$ q0 A. A. f) O4 s (setq olderr *error* *error* nterr)
: g* O& T& `( k0 `' s (command "_.UNDO" "G" "_.UCS" "")
2 a0 n, R1 ~7 p' n9 X! Z; n (while (null ss1): i9 m2 H: b g' ^1 G! e, Z: S1 }
(princ "\nChon tuong muon noi...")
% F" g" y7 J J$ ~5 f) ?0 b (initget 1)& b* L$ F p* Q9 s% [+ e7 t
(setq g1 (getpoint "\n>Goc thu nhat:")), n# V9 V4 y, N
(initget (+ 1 32))7 J0 p' I0 V: h. A
(setq g2 (getcorner g1 "\n>Goc thu hai:"))
+ K/ U; B: h3 X+ n W! o (setq ss1 (ssget "c" g1 g2 '((0 . "LINE"))))
# @; B& I+ Y; C, n (if (null ss1) (princ "\nKhong tim thay doi tuong!"))% m( k2 v8 c0 k$ T
)9 A* `- p. e" J/ Z
! l" p/ {" e% l$ K0 f( A (setq temp (list (min (car g1) (car g2)) (min (cadr g1) (cadr g2)))
: j4 j' _" G2 Y7 Q# i g2 (list (max (car g1) (car g2)) (max (cadr g1) (cadr g2)))3 W! O3 o- u" u2 _7 V- ?! |- _% E
g1 temp)
8 J# K8 Y. ?# p! y (setq ss1 (ssget "w" g1 g2))7 p6 e# V! u" U W( G7 J, m! h1 {
(if ss1 (command "_.ERASE" ss1 ""))
9 @) m) s; ~" `8 } (setq ss1 (ssget "c" g1 g2 '((0 . "LINE"))))
( ^$ W9 k& j `& V% q* S+ K& X; V" ^! `+ n" a* V* h
(setvar "blipmode" 0)7 k8 n( x$ c6 P1 n0 X2 h, M
(setq i 0 l (sslength ss1))
/ `3 V5 F3 V& j! \1 B( J( h (while (< i l)
: \) g# {/ k/ L- i" c (if (tim_in (ssname ss1 i)), { H/ m5 m" E1 l
(progn
; f7 [ ^' i& C (ssdel (ssname ss1 i) ss1)) W& y+ @& L" s# v) B; d. _
(setq i 0 l (1- l))* U! D; `. P7 _ N9 `( d3 n
) Z# S a( ^" e, E% O
(setq i (1+ i))* B9 e( ]3 k6 H+ Z- ^+ a6 ^
)$ a; d: X1 Z u# h. D4 Z0 O
)! b5 x7 H; d* Q4 F6 a6 x/ A
(setq l (sslength ss1))
- M! X% [, Q( o. a6 ]$ d (while (>= l 2)& S5 g: q% j \" Z( k
(setq e1 (ssname ss1 0))8 m0 R/ p% [0 B
(ssdel e1 ss1)3 K9 W( L5 @- Y" @2 H
(setq e2 nil i 0 l (sslength ss1))
% b; I5 M3 R z& a1 a! r7 ` (while (< i l) 1 k" i( o. Y6 C8 X* L
(if (timdt e1 (ssname ss1 i))
: g& I0 X0 W3 d) Q (progn
8 s8 A) D8 }& G1 O* y (setq e2 (ssname ss1 i))
& Q8 ?7 J. c" y$ n (setq dd (tim_out e1))/ h# x! C8 v# Q, r
(setq dc (tim_out e2))
" W* K2 F& x4 F )
. [5 e! R' A6 U8 O2 | )
2 ^- l- J. G) _; C. z (setq i (1+ i))8 H$ a4 [' w- H( C' U
)
# \# ^- v) H h. g/ X (if e2 (progn
+ S7 i3 Q# P# W/ E9 L6 q (ssdel e2 ss1)
8 v3 D0 q% c3 f# i; B+ ~ (command "_.ERASE" e2 "")
. w! X8 B3 e! F! d. T5 I (setq temp (entget e1))
7 u7 ~( r4 ~# A" b; j! y (setq old (assoc 10 temp))- z: {5 ^4 L6 Z2 c4 N
(setq new (cons 10 dd))
& d3 v$ h& w% o, p' y (setq temp (subst new old temp))
& I, { V1 E; s& v (entmod temp)
d0 k0 p) [! o6 Z1 V# C- b Z (setq temp (entget e1))$ ]/ {0 u/ U# W* a$ U+ E; X
(setq old (assoc 11 temp))
& t/ Y' y \5 C* [ (setq new (cons 11 dc)) N h0 `7 z' ]6 C# T; ~+ D
(setq temp (subst new old temp))9 }" y% [% p) g
(entmod temp)
C+ N, q/ c, I (redraw e1)
5 O3 H8 W6 Z! V. E( D (setq l (sslength ss1)) a- W( u( V& S' s* Q
)1 \7 S9 G5 j) H& n- l. x
)
. c5 a4 m' {2 o! _5 x/ d$ ~ )# m' J( E5 S5 x4 V5 I: p3 |
& \" M9 ], i( l- `5 p: S (command "_.UCS" "" "_.UNDO" "E"): R7 Q% J L) W- j* m- C
(setvar "cmdecho" 1)
" [4 z: u [" w3 T- f5 I7 O (setvar "blipmode" 0)8 R) o* j+ f+ h3 J7 T
(setq *error* olderr)6 R) i% D g9 m; N
(princ)
, K" ?- k1 a0 S; X/ q; J: C3 P- T) K), R" J1 A) u9 P; X6 G, F
;*********************************************************************+ c, [; f; T$ a- I& n- P6 A9 K
(defun ketthuc ()3 I8 P0 r) C+ P t6 v3 Q
(setvar "cmdecho" luuecho)
3 `3 \3 D* z2 H' k, R2 t6 |( i (setq *error* luu$ }% O, e" q$ u) T
luu nil
4 f& [. b' J/ ~, {! I luuecho nil
$ c( T8 _& K3 p' x; N0 L" ^6 T4 W );setq
; A. \0 x8 S; h: ^! q (princ)" w9 G8 P5 \3 R5 a' ?
) 9 r. _9 b- V* W; @
;*********************************************************************
4 ]1 v& A3 f9 R4 | U(defun modau (); [1 q1 Z$ I: D) x9 ^' x
(setq luu *error( ^9 X6 V* I; I1 T
luuecho (getvar "cmdecho")
' ]$ x' S( v k Y0 w7 t *error (ketthuc)
% G2 ?1 q, ^' O+ G)& E8 R( {$ V2 i% ~. d1 B
)
4 q; _7 E X5 r' F# n;*********************************************************************4 _* W. @; j9 C8 s0 h8 W" d3 X
(defun xulytext (text / kytu ma sokt luusokt lui )
/ d: L4 Q$ C. g& m: A Z, Y- I(setq kytu (substr text (strlen text))
# ]- r( x8 `+ o) i# z- x ma (ascii kytu)
5 m A7 j3 D7 m E, c sokt (read kytu)
; V$ J7 M# N7 W: { lui 1
) `* t! ^& H' Q: |: c)" f9 v! }) T, O6 O+ [. f9 m( C
(if (numberp sokt); b* v7 N* G3 o6 Q0 Z U
(progn7 q) U1 {, m5 p0 A; {* h) q- K
(setq luusokt (1+ sokt))1 D7 Y" z7 ^& b; V
(if (and (numberp sokt) ) |' K) Q3 j% a Z( i/ S% N
(> (strlen text) 1)8 V, ^1 S7 _# {
) $ M1 x/ j* p' ]/ {3 n0 m) U' S
(progn
4 y# ?- d. p0 x7 i5 ?5 y' g" c4 _ (setq kytu (substr text (1- (strlen text)))
* V `- ]" Y3 x2 Q sokt (read kytu)
' l7 s' O) X, L( H: B )
5 b7 [! [, D- M5 l (if (numberp sokt)
% Z3 u/ J# S% x* Y4 n( g (setq luusokt (1+ sokt)3 b- e: A) S/ m' T: ?2 Y& F9 ?
lui 2
% L/ x3 ?0 [/ X! r0 f8 g+ {
( x' v/ d7 e4 G7 M )
* s+ C. Y$ R& L4 T$ _9 ? )' C/ V# j/ B' Q, P3 C
);progn
; [) B+ \# g: z )
5 {: k" L8 X- j$ `0 y. x (if (= luusokt 100) (setq luusokt 0))$ J" a$ S, T0 U0 ], Y x
(setq kytu (rtos luusokt 2 0) O. P* _8 S$ U- p
. Q; a- L& } q# P- Y' q
text (strcat (substr text 1 (- (strlen text) lui)) kytu)
% J6 p' H8 n3 m8 B' z4 z, H )
" Q8 K+ a( L$ i );progn
0 T9 d$ g% [0 P& M$ D# E9 U (if (or (= kytu "z") t+ m% x/ E3 l, s W
(= kytu "Z")1 E" y- N8 j+ x/ D0 u4 ^/ H2 b
)
! y% ?+ o8 O( W1 R; Y+ t (setq text (strcat text "0")* ]" j+ l0 `. _1 D6 I
textxl "0"% L% i& j' h- \" s( Q6 G! r. g) V! K
)
! R0 p: q5 j: v$ ~$ P% x (setq ma (1+ ma)- N' L: Z* |0 {6 e6 j3 z- b
text (strcat (substr text 1 (1- (strlen text))) (chr ma))4 s! v5 u6 T+ R; k4 s8 P$ v
)' H( r, c; a& p/ j: g
);if
- Z, K9 x1 p+ V: M- M. [);if
P0 c$ w7 U' [$ i)
# }7 f3 f4 X0 U3 u* q;*********************************************************************
) _9 W$ ~: g8 h% _' G& r(defun doitext(tendoituong / chuoi doituong thoat tam dsach kieu text vitri10 vitri11 dem canle)
$ V6 Q9 {' `# \;Neu doi tuong la text thi tiep tuc
! |' |/ s# F: Z3 {, T+ n" f: C(setq doituong (entget tendoituong)
1 I1 r( M4 M& p5 K kieu (cdr (assoc 0 doituong))
4 B- m$ ]9 _2 |' |5 z% n/ k canle (cdr (assoc 72 doituong))
- X4 f6 B, B" D5 _: x& I)
* J; q# _" P' i7 l( O4 S$ B(if (or (= kieu "TEXT")( g) ^8 E0 P' m" ^( }7 ~6 S
(= kieu "MTEXT")
) b& C9 v. `8 a )
- j2 t4 i3 L( U: D6 M2 V8 k (progn- \1 }) I, L) z2 i6 p5 c: ]
(setq textxl (xulytext textxl)3 F7 G0 F- ?) L. b- z& j9 P7 u
text (cons 1 textxl)
: u* D) ^/ o" X0 ~5 I$ B vitri10 (cdr (assoc 10 doituong))" U9 h% [: ]/ |2 h9 R
vitri10 (list (+ (car vitri10) (car vitrilech)) (+ (nth 1 vitri10) (nth 1 vitrilech)))' k8 h. R) B8 h4 g! G
vitri10 (cons 10 vitri10)4 j( \ d2 k. Z+ R' b. i! @ M
vitri11 (cdr (assoc 11 doituong))- _2 E5 n8 ~ e! O% t8 p
vitri11 (list (+ (car vitri11) (car vitrilech)) (+ (nth 1 vitri11) (nth 1 vitrilech)))
, e2 q9 F+ T) P- \$ e8 O4 {2 ~0 b vitri11 (cons 11 vitri11)
/ M0 m/ W3 }/ f* e dem 02 h- D4 a% Y" |$ A+ J* y
dsach nil
0 \; k7 D3 v1 F6 \9 `2 d )( \ z! a: I! j% i, Y/ f/ R0 ~
(foreach tam doituong
# B6 B% X4 n" C: a$ a& Y (cond/ N9 ~8 A$ [" u# _
((= (car tam) 1) (setq dsach (append dsach (list text))))+ b6 i9 |+ z" b$ F/ H; [( N
((= (car tam) 10) (setq dsach (append dsach (list vitri10))))
% H: I! W8 U h& ?. v, ? d( K; _ ((= (car tam) 11) (setq dsach (append dsach (list vitri11))))7 y3 Q% U+ D1 {# ^+ I
((setq dsach (append dsach (list tam))))
; W8 l k I$ h% y$ t )
- S0 {5 k8 X9 x: c& c4 A0 f9 ] )
+ W( O* O; e/ a- q (entmake dsach)
! y/ ~# l b9 A2 I );progn
. d3 B6 s' [+ C& Q/ A# G7 X);if$ C$ K, t, W9 ?) P( ]
);( @7 l# g7 V, K8 w+ H
;*********************************************************************
3 S Z) y- F" J7 k3 Y- j% O;sao doi tuong cu sang vi tri moi, r# t! \4 s) P$ q' i
- ?+ x: ?2 B. f1 w7 E7 x5 W, J(defun copy_dt (tendoituong )
( X+ b0 K9 H4 g8 w* H(command "copy" tendoituong "" goc toi )% o" s; O* f6 z4 g- \1 X
);defun8 |# g/ y1 _9 h6 ~5 S+ j
: T0 t7 W: y' v4 z, Y;*********************************************************************; z- I/ q) \& Z& B. N7 ?+ M& h( W
& s8 j3 I6 s* n# l& d0 S1 ]9 \+ y; i) }
(defun c:ct ( / cumdt dodai thoat dem ten doituong textxl dem goc toi)
9 R8 w, K7 T0 Y, U; Khoi dau cua chuong trinh, l/ G9 [' B, \! r1 z
(princ "\nCopy Inteligent...\n"); p" k% V0 f$ P% w5 q
(setq luuecho (getvar "cmdecho")- C/ B3 ^0 ^5 ?
luu *error*
& K P2 T; b- f3 N0 H: ? *error* ketthuc
( Y- l- C4 m3 t/ r3 O' t1 c cumdt (ssget)
1 I" y% M+ D- k' E+ C! |/ a dodai (sslength cumdt); N* }9 f7 F% Q" E" z3 N$ E, F" W
goc (getpoint "\nSelect base point:")& |: R j, r! H% ], \# s
thoat nil
7 W. a; a; r) z$ ?1 a: d* u6 K- y dem 0- ~+ B/ C) O+ O9 N H: ], s
textxl nil
& w, _6 ~5 G9 r);& N L: e4 ~. _- W' c
(setvar "cmdecho" 0), s! A4 w c+ H/ A
; Loc ra duoc ong text de xu ly, D3 t. V* H7 n+ C2 A
(while (and (= thoat nil)
4 i# Z6 [4 m. r- t6 H (< dem dodai)3 l" N3 ^) L; k% ]& z
)
/ D0 Z4 C) S& O3 R% {0 w (setq ten (ssname cumdt dem)9 O7 F' e0 p& O5 z8 C8 v, X( Y6 B
dem (1+ dem)
1 w5 J3 F4 `8 B8 u7 K( D" i1 f doituong (entget ten)7 [% V. B5 i" O# e
kieu (cdr (assoc 0 doituong)) + Y7 S0 W" h9 _
)
2 a, n+ [# k% P9 O! d' d, F ) z( I6 w, f% k8 }1 l
(if (or (= kieu "TEXT"); B m4 c! J7 r8 a% N
(= kieu "MTEXT")
3 u- Z- v0 J2 w) F. [ )
5 F' T0 Z3 X) u% x (setq thoat T, R1 g9 l6 m$ i d; k- u
textxl (cdr (assoc 1 doituong))
3 M6 K ~, Z% Z5 z )" x( p2 e) ] Y8 \* o
)% @( K3 F' I: [; h7 p
);
4 r; [) x& S4 ?) A- |; X(while T
/ j( {" R9 t y# {. l(setq toi (getpoint "\nSelect next point: " goc)/ g: F' S6 z" ^4 n
vitrilech (list (- (car toi) (car goc)) (- (nth 1 toi) (nth 1 goc)))
: g7 y1 n- W" [0 A/ f dem 01 j& L7 ?$ B+ ^2 R+ m0 f) k3 z( d! @
)
+ |4 W( e @0 v6 s. G$ n8 X(while (< dem dodai)
- ]! Z- d0 p) v1 m3 E: V0 l- A (setq ten (ssname cumdt dem)
! q1 D4 o4 @6 |; K dem (1+ dem)
" R2 X6 u" i: Q5 i doituong (entget ten)
3 Y( }+ o4 C( ~3 D6 M( b/ y7 j kieu (cdr (assoc 0 doituong)) ' L6 T( G. B4 T) C! N4 h' v
)# n- E0 g6 E) p N
; W- Y- [4 V: g' `* D1 A (if (or (= kieu "TEXT")
- r) e% @0 k! h) s (= kieu "MTEXT")
' {: h J' U1 p" Y8 l b )) M6 t7 Y" Q6 H% P5 I
(doitext ten)% a) X' t% q1 |+ C, g8 I# G' s- c
(copy_dt ten)
- t, V0 e+ n) Y. Y# v, i. x; R6 y8 Y7 p
);if
1 Y5 Q' N- ?9 ?8 E0 @ g): t# A9 {6 c& ^7 B
);while
- a. W5 ^+ M' ?+ s( @(ketthuc)
% W, i+ _4 J" Q$ e);defun
9 H& s% T }6 v* y0 K/ A(princ "Type \"DG\" to start")' d& F& k. D7 _& S6 E: m' d
;Note: bien toan cuc: textxl vitrilech; P" e* e" ^6 b1 j2 ]
; ]- w! q5 Z( I. Q( o;=====================================================================
: C8 q" T- W3 ]/ {1 q0 {;;; PLJOINFUZZ.LSP4 \' o. v* I9 l0 f! Q' r
;;; Joins lines, arcs and polylines using a fuzz distance9 `- A6 Z" v( q6 S7 \
;;; If only one object is selected it tries to join to all objects that are possible
; B& I8 F' b! \0 d;;; By Jimmy Bergmark
& r; |, c& M, l$ a' V: \;;; Copyright (C) 2003-2004 JTB World, All Rights Reserved
) I" l5 M& m( c M* z) ?;;; Website: www.jtbworld.com
$ @6 }: b# h$ \6 t7 Q- E: J# ^;;; E-mail: info@jtbworld.com
* `+ y2 z# d( p1 X- b;;; Tested on AutoCAD 2002,2004 and 2005
$ J8 G, R: U3 w2 s;;; Latest revision made 2004-11-111 f$ ?" V4 g' [- H8 L
;;; Minor code cosmetic change made 2004-11-132 U' \" q6 I5 ?+ j$ U
;;; Bug corrected 2004-12-236 v+ l, U8 L) @
. E5 {. F7 ]4 ^(defun c:jf () (c:pljoinfuzz)) ; this line can be commented out if there is an existing command called jf X/ D# q; ]6 \ s$ N9 F9 C
(defun c:pljoinfuzz (/ ss1 entLine objType oldcmdecho oldpeditaccept fuzz okObjects)
9 S" E/ @9 m- D% k7 r: u (setq oldcmdecho (getvar "cmdecho"))
* z& ]5 t* r) m: }5 n1 y: r (setq oldpeditaccept (getvar "PEDITACCEPT"))5 f! J! `$ W- u% L* a
(setvar "cmdecho" 0)( v* M$ [0 t5 Z# W: w. ~! T) D! W
(setq A2k4 (>= (substr (getvar "ACADVER") 1 2) "16")), O2 _" T: q0 o) B& Q4 R0 d
(if A2k4 (setvar "PEDITACCEPT" 0)); v) C ~. g5 n2 f" @6 X
(setq okObjects '((0 . "LINE,ARC,POLYLINE,LWPOLYLINE")))# {: I3 a# V! R) a$ a
(princ "\nSelect object to join: ")
+ [# J; A6 q; ?2 T; Z! W, m/ F (setq ss1 (ssget okObjects))2 c0 Y# r, X% ~ I6 @6 [
(setq fuzz (getdist "\nFuzz distance <0>: "))" A' f% B( N' N& C$ i4 l
(if (= fuzz nil) (setq fuzz 0))
7 ^3 u9 K! E, G B3 b, M. N0 \& N (if (/= ss1 nil)
: D! Y3 P: I0 R& U (progn
* H2 K5 O0 }- l4 l (setq objType (cdr (assoc 0 (entget (setq entLine (ssname ss1 0))))))# r% e- Z3 C# F
(if (= (sslength ss1) 1) (setq ss1 (ssget "X" okObjects)))7 A% S$ U0 d6 @! M" K/ A+ ?! G" z
(if (member objType '("LINE" "ARC"))
8 w& A4 r+ A( y$ [ (command "_.pedit" "_M" ss1 "" "_Y" "_J" "_J" "_B" fuzz ""): K% x! A; I) _ Z# K2 {5 L) y
(command "_.pedit" "_M" ss1 "" "_J" "_J" "_B" fuzz "")0 `! g. y2 d! i3 `! [
)- l" k B0 u" z1 }: h
)
4 o2 D* s% r7 W9 { ): w9 t5 {$ d5 _4 x8 D1 X5 K" [3 c3 d9 X
(setvar "cmdecho" oldcmdecho)' c& ~& t) F I( o. v
(if A2k4 (setvar "PEDITACCEPT" oldpeditaccept))
! G1 J7 F! \( W" x: \# ?! l( ^ (princ)
/ b4 l: k1 ~6 x3 s)8 A6 j+ i$ @4 ]2 k; m- x
$ U$ f' Z. P2 I+ b' `) K) r1 T
;===========================VE CAO TRINH===========================
# l! F5 N. E- x+ S/ ^# {' f% y+ |( K N
(DEFUN C:Cotcao (/ CMD PT1 PT2 PT3 PT4 PT5 PT6 PT7 PT8 NPI TX DX DY TL OSM OLL1 {8 {# I! G; O/ v; L$ @- \2 a
CRST RSIZE TSIZE STR PRMT FCH NBC OLDERR). Q1 f' i( J; q$ i
(SETQ OLDERR *error*1 h; w6 W$ g& d# p
*error* loisb)6 l+ o P& Y; B. w% K
(command "layer" "m" "dim" "c" "" """")
; G- U4 L- w4 t' @2 t0 `2 a J(SETQ CMD (GETVAR "CMDECHO")). @* `4 H% y/ m
(SETQ NBC (GETVAR "CLAYER"))
( a" j: \" d% v& A: W2 j* V(SETQ OSM (GETVAR "OSMODE"))
& s$ W5 U6 I( w+ w" V(SETVAR "CMDECHO" 0)
5 X% E& x4 m* K8 a(SETQ PT1 (GETPOINT "\nDiem cao trinh:"))
) y ?- M; L$ e" s(SETQ TX (GETSTRING "\nCao trinh:"))
0 o4 I+ t) F% Z(SETQ FCH (SUBSTR TX 1 1))
+ P& t+ U$ S# _(IF (= FCH "@") (SETQ TX (STRCAT "%%P" (SUBSTR TX 2 (- (STRLEN TX) 1)))))) L* X7 }& Q2 R5 l2 A, B5 a' @9 J7 b& q
(SETQ CRST (GETVAR "TEXTSTYLE"))/ k: o! u, L3 |: y( g, _1 I0 B5 a
(SETQ RSIZE (CDR (ASSOC 40 (TBLSEARCH "STYLE" CRST))))
# F T n' I5 `3 I+ X; ], R(SETQ TSIZE (GETVAR "TEXTSIZE"))
/ S: t) W" k4 N; b1 N, ~& o(SETQ STR (RTOS TSIZE 2))# r5 c+ ]) E% c; u1 `
(SETQ PRMT (STRCAT "\nText height <" STR ">:"))
( ?5 d/ K! l2 g f; ^(IF (= RSIZE 0)9 \' _4 `3 l' {9 s+ Q3 l
(PROGN9 M$ `4 j! _5 F+ i# Z5 j3 n6 s, m0 t+ C
(INITGET 4)* O! _+ y/ t0 g* Z; Q3 C2 F
(SETQ TSIZE (GETREAL PRMT)): Y/ f9 j# F3 d2 `3 v; }
(IF (= TSIZE NIL) (SETQ TSIZE (GETVAR "TEXTSIZE"))7 @. a. g B: @: u0 \
(SETVAR "TEXTSIZE" TSIZE))
- `2 s @ Q& S& _3 m )
. U! a d f) D1 v- L1 W0 A2 i9 t): ~& a# ~/ V' X( r$ A7 S
(PRINC)
. H' d: N& [- D* @6 _(SETQ TL (/ (GETVAR "TEXTSIZE") 2))3 q$ L" M; |. T# j* Q. v$ o9 f
(SETVAR "OSMODE" 0)0 f9 Q. ^3 _6 t
(SETQ DX (CAAR (CDR (TEXTBOX (LIST (CONS 1 TX))))))8 x9 B+ R( ?& T7 t1 A1 q8 O# g% k
(SETQ NPI (/ PI 2))
* o, h5 j+ E$ `3 ~(SETQ PT4 (POLAR PT1 NPI (* 1 TL)))
1 p! f9 d* v8 b5 R(SETQ PT2 (POLAR PT4 PI (* 2 TL)))
9 L: f6 F( A! U) ?* @! j(SETQ PT3 (POLAR PT4 0 (* 2 TL)))' ~: Q$ z# Y( r( e9 G4 z; Q
(SETQ PT5 (POLAR PT4 NPI (* 5 TL)))
- H9 S; X, s7 y(SETQ PT6 (POLAR PT2 NPI TL))
$ \/ c' V' Z$ v/ ^' I(SETQ PT7 (POLAR PT6 0 (+ (* 3.7 TL) DX))): B$ ^# F. Y% J0 W( ?( D
(SETQ PT8 (POLAR PT6 NPI (* 1 TL)))
. v: h) u( ]1 b( D(SETQ PT8 (POLAR PT8 0 (* 2.5 TL)))) U" N& H* I/ f2 f8 {# s7 W; H+ i
(SETQ PT9 (POLAR PT1 pi (* 2 TL)))/ P$ q: v9 o t
(SETQ PT10 (POLAR PT1 0 (* 2 TL)))6 w/ f0 o! b" J& P, t
(COMMAND "COLOR" "7" "")% Z$ p1 g' W1 m7 k5 [& A8 G
(COMMAND "STYLE" "COTES" "tcvn3italic,vnh.shx" "" "1" "0" "n" "n" "n")
E' {4 P$ f2 u ~(IF (= RSIZE 0)(COMMAND "TEXT" PT8 TSIZE 0 tX) (COMMAND "TEXT" PT8 0 TX)), l; t% x H2 `: O
(COMMAND "COLOR" "BYLAYER" "")
+ z5 h [& u4 T" v(COMMAND "SOLID" PT1 PT2 PT4 "" "" "pLINE" PT1 pt3 pt2 "")
, J& a. t8 o' h' c q! `(COMMAND "COLOR" "BYLAYER" "")+ \+ h; P4 e- m
(COMMAND "pLINE" PT1 PT5 "" "pLINE" PT6 PT7 "" "pLINE" pt9 pt10"")
" t, i8 t/ u$ n+ n2 j6 V(SETVAR "CLAYER" "0")& I% S/ m/ T- n/ N
(command "ddedit" pause)
/ c3 u2 y) z0 k* T7 V(COMMAND "COLOR" "BYLAYER" ""), w& k5 k# A! p* K
(SETVAR "CMDECHO" CMD)$ _; E! ?4 I" y3 F/ p m; B
(SETVAR "CLAYER" NBC)
1 U9 g2 T5 H- n(SETVAR "OSMODE" OSM). u8 P6 W# \7 N) p0 Z% f0 e. p
(PRINC)
# k5 ~5 K- E/ [)5 I8 b6 |+ M* Q% r2 t
* h. Y Z0 |: h* ]% U) `
;;; =========================== VE NET CAT CHEO (GC) =============================
0 F& I1 h h6 [( b- Q& H6 F5 S* E+ X j# d0 m
(Defun c:G1(/ p1 p2 p3 p4 p5 p6 p11 p12 l ang), a1 o5 X+ Q+ m% g1 G- q
(setq x (getvar "osmode"))
/ [9 f+ A9 E! H8 _7 S6 z. t* Q (setq p1 (getpoint "First point : "). n: \8 A( {' E4 }' E. ]. f
p2 (getpoint p1 "Second point : ")); n" s, Z# b5 ?6 {( ]8 X! V/ {
(setq l (distance p1 p2))
. P1 n; A% K- I' `) r/ J( n: V (setq p11 (polar p1 (angle p2 p1) (/ l 5))+ y, ^5 }" L: ]
p12 (polar p2 (angle p1 p2) (/ l 5)))3 `" [4 u+ G- v: m0 A% m1 ~ x
(setq ang (angle p1 p2))
- ^: q1 s- g, u. M: p; | (setq p3 (polar p1 ang (/ l 2.5))4 B. E2 @0 {5 x6 ?. C. J
p4 (polar p3 (+ (/ pi 2) ang) (/ l 5))
# A$ y f) |' F/ b) ~) _; P( D p5 (polar p3 ang (/ l 5))0 a: E" b) |* e( K5 [9 L" \
p6 (polar p5 (- ang (/ pi 2)) (/ l 5)))
* _8 Q# _; o3 B4 a0 }. Z5 G (setvar "osmode" 0)( a4 ^* a" `5 P4 E S5 p5 ?
(command "pline" p11 p3 p4 p6 p5 p12 "")8 ~$ u, B2 h. h+ ? F ?7 D6 t$ L; a+ q
(setvar "osmode" x)
' a/ v; N+ G0 f' U- h) _)2 l* R( W8 |0 i/ Q" U
;----------------------------------------------------------------------------------
& Z( ?; g( z. z1 n9 i7 A$ r' o(Defun C:G2 (/ ps1 ps2 pf1 pf2 pf3 pf4 pf5 pf6
2 f. f1 p4 x' @+ ?* x2 U pf7 pf8 sb sh se ang old_osmode); (setq old_osmode (getvar "OSMODE"))$ E$ Y0 ]# P( l5 B
(setq ps1 (getpoint "\Chon diem thu nhat: "))
) K7 l! n. n' Q" k (setq ps2 (getpoint ps1 "\nChon diem tiep theo: "))
! i) G) G0 ]( q (setq sb 50.0 sh 200.0 se 20.0)
7 G6 b$ u1 Z! h, K% ^ (setq ang (angle ps1 ps2))- d T. f+ O/ \4 h+ f
(setq pf1 (polar ps1 ang (- 0.0 se)))
2 \% Z1 Q5 x* o. t! ^1 b' ] (setq pf2 (polar ps1 ang (/ (- (distance ps1 ps2) sb) 2.0) ))
2 G i" M! m2 h (setq pf3 (polar pf2 (+ ang (/ pi 2)) (/ sh 2.0)))( e5 }/ v/ e+ ~9 {# _) J: n8 w+ q
(setq pf5 (polar pf2 ang sb))
' ^5 s- h; J% Y& ^. Z5 l W (setq pf4 (polar pf5 (- ang (/ pi 2)) (/ sh 2.0))) C# ~6 c9 B/ c# s4 [
(setq pf6 (polar ps2 ang se))! s0 |0 ~2 u9 w; u9 e j
(setvar "OSMODE" 0)
8 `7 O3 `3 m# {( u/ _& Z% }' w7 Q (setvar "BLIPMODE" 0)
: l1 X* S- h! {& `$ u1 \( Q% M (command "PLINE" pf1 pf2 pf3 pf4 pf5 pf6 "")
4 k+ M0 l3 I+ h. p+ F (setvar "OSMODE" 703)* _* Y m4 U" s m. {. U
(princ) )
/ G+ [8 [$ o* {* j, K. t;----------------------------------------------------------------------------------7 {2 V2 _- r( n
(Defun C:G3 (/ ps1 ps2 pf1 pf2 pf3 pf4 pf5 pf6
# D/ W @! Q+ s3 _5 c. m3 J3 r pf7 pf8 sb sh se ang old_osmode); (setq old_osmode (getvar "OSMODE"))( @% k2 z5 r- a# ~# O: c1 q1 ?: u
(setq ps1 (getpoint "\Chon diem thu nhat: "))0 e8 r5 ^9 q6 I: c6 T; i
(setq ps2 (getpoint ps1 "\nChon diem tiep theo: "))
& ~3 @' K @2 m. t* e0 r8 `) G' |4 s: w (setq sb 100.0 sh 150.0 se 20.0)* y; C- @ y+ b& n1 c5 V4 B0 @' n
(setq ang (angle ps1 ps2))0 ^6 m; V9 R" C- f
(setq pf1 (polar ps1 ang (- 0.0 se)))
6 s3 {9 O9 ` h. n (setq pf2 (polar ps1 ang (/ (- (distance ps1 ps2) sb) 2.0) ))
`4 k7 c& w3 A" u+ g# v& y (setq pf3 (polar pf2 (+ ang (/ pi 2)) (/ sh 2.0)))
5 d' P0 A, }. T* h5 N I' s (setq pf5 (polar pf2 ang sb))3 \" B' O9 k0 `+ F L
(setq pf4 (polar pf5 (- ang (/ pi 2)) (/ sh 2.0)))
s. R! k$ {! R$ z (setq pf6 (polar ps2 ang se))- Z! [) Q7 b$ F7 J
(setvar "OSMODE" 0)
& y6 }" ~' i9 y0 i! z' j (setvar "BLIPMODE" 0)3 c8 T D! T1 T. ]) E
(command "PLINE" pf1 pf2 pf3 pf4 pf5 pf6 "")% l$ |% F% J& ]4 ^" @. D% E2 m
(setvar "OSMODE" 703). \5 F- z/ `8 X! O I! W1 i
(princ) )" \/ d) V2 v7 A5 F
;----------------------------------------------------------------------------------0 ~5 V% t, w. D/ {" r0 s2 n
(Defun C:G4 (/ ps1 ps2 pf1 pf2 pf3 pf4 pf5 pf6
2 {: B2 X1 r+ r& V9 \ pf7 pf8 sb sh se ang old_osmode); (setq old_osmode (getvar "OSMODE"))& h" P* B! I/ w6 U- k; P3 E6 D
(setq ps1 (getpoint "\Chon diem thu nhat: "))
$ [! ^9 j, G/ B/ L; a4 P (setq ps2 (getpoint ps1 "\nChon diem tiep theo: "))
: n* N8 z7 v7 w0 j t; W (setq sb 100.0 sh 250.0 se 20.0)
6 q. h/ L. M% P& u6 S: y (setq ang (angle ps1 ps2))
. E. j$ T2 w: a# T" A7 a9 t f- P2 P (setq pf1 (polar ps1 ang (- 0.0 se)))
& d) W( w4 X: U (setq pf2 (polar ps1 ang (/ (- (distance ps1 ps2) sb) 2.0) )); G4 R! j7 f0 _7 H7 A
(setq pf3 (polar pf2 (+ ang (/ pi 2)) (/ sh 2.0)))
- G1 L. Y$ g) n: M$ \ (setq pf5 (polar pf2 ang sb))2 E( |3 ^5 d0 G2 f8 _
(setq pf4 (polar pf5 (- ang (/ pi 2)) (/ sh 2.0)))
+ g# w( O9 j6 [; D( u (setq pf6 (polar ps2 ang se))' w( V- E0 j# r+ G
(setvar "OSMODE" 0). B4 x: t9 p, L1 W2 z1 k& F- ^9 J
(setvar "BLIPMODE" 0)" B/ y( ~! W- _& {7 {4 J X
(command "PLINE" pf1 pf2 pf3 pf4 pf5 pf6 "")
_/ U Q# ^( ]' O (setvar "OSMODE" 703)
. Y" i: I1 ]5 B, f }! T9 F (princ) )2 d& Z- s t% k7 y; H' V
( [1 E+ o; N4 {8 ]' C5 l
;==================================================================================
^: ~6 S" w* m(defun c:ang (/ ent pt1 pt2 ang)
+ B' g6 ]3 Z. o: j. D (setq cmd (getvar "cmdecho"))
2 B: g4 R/ ^# p' o (setvar "cmdecho" 1)
7 F: \" D) N& A& J/ @ (prompt (strcat"\nThay doi truc toa do theo duong thang chon truoc"))
. f/ U' q. V) s( Q$ b& v (setq ent (entsel "\nChon duong thang:"))0 X+ m9 e) u( Q. T- z
(if ent - |" T2 u8 G1 h$ w
(progn7 x) D9 V" S! \: j8 u, X. ?3 L, v
(setq ent (entget (car ent)))! |! \" H6 ^; k$ l1 L) L' G
(setq pt1 (cdr (assoc 10 ent)))& K# x( e) [" u) V
(setq pt2 (cdr (assoc 11 ent)))
: w3 W% w5 D8 r4 |6 p1 ~, m7 w5 J& u (setq ang (angle pt1 pt2))! o, u5 D. H( F# }# b% l
(setq ang (/ (* ang 180.0) pi))
% F& V$ `, s$ b) q* B& z6 ~ (setvar "cmdecho" 0)
2 X; F9 F* r/ C1 U# @ (command "setvar" "snapang" ang)
- i W4 K% O& d1 t (princ "\nGoc cua truc toa do moi : ")
- h+ T% h3 F/ v# k5 W* K4 V9 n (princ ang)( S! s6 N/ L% N5 t4 I
), b! ?: I0 N' C4 x @ h
)1 ]! K1 ]! m; K9 V
(setvar "cmdecho" cmd); e# ?9 y6 t5 C* K: s8 q
(princ)3 d X# h. D- O2 W& D
)
! g' j& I2 e! o, l& C4 ?* f9 \7 N( u;==================================================================================5 w. \0 b! C6 M" `" u
;============================== KY HIEU DOI XUNG ==============================0 b! L0 D. W: V( Y
;==================================================================================6 h- r. p; ?1 k- o( O$ O
- J4 k U0 T8 X7 V$ Y3 D! \
(DEFUN C:DX (/ CMD OSM OLDERR PT1 PT2 PT3 PT4 PT5 PT6 PT7 PT8 PT9
1 f2 @* J2 K. S5 m4 K& i" i5 } SZ G45 G135 G90 G180 SS loi)
) h' ^! e M7 B* }3 _$ Y; x, \(defun loi (s)
- H; b, F+ V% n4 \/ z" A& f- L1 a (if (= s "Function cancelled"): e5 B/ i) U( i
(princ)
8 B9 @9 W1 ]0 z. } (princ (strcat "Error:" s))
! n0 e) ~1 W5 s/ ]3 \( D )
2 N; P! i% q( V3 G0 c (SETVAR "CMDECHO" CMD): D( e6 {4 }4 a8 f
(SETVAR "OSMODE" OSM)3 } f; {# D+ E$ e& K% \
(SETQ *error* OLDERR)
" e) y7 D x, J& Y. ^/ @& e% j2 T (PRINC)
3 G+ Y' k* F- K$ W+ `; Z- X)
" @5 A5 K0 S* E* L+ O6 p (SETQ CMD (GETVAR "CMDECHO")). D9 U' f/ S% ^% W
(SETQ OSM (GETVAR "OSMODE")): Z2 F; v5 u; q; f' V
(SETVAR "CMDECHO" 0)% _; } ?6 R8 P& D
(SETQ OLDERR *error*
3 Y8 z" ^: X3 p: f6 L6 y *error* loi)
: h7 R8 O8 z6 Y/ v (SETQ SZ (GETREAL "Size <1>:"))
( f7 [5 E; ^4 _0 H9 Q (IF (= SZ nil) (SETQ SZ 100)); q4 r4 l6 {& Y
(SETQ G45 (/ PI 4))& l8 k6 J) z. { y7 e
(SETQ G135 (* 3 (/ PI 4)))
+ H0 v/ }% p5 f, A& ^. q (SETQ G90 (- G45 (/ PI 2)))/ O7 T( _) i6 p9 U: N! j8 C8 y! M
(SETQ G180 (+ G135 (/ PI 2)))
: k' \6 `7 y$ f/ p. x2 M4 r& @ (SETQ PT1 (GETPOINT "\nDiem doi xung:"))- X0 e9 h, e! ~" Y' C# a
(SETVAR "OSMODE" 0)
8 \5 D- {2 l/ a3 K8 T P (SETQ PT2 (POLAR PT1 G45 (* 2 SZ)))0 ]* d+ J& S$ H! h& [( m
(SETQ PT3 (POLAR PT2 G90 (* 2 SZ)))5 u; c& P7 J! X! j$ y4 o8 F
(SETQ PT4 (POLAR PT1 G45 (* 1 SZ)))
& J1 H5 E9 u- f Y# ~ (SETQ PT5 (POLAR PT1 G135 (* 2 SZ)))0 q8 M( v& I! ]5 W$ H+ C9 G
(SETQ PT6 (POLAR PT5 G180 (* 2 SZ)))& K7 k0 T& e& w F. B0 A
(SETQ PT7 (POLAR PT1 G135 (* 1 SZ)))
4 M3 o& s7 x1 K- }+ i. u% u (SETQ PT8 (POLAR PT1 G45 (* -0.7 SZ)))
9 B! K, Y( H, Y/ i! T (SETQ PT9 (POLAR PT1 G135 (* -0.7 SZ)))3 K0 u ]. h5 c$ I: c
(PRINC "\nGoc quay:")! v! o* ]$ E! g, C# \$ y5 u" [
(SETQ SS (SSADD))
* u8 b3 H6 N |5 D* u. G3 h(command "layer" "m" "Dim" "c" "" """")
9 ~6 j, p% T3 W2 f! }6 {(COMMAND "COLOR" "1" "")2 X, d1 @+ I9 N6 _
(COMMAND "LINE" PT8 PT2 "")
/ }( e4 u' O& g, |- ?( K (SETQ SS (SSADD (ENTLAST) SS))
7 r4 m4 x7 Y1 B" Y (COMMAND "LINE" PT9 PT5 "")
3 }; N) l5 n i5 v. ~ (SETQ SS (SSADD (ENTLAST) SS))1 t/ `: g4 t4 n
(COMMAND "COLOR" "1" "")( q1 Z! i8 K: [( w# Q% g
(COMMAND "SOLID" PT2 PT3 PT4 "" "")
: ^6 Q; T4 P2 y9 ` (SETQ SS (SSADD (ENTLAST) SS))/ O# F$ J) s" h6 k5 s
(COMMAND "SOLID" PT5 PT6 PT7 "" "")
8 z& _5 @# | A/ S) r. Z (SETQ SS (SSADD (ENTLAST) SS))/ u1 r+ f* b, {) N# k1 V0 R
(COMMAND "ROTATE" SS "" PT1 PAUSE)! P4 S2 q! R6 {
(COMMAND "COLOR" "BYLAYER" "")
+ I3 m4 V0 _' Y9 s# e0 s N5 Q (SETVAR "CMDECHO" CMD)
' K5 `" Z6 j# o& V R% X+ ~* |& P8 I (SETVAR "OSMODE" OSM)0 \5 \( p$ A% s
(SETQ *error* OLDERR)2 @1 }$ z5 E* k2 S
(PRINC)7 h) H& j* y' m6 b; Z* r3 J
)( p' g4 `9 l* \# m0 g
' h' ~9 }% y' n8 A& e
;==================================================================================
+ ~+ S+ p! } q! F2 C% ]8 J# ^3 A5 J0 e. T;================================= KY HIEU TRUC ===============================
) ~; X/ T9 Y9 ]( k$ u( v @;==================================================================================
% ~1 U& H& U& l3 d) Y
+ F) H( f) @: B0 [(defun C:vetruc ()6 Z1 G, w* j1 y k, S5 {
(setq bk (getvar "USERR3"))
1 p- U( z% `. W8 o(if (= bk 0)+ D; C2 r- q5 T# b3 v
(progn
0 b2 j/ F/ H8 \3 Q; x4 s2 Y1 Q0 m (setq cont "1")
, ^# P5 F0 @) v (setvar "USERR3" 1)
- B7 a" a9 R( {% c% n% Z& m )
8 C" V& e: C8 [# z5 l# B7 Y (setq cont (rtos bk))
) P6 q ?- O; O# }1 A)
& L/ |2 X1 B l7 ~4 j9 Z9 p(setq pt1 (getpoint "\n Nhap diem dat:"))0 P2 P" y; u* g+ p
(command "layer" "m" "Dim" "c" "" """")
5 v# H6 M0 `6 ?" B! r! K5 K& u(command "osnap" "")5 x. _9 I, D& A0 e
(COMMAND "COLOR" "7" "")) S7 z; w0 j9 J
(command "circle" pt1 150 "")
; D8 n9 r( D% ?8 B1 f+ w8 n(setq pt2 (polar pt1 0 150))9 y; w* J- {* `; V" A9 r0 h
(setq pt3 (polar pt1 (/ pi 1) 150))
. ~; G7 |$ B2 p3 F9 n z) f4 `" k(setq pt4 (polar pt1 0 300))
( N) i- Q. G' U- _- S(setq pt5 (polar pt1 (/ pi 1) 300))
( X* d, V0 s7 w(setq pt6 (polar pt1 (- 0 (/ pi 2)) 150))) k4 H( a" G$ I6 w- ]0 X3 `4 y
(setq pt7 (polar pt1 (- 0 (/ pi 2)) 300))
4 g7 l0 S, l; t& m( \8 g(setq pt8 (polar pt1 (/ pi 2) 150))# q; o( @# k1 ]1 r- B
(setq pt9 (polar pt1 (/ pi 2) 300))+ T3 F" L: `& \5 y( m. z
(setq pt10 (polar pt1 0 150))
. A: j% x8 R* d9 ]9 ~, ](setq pt11 (polar pt1 (/ pi 4) 150))
, g" e+ e+ ?/ c. M& J- L+ g4 R- [(COMMAND "COLOR" "BYLAYER" "")
3 n, y f J. c- ]( H4 P(command "line" pt2 pt4 "")0 N9 g- D$ t0 j0 [8 O# e
(command "line" pt6 pt7 "")
, r! W9 g3 ~; X' D8 E(command "line" pt3 pt5 "")
9 @- Q8 t F2 w) x" T/ {4 M h. G(command "line" pt8 pt9 ""), I, _6 Z9 F. X
(setq dk (strcat "\n Size:<"cont">"))# w( t% M! C3 s
(setq bk (getreal dk))
' m0 u5 }* k" D$ n$ d(if (= bk nil)! n a w5 z! h% ?9 F9 d% j! G" f7 P
(progn: w0 y$ E# c+ M: ^) ~: ^
(setq bk (getvar "USERR3"))
7 `) h& \: G7 z& w" L )/ ~! Z6 T8 A" K; G/ x
(setvar "USERR3" bk)# v4 q" Q4 Q2 o* r6 D* i8 H% \
)
+ Q9 p9 x( l( Q0 J/ D) |4 l& d5 T5 z(command "scale" pt4 pt5 pt7 pt9 pt11"" pt1 bk"")8 L/ X7 D- ?) c
(COMMAND "COLOR" "7" "")
0 _; U" ^- O" q' Y N! s' x; I(COMMAND "STYLE" "Truc" "impact" "" "" "" "" "")7 K/ k! d. ~4 @5 R, o7 D
(command "text" "j" "mc" pt1 (* 150 bk) pt10 "A" "")
8 |8 F5 x6 [& D6 [(COMMAND "COLOR" "BYLAYER" "")
: t$ ?0 u, ^9 \7 G+ b. P2 t)/ z' X: W4 r. r5 }% T! b9 s
% H' h. a# ~) N0 T0 m* e/ e1 C/ O
;=====================================================================
' V& b6 U1 V5 C( v;CA - Reverses the case of text. (Upper to Lower and Lower to Upper.)
7 s/ T/ { Z k;
3 E# |+ D5 u5 q6 H# M;Jeffery P Sanders% a: r( v) t3 d2 [
;! g, S: \7 [; v5 m
(defun C:CA(/ en enlist tx newtx cnt tp asc note)
5 M" S! I6 _7 C) c- M$ n$ C (setvar "cmdecho" 0)
4 R9 J2 _6 `, i0 C& y: J9 T+ J (if(setq en(entsel))
1 I* t/ s1 C) F0 S' S+ \ (progn, B% V" l+ d! a/ X9 @' V; i
(setq enlist(entget(car en)))+ r0 q* ~% E8 p9 c7 D$ `0 [6 [
(if(= "TEXT"(cdr(assoc 0 enlist)))
! O( ~3 V4 j' _) R5 B (progn
: F9 j9 I7 X" l (setq tx(cdr(assoc 1 enlist))- B& p3 a0 Z6 e& Y. x& n) P
newtx "" cnt(strlen tx)
9 H0 F$ L2 l+ ]1 V note "\n...CASE Reversed. \n "! t" y$ ~3 H8 n
); j, l8 a. K3 j, p% W
(while (> cnt 0)
# s/ Y: S) F- _8 x" I+ g% k9 I (setq tp(substr tx cnt 1))0 u) w: u' [: R( ]7 t L
(setq asc(ascii tp))( f. n% ^1 z! c9 o5 l0 U
(if (> asc 96)3 L1 a9 H, @7 [/ ^% x- t7 } t
(setq tp(strcase tp))$ l" n1 q: Q Y
(setq tp(strcase tp T))
( ~' s8 c, A1 A: o )
% N4 }5 l) r. i# N& [ (setq newtx(strcat tp newtx))0 w6 a5 q1 i9 s ]$ W- y" p8 n" b
(setq cnt(- cnt 1))& o, u f8 o5 s/ r0 c5 n
)
& b9 p# r. v. [ C. O, X) ~ (setq enlist(subst(cons 1 newtx)(assoc 1 enlist)enlist)) a1 O+ @4 V# j7 z% ?/ i$ F
(entmod enlist)
2 Y: g* s4 A0 N& p- s; |1 a# \( t ), F x1 W, ~ q9 `
(setq note "\n....Text Only Please. \n "): w! t5 y& M& z
)- S/ n# y( c3 l+ c3 L/ m3 q
)0 X. P" s& E4 ] [9 C
(setq note "\n....Nothing Selected. \n ")$ d T4 o" f5 z: e$ h
)
- `1 X9 Y+ x0 s9 j& P2 \5 { (setvar "cmdecho" 1)4 _0 x d! |* I `) \9 v/ ^
(princ note); F1 @- k: E" m, z1 `
(princ)0 o; U e7 ^/ ~# G) \, N; ?5 D" s
)
: D$ j$ t; B1 Z1 E, r9 a
9 O4 V; `8 Q6 o1 S' X6 {;=====================================================================
! V/ ]2 g2 z% q" F0 v$ }- K, E;==================== NEW TEXT STYLE UPDATE ==========================/ t( j+ s7 K$ W' @9 w7 k2 R! q: f( S
;=====================================================================
( t( f9 v3 w/ R$ f) d: H
1 k8 T1 f; v: s, R3 [' E(defun c:nS (/ tdt ssdt sodt index)% {0 \/ ^9 u4 Z* ^
(defun ObjName (ssdt /)
: v' E- G$ R7 t) ?+ r(cdr (assoc '0 (entget ssdt)))
. A) F) C: [4 m)
/ }* B) j |+ k" M( R4 y$ i(defun MoPL (ssdt /)0 ]5 f- J$ R, N
(= (cdr (assoc '70 (entget ssdt))) 0)5 [6 W( A0 b( W3 T. ~9 W- s: v* x
)- k; X6 a/ p6 V5 {/ {2 {
(defun NoiPL (ssdt /)8 w# X: U$ a) r2 D
(if (MoPL ssdt)1 K& h6 j/ _2 B# z/ m/ R- b8 N
(command ".PEDIT" ssdt "J" "All" "" "X")
' J Q- P8 d. ^( f/ P)
, N4 a& w4 x, Z1 I3 F)' P X! h; C: K
(defun NoiLC (ssdt /)
* A# P. v6 b v" a7 W(command ".PEDIT" ssdt "Y" "J" "All" "" "X")/ S3 v. D# H4 b" Z) S1 }- R+ x! ]" i' p) ~
)
- ^* o8 M& u: R$ y- \# ^; z; L(setq) E8 E+ u, t* e
tdt (ssget)
- p% A2 n7 r2 ?+ u( b3 n2 csodt (sslength tdt)
: |1 Z. T. u% T5 S6 xindex 0- q% j2 L L9 ]4 v; H; V7 X$ z0 |
)
: e, \: j- ^6 t2 u$ V(repeat sodt
2 T6 H6 z V7 R, k1 D(setq
3 w8 \- d" a$ ?ssdt (ssname tdt index)
i# X7 l% I$ v+ |6 [. B* o3 windex (1+ index)
" [. } Z+ {9 ]4 s+ ^1 f0 v)
9 w5 N0 P) U; |7 F1 s(if (or (= (Objname ssdt) "LWPOLYLINE")
9 x% V' g% ^) \: U(= (Objname ssdt) "POLYLINE")% W! g2 [4 K$ h+ K
)+ g% D& V& t: A# }. O2 w7 u1 \
(NoiPL ssdt)% W2 b* w& S+ U2 Q* ^+ M8 }1 k* e
)& \( @0 [/ V9 ^% m* G) X& I, u
(if (or (= (Objname ssdt) "LINE") (= (Objname ssdt) "ARC")), V9 a* W7 b" E- y2 f
(NoiLC ssdt): C m4 T* X, s* W# o
)0 J z+ B! f8 | X: \( t
)
" ?. L" d+ ~ K/ y(princ)
6 b0 l) C. f& Y) g)
( N4 ~* s5 ?) e1 C, y, B* n/ E- [* Q! @: u; U- e# y) ]% [( w
;=====================================================================
: s: [$ j" |% m" I;;; AREAM.LSP
% f4 s. Z$ W9 `( i" C& P, K; F9 u;;; Function: Calculates the total area of selected objects6 \7 _( e8 a8 @) l0 W4 e
;;; By Jimmy Bergmark1 L# d( a! r- J7 P/ A
;;; Copyright (C) 1997-2006 JTB World, All Rights Reserved7 ?" N+ @7 x( m2 P0 j' j
;;; Tested on AutoCAD 2000# S) _ S2 m# y
/ f" _" d( s. n/ Z+ `5 C1 Q6 _(defun c:ea (/ olderr oldcmdecho errexit undox restore ss1 nr en tot_area)
3 ^0 ?7 _2 |+ g# f$ t& {8 Z (defun errexit (s)& m2 d, e) L }. u. `; v
(restore)+ x3 z0 l$ e, O
)
/ p. z9 W. I4 s
. f) F7 x4 A* c* h. j (defun undox ()3 z1 c$ o! L8 T
(command "._undo" "_E")8 C( p7 o$ {: p6 i K/ e
(setvar "cmdecho" oldcmdecho)$ h; r, v: G4 g0 v
(setq *error* olderr)' [# H8 f& C' ?
(princ)
! ^& |+ Z* S c, ] )( i$ z$ g0 J1 D! J$ d3 i( c7 Y
. u2 t+ }* H& F8 H$ f (setq olderr *error*
1 e( ^9 u9 m* Y restore undox- }# B0 D- N, Z; s R/ [* M
*error* errexit" o" x. _" ?+ ?5 D! ~3 Y
)7 W, D- Y d! P2 K5 e4 m v
(setq oldcmdecho (getvar "cmdecho")): Y) M6 z$ ~$ `. ^3 ^
(setvar "cmdecho" 0)
+ `$ a3 B7 w" [6 T$ O (command "._UNDO" "_BE")
$ A) y L7 X" J9 K0 t- [ (if (setq ss1 (ssget '((-4 . "<OR")
% \ n( G+ l; I3 |8 } (0 . "POLYLINE")
2 G% b4 h# X/ a (0 . "LWPOLYLINE")4 ~" E; M: F3 r# X
(0 . "CIRCLE")
* o" Z; w z( ]$ ^ (0 . "ELLIPSE")
. @6 a5 H! r' ^- Y2 g8 l (0 . "SPLINE")0 R; k4 y1 q) R5 i4 w/ p
(0 . "REGION")0 Q0 _) P- |/ y# h9 w. S
(-4 . "OR>")8 m+ V7 L- i1 z/ ~/ w! b# Q
)& B ~4 | q& K: t9 u6 N
)
& h6 s/ H, w; K& a! @: \. q )- N9 y4 L1 n7 W4 z
(progn7 k, X; e2 c' T2 I' f% H2 k1 F
(setq nr 0)
# D3 S& L# S( X7 x! [% g6 R3 P (setq tot_area 0.0)+ o+ k+ |2 Q7 t3 `, G
(setq en (ssname ss1 nr))- x5 U! W& ~0 y) g) p% _
(while en
/ G# ?' M" C: ^& o& K0 d H- h (command "._area" "_O" en)
% `/ c3 d3 T. H8 M2 }. X (setq tot_area (+ tot_area (getvar "area")))
: g2 I$ w4 i- x- c, x% O" R$ n (setq nr (1+ nr))
1 f1 j8 z( L g% ` (setq en (ssname ss1 nr))
0 c3 M/ g" _/ d )
0 j3 i% t+ w5 d H: b4 x (princ "\nTotal Area = ")$ u- Z4 N0 M6 d7 ]
(princ tot_area)7 T, y+ i( ^+ M1 E6 t
)
9 v) C3 l( {# b5 {* b$ K/ \4 q )
- ~: \4 ]" q, s* f, m L3 c/ X' _ (restore)
. }+ F- O# f5 |+ q)
" _1 w/ B8 m' C
9 @% e2 l' L8 L/ u8 Q9 G; j;=====================================================================
8 q3 H, R R8 Z* M5 r4 p;;; By Jimmy Bergmark% v; g1 |* F- z) J
;;; Copyright (C) 2008 JTB World, All Rights Reserved
) _& | i! Z% @& e- M" w;;;
. T3 z& _# C ^' y: L P;;; Created: 2008-03-31
; N, s+ }# _* L% U4 c;;;
( \7 J$ d7 T- ` F& A* q# U' F;;; Convert Attribute definitions to mtext
& F. d& I$ b) J$ S& G;;;9 ^. W9 U6 Y" E, S6 V, [( e
]5 G! e( q7 g+ F, m
(defun c:ATB (/ eset1 blkcnt en enlist tag1 ht pnt vl space)" b/ B8 K" e5 n% X+ N$ |
(setq eset1 (ssget (list (cons 0 "ATTDEF")))
H4 X, m/ |7 R1 H& Y3 d1 r blkcnt 0
& I# L7 _" h- J3 {/ M )
, U1 i( i7 d9 y$ `8 [! S6 l
0 x8 }- S/ X& y$ d (if eset1
+ f! d ~3 j/ C! o6 p4 J (while (<= blkcnt (- (sslength eset1) 1)): c% R0 g# c1 n
(setq en (ssname eset1 blkcnt)
7 c6 [) H# ]3 m# `; x7 T enlist (entget en)
5 v1 S2 ^! X$ Q F ht (cdr (assoc 40 enlist)): k) _+ `# U Y, a4 K3 D
pnt (assoc 10 enlist)7 v; \( ^- }; C, {
pnt (subst (+ ht (caddr pnt)) (caddr pnt) pnt)+ w* D' l. W3 Z' H P
space (cdr (assoc 67 enlist))2 D& N! b( Q) _* j2 k$ |
)9 i3 O, i: M0 ^, Y4 S& e7 g
(setq vl (list9 B2 b1 P9 L' {9 Q+ ]4 G- M
(cons 0 "MTEXT")
- Y, b$ M. J+ I: o2 d6 [' @7 u (cons 100 "AcDbEntity"), R3 B9 I/ Z8 p8 x( w- B# _+ B
(cons 100 "AcDbMText")
& D( U1 {- ^, p+ m) e (assoc 7 enlist)5 d; w0 _4 i+ `. V
(assoc 8 enlist)% P1 ?6 j# I/ F1 s) _- e
pnt
% R9 H$ c' k/ t' a (assoc 40 enlist)6 {) ?5 g8 {' F2 b
(cond ((assoc 62 enlist))
% a9 ?5 ] L9 T& E" O' w ((cons 62 256))
+ D) R6 M$ r& g )8 J# C* T: t! f& ?; K L
(cons 1 (cdr (assoc 2 enlist)))
g3 W+ x( p l: E$ d! ?2 I# \4 s (if (= space nil)5 G: c2 H* c) h* C: ?2 q
(cons 67 0)- H! c4 }) \ p5 x1 k: X) Z5 T! H# z
(cons 67 space)
- Z5 N% y3 @) T2 f8 _) n5 u" J )5 D! V* a8 n; m& M4 _8 p
)8 ~8 y. w9 [/ g
)
( X/ O/ M% X4 k6 j! @ (entdel en)
' V* w2 H% z& l# _% g4 U K (entmake vl)
9 I: M% K" e1 o4 r7 S (setq blkcnt (1+ blkcnt))
+ b7 T9 W+ L( B; R" m ), J4 L9 a( L3 Q- W4 k
)
5 e! n/ n' \# G)
" ~& E* Z1 i/ t2 h/ o- B8 h) @
1 M. Z( K5 X% \& o( a; S# m8 g;=====================================================================
1 h2 A/ q9 r7 r- O6 ]# r; |6 V
# Z% ^ p9 U4 ]7 F' L# E6 C(defun c:xxx ( / cumdt dodai thoat dem ten doituong textxl dem goc toi)+ ?' Q' Y* s& }! h
; Khoi dau cua chuong trinh
9 @- {3 Z0 Z/ Q$ I(princ "\nCopy Inteligent...\n")
* u! u9 @# y5 W% ? T& m(setq luuecho (getvar "cmdecho")4 x4 s8 n3 E% D9 q1 m
luu *error*# p* j3 m. g5 z
*error* ketthuc
: N6 P8 Z$ t5 X+ m! ^ cumdt (ssget)2 }, P7 J |, _* z, l1 I" n# {' G$ q; Q
dodai (sslength cumdt)
6 I) t4 W- L$ F: l goc (getpoint "\nSelect base point:") e! E' Z4 s+ X& Z' A: S6 y
thoat nil
* w, W! M0 f7 C. X" _" F% a1 o! o dem 05 f7 p; x2 w0 ?* H, ^1 f. h
textxl nil
- D+ P9 s$ v7 w2 n. u* y9 o);* q! _6 y; ]6 L! G/ Z. j( K
(setvar "cmdecho" 0)
- ?- c! k. M; r( N! n: I) P$ g; Loc ra duoc ong text de xu ly
, L. X2 g ?; g(while (and (= thoat nil)
5 x9 H/ K# P* h6 p (< dem dodai)$ V- e( t9 i; j# @. u4 l5 E% w
)# }3 Q' |+ Q6 W' L. w0 g' Z; p: s
(setq ten (ssname cumdt dem)
; r, `* Q" Q" ?# g$ x dem (1+ dem)
4 Z1 y6 y$ d7 S" Z/ \6 b- f$ k doituong (entget ten)! N2 b% ^# W2 K7 K$ f9 d* ]+ o
kieu (cdr (assoc 0 doituong)) % }6 q# {: c6 I @% T1 K. _
)6 d8 O% E' p9 E- Q. w
8 T/ L0 k1 S5 h2 r/ ?# n( H0 g (if (or (= kieu "TEXT")* a X. S% T7 s
(= kieu "MTEXT") ! i6 f' }3 B- a4 M+ I
)) }+ x" d4 D" \
(setq thoat T1 J+ \% {$ f7 @) e
textxl (cdr (assoc 1 doituong))
. S0 ^9 l; V' t/ z' t# s# ~ )
& g/ n8 _! _' u- N; | )- f, Q* G/ Z* n# T% `1 a s
);
6 y# T) m' I( q: C(while T 5 O5 W# J% Q+ o
(setq toi (getpoint "\nSelect next point: " goc)
$ `, w( W* ?2 Q) i! @ vitrilech (list (- (car toi) (car goc)) (- (nth 1 toi) (nth 1 goc)))
4 i5 Y6 h! Y8 s' s9 j dem 0
8 q+ H. b& d; u P7 R)
. U$ Z; `2 v9 S6 R8 f" D(while (< dem dodai)
b& K2 x9 k* C+ `& u (setq ten (ssname cumdt dem)
3 J+ ^5 L+ X: k dem (1+ dem)
* p# B {$ ]: o# k4 |2 } doituong (entget ten)# Y5 f- ]* E5 ^
kieu (cdr (assoc 0 doituong)) 1 C; ]2 l( `: p. j1 w( l
)
- H! ~3 @7 B) M, r1 f+ ?
( b/ t0 S( S; b% j (if (or (= kieu "TEXT")9 A; P2 J+ h+ J/ U; ?; Z; Z
(= kieu "MTEXT") : D; j! j3 x C; v
)6 M0 U8 I$ ?+ T& _5 w1 I! U5 z
(doitext ten)6 U5 N6 C; l2 h _- d6 S
(copy_dt ten)
0 ]1 u, s9 ?5 c( ` n! |
$ g, `' h, t2 d y1 A );if
& P& x' ^, X* Z; f)7 D' C+ W0 f0 i0 z1 k7 N1 M- I
);while
, @' A) f$ q0 Z! P8 ]- _8 p(ketthuc) A6 ` l: m9 f. x l/ \
);defun9 T2 U+ W* Y; r0 L. c+ }# p: k4 c' \
(princ)
3 O3 F2 O: U' p
, L2 S E0 Q4 _2 P;=====================================================================5 a& N) x: e5 x5 D. J* T
;;; By Jimmy Bergmark
) I3 R7 V$ p/ p;;; Copyright (C) 2008 JTB World, All Rights Reserved
0 |' r1 Q, D& k+ u;;;
! [ B2 e" V1 M) M- ~7 n;;; Created: 2008-03-31
1 i* a+ J3 d8 z7 ?;;;
6 x9 S8 j5 J- W z;;; Convert Attribute definitions to text
/ [# Q; R/ E/ L+ k+ {;;;; P9 B" B. \! f2 L1 Q! P8 N5 [
2 d6 g, w5 H! @9 H; [) v+ J# e(defun c:ATT (/ eset1 blkcnt en enlist vl space)
, [. K5 X- R/ d9 f (setq eset1 (ssget (list (cons 0 "ATTDEF")))5 f H' A; G J: B$ A% `/ }
blkcnt 0
7 B4 ^/ G% c0 J1 G/ S0 C$ R) Q2 F )
- @) E8 h# @* p5 _2 d2 J
$ `2 r7 o& S7 z) L- X8 R (if eset1
; f" }' B" Q) X' E1 D9 } (while (<= blkcnt (- (sslength eset1) 1))
7 Q$ \- y1 m! P3 G8 e (setq en (ssname eset1 blkcnt)
' h* F2 v" I6 y1 F enlist (entget en)4 c- H- Q+ N; J' c/ E
space (cdr (assoc 67 enlist))
4 Y& e, F& | z# m) H H: V3 W )
3 p/ z; Q) f* X) V8 o (setq vl (list
' {( U. y+ }5 d0 s# e8 J) b L: e5 u. } (cons 0 "TEXT")
/ g- T3 S A8 f; r+ m (cons 100 "AcDbEntity")
+ Z* r9 w& e* A/ D3 d- u$ P% n x (cons 100 "AcDbText")8 G+ r# _# V& O) a# g) @1 s" r
(assoc 7 enlist): ]4 \. ^3 ~! ^' i' l- h2 a
(assoc 8 enlist)+ u9 \) }' l; z( |/ ^
(assoc 10 enlist)
/ a' Z" b+ l* C3 N# q (assoc 40 enlist)
6 H( Q/ ^% j0 n% p8 b* U (cond ((assoc 62 enlist))
6 X6 a- T, i/ h6 y1 o3 ~2 A" t ((cons 62 256)); H6 y6 u$ x$ r
)4 D: H' ~. E$ S* V2 k f
(cons 1 (cdr (assoc 2 enlist)))
6 t0 ?8 G' x2 b& \( E (if (= space nil)
0 L0 M5 H- E t& m) i (cons 67 0)/ \8 N* A8 ^7 V' A
(cons 67 space)
. a! n! T1 J5 ? i" E )
- T, Y8 Z# E$ T )
4 J) {6 h) }% P; k2 T+ p+ ? ) c/ D/ _# S7 ` W- }- o
(entdel en)" x8 F6 q( j4 e; h8 ?: F- i
(entmake vl)
& l' P7 b8 l, S+ N (setq blkcnt (1+ blkcnt))- r" n3 v2 G ~* v( _5 D
): d0 B3 I% _( m( u" M' A5 P3 T; W
)" b0 S1 L# r- r) t
)
' F# t0 f& d5 P;=====================================================================# ]/ T1 Q8 g; M) r9 N, l- p" g
;============================ Doi Truc ===============================$ d9 ]7 `- k4 |5 ~
;=====================================================================# t6 i& |7 P: p3 F, [: Q
- a$ J" `: C7 I q, N& _;=====================================================================
+ [. _0 @, _4 `: o$ @8 w% }8 |; g;=============== FUNCTIONS GA 1+3+5+7+9+11+13+15+17+19 ===============
) m- |/ [: H2 \# x# T;======================== Tran Ngoc Thang ============================
- {% H$ D2 y& q8 r2 Z& ^# j+ H. q(defun c:ga1 (): A) M' ^; m1 q7 X8 }
(setq a (getpoint "\nChon diem: "))+ {" F; r2 \$ u/ z: @& L" S
(setq b (getpoint a"\nChon diem: "))4 u, u) T3 ^& A9 Z. n
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
3 q0 K8 o2 D2 D0 y(command ".circle" c a)* Z, o6 H* b+ v2 w, G) f% K: b
(command ".line" a c ""). w& T2 S, G! }3 u
(command ".array" "last" "" "p" c "1" "" "")
# \1 Q+ d& O7 b' ?(princ))
: p a$ k6 ^ @. F% ~4 D# A- X$ B G, w- s
(defun c:ga3 ()8 B0 `' d2 I) A" D) a% m
(setq a (getpoint "\nChon diem: "))
; {- H! P8 u" a+ ^9 J(setq b (getpoint a"\nChon diem: "))6 i8 I2 k% ]3 u+ E$ }/ n
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
( B# |' a8 s' ?( T+ J(command ".circle" c a)
4 q2 p* K) E7 I0 q7 O(command ".line" a c "")0 p5 W w' Z$ _ ~3 U( ]' N
(command ".array" "last" "" "p" c "3" "" "")
& l) t; i1 d# F/ f4 j- H(princ))
0 h+ m3 ?; j3 D
+ N' ]; [( S' y4 }$ l* w(defun c:ga5 ()' Q' r- t) j) D
(setq a (getpoint "\nChon diem: "))
! a* w4 A2 l- T7 Q6 S+ l% T(setq b (getpoint a"\nChon diem: "))
/ u, N j1 {$ ~& m1 |1 y/ v4 `/ ~(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))/ l0 b/ b0 J# A f
(command ".circle" c a)* k3 H3 F3 ~' N" A
(command ".line" a c "")7 @' u% c* ~+ Y
(command ".array" "last" "" "p" c "5" "" "")
0 D5 _) n; }( v9 G/ R3 v(princ))* ?* n4 e I6 F, N0 L6 G7 d$ t
* C* Q/ N0 Q# ?8 [; ~& ~% \ }(defun c:ga7 ()1 T7 b0 S0 j: Y; j
(setq a (getpoint "\nChon diem: "))
, G8 J' d( m( a" k' e& t(setq b (getpoint a"\nChon diem: "))
$ b2 U& [ X! t# f# k1 V(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))5 q4 q( }; \# z2 s7 m
(command ".circle" c a)8 h7 X) x5 _+ W* d! I
(command ".line" a c "")
' F3 b! i( j6 D3 r(command ".array" "last" "" "p" c "7" "" "")0 Q1 y, q1 A* g+ ]# D6 v) a
(princ))
5 H& R8 F/ h( e2 p, E* u! t# M0 t" s. j6 t; \0 L! W% W
(defun c:ga9 ()
* F; E2 M; A# `" I# A8 x$ I u. H(setq a (getpoint "\nChon diem: "))
& ^6 E% h! J# a- E(setq b (getpoint a"\nChon diem: "))9 L5 a4 \8 J6 g: c+ G
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))) k. s, S5 e* Y3 `" V: k
(command ".circle" c a)
9 |5 O" t; d! S6 H" m+ x# F0 M(command ".line" a c "")
5 y; m3 z1 K+ `1 H; O& ]1 i0 f(command ".array" "last" "" "p" c "9" "" "")
6 Q0 P- d) O, Q1 ~# a(princ))0 U$ X' p' D" T% T9 l. v* \$ T+ o
. [5 T) s8 h. _7 g: i" R- [5 y% O' z(defun c:ga11 ()/ a( f( h4 |, G5 C; r
(setq a (getpoint "\nChon diem: ")), m# R' C( |% `: q [0 B
(setq b (getpoint a"\nChon diem: "))
* i+ ^( c5 R ]% [" U" T2 V: ?(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))): g$ _4 Q0 @# c+ `/ r3 f* H. G
(command ".circle" c a)
" s) w3 ^: L) w(command ".line" a c "")
7 A# ]: [ f2 W0 _/ W! ]% g. V(command ".array" "last" "" "p" c "11" "" "") h+ R. A* ]5 [3 p: g
(princ))
3 k% a' o5 z4 q! b5 [, [4 a. F$ l1 v! x+ Q+ o; m& `
(defun c:ga13 (), ?& N6 F' l& Z5 b$ z6 a
(setq a (getpoint "\nChon diem: "))
: W+ J. h# B5 y$ C' u(setq b (getpoint a"\nChon diem: "))
0 X) w) ]2 V/ O& i4 J6 d4 R# P(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
4 f' _. Q8 } [7 a8 H7 o! t(command ".circle" c a)
6 E4 S3 D/ F) x* }. { }7 J(command ".line" a c "")
2 k0 v7 n% \; y' g; _- J. p% h) D(command ".array" "last" "" "p" c "13" "" "")
; {/ R7 U' j+ }& s# ]$ S(princ))9 N7 I- @& f' k; N" d
3 h1 F0 o* d; a$ @3 t) w( w7 I- J
(defun c:ga15 ()% x6 E# N" U1 ~$ k9 L
(setq a (getpoint "\nChon diem: "))# m* F9 j! {( v7 G: J) I: Q6 S3 y( c# W
(setq b (getpoint a"\nChon diem: "))
$ J1 ]4 r0 \& V# }0 o g/ ^( K# v/ K(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))5 J7 n0 e5 X' r6 v7 c" D( A
(command ".circle" c a): i* ]1 C7 W+ f
(command ".line" a c "")6 Q \ E5 Z9 c& j3 O
(command ".array" "last" "" "p" c "15" "" "")
- h, g/ w. L7 b+ P& h1 f(princ))% O, G$ r/ ^' G7 w( ^2 h! [1 G, e/ ^
' G- F. y8 _' u4 a" W% M9 Z
(defun c:ga17 ()+ V. ?3 y2 d% X0 N: X+ l& V
(setq a (getpoint "\nChon diem: "))
, M7 C; a5 L9 r* y& |. e7 c(setq b (getpoint a"\nChon diem: "))3 V% X, E! s) Y6 q4 H2 P! A
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
/ r/ v7 y- z T) L(command ".circle" c a)* o5 C P: U) n/ t4 |8 a
(command ".line" a c "")6 {' T5 s) r% W' {" V6 u2 l3 `& \
(command ".array" "last" "" "p" c "17" "" "")
9 P" {: ?, s$ N(princ))7 Y( m( r, a% Q1 d9 i1 |
2 s; N% R+ k! Z$ n
(defun c:ga19 ()
/ K) R/ P+ n4 ~, W2 q(setq a (getpoint "\nChon diem: "))
( i; ?) e- g6 d S6 S. i(setq b (getpoint a"\nChon diem: "))9 G4 R( B& W1 Z G9 ?8 E, A$ a
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))8 C+ A8 |2 v8 }7 D3 }
(command ".circle" c a)8 @+ I B4 V e5 C4 r/ H1 R3 E
(command ".line" a c "")
, `9 a4 s" g( H, Z(command ".array" "last" "" "p" c "19" "" "")+ V: X9 n+ F4 W. K4 F
(princ))5 u( ^6 `4 }! V5 r; W
& {6 I% A3 I/ [/ L6 }: y
;=====================================================================
' v5 L" `' v; O! A2 M;============== FUNCTIONS GA 2+4+6+8+10+12+14+16+18+20 ===============
) `% y& W8 E# \2 D3 y5 W1 x9 I! ~+ r3 p;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 ================= c U% m+ b9 }* ^5 K
(defun c:ga2 ()
. C9 n: ?) g* g, L: |9 T(setq a (getpoint "\nChon diem: "))
, _1 r, P% P0 w% a/ ?(setq b (getpoint a"\nChon diem: ")). \# o- s8 U4 ~7 _. f
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))2 J5 J3 s% c) N( a9 L
(command ".line" a c "")( `! Q: |8 H7 G6 U+ ]+ C
(command ".array" "last" "" "p" c "2" "" "")! `# h( u. Q5 k4 m1 b, f4 z3 {* x
(command ".circle" c a)
$ O8 U* ]) X, F% m- j(princ))
U* h. V* W4 Q7 R" r' X$ { f* S; e6 m% V1 C" w, B; k4 p5 M
(defun c:ga4 ()
! X) e* R. s& F7 m C0 p' w(setq a (getpoint "\nChon diem: "))' a7 E! Y% h5 c& c2 K& U% T8 u) p1 l
(setq b (getpoint a"\nChon diem: "))
1 d3 X. u) T7 v(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))2 ]2 }) F" ^* b3 W+ d0 f2 A
(command ".line" a c "")# z2 |! z; n2 ~, L6 A* P$ ^3 T$ b
(command ".array" "last" "" "p" c "4" "" "")
/ @9 \& K2 e! W2 ]0 }9 _(command ".circle" c a)
+ @6 a% C! |2 r- V8 x8 J(princ))# ?; b) P$ s' C9 ?: l
5 d# D5 D% n& {
(defun c:ga6 ()
! N& A0 q0 A7 B(setq a (getpoint "\nChon diem: "))* ?& A( ?/ x+ s5 J
(setq b (getpoint a"\nChon diem: "))
[; f4 ^' B: ?) u( E. |$ B(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
/ k# y9 ?4 h2 i' k7 R2 \(command ".line" a c "")+ Y7 n" b5 t" v, l ?2 d# }
(command ".array" "last" "" "p" c "6" "" "")
) }+ [2 g8 [* \2 _3 e% ^+ g& N(command ".circle" c a)
& r+ [& X# W+ J(princ))( y0 V* |. u: S- A) w6 V& A; Y% J
! F$ u0 r2 R; X
(defun c:ga8 ()
/ x" x% Y# Y: j3 l6 r(setq a (getpoint "\nChon diem: "))& b5 R4 P6 U1 g; y' q' ]$ Y: I( p
(setq b (getpoint a"\nChon diem: "))/ V6 W* |6 k1 D3 I
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
& p5 ]) g: Y+ m, _2 R$ Z(command ".line" a c "")
1 n9 B/ O }; V: p(command ".array" "last" "" "p" c "8" "" "")
5 W V2 R, G" a" n" R(command ".circle" c a). t" C" ^ r- L- j# `2 e1 U
(princ)) s+ D" F n: Q2 P& n' q- e
& h0 u }3 E, u" a/ O1 E0 |& o
(defun c:ga10 ()
\% P% M! L5 @ x4 S$ t2 f(setq a (getpoint "\nChon diem: ")), N; ?0 ^1 D' ]& ~9 A. H
(setq b (getpoint a"\nChon diem: "))
8 A3 {- G; f% M6 v(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))). q! b! [9 Q( p {
(command ".line" a c "")
/ r0 E! l8 U2 m* k(command ".array" "last" "" "p" c "10" "" "")! w0 L+ J+ `' ]8 Z7 O& i
(command ".circle" c a)2 E; Z5 \' X* g/ s& ~
(princ))
) x% S3 E- I- N+ f0 m& m; t* h' \4 @! n& V) S1 T# Y
(defun c:ga12 ()
7 S+ x8 D! W: y; r5 v% Z6 s(setq a (getpoint "\nChon diem: "))
1 t; W% ^& Y. B; t. b, p(setq b (getpoint a"\nChon diem: "))
' h0 p1 M1 H* d7 h! ^6 ^5 `' C$ @. _. f: k(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
7 d& ~) ?+ T( C; K$ _+ G(command ".line" a c "")
! i5 H% T4 a, r(command ".array" "last" "" "p" c "12" "" "")
& _2 Z+ J c# A+ e/ g/ t- N& r(command ".circle" c a)
0 o3 P. p' a& l' @4 T(princ))
) ]3 a# P: J: f4 n
: r% x- n* K+ u% i(defun c:ga14 ()+ ^3 r" ^0 R# C" x
(setq a (getpoint "\nChon diem: "))
' g+ ]& d$ D0 e! W' Q1 G(setq b (getpoint a"\nChon diem: "))
6 H, h3 U+ |/ t: ~: y(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))): s P6 u# j5 J% ?; u& @
(command ".line" a c ""), m; b! N* y' v
(command ".array" "last" "" "p" c "14" "" "")
/ e& m: p. ^' J! v* C, {(command ".circle" c a)7 j5 F& Z! l/ r8 H/ r' R5 ?4 t- c
(princ))
3 ?! F$ E+ v2 Z" ?" ~5 S" m% o) \8 R# D% a) w% t, u
(defun c:ga16 ()9 V" ]9 X3 f" a) c
(setq a (getpoint "\nChon diem: "))# d- _! W5 L6 s* K
(setq b (getpoint a"\nChon diem: "))
4 s1 \$ ?: e4 _6 ?+ V {5 c1 W(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
6 X2 K7 ?" t4 J5 f6 Z, ?% N(command ".line" a c "")
4 Y+ Z: B% E2 G. x(command ".array" "last" "" "p" c "16" "" "")
% i Y; h4 V i7 W8 D0 l( i(command ".circle" c a)
6 n$ c* ]" A7 ^6 \$ R2 n4 \(princ))/ M0 y. q5 J) A$ O0 I+ L$ S
& O8 G# E P$ c, N7 L I(defun c:ga18 ()/ B, J1 f6 n$ X1 @1 M) d' A' J
(setq a (getpoint "\nChon diem: "))
! i' R* o4 i( r/ g0 j4 R1 w(setq b (getpoint a"\nChon diem: "))
4 ~" h2 W; B7 [: A) z4 e* D$ E(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
& G. ^& ~9 @- U(command ".line" a c "")
$ S1 |3 f3 j: U/ f7 L! _& t0 v+ G7 \(command ".array" "last" "" "p" c "18" "" "")5 Q( y% x o( m; g3 j# F1 A, R( J
(command ".circle" c a)" W+ s" s0 W. |1 R2 Y9 K- r( U
(princ))
- e/ ^" t2 q2 F0 u! D
# l6 U- ?1 A$ l* \/ t" D(defun c:ga20 ()
3 N2 ]1 \' o8 V7 u(setq a (getpoint "\nChon diem: "))
4 c# N7 u/ O9 P(setq b (getpoint a"\nChon diem: "))
% w5 j5 n$ d* i6 G7 }, s; E(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
. X* R& x+ D$ I(command ".line" a c "")
" `* f$ f q: k! x' \3 g [(command ".array" "last" "" "p" c "20" "" "")
" n1 c# e) A6 ]: _% N: Q9 @; h(command ".circle" c a)
0 H% I5 o/ _" a0 E(princ))
- M$ w" d7 v+ g! U, U9 p {6 w# }& A- K4 v
7 g! H9 I# Z# l" {
6 g' O. a5 g# w' T& M! y) L4 F;=====================================================================- L8 c- D0 o2 c' n2 q+ O9 }
;============== FUNCTIONS GA TUY THICH : EVERYTHING IF ===============$ U6 _( \' ^' Z
;========================== 06-11-2016 ~ 18h00 =======================
) I% G3 x/ b- G$ O* o+ x! u/ m;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
/ B0 n# Z( e* z& ~4 l, K(defun c:ga ()* l7 n6 N5 K( j9 f
(setq a (getpoint "\nChon diem: "))
: @) N2 A0 B2 o4 m( o(setq b (getpoint a"\nChon diem: ")), s0 l4 ?& u C
(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))): Z9 q( Y7 b0 S, U! ]
(command ".circle" c a)# b( N' q% b' r3 w/ @
(command ".line" a c "")
G6 G$ }3 I# g$ ?& }(command ".array" "last" "" "p" c "NUM" "" "")& D, M+ y D+ Q! T
(princ))
8 `7 C7 m7 k) m. R p2 N8 }; F$ N3 Y: a8 g
;=====================================================================
% s: S' D/ C7 E3 A;=========== FUNCTIONS HOA THI TUY THICH : EVERYTHING IF =============
6 G9 j- o8 G+ N;========================== 06-11-2016 ~ 18h40 =======================0 \; r% _ ?+ T2 U9 P/ O
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
6 ]- A l* B1 P h" |/ x/ x: k
5 y4 l/ {% {7 i+ g0 K7 |3 G4 c(defun c:hoathi ()
^$ i7 I" a6 m: H8 p(setq a (getpoint "\nChon diem: "))& P' S, u, b+ |( a2 x9 q
(setq b (getpoint a"\nChon diem: "))
! f, \, W( L7 g/ @6 E) Z(setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
% q* c. g5 h5 |) c(command ".line" a c "")* A( P7 C3 j& b& ?+ q6 y- S( |
(command ".array" "last" "" "p" c "NUM" "" "")8 E7 q+ N5 x) ?. ?
(princ)). M5 S! V Y, B* u, n3 _" u/ e
$ F q5 K2 H8 O4 {8 D6 U;=====================================================================3 D f U) w2 Y) P
;============= FUNCTIONS CUNG TUY THICH : EVERYTHING IF ==============( b- D; w( c0 e3 C0 P0 K, r/ R
;========================== 03-11-2024 ~ 19h33 =======================
# [0 O" n4 i' v2 W3 W% A3 o9 D( Z8 j;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
8 L7 b% W, A, ^$ f8 u, R* B2 u) Y3 J' W
(defun c:cung ()3 `* u$ h( l9 S4 W: d
(setq a (getpoint "\nChon diem: "))1 W& h0 Q9 v9 S$ r- ~
(setq b (getpoint a"\nChon diem: "))
" L4 X) h! V( R+ F(setq c (getpoint a"\nChon diem: "))
: N+ T5 D6 O( n(setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
: C0 t3 `; S! X: }" U" K(command ".arc" a b c ""), S3 l) Y* v% k/ g( C
(command ".array" "last" "" "p" c "NUM" "" "")
7 c5 ^! R. S7 P9 ~% S, z% Z(princ))* h9 n3 R' {/ T, f: e( c; G
! |# C; H: v4 U2 z+ m;=====================================================================6 @ K+ _. j6 Y9 u; H1 V& R- Q
;============ FUNCTIONS HECLOIC TUY THICH : EVERYTHING IF ============3 u8 {0 U2 R. \3 O
;========================== 03-11-2024 ~ 20h02 =======================
, o) ]; A; ?9 F# k% R) V;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================% B+ q4 V# u" E& U: d' O p) `
(defun c:hecloic ()
1 M. }+ s$ a) F- ?% n3 t(setq a (getpoint "\nChon diem: "))8 Y7 J8 i' C- F, d1 h7 x
(setq b (getpoint a"\nChon diem: multi "))0 Q& `( N2 I$ L6 J
(setq c (getpoint a"\nChon diem: "))(princ)
9 A/ B( y5 X7 Z4 W$ v# m(setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))): a$ d# q# s+ V. A @0 q$ x
(command ".arc" a b c "")
% M# J& I; k1 V(command ".array" "last" "" "p" c "NUM" "" "")
# r/ X7 ^( ^0 A8 G) M, {(princ))
* ]$ l7 d+ C0 X6 M) ~7 Q5 ?
; k1 s- y! ^" H4 N7 V;=====================================================================' c% q5 D- [; L1 D9 p
;============== FUNCTIONS GAY TUY THICH : EVERYTHING IF ==============0 K! [1 y6 N. }! o$ q2 t( {$ m, c
;========================== 03-11-2024 ~ 19h38 =======================
( u1 \6 e3 {+ v! N/ K;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================" Y$ n) j, |% x6 s! R
# o- {! h, G/ }( x2 T; \. t(defun c:gay (). L- P5 `- s3 y* I7 `' y! M
(setq a (getpoint "\nChon diem: ")) } S1 Q4 ?" Z7 q7 h
(setq b (getpoint a"\nChon diem: "))% H/ D4 o6 w! c% d
(setq c (getpoint a"\nChon diem: "))(princ)
1 ]& z+ b8 ~: U(setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
( Z3 B$ h: F4 M(command ".pline" a b c "")
2 f& b% \8 [( t* |5 e, Z# W T(command ".array" "last" "" "p" c "NUM" "" ""), o5 @7 B! i( P* ?4 M# N- K* x
(princ))
" \8 e X$ V5 c% S4 g$ M2 t2 V+ a
;=====================================================================
* w! C8 o% n$ @+ e6 P+ _* W6 i;============ FUNCTIONS HECLOIT TUY THICH : EVERYTHING IF ============
/ z) t+ U' Q3 c4 q _. }- ^" e3 d;========================== 03-11-2024 ~ 20h02 =======================, N2 d: _+ m+ {* n' J
;;;=============== Tran Ngoc Thang - Sinh 03-05-1976 =================
) Q9 j0 e1 G, @/ i( H) f+ |
' r" P' v# B) n( @2 s(defun c:hecloit ()$ y1 ?0 A" j: n' L: N; B
(setq a (getpoint "\nChon diem: "))+ [: m+ r+ R7 Z0 C5 z" Z6 B
(setq b (getpoint a"\nChon diem: multi "))( e/ a* ~% Q2 n# s
(setq c (getpoint a"\nChon diem: "))(princ) `( D# u, Y+ j0 x/ z6 D
(setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
' t9 J/ r. ]2 t(command ".pline" a b c "")0 j7 }8 ?) [* B( Z" M; F0 X
(command ".array" "last" "" "p" c "NUM" "" "")
4 o& l6 @( |# U" G1 L(princ))
: F" ^* {$ w3 K# ?/ v/ `" y
( `- i; C6 V' r9 Q0 n5 m( m9 s
: E- M4 e0 @ a% H;;; ============================ Merge Hatch =============================
) s( i# F( y! m. @) R
0 m- A0 N0 U1 |+ G1 y(defun c:mh (/ ss entht sl i dt dtht)
: u; k9 V q' l! M, K
% `7 K& @" H7 B. K/ ?6 `/ d (princ "\nMerge Hatch - free lisp from CADViet.com"). N$ F/ \9 L- _) G) n
o7 l% p- L" W6 Q9 e/ i (setq1 h! u9 a% A' Y T% n/ k) ~
ss (ssget '((0 . "HATCH")))
I, H' d/ j+ S8 T- e; Q5 _; V sl (if ss$ @) R U. X3 m- f4 \1 e
(sslength ss)
& z# E5 f7 A9 h 0
/ m* | a" _5 @. G; j )& J3 J* M' t( g
i 0
" A2 q8 ?0 [5 n' J. B; y l 0
' @( R' g+ M% ], ^1 U' y# Y" ~ )
0 Q: ~! k3 d" Y- \2 _7 g3 T* a! C* j6 f9 o$ D9 c
(repeat sl
2 _( `: e* n0 u r: r: p. X (setq
3 o* Q( T0 k e$ D4 T entht (ssname ss i). [4 E6 s( f% f' D+ U! G
dtht (getbdata entht), F" N. F! a: t2 }4 c
dt (append dt dtht)# I7 ?1 l |9 F0 {) C
l (+ l (cdr (assoc 91 (entget entht))))/ U" i6 |; u, @$ k$ m6 Y
i (1+ i)4 v0 l8 [, @( J9 k3 ]2 v! d
)6 M2 i# h9 g& f" v/ o* g- }
)
% \8 z, }, D }, S! n
% Z! p4 O4 V/ o/ f6 h0 ^; k: Z, M (setq ent (ssname ss 0)
- A9 f9 t/ |- v+ ~4 {4 ` ss (ssdel ent ss)
* Q7 z0 m# `+ k4 y. H6 @ tt (entget ent)+ k- ~9 r0 q- L( p. z" z
duoi (member (assoc 75 tt) tt)) H5 U4 |( }6 _3 o* G
dau (reverse (member (assoc 91 tt) (reverse tt)))
% Y& i* n: ~3 B0 u5 B, m# s- A tt (append dau dt duoi)$ l* f6 |1 b. @8 e
tt (subst (cons 91 l) (assoc 91 tt) tt)# [( w5 [( L5 \: k: n- T
)
/ Y( l; O8 K5 T5 } (entmod tt)
$ O: m% c' X% P' Z0 d9 w' l3 U! E1 P2 U& o4 i' e1 u3 T& h
(command ".erase" ss "")$ q7 o" E4 C$ {: |- B! p' ~* E9 n4 d
(princ)/ w& g8 }5 d9 o' y
)
; T5 k- k/ f# b9 U q6 S* n* ]6 b9 |* ]" l( {
(defun getbdata (ent)
9 E+ R( n0 o* `+ W" q (setq tt (entget ent)% D7 K# r$ A( g* K
tt (cdr (member (assoc 75 tt) (reverse tt)))- Z$ \6 d, @$ h& I! b7 a3 A1 z/ b
tt (cdr (member (assoc 91 tt) (reverse tt)))7 w# v! M/ B; m/ |1 k# k, U+ i
)( K6 Z( u; h4 q8 \
)
8 `: H. v0 ^6 G/ u; F5 Y( D
+ N% Q, a! Z" W: J/ u2 }! E7 N
) n& W+ r$ ?" ^' r; w(princ)$ R) g( ?& c n" P
5 }/ z, H* R3 q& c, F3 f' r;;; =========================== CAC LENH LAYER ==============================6 v2 X" r( L# m: ~
;;; =========================== Layer hien hanh =============================
! y- n5 J3 u7 H
2 t0 f$ t, T$ S6 V; n' Q(defun layset (/ LAY) (setvar "cmdecho" 0)
6 J/ @- @4 k: N8 ~& F$ `& B (setq LAY (entsel "\nPick vao doi tuong muon Layer hien hanh la Layer cua doi tuong do : "))% S* ?0 {* x$ b9 n
(if LAY (progn 1 r$ W4 K0 v/ n0 T. i
(setq LAY (cdr (assoc 8 (entget (car LAY)))))
- p# M3 v; K4 x- C4 \3 \- n$ U7 p! ? (command "_.layer" "set" LAY "") (princ (strcat "\nLayer : " LAY " da la hien hanh.")) )
+ j7 D' z$ B2 w; B I" y4 v+ l } (progn
# N8 {% A& a5 b( N, z1 ^ (if (not ddlop) (load "ddlop")) (if (setq LAY (ddlop)) & @; z0 \) k+ d( M& o, m
(progn
& Y) }: W, g" p% _: C6 L4 t" X6 j- R (command "_.LAYER" "ON" LAY "THAW" LAY "SET" LAY "") (princ (strcat "\nLayer : " LAY " da la hien hanh.")) ) ) ) )(princ) )3 y: F+ ^0 L4 d7 P0 b
(defun c LL () (layset))(defun c AYSET () (layset))
! N8 v6 A* O4 U% O7 n1 T! Y" U0 F: M1 a- P$ t. D
;;; ================== Cap nhat doi tuong vao layer hien hanh ==================; {8 O1 w6 _( U8 c& i0 s
4 _' O1 ?" Y" X! }4 P2 }/ G
(Defun LAYCUR (/ SS CNT LAY) (setvar "cmdecho" 0)$ H/ R I: @2 a% E6 |4 F% l
(if (not (setq SS (ssget "i")))
3 C* D/ O- N- }' c% L$ S6 s4 G (progn (prompt "\nChon doi tuong cap nhat vao layer hien hanh: ")2 N+ S, y& i; r. b6 i) Q2 j( ]* s
(setq SS (ssget)) ) )& |' d/ u& |% w; L0 V0 i# w; v$ f
(if SS (progn
# Z( j- r! [8 q' T& C' F (setq CNT (sslength SS)) (princ (strcat "\n" (itoa CNT) " doi tuong tim thay.")) (command "_.move" SS "")
& j. {1 O3 S9 H" ^( W4 k1 q) y) i (if (> (getvar "cmdactive") 0) 5 V- X' b1 \) a0 D+ F
(progn+ l6 V) e- T! E- M4 q. N {; ~
(command "0,0" "0,0") (setq SS (ssget "p") CNT (- CNT (sslength SS)) ) )* r( F& a" j# O& x3 G( {$ p
(setq SS nil) ) (if (> CNT 0) 5 d4 y6 t$ J1 h Z+ Q+ z( D
(princ (strcat "\n" (itoa CNT) " doi tuong tren layer LOCK.")) ) ) )
" _8 I! [! R! P' Z4 @ (if SS (progn: y% ?; R4 g4 O5 ?5 p# S' D9 M
(setq LAY (getvar "CLAYER")) (command "_.chprop" SS "" "_la" LAY "")
6 a3 g. E8 J. s2 n( C) H2 [ (if (= (sslength SS) 1)! B9 S+ k7 M" c- u1 G4 ?8 k
(prompt (strcat "\n1 doi tuong da cap nhat vao layer : " LAY " (layer hien hanh)."))
- k _6 h5 F* Y' C (prompt (strcat "\n" (itoa (sslength SS)) " doi tuong da cap nhat vao layer : " LAY " (layer hien hanh).")) ) )) (princ) );end
3 Y1 G0 M5 j$ U(defun c AYCUR () (laycur)) (defun c HH () (laycur))
4 B+ a9 @$ y1 K, z, m$ ~2 z1 L. K5 H0 X. _
;;; =========================== Layer Iso ===================================- N3 X7 C, [& }4 ]# W& J
4 w0 t: v; o6 W2 V" ~9 W4 y5 p: V7 b(Defun LAYISO (/ SS CNT LAY LAYLST VAL) (setvar "cmdecho" 0) S. p; d F! W& t* [. Q
(if (not (setq SS (ssget "i"))) (progn5 ?7 Y2 Z: G& i8 G/ J1 U9 ]/ H& ]
(prompt "\nChon doi tuong tren layer(s) muon lam viec doc lap: ")
+ D! k" s* d* J8 z/ [ (setq SS (ssget)) ) )* t P3 m* e6 g8 }; I1 G3 u
(if SS (progn (setq CNT 0)
. | {4 z1 C2 U. V3 T, y (while (setq LAY (ssname SS CNT))
) ?& a: b* A' q (setq LAY (cdr (assoc 8 (entget LAY))))' C) p4 j& [' x8 D5 l
(if (not (member LAY LAYLST))
! I3 d$ I% ~8 f: K+ b( { ]2 I$ ~ (setq LAYLST (cons LAY LAYLST)) )+ Y' V, _9 G) c9 f) Z
(setq CNT (1+ CNT)) )) a n3 T0 c# o2 B1 V7 I
(if (member (getvar "CLAYER") LAYLST)
$ X* W" K+ ^- k; \: Q (setq LAY (getvar "CLAYER"))# w9 T+ o- t+ ~' {1 I: a
(setvar "CLAYER" (setq LAY (last LAYLST))) )
' ]7 C J3 @' G3 d( v5 |9 c* W (command "_.LAYER" "_OFF" "*" "_Y")0 A, D0 H3 N6 r( \4 X1 d8 j+ T
(foreach VAL LAYLST (command "_ON" VAL))7 N. l5 v+ S' ~; t2 B' X. l$ v& E
(command "") (if (= (length LAYLST) 1)/ L: x: I0 d) y) Y
(prompt (strcat "\nLayer " (car LAYLST) " da tach ra."))3 K1 z7 O. @, S/ X. h
(prompt (strcat "\n" (itoa (length LAYLST)) " layers da tach ra. ". v3 }/ x# @% |. [. U
"Layer " LAY " la hien hanh." ) ) ) ) ) (princ) )8 U9 q' }6 i; [, I$ S. `0 R
(defun c AYISO () (layiso)) (defun c I () (layiso))
; A/ K& ^# ]7 G2 e5 t* n: f* U/ s* c' Q1 J3 X; r0 b
;;; ========================= Layer Match ==================================
0 _2 X. d9 N7 B, h7 a5 }' y9 { s5 W! q( f; W* ?
(Defun LAYMCH (/ SS CNT LOOP LAY ANS)
1 @' u' z% N6 ~8 E+ `: n (setvar "cmdecho" 0)) R7 k; V% Z. @4 D
(if (not (setq SS (ssget "i"))) (progn4 |1 ~1 o' r9 ~& ?8 k
(prompt "\nChon doi tuong muon thay doi Layer : ")1 w. V3 e5 @7 H5 t a
(setq SS (ssget)) ) )
7 A" m8 `1 E3 e: H) b8 B (if SS (progn
$ z* Y2 w$ W, b4 T( A @ (setq CNT (sslength SS))% {2 e2 Q1 S" |3 L4 M
(princ (strcat "\n" (itoa CNT) " found.")) (command "_.move" SS "")
$ A- c/ a7 C2 p, [% g9 v7 B (if (> (getvar "cmdactive") 0) (progn( \0 e7 k6 i3 V, K
(command "0,0" "0,0") (setq SS (ssget "p")7 ?( H n% o' j) ?' S) G
CNT (- CNT (sslength SS)) ) )4 F# ]* ?' G6 F# V) G* l' n/ }
(setq SS nil) ) (if (> CNT 0) 8 r @4 k, L; }4 J3 |5 _' t* a! o
(princ (strcat "\n" (itoa CNT) " tren layer LOCK.")) ) ) )
! H* N+ s7 U5 R; ?' ~; H9 N9 m (if SS (progn
# p" I8 K/ C8 F Y0 v" o" [& w (initget "Ten") (setq LAY (entsel "\nTen layer/<Pick doi tuong>: ") LOOP T )2 A( t7 H6 V8 G+ H
(while LOOP (cond* [$ o7 W4 O6 w; }2 A
((not LAY)
) Q1 g& r; P# C2 B4 v$ c (prompt "\nKhong chon doi tuong.")8 A3 n! `( Q" `/ \; {/ h3 z
(prompt "\nSu dung layer hien hanh? <Y> ")
6 A$ C: d2 v3 T3 B8 n! s (setq ANS (strcase (getstring)))" r y; E7 h" O
(if (or (= ANS "") (= ANS "Y") (= ANS "YES"))
/ s8 L5 }0 m1 L' m (setq LAY (getvar "clayer") LOOP nil ) ) )! u0 V( ]: o; h- b0 k; D* j, D. P
((listp LAY) (setq LOOP nil) )
" u& M5 V8 d1 c6 m W ((= LAY "Ten")* _2 R% r6 Z. h' f1 S0 C
(setq LAY (getstring "\n>Nhap ten layer: "))1 `6 V: d# R, n8 |; R
(cond
! O3 h; a6 D4 ]' g) r ((tblsearch "LAYER" LAY) (setq LOOP nil) )
: @* G) M- i( x- |6 m ((/= LAY "")) \# U) {/ H2 q& |2 C# |/ Z1 E
(prompt "\nLayer chua co trong ban ve. Tao layer moi? <Y>: ") U( I7 e( t* J
(setq ANS (strcase (getstring)))
/ X- T1 b" T! V/ e (if (or (= ANS "") (= ANS "Y") (= ANS "YES"))
' M$ T# d- k! h$ d. F (progn
: J: n0 c" B5 s! e" } X* W (command "_.LAYER" "NEW" LAY "")- L) M* f% i# h6 B$ g2 M7 D+ k V
(setq LOOP nil) )' h4 k: G: m+ x5 z/ ^# V
(prompt "\nLoi ten layer.") ) ) ) ) )
% y4 q8 ^, l: X0 a X (if LOOP (progn (initget "Ten")
% H; {! Z/ k: I! W* M% o/ U$ R6 o3 j (setq LAY (entsel "\nTen layer/<Pick doi tuong>: ")) ) ) ); while LOOP; S$ w3 i$ @$ M$ I# z
(if (listp LAY)% D/ l) D' C5 @7 T; K
(setq LAY (cdr (assoc 8 (entget (car LAY))))) )
' |; b C+ x2 G/ ]% p (command "_.chprop" SS "" "_la" LAY "")
+ H6 _4 @4 B' W* e; m' p0 y (if SS (prompt (strcat "\n" (itoa (sslength SS)) " doi tuong thay doi toi layer " LAY )) ): j! Z# _# t) l
(if (= LAY (getvar "clayer"))0 w( r3 n- J* U& ^9 C: @( C H: ]+ S
(prompt " (layer hien hanh).") (prompt ".") ) ) ) (princ) )
+ c$ m" @, R3 \% u2 h! r(defun c AYMCH () (laymch)) (defun c:CLL () (laymch))
9 x! d0 u- R% k- U, f# A- [8 B2 q- n; P$ U# N
;;; ============================ Layer OFF =================================. a4 v, |9 m- s* a
- E2 j3 G1 z* d
(DEFUN C J (/ SSET SSL ENT LAY I MODE); J" Z" ^% s l1 N
(SETQ SSET (SSGET))
) i9 k6 y; \( r# h" q0 B (IF (/= NIL SSET)
/ x, Y$ `4 C( f! Y (PROGN
$ S6 J$ P: @8 b (SETQ SSL (SSLENGTH SSET))1 U7 q! I% l0 F$ E8 k* G
(SETQ LAY "")/ a/ e3 S* W3 M% |
(SETQ I 0)# w% S! V/ A) t" O3 t ]
(SETQ MODE 0)
# K p4 z/ q- Y, i (WHILE (< I SSL)
( {# d& Q% ]" `9 L7 v (SETQ ENT (ENTGET (SSNAME SSET I)))* ]7 \9 Y8 s! k {+ U
(IF (= (CDR (ASSOC '8 ENT)) (GETVAR "CLAYER")) (SETQ MODE 1) )* v: w9 R# s$ B/ A
(SETQ LAY (STRCAT LAY "," (CDR (ASSOC '8 ENT)) ))% z% W- p( ]4 L; j% x4 y" J/ N4 ?
(SETQ I (+ I 1))
s- r' {6 m& S4 v7 X )
& }' ~- I/ [8 v, |+ n (COMMAND "LAYER" "OFF" LAY "")
t# o8 H m$ Q (IF (= MODE 1) (COMMAND "") )
4 @) X' U; W/ n7 S) B4 n2 I4 } )
. x" Y G$ X0 K4 O+ w )
( M, l! u+ T0 k' S- P+ q) ]! I (PRINC)6 G; y$ n$ O q( V- H) w# W3 A
)
! E6 U7 C0 a9 C h( j7 A( j
5 K$ U) \& R' v! t( I. c;;; ================================ Layer ON ==============================5 m! o$ ^( m7 z& y
5 Q6 Z! V! f5 s+ a, i, R3 t
(Defun LAYON () (setvar "cmdecho" 0)
1 v9 G9 j' M- D; b+ c# n% D (setq Lay loff1) (setq Loff1 Loff2) (setq Loff2 Loff3) (setq Loff3 Loff4) (setq Loff4 Loff5) (setq Loff5 Loff6) (setq Loff6 "0")% U8 w* u# n0 S" n/ M
(Command "LAYER" "ON" Lay "") (princ (strcat "\n Layer : " LAY " da ON.")) (princ))+ j% b6 s2 T0 }6 j( M E
(defun c AYON () (layon)) (defun c:LOO () (layon))% M& J4 _! u- q
(Defun C:LO () (setvar "cmdecho" 0) (Command "_.LAYER" "_ON" "*" "") (princ "\nDa ON toan bo cac Layer !") (princ))
2 A9 |: w; e, G* T
/ ~; g0 {; K2 M;;; ============================== Layer Freeze ===========================
# H3 b6 |" |7 ?. B$ G! N0 Q0 Z2 P ~0 w7 {8 Q6 s
(Defun LAYFRZ (/ LAY TEMP)(setvar "cmdecho" 0)
[! z9 Q' K4 m8 x) d( Q+ z' P(prompt "\nChon doi tuong tren layer(s) muon FREEZE: ") (SETQ SSET (SSGET)). j* e7 [* p8 J
(IF (/= NIL SSET) (PROGN; G' K* p; N k& o* N
(SETQ SSL (SSLENGTH SSET)) (SETQ LAY "") (SETQ I 0) (SETQ MODE 0)
2 y/ x5 q$ T8 D! ?4 X" y. n7 K" l (WHILE (< I SSL)4 @2 j4 l9 W& I; b7 B' N
(SETQ ENT (ENTGET (SSNAME SSET I)))) j, \/ I6 n! b9 i2 F
(IF (= (CDR (ASSOC '8 ENT)) (GETVAR "CLAYER")) (SETQ MODE 1) )% ^9 f9 @- _8 w% d8 a6 n
(SETQ LAY (STRCAT LAY "," (CDR (ASSOC '8 ENT)) )) (SETQ I (+ I 1)))' e* Q% g0 ~5 s- C8 F
(COMMAND "LAYER" "FREEZE" LAY "")
8 a7 I" ]- k( R$ l( v (IF (= MODE 1) (COMMAND ""))))+ c( ^# o7 Q7 \7 j" q
(setq Lff6 Lff5) (setq Lff5 Lff4) (setq Lff4 Lff3) (setq Lff3 Lff2) (setq Lff2 Lff1) (setq Lff1 LAY)
4 D& Q+ j9 P. r! E# @' [5 W (princ (strcat "\n Layer " LAY " da FREEZE."))(setvar "cmdecho" 1) (princ) )
1 E4 N9 ~! j3 N4 w/ r9 \, {- N(defun c:LAYFRZ () (layfrz)) (defun c:LLF () (layfrz))3 c! ]2 d( ~4 O! m3 y
1 P( q' \% j) x$ F6 i;;; ============================== Layer Thaw ===============================2 @: l( Q1 M& V% E$ Q
( W$ X! C. w4 f
(Defun LAYTHW ()" N) X8 h. h, p( D/ |
(setvar "cmdecho" 0)
7 D5 |, q& Y% P# z# x (setq Lay lff1) (setq Lff1 Lff2) (setq Lff2 Lff3) (setq Lff3 Lff4) (setq Lff4 Lff5) (setq Lff5 Lff6) (setq Lff6 "0")
% G2 M0 M% Z0 S% Y (Command "_.LAYER" "_THAW" LAY "")' S" K6 A# F2 f$ k0 }/ R
(princ (strcat "\n Layer : " LAY " da THAW."))
; d2 A+ F' x) N7 X) p- ~ (princ) )
, S8 M- |) k) [' b( c(defun c:LAYTHW () (laythw)) (defun c:LW () (laythw))* C: a2 [0 |1 K8 F- S: o
1 i3 M8 U( t' l! [;;; ============================== Layer Lock ==============================( M4 p5 Q/ g, V% u
. A0 h$ H. _8 _(Defun LAYLCK (/ LAY)
8 ^% ^* G3 J+ b' P( L% n) C& _ (setvar "cmdecho" 0)# c$ s4 u2 p# ]. I$ y1 c
(setq LAY (entsel "\n>Pick doi tuong tren layer muon LOCK: "))$ D6 y& [. @1 ]& U$ q- }
(if LAY
' W5 u. P' T) [* I- O (progn
) k6 A7 ]1 D; s3 O$ u8 w# w0 b0 f$ ~. P (setq LAY (cdr (assoc 8 (entget (car LAY)))))
3 Y6 \& O7 g' e( C! a (Command "_.LAYER" "_LOCK" LAY "")* J* g. E2 A' I2 W
(princ (strcat "\nLayer " LAY " da LOCK.")) ) ) (princ) )3 i$ W& w' b6 W3 w& B# R& B
(defun c:LAYLCK () (laylck)) (defun c:LK () (laylck))
2 V, A# L, o& v( a9 C- N2 U
# o$ B% `2 t( ^;;; ============================== Layer UnLock ==============================6 T( T- I: |; o& i5 y0 r# d
$ x$ f' L) W O" U
(Defun LAYULK (/ LAY)- y9 x2 N4 G- J+ S0 f! U$ ~
(setvar "cmdecho" 0)7 U; u& O! m' ~3 R1 C
(setq LAY (entsel "\n>Pick doi tuong tren layer muon UNLOCK: "))
, @8 n. a8 n- ^( I (if LAY
1 N0 q7 E! V: F0 A' i3 P (progn& f3 m. j5 O- q: ]/ _- N
(setq LAY (cdr (assoc 8 (entget (car LAY)))))
/ b2 n; r( q% k. E" z (Command "_.LAYER" "_UNLOCK" LAY "")
1 V* M5 q1 _; ? (princ (strcat "\nLayer " LAY " da UNLOCK.")) ) ) (princ) )
4 S% R2 B' |1 Y' V. F1 t, Y6 H+ Q' K(defun c:LAYULK () (layulk)) (defun c:LU () (layulk))
; L2 [" c! H5 v+ C& W1 l4 n( }$ V
;;;===================== Delete all objects of Layer ========================: j- g0 g7 ^6 n( G) d
7 f% @2 p6 v& M
(defun DELAYER (/ ocmd L S) ( a& j( m/ Q8 c- B: ?
(setq ocmd (getvar "CMDECHO"))
: h) S, g" m8 C7 ~( r& i (setvar "CMDECHO" 0)0 R$ v/ `# A' g( u9 l! ?
(setq L (strcase (getstring "\nLayer(s) to delete: "))), }0 d; `! `- u( R
(setq S (ssget "X" (list (cons 8 L)))) . e8 f: ]8 H: B6 W( w+ w
(if S , _/ E: i% J9 P0 f& p
(command "ERASE" S "")
" l. a5 ]3 w9 b1 R+ ] y (princ "Layer empty or not a valid layer name.") )
, H' Y6 t- m4 G) B, [ (setq S nil)
* u$ m3 o8 T* v (setvar "CMDECHO" ocmd) ' Q4 `- u1 j( J I$ s
(princ) )
8 s& D( j; P/ _; ~% k$ z) x: w( ?(defun c:DELAYER () (delayer)) (defun c:DELLAYER () (delayer)) (defun c:DEL () (delayer))2 ^) l" U5 {/ h1 Z% P! K- w7 Z
2 N+ g" X$ h- V;;; ========================= HET CAC LENH LAYER ===========================
# J% u X u0 w2 k, \
& I+ v N1 U% };;;====================== EXTEND NHIEU DOI TUONG ===========================
0 d: F9 b9 c1 h1 i! M' O" D( T1 m4 ?% q# D O. v5 j- X1 O
(Defun C:EET (); ?# L1 ]3 ]9 {; v% |6 ]$ n
(Setq CVAR (Getvar "CMDECHO")) (Setvar "CMDECHO" 0)
& q: y3 {* ^) i: _. T (Prompt "Chon doi tuong dich cua EXTEND :") (Setq CUTEDG (Ssget))
9 U# M1 p7 ]; d* k (Prompt "Chon doi tuong de Extend :") (Setq SS (SSget)) (Setq LEN (SSlength SS))6 Z" v; _# v0 P: }. N" s: S" T
(Setq I -1), d" L$ _$ N* Q# C
(Setq SIDE (getpoint"Chon phia de EXTEND")) (Command "EXTEND" CUTEDG "")
* k: l0 X/ _/ O# v% b (Repeat LEN
5 m9 p) b* m0 M: T, q" X$ e (Setq I (1+ I))
4 W4 m7 i9 c; M: k (Command (List(SSname SS I) SIDE)) ) (Command "")
+ f T; h5 c, Z' Q) U0 h. f n P1 Y (Setvar "CMDECHO" CVAR) (Princ "Da Extend xong moi ban lam tiep") (Princ) )9 W. n- Y( F, c+ R# H
- y& W' B; U1 i+ k) `7 a) B
;;; =============== EXTEND 1 DOI TUONG THEO KHOANG CACH ===============
+ V9 O# K [ G) U
. y# _5 F6 g4 u0 L5 ^(defun c:ETT () (setq os (getvar "osmode")) (setvar "osmode" 512)3 @8 c; h5 `: u' o" Z
(setq pt1 (getpoint "\nKich vao 1 dau doan thang can EXTEND "))- F& i. ~* I1 |* m6 Y& L
(setvar "osmode" os)7 X% u5 T' Z% G, H% k9 l/ \+ m$ z
(setq dis (getdist pt1 "\nKhoang cach can EXTEND :"))
$ d8 J/ V4 {) R' t6 H (command "circle" "endpoint" pt1 dis) (command "extend" "last" "" pt1 "") (command "erase" "last" "") (princ))
I! x7 i- L- Y) i0 w: f6 j$ ^' Z# `# H: l5 L3 z( \& W m
;; ================ Change width of polylines =========================
a# s+ S2 K4 ^/ G
- T* w6 j& i0 ^1 |1 G4 H# ^5 M(DEFUN wp (/ a b sophantu sodem list1 ha:wid), ]+ H8 i$ q+ H
(PRINC "\n Chon doi tuong can thay doi do day (Width) !") / M/ ?0 H) y" y4 ^6 a* N6 ~
(setq b (ssget))
) A, c; V6 }1 P! ?2 X0 ]1 l (setq sophantu (sslength b)) 3 n% N+ w$ d/ d8 f6 J1 l3 Q0 M) l7 G" i
(if (null ha:wid) (setq ha:wid (getvar "tracewid")))
& x# J9 W* \; h! R. [5 P/ R (princ "\nDo rong polyline <"): O; f% I B; D$ Q6 L8 Z; h
(princ ha:wid)
8 r5 o$ c! T, E6 ]4 B, x( I (princ ">: ")
. a: z0 k2 W! { (initget 4): }' `9 \" }/ d( t
(setq ha:wid (getdist))
! `4 X' J: R: {: P1 O (if (null ha:wid) (setq ha:wid (getvar "tracewid")))
8 ]! r, ~9 v) L6 c (setvar "tracewid" ha:wid) \7 D* T' V0 w5 y- R, [
(setvar "cmdecho" 0)
2 f8 N, N$ W) \5 I! ?2 V (setq sodem 0)
3 [$ M* w. N2 G$ q1 [' ]6 _; L (repeat sophantu n* j" H( P \9 w" [
(setq a (ssname b sodem))' V5 X' C, Q2 a8 x& A. S0 [" F
(setq list1 (assoc 0 (entget a)))2 C; [8 @1 d7 N* m7 g" w) [ n& A
(cond: W3 G2 \& w9 B9 y6 v+ J
((= (cdr list1) "POLYLINE") (command "_Pedit" a "w" ha:wid ""))/ J. X8 I5 i4 j: C# d" E3 x+ O) {3 _
(PROGN (command "_Pedit" a "" "w" ha:wid "")) ) 3 C$ J u) ^. d6 n. Z& ~' J
(setq sodem (1+ sodem)) )(SETVAR "cmdecho" 1)(princ))4 m0 G/ N* Z0 e; \* b& O0 l* ]6 C
(defun c:wp () (wp)) (defun c:pw () (wp))' O# y+ T% ?1 l. G
+ ?4 ~9 Q# W* @3 W) d7 ?2 R/ b;; ================ Change radius of circles ========================== J; x$ ]% d" K }" j
@) \: V5 N9 D* j# \(DEFUN C:CHR (/ SSET SSL M RD I) (PRINC "\nSelect Circles :") (SETQ SSET (SSGET))( V% ?7 a. z7 L# u9 U; |3 v
(IF (/= NIL SSET) (PROGN (SETQ SSL (SSLENGTH SSET)) (INITGET 4 "") (SETQ RD (GETDIST "\nNew radius : "))6 }6 I) J8 \( _9 l1 U% \
(IF (/= RD NIL) (PROGN (SETQ I 0)) I: g! Y7 `# \3 ?6 K
(WHILE (< I SSL) (SETQ M (ENTGET (SSNAME SSET I) ) )
I& X* j0 ]# z* M* R h (IF (= (CDR (ASSOC '0 M)) "CIRCLE") (PROGN, ]* U( y: {/ z2 O
(SETQ M (SUBST (CONS 40 RD) (ASSOC 40 M) M)) (ENTMOD M) ) ) (SETQ I (+ I 1)) ) ) ))) (PRINC) )# k b1 Z' T0 h2 z$ c
- }* y" u1 w# L6 @4 c& x" L;;; ============================== TEXT Hight ===============================
6 o3 j4 C: H9 J+ N" E7 D; h0 M( Q# c9 p% U, K: @7 @# }" T
(defun texthght (/ ent hght)
; F+ I) |0 ~% z$ e/ t. q4 a* y (setvar "cmdecho" 1)+ Y3 A6 Y3 R2 t+ r
(prompt (strcat"\nSelect text entity with required text height"))
0 t5 Z ~& c4 R$ a" V$ w (prompt (strcat"\n."))0 ~% p6 I y/ ]2 u8 ]
(setq ent (entget (car (entsel))))6 D$ ?4 x2 `1 q9 m8 \
(setq hght (cdr (assoc 40 ent)))
: i5 j4 B( G" e& P' t (prompt (strcat"\nText height now set at "))(prin1 hght)1 S% U: s! L+ `6 t$ L
(prompt (strcat"\n.")) 2 M' Y6 r6 d5 w- O2 v
(setvar "cmdecho" 1)
. l# y/ A; K6 ^3 m3 m* D# _0 G (command "DTEXT" PAUSE hght "") )7 ?3 I6 @8 i. U
(defun c:teh () (texthght)) (defun c:texthght () (texthght))7 m1 K" A/ ]% S% o* z- { a
6 C& p+ _9 v; m;;; ================ BAT -TAT CHE DO GACH CHAN TEXT =================* p1 {9 n& ^* V0 X8 M8 Y$ G" }
' w: d1 l8 |+ E6 I(defun c:tuu () (setvar "cmdecho" 0) e. q; L4 ~8 b5 O( T8 w
(prompt "\nHay chon dong TEXT can gach chan ")
+ Y7 D- J/ V/ ^ (prompt "\nSelect objects: ")% P7 T) w1 I" B
(command "select" "au" pause)6 Y4 v: m+ u; s+ G ?
(setq sstxt (ssget "p")
! V6 c, o( H+ x2 X0 ? sslen (sslength sstxt)5 z h, J; Y+ A5 J) O1 Z7 {: a
ctr 0 )7 J) x8 B7 X+ j' H; L3 {
(command ".undo" "mark")
" T3 h! ?4 n" @% V$ [) `; _ K (while (< ctr sslen)
7 r+ e0 I, _8 P- F9 f (setq listxt (entget (ssname sstxt ctr))# l$ c/ ~, L$ `) K7 x' z5 Z
txttxt (cdr (assoc 1 listxt))0 y: }' @( p% y, w: a
enttxt (cdr (assoc 0 listxt)) )* g( N- ~4 K4 G+ K% _* C, [, V
(if (= enttxt "TEXT")/ X) k% ]( Q1 Q5 {1 r2 o
(progn$ N' Z3 R- S$ c4 P9 q& A
(setq testxt (substr txttxt 1 3))
. {3 F) k& O- a( p2 O. q9 e% b2 }9 ~ (if (or (= testxt "%%u") (= testxt "%%U"))$ I, b: ~7 z) w! P r% T/ X Z: O
(setq newtxt (substr txttxt 4)) U7 N( p; z4 W" N: r
(setq newtxt (strcat "%%u" txttxt)) ) [0 Z, z8 B% P' d4 h/ X* k
(setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))
! N3 ~6 g K& K9 X3 v0 [1 I6 A (entmod listxt) ) ). H" |( Z* l$ d
(setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))
1 P" v7 ?7 ]0 |& M$ r' I
- Q7 p5 P/ L7 Z; `. }( p;;; ================ BAT -TAT CHE DO GACH CHAN TEXT =================
; R' b: ?; D: c& ^3 E# E* A4 | r3 @$ T7 A, c' [5 @
(defun c:tob () (setvar "cmdecho" 0)
9 G' ?+ U# m: A5 d! \ (prompt "\nHay chon dong TEXT can gach tren dau ")
4 w( M! H- q4 f* I9 Q( _) _! q5 O; d (prompt "\nSelect objects: ")
* F8 x' ]3 h" f* ? (command "select" "au" pause)
$ T( g& w$ \7 w, z- A (setq sstxt (ssget "p")
* `4 M( X2 l- {6 n* r sslen (sslength sstxt)
: l. B- B. A f, Q ctr 0 )) H9 \$ Z2 c' i! p5 t
(command ".undo" "mark")/ R7 e* B& @6 i7 T$ r
(while (< ctr sslen)
9 ^3 a2 G* A- o' I! Z1 U (setq listxt (entget (ssname sstxt ctr))0 Q- x! N8 l: w
txttxt (cdr (assoc 1 listxt))- O j. I+ a& h8 B
enttxt (cdr (assoc 0 listxt)) )
! Y. B4 J. J- J% x6 { (if (= enttxt "TEXT") h7 q& ^8 v* g5 J' w) {8 o
(progn- E/ z$ H; t3 d/ Q* m
(setq testxt (substr txttxt 1 3))& _" |) V6 k6 \& k$ G, l. w% _
(if (or (= testxt "%%o") (= testxt "%%o"))
: e! @; B2 g+ R5 n1 U0 f (setq newtxt (substr txttxt 4))9 ^" T+ ~- e$ Q# K8 n7 ~
(setq newtxt (strcat "%%o" txttxt)) )
% b% l ~% k& J/ N: q; r (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))7 ~8 }0 ^9 E; I4 ]+ s1 V
(entmod listxt) ) )
+ u2 |( X" R. c* u# @5 [+ _, i (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))( @) U* E( @# a9 X% r) L- ]3 `
% j6 B+ L3 q4 s$ m/ J
;;; ========================== Tim & thay the TEXT ==========================8 q- C/ |( i8 C. f5 l2 K
3 h- H$ x: A# _8 _' D8 m(defun frstring (str search replace / str1 str2 index find)2 \. D, l$ b' Q/ X5 l
(setq index 0) (while (<= index (- (strlen str) (strlen search))) (setq index (1+ index))% m8 s2 a; g/ a
(setq find (substr str index (strlen search))) (if (= find search) (progn (setq str1 (substr str 1 (1- index)))1 F; X% z; s# h+ H4 H
(setq str2 (substr str (+ index (strlen search)))) (setq str (strcat str1 replace str2)) ) ) ) (setq str str))1 |' R/ Z- ~& X0 }/ C$ B
(defun hai (/ dial)( q* \. E; z6 r8 N/ _+ e5 W: q
(setq dial (load_dialog "hai.dcl")) ;;goi dialog
9 j5 L! B- J$ j (if (not (new_dialog "find" Dial)) (exit)) ;;
! L4 r; F3 f! u (mode_tile "find" 2); Tao dau nhac tai hop thoai
# H& k0 @: f9 f3 R (action_tile "find" "(hai1)")
' Z; m! Y: W' h9 P" C# M (action_tile "replace" "(hai2)")# x7 x5 H+ y4 M0 J+ [2 y
(action_tile "cancel" "(done_dialog) (exit)")( f+ F/ F3 Y- _7 D
(start_dialog)
0 F9 B* X# u. E1 g2 t9 m (unload_dialog dial))/ h, ^- Q* J, S: l9 x
(defun hai1 () (SETQ str1 (get_tile "find")))
3 L2 \. S) h2 I* V8 X) D4 k(defun hai2 () (SETQ str2 (get_tile "replace")))
$ \9 u$ t# L6 D: g
2 `5 A0 L- ~6 n$ Z(defun c:TTT (/ a str str1 str2 newstr taphop sodem)- N; o; {+ z6 z
(hai)! I5 |9 v' j: L( c3 [; {9 U
(if (or (null str1) (null str2)) (princ "\nDu lieu khong hop le")
% N2 X4 ?; V6 G6 L (progn$ j: n5 Y( F- f
(setq taphop (ssget '((0 . "TEXT"))))) ^: \) H# E* M
(setq sodem 0) G1 X/ Q( |' e- m! ^& r8 X
(if taphop
' r! V! u. L* P# h# E (progn+ d* \: ?: C" L! f# [8 q
(Repeat (sslength taphop)
R. L0 N" N* E9 Z" W (setq a (entget (ssname taphop sodem)))
/ e6 ^9 i1 c* n& N3 K! i z+ E" ]) h (setq str (cdr (assoc 1 a)))# r% g. d. H/ |% @& w
(setq newstr (frstring str str1 str2))
1 \9 |( C/ p) I (setq a (subst (cons 1 newstr) (assoc 1 a) a))
/ ~. a' A2 X3 c0 l- Q (entmod a)
# }# z D' L* L3 J7 K$ b' K8 m/ g Q (setq sodem (1+ sodem)) ) )2 Z6 f9 m3 v. U' M5 f$ |
(princ "\nNone "TEXT" selected") ) ) ) (setq *error* olderr) (princ)), G7 {8 S1 z _
* E7 h* c7 Z2 n$ P1 s: q# ?;;;============================= CHTEXSTY.LSP =============================. v7 W% }) E5 A. @$ _8 b$ Q
, `# h7 b5 T1 n7 l' E
(Defun C:TXS () (Setvar "Cmdecho" 0) (Initget 1 "SE ST ")/ ?7 }7 h$ U2 j% }
(Setq G (Strcase (Substr (Getkword "STyle/<SElection>:")1 2)))
4 ]0 }, v6 y/ W; y' C7 @, o4 D$ I8 T/ |(Cond ((= G "SE") (Setq A (Ssget)) (Setq B (Sslength A))$ I( a. p% a. I [# }% c
(Initget 1) (Setq C (Getstring "\nEnter new text style: "))
7 s* E1 S) X+ c* f" c(Extang C) (While (> B 0) (Setq B (1- B)) (Setq D (Ssname A B))8 {/ E$ n, i7 b$ i, y
(Setq D (Entget D)) (Setq E (Assoc 7 D)) (Setq F (Cons 7 C))
, P) Y4 I5 U/ | o(Setq D (Subst F E D)) (Setq H (Assoc 51 D)) (Setq I (Cons 51 J))
5 X+ V2 F' r) H1 D( U& e- g( a(Entmod (Subst I H D))) (Setq A nil)) ((Or (= G "ST") (= G ""))
( t( J) P# F2 ` o+ ]1 b9 I' }2 ]% e(Initget 1) (Setq A (Strcase (Getstring
# x% k6 f x9 i/ v0 Z4 L"\nEnter text style to change: "))) (Initget 1)
- ?5 V' j: V3 U: d7 ?(Setq C (Getstring "\nEnter new text style: "))(Setq D (Entnext))
8 N; E5 q4 N/ Q2 d8 H) s(Extang C) (While D (Princ ".") (Setq E (Entget D)) (If6 \/ }, z! i* K
(And (= "TEXT" (Cdr (Assoc 0 E))) (= A (Cdr (Assoc 7 E))))
. p! A4 f# p$ T# p8 u9 s0 p(Progn (Setq F (Assoc 7 E)) (Setq G (Cons 7 C))) m% f2 ~8 }9 o, S" d3 |$ O
(Setq E (Subst G F E)) (Setq H (Assoc 51 E)) (Setq I (Cons 51 J))
2 h" {* ]! P, \* @( ?: ]4 e. M7 L(Entmod (Subst I H E)))) (Setq D (Entnext D))))) (Princ))
[3 I% L, R& C; C( p h, q, N/ l' @0 X o0 c; h8 g9 @* m
(Defun Extang (A) (Setq A (Tblsearch "STYLE" A))0 S3 N W! D8 g8 k
(Setq J (Cdr (Assoc 50 A))))2 Q! K# P9 `* n. {. |
2 N6 M4 ^( P4 s9 O1 A+ z9 W
;;; ============================ DRAW CLOUD =============================" H' M" L2 d: Q) |% s/ @/ {
5 R! O( C: j4 }" c
(defun CLOUD (/ pt1 pt2 arc1 cnt ss la) (setvar "cmdecho" 0)
0 U2 _# b1 K: s0 T; m- r7 v8 ~ (prompt "\nVe cloud (may) khong khep kin - Tu khep kin ve diem dau!")
/ Z2 S' x, K! G5 ] (setq la (getvar "clayer"))+ A1 J' S# i8 \
(command "layer" "m" "cloud" "c" "5" "" "")
: ?2 R7 g3 t6 j7 @ (setq pt1 (getpoint "\nEnter first point of Cloud: "))
9 u S0 i) q: M" L* g% V6 x' j/ d (if pt1 (prompt "\nProceed in a COUNTER-CLOCKWISE direction..."))
5 x* Q& [* C- R7 z3 W (setq cnt 1 ss (ssadd))% F( K# V' ^$ H9 ~) L9 e
(while pt1 (setq pt2 (getpoint "\nEnter next point - and close: "))
D4 t& k$ A' e (if pt2 (progn (command "arc" pt1 "e" pt2 "r" (/ (distance pt1 pt2) 1.75))2 ^8 N) G8 T3 m
(if (= cnt 1) (setq arc1 (entlast) cnt 2) (ssadd (entlast) ss)) ))- \$ V K8 x& D0 \
(setq pt1 pt2) ) (setvar "highlight" 0) (if (> (sslength ss) 0)
8 j d- u8 _* P* M (command "pedit" arc1 "y" "j" ss "" "x") R9 X7 d V; {3 D& C2 r5 v* q; Q
(if arc1 (command "pedit" arc1 "y" "x")) ) (setvar "highlight" 1)7 q( O) F: ] X0 T+ `6 B( z
(command "layer" "s" la "") (setvar "cmdecho" 1) (princ))
& d L% U0 [& o# ~/ k6 W(DEFUN C:CLOUD () (CLOUD)) (DEFUN C:CLO () (CLOUD))6 Q1 r" s. \7 \1 q' I3 d
0 v. N9 [5 y9 H" b$ f Q$ w3 _! f;;; ================================ Funtion-Dulieu ========================5 l- B1 X G4 o! t' Y
;;; ================================ Funtion-Dulieu ========================9 i2 ]; h$ h a }( D- }: K9 [3 J
;;; ================================ Funtion-Dulieu ========================
: o& L) V: y, x+ @# S% j8 c# R8 o7 d
8 R- k' V7 F! `' [- e h9 D0 i(defun ha:nhap (kytu thamso) (princ kytu) (princ thamso) (princ ">: ") (setq key (getint)) (if key (setq thamso key)) (princ thamso) )* f& B& d5 L4 U8 ]* P* c
(defun ha:thoat () (reinit) (setq Temp "Da thoat khoi chuong trinh"))
) t& S8 ] i* G/ ?1 `) A# N(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))
& `$ p0 z) P6 G7 C+ V6 @ u(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) )0 n. }0 Y. r; z* u* F
(defun hauon (hauon1 hauon2) (command "fillet" hauon1 hauon2))7 B7 ~, {+ O' d1 n0 ^! c. ?4 c9 L
(defun init () (setvar "blipmode" 0) (setvar "cmdecho" 0) (setvar "angbase" 0))7 _1 R3 t2 P* k' {
(defun reinit () (setvar "cmdecho" 1) (setvar "osmode" 0))
( o3 S7 S Y! i: |* {/ I(defun tichvecto (vecto1 vecto2) (apply '+ (mapcar '* vecto1 vecto2)))2 g* A% z& ^8 x, |$ M
(defun vectophap (v01 v02 / vectochiphuong) (setq vectochiphuong (mapcar '- v01 v02)) (list (cadr vectochiphuong) (* -1 (car vectochiphuong)))) m; J d+ _" f$ u; I: p# Y
(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)))
2 ^" R0 [: D! L' Q7 l6 L/ S: v(defun dtr (dtr) (* pi (/ dtr 180.0)))( g- ? f* h; V% G: E
(defun rtd (rtd) (* 180.0 (/ rtd pi)))2 t5 S( l' V0 |5 V
/ ?7 ~3 Q' c, \7 F! n! ?8 N;;;==============================PROGRAME===============================
2 \9 K' k- s; d% f$ s;;;=====================EditDiM Hien Hop Thoai Dep======================- x& c$ G5 h' l9 E! ^' z, u
;;;==============================PROGRAME===============================! p8 h' E; |4 ~9 k
: O' ^. L! b G& i) F3 A;;Dth Edit Text, Dimtex & Attributes(Chu Co Thuoc Tinh)$ {5 o, e$ q; `+ @5 s
;;Chay Cung Du Lieu.Lsp & Hai.Dcl
0 C% `" F1 ?7 R* _. W9 g. _9 y(Defun Hai_Edim (Chon / Dial State Str Oldlis Dimdefault Pt10 Pt13 Pt14 St Ang Dis Pt Hc)$ x; t3 J% @# v% q: ?
(Setq Oldlis (Entget (Car Chon))2 s# X2 R1 V6 o6 t1 |: w7 ~$ F
Pt10 (Cdr (Assoc 10 Oldlis))( A5 [; x: |) z' o0 z
Pt13 (Cdr (Assoc 13 Oldlis))6 Q, @) l e* e% U' {( z
Pt14 (Cdr (Assoc 14 Oldlis))
3 K: k7 N5 H4 }& B# } St (Cdr (Assoc 70 Oldlis))3 e( e- {( C+ h" e' A6 T
Dimdefault (Cdr (Assoc 1 Oldlis))1 @! S, K( p; B. k
)4 ` L3 L; S6 f% }
(Cond! g0 V$ ^* W/ I
((Or (= 32 St)(= 0 St)(= 160 St))
- M; @0 ^, T: F (Progn
5 V$ Y! |. q1 @4 R% F (Setq Ang (Cdr (Assoc 50 Oldlis))$ q( a2 P/ E4 I" F7 q
Pt (Polar Pt13 Ang 500)9 u2 _, O3 @' y& D3 V0 w
Hc (Lay_Hinh_Chieu Pt10 Pt13 Pt)
& T5 R1 ]; F3 i+ Z/ `; T5 x Dis (Rtos (Distance Pt13 Hc))
' v y: O6 n+ q' U% U )
! N. S" `6 A7 b' N( ~- |" M ), n' c+ }# q- i$ x8 n
)0 d4 h. G7 V0 ]* n& I: m1 {( a
((Or (= 33 St)(= 1 St))
" Z! l! N! o# l+ N/ b2 L C (Progn(Setq Dis (Rtos (Distance Pt13 Pt14)))))
; m+ P& |! ]6 O5 w );;End Cond$ v% i, J2 G/ a0 O( u
(If (= Dimdefault "") (Setq Dimdefault "<>"))
$ q, ]* f5 G0 ?) F (Setq Dial (Load_Dialog "Hai.Dcl"))
% D8 E% V: P% D (If (Not (New_Dialog "eddim" Dial)) (Exit))
, ~9 O" M) J2 u' d5 [ (If (Or (= 32 St)(= 0 St)(= 160 St)(= 33 St)(= 1 St))
9 s4 I, t+ A% M3 ? h" [ (Set_Tile "text" Dis))0 h6 M8 B$ H4 l/ ~# E$ c F) G8 K& g
(Set_Tile "ha:edim" Dimdefault)6 v4 B+ D: o# @5 z
(Mode_Tile "ha:edim" 2); Tao Dau Nhac Tai Hop Thoai
% b P1 D' _, P (Action_Tile "ha:edim" "(Setq Str (Get_Tile \"ha:edim\"))(Done_Dialog 3)")
5 ]% J) U, _$ ^; r7 l* V (Setq State (Start_Dialog))(Unload_Dialog Dial)* A- C" E5 W7 N4 i* J2 |+ L2 ?
(If (And Str (= 3 State))
: H7 R+ B7 i2 m& t0 F- | (Progn6 Q/ H3 y* V% b5 v. |
(Setq Oldlis (Subst (Cons 1 Str) (Assoc 1 Oldlis) Oldlis))(Entmod Oldlis)))
+ ]5 D) K) q3 N' B8 X( M; u- Y )- |% [% H( _2 o; g+ D' y
(Defun C:EH (/ Chon Name )4 @; c( t- o) q# N' D% y
(Defun *Error* (Msg)
P' z4 U5 q: Y4 F (Princ "\nerror: ")(Princ Msg)(Princ " ")
8 H; q+ p/ H t# M+ ] (Start_Dialog)(Unload_Dialog Dial)
5 j B" _ V. ?' G. G7 o6 y# w (Setq *Error* Olderr)(Princ)2 X; m) K( c+ p
)
: b9 q% T7 k! _# Z, X (Setq Olderr *Error*)
- d2 f0 g" q: N% Z4 c- X$ l (Setq Chon T)7 g$ z( G0 X3 u d% P4 h/ [
(While Chon, B8 v1 z2 U: E) V
(Setq Chon (Entsel "\n\n\nSelect Text, Dimtext Or Attributes To Edit..."))
4 P: S$ {8 q' m' O( E (If Chon& @. b d9 V6 M3 q7 E# ^+ y
(Progn
3 D0 y- m/ l7 I$ Z6 J (Setq Name (Cdr (Assoc 0 (Entget (Car Chon)))))
% f4 S2 M( f: A% I2 e* D/ M' r (Cond
0 D& g$ ~2 n7 K ((= Name "INSERT")(Command "Ddatte" Chon))$ h# Q8 N& M1 y6 M
((Or (= Name "TEXT") (= Name "ATTDEF") (= Name "TOLERANCE") (= Name "MTEXT"))(Command "Ddedit" Chon "")) y$ C7 ^ ]5 q' E3 ~& J. f" W
((= Name "DIMENSION") (Hai_Edim Chon))
$ g* ?1 k% ^3 d( J! R: F )) }4 W- t7 r H. S7 X0 b
);End Cond1 |" S$ v' ?& n+ h. g1 I/ U' {
);End Progn1 J" d+ o! Y5 U& ]. @( z6 t: k
);End While8 o* }- J, O2 u+ F6 o
(Setq Olderr *Error*)(Princ)
7 u2 o7 \: p. }& w$ _+ y2 M5 l );End Program6 W7 E" j9 P7 g! k4 ^, ?
+ M' D3 a2 ^) O7 r8 ]8 F+ C;;;====================DDeditDim=====================
% k$ ` N8 O1 ?+ ]% V& d& e u;;;=====================Hai.DCL======================* T! W* R( O, M. P" V2 n2 E
;;;====================DDeditDim=====================
1 _1 b6 x! {2 ]) K
1 z4 j, ^7 w9 j: b+ k q;;Dth Edit Text, Dimtex & Attributes(Chu Co Thuoc Tinh)
8 ?# X$ p% d, ~. ^: J;;Chay Cung Du Lieu.Lsp & Hai.Dcl- n: x( a- \4 V/ C" ?% x: d' N+ B" Z
(Defun Hai_Edim (Chon / Dial State Str Oldlis Dimdefault Pt10 Pt13 Pt14 St Ang Dis Pt Hc)
! W2 w4 j( K( A$ S M( h (Setq Oldlis (Entget (Car Chon))
% ?! X. A' ~! B# p# ~) a: p Pt10 (Cdr (Assoc 10 Oldlis))
: r! B/ W& P8 Z Pt13 (Cdr (Assoc 13 Oldlis)): ?0 T3 \8 i C2 x3 `# h
Pt14 (Cdr (Assoc 14 Oldlis))
- s1 s0 o$ V3 \$ l2 t! M St (Cdr (Assoc 70 Oldlis))
/ Z- y4 R: v. i% a" N2 t Dimdefault (Cdr (Assoc 1 Oldlis))2 M' q/ }( C/ C9 L3 s- O3 f
)
5 t9 C. m2 G x: P+ O (Cond
8 x: d6 B3 P5 R# L. I5 R3 B ((Or (= 32 St)(= 0 St)(= 160 St))4 z( n4 W! t1 r# _4 I
(Progn) `" W* V3 j: W/ k$ O, T4 A
(Setq Ang (Cdr (Assoc 50 Oldlis))* H* ~& Y0 d/ x3 [# m
Pt (Polar Pt13 Ang 500)
& T H* k, A( B1 r( _; y Hc (Lay_Hinh_Chieu Pt10 Pt13 Pt)
0 @- Q9 n% x K& l6 N, M5 E Dis (Rtos (Distance Pt13 Hc))/ @7 w7 z* g& I* _; d( T4 Q
)
3 ]! V0 I/ o+ x8 P) m# \" \ )# R5 t- Y. P( g+ o/ [
)
4 \3 z( h$ J, U% X ((Or (= 33 St)(= 1 St))
0 D# j& d5 K- H (Progn(Setq Dis (Rtos (Distance Pt13 Pt14)))))
- {6 l2 U- ?6 `' ~, q );;End Cond
" @( `2 {4 `* E (If (= Dimdefault "") (Setq Dimdefault "<>"))
/ d/ q4 _9 Q1 L1 ^" s (Setq Dial (Load_Dialog "Hai.Dcl")): k5 q$ X' j2 y3 v
(If (Not (New_Dialog "eddim" Dial)) (Exit))
" X/ k1 s3 V0 y (If (Or (= 32 St)(= 0 St)(= 160 St)(= 33 St)(= 1 St))
' l3 d' Z# W" x8 j. _7 F" A (Set_Tile "text" Dis)), S2 L1 H* s( X7 |2 ]* ?
(Set_Tile "ha:edim" Dimdefault)' Q6 u3 B& ~; D0 ^. w8 h
(Mode_Tile "ha:edim" 2); Tao Dau Nhac Tai Hop Thoai1 }0 h1 I/ \: q2 b- i
(Action_Tile "ha:edim" "(Setq Str (Get_Tile \"ha:edim\"))(Done_Dialog 3)")
" M. E7 m5 y! j. e8 ]+ ~ (Setq State (Start_Dialog))(Unload_Dialog Dial)4 R% s& ^6 w0 f8 P
(If (And Str (= 3 State))) T% ?: B% w2 I2 v4 A' d* k+ P9 l
(Progn" p+ g! O8 o1 B% V
(Setq Oldlis (Subst (Cons 1 Str) (Assoc 1 Oldlis) Oldlis))(Entmod Oldlis)))
5 k4 r. k( Q2 [4 @2 _1 E2 n )
: I7 T- @, a. F$ c+ a5 |, F+ O# U) n(Defun C:EH (/ Chon Name )
/ s2 P, K! ~3 e$ l: s+ }( Y: k4 _
7 ]- S0 r! }1 \% ?; H;;;********************Du Lieu********************* N5 A; y! q6 _6 V( a
. g" U/ z0 \7 k3 d$ c
(Defun Ha:Thoat () (Reinit) (Setq Temp "Da Thoat Khoi Chuong Trinh"))
3 P8 a6 E- {: H; g* N(Defun Hacat (Hacat1 Hacat2 / Hacat3 Chon)- R# v5 u$ v* |# W, O
(If (And (/= Hacat1 Nil) (/= Hacat2 Nil))
4 V& a y& H2 j (Progn: a* ?4 I& L! _: j% m% T2 |
(Setq Hacat3 (Polar Hacat1 (Angle Hacat1 Hacat2) (/ (Distance Hacat1 Hacat2) 2))) w9 n. X" U# L1 A4 A, R% A+ ^
(Setq Chon (Ssget Hacat3))9 ^" C3 l' n3 A# i. r
(Command "Break" Chon Hacat1 Hacat2) o k. ?8 Y8 u0 v
)
, b7 f2 C# v9 C! a )' e& B. W1 X/ d1 ?
(Princ)# q4 V: E# j3 w/ N' P
)* d1 i. X* @8 X% l6 j
;;
4 i/ a! h$ V7 ^0 P) B- P9 D(Defun Hauon (Hauon1 Hauon2)(Command "Fillet" Hauon1 Hauon2))
5 l4 _, |- g e- L$ k5 L( l( ~;;- v% \" ~% k; r' r+ q( u- A$ j' ~, f
(Defun Taolop (Mau Lop / A)(Setq A(Tblsearch "Layer" Lop))(If (Null A)(Command "Layer" "_N" Lop "_C" Mau Lop "")) (Setvar "Clayer" Lop))
6 e" T: \0 F5 z' y6 E. f E;;
/ S: w3 t( F/ r* F5 |+ A# F" x. }5 G$ s(Defun Init ()(Setvar "Blipmode" 0)(Setvar "Cmdecho" 0)(Setvar "Angbase" 0))
8 H' L: ^4 W) D6 o: [6 L;;
' \# s" h/ s4 T7 ~0 N" b(Defun Reinit ()(Setvar "Cmdecho" 1))8 k G+ y. j9 k+ d6 c
;;" g# } v: r) }! `5 v: j( u; j
(Defun Tichvecto (Vecto1 Vecto2)(Apply '+ (Mapcar '* Vecto1 Vecto2)))
( m% Q% }8 x2 X1 K/ B& q;;+ V% j% a: c1 D, W8 [, g
;;Cho 2 Diem Tinh Ra Vec To Phap
" v4 P l% D0 R- @7 x6 M/ N1 r% X(Defun Vectophap (V01 V02 / Vectochiphuong)(Setq Vectochiphuong(Mapcar '- V01 V02)) (List (Cadr Vectochiphuong) (* -1 (Car Vectochiphuong))))
' C, ^% _0 K. Q% N' V+ Y7 j+ V. f;;Xac Dinh Vi Tri Hinh Chieu 1 Diem Len 1 Duong Thang
$ e* y3 A2 f$ P S& N* ];;Da Biet 2 Diem Thuoc Duong Thang3 K. _8 h, _/ E7 U
(Defun Lay_Hinh_Chieu (Dc1 P1 P2 / Hc Dc2)& y0 Y/ c4 Z6 H" d6 p
(Setq Dc2 (Polar Dc1 (+ (/ Pi 2) (Angle P1 P2)) 100)7 s# O9 Y( V1 P7 o$ O* v! q
Hc (Inters P1 P2 Dc1 Dc2 Nil)))3 T( O, U. v! C: u
;;Xac Dinh Khoang Cach Tu 1 Diem Len 1 Duong Thang" @% q4 u9 @- G9 L/ u
;;Da Biet 2 Diem Thuoc Duong Thang
9 k+ `0 T# z; F; Y(Defun Khoangcach (Dc1 P1 P2 / Dc2 Hc), v# c0 w2 _5 B/ _0 K$ L1 b
(Setq Dc2 (Polar Dc1 (+ (/ Pi 2) (Angle P1 P2)) 100)5 X4 f* ]5 U' W5 h: v
Hc (Inters P1 P2 Dc1 Dc2 Nil))
& m2 `; t. W8 K' e! _0 | K4 C (Distance Dc1 Hc)
) ]5 p0 @( X% N" ^0 F7 K9 _; j8 O )2 \* @4 X H2 w/ v0 E( S0 |' b4 p
(load "nhapcua.lsp")9 j. Y: t. i0 _5 D; ?$ j
(Defun *Error* (Msg)+ ^/ s9 v Y4 e* T; F" C' \
(Princ "\nerror: ")(Princ Msg)(Princ " ")
9 w5 M8 F# i! q8 a' Q (Start_Dialog)(Unload_Dialog Dial)
7 K- y6 H' j: g0 @; U (Setq *Error* Olderr)(Princ)
9 N; S0 L }: @6 ]) g" Y ): n$ n g, z& k" t8 P: K. m* S
(Setq Olderr *Error*)
; }9 X! x8 j8 x0 ~# j' e (Setq Chon T)7 X6 M8 ^0 b6 L: {! z7 f
(While Chon
- J- F3 O$ p1 M0 Z (Setq Chon (Entsel "\n\n\nSelect Text, Dimtext Or Attributes To Edit..."))
0 H/ p! Z% k6 `7 z C (If Chon
; K: X9 b( `" e# Q( E. j (Progn4 M2 o v% [2 `* s) n \! e
(Setq Name (Cdr (Assoc 0 (Entget (Car Chon)))))
6 C. k& H0 C3 ], w; x5 u (Cond* r9 p, p1 {& Z. X0 ^
((= Name "INSERT")(Command "Ddatte" Chon))& _( }; v$ O4 n) O1 U+ c( K
((Or (= Name "TEXT") (= Name "ATTDEF") (= Name "TOLERANCE") (= Name "MTEXT"))(Command "Ddedit" Chon ""))
y- O1 M" E! k. A/ v7 x ((= Name "DIMENSION") (Hai_Edim Chon)), u# N, x% y/ F2 H- ?; n
). s- C4 K+ e- t9 V8 B$ ^0 G9 |
);End Cond9 g1 d- z1 F( ]3 g
);End Progn
: C" z: N& \* E, V );End While
r3 Z ` E, x- p1 A) H) o (Setq Olderr *Error*)(Princ)% k( M1 T, X9 a' g V) B
);End Program
8 {% U1 Q6 Q* {& n& G' e7 X% ^2 P% U! ]0 A6 e
% j g5 X: ]# A- M. w& z# t8 ~: O. B* D4 ?7 R- \8 M- [6 w
;===================HAI DCL Nhapcua.LSP De chay Hop Thoai EditDiM===================( Y! j) E; {, n* o" t$ C9 S4 v& a
;====================================Nhapcua.LSP====================================' R$ u% h2 u7 q' |$ c3 V
;===================HAI DCL Nhapcua.LSP De chay Hop Thoai EditDiM===================4 F. K8 |+ \- x' q* k
3 k6 G; z8 C7 Z0 o+ \) s2 }
;;; ============================ Ve Hinh chu nhat ==================================
2 }! M; O/ e: T, [4 A& C# {4 D: `(defun HCN (/ olderr ocmd oblp pt1 pt2 pt3 pt4 l w)6 {+ a6 ^* J: }' M
(setq ocmd (getvar "cmdecho"))3 e. A1 A) M! C# E+ F$ p9 J: S: T O
(setq oblp (getvar "blipmode"))+ O$ H* f B, e% V" ~. i3 \
(setvar "cmdecho" 0)' H0 b8 B+ V4 A1 n+ }. V0 p* \9 Z
(initget 1) ;3D point can't be null
5 c5 i @7 G7 Y (setq pt1 (getpoint (strcat "\nCorner of rectangle or square: ")))4 E# p+ i( y. |
(setvar "ORTHOMODE" 1)6 m7 b# I! t4 U g
(initget 7) ;Length can't be 0, neg, or null
" L/ T3 l, d' O2 b% w! } (setq l (getdist pt1 "\nLength: "))
8 t8 V7 @, t$ |4 F4 N7 N (setq pt2 (list (+ (car pt1) l) (cadr pt1) (caddr pt1)))
! N Y& _9 p5 i$ u6 @4 I, N (grdraw pt1 pt2 2)- N: X2 d+ [7 n' M
(initget 7 "Square") ;Width can't be 0, neg, or null
1 Z }' R' W1 I( T* R! m% T (setq w (getdist pt1 "\nSquare/<Width>: "))% h2 @, m O; `7 Q) W& x
(if (= w "Square")
+ w2 P& k% J; e" k. f W+ V (setq w l) )
0 z8 S/ I4 X* ]- K: d (setq pt3 (list (car pt2) (+ (cadr pt2) w) (caddr pt2)))% ?4 I d* V4 m6 j, { O0 J0 G
(setq pt4 (list (car pt1) (+ (cadr pt1) w) (caddr pt1)))( m. L/ D% ~9 g. E
(grdraw pt2 pt3 2)& m2 z/ ?$ E: P F* k5 `! T. `
(grdraw pt3 pt4 2)- A* M* C9 A; B! Y7 ~5 A
(grdraw pt4 pt1 2)
4 C& \# G' s8 n3 G( U! E (setvar "ORTHOMODE" 0)9 h: N' |; s2 n, h! D
(command "pline" pt1 pt2 pt3 pt4 "close")
! f" a! \1 T2 t: d- u" a (setvar "cmdecho" ocmd)% k- Y9 h9 F2 ]6 I; r+ U
(setvar "blipmode" oblp) (princ))
. B+ C) a( a! [" {(DEFUN C:HCN () (HCN))
3 d5 U; C. Y. X/ h& \0 R: d3 V7 f
;*******************;*******************;*******************;*******************
. d: s* Y- e# n' M E7 @0 t3 x) C;****K E T C A U****;****K E T C A U****;****K E T C A U****;****K E T C A U****! ~* M8 E+ w* B- o0 I
;*******************;*******************;*******************;*******************/ S- M2 e" \$ h( w% ~( P
R2 A9 j, Y0 k' `;VE HINH BINH HANH$ s$ [. }$ ^; Y4 N2 o4 A
0 q9 E) S0 H$ n$ J) X, i, ]7 [, I
(defun c:binhhanh (/ p1 p2 p3) o5 {9 T% C; Z' `& }/ W4 h% T
(setq p1 (getpoint "\n Nhap diem thu nhat:"))7 U' d8 z) i% r& L: D$ e. d; |# P. s
(setq p2 (getpoint p1 "\n Nhap diem thu hai:"))6 @- s2 ?; p6 ]
(setq om (getvar "osmode"))" V/ v% e0 S/ r- N
(setvar "osmode" 0)' D% z5 V0 ?+ a; a) |& M
(command "line" p1 p2 "") _1 G7 s+ ^, ~2 D n/ i
(setvar "osmode" om)7 m& }4 s5 ^) R1 f9 \9 k" a0 I6 j8 V
(setq p3 (getpoint p2 "\n Nhap diem thu ba:"))
) {) b; {; `- j" Y (setq a (angle p2 p1))3 E6 z! ^6 I6 o; g3 p9 p8 }
(setq d (distance p1 p2))4 W. p. y: u( w$ U- M8 G. I' }# ^6 l" n
(setq p4 (polar p3 a d))
; D4 L' \2 P# X3 `) K (command "OSNAP" "none")
: l7 b. B j( ~5 } (command "erase" "l" "")2 m9 X5 \, @8 J9 p$ c1 ]/ x' x
(command "pline" p1 p2 p3 p4 p1 ""); J: x. B# O" g0 ^1 Y
(setvar "osmode" om); q) k7 _% Y `9 m9 L; r% w, C% h
)
6 v4 ^% t7 M- W& ^. K$ `- ]: p7 S1 S' K5 a! ^" h7 w
;VE LUOI COT
' {& @5 g' l! q' `& l3 E5 `( `$ r; V8 f/ k+ ]( {6 L
(defun c:LuoiCot (). V' y. C$ i1 \
(setq om (getvar "osmode"))
1 q" q" t. l" f: N(setvar "osmode" 0)% g! d2 `7 p4 G- a8 u
(setq tile (getreal "\nCho biet Ti Le ve 1/x, x="))
/ D: G9 I8 d3 y$ _+ @3 p (setq p0 (getpoint "\n Chon Basic Point:"))( A( e9 e8 t1 o$ R, i
(setq nc (getreal "\n Nhap chieu ngang cua cot : "))) _6 \6 _7 O$ _, N/ I
(setq dc (getreal "\n Nhap chieu doc cua cot : "))
6 S" g8 U1 b" t7 ^& i; X (setq p1 (polar (polar p0 pi (/ (* nc hstl) 2 tile) ) (* pi 1.5) (/ (* dc hstl) 2 tile) ) )6 v/ l, |9 ~& V2 k$ d S
(setq p2 (polar (polar p0 0 (/ (* nc hstl) 2 tile) ) (* pi 0.5) (/ (* dc hstl) 2 tile) ) )4 R) Q4 f* C* _2 |
(command "rectang" p1 p2)
# E0 D: A" [$ h/ \ s6 O (command "hatch" "solid" "l" "")
; m* D- a: U; O7 L9 z+ d (setq bcn (getreal "\n Buoc cot theo phuong ngang : "))* `" m2 R2 X0 @& J; O' g& Q) n: A
(setq nn (getint "\n So buoc cot phuong ngang : "))
( ~! s L" x. y K% u0 x/ i (setq w1 (polar (polar p1 pi (/ (* nc hstl) 2 tile) ) (* pi 1.5) (/ (* dc hstl) 2 tile) ) )
/ H1 ]5 m0 C `/ [5 i7 B& e% y (setq w2 (polar (polar p2 0 (/ (* nc hstl) 2 tile) ) (* pi 0.5) (/ (* dc hstl) 2 tile) ) )
6 Z' m* Y% C8 _* P (command "select" "w" w1 w2 "")) a3 Y% p6 t. j0 g0 B
(command "array" "p" "" "r" "1" (+ nn 1) (/ (* bcn hstl) tile) )4 O) D; m) C8 @; ?# J3 Y
(command "line" (polar p0 pi (/ (* 1000 hstl) tile)) (polar p0 0 (/ (* (+ (* bcn nn) 1000) hstl) tile) ) "")
% M# e" \! b0 Z. n4 u) |) R (setq w1 (polar (polar p0 pi (/ (* hstl 2000) tile)) (* pi 1.5) (/ (* hstl 2000) tile) ))
7 I- p+ H- G& X/ t$ W& V2 k (setq w2 (polar (polar p0 0 (/ (* (+ (* bcn nn) 2000) hstl) tile) ) (* pi 0.5) (/ (* hstl 2000) tile) ))1 e: C$ | I2 t2 X& d
(command "zoom" "w" w1 w2)
) q6 q# a# G6 ~* a (command "select" "w" w1 w2 "")
% w) d2 k6 F! R. @. n( o5 I0 D (setq bcd (getreal "\n Buoc cot theo phuong doc : "))" L- H3 J7 {( z
(setq nd (getint "\n So buoc cot phuong doc : "))/ N$ I# c5 `- E
(command "array" "p" "" "r" (+ nd 1) "1" (/ (* hstl bcd) tile) )
( V# A2 @, o( q (command "line" (polar p0 (* pi 1.5) (/ (* hstl 1000) tile)) (polar p0 (* pi 0.5) (/ (* (+ (* bcd nd) 1000) hstl) tile)) "")
) D/ t7 m1 \, I8 u: A- x" P2 i (command "array" "l" "" "r" "1" (+ nn 1) (/ (* hstl bcn) tile) )
, Y% n6 b, z6 L4 o: Z0 r+ x (setq w2 (polar w2 (* pi 0.5) (/ (* (+ (* bcd nd) 2000) hstl) tile)) ) ! v1 S6 z+ z8 ^! }0 v; {. [& F/ e
(command "zoom" "w" w1 w2)1 M! p) y, ^8 f: l
(setvar "osmode" om)
" }0 H7 Y7 {/ C! `- |)5 p4 {! j0 Y$ U% _6 W& _% U2 L
/ k9 ?* @1 M; J;VE CUA DI
+ W5 m: [7 }4 f5 M6 M: J
3 O* E2 M/ y, f$ | P: x(defun c:cuadi ()
: g8 f- s& W8 g* `7 Y/ ~(setq om (getvar "osmode"))+ _0 n- V7 ?* \ m7 h
(setvar "osmode" 0)/ R$ e$ j4 Z9 ~4 ~% J( a
1 ~$ ]# q: q- a2 `( a
(setq tile (getreal "\nCho biet Ti Le ve 1/x, x="))
5 V. z% F; k. e, x6 `0 ]+ q(setq b (getreal "\n Nhap be rong cua : "))
9 x, x# j! R* A5 ~2 z(setvar "osmode" om)+ F$ l$ M+ v* \, }! {. D! W
(while (< 0 1)
) x" d7 l! a8 x& s. D# ~+ k( S (progn6 w; ]4 [: [1 H2 ]! t
(setq p0 (getpoint "\n Chon Basic Point:"))- V5 |$ a3 `8 [5 G3 U* s( r! b
(setq p1 (getpoint p0 "\n Chon diem de xac dinh huong cua cua:"))
+ b4 F& u6 _4 ` (command "osnap" "none")
" D& x. l3 I+ ?) o, n (setq p2 (getpoint p0 "\n Chon diem de xac dinh huong mo cua:"))/ Y" C, @! F2 Y0 K, a" G
(setq a1 (angle p0 p1))
3 m) F7 p* w( k, [0 w* Q$ c (setq p1 (polar p0 a1 (/ (* hstl b) tile)))' k) u' k3 b; \1 N( c7 V5 i$ {
(setq a2 (angle p0 p2))
* N2 A* e" F1 l' f4 G9 D (if (< (- a2 a1) pi) (setq a3 (+ (/ pi 2) a1)) (setq a3 (- a1 (/ pi 2))) )
% x6 [( ~. D+ R2 h: G" x6 f' k# _ (command "pline" p0 "w" "0" "0" p1 (polar p1 a3 (/ (* hstl 40) tile)) (polar p0 a3 (/ (* hstl 40) tile)) p0 "")& {- z& y& W: g. p
(command "rotate" "l" "" p0 (/ (* (- a3 a1) 180) pi)). T# m% ^. n3 @( X6 T- I1 R3 J
(command "arc" "ce" p0 p1 "a" (/ (* (- a3 a1) 180) pi))
, W& o! c+ z, Z2 d1 l/ w(setvar "osmode" om)) z9 O; P ^! n" T! E
)). y3 I- A: O5 Z/ s* ^" D* G4 N
)
, R* Q1 [2 ~; M c3 j, g0 C- Z% o, U" u$ @, W) l( v0 y
;VE CUA SO# K) D% z! ]$ f8 k: X9 k
, k) ?0 N: O+ b; `' z(defun c:cuaso ()& y- @! L, T, E2 h
(setq om (getvar "osmode"))
) ^* b! ], K" U. _: H(setvar "osmode" 0)/ Q' [; j$ y$ K: g O( e# [6 v
. u! r9 R. w t! N2 T5 P. @3 B3 y
(setq tile (getreal "\nCho biet Ti Le ve 1/x, x="))3 u# B5 r5 }, V& X8 p% K1 b
(setvar "osmode" om)& ]0 \; d# C2 Y. ]; }
(while (< 0 1)
$ {+ @ z& w l' ~0 a! [9 @ (progn, ]( Y; e u) o! ?. @* I
(setq p0 (getpoint "\n Chon Basic Point:"))0 x0 a0 N& M, y5 `' n
(setq p1 (getpoint p0 "\n Chon diem de xac dinh be rong cua:"))) h- E) D# A! M6 M
(command "osnap" "none")6 S+ m' u/ E7 x
(setq p2 (getpoint p1 "\n Chon 1 diem o trong nha de xac dinh huong cua so:"))1 l( T# t& h: w) v. E/ H7 e5 w5 W/ u
(setq b (distance p0 p1))# J, _/ N% t" \4 z
(if (< b (/ (* hstl 600) tile)) (setq du 50))
4 X" E: b5 N+ t9 M! H (if (> b (/ (* hstl 600) tile)) (setq du 150))) X( ]. i3 O* l, I
(if (> b (/ (* hstl 1800) tile)) (setq du 200))
6 v, e. v j T7 } w _/ R# J4 W% @ (setq a1 (angle p0 p1))( P" X7 Z6 d/ n" q$ c
(setq a2 (angle p0 p2))
8 I. `* z9 ~6 P! P0 i5 h0 l9 } (if (> a2 pi) (setq a2 (- a2 (* pi 2)) ) )
5 C8 f9 G) ]1 ~* ^/ ] (if (> (- a2 a1) 0) (setq a3 (+ (/ pi 2) a1)) )& r6 o* d* q0 Z P- G
(if (> (- a1 a2) 0) (setq a3 (- a1 (/ pi 2))) )$ [0 A7 J* L0 R; A4 [7 @! M
(command "pline" p0 "w" "0" "0" p1 "")
% ~3 s& h! E: s8 ~& B* q (command "pline" (polar p0 a3 (/ (* hstl 50) tile)) (polar p1 a3 (/ (* hstl 50) tile)) "")
1 L, R" v' z8 P/ W2 U (command "pline" (polar p0 a3 (/ (* hstl 100) tile)) (polar p1 a3 (/ (* hstl 100) tile)) "")
9 y. O X) z! f, ]! O2 f (command "pline" (polar p0 a1 (* (- du) (/ hstl tile))) (polar (polar p0 a1 (* (- du) (/ hstl tile))) a3 (* -100 (/ hstl tile)))
& B3 J4 {+ I; X$ r* X) i (polar (polar p1 a1 (* du (/ hstl tile))) a3 (* -100 (/ hstl tile))) (polar p1 a1 (* du (/ hstl tile))) "")4 e+ r7 P5 y2 f% c1 ^- N
(setvar "osmode" om)
7 T" ?5 _: A+ D))5 @5 h% j2 Y; s8 J
)8 y6 j; |4 L9 Y% ~. J, N
& [+ E( }; G# a& {( O8 o
;;;=== General Utility Functions ===# w( w" i/ C$ e, S8 J
+ @' b4 h/ _5 u; R12 compatibility - In R12 (acad_helpdlg) was an externally-defined
5 J* Z0 k7 ]( |; ADS function. Now it's a simple AutoLISP function that calls the
+ L \- ]& g# _; `; built-in function (help). It's only purpose is R12 compatibility. 3 ]* O; g) A. A0 y& C( L7 U
; If you are calling it for anything else, you should almost certainly
) p+ u) H7 M/ P/ G* E; be calling (help) instead. * b4 L9 Z5 l4 z- j
d& \6 J. x; Y5 m9 `+ X1 y3 p
(defun acad_helpdlg (helpfile topic)
" s/ t4 }3 q. s$ Y% T (help helpfile topic)
& Y9 a% D6 O( z)
; ?5 F8 u+ E5 L: U% I" c0 |/ ]
: f& w) e. z9 _6 t; B. Z9 s" w
- C1 T4 A V! L6 z% ?% D. C$ k(defun *merr* (msg)
* K! N$ @& U, J) f9 A (setq *error* m:err m:err nil)
7 R% C9 M4 d# E (princ)
# e- v, m( w6 U) t! Z$ ^)
9 m+ @% }( B' o9 o, G, R, [5 @3 d* g: o: n- I+ t& i
(defun *merrmsg* (msg)& y8 Q1 z1 W c' y
(princ msg)9 j: v; E# i; e1 \; E8 m! i7 V
(setq *error* m:err m:err nil)
" ]- @" d% m' E8 d9 ~: s. z( @ (princ)
0 k) P5 N4 r. @# E) Z5 Y4 v6 J1 I' M; x7 G ~/ P. x
) l0 \( M0 b. j }+ S;; Loads the indicated ARX app if it isn't already loaded
9 C& w- g4 e# ^. R6 r- x;; returns nil if no load was necessary, else returns the1 o- z% U( U S8 l$ V, [" W7 N
;; app name if a load occurred.
3 N$ t* T# A5 d0 |(defun verify_arxapp_loaded (app)
; W/ X1 o/ q1 |2 Q& ~. E) v; D (if (not (loadedp app (arx)))
6 V0 S D$ v/ i% e! m1 {0 m& u (arxload app f)
) K v2 e/ \* e$ q$ x" a )2 `" v0 D! U2 u$ K% w3 k
)
7 b% q& R2 W3 M; O2 j& [
, [8 P; n% J# _$ c;; determines if a given application is loaded...; C# j1 K1 n* m+ {0 W; \
;; general purpose: can ostensibly be used for appsets (arx) or (ads) or....
" m# R; a2 l! S* ^0 X6 t8 d& `) N;;& C5 t$ u/ _: c' v1 g& z$ |! X$ W
;; app is the filename of the application to check (extension is required)2 H( [- @4 S( ?' |6 b
;; appset is a list of applications, (such as (arx) or (ads)8 m3 C+ s# R3 F3 m# e" Y
;;
# s4 \; N: d2 p( `2 T" I;; returns T or nil, depending on whether app is present in the appset- M, [0 k/ k4 r% g- N$ M9 p
;; indicated. Case is ignored in comparison, so "foo.arx" matches "FOO.ARX"4 `1 i& L9 r& N6 v/ [+ v
;; Also, if appset contains members that contain paths, app will right-match
, Y8 r t6 b/ T [/ n8 f7 \9 J;; against these members, so "bar.arx" matches "c:\\path\\bar.arx"; note that# J* p, H2 i6 V
;; "bar.arx" will *not* match "c:\\path\\foobar.arx.". n* H! s* Q: U- Z$ Y0 W* K+ b
(defun loadedp (app appset)
3 D# I4 s" d( a" h, P# n% i (cond (appset (or ( ~% ^9 U" d/ S7 N: `5 G" S/ ?, j
;; exactly equal? (ignoring case)+ X/ J% \+ G2 j/ |; n
(= (strcase (car appset))! e, x3 Q/ N' G9 P n
(strcase app))! l' H2 Z, x% |* l
;; right-matching? (ignoring case, but assuming that
% W" F8 b0 S2 A% Z) A ;; it's a complete filename (with a backslash before it)
7 t0 \, Z2 k2 S( o$ o (and 9 b4 C7 [ W1 u0 y. e! v6 a
(> (strlen (car appset)) (strlen app))
/ E) }) K2 G' m0 [3 g$ p (= (strcase (substr (car appset) 7 J: o- R3 e- K1 X5 p
(- (strlen (car appset)) # T. O9 z4 D- U: [ o( @+ |
(strlen app)
- w" ^% R# f/ }! q x! x4 G2 V ) 4 }, A5 X. q* d6 ~) V) [) C
)* }& S) Y$ D+ R2 q6 w/ h
) ; z( e. x2 ^* j5 P, i# K
(strcase (strcat "\\" app))
0 ], d. C6 M+ S/ |1 v, O )
; P* z/ T+ p5 `" b/ ]4 q )
1 `6 o. X) u, ~1 {& A1 ~$ T& M ;; no match for this entry in appset, try next one..../ [* e/ |. h6 z+ V5 d2 ]! i
(loadedp app (cdr appset)) )))
: M2 ^% v+ i v$ K7 a9 ?- H)) k1 ^+ @7 I/ ~# s q# [9 O
( w, h- R. ?. V, Z) C! q% t5 i7 n6 k- \! K( f5 d
;;; ===== Single-line MText editor =====( j! q( v. s1 \. h, I5 n) a# G
(defun LispEd (contents / fname dcl state)
& U- n/ p1 s h3 _2 O (if (not (setq fname (getvar "program"))), E6 w y5 _8 `! z7 [0 g$ i
(setq fname "acad")) O; G. }1 ]0 y0 O; }! A# ]
)
4 X/ d& Y4 V5 r4 C* y2 ] (strcat fname ".dcl")9 {7 p8 n: F7 n; G5 _
(setq dcl (load_dialog fname))
; b2 D" E3 C7 O (if (not (new_dialog "LispEd" dcl)) (exit))+ N; E/ J: l( l. _( n, ]0 w/ y7 O
(set_tile "contents" contents); d+ ]! S& p# a/ A7 M/ O1 s9 Y
(mode_tile "contents" 2)
, a5 w" D9 c) r( i! ]# U$ Q7 ` (action_tile "contents" "(setq contents $value)")4 V* C9 W0 ] j7 ~4 R) H8 }
(action_tile "accept" "(done_dialog 1)")
& `6 l/ m+ V! D! u4 V+ o; l (action_tile "mtexted" "(done_dialog 2)" )& @% f ]- W: }4 Q; Y5 f0 w
(setq state (start_dialog))
& T! }3 i6 D% T/ D4 W& j' `$ C3 J (unload_dialog dcl)' M2 W4 G$ k; u4 u! _: l
(cond0 b! \6 ]4 x* m o
((= state 1) contents)! f* X, y: W$ a' o
((= state 2) -1)
; W/ N: O; X; F5 j6 A (t 0)
1 l7 K) n T$ A l8 l e )
$ t( ?6 k* d6 [4 `% T$ O) |8 H& H* M; Z" @
5 D0 G P6 d, f9 W1 {
;;; ===== Discontinued commands =====" x. J' @9 ]6 n" c W+ D0 j3 Y- k
(defun c:ddselect(/ cmdecho-save)
* I: k6 M+ F' y (setq cmdecho-save (getvar "CMDECHO"))8 V1 v8 B3 [, l- K6 g" }" Y3 k
(setvar "CMDECHO" 0)
+ y; j( b. k: L$ C+ h0 I (command "._+options" 7)8 f6 v d/ P( N' ]: N
(setvar "CMDECHO" cmdecho-save)
5 _1 h5 i. ?" N1 }9 z (princ)/ w Q" B/ O) E( ^
)3 \7 T0 }( S- a; Z2 `( M, D
( h) _9 V1 h$ n4 ~ {1 ?5 ?
(defun c:ddgrips(/ cmdecho-save): G; I. I+ K8 u3 s) ]: X* }
(setq cmdecho-save (getvar "CMDECHO"))/ B/ n3 x8 f4 w/ ^: \2 R
(setvar "CMDECHO" 0)+ B% q2 ]8 a% s" g
(command "._+options" 7)3 J; x$ U7 f. O
(setvar "CMDECHO" cmdecho-save), K8 b+ {6 [2 h: g7 g5 M7 J# ]
(princ)
- R7 ]5 }3 m: w! B5 m A: T: o P)( `, I2 r, q' ~3 w, U$ I
' J8 a3 Q9 p1 o; m$ E. m& {(defun c:gifin ()1 k* U3 K* b8 \
(alert "\nThe GIFIN command is no longer supported.\nUse the IMAGE command to attach raster image files.\n") Y* x+ y) h% \+ J0 ?
(princ)2 L1 P5 q8 C: C7 X* Y
)* y2 k$ v% I( W4 r$ _
9 V/ n; @6 J. U+ d
(defun c:pcxin ()
9 x1 K8 i3 C1 d. y# t |# h (alert "\nThe PCXIN command is no longer supported.\nUse the IMAGE command to attach raster image files.\n")- Q' @0 e5 V, b8 }1 H: }, J
(princ)
, u- I# w- N3 ]+ j# U: g) H; y)
, K! O( X1 F$ B U& I8 b* N2 g2 U& t
/ O$ Y$ ^) L U3 M# q" n(defun c:tiffin ()
0 s8 Q, G; y9 b7 }' F (alert "\nThe TIFFIN command is no longer supported.\nUse the IMAGE command to attach raster image files.\n")
% S& Z5 K. N+ z ^ (princ)9 z/ m5 _2 O* B1 _
)
) o1 c4 c+ V$ E/ e8 R) J0 ~) B) n$ [4 r7 ^
(defun c:ddemodes() M0 c4 ~8 ?. H f3 m
(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.")
+ K2 v. Q1 t( _" w. C (princ)- v/ E$ f, u& E: p/ a: f& u O" S
). ^& ^0 K+ v2 K' K" T2 C
) @4 }7 v G8 T: q% a/ G% C) i2 Z(defun c:ddrmodes(/ cmdecho-save)- W; `$ q, t7 A
(setq cmdecho-save (getvar "CMDECHO"))9 p( L' h; L9 Q7 }
(setvar "CMDECHO" 0)
& x2 o7 I% \0 q9 |. a3 v j (command "._+dsettings" 0); Q0 |; r# n: W+ L
(setvar "CMDECHO" cmdecho-save)- ]* V' b- d* Q+ ?! ?
(princ)
' n. U M$ x+ X: O) i, L. V( a8 ^3 X0 \
; G! D/ ^/ K0 {* E4 ]& v1 ]: t( ?;; HPCONFIG; C( K- {' @6 K
(defun c:hpconfig (/ hlppath)
5 K1 P! r- i6 D, Q' K. q" E1 f% B- s (if (not (setq hlppath (findfile "acad.hlp")))3 P' M% @& g I* _0 q8 K- f' Z
(setq hlppath ""))
$ p: U# G" N" G/ u. X/ ?( b3 Z (help hlppath "hpconfig")
2 u, H. s' t. n& q1 M- m (princ)
, M) F, q$ l a1 [)6 U, y+ P: j4 P- K& _
3 u) b* t9 L9 R/ u @% s
;; OCECONFIG
' }0 ?5 u) f; k. P9 r(defun c:oceconfig (/ hlppath)
8 B# e+ y4 I4 s8 p (if (not (setq hlppath (findfile "acad.hlp")))- B- P/ N5 |) d& h; Q, D" {
(setq hlppath ""))2 t; v X: l# |2 X' B* d0 f' f
(help hlppath "oceconfig")
3 \. i4 `' N2 Z; n4 c (princ)
+ n9 ]3 G" e$ i$ z3 N)+ ~8 L; ^4 |; y- w2 F
& e9 D& T& n. B9 | j- Q0 } c M0 [;; CCONFIG1 z4 t8 A4 P) {, m& t+ q
(defun c:cconfig (/ hlppath)
; d+ d' L! R o1 M, J. w! ]$ A, O (if (not (setq hlppath (findfile "acad.hlp")))/ g# t0 P: F) {) j) @1 p) O- {
(setq hlppath ""))! x! |7 j( Q/ e' b; a
(help hlppath "cconfig")
' M0 W+ \6 ~8 { (princ)- f) H6 R; p0 U4 T" U0 O9 x4 Q" e
)
2 C4 O/ A% s: C" X% S0 ^* L1 B/ s% O: Q. ?4 r& D4 B
;;; ===== AutoLoad =====$ K5 a+ B& `6 a( @* n. v x. V
5 _* `( x1 x3 _. k0 E$ }) ?- H# j! K;;; Check list of loaded <apptype> applications ("ads" or "arx")
! ^9 [7 X M0 j+ X" ^( a;;; for the name of a certain appplication <appname>.# {$ N8 V1 C7 o# Z3 c
;;; Returns T if <appname> is loaded.
5 S( B+ i8 W# ]: I. F# P
4 p3 r! C6 y: G5 c8 [(defun ai_AppLoaded (appname apptype)
' e: u4 g% [% p! @8 O0 V% |0 p (apply 'or* G; b W) @& b4 \" o& I0 f" N. O
(mapcar
; x( J q- K k6 ?; A" U '(lambda (j)
6 T' i* P7 c- O3 } (wcmatch
- ]9 [- [/ H0 Q3 z; Y Q7 _; ] (strcase j T)
5 i& J. z; c4 o J4 b (strcase (strcat "*" appname "*") T)
/ z9 o! c# t7 I6 m1 a1 { ) 0 l N7 R# c5 ~9 l
)- X3 E4 O, J# k2 E( T% @
(eval (list (read apptype)))! A9 j' F( P6 g7 ?) k. o" Q
)
$ a; b- J9 o& ^# L )
g, h2 F9 T' l2 e)
3 _$ I- n4 j2 E; ~$ l1 ?. C
4 y, x. F/ J6 l2 J3 };;
$ A- r3 r* l( ~( W;; Native Rx commands cannot be called with the "C:" syntax. They must
' ^0 ^' c# r9 P;; be called via (command). Therefore they require their own autoload 8 ?. l' f9 l8 R: V2 B% z2 L8 c$ A
;; command.1 x, ?/ T& C# C4 ]% p5 I. ], l$ G3 q
% g2 w; |+ P4 q! `
(defun autonativeload (app cmdliste / qapp)
5 D; \: L. d7 n! O9 Q (setq qapp (strcat "\"" app "\""))
: R" J& R6 z. g* H (setq initstring "\nInitializing...")
+ e& ~' i% }! a3 S& I u+ {% e (mapcar3 N* H. P) |+ J5 @- ~9 S% K4 e
'(lambda (cmd / nom_cmd native_cmd)
+ `* z* y( l3 ` H, \$ f8 h0 h (progn0 l( b4 _, r6 s/ o, N+ {2 ^
(setq nom_cmd (strcat "C:" cmd))
9 b, \" |, T9 G (setq native_cmd (strcat "\"_" cmd "\""))
1 r2 ~1 p& [$ H% A (if (not (eval (read nom_cmd)))
* J# {" V' i0 t N1 {6 H* Y (eval
/ Y& b" Z7 {7 a9 y (read (strcat! w* |4 U, H; I& G+ Z! r: A v
"(defun " nom_cmd "()"
0 H$ Q- g9 H- J3 b7 f' {3 u0 z "(setq m:err *error* *error* *merrmsg*)". [ z5 C% W4 [$ ]8 E. x, k& }
"(if (ai_ffile " qapp ")"% p. ^, Q3 @. E1 m
"(progn (princ initstring)"
% T$ f! D4 _- [) f "(_autoarxload " qapp ") (command " native_cmd "))", K7 I( g# `4 t4 l9 ^* \, A: B
"(ai_nofile " qapp "))"6 e+ n' m( O9 C1 `, n
"(setq *error* m:err m:err nil))". U+ y, p( m# k4 ?# @" H
))))))3 g( M9 R7 O4 Y; M
cmdliste)
. R' S4 q) r8 ?7 z7 ^3 \8 Z% q: ^ nil
0 r3 \' S7 l, ?. T)
1 V5 U# j8 e' Q9 H. U4 e0 B7 _, q5 F4 V2 u. R) m# K
(defun _autoqload (quoi app cmdliste / qapp symnam)
H: ^1 m3 `" j- l( [: Y. | (setq qapp (strcat "\"" app "\""))3 Z( i8 _$ ?1 L4 B3 ?4 M5 h& {" e
(setq initstring "\nInitializing...")
' ~1 q+ q. n3 ^: J ^ (mapcar2 [; [6 v( z4 ?0 b" p
'(lambda (cmd / nom_cmd)+ V6 l. m" \9 x# j# O, U' D( e
(progn
$ }; H$ O! \& ^( ^6 Y, u6 U (setq nom_cmd (strcat "C:" cmd))
8 H0 Y6 U2 y. _# z9 ~# O U w (if (not (eval (read nom_cmd)))
3 F% e, ?! N1 H" |# W8 x2 o* R) V1 X) H (eval
|; x c; o. G2 N9 Q# M (read (strcat B. N! G$ K$ q5 D' Q
"(defun " nom_cmd "( / rtn)"
7 t! q! D- E2 t& c1 }' I# { "(setq m:err *error* *error* *merrmsg*)"& L; K9 h: O+ m- ^
"(if (ai_ffile " qapp ")"6 P( G& [+ F1 o" J9 X5 [+ |
"(progn (princ initstring)"
; P6 s, q' B( e "(_auto" quoi "load " qapp ") (setq rtn (" nom_cmd ")))"
/ h! f% Q8 ]/ m0 g "(ai_nofile " qapp "))"
" V* P" K; u/ g1 N "(setq *error* m:err m:err nil)"
) P3 V( \$ D5 O- e* _ "rtn)"4 F& D I3 ^; C
))))))" e- U; y1 x. m4 m. r
cmdliste)
! R* b5 N% x% H. V. ], n! w nil$ [% u5 M& N/ f: O( s* [5 ]" B
)
( c) y8 u) ^' J; j: \% T! Z, e, Z6 n5 u/ c
(defun autoload (app cmdliste)1 ~5 W- C5 o5 Q( y* F
(_autoqload "" app cmdliste)( X! W$ z/ s# a6 r
)
' z4 j7 _3 I1 n( I0 r$ ^/ T T- A# a' `
(defun autoarxload (app cmdliste)1 ]0 `0 B% Q" v0 @ K8 P. w$ V
(_autoqload "arx" app cmdliste)
5 j" g9 X x) D- Y9 _2 O' n5 X: g)2 \$ p8 D; T, c/ K I. m
# e. E6 y F2 o: }0 q" j2 C(defun autoarxacedload (app cmdliste / qapp symnam); @! I6 [; f* N& _% S$ {7 U) ^
(setq qapp (strcat "\"" app "\""))$ x. ?' T9 z5 T) s; w! @# ~" K
(setq initstring "\nInitializing..."): q/ [6 d7 Y5 `, F" H
(mapcar
( w4 K$ s7 v9 C+ k '(lambda (cmd / nom_cmd)
/ V( h9 y. B3 Q5 y5 M (progn
) g3 p7 Q' Z# j( q& \! B (setq nom_cmd (strcat "C:" cmd))
* _" ]4 s( ~4 X4 P+ J0 q (if (not (eval (read nom_cmd)))3 Y P0 l" M9 _2 U. w% U
(eval
4 I R6 h0 E8 Y/ n/ ~' C1 n8 m (read (strcat/ M& a, J: b* C1 t0 e6 ?
"(defun " nom_cmd "( / oldcmdecho)"
: ^( L9 Y. P: Q: P+ ` h. c J! R/ a "(setq m:err *error* *error* *merrmsg*)"% Z$ i! z6 M! h; a w& l$ f) R
"(if (ai_ffile " qapp ")"
& \5 U& n k2 S "(progn (princ initstring)"" }8 e2 h9 Y% i- ^7 K% G" [
"(_autoarxload " qapp ")"% K" B0 g8 g1 N
"(setq oldcmdecho (getvar \"CMDECHO\"))") t6 o" p7 L; O4 w. T/ @8 U
"(setvar \"CMDECHO\" 0)"
9 U+ z; E8 Y* j "(command " "\"_" cmd "\"" ")"
# o1 S0 d. Y" @* K "(setvar \"CMDECHO\" oldcmdecho))"
* {3 [; y# |; }, J' g+ j' P "(ai_nofile " qapp "))"/ `4 F' G% H; V- B
"(setq *error* m:err m:err nil)"
. d8 C5 T" S' K- W "(princ))", V6 f7 }$ ]5 J' v. g" d
)))))). ~+ v" i7 l! M# ^5 Z$ }- I ?
cmdliste): { k" z X2 G" h* g
nil y) g$ O0 f9 V8 G
)
2 x4 B1 J$ k% T) J8 D" }: S" @. p E9 v
(defun _autoload (app)) d- [6 L4 c& d: u. }2 V
; (princ "Auto load ") (princ app) (princ ")") (terpri)
6 |7 q9 ?4 t% X& x( S( w6 n3 J (load app)
1 h4 i( `6 i x' N/ k)
, ] a8 t7 f% B6 w) [
7 j9 r, r R& s2 o/ d4 @6 {(defun _autoarxload (app)
) v( d0 V0 J8 S7 f$ T; (princ "Auto arxload ") (princ app) (princ ")") (terpri)6 Z. M/ ^, f" Q$ \" J% U8 ?
(arxload app)" r/ _9 E5 ?/ w
)9 n4 E k- r4 C$ i- f( q5 \! E
5 _& _, V+ d6 p- T+ |' B(defun ai_ffile (app)
" ^7 Q6 n/ v, e# h7 y (or (findfile (strcat app ".lsp"))! \/ q2 Y8 v: Q. M, n- r
(findfile (strcat app ".exp"))4 Z- h# W) a5 f' p- a8 c
(findfile (strcat app ".exe"))
# O* r2 L( P% `# l3 ?3 B (findfile (strcat app ".arx"))6 t S. f. ?4 M, ?% R
(findfile app)
, ]# W; h# ^. V. @! \ )
4 y$ N, e! v9 Z4 O$ P+ s3 i)
. `0 ^2 N) A ~) a ~) |
% @* h! U/ P5 ~8 d( s( t; l$ Z1 M(defun ai_nofile (filename)
- v) V% {/ u4 H! u# g6 U5 l5 f" V (princ
" M. r! l: e5 J+ F; F (strcat "\nThe file ". c% X( B( I0 |* M1 N) x( V6 `
filename
# W5 s5 d C4 ^+ h3 N1 F7 O# B "(.lsp/.exe/.arx) was not found in your search path folders."2 f7 i. M `* G) L8 W
)2 ~6 V/ z8 d/ j6 B# e% S
)7 b, i$ q0 B4 p; A* t
(princ "\nCheck the installation of the support files and try again.")
, y8 U5 Q) ~# k9 c# v9 g (princ)% D# D7 ]& f. U1 p7 s) c; j, O
); S1 A6 w+ t: L# u4 `
5 M* j9 n3 O2 \* s
- ]5 f7 u0 G8 O X: c
;;;===== AutoLoad LISP Applications =====. G5 Z9 A4 ~5 V5 J! a# @+ [
; Set help for those apps with a command line interface
# U; I5 N+ X* C/ u o6 y/ s* c. [5 w" _7 z4 h( H. m6 _# V- X
(autoload "edge" '("edge"))4 k4 _4 ?, z. L0 u, h
(setfunhelp "C:edge" "" "edge")) r, E8 j0 J. }0 P. J
! m6 [- ]% f+ m2 r/ C' _9 V
(autoload "filter" '("filter " "filter"))
' ` B+ Y1 K2 ~
( H/ A K Q8 I( P: K(autoload "3d" '("3d" "3d" "ai_box" "ai_pyramid" "ai_wedge" "ai_dome"- W* L s b0 W
"ai_mesh" "ai_sphere" "ai_cone" "ai_torus" "ai_dish"), f p6 t( f& ~6 |# x1 x
)
$ {) p4 S2 x. d% \( U(setfunhelp "C:3d" "" "3d")
5 r& u' @1 c/ B/ S(setfunhelp "C:ai_box" "" "3d_box")( Q" {, D6 s- S: W3 A8 s+ |
(setfunhelp "C:ai_pyramid" "" "3d_pyramid")/ Z$ S2 }) H3 Q; y: M2 Z+ i
(setfunhelp "C:ai__wedge" "" "3d_wedge")
; c* h9 [7 E" r2 q(setfunhelp "C:ai_dome" "" "3d_dome")
) ^. m) q3 i+ ~- j6 a5 K$ ?(setfunhelp "C:ai_mesh" "" "3d_mesh")' V0 H+ a f0 \$ ~! \8 `$ L
(setfunhelp "C:ai_sphere" "" "3d_sphere")% A1 B0 b/ I7 n2 ^7 d
(setfunhelp "C:ai_cone" "" "3d_cone")1 O9 C) t. \0 F2 z
(setfunhelp "C:ai_torus" "" "3d_torus")
# W9 b# \9 \; T& o(setfunhelp "C:ai_dish" "" "3d_dish")
3 g8 T U2 G5 r4 R( Y/ J) }3 W+ q) c- c1 N" l. [6 ]6 X, R
(autoload "3darray" '("3darray"))
! q& L7 D. j0 r3 l' @(setfunhelp "C:3darray" "" "3darray")1 g! N2 j( J) n5 i
- v H7 M4 B% R3 b5 [; J9 `9 H+ I2 `9 G
(autoload "ddvpoint" '("ddvpoint")) c2 t- K% {0 ?- l. m9 b2 F
0 Q4 [! T& g$ m4 U
(autoload "mvsetup" '("mvsetup"))
6 r0 m+ S0 h, U(setfunhelp "C:mvsetup" "" "mvsetup")& {8 m8 X8 A1 Z7 y$ i
" Z. M4 Z7 G/ T g- I# i(autoload "ddptype" '("ddptype"))
: \( A2 H0 G8 N
& X2 ?; p' s1 C$ G0 v+ h c(autoload "attredef" '("attredef"))
! v+ M9 ]/ m- g+ I4 i4 W) d; O(setfunhelp "C:attredef" "" "attredef"); f" X# _' i) j4 n% X% c
: h0 a3 c5 P; ^8 C! J. E1 q
(autoload "xplode" '("xp" "xplode"))
4 @$ t' d3 U! H h5 J2 M(setfunhelp "C:xplode" "" "xplode")
1 g( `- U) b3 R4 s6 w
9 | C4 e6 Z' R) d. w4 c(autoload "tutorial" '("tutdemo" "tutclear" u$ i- A, d4 Y. e( [! z
"tutdemo" . ]1 D3 w. j3 p# P9 O
"tutclear"))
3 \, _& w, r$ U
B9 g6 Z2 k1 U4 b B1 S# F3 P;;;===== AutoArxLoad Arx Applications =====- c0 D" |2 E$ b
1 c @" C9 T9 V2 k- v- {5 h
(autoarxload "geomcal" '("cal" "cal"))
% L& J! O4 i2 A L% p: ?' @. H! y, z6 u% o! d4 a1 G% k
(autoarxload "geom3d" '("mirror3d" "rotate3d" "align"
3 l, R$ T' x; i: D6 x3 B$ s7 U "mirror3d" "rotate3d" 4 [; K" B, a2 Q) K' M7 }6 i
"align"))
& m( H6 w1 d7 B* L0 n3 m) C' ~( j/ p. g8 M7 y: r% U) z
) q3 ?. w. H: c
;;; ===== Double byte character handling functions =====( i9 V, I8 b J3 f
9 r/ M: n9 c6 l8 P(defun is_lead_byte(code)
* t! r7 M, T6 Y3 r h: Y (setq asia_cd (getvar "dwgcodepage"))
/ w! w# _8 d3 R n (cond
/ i' D$ }: [! v4 F% A ( (or (= asia_cd "dos932") Q0 K# V0 y4 N: _: `
(= asia_cd "ANSI_932")
" D- b! f$ L; T1 Q0 | )
8 D% A4 ~: c( F (or (and (<= 129 code) (<= code 159))# a, _1 C# l7 M. n
(and (<= 224 code) (<= code 252))9 K" w, \- }* e" T
)
2 r0 h4 p" @% ~# ?+ U2 t )$ D5 x/ y( A, z& ^/ s
( (or (= asia_cd "big5")5 d4 v" E: B0 q( {2 s& @
(= asia_cd "ANSI_950")
6 a9 [* j# Z+ D )
+ h" {, n& P8 G9 v (and (<= 129 code) (<= code 254)), o' W& ^* @7 e% D- B+ U) K
)
: ?( {" N% y: o. I* k/ O ( (or (= asia_cd "gb2312")
- Z4 r4 L! a. e) \/ k (= asia_cd "ANSI_936")
% h9 Z* e) ]6 l% Q: D* v7 V )
! c; n3 U, ?" ]! w- i (and (<= 161 code) (<= code 254))/ V5 B/ c+ m5 ]/ P- _
)
5 G: L% W! t% p! C% P: F ( (or (= asia_cd "johab")
8 x, V9 n# _3 \0 z (= asia_cd "ANSI_1361")3 a* z4 o* i* [! K7 y( P# s- u
)5 g& H* B# u- `3 t2 G9 p& _* c
(and (<= 132 code) (<= code 211))
6 ?" K$ V0 d# e+ \5 o! P ). g* u6 A J# {; `
( (or (= asia_cd "ksc5601")# }! p8 s) ], z
(= asia_cd "ANSI_949")
& k# A2 w" V9 C1 R; J4 c9 U )5 b7 }1 O% B: d2 C
(and (<= 129 code) (<= code 254))
1 ]" R, |6 Y% }. n5 F- b )2 {/ o/ \$ B1 O+ r W3 x
)5 e$ O& a% x4 I+ ?
)
% I6 W5 M2 p( t7 W/ L3 d. h8 M! r$ |
;;; ====================================================! d2 |- w" X% m; C1 a, o
- {0 k5 L' c! r. i
* E; R7 f2 V1 H' n;;;
' N i) a, ^& Q* [4 u5 Q2 N;;; FITSTR2LEN
$ \# J: Z. l/ k" {;;;
+ l. W* g5 Q0 r ?/ G; ~; H;;; Truncates the given string to the given length. . @4 ?3 C' q+ {' R4 [2 n$ _! i
;;; This function should be used to fit symbol table names, that- p; E, t/ d# u1 n5 x( Y+ }
;;; may turn into \U+ sequences into a given size to be displayed
7 Q5 v3 n7 y' M8 E+ t4 t;;; inside a dialog box.8 t, J- j- S6 Z# [7 K0 {
;;;- J$ P# i, ^5 ~! y( f+ w3 T
;;; Ex: the following string:
9 W/ m7 N/ J; Q0 r;;;
" m* V2 C3 b4 Y6 e/ m;;; "This is a long string that will not fit into a 32 character static text box.". b+ I3 y4 L# T' e2 F( l" l
;;;
0 S; F. H6 n7 m" v$ o; {9 W- ]& G;;; would display as a 32 character long string as follows:
9 c5 ]) ], E/ X8 o8 H6 d1 };;;
$ m8 I) n! Y: S;;; "This is a long...tatic text box."- J7 v3 q- y: v( a: c
;;;& c# I) ?2 ~ y; C% w
I9 n+ \* O4 R$ ]* p U& [2 `
(defun fitstr2len (str1 maxlen); Z! t5 I8 o0 _4 c* x" A0 W( W. G6 n
, U( a2 t/ J( g; k! ` N% s0 {4 | ;;; initialize internals/ l* M+ @8 q k% i) a2 K* e9 F
(setq tmpstr str1)
1 l7 W2 Q& c' l (setq len (strlen tmpstr))
5 K: T1 [# P+ S& m8 w5 V" b" t( v# H* F1 ^( Z" l
(if (> len maxlen)
$ W- b; l ]- \0 u. C7 c* H (progn
: p- p) R2 R' e/ R: p (setq maxlen2 (/ maxlen 2))
- b% Y. S) ^5 ?- ~ (if (> maxlen (* maxlen2 2)). G3 Z% i8 r8 E w/ D: O
(setq maxlen2 (- maxlen2 1)) t4 B( L: I. T9 i4 o. [0 ?
)
_8 E6 v# H0 c1 Q# \ (if (is_lead_byte (substr tmpstr (- maxlen2 2) 1))
7 _, G& J* l. H0 }+ F4 o (setq tmpstr1 (substr tmpstr 1 (- maxlen2 3)))
9 _% ]$ ]0 G9 }* J, D (setq tmpstr1 (substr tmpstr 1 (- maxlen2 2)))- K5 g6 t- r$ J: Y
)1 X: d- M, Q$ H; T& d
(if (is_lead_byte (substr tmpstr (- len (- maxlen2 1)) 1))) ~9 T7 q9 j" V- ` L
(setq tmpstr2 (substr tmpstr (- len (- maxlen2 3))))
2 }* z W' r# j& J: P8 g) I3 m9 x, H (setq tmpstr2 (substr tmpstr (- len (- maxlen2 2))))
# ?) Q$ [( D; z9 [5 @, N ); k$ e5 G% d' L, p) }% R
(setq str2 (strcat tmpstr1 "..." tmpstr2))$ t3 l; A7 z( A- U; t; g
) ;;; progn
3 G9 N: b0 |. i B (setq str2 (strcat tmpstr))! C3 M# Z2 }9 g: Z7 `. U
) ;;; if% ~( P" h! X! K" e
) ;;; defun" h1 w z m) c1 p# j# d
; R$ q+ t$ N; C& D. T7 A
7 f9 q# v! y1 [ |6 s4 |
;;;* B- g3 F( V4 O, B Y3 z- ^
;;; If the first object in a selection set has an attached URL
, J( y) h+ V+ L& \" V# I' A* Z;;; Then launch browser and point to the URL.: D3 ^* T$ q$ Z0 i- D8 l
;;; Called by the Grips Cursor Menu
/ w/ N8 h$ S# V q;;;
" A; s% s5 k: w8 h$ Y# A0 g1 t
3 _/ R3 P _# Y+ y$ W9 l# Q/ I( N7 s(defun C:gotourl ( / ssurl url i)4 u6 y3 m, L) N8 O; Z1 Z
(setq m:err *error* *error* *merrmsg* i 0)/ ^4 L0 T& ?+ c
) r3 i* f! h, T2 w; if some objects are not already pickfirst selected,
- D% ^! b q. b4 C% L; then allow objects to be selected# R0 @# L/ z4 A3 W) l3 o
) x% d# M8 M6 A
(if (not (setq ssurl (ssget "_I")))
- }2 A4 _* \$ E; D/ z1 P8 u (setq ssurl (ssget))5 g& n6 t0 F( k5 b" W
)
4 S! ~; I$ [9 C) L6 L7 z1 S
. k% j% d& c! f- x4 Y& ~; if geturl LISP command not found then load arx application
; t3 `& ?2 |! [1 Q
8 I9 x: b6 k% o (if (/= (type geturl) 'EXRXSUBR)
6 ]+ T0 y) m) Y: }. I6 g3 |/ f# m (arxload "dwfout")2 }) F0 }/ O1 x, i: z* D
); `! W: }# A# @
; ~9 m0 K; {$ C; Search list for first object with an URL/ C/ O+ P6 x5 u
(while (and (= url nil) (< i (sslength ssurl)))9 d+ I% z0 p" e$ Y, u
(setq url (geturl (ssname ssurl i))
! ?0 }, [0 a, ^7 b7 }2 Q! G" L i (1+ i))# U& T: S z7 d+ Z" m
); @& V' p1 f, |- H# O
5 m- \; H! v' U
; If an URL has be found, open browser and point to URL, E& O% K5 p" T9 y$ o
(if (= url nil)
3 o: w: l7 s1 T& q, O (alert "No Universal Resource Locator associated with the object.")
- k: y& h' n; X; ^ (command "_.browser" url)
c$ @. T3 x& E, v )% O* X$ F4 q5 p5 s8 u3 q% y
! `' s& |# a( u: V (setq *error* m:err m:err nil)
" y2 `, ?3 K: j" ~! n9 P1 u. n5 S (princ)" o) h1 g+ p) V( K6 D1 W% K4 m
( N* I7 [) y9 J+ T; n7 B, Q
)
6 d0 C2 {3 c0 E( x4 t' w' p( U* t+ a
;; Used by the import dialog to silently load a 3ds file
" O, z# s. I( W(defun import3ds (filename / filedia_old render)
# M8 v; d3 d3 o1 j$ O$ r ;; Load Render if not loaded
/ i0 d6 U8 l4 b9 F$ H$ k, T (setq render (findfile "acRender.arx"))
+ Q; f* r3 @) c5 e$ G3 C# A# g (if render
' H# g/ D3 P w4 X (verify_arxapp_loaded render)
) I" S8 L3 ^0 m& j& y6 _4 b (quit)6 v g$ Z$ X, v# H
)
, Z, l8 q8 H. z5 F. |' A6 ]# z: {" Y2 N3 Z" [, f
;; Save current filedia & cmdecho setting.( p& |, i( ~! C: p# B8 @: {
(setq filedia-save (getvar "FILEDIA"))" f5 [0 n- D- I" y! C
(setq cmdecho-save (getvar "CMDECHO"))
$ S0 ]7 U% i/ ?# [7 H2 a1 g (setvar "FILEDIA" 0)
2 L& W5 j3 u7 r8 P$ E (setvar "CMDECHO" 0). Y" J4 U6 t; |( R8 |
9 M) p( t# y6 j$ [/ T! c
;; Call 3DSIN and pass in filename.' ` V! O$ T0 l0 S0 Z
(c:3dsin 1 filename)
. p" b' V1 Z2 F ~4 _1 K5 U U1 E+ O6 {9 B% C) @
;; Reset filedia & cmdecho
* |* P& ?3 L1 S: d9 k+ U% K (setvar "FILEDIA" filedia-save)
% W# i# { l( J7 y (setvar "CMDECHO" cmdecho-save)
/ d( H' l9 O" ` (princ). g* f8 ]3 i9 O' {0 }& n( y, `
)
' q! @$ o: P$ l2 Z& {! w1 ^ c9 `6 d( S% _6 ?: O8 B* P
! h7 i5 B+ d, b# ~- ]
;;;=== Menu Functions ======================================4 A& X! e" b& F3 j" f$ f7 g
( a0 b) Q. S, C9 A& H: B/ S0 S
(defun ai_rootmenus ()
% ^- X: e2 G$ y6 D; V7 s (setq T_MENU 0)5 g$ x. I6 A( N" a
(menucmd "S=S")
# m% w. y' \& T# C# V, n (menucmd "S=ACAD.S")
) s! j4 }1 E+ S. i' h6 D% \ y (princ)' y) d, M" K; B1 t& K
)
. i) c M! U# v9 i' g/ b
6 E% R$ X: n# d2 v$ u7 K" {: T(defun c:ai_fms ( / fmsa fmsb)
7 B8 ^5 T0 x4 H, f1 g/ I5 b' W (setq m:err *error* *error* *merr*)
4 Z8 @# m# ~! X/ s5 t P* d (ai_undo_push)
- `; A5 m6 Y* g) F (if (getvar "TILEMODE") (setvar "TILEMODE" 0))- b- T/ i l; V5 E4 u$ R# L
(setq fmsa (vports) fmsb (nth 0 fmsa))9 D1 R0 g; n" h
(if (member 1 fmsb)& g5 J: O7 q; ^( _; n* Q
(if (> (length fmsa) 1)
+ f7 k8 g& k* T (command "_.mspace")9 Q( O0 N! T9 F. ?
(progn; z7 ~- F; o- S4 U& _* I! I
(ai_sysvar '("cmdecho" . 1))
- K4 W: ^& I+ q- p/ O: w6 o (command "_.mview")$ m5 m* W/ m% e0 _: E$ ~
(while (eq 1 (logand 1 (getvar "CMDACTIVE")))
6 ]$ W; l9 b! e: c (command pause)/ j7 V9 i! ]. r1 J n3 i7 X7 i
)
4 F' E$ G( @) L+ p6 A (ai_sysvar NIL)
/ |5 B; q7 U( r: k- D5 [" y$ r6 R (command "_.mspace")2 O; G( D6 \7 ` U3 z H
)
( K9 ?. R% ?9 K' \. ~% i) K! O6 X )$ `* o* w4 D! _4 j* f7 N
)
) M) k! b+ P8 l- a8 _& y+ Q7 O# P (ai_undo_pop)0 w0 A" `; o' G8 m, i5 T4 V
(setq *error* m:err m:err nil)2 b5 y# x) P8 D5 `0 t
(princ)# d" z) D9 p; |5 L+ g! A: [) I
)" a- M& D+ @* ]1 {( H c
* t! q; c O& Y( l
(defun ai_onoff (var)
: Y) K- D( A2 Q7 ]1 ?2 h (setvar var (abs (1- (getvar var))))
) g' F" c* Z& ^ (princ)
$ ?9 [' d) N7 K! W)$ h6 |7 T8 a+ `7 v, m" x1 P( B# X
% _% _% X6 ~) I6 m
;;; go to paper space1 { k2 d8 K' f' i: `
(defun c:ai_pspace ()
2 C1 P6 p- P$ v) A: H (ai_undo_push)$ k5 G% A9 e! |1 U7 h% c
(if (/= 0 (getvar "tilemode"))
P9 e+ {7 }# b- B0 o (command "_.tilemode" 0)
; F5 H% F1 L& N3 \) Y )
4 r# a2 ~! u) l% V, _4 o (if (/= 1 (getvar "cvport"))
A8 G% s: g2 i (command "_.pspace")( J, H2 J: g3 l A6 l% l
)
+ d" Q8 F' Y' e2 j5 _: _ (ai_undo_pop)
8 f: y0 C a1 m9 Y/ C3 r, `8 F (princ) x/ c. n5 L" K$ x
)5 H/ J" o8 t9 O, `
+ R6 K. V! r5 M$ h
;;; go to tilemode 1- z7 }2 t0 X( g* y
(defun c:ai_tilemode1 ()
; Q! E% W) ?" D5 P. c# ]* u$ D (ai_undo_push)
! T7 [3 x+ V0 z) c. A (if (/= 1 (getvar "tilemode"))
# s- d% y, [) i7 u+ ?1 q4 w, ~ (command "_.tilemode" 1)) Z3 {" g# ?& ^% A6 H( M
)1 \6 U' j! r" N& u, m
(ai_undo_pop)) a" D/ _4 ], p8 b6 S: Y- w+ W# y
(princ)* q8 p4 G, v7 p& ^3 c
)1 }2 ^, @- a1 E- D
3 G# f& W* N; Q) E9 t
;;; Pop menu Draw/ Dim/ Align Text/ Centered! d N8 P( Q9 ?2 }% x5 w
;;; Toolbar Dimensions/ Align Text/ Centered
) [) `: g+ a- e _5 z( M8 F3 R: W2 Z# w" v+ q8 x" Q1 t' t9 J
(defun ai_dim_cen (/ ai_sysvar ai_dim_ss)* b! T4 W7 e. E' n
(setq ai_sysvar (getvar "cmdecho"))" I% F# Z3 {3 \! J8 \; U5 a' u
(setvar "cmdecho" 0)& b) l2 N7 p( ]" Y; X" O
(cond
7 V& D1 t% {1 L& n) N& G0 L ((setq ai_dim_ss (ssget "_P" '((0 . "DIMENSION"))))( G9 I: P- o9 J1 |1 C' P9 c
(command "_.dimoverride" "_dimjust" 0 "" ai_dim_ss ""
# G& u# U6 Y% ^2 E5 { "_.dimtedit" ai_dim_ss "_h")
7 O/ l. {0 |! ^" d )8 C+ p4 r$ g6 h' {% a
(T nil)
0 _, H4 l/ D8 u5 P1 a& f )
. G n+ X1 |4 S" _9 R. L6 W (setvar "cmdecho" ai_sysvar)! l( @& h+ y, I1 e! m% G9 j
(princ)( K1 n( C; D+ `. G# q# b' R& d
)9 h$ x9 h, n M6 |+ ~
4 p. W6 Q/ N* U# Q" E3 }. ~
;;; Shortcut menu for Dimension Text Above # a& m2 n$ |6 Q N/ g
& \2 a% s3 n! M* |
(defun c:ai_dim_textabove (/ ss)" K) B3 M4 L" y) E9 K
(ai_sysvar '("cmdecho" . 0))7 }2 O9 R' }# U4 S; p# O0 x: x- n
(if (setq ss (ssget "_I")); k, a1 k6 c+ P: n
(command "_.dimoverride" "_dimtad" 3 "" ss "")" S; R. G! x, ~/ q: h) c4 E. ]& C
(if (setq ss (ssget))7 [& ~2 Y4 J8 g
(command "_.dimoverride" "_dimtad" 3 "" ss "") ' f- G: v" l+ O( d/ {( B2 S p4 W- n- |
)
( }, N6 _' y/ J) r8 _4 k )
2 m# G4 X3 t# K, Q (ai_sysvar NIL)
5 A' g8 g: l5 e) Q (princ)
, X* {/ R- }# f0 t& b)- p/ }% j1 e; K& d! M
0 Q. H: e- G" J% @- q
;;; Shortcut menu for Dimension Text Center
# A4 {8 P. o, c$ H S$ z7 c* w1 _0 x, |* M% C$ Q: h
(defun c:ai_dim_textcenter (/ ss)
( R) [9 |$ y, S; \ (ai_sysvar '("cmdecho" . 0))
' b: @; m, ~! C5 [# G. ^ (if (setq ss (ssget "_I"))
/ G8 S& q+ P( c/ i$ R! W (command "_.dimoverride" "_dimtad" 0 "" ss "")
4 Y5 E$ ]1 i% q" N3 i2 h# V7 @1 W (if (setq ss (ssget)). n# [6 Q, I7 S: d. }6 H7 S
(command "_.dimoverride" "_dimtad" 0 "" ss "")
8 I) P9 W% k6 i9 ?8 o2 ~% A; q )
8 m+ H) N% C. r )
4 ]! z* @$ B; I* g: r" M) v" J (ai_sysvar NIL)" A/ k: n$ T B6 i: c4 P
(princ). ~& c7 J' p' j4 ]
)
" A7 X8 s# e6 X* y9 h2 }# p5 _, z* U# R) E0 I! _, ]& g
;;; Shortcut menu for Dimension Text Home / w; Y, s! p' q o
- N+ {6 l4 x) a0 _8 p; \: {, ]* h
(defun c:ai_dim_texthome (/ ss)
7 `! z, B# J3 A H( Y (ai_sysvar '("cmdecho" . 0))* N% C5 h' |, ]/ I( j. L
(if (setq ss (ssget "_I"))
# e2 o; u) ]5 \4 _$ y8 w/ F" d2 i1 S (command "_.dimedit" "_h"); ^) ]0 g' ]; h- J |4 p
(if (setq ss (ssget))
# i/ N& T2 M N# B (command "_.dimedit" "_h" ss)7 w/ G0 Y- @0 i7 F; l3 l5 P1 P
) f4 @# P6 _7 r" p% V7 {
)' }. H3 E/ y4 F
(ai_sysvar NIL)2 u! n4 X2 H/ G2 ] d1 Y$ p7 e7 U
(princ)1 N( `& z& f. r9 s
)) m! x2 u) s" }4 [4 f
0 n) i8 _5 I/ S% m. G, \0 N. [+ r6 |
7 T4 ], F4 v) n: `! H4 ^- Q
;;; Screen menu item for CIRCLE TaTaTan option.+ M8 Q- I. O7 z( B
;;; first, get points on entities) ?- i( d a' ~) V4 ?( R# ^! o
(defun ai_circtanstart()
7 o% P+ }, R& I& { (setq m:err *error* *error* *merr*)
A- U; V1 ^! _6 X (ai_sysvar . T' L+ t) c1 |" n+ z5 W& i
(list '("cmdecho" . 0)% ?- o$ B+ n3 `$ U3 b8 t' d
;; make sure _tan pick for CIRCLE gets same entity& N2 f* s* B2 z, A
(cons "aperture" (getvar "pickbox"))
3 l- S" W6 Q+ W: ?4 _* l )
: a$ _- A+ v* W )' i' }9 U4 \2 p( m: _; K
;; prompts are the same as CIRCLE/TTR command option
/ L( K8 P& Y9 h: D/ K( d (setq pt1 (ai_entsnap "\nEnter Tangent spec: " nil))
6 N5 I4 s5 Z. e u" |7 O H (setq pt2 (ai_entsnap "\nEnter second Tangent spec: " nil))
* C6 E! b6 U- F (setq pt3 (ai_entsnap "\nEnter third Tangent spec: " nil))
; c9 z7 w0 a4 l v, c y5 [% ?% P)
. f1 b3 U. t7 p9 G;;; Command-line version' P1 O2 d8 i% L" j5 b
(defun c:ai_circtan (/ pt1 pt2 pt3)" @ r- h& _* I6 w G+ A0 R j4 H
(ai_circtanstart)
+ ~$ e# \* Q7 y" ~
- g# K1 j) \% l7 G, W, t; ?2 T) Y6 f (ai_sysvar '("osmode" . 256)), ?- d: u# \* r% U' p+ A- S9 v7 P
(command "_.circle" "_3p" "_tan" pt1 "_tan" pt2 "_tan" pt3)
5 x) E& g [. C
( E& Z! c3 t; n0 e) r9 D (ai_sysvar nil) g% _8 d- |1 { o
(setq *error* m:err m:err nil)- p8 k8 f) x, O) [6 s" V* E3 F
(princ)0 ^% y1 m' ^9 v) B+ ?* r
)
% r8 g' K" w$ ?! S;;; Use this if CMDNAMES == CIRCLE# }) i7 T' a% w5 E
(defun ai_circtan (/ pt1 pt2 pt3)
' e, |1 X1 h [" O: c (ai_circtanstart)
; E9 E3 B( z( Z4 `# p/ ?) W: j+ _# y( n8 h* {* @
(ai_sysvar '("osmode" . 256))! j M- v. O& [! ~
(command "_3p" pt1 pt2 pt3)
; L3 {3 n6 Y$ ?- ?4 C5 A* j2 S& \# O
(ai_sysvar nil)
! |4 i6 r8 D6 x, R" a% V. N (setq *error* m:err m:err nil)" o2 J3 T+ y) j! x6 X$ a
(princ)$ K2 ~( _! Y* s' z
) D; _4 j$ O4 P
4 c! C X$ @' x: Z5 G
. G( W' n6 B$ M7 Q9 v* F) }0 B7 f3 ?
;;; Shortcut menu Deselect All item.% H$ N2 C. R- ^, C
3 w( l: f$ k6 `# Z6 Z5 C(defun ai_deselect ()
( X7 ^2 ]. p1 l( A- H (if (= (getvar "cmdecho") 0) ;start if
! u6 _7 T5 u ]! C H (command "_.select" "_r" "_all" "")$ T# i( M( f$ f* C9 h) T
(progn ;start progn for cmdecho 1
: H B' Q2 R( A/ W# K |) c( K (setvar "cmdecho" 0)& z5 O8 u2 G5 |! Z3 w/ Q; Z
(command "_.select" "_r" "_all" "") R+ E2 z9 x; c# C1 l
(setvar "cmdecho" 1)5 J, H& K0 O/ O8 q5 N: P- ]
) ;end progn for cmdecho 1
2 i, F, L3 t. @/ [" X8 J' q' y ) ;end if0 R# w. j8 O+ c L
(terpri)
( Q% h3 T I3 M, K7 x5 j" F S( P c (prompt "Everything has been deselected")3 k3 s* Q! [5 ?! X
(princ)( ]0 l# {' w. g- t
)- f9 G0 N- k& Q: g
9 t1 L3 e3 E! e+ n# `7 Q. T
;;; Command version of ai_deselect to be called from the CUI0 a+ O$ t8 {& g% o0 ~
;;; so it gets properly recorded by the Action Recorder
6 t1 I+ a# x$ L% J1 Z8 o" {;;;, c) _9 h( J( {8 {& `
(defun c:ai_deselect (). Y9 M: i0 B: J6 q
(ai_deselect). \- D. i0 r, i8 h$ Q
(princ)
0 l0 `8 h: Z0 a)0 N Z6 t) O' e& \3 O
! y1 p# ?0 A6 ?
;;;
- I7 \8 p M* K/ S& t U) A3 ?4 _;;; Enable Draworder to be called from a menu
- ]! X0 c2 @; c;;; Checks for Pickfirst selected objects
: X) D; k* d/ l( `5 a5 e;;;* z* Z1 _2 s4 ^" t7 Z! \4 v _4 _
, s1 M' J7 S: d5 _0 S; n! O* y
(defun ai_draworder (option / ss )
+ Y( n2 {. o5 t( @0 h6 _
( v9 r$ l& l+ J1 t8 \( `0 |3 j (setq m:err *error* *error* *merr*)) w' f1 d h% V/ }0 _2 Q
(ai_sysvar '("cmdecho" . 0))
3 ~" _* d4 C e' L j
& p& m0 U( o c" l: A2 o$ O- t (if (setq ss (ssget "_I"))
$ Z7 ]+ X" U9 {% P9 l F: Z (command "_.draworder" option)( X( z" O& y; X, U% R
(if (setq ss (ssget))
; b: J7 n) I, t2 V* r. V( B- P (command "_.draworder" ss "" option)
) S# Q4 I- A+ z5 N3 u/ T+ } )
. X9 [2 ^ `; S+ h ) z; N! V7 }# W
(ai_sysvar NIL)# R6 `9 L* ^5 O( B
(setq *error* m:err m:err nil)
. |- s, a8 J$ M) k7 ?) r2 `
0 V' A B' _0 E (princ)
. N& U& `: I3 ]$ r$ P)
+ d' i! j! |/ `
$ h9 e% w: K0 ^;;; Command version of ai_draworder to be called from the CUI
6 [* k; ^1 X* @;;; so it gets properly recorded by the Action Recorder& @; }( X3 Q1 ?% \
;;;
$ B5 L5 e" m' c; B/ m8 S* S$ Y(defun c:ai_draworder ()
! z, y5 a8 b( P; J (initget "Above Under Front Back")- z l% Y& N/ h# ]+ V4 h6 b
(ai_draworder (strcat "_" (getkword))); L; |! k: M# H
(princ)% w4 Z+ ~1 |! M" t4 y2 N
)
& h3 ]( q$ M! c% l2 p
) S- e) Y; o1 v1 q$ g(defun c:vlisp (). o7 D6 r, x7 |2 u
(if (/= nil c:vlide) (c:vlide))" T! ^, O2 i# e+ r8 I. p$ h
)
% ?. o/ x- S h9 a6 C
, j' B! G F- ?6 l7 w( w(princ "loaded.")" A2 B. q8 X) h2 n* n7 v
4 t! X' b, h7 @( X& h6 S
;; Silent load.
% C8 p# n1 C2 Y" r2 o d& N. t! _5 Z(princ)$ f+ Y6 W6 Q4 h1 G8 f* _- o; M
3 N: D# D' z! P# g4 U* I9 E& x
1 H$ v9 y' R0 ~% h8 t
; g8 R( B0 h6 u: ~- t;;;----------------------------------------------------------------------------' Q6 A6 e4 d o
;;;& l8 T" R& d- _) d- G+ C2 Q
;;; DDCHPROP.LSP Version 0.5# ^& P" I1 e5 ~+ B6 U- I0 Y
;;;
+ x) P; B* ?) k) K* ~, g& u;;; Copyright (C) 1991-1993 by Autodesk, Inc.
2 j+ a' [% i9 X( M6 F: k;;;
& X" c% L6 D5 s3 V# c;;; Permission to use, copy, modify, and distribute this software! l' f3 Q, N( z; }0 g3 _
;;; for any purpose and without fee is hereby granted, provided
! c" t5 K1 J) m! U: r;;; that the above copyright notice appears in all copies and that
" D: @" b7 j# X% y;;; both that copyright notice and this permission notice appear in
% k0 s9 l$ P/ A: u" n;;; all supporting documentation.
' g2 v& V" n$ ?( v0 |# y;;;+ b/ f/ a$ {' q! [4 T
;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED8 ]+ P* n9 m- C3 o
;;; WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR
. W6 O- a: u6 @2 \1 \/ D+ S;;; PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.
- s4 E- A2 ~; b;;;& ?4 t' k( g% s4 ~* @- Y7 P5 i! w( e
;;; 2 February 19924 G3 M' E+ F! `& L A D1 ~" s9 l
;;; ( u6 N G* b+ r9 y
;;;----------------------------------------------------------------------------
6 j9 q5 }) B K% l) x* x;;; DESCRIPTION
2 c+ \4 c: V4 ?& y& s+ H;;;----------------------------------------------------------------------------0 |5 t3 ]9 ~$ N/ \0 C
;;; C:DDCHPROP is a dialogue interface for the CHPROP command.7 ^! O) z- Q x+ s3 |* c7 l
;;;
9 S! v. m$ e4 w/ m;;; The command looks similar to DDEMODES. The main dialogue has an image 3 {2 A1 K- e! H# W( b2 \ C9 _
;;; tile, 3 buttons (layer, color, linetype), and an editbox (thickness). + P+ X. o. O* U6 i' A
;;; The 3 buttons each launch a sub-dialogue containing a list and edit box. 3 y/ ] J+ K5 `5 K8 k; h9 J
;;; The dialogues are all defined in the DDCHPROP.DCL file.
- y: l5 S* V' `+ Z;;;5 ^ M) U) r b9 ~2 s
;;;! @8 w7 J, O3 l# B( s9 n
;;;----------------------------------------------------------------------------# x3 N2 F6 X9 S
;;;----------------------------------------------------------------------------2 }% Q8 A. V6 }0 t9 o9 s
;;; Prefixes in command and keyword strings: 0 x: I2 D% u3 a6 g
;;; "." specifies the built-in AutoCAD command in case it has been
7 a7 j# L1 L; Z/ o$ l- j;;; redefined.# g/ ^1 C+ U+ Y; g, u7 I0 ` N# j
;;; "_" denotes an AutoCAD command or keyword in the native language
- Q% P) @4 ^" Y* W# h6 G1 t) r) t;;; version, English.
; K8 F8 \3 _, H1 V;;;----------------------------------------------------------------------------. z6 B9 ^( ^+ ^
;;;
: w! a1 q1 t& f: G;;;
% V7 m2 T T9 l# v$ w- ~2 q3 Q;;; ===========================================================================- Q+ c- Z' u7 O' @! j
;;; ===================== load-time error checking ============================
% V0 L$ ~" q# R2 Q' \9 e;;;
# B! Y: N0 i1 C1 G/ @) ]! o( M( H# h1 x5 B- i) H4 y" a
(defun ai_abort (app msg). p. m3 a3 f6 b- v
(defun *error* (s)
5 P B8 z, W; |+ E: u1 f& s (if old_error (setq *error* old_error)), p- Q6 h8 t z# M! S
(princ)- s9 l. B2 s f/ Z3 v4 E
)
" d( K6 e2 j: q; K9 B (if msg
M+ G; N8 n. H" R (alert (strcat " Application error: "( b7 S8 }0 L8 n% j% z' ^
app
9 m. a$ Y" ?7 y " \n\n "' X7 G! B+ S! S) @! u4 Y! m# I3 D
msg1 D3 i* `% K; `* R/ s' E; h
" \n"; j1 m9 j& M) Q8 R f+ [ `
)9 y; E5 d) m4 ~! C
)
9 z' T& ?' W# N$ k7 J )7 d7 g7 a* Q( X7 c5 s
(exit)
1 O) P9 R- w8 |7 @( S )# k" t3 t, m# ]" y
; Q* m. \2 A0 f- w- w( e8 m;;; Check to see if AI_UTILS is loaded, If not, try to find it,
- k! K3 \8 L7 Y+ w( {2 l' o" W* e;;; and then try to load it.; `8 n! k7 C& s9 D9 {6 X4 x3 _
;;;
' q Q x( _3 b, e9 K;;; If it can't be found or it can't be loaded, then abort the* _1 t! A& k$ G; i) @& d9 B& y
;;; loading of this file immediately, preserving the (autoload)2 |4 a- D! }" r9 E0 c9 W6 g
;;; stub function.
) T, [# H. W- \% u/ o! K0 Z$ r7 i5 S( s+ j2 s X" x! r3 L
(cond' Q* w. I, c K+ R
( (and ai_dcl (listp ai_dcl))) ; it's already loaded.
, E4 D C }6 Y
8 M: n9 Z9 y+ ]; g9 y, N ( (not (findfile "ai_utils.lsp")) ; find it- W4 V; v+ U/ l8 } [ f
(ai_abort "DDCHPROP" t6 ^9 [& x5 E+ F
(strcat "Can't locate file AI_UTILS.LSP."& A0 ]. W. _6 e+ t% c
"\n Check support directory.")))
/ C5 p, V$ g/ f1 m1 V6 g3 V. }% ]+ P( [0 F# [% N) [/ `+ V# \
( (eq "failed" (load "ai_utils" "failed")) ; load it: j5 \* g2 ?+ J2 K+ [2 _
(ai_abort "DDCHPROP" "Can't load file AI_UTILS.LSP"))
* b7 Q& Y+ l# ] )
3 i9 c6 W6 s5 @+ J% [6 U# ]% Q% S: f7 i
(if (not (ai_acadapp)) ; defined in AI_UTILS.LSP9 H0 W9 l7 h4 {* |
(ai_abort "DDCHPROP" nil) ; a Nil <msg> supresses$ L+ ]) W+ [6 A0 q- ^8 g
) ; ai_abort's alert box dialog.7 [& z+ l; Y1 G4 T
4 j/ n" e! P' R" G! i! }
;;; ==================== end load-time operations ===========================: I) Q: n' d+ Y- [8 N
5 O: e3 w. c5 J1 Y
;;; Initialize program subroutines and variables.
6 ?# t8 D. q2 o; `
0 j, ^, ~# x9 a(defun ddchprop_init ()
3 W9 Q+ s' J! W2 h, y# c% Y8 A
- U+ `0 m; s8 u6 V( q6 h% g/ \ ;;% C% a! [ t* u9 V
;; Define buttons and set values in CHPROP dialogue box 3 _( K8 D$ \; _5 N
;;+ T" z8 }/ X; e' j$ Y9 \4 O
(defun call_chp ()
y7 k! I [1 G5 o8 H (if (not (new_dialog "ch_prop" dcl_id)) (exit))$ P, \ ]9 ^; ^; M1 L7 U
(set_tile "error" "")
) |- X) _6 A g N" N ;; Set initial dialogue tile values: M# W, M2 K, p# J
(set_col_tile)
- W& m- b9 Z1 v; V1 p" N* g (if (= lay-idx nil)
9 `3 O( F9 V/ U (set_tile "t_layer" "Varies")
: t5 D: X1 t1 f+ q ^' u (set_tile "t_layer" (nth lay-idx laynmlst))
( }4 C! C: d. V/ N ); E1 t4 {( L& ^
(cond
+ i6 Y# c/ x! `5 p ((= lt-idx nil). H) X) c' ?2 i% \9 p
(set_tile "t_ltype" "Varies")
( g8 h% t+ }3 U )* K5 C4 _3 A" g9 n( \$ @. S
((= lt-idx 0) ; set tile "By layer & layer linetype"
1 d) R' m( x! f# Q+ f (set_tile "t_ltype" (bylayer_lt)) T6 R- I e8 O' d* h( [5 S
)! W( S9 B; a3 x3 s. P: {" C
(T
' C ?/ r' b. K- y (set_tile "t_ltype" (nth lt-idx ltnmlst))
2 L8 O1 t3 J/ L: Y) ]% }" y: F& a3 h )# U* ~$ x; S: \' _
)& E+ m- y. R& o! Q+ w
(if (or (= ethickness nil) (= ethickness "Varies"))$ n9 a# G1 j5 _# l
(set_tile "eb_thickness" "Varies")
# L6 f+ W C* V- X (set_tile "eb_thickness" (rtos ethickness))
1 |5 j, l5 J- k. | )
1 p K7 E) ]" y! Q ;; Define action for tiles; h3 S5 l, ^1 e7 E
(action_tile "b_color" "(setq ecolor (getcolor))")
d9 k, a3 {# J ~ (action_tile "show_image" "(setq ecolor (getcolor))")( t5 c6 R6 o# G. b- K. |
(action_tile "b_name" "(setq elayer (getlayer))")
) d# c8 G4 Z% ] P0 W; @ (action_tile "b_line" "(setq eltype (getltype))")
( @. Y4 I1 b8 z4 `( L/ r$ K* v6 R" m) W (action_tile "eb_thickness" "(getthickness $value)") t" f1 [0 J, i; r$ I! `/ N: i
(action_tile "help" "(acad_helpdlg \"acad.hlp\" \"ddchprop\")")
! ?+ G1 `# @+ m- I3 V (action_tile "accept" "(test-ok)")' O- j% @1 i( [% b
(if (= (start_dialog) 1)
6 q8 {/ g/ n- B9 S$ m8 n- b+ C (progn: y( S0 P! M! ^
(command "_.chprop" ss "")
+ z8 Z1 Y0 J/ C! a9 a }* J8 P- t9 \ (if ecolor
$ Y) U, A C$ E7 t (progn
6 ]( }% }1 P+ S$ g( R (if (= 0 ecolor ) (setq ecolor "BYBLOCK"))7 c& _! O* N* I l' h6 {2 d. E1 ]
(if (= 256 ecolor ) (setq ecolor "BYLAYER"))
. Q; w5 Y& Y/ A9 Z1 }$ V/ x (command "_c" ecolor)) e/ d* [* B% c& u G
)* @$ m. q* y; d
)9 u5 o2 i0 Y5 E3 J4 _$ Q' [
(if (and (/= eltype "Varies") lt-idx)
; W5 k8 k) E5 P8 a. ` (command "_lt" eltype)
C' F7 Y+ E% g- l+ d )9 v& V- N3 P4 C4 t: ?0 p
(if (and (/= elayer "Varies") lay-idx)
2 p1 d# Q8 g9 t1 R( j% v+ g (command "_la" elayer)
7 G( {/ r. w. x9 _1 } )' `: k7 ]; l4 [- ~% f. k0 Y* m6 y
(if (and (/= ethickness "Varies") ethickness)- V& b- W9 i. x; q
(command "_t" ethickness)
4 f9 y7 {' C" E# f4 |9 Z1 z ): z2 s. G7 o: D" k" T( T) [
(command "")
, W) a2 W) D. k, I )0 Z1 n0 x n8 B4 a8 ], ^/ H
(princ "\nProperties unchanged"). Z4 P" @2 T3 k4 }
)* \5 {' j3 w& w' Y' m- m+ @( F
(princ)
' N' I! U) V* y! o; J )4 ~0 K: s/ D8 O* X3 s% A7 ?
;;
; c7 P2 V4 N! p: D4 D( Q; S ;; Function to set the Color text tile and swab to the current color value.& p) U7 l, |9 o- ]- w. |
;;6 n, @) U5 P$ J7 B# K4 `
(defun set_col_tile()- \6 d7 D3 k9 `9 }3 C" q0 w
(cond
; A2 Q+ Y! \2 s8 Y ((= ecolor nil)
f6 I N+ u3 v# A7 ?! U (set_tile "t_color" "Varies")
* G7 S& m, ]' `0 {0 `: \ (col_tile "show_image" 0 nil)
E4 _& R- m; ^& x. J* d )
- b1 X$ E. I2 @) ~ ((= ecolor 0)
$ V1 ]) c' E) [: P. L2 I$ g (set_tile "t_color" "BYBLOCK")
5 e u" c/ G( y. T4 A. } (col_tile "show_image" 0 nil)
0 ]. B5 \, ?) @* D8 y ), W/ |& Z) X6 \. ]0 g0 O
((= ecolor 1)
; W- @2 p, P9 f. N (set_tile "t_color" "1 red")
, d# r7 a" F3 j) N! z% A2 S$ [ (col_tile "show_image" 1 nil)
% L" W* z5 f( X5 W0 V) J- H! N. N )1 I* J, z7 ]) E7 }& Z( T
((= ecolor 2)
, ^* X7 z$ ?0 R( n* q (set_tile "t_color" "2 yellow"); h; a0 E; C& s
(col_tile "show_image" 2 nil)% a7 K4 w, ?4 k1 I
)9 q- h; }9 k, J J7 w8 a
((= ecolor 3)
; k: r; ~" z" N' r (set_tile "t_color" "3 green")) g U) Z& @! I) b
(col_tile "show_image" 3 nil), p" x+ ^1 `' o- G u+ c
): S7 O; P; |( g2 [. Z
((= ecolor 4)" k! I& r1 U0 D8 R5 `0 m
(set_tile "t_color" "4 cyan")9 f) ]. e2 B- k' E5 q; ~
(col_tile "show_image" 4 nil)
5 i8 G" Z1 K {( S9 ]7 n+ [ )& y4 g) a4 R# s( U1 f+ I& |# [
((= ecolor 5)
/ [# Y# w5 z$ J0 n8 X8 X% h (set_tile "t_color" "5 blue")
W$ G) `2 C { (col_tile "show_image" 5 nil)# u7 K' d Q; R7 \. L5 i1 o
)
. F$ V2 c' Z: C ((= ecolor 6)7 K6 E4 ~7 ~- ?+ n
(set_tile "t_color" "6 magenta")
9 L9 M0 q, L8 l' V8 |9 ] (col_tile "show_image" 6 nil)
5 o6 K. c# l/ \# B& I2 T0 M )
, U/ W) y7 {- ]9 N# _# W ((= ecolor 7)
. t! l+ |: g7 A+ S& A (set_tile "t_color" "7 white")
% f! S* P5 t; |7 i4 h (col_tile "show_image" 7 nil)
. B# m4 q, _, _; G# w# A )
! U5 x9 @ f# _ ;; If the color is "BYLAYER", then set the tile to. L3 R' T' }) K4 l
;; show it's set By layer, but also indicate the; j1 Z0 q/ f- ~, T
;; color of the layer - i.e. By layer (red). J" D8 K3 r. D
((= ecolor 256)3 e( r/ L. j1 A% I2 o0 A
(set_tile "t_color" (bylayer_col))) Z8 F1 R% i) k( x. a9 B
(col_tile "show_image" cn nil)- q. R8 ~! v- j* f7 O" s% h
)# s0 ~/ d4 c; E1 J3 [ z
(T + l: S' Y0 G9 n$ s. j
(set_tile "t_color" (itoa ecolor))
8 X/ k( j; t* @+ [2 Y (col_tile "show_image" ecolor nil)
0 X W' Q1 z* L4 [" k* V )
1 [$ I+ G6 E; {3 K# J/ q ) C T7 f% Y$ z* h( r7 b, H
)
: o7 J. x! i8 L. a6 v, b6 |/ E$ c( E ;;
0 J. O8 x) _. W: ~4 t+ |& v ;; Function to put up the standard color dialogue." j7 @7 j( t |3 O+ O. z( l: M
;;
; Q6 Q. F& |( j7 J; T (defun getcolor(/ col_def lay_clr temp_color)
: _. n" w+ E* R9 W ;; col_def is the default color used when rq_color is called. If ecolor 0 y X2 o5 u5 G8 |& n* E! ]' M, h
;; is nil (varies) then set it to 1, else use the value of ecolor.
2 j2 m. g- }. }' L- T (if ecolor
! Q; e& O, D& E, m2 | { v (setq col_def ecolor)
3 p! F( `! D3 l; S/ ~4 U (setq col_def 1)% K4 U$ ?/ O4 ~5 U8 l/ S/ f4 |
)
. ~1 U$ v, x8 b9 e I1 p
+ c s4 U4 r8 C" Y) ^* O; J" A6 I ;; If we're working with a single layer, get its color) Q/ S% h9 u6 P3 A" u* ?
;; for use in the color swatch if the user selects color BYLAYER.! r2 H0 |. G6 t9 p
(if (/= elayer "Varies")6 ]1 Y q+ g* r i
(setq lay_clr (cdr (assoc 62 (tblsearch "layer" elayer))))- n( I) P1 Z9 [9 M
(setq lay_clr 0)* @$ N$ a7 ~! v/ u4 V/ Q
)
( z4 D" `" h @- ]; r3 k (if (numberp (setq temp_color (acad_colordlg col_def T lay_clr)))& g" G" q& ]. U0 `# r: X
(progn
+ N8 Y0 o. E- z* E7 |# D- ]. o" n (setq ecolor temp_color)8 ]9 _9 ~& q7 H, j! R
(set_col_tile)/ x5 c z8 X6 }
ecolor
0 e) A X& y: Z/ [. B* U# d )
, i$ y; u2 m) {! n$ A) c6 {5 d ecolor/ Z$ l: ^: N/ t+ G! a. f
)
1 u5 R% _' x* G )' R; M- s% n9 m$ _ G t
;;6 B$ p: a* z/ C1 i v
;; This function pops a dialogue box consisting of a list box, image tile,
* E) i) e( X2 M8 o3 A0 Y8 `7 D5 r ;; and edit box to allow the user to select or type a linetype. It returns " Y: X- {( m8 @
;; the linetype selected.
) j( b$ b2 Y! K ;;
! G/ C; p' j8 @5 z. A; x; e! Q (defun getltype (/ old-idx ltname)
9 y% r+ R3 @2 C- i6 ` ;; Initialize a dialogue from dialogue file) p4 n8 |& q/ L: _& j
(if (not (new_dialog "setltype" dcl_id)) (exit))5 c+ S b; F4 h4 ~! G* }
(start_list "list_lt")
* u+ E5 _4 e2 F9 F. i+ q (mapcar 'add_list ltnmlst) ; initialize list box
3 o' w- l! h% n8 |5 a4 ^# ]: m (end_list)
8 u2 u# M' u- G2 z& B (setq old-idx lt-idx)
. X4 @( l' N) i& t0 i: E+ j5 e ;; Show initial ltype in image tile, list box, and edit box
; [+ @7 H0 E1 U6 w& a (if (/= lt-idx nil)
' ?4 \9 R" B+ W (ltlist_act (itoa lt-idx))
$ Y2 F3 }% V& A* L (progn% u. [7 J4 W' \7 W3 b, v
(set_tile "edit_lt" "Varies"): B9 a/ X. L4 W H" N
(col_tile "show_image" 0 nil)- \: ], |# f1 i5 ?# S
): T" e) C# m, P+ H3 t
). m! F: w1 d7 x9 }
(action_tile "list_lt" "(ltlist_act $value)")% h( V7 t8 D$ h8 \9 y3 w6 A
(action_tile "edit_lt" "(ltedit_act $value)")) Q, N/ V' M2 b: C+ q# ~+ x: G6 m: C
(action_tile "accept" "(test-ok)")
( H0 P |9 r! S. u7 A5 f" ?1 w( b (action_tile "cancel" "(reset-lt)")
5 _$ ]: f0 ~, U/ P' x! u; C (if (= (start_dialog) 1) ; User pressed OK
% v( J' g3 \* q! ~- u- g3 E- d (cond
% O! b) b- E: l% B1 k ((= lt-idx nil)
9 q3 D7 {6 s% h* V; l( \5 s (set_tile "t_ltype" "Varies")
9 |2 }2 q @* t2 G: F$ X; g# K% n "Varies"+ U1 e: i9 \' V) i
)0 F) Z! s5 [) P& U6 x
((= lt-idx 0)
' Y0 w& p( j% f/ D# H. o2 i* h& B (set_tile "t_ltype" (bylayer_lt))& x+ x [ M4 C
"BYLAYER"
% ^+ J8 z) l$ q9 t5 ` )
* ^! ] I: h7 o' U4 Q& ~: t ((= lt-idx 1): @) e0 C! C: T, v. D: u0 k
(set_tile "t_ltype" "BYBLOCK")$ M5 _# U) i0 H
"BYBLOCK"
% F8 n* K$ c1 ^( d( |( I )* `4 z' _ F0 R: E& L* Q2 U9 a
(T
" K4 p7 l |5 n (set_tile "t_ltype" ltname)
& f: j% T- ^$ C, P7 a k H& u ltname
, U6 r2 K5 q. S& ~' |1 p )
& ] j6 N' N: e$ y C )
3 u* C$ v% z1 P* R* P- a# y8 ? eltype
4 {4 u' H. {, O )* Z. E; H* V' A
)9 g( H9 @) } A
;;8 x) Q* C1 D) M9 h: J' v. d- {+ m
;; Edit box entries end up here
" ^# r% B6 R/ J$ U, J. ~' o9 o ;;% _. e& e6 _% ~- R) f9 I2 i
(defun ltedit_act (ltvalue)$ Y- ^1 V7 ^6 j% r" X8 K
;; If linetype name,is valid, then clear error string,
" O# k( E0 }/ r7 U8 f" | ;; call ltlist_act function, and change focus to list box.
* `# K0 g2 s5 \9 I7 C* @ ;; Else print error message.
3 W1 |, `6 g+ k. o (setq ltvalue (strcase ltvalue))! h" Z& J7 F4 G/ F: x
(if (or (= ltvalue "BYLAYER") (= ltvalue "BY LAYER"))' ] x- E. f# m" q* g! r9 b6 F
(setq ltvalue "BYLAYER")# D! _! R) E5 ~: Y% z
)0 {/ S& y/ c. H7 a) D u: j
(if (or (= ltvalue "BYBLOCK") (= ltvalue "BY BLOCK"))
+ C' S1 g$ ]$ t# U! a (setq ltvalue "BYBLOCK")8 l( R! }) n( W F
)
4 E2 t5 o8 v I8 d7 j$ t. P (if (setq lt-idx (getindex ltvalue ltnmlst))
$ x2 Y( \7 I# J (progn3 k: S/ k$ L9 U1 q
(set_tile "error" "") L' o: _8 C4 D s3 U# f4 T
(ltlist_act (itoa lt-idx))6 R# ?0 G5 O3 d, k
(mode_tile "list_lt" 2)3 j- O0 z T0 _/ ]
): p- }$ R( X# q4 L$ n& W: t8 C8 _" l
(progn5 n" n. o. O9 W* n9 x/ |
(if (/= ltvalue "VARIES")8 k* x1 |8 f6 B: U
(set_tile "error" "Invalid linetype.")
5 n% E8 l7 E: v )
' Y, Z3 o% I( } (setq lt-idx old-idx)- m. d" l) x6 w" J/ Y" j
)
5 u( [* h0 A0 d )
0 _1 J# e' X# N h& @2 Y8 h )
( Y4 i8 \( m% E$ X1 k ;;
* ?) l4 s6 K# k' T2 {4 A ;; List selections end up here% E- T( \1 A1 r- S* f4 b
;;* Z! `; j9 h8 k5 n
(defun ltlist_act (index / dashdata)
. u" W8 | f( o: x3 i# E) S ;; Update the list box, edit box, and color tile
, b J$ \7 r( b. Y# V& i7 Z8 z- K* I (set_tile "error" "")
( a- }& }) W3 f7 t6 k (setq lt-idx (atoi index))
+ c0 Y! r3 C/ V/ H3 k (setq ltname (nth lt-idx ltnmlst))
' k# e7 X/ j( H# F6 m& W- C (setq dashdata (nth lt-idx mdashlist))
9 _( M6 A5 P3 N! p (col_tile "show_image" 0 dashdata)$ }2 b2 p- T. h3 y* q! s/ v9 H
(set_tile "list_lt" (itoa lt-idx))1 T+ Z5 r, m. H0 |) o M1 m
(set_tile "edit_lt" ltname)
, `5 m( S% O) r6 ]+ q )2 Y( E* _! ` \! j! g3 E
;;
# t$ S+ F* H; @& h0 l& m; i9 } ;; Reset to original linetype when cancel it selected
7 i: z2 F0 U3 Y' Q0 U/ H* l ;;6 A9 m d# F: o3 Q9 Y. |6 [
(defun reset-lt ()7 A6 O) V2 S) Y8 E2 w- ?
(setq lt-idx old-idx)) o# W& x( X: J) X
(done_dialog 0)" _$ C5 o+ @6 h2 [ \) l
)2 C5 Y/ j' u! i1 a
;;8 _% B& z( W( S3 u
;; This function pops a dialogue box consisting of a list box and edit box to
5 B) P; M6 w6 | ;; allow the user to select or type a layer name. It returns the layer name ' Z$ a# t8 x$ p0 Y% q
;; selected. It also the status (On, Off, Frozen, etc.) of all layer in the
. a) W3 r4 p4 @. t' D* i ;; drawing.
. {, b, P- `9 x+ B: N0 M* O9 t: P ;;( H2 b) V8 t& w. c$ y
(defun getlayer (/ old-idx layname on off frozth linetype colname)
0 B4 F2 o$ H- C! b& S! ? ;; Load a dialogue from dialogue file
4 m f: R* c Q3 t7 H (if (not (new_dialog "setlayer" dcl_id)) (exit))
# X* V6 \7 S; } (start_list "list_lay")2 J. i# C2 b9 P% M! b4 e) }( t' `: W, F
(mapcar 'add_list longlist) ; initialize list box
; y, x) j# @; }% {8 q5 s6 V (end_list)% R/ Q! D3 t4 H% X* N
;; Display current layer, show initial layer name in edit
: [' Y- t; u1 x" o: \# ^( \6 q ;; box, and highlight list box.! V' Y' \% \, b6 C4 ~2 G
(setq old-idx lay-idx)6 ~( Z, H( A8 _
(if (/= lay-idx nil) (laylist_act (itoa lay-idx))), x7 {) C" B0 r% W/ J) u3 r0 E0 r3 b
(set_tile "cur_layer" (getvar "clayer")) ^: F4 Z! m: x; s# ] u7 e
(action_tile "list_lay" "(laylist_act $value)")& F/ t! d# X5 k J% Y; q
(action_tile "edit_lay" "(layedit_act $value)")
( c4 V- J- b' Y; F" d( R& u4 Z6 L (action_tile "accept" "(test-ok)")5 o: L" T7 L0 T2 Q
(action_tile "cancel" "(reset-lay)")0 n2 _$ A' w7 ~; i$ C# Y
(if (= (start_dialog) 1) ; User pressed OK3 Q3 _4 h4 Q, M
(progn
* K6 S, J. a H0 O. X (if (= lay-idx nil) (setq layname "Varies"))
9 f9 t6 q7 {# [8 E( d (set_tile "t_layer" layname)
: b6 F$ S( R2 I7 A- \# g4 i9 V) @7 J2 Y7 ` ; If layer or ltype equals bylayer reset their tiles$ f' Z+ j8 j6 u2 d: ]& |
(if (= lt-idx 0)8 ]9 Z- Z3 R. l W1 H3 _
(set_tile "t_ltype" (bylayer_lt))
$ N2 m0 K; o0 {, Z; E1 o6 r ): g& p7 X. R, s, l
(if (= ecolor 256)
$ R; D) t! @/ |3 i% ?" v5 u (progn
+ j0 r( r' M) B% @: ] (set_tile "t_color" (bylayer_col))
- d6 [% ]/ Q; v5 ^: d (col_tile "show_image" cn nil)& ^* c- z/ g% i0 I. x! s2 }4 n
)
$ s' b. B0 V% ]) u- E) y7 ~ j )
+ J4 n6 N' {: T* J1 L# s4 _ layname; r* N3 Y6 G: F# |8 \
)6 j( K9 s+ p* [. t% K, g
elayer
7 y, e# S2 A% y/ P )# B9 [! ?: c, H. s4 |8 m' d' L# m
)3 u, e& k2 q; {7 c8 e# D* |
;;
: C/ k: F. J3 A' U7 _- J ;; Edit box selections end up here/ [8 B/ A2 z9 |+ ~
;;
/ y0 C9 t/ d% G( E6 E (defun layedit_act (layvalue)* {" ^ P! L1 U9 n
;; Convert layer entry to upper case. If layer name is \! B! V) H5 B
;; valid, clear error string, call (laylist_act) function,6 L. W( r4 w+ q- J4 B. @1 Z
;; and change focus to list box. Else print error message., o- F; g$ I$ F
(setq layvalue (strcase layvalue))
5 Q# Q ^& X, x: e1 ?7 t( |7 s% s, O& l* n (if (setq lay-idx (getindex layvalue laynmlst))
+ Z6 w* a/ x! ~; u7 |. m: j) C (progn7 a; R0 K# D! [
(set_tile "error" "")
( H; Q7 y* |6 H R% y1 a (laylist_act (itoa lay-idx))# N( y7 U, C8 ]0 x1 g* @
)
: \8 n% A5 o& U0 P n (progn
" r6 Q8 Y$ S4 t T& |. J5 w (set_tile "error" "Invalid layer name.")
5 z" z l1 N9 V N+ ]$ |( K (setq lay-idx old-idx)
0 m' H/ V7 N1 P3 k )2 k( U! V R! G0 N
)% c d% ^% P+ Q9 d0 j( p) a7 J
)
( V/ M+ g" ]* } ;;3 ]' F- a5 r q0 X
;; List entry selections end up here
^, }: Y( I0 ]6 _( _: N4 a ;;7 M8 Z' i3 T& @& I
(defun laylist_act (index / layinfo color dashdata)$ W$ [$ p N& S# i
;; Update the list box, edit box, and color tile* V. t v5 [5 s- X8 e. l2 R
(set_tile "error" "")
0 f0 g* k: r7 W q/ O& J (setq lay-idx (atoi index))
5 J' C$ m9 _, J6 D2 \& P, I/ }" f5 M (setq layname (nth lay-idx laynmlst))
/ E/ x! p, M8 z) Z+ l i (setq layinfo (tblsearch "layer" layname))
5 t9 c0 q3 |( U8 { (if (= (logand (cdr (assoc 70 layinfo)) 4) 4)( `7 e3 K8 @5 d3 m
(set_tile "error" "Cannot change entity to locked layer.")1 j! _ z4 q. M2 O6 ]; } G5 \
(progn5 a5 k/ d: Q6 {
(setq color (cdr (assoc 62 layinfo)))3 ^8 a7 Y1 V4 G$ @9 m4 _4 l s
(setq color (abs color))
. f7 R4 r- _5 e$ t9 I (setq colname (colorname color)). k) M: v1 p4 g8 a/ F" }
(set_tile "list_lay" (itoa lay-idx))0 [2 D% q2 G- T$ W
(set_tile "edit_lay" layname)
+ X2 P& G x3 s. w5 F+ v (mode_tile "list_lay" 2)
3 l9 l# R4 b1 m4 [ )
# ]! g, D3 P3 L! ^ )
& |1 W6 W& O' Y5 C7 P8 i )
5 n2 F3 S! ]: W' A ;;5 m9 c! y5 m2 _# f
;; Reset to original layer when cancel is selected3 w; D% X3 S& c9 A, ~& Z A
;;
) f8 X3 [9 p- |9 ~: P; a (defun reset-lay ()
: c ^+ s$ _" m; H# F (setq lay-idx old-idx)
. u5 J; a, R% O; Q( o (done_dialog 0)
2 N. _. n' I- `# q8 o' b )
, _9 b7 g5 I8 h2 s ;;
7 d! v6 y- O2 G' |4 X$ ^ ;; Checks validity of thickness from edit box. Since (atof) returns 0 when a
5 ? w+ p) L2 { ;; string can't be converted to a real, this routine checks if the first
( y6 b8 l1 m8 v6 ] ;; character is "0". It also checks to see if the value equals "Varies".! S1 d* `! d8 [9 s
;;
- q8 c5 u# V5 ?) `1 M6 O6 p (defun getthickness (value)
5 o' ~2 L! W. ~! }3 q (setq value (strcase value))
3 I1 s. @# n3 j0 E- X5 X9 o2 c (if (or (= value "VARIES")9 n! b5 ]1 M' e6 h% v3 ?
(distof value)" K& X0 C Z6 ]. z, v
)* Y4 J" e8 e: U! H
(progn
) {1 n' ^4 i. _# q (set_tile "error" "")3 x5 ~1 {+ R: [1 c
(if (= value "VARIES")+ K7 ?1 G) E! ~( r x _; h. ?
(progn
/ B1 H$ p( T# ]( E (set_tile "eb_thickness" "Varies")+ k8 ^$ G" T: ]4 L
(setq ethickness nil)
6 G5 ] j( [" x! B# E* j2 X )
; I/ B! J t0 n" }- Q0 C8 i( \ (progn' `+ F8 x; u0 T: L7 n9 m
(setq ethickness (distof value))$ ~, T, m0 z) v; |" s @, R8 `3 s+ g
(set_tile "eb_thickness" (rtos ethickness))6 d0 m$ g$ h9 c' @+ G) l% Q+ C
ethickness
% i* a, b! i8 r )
2 r) b* @/ C$ x- ^7 X )8 k; g a t& Z" Q$ i$ D
)
* Y) H; h0 L% U: A1 F! A( q# J8 r (progn
; q8 }: ]3 @+ K) F* D& z (set_tile "error" "Invalid thickness.")
& v2 J3 d) ~4 Q |3 s d, u nil1 F% c. B. S" _! P* z9 k. e
)
( ?3 d/ X/ [- k9 R Z* H )* D6 ~% R5 K5 X/ P2 M. d3 ~
)" m4 y/ H: u! B
;;
" Y6 z4 O- z0 [ ;; This function make a list called laynmlst which consists of all the layer + B" C) j2 r4 l) Q. F7 o2 f/ m$ {
;; names in the drawing. It also creates a list called longlist which
+ \/ b, @2 y9 m ;; consists of strings which contain the layer name, color, linetype, etc. 5 P$ V2 {( ~! S# S! ^2 c
;; Longlist is later mapped into the layer listbox. Both are ordered the
) T6 [' s7 ]3 R; x% i$ h; ?: T ;; same.
0 D3 n0 a$ b/ r* U5 ?* n ;;
% F5 C5 L! M+ T (defun makelaylists (/ layname onoff frozth color linetype vpf vpn ss cvpname
1 U \. M8 V3 I xdlist vpldata sortlist name templist bit-70+ R; Q& p3 z, G' N! E3 k2 r
)$ i4 u7 v/ a! _' H
(if (= (setq tilemode (getvar "tilemode")) 0): |1 @$ J" t* L& A/ F1 {8 E" Q O5 Y
(progn
4 m6 h) A! @& ]. }4 Y3 [1 X (setq ss (ssget "x" (list (cons 0 "VIEWPORT")
! B% C* v O3 l& _; f9 B (cons 69 (getvar "CVPORT")). A, [# e/ a; K" y { k
)
$ |! m4 n' M8 w6 v: E )
6 T% d1 M: G! X# H# V: B- g )
5 b2 \5 m" M! w4 x( x! T: w2 { (setq cvpname (ssname ss 0))% _8 n2 N% Q6 t, t8 D$ f. p- N" q
(setq xdlist (assoc -3 (entget cvpname '("acad"))))4 m1 R6 S" A5 }+ |
(setq vpldata (cdadr xdlist))) B; `4 D6 a4 J4 K1 A
); p$ I! Y' y) y+ g- o8 G5 r
)
1 j8 P9 ~1 `# a (setq sortlist nil)
6 z+ H2 t" O0 |8 g1 g, J& U% f (setq templist (tblnext "LAYER" T))
2 P( `$ a+ ?5 `- x) O& @ (while templist
2 e& j' G& T! z' U2 k (setq name (cdr (assoc 2 templist)))$ F' _& \0 m2 p# h+ N/ r9 S1 |
(setq sortlist (cons name sortlist))
9 C- M& T8 E2 p& p2 |# D2 t (setq templist (tblnext "LAYER"))% Y/ A- w) C( y7 c' M4 J
)
- T5 A; G( p$ f9 K/ B' ^0 { (if (>= (getvar "maxsort") (length sortlist))0 M6 D: a. _6 u$ f
(setq sortlist (acad_strlsort sortlist))
% V- Y% B6 I& I; H% Z- _* Q; { (setq sortlist (reverse sortlist))
" Z8 z( E8 Q2 }) j, R/ v6 L6 I )/ k0 p( c% W) P5 T9 c/ M& i$ a. b
(setq laynmlst sortlist)' B) U6 ` V) w( ^, \3 I' s
(setq longlist nil)
\: ?+ X ?; z9 h7 S (setq layname (car sortlist))
' J: d" Z( |8 J2 \4 r (while layname9 R) C# l8 S! E* F9 F6 F1 a0 x
(setq laylist (tblsearch "LAYER" layname))
2 [$ E: p4 W- ^6 q& h) K (setq color (cdr (assoc 62 laylist)))
/ ?* C# B" d) c/ p: n9 g (if (minusp color)
' o2 [- N I0 ]9 {2 | (setq onoff ".")
/ V C+ W% {* {6 e, ~* F } (setq onoff "On")
4 c# S; n; Z7 W )9 ^& ?# y5 X I7 I7 t' m4 T
(setq color (abs color))# I7 p9 B/ |0 I3 w$ G
(setq colname (colorname color))' c9 e8 M, N9 ^# R% ?9 j
(setq bit-70 (cdr (assoc 70 laylist)))
8 n y' O/ e5 B$ i% g x (if (= (logand bit-70 1) 1)9 d% U+ g E: G0 @
(setq frozth "F" fchk laylist), w% l$ Y/ i6 g, |6 e: r
(setq frozth ".")
+ [1 O0 h- ? F& r; y )3 `& B) }& I% F* C4 e$ o
(if (= (logand bit-70 2) 2)( n! ?+ O* N! b3 w0 p, M
(setq vpn "N")
/ u9 I$ G4 L" [. @ j0 t( n (setq vpn ".")( c- z' `/ b" T$ J$ t8 H
)
- @ e3 x1 b1 p" z (if (= (logand bit-70 4) 4)
3 _. k# Y+ P/ `3 V6 V, l (setq lock "L")
% W l1 `, T% K6 K: Y (setq lock ".")
" w+ A/ N( {; G! u4 O& U: n )
* E1 H: d3 q* ~ (setq linetype (cdr (assoc 6 laylist)))9 V! a4 e8 E8 `. v- r
(setq layname (substr layname 1 31))
. v% \/ C* I$ p9 [% q (if (= tilemode 0)9 Z5 o5 |+ T2 r$ N4 W3 W0 `
(progn
7 m/ C8 A0 G# \3 w; f (if (member (cons 1003 layname) vpldata)
3 i2 U5 c. J9 r8 h$ e& P( M (setq vpf "C")/ w" @" `3 M: \6 M
(setq vpf ".")# I, I" r' `2 q/ h1 m
)
, E7 M2 Y/ y4 g/ w% _& U: r. D )& ^) v6 h! f7 g
(setq vpf ".")
9 H: T1 V7 P/ M/ ~' H) R, | )
8 p1 J( j9 a! P {4 f (setq ltabstr (strcat layname "\t"
7 n3 z: s6 F3 }. {/ S3 V+ b onoff "\t"
7 S3 h# W* E) y+ i2 j* v6 B7 g0 v frozth "\t"
! V& Q: m1 J" }7 G! B7 t lock "\t"5 K0 j; l5 _7 `8 S4 U5 p' o
vpf "\t", O, _) x2 E% J' C% z
vpn "\t"
# l5 `9 s( p K, p3 Z3 t, R% C- l colname "\t"
6 D; `: l$ u' b* H- M- U9 b7 X) n linetype
9 D7 a- w/ `$ n )* ~8 W; y3 a9 @+ G3 s7 W; M( I
)
% s, Z! y/ k; F$ G" t (setq longlist (append longlist (list ltabstr)))+ l f1 P. ~% x& W; j
(setq sortlist (cdr sortlist))
: I1 d( r, x0 `- H (setq layname (car sortlist))
; j+ R/ V n, G4 ^ )3 d5 D1 | k/ N* j% J, W& x3 |$ x
)
* n9 n3 D; o7 i* i5 ~+ @ ;;
) K. V" u1 n- t/ X" S8 o% \4 e ;; This function makes 2 lists - ltnmlst & mdashlist. Ltnmlst is a list of
$ V& c7 i& K# {3 P; `4 w ;; linetype names read from the symbol table. Mdashlist is list consisting
h0 G0 H8 H6 t ;; of lists which define the linetype pattern - numbers that indicate dots,
. d0 A# N0 O" x2 u! v" S: K+ s ;; dashes, and spaces taken from group code 49. The list corresponds to the # `4 ?% E3 c5 Q1 d5 T& q
;; order of names in ltnmlst.
' X0 f3 I1 ^: |1 x+ v# s ;;
# I5 B2 ^% @1 P+ _/ U# N (defun makeltlists (/ ltlist ltname)
& y( s1 H7 y8 t) n# e/ U (setq mdashlist nil)
- B0 i* F& F- w* { (setq ltlist (tblnext "LTYPE" T))
. f; ] M1 ]2 D: H7 V, L Q (setq ltname (cdr (assoc 2 ltlist)))) m7 W; p, y4 O! Z& g. L. X
(setq ltnmlst (list ltname))
# c, t# S$ z( w* ]) T$ }+ x9 h3 L. x, v, A% E) x7 W
(if (= ltname "CONTINUOUS")$ f0 z& B! L, n. j* \
(setq mdashlist (list "CONT"))
) N ]2 K- P: V u4 @3 ^, G% C. b (setq mdashlist ' k% u6 }( n$ u) }
(append mdashlist (list (add-mdash ltlist)))
& V1 d9 B. N& |. Z7 Y5 V+ v8 H/ R) Q# } )
. M' `, o' F$ H) Z )! L+ |9 c2 W+ f7 H
(while (setq ltlist (tblnext "LTYPE"))
2 v/ l% v3 l2 K, }, d (setq ltname (cdr (assoc 2 ltlist)))5 F l/ S. y: I4 r& }
(setq ltnmlst (append ltnmlst (list ltname)))
# p. E! {4 B% f: x7 x2 }# B (setq mdashlist
. m; y% Q/ R- d Y (append mdashlist (list (add-mdash ltlist)))1 j% }" \* T& ?& `" _3 K% r7 C
)
4 |/ l" ]" D" s. k/ m) \ )6 t) u7 J5 p1 D$ v
(setq ltnmlst (cons "BYBLOCK" ltnmlst)): k: @: T* \/ m* e) p! C) J
(setq mdashlist (cons nil mdashlist))# q8 O; D8 T, ]
(setq ltnmlst (cons "BYLAYER" ltnmlst))
* p5 F: _6 o5 I! h (setq mdashlist (cons nil mdashlist))
6 n' P$ p7 u+ k: n6 G )& L. V) }$ ^+ G7 l1 a7 `
;;
' l, G6 p' Y+ k1 \ Y7 ` ;; Get all the group code 49 values for a linetype and put them in a list
4 }( C/ O3 A1 _4 J$ c ;; (pen-up, pen-down info)
6 G- t% c4 I; w' P8 M ;;
9 z+ Z$ N5 |+ V3 `+ m9 O$ q c (defun add-mdash (ltlist1 / dashlist assoclist dashsize)
% V3 k7 j2 d& O- B0 K2 R7 u# ? (setq dashlist nil)2 T7 g& e; X2 f1 I/ R! \, m2 P3 l
(while (setq assoclist (car ltlist1))* `. T6 l/ O$ E
(if (= (car assoclist) 49); y/ u3 o* [& ?# C% W9 B8 F
(progn5 j! n; A( I" ~. w
(setq dashsize (cdr assoclist))6 n. m" x" B' K: `% A* y
(setq dashlist (cons dashsize dashlist))0 @; x7 y8 v$ Y- f& H7 G
)5 \, b- X" p; w3 y5 {" a, L
)
2 {( B3 w. ~2 F- m7 h2 n: Z (setq ltlist1 (cdr ltlist1))& Q" f( r1 b U9 t1 u- C: w
) B% K* k8 i6 m) ^" r2 v7 K6 ~+ r* m
(setq dashlist (reverse dashlist))7 s& p& S/ g7 D* s- _. ]) A
)7 j* N7 q& {. H3 n& {& s! Q
;;8 B, g0 m! X1 r0 @
;; Color a tile, draw linetype, and draw a border around it- J9 K1 `$ {; v0 ]
;;
; i$ M! S1 x5 [! Y" s# I3 j: e (defun col_tile (tile color patlist / x y)
' x- F' x# M& u4 K+ Q7 W$ b' y8 k (setq x (dimx_tile tile))2 K" p( ^2 n( C1 B- b- h' P
(setq y (dimy_tile tile))
1 V+ W: B* S+ |. B! T (start_image tile), X( O; A8 U8 j0 ], o
(fill_image 0 0 x y color)4 g3 Y! F0 ]8 P7 ~3 s
(if (= color 7)
( s! N1 H7 H$ A# d5 [- y( h0 h (progn8 J4 r9 [! g! { v
(if patlist (drawpattern x (/ y 2) patlist 0))
2 {' z' h. z5 c, T# C, K# h (tile_rect 0 0 x y 0)- ~% J% Q; v7 a5 M% h W" p
)
( E8 ~( D" Y) _6 {) \0 r (progn( [0 G2 t7 f1 } [. F
(if patlist (drawpattern x (/ y 2) patlist 7))) t* u1 |$ \) j$ T8 k' F# _" l
(tile_rect 0 0 x y 7)
& l, S6 g5 X" i4 O$ D4 \ )
1 ]! }9 W5 T, I$ y- F' K7 ~3 F ). Z8 P: N0 L6 S+ p, p
(end_image)
. \- C& L" A; d )3 G+ I A/ E; @% G5 e8 K
;;4 W: g- b8 Z$ m1 O: J1 q8 f
;; Draw a border around a tile
U5 M5 ]$ _2 B& f" B0 ^* ^ ;;4 C9 |* O1 ?) n% H& l( \/ D
(defun tile_rect (x1 y1 x2 y2 color)
$ ?* k/ r0 F0 K: { (setq x2 (- x2 1))
3 K6 r/ K5 t& z (setq y2 (- y2 1))
( i5 w7 d6 B" U- ?6 { (vector_image x1 y1 x2 y1 color)
. Z- ? c1 k$ v s) W8 H6 C, S; | (vector_image x2 y1 x2 y2 color)
N* ?- J4 i* p+ G6 a (vector_image x2 y2 x1 y2 color). G* d1 A. Q p4 v3 e/ R+ q
(vector_image x1 y2 x1 y1 color)9 r+ o% `0 a& z0 |3 v& U
)
9 E3 I3 O5 h* ^0 N, ^ ;;: A7 h4 q- e& X w3 @
;; Draw the linetype pattern in a tile. Boxlength is the length of the image ! I/ j b: J% M
;; tile, y2 is the midpoint of the height of the image tile, pattern is a ' {. r- z$ o5 J+ b+ g( @2 L" p
;; list of numbers that define the linetype, and color is the color of the
) A7 ~, m9 N" j* B% i, `+ ? ;; tile.
# Z* j2 T8 D- ~, Y2 ~( Z5 X+ B ;;- R* s/ p% ^- X, [+ D, r9 A: S
(defun drawpattern (boxlength y2 pattern color / x1 x2
. k# @3 r8 X& k1 i/ f' R patlist dash)$ U6 A6 u$ ]% B0 f" q& n# Y0 ^& P
(setq x1 0 x2 0)" ~9 T2 W0 o+ N. O. I- }
(setq patlist pattern)
$ S1 K7 j% B. r ~/ s2 p* U (if (= patlist "CONT")* B; `$ W U4 f. Y8 z% E, f
(progn 2 w ?8 [+ p! U* k" Y
(setq dash boxlength)
+ K1 M) G2 o. n (vi), s1 |6 _" r( N# [4 \
(setq x1 boxlength)# @4 b; y( }( T- J
)7 ]5 o4 d7 I% x1 i7 E; o* o$ W
)' I. }9 G2 {: Y: x" V- R, x: C8 ]
(while (< x1 boxlength)" A; \" g' O; x% }6 e5 } M2 f' t
(if (setq dash (car patlist))
! w3 l1 [0 _4 F (progn+ x7 o( ]/ f; }1 P% u
(setq dash (fix (* 30 dash)))
2 p% D3 B0 z' M/ X! t (cond
, |, ] j$ w5 X1 e* r ((= dash 0) / p5 y) w; J4 M$ t9 S P2 p) ^
(setq dash 1)
' m( x g% N7 x0 R (vi)
- U% K. {7 M1 e )- U& V t( j* X1 T; s: X
((> dash 0)
4 d0 E: e* J. M* \" v( b& |! i (vi)" [' {3 n/ k$ B5 u& {5 u- E
)& U$ V) X1 p$ ?& b6 F1 R* N; d, n
(T - Y) {5 O$ E) b
(if (< (abs dash) 2) (setq dash 2))8 g" }% G& T) [
(setq x2 (+ x2 (abs dash)))8 O7 j( }& c+ k0 v s! C- S
)
" z; t6 \# r* C# ]3 W0 j )' D2 t. I# H6 x0 N3 W9 e6 i
(setq patlist (cdr patlist))* f2 R8 E- }# \2 P! W( S8 S7 [9 \
(setq x1 x2)
* { [" ^ @$ `. u X9 l$ n/ j )2 J( J. S+ }, A3 M% b' K
(setq patlist pattern)
) s$ N: w6 E: d: B )( D/ i; d6 E/ h' V1 x
)! l& S" _; ?8 ^7 s
)
0 N5 B b$ m5 {6 Y; P ;;, {6 r$ b. S2 p; C0 h: p8 S6 A" `
;; Draw a dash or dot in image tile. n; V3 z9 J- m9 P4 U0 c" n, J. @
;;
% [: N+ R) F. |1 K" J (defun vi ()
' z2 S+ g4 G% T- \ (setq x2 (+ x2 dash))' O6 H- P. v1 q: @& w
(vector_image x1 y2 x2 y2 color)% R s( a3 l$ ^4 r
)
: v' o: P& Z: V) E7 u ;;
- y" |$ L2 }8 Q4 X+ X9 B ;; This function takes a selection and returns a list of the color, linetype, |3 l! L: Z- T/ n8 a) w2 f
;; layer, and thickness properties that are common to every entities in the9 o/ H" N- C% X5 Z# @( h) g& O
;; selection set - (color linetype layer thickness). If all entities do not ! l' f: D- n4 M' I/ K( @" F- B
;; share the same property value it returns "Varies" in place of the
: {' q+ U$ C$ Z$ [. w0 ~+ P. U& r- a: T ;; property value. i.e. ("BYLAYER" "DASHED" "Varies" 0)3 P+ R: ?5 S) D# G; U* U. p
;;
7 g* Z- J; Q: |! n' L8 l (defun getprops (selset / sslen elist color ltype layer' i" A+ d& U- ^; o; }& C7 c! B
thickness go chk-col chk-lt chk-lay chk-th ctr)
M4 F1 C% j G. @) m9 a6 ? (setq sslen (sslength selset))5 p3 N* D8 R; N
(setq elist (entget (ssname selset 0)))
' Z" o! c3 D) A0 m (setq color (cdr (assoc 62 elist)))
A/ V1 t Z, P+ s# `! ~- w (if (not color) (setq color 256))& z5 G) _% y, r
(setq ltype (cdr (assoc 6 elist)))
3 r6 b7 Z' y5 v3 X. ] (if (not ltype) (setq ltype "BYLAYER"))3 I9 F1 w" q4 Y" J
(setq layer (cdr (assoc 8 elist)))
5 d: X5 e: q( n6 L+ _8 e. w4 G (setq thickness (cdr (assoc 39 elist)))
' v2 I+ h: ^% j- W8 Q (if (not thickness) (setq thickness 0))
+ H: k r2 [( _/ @, P9 E (setq go T chk-col T chk-lt T chk-lay T chk-th T ctr 1)
1 Y2 e- c N S5 J% h, x5 w: E% ^, _, B- P- e7 p9 H6 T) _6 @- G/ t0 |5 l
;; Page through the selection set. When a property3 @/ J2 a' k5 x& D$ @
;; does not match, stop checking for that property.. l% Y! S' i. Q# T/ m. r
;; If all properties vary, stop paging.
! k- f/ ?1 ]* v0 }; w& }. i1 T! M+ F) I8 C8 }6 c2 t( P
(while (and (> sslen ctr) go)* ?8 @! Z! Q8 X9 g
(setq elist (entget (setq en (ssname selset ctr)))) G, T% B" C' B
(if chk-col (match-col))+ o0 P8 { M$ ^4 T: u: C7 G1 D; o
(if chk-lt (match-lt))
* @8 U. ^" b0 Y; c (if chk-lay (match-lay))
8 V' J& n8 S4 X/ } (if chk-th (match-th))9 o( c. ]) D# w" W2 V8 h
(setq ctr (1+ ctr))/ t& x& L9 l( G+ R9 e O# S7 U
(if (and (not chk-col) (not chk-lt) (not chk-lay) (not chk-th))* m9 u R4 L+ P( ^: G: v6 q
(setq go nil)
0 R' X! w, h) h! v& v )0 Q0 z7 [3 \; D T* b/ ]2 B- O6 S
)
, m& Q& d/ S" h3 d' B (list color ltype layer thickness)
/ ?6 I% A7 q- L4 X )
$ S* V7 U" B( S5 A1 X
7 } F7 B: ^" F @3 x" I8 W$ } (defun match-col (/ ncolor)
$ I) \8 B4 I) v (setq ncolor (cdr (assoc 62 elist))), i+ x% x/ S9 E
(if (not ncolor) (setq ncolor 256))6 k) D- u" H* u3 a
(if (/= color ncolor)
; m) K( a7 L; S1 C6 a; j (progn
+ r- E$ R! {; z f0 Q (setq chk-col nil)
7 P9 P/ i: d1 q0 x# w0 k (setq color nil)
3 r V/ {2 W* y2 ^ )% f6 j( N/ H8 n! s4 f6 N
)
! r" h/ k$ Y& T' w) r )( o3 X x" [* V, t4 h, b6 R
& N/ ]0 W: e! T( s$ X (defun match-lt (/ nltype)+ }4 A( k Q1 }: i
(setq nltype (cdr (assoc 6 elist)))
* J# m1 z" ?- |- ] (if (not nltype) (setq nltype "BYLAYER"))9 u3 D2 S, R" J \& X
(if (/= ltype nltype)
6 p8 O7 p# @0 x& I5 T" w ] (progn
+ c1 n4 z4 V$ G (setq chk-lt nil)" J3 Y+ J* R" `* U7 \
(setq ltype "Varies")
4 ~# I4 P$ f$ i )4 a3 R6 {3 F- B K2 P
)
; L2 @6 @, `' \1 y$ |7 R )
) R$ W) t1 M) _" i% M9 b! L) O" D ?: s) A
(defun match-lay (/ nlayer)' r4 K, R* J8 a6 } F( j/ t
(setq nlayer (cdr (assoc 8 elist)))* ?1 X7 N( X% ?6 Y; @* h
(if (/= layer nlayer)
, j, J/ q8 ~) A* `7 `# h7 @ (progn
- { q1 ~+ C2 L4 n" A (setq chk-lay nil)" |6 Q& X% B% H. i0 D3 n
(setq layer "Varies"): T# u- D7 k+ V- [' X1 t5 {/ ]! E- H
)$ {* _6 u6 ?' |6 l; O0 H J
), f7 f* z6 L' _# d5 T. I0 r
)
0 B8 K! f' X1 K/ l4 E# k' z$ M/ ?- ~ ]( Y) L" u4 w
(defun match-th (/ nthickness); t( u5 L1 {0 m K1 I$ D ?! z
(setq nthickness (cdr (assoc 39 elist)))$ G' | F8 T# J) c2 p: {
(if (not nthickness) (setq nthickness 0))
8 z4 [9 N2 }9 S0 U0 A (if (/= thickness nthickness)
$ h. K/ A- K B- S$ [& I) E) V (progn
( @; G2 g6 _0 I$ R (setq chk-th nil)
W4 g( ?" E! T8 W9 z; p4 j3 T (setq thickness "Varies")
* r9 {( r r1 m; W )1 M4 r% j" L- X- [% \
)/ t( F8 x+ ^/ X- I1 A
)3 b9 a) j# E$ I, b( F( d9 F* K
( T% ?% e8 W$ ]3 Z* q$ w; W
;;
3 @- ~3 T7 y$ U' j! r# V; q7 j6 ^ ;; If an item is a member of the list, then return its index number, else
; \* ~/ X# Q8 N: ^, f6 ]% Q ;; return nil.
8 H. w3 c: F: b3 c. W ;;3 p# M- |* H0 A% d9 T/ }* J
(defun getindex (item itemlist / m n)
& J1 S5 q; v2 _4 S' ?! T (setq n (length itemlist))& a+ v W% M7 l
(if (> (setq m (length (member item itemlist))) 0)
! V9 ~2 j7 ?8 V( Y1 n# Q (- n m)9 b2 v; @: z" ~, A4 T
nil
" X( ^! ^% \0 m' K7 | o8 V' C )/ q3 p" k. O$ \/ Z( ?
)
& X% ^: _4 F/ T* ~. z5 {2 C& b ;;9 d1 h; S' Z! X+ c
;; This function is called if the linetype is set "BYLAYER". It finds the % ?, e; T" g" \# K
;; ltype of the layer so it can be displayed beside the linetype button.
) K/ h6 j- k1 e3 @ ;;/ y5 P8 m5 g5 h! L9 W: n
(defun bylayer_lt (/ layname layinfo ltype)
* n: t! Y8 m8 c2 U (if lay-idx
' w! K* w: m/ Y9 Z9 S. E8 i; J (progn
" I6 u! R; V* l( |& _ (setq layname (nth lay-idx laynmlst))
" S( \6 Y `' Y+ h (setq layinfo (tblsearch "layer" layname))
) S. c" Q- f$ P# \" a m (setq ltype (cdr (assoc 6 layinfo)))8 B' K0 D' d1 c
(strcat "BYLAYER (" ltype ")")7 @8 K2 M' Y1 R1 x. K, n% }: v* e6 T
)
, A0 U& N# Y! \( N& ^/ H4 ]! C "BYLAYER"
& X B% t! c, h; s8 U )
( K$ z3 {# E! \- h )
7 V% ?4 C. {- x& P/ O/ e7 N. [ ;;
# z; A7 L7 _8 ^8 h/ r. x+ h. | ;; This function is called if the color is set "BYLAYER". It finds the
8 T" I- E: |$ l; N1 s, V ;; color of the layer so it can be displayed beside the color button.
% @' S$ \9 {7 Z; b. L9 | ;;/ q# |' D# k8 X- [
(defun bylayer_col (/ layname layinfo color)- J* ~5 E r, o. Z! u8 G
(if lay-idx
) e% T4 v0 I. o* e$ r% s (progn
( s9 t8 N- s% V' I7 | (setq layname (nth lay-idx laynmlst))( u' d: b- ]" z' e5 S
(setq layinfo (tblsearch "layer" layname))
6 v' t: g0 l9 z D' j. h0 w0 ?( z (setq color (abs (cdr (assoc 62 layinfo))))* u+ }% Z" s9 H3 q
(setq cn color)! ~( ^) E0 X3 l1 M9 j, \% a
(strcat "BYLAYER (" (colorname color) ")")
: Y, o! ~: T9 i+ u )
1 k# y# N4 N; E. E; Q: X5 {1 n) Y% { (progn
6 I+ F5 P+ f& L& _ (setq cn 0)
5 P; e( b y0 p+ M. B* f6 Y. L "BYLAYER"% ^+ M! I8 g" k
)# R0 o8 j) d& f' }2 G% c. B
)
' m" D# Z$ P( A3 N )( k( t4 t) A% ^; Y! g' o; |1 f
;;
% i0 j+ b/ X0 y9 d$ r ;; If there is no error message, then close the dialogue* e1 u1 M g+ T Z& } R5 e, N
;; {) M; }2 T* {; [# ?& A
;; If there is an error message, then set focus to the tile
7 T/ P8 `/ }2 t* A. K! T ;; that's associated with the error message., ~5 U9 {' U8 H2 C& ~2 Y
;;
3 Q" v0 j' j6 q3 G% Z (defun test-ok ( / errtile)3 S6 I, Y- I/ a4 m& J4 i8 U# E% S
(setq errtile (get_tile "error"))
: E H. \: f, }$ A (cond
: `! q! d$ p; X ( (= errtile "")
8 D/ \! k% h: ^. c/ B (done_dialog 1))4 S, j" S3 e2 S$ |
( (= errtile "Invalid thickness.")& e; |% }) t( M
(mode_tile "eb_thickness" 2))8 U* r! X N$ o' U; ?
)
/ P& b- V# m; N" f5 U )
) u* }0 V$ M8 j* b8 t2 Z) T* x, g& o ;;/ V/ _! ?/ x! D- ]( C" \
;; A color function used by getlayer.) a1 Q/ a: {6 _9 G! U0 G# p
;;0 C9 }% h2 }9 x9 V0 P/ O
(defun colorname (colnum)3 u9 l$ d# A" k; ^ ~, v- f
(setq cn (abs colnum))# L* p$ k! A0 N) R7 K3 }4 H
(cond ((= cn 1) "red")
: j2 b; s$ M( G ((= cn 2) "yellow")
# i+ ]9 W" ^6 } ((= cn 3) "green")9 B" u# E5 B. P) J
((= cn 4) "cyan")6 [& v# ~- A2 T5 X7 H* d
((= cn 5) "blue")
# x& D4 k- c& O5 p) U ((= cn 6) "magenta")& w) V$ a3 O3 u% l: x$ ~2 d
((= cn 7) "white")
" L3 I# a- r) I (T (itoa cn))$ V: l5 A/ E7 f, z
)! ` ?( w: S: V! I, \
)$ {7 E \( T" y+ |4 @& m$ d
8 s; l2 X: K4 {- r1 Q;;; Construct layer and ltype lists and initialize all) g1 p3 L% F( s% P$ a% g
;;; program variables:1 d& d4 o# J" M! q/ [
8 u& R) S' _6 v; ^* y (makelaylists) ; layer list - laynmlst- U4 U$ m& Z- P3 n/ F- H5 l
(makeltlists) ; linetype lists - ltnmlst, mdashlist- H7 Z8 m" D7 e2 h' X4 `. |
;; Find the property values of the selection set.
" v; `7 u' Z, } A% F" a( l2 U ;; (getprops ss) returns a list of properties from+ M8 q* ]- {, l
;; a selection set - (color ltype layer thickness).
% e, h. x" I5 j2 o# F5 O (setq proplist (getprops ss))
0 q4 V7 S9 ], M (setq ecolor (car proplist))- S" q/ O# V" O0 ~2 t& ^0 }/ U$ E
(setq eltype (cadr proplist))' w: r6 [% R; S- K3 F( f' Q
(setq elayer (caddr proplist))
H* ~ Q6 W6 W (setq ethickness (cadddr proplist)) p. a, W5 E( Q, V
;; Find index of linetype, and layer lists
' W$ @% P1 ? A) A. v4 n (cond% ]1 A8 K+ a# ~' \& v
((= eltype "Varies") (setq lt-idx nil))
, J# m5 h3 v) x3 E4 q; ((= eltype "BYLAYER") (setq lt-idx (getindex "BYLAYER" ltnmlst)))" B R9 J J. e. j5 N1 h
; ((= eltype "BYBLOCK") (setq lt-idx (getindex "BYBLOCK" ltnmlst)))
" \2 r- h# h- p (T (setq lt-idx (getindex eltype ltnmlst)))* G: v v2 s! h+ ~* u
)
' O* v% W4 H0 Z; ^/ O$ ]4 f (if (= elayer "Varies")5 _/ y' c6 L) r; O. ^
(setq lay-idx nil)
U8 _3 D' H% V; p3 d3 s+ V. H (setq lay-idx (getindex elayer laynmlst))
3 }4 ~0 q' L9 }; p1 {4 L )5 W k% H' M' ^
(if (= ethickness "Varies")5 L, Y7 k9 W' V" e5 N6 M* L
(setq ethickness nil). Y t, Q6 a2 E( ~# V
)( w7 W" i2 T% C2 O
' y9 t" w/ m. M( y) ; end (ddchprop_init)( T& v4 `$ m9 }; Z0 a% H8 C( B
. U! D$ ~& n- N0 g* {; i4 H# p7 p
;;; (ddchprop_select)
% l5 j0 f A% c+ u% n0 J;;;
0 q c, |9 n% ^2 B% `+ ?$ A;;; Aquires selection set for DDCHPROP, in one of three ways:
; b- ~! v9 X4 ~2 ^1 ~& u: H7 c;;;$ Z R* N8 k) m; D: I
;;; 1 - Autoselected.
. d; d/ w0 P" {/ ~;;; 2 - Prompted for.; h- z7 Q- g# [- G
;;; 3 - Passed as an argument in a call to (ddchprop <ss> )8 q( G! G' _7 ?* z1 i6 F
;;;4 p! u: @# W* p; q4 q) P
;;; The (ddchprop_select) function also sets the value of the6 w/ x; T, h& r) }8 m8 ~
;;; global symbol AI_SELTYPE to one of the above three values to5 Z# `4 O! y& h) L0 B
;;; indicate the method thru which the entity was aquired.
$ \) N T: U* ^: p' _ v7 e6 L' I; n" J( [9 h
; j8 D9 |: f! Q* m8 ~% B4 Y4 E1 O7 J
(defun ddchprop_select ()5 v' w. T. ~% y' X
(cond
8 G( T5 w% j) d3 V2 S- \ ( (and ss (eq (type ss) 'pickset)) ; selection set passed to' b c l5 M% U) J0 k
(cond ; (ddchprop) as argument
( y6 E( Q! C$ C ( (not (zerop (sslength ss))) ; If not empty, then
4 u( n6 @6 E! J; A( A) d (setq ai_seltype 3) ; then return pickset.
+ h6 i& b8 e7 b (ai_return ss))))
) \0 b7 U' u% C# E# j y6 J
* N0 t: x1 Q0 U) m9 K1 C1 r ( (ai_aselect)) ; Use current selection9 E9 k* D2 o8 Z" n1 t
; set or prompt for objects! r& Z% P! t/ w2 K
. j& {" H' p0 f+ p4 W( H
(t (princ "\nNothing selected.")4 p0 A7 d& @) n+ K% p9 J0 f. z
(ai_return nil))6 B P# c1 s$ r- r
)
1 N/ X8 i2 Z" C f* ?5 r, H$ m% I)& F. `' C! w: n- m; ?: u7 l
) u+ ?. ?6 n- i; Z
;;; Define command function.
/ B' B# p, a1 V* K0 P
+ [: g. z. n( p z/ J8 y6 G(defun C:CH ()
, H1 x6 g0 K1 ]6 I (ddchprop nil)/ o m6 i+ _& h/ P
(princ)3 n" |8 a, C _/ q
)
o6 T. ]6 J% x o$ H7 t( s) i) G& [0 F5 } `# j# n( m5 D
0 p# Y( r: X3 m! a, m0 o' P0 ]* d;;; Main program function - callable as a subroutine.
/ F0 B/ V9 I! A; q6 d;;;
. ]4 a# [5 @9 Y8 };;; (ddchprop <pickset> )5 s* U6 y+ U/ O2 _9 r: p+ a! X
;;;- J# z1 C% M6 u- A6 K# k+ }
;;; <pickset> is the selection set of objects to be changed.8 }: Z$ ?- Y+ O6 `
;;;
' f6 {) b( K# ~* g6 ?4 }6 k;;; If <pickset> is nil, then the current selection set is& p; O% [5 w, { }# u/ C
;;; aquired, if one exists. Otherwise, the user is prompted
4 s; |" J3 M- q3 j; ?;;; to select the objects to be changed.0 M- n |/ x: v3 }& P
;;;
) x4 r6 _8 ?& Z! c;;; Before (ddchprop) can be called as a subroutine, it must K$ R' w* L# r8 P+ \/ ~: B
;;; be loaded first. It is up to the calling application to
# P( @9 I' V$ K; H' e0 v;;; first determine this, and load it if necessary.' J. s2 N `8 c
8 j; j+ ?) {3 _0 T% t$ Y7 L
(defun ddchprop (ss /
1 m7 Z" W3 N' R$ X, b2 D; F/ s8 P0 }0 |8 G+ m n Z
add-mdash ecolor ltedit_act s, W. l: g. {# k0 M: Y
assoclist elayer ltidx selset9 d8 N7 e* y9 }6 g: \
bit-70 elist ltlist set_col_tile8 p5 h ^8 V4 B: `
boxlength eltype ltlist1
! @. c' g5 y6 k bylayer-lt en ltlist_act sortlist
) P) @# T3 a l( ^, o bylayer_col ethickness ltname. ~" k) ?0 }! V9 }; u
bylayer_lt fchk ltnmlst sslen7 T' T; @6 F0 a; f! Z
call_chp frozth ltvalue templist
7 d$ |9 _+ C. P1 P chk-col getcolor ltype temp_color
) a% _: q0 \% I5 c( t/ ]* m chk-lay getindex m test-ok
! v6 a2 j: |" s4 R/ Q chk-lt getlayer makelaylists testidx
! x% K7 t& v# D6 b2 w5 a chk-th getltype makeltlists testlay
! Q' N( A5 M4 M2 Y7 \; r) K* l cmd getprops match-col th-value
4 [8 |; O" w# ^" b' C5 ?( K) E cmdecho getthickness match-in thickness- J9 g6 k4 q: k' I- _
cn globals match-lay tile# a# F% K3 t) z) r3 S# f) c0 A- }
cnum go match-lt tilemode
$ q* j. W2 Y! {+ D1 S col-idx index match-th tile_rect8 U2 ^4 l0 L) ?# _4 M- m
colname item match_col vi# w ^* Y$ u1 K- E# p* d
colnum item1 mdashlist vpf
5 X0 r; U0 p; s* @ color item2 n vpldata4 u( y0 F* v p4 w' X7 V; {+ V9 F' _ D
colorname itemlist name vpn
: m! y- e& X; v0 n; H/ p' B col_def lay-idx ncolor x9 p$ D+ e. K8 N! _: D9 A
col_tile layedit_act nlayer x1
2 _7 S" ^, H" |3 H+ S' Q ctr layer nltype x27 @9 h7 Z! \4 V' ^
cvpname layinfo nthickness xdlist' G2 h7 j X1 ?4 o* p9 `
dash laylist off y1 n3 j0 ]4 W) n8 i. ^# Z
dashdata laylist_act old-idx y1
8 g2 L3 d! u, \" v7 F; x+ ~8 g! V dashlist layname olderr y2
2 X3 k, e) E, ~/ e dashsize laynmlst on undo_init
. ` }. h2 c# m dcl_id layvalue onoff
R5 m4 M) A* Y; N linetype patlist
, i+ I$ ]4 r, H7 h ddchprop-err list1 pattern- _ S6 w: Q/ o3 r; n1 w$ s
longlist proplist, {$ q i6 Q3 H- m* a- L% D/ C, y
lt-idx reset-lay( b, {% w! m( o" T5 t6 ~
drawpattern ltabstr reset-lt# r& {# o- s5 A) S! F+ A- y+ u
)* t! x$ j9 w. U, m' W- I2 b
1 k, y0 X: x% r; S) o/ s
(setq old_cmd (getvar "cmdecho") ; save current setting of cmdecho
4 T9 U$ V! p) n5 y: C5 n2 B. C! j, j old_error *error* ; save current error function
; P& ] c8 Z3 }9 q *error* ai_error ; new error function
9 @6 a/ g: R; I- g+ K& V/ u )
/ H1 l( X1 y& e. D0 ?1 K; B0 R5 ] L( E$ z* a
(setvar "cmdecho" 0)) I4 L: W1 J) g3 |& _, U
9 ?, Y- _( i- T5 p (cond$ `8 j; X$ q; g: c
( (not (ai_notrans))) ; Not transparent?0 a% x9 h/ b& L: m
( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
* r% H Q; @6 p; v ( (not (setq dcl_id (ai_dcl "ddchprop")))) ; is .DCL file loaded?
. o1 E) @, X. z; ^- o ( (not (setq ss (ddchprop_select)))) ; objects to modify?3 ~3 A! b T. l# `
& j3 s# m# B* B5 q4 n* g' f
(t (ai_undo_push)
4 x S( O1 q( T (ddchprop_init) ; Everything's cool,0 G+ z' r I, ?- t0 j" v
(call_chp) ; so proceed!
0 P$ j& N8 e) Q4 N6 d; B (ai_undo_pop)
% w; V% @& j: D5 m' D ) u0 z9 A0 V8 r& C
)
; O% B( A9 o% J0 s; J( _
" M: S* m$ v" j& c7 q (setq *error* old_error) # J6 O E$ u. j8 M( H
(setvar "cmdecho" old_cmd)' K( v* h$ `# o; _# f. W: V/ _8 r
(princ). F i1 S' M) u9 z
)
! ]3 S$ }" j. R% Y4 i* l' x1 L: }3 V% @. H- D# l% G& {
;;;----------------------------------------------------------------------------
I- X0 N$ {- Q. e8 Q# k. j! T
^4 l2 n2 N6 v(princ " DDCHPROP loaded.")
) N) l1 z/ U/ b2 d" f. j(princ)
0 y. v& u! S" c! ~ m
! I# C7 }4 j6 Z5 B# R;;;----------------------------------------------------------------------------1 k3 B0 a# J1 \. N
4 d* g* \+ }7 ]+ O
;--------------------------------ddmodify.lsp----------------------------------6 P1 j5 @; p; ]8 z# Y" S
; Next available MSG number is 1111 c# l' I4 r8 m! A# k0 ?
; MODULE_ID DDMODIFY_LSP_* j( H6 Z4 `5 H
;;;----------------------------------------------------------------------------
$ [5 I# i% H; U2 S9 q;;; DDMODIFY.LSP+ `) s/ i/ S" m1 ]
;;;
) }3 @6 j) y. N3 }. Y;;; Copyright 1997 by Autodesk, Inc.
' h/ ^. I2 k9 F) p& s6 o;;;, Q2 R1 }( U1 g3 _% e( L
;;; Permission to use, copy, modify, and distribute this software
5 m3 w9 P1 T* w0 A;;; for any purpose and without fee is hereby granted, provided
5 e& z% s. }5 P+ w8 Q- L2 u;;; that the above copyright notice appears in all copies and
5 N! E/ J% E6 q w;;; that both that copyright notice and the limited warranty and3 I6 @" b, _7 Q) \) f& |- _% t
;;; restricted rights notice below appear in all supporting
" A) z* j/ c4 ^;;; documentation.* c$ X3 ]9 E8 x. Y& v( ?; w
;;;
$ c" p; { U* @% j) b;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.3 n5 z+ [3 T) ?6 h% {+ M9 h
;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
6 M0 z# |: b, M;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
: y' v& u2 X/ K4 L;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE; a- K0 H* h+ q) t* a5 V) F, l
;;; UNINTERRUPTED OR ERROR FREE.# B4 m) x8 E, P: p5 n, k! b
;;;/ L2 [3 U; i* N) Y b
;;; Use, duplication, or disclosure by the U.S. Government is subject to* m X* @/ m' T; h0 L9 b
;;; restrictions set forth in FAR 52.227-19 (Commercial Computer2 p" J9 t) N9 m) u. }) B
;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
4 X5 W2 Y* K, w3 Q6 J K;;; (Rights in Technical Data and Computer Software), as applicable.
1 |9 \* r5 c$ V0 x# ~, m3 ]0 y) m) {$ Z;;;: }5 a/ I) e6 H3 r
;;;.
1 q& T; W/ J+ Q! l;;;
# i# v: y U0 q! `" u" a;;;----------------------------------------------------------------------------* ? l8 C; y1 X& L# _( S
;;; DESCRIPTION2 g! I* b& V) ]/ x
;;;
: W3 J7 N7 v# [. {8 K;;; This function allows the user to get a listing comparable to the LIST
: K, }- X* v! o6 t0 k0 D% M# N, d;;; command for most objects. In addition, most object fields in the
2 H, S" ^6 U1 c7 r$ T;;; dialogue box are editable. Points can be specified dynamically by& v% F( r; B: e, m4 S
;;; temporarily dismissing the dialogue box. Each object has a unique
# Y: P; g) b( h! t! i;;; dialogue.8 [+ z/ p% V. [& x% _, X% {
;;;
- U' h8 [: r' j3 G; B;;; Naming conventions
' W" L3 ?7 L3 H, o;;; Long function and widget names may use an underscore "_"
% c* ^" w0 l" A6 c, P# D3 C;;; in their names to make them easier to read, long variable% S+ T& I2 F* w; ]1 |& K3 F
;;; names use a dash "-".
! G- [3 o. f) \;;;----------------------------------------------------------------------------& J3 p/ G$ B: d; b) ?6 I& u
;;;----------------------------------------------------------------------------
2 D J3 i$ v$ r, \;;; Prefixes in command and keyword strings:
8 w9 B3 |1 z+ \9 ]+ f3 \; i7 G) a;;; "." specifies the built-in AutoCAD command in case it has been
+ @9 D9 E' n1 n' B% B X4 G;;; redefined.
, i5 @/ Q, @4 X# |3 I" H;;; "_" denotes an AutoCAD command or keyword in the native language
" B0 n6 z6 _. q1 z0 \;;; version, English.
b5 z, H! l) ~;;;----------------------------------------------------------------------------7 r) E5 b5 i9 i
;;;
0 w3 l2 c6 L, u9 s! w9 h! d;;; Avoid (gc)s on load to improve load time.' z! c" p1 F( {; L+ \
;;;7 N/ m) m4 @: {1 ^1 s/ I
(defun do_alloc (/ old_allod new_alloc)
7 _& a5 z0 _/ ^3 ]/ \ (setq old_alloc (alloc 2000) new_alloc (alloc 2000))* o% k# ?- H3 a- `$ o( C
(expand (1+ (/ 17000 new_alloc)))
: H/ G% N$ j, V4 _, V, m8 d- a (alloc old_alloc)
8 k4 x8 F7 z9 S* h+ \' q)
, P) \% `! W, z% }(do_alloc)$ T8 }7 o$ e. @' H
(setq do_alloc nil)% I- [0 [+ ~4 E- d( b0 |
" X' m) T( i8 h- ~, C) X;;;" [$ j! Q% i5 y5 u
;;;7 d7 c& q& N4 s3 R8 Z
;;; ===========================================================================
, @! }3 V& T& w7 {; x;;; ===================== load-time error checking ============================& p) L* S$ {; a# ?' v% e I
: h* a" `" W/ K K+ y1 C (defun ai_abort (app msg)5 c6 `0 L0 t* C: ~' u
(defun *error* (s)( R/ d+ ^' h0 p' u
(if old_error (setq *error* old_error))
, n2 Q" j4 ~( p" ~# p) _: z6 x (princ)
* v% A$ a% u' W1 ]: @2 x, g# T& Z# h4 B )
7 |) `/ w8 q1 b (if msg
6 k+ {7 N2 b, t' L1 f (alert (strcat " Application error: "
* l3 e- W$ d3 \1 c app+ V- G0 q+ \3 Y" w/ {
" \n\n "4 ]8 X* u, p5 q. W
msg9 K( b) v, [ f' [
" \n"/ A2 r' n8 _0 H2 e' i( R! U/ H
)
W2 O2 S7 ?6 R1 [9 @- w )
8 V% k- L; D, x& ^* t )5 t; e; m3 E3 V% V. w1 f
(exit), O/ D. X/ Z0 B, g8 l1 a2 P* G
)6 C {2 u# N& m/ H
. a* h; [4 L- r$ m+ {7 b
;;; Check to see if AI_UTILS is loaded, If not, try to find it,
+ K5 A0 x, R; S. a/ t;;; and then try to load it. If it can't be found or can't be
" j! `( r5 g- K" j; Q3 g7 [;;; loaded, then abort the loading of this file immediately.
( Q4 ^( ]: t" p3 `. _$ t4 p3 Q) x t7 z2 Z8 u! B# q) a
(cond
, y" v0 D5 t- Z$ M4 H ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.' h: y# {( R5 w8 w8 Z9 _' K
3 Q5 q* b4 h/ T ( (not (findfile "ai_utils.lsp")) ; find it: ~; B; K ^; O
(ai_abort "DDMODIFY"
$ X( T! u! L3 o. b1 N (strcat "Can't locate file AI_UTILS.LSP."7 `; D. i+ h# V6 ?
"\n Check support directory.")))
# Z$ b' o3 D, `0 X# m. F% J. L& m* c' i. b$ s
( (eq "failed" (load "ai_utils" "failed")) ; load it
% A+ m8 _( A0 u0 k% U6 H (ai_abort "DDMODIFY" "Can't load file AI_UTILS.LSP"))5 n" @' X- K! g& B+ Z& m2 ^
)
. ]+ Q W" n- K) I i, f1 c4 X3 c
. @, s5 d# _4 q, a1 Y+ f- y;;; If we get this far, then AI_UTILS.LSP is loaded and it can
7 z5 J$ F6 w& f6 P6 V;;; be assumed that all functions defined therein are available.
, n* Y" u8 I6 p' T1 J
. y6 x- E# b7 U( I. ^9 g;;; Next, check to see if ACADAPP.EXP has been xloaded, and abort
/ i Y9 Y" g7 `# Y/ T;;; if the file can't be found or xloaded. Note that AI_ACADAPP' K0 q4 H# `, `/ @3 h1 v
;;; does not abort the running application itself (so that it can
6 x) i/ J" l4 y4 j;;; also be called from within the command without also stopping
. j7 L) y& ~! H( t- r# H" y;;; an AutoCAD command currently in progress).& k* Z' C4 j1 F! x; V& R
+ y1 s7 g# i6 y; Y
(if (not (ai_acadapp)) ; defined in AI_UTILS.LSP* n& L+ k, D/ g3 g W, q* C
(ai_abort "DDMODIFY" nil) ; a Nil <msg> supresses$ \4 M3 s2 a1 ]
) ; ai_abort's alert box dialog.
) w/ L/ R) Y+ B W) I4 x2 z4 Y6 \: N+ M0 t( I
;;; ==================== end load-time operations ===========================# ~" I: v# _! V; `5 R# B ~
) y. T- @3 t2 X0 R" x% o% s# ^;;; global variables( |% X( P) A1 \( b
& X- g! V- y, ^9 s' ~# P(setq hatch-elist nil)
# T) N- I. k _' I4 ~+ B' f( r7 l8 i0 d, a
;;; If we get this far, both ai_utils.lsp and acadapp.exp are
7 X; @: w! [! N/ i1 Z2 u# x8 H f;;; assumed to be available." q% d A# F4 L* Q! x3 I$ z, y" ~
/ ^' T; M! U1 v Q; U;;; Define and encapsulate all subroutines that are declared
$ m: o5 y3 m6 o0 Z; s5 T;;; locals of the (ddmodify) function.
1 ~: l7 X7 ~4 g7 E* W2 f4 O
/ j4 g% `8 g4 e+ k(defun ddmodify_init ()
4 l+ `; U* x$ i' Y ;;$ t6 G! P5 Z# }; P$ \5 ]. i
;; These three functions modify the enitity list for common properties. Since; X% k- d; _! w [& k4 C y
;; color, ltype, and thickness are absent from the object list when they are
9 C, H& M8 Y) f ;; set to their defaults (i.e. color = bylayer), a simple substitution using
- q! Q- O# E9 e: z) v! v ;; SUBST is not possible.
: n; P% @$ l; l( Y: i ;;! v4 z- O8 z. [; I$ i: N) l
(defun modify_properties (), y7 H- T& m& V. r* f/ `" }
(emod ecolor 62)
' { L I. D* k6 u+ J4 m (emod eltype 6)+ H0 \4 U+ B9 e
(emod ethickness 39)
8 d% n1 W4 m+ M; j; q (emod eltscale 48)/ `. `% J( I- A( v5 o1 L
(tempmod elayer 8 nil)6 g9 O' t) i5 M/ u
): T8 X2 n& _- i, {, G( t
;;
0 ?1 j: x% \( c/ M ;; This function is used for modifying common properties of the ACIS
" ]& n- r8 a: y; N* R6 P5 V$ E% I ;; based geometry objects. Thickness is not valid for these objects
; B( M# Z9 S( ^- N& ] ;; so it is left out.
- t4 V9 D5 o0 D& O- u L ] ;;7 G/ d& B$ i& i/ a4 Z
(defun modify_prop_geom ()
4 i7 c3 V( z- F3 a3 E1 ]6 k (emod ecolor 62)
1 V4 A6 c: r1 C# o3 Z; i Y. ] (emod eltype 6)
3 F2 `# l: ?% C" P. F; E (emod eltscale 48)
9 ]) C! g( U) n7 [ (tempmod elayer 8 nil); M$ O0 b1 i: k. l
)
) w2 m& Q. Q u3 |8 V+ c- E
' @% H# m0 |( C* ^ (defun emod (value bit)
0 B: e+ p$ g* z/ _- Y! r6 J (if (= bit 62)
2 O& T3 Z5 m7 e4 h8 \" v (progn
: {+ x# m, h( u6 h% D: f (if (or (= value "BYLAYER"), _( _& T$ u! w% W1 c
(= value "BYLAYER")) (setq value 256))
, I- {- k7 N$ Y- V& p8 J: F& J (if (or (= value "BYBLOCK")$ {+ E* M# l$ i4 D3 o
(= value "BYBLOCK")) (setq value 0))
; j" U% |& I# u- N )
( T- ]& V7 y9 g( p7 P )2 U5 Z0 Y& Q9 \1 z$ i1 m
(if (setq oldlist (cdr (assoc bit elist)))
- k- A9 \5 J. N1 X) S- | (tempmod value bit nil)) O9 z3 G$ o8 Z0 u
(setq elist (append elist (list (cons bit value)))): n0 D K. a F6 z$ y+ ?
). y7 P2 @* X. ]
); N R. l6 |" T% P# X1 I
;;( ~, @( h6 h, r& f0 F
;; Resets object list to original values. Called when the dialogue or: h S* R: `/ e0 W1 D+ b+ L# k
;; function is cancelled.
5 @# r! W2 ?/ ^9 n ;;( ~; v% e/ _7 ?: b0 g
(defun reset ()! p* V: A0 @5 p$ N: P. F
(setq elist old-elist% |1 R0 k, w& `6 Y! s1 A
ecolor (cdr (assoc 62 old-elist))9 E* v, {+ z3 T! H9 D; Y
ethickness (cdr (assoc 39 old-elist)). P* r% z4 t; k/ Q9 ]6 Q8 b7 c
eltype (cdr (assoc 6 old-elist))0 k2 y, E- d$ q
elayer (cdr (assoc 8 old-elist))
( z3 E/ r% g" l eltscale (cdr (assoc 48 old-elist))
7 b& G( V" [) }# w# z+ w5 H6 N )
8 k3 S1 _, [" J (if (not ecolor) (setq ecolor "BYLAYER"))6 d7 E4 O: H# h( }2 [5 v I
(if (not eltype) (setq eltype "BYLAYER")) o6 I* B" U5 Q# Z
(if (not ethickness) (setq ethickness 0)); X! f) }" c: Z6 A( ~4 l; V
(if (not eltscale) (setq eltscale 1))
/ z8 s0 e" e; d6 X (modify_properties)
( ]3 z' l ~3 x- t+ ^6 h( D" q# d' | (setq reset_flag t)
# _' H% W* `4 T: C& }! A (entmod elist)
" J: o1 }# n3 ~- W )
) u4 `' @( Y+ t% g7 @ ;;
. a- l5 ]/ x" N9 H% T ;; Modify object when dialogue is temporarily dismissed to reflect latest; F0 Q* z: F: r) n/ S
;; settings of dialogue. It converts the point from current UCS coordinates to
" b. u! \5 L4 E8 ]. |% f ;; the proper object coordinates (world or object).
, ^$ |+ {! g7 h+ W: f% _1 w( r$ a9 u ;;
$ S0 s- v. b, `6 \8 e. y3 ^. i ;; Arguments: value - in current UCS coordinates* Q7 T# I6 ]( ^$ V* z8 b: `8 ^
;; bit - object code (i.e. 10 for start point)+ L1 x; V6 S; Q4 I
;; ptype - point type 0=world 1=planar
% _/ h% ~; }- Z) ^ ;;
' ?3 F% j9 @4 }* V7 {5 J+ o (defun tempmod (value bit ptype / newpoint)
) c$ X( S1 z3 `0 \/ o (cond4 x5 f) |' s* u) B* y l' Z
((= ptype 1) (setq value (trans value 1 ename)))
5 N ~3 |4 P3 F! L9 V/ W; `" u: }! T ((= ptype 0) (setq value (trans value 1 0)))6 t* _; c$ O! M: ?9 m2 E
)
6 F9 ]* ?- M' Y, ^9 T (setq elist (subst (cons bit value)- R. C1 B+ |4 n# V: T
(assoc bit elist)- j; B$ ~- ~, \
elist+ w! J! p0 ?7 E' X: O
)
& B1 @+ k0 [ q, f )# ^9 ^$ h. h9 T( ?! v' Y0 S
)
/ n8 u. r3 G; t' e0 F8 R7 P" t ;;
4 F* h. ?. w# E2 d( a7 e, H ;; The following functions are called after a dialogue has been temporarily
, f2 x7 \1 C v, O2 T5 a ;; dismissed and the user is selecting a point. If a point is selected the
F! f' p. m8 K# N; n( l' Q ;; object list is modified and new X,Y,Z values set. If no point is selected! ^ D( v7 j6 m; u; L; I8 A
;; (null response), then the point is reset back to its previous values.3 Q. B6 A- M! z- q1 h
;;
' J: e' w3 }* k# r" }# R+ `) a (defun ver_pt1 (ptype)
' q9 D; i% J1 `6 T4 I (if pt1. s5 R: f/ B: a @# Y
(progn
, L0 o8 V; o1 K, e6 u (tempmod pt1 10 ptype)- o* R9 I" P& J
(entmod elist)* r) {' b6 ]- f, e1 W: d5 A6 N
)1 o0 e3 X6 Y. b: J/ [
(setq pt1 (list x1 y1 z1))
% o1 l4 k0 _; R. r )% b8 H7 p7 t3 W0 K( a
)
9 K: ` |$ y- P# u" v
7 H F b, k8 ]! E6 ] ; (move_pt1 <ptype> )4 Y: {' a8 j- ^2 O1 Q
;* D" _* e% b5 e. F
; Called in liew of (ver_pt1) to translate block insertions which& k; z3 G- Y3 Z
; might have variable attributes attached to them. If the distance9 K7 d8 _4 }* ] v0 t" Q
; the block is to be moved is < 1e-6, the move is deferred.7 M1 Z1 W3 }$ Q1 l8 P
. C3 f r1 x* t; m- _' {2 F% N
(defun move_pt1 (ptype / basept hi): t! ?& D. L( t* E. e# t# s
(setq basept (trans (cdr (assoc 10 (entget ename))) ename 1))
4 s* Y0 A" _5 t- G (cond0 c& L: l+ q8 j$ F7 S+ A8 R. I& y
( (not pt1)
* r1 B- @8 q; B2 E, U" p (setq pt1 (list x1 y1 z1)))
! R/ M) n2 ?, W) A) e: ~; h& e; \( @: c. T- Z# J. J+ I' \' F( Y( J9 J2 t0 k
( (> 1e-6 (distance pt1 basept)))) Q3 M" h$ r4 T; Q- M* I* C
9 D4 |. J% b: I3 `" [% C7 ^ (t (tempmod pt1 10 ptype)' h7 y6 F+ N- Y1 N# u7 T; W3 C- t
(setq hi (getvar "highlight"))+ m( L% d% X9 g! v% U! y }) @
(setvar "highlight" 0)( ^, j$ j8 |; D& K+ b
(command "._move" ename "" basept pt1)9 `' G& B5 N1 u" K& }
(setvar "highlight" hi))$ N- G f# C4 s( _" N
)
( `& B. V+ o' B( T, c )1 N) K2 O; \/ F+ r" Z/ N
1 d n% H5 Y8 B0 C" \6 }% ~/ P4 o (defun ver_pt2 (ptype). o) C$ o4 k6 b8 _* L) w1 Z
(if pt26 l7 g' P' ^# ~* R
(progn) Y) E7 F. l; D4 ? F. a; j2 D
(tempmod pt2 11 ptype)
; `- A, }: x& Y- K2 D (entmod elist) L( ]- P7 Z. u- r
)
7 O; S; |1 M: U4 y0 p3 I6 \- G (setq pt2 (list x2 y2 z2))) {0 ~; C- l X) s2 |
)
9 |& E$ ^5 D2 I | )8 y; [( x# i, h8 X1 f6 W2 h
% B' Z2 ~4 n2 }3 C" v) J- u0 z
(defun ver_pt3 (ptype)
# G+ w+ i6 _+ g; c (if pt3 f5 o8 u3 g4 [+ d; X$ [' {) V
(progn' g7 E# g" K3 a( n6 q
(tempmod pt3 12 ptype)
) x+ ^1 U2 X$ v (entmod elist)0 S$ e3 |) |' H7 I
)# R/ F! A+ B/ U+ l* q
(setq pt3 (list x3 y3 z3))
% c4 {; Q: c' b! w( s7 h7 Y3 w )
' E+ ?. u- e1 c0 I' p6 q4 w6 J ). h. L. p) m7 |4 P# F& Z9 |! A0 q) T
; y$ K: |( u' a8 n (defun ver_pt4 (ptype)& w* H$ T2 w; N2 k+ ?# i' {
(if pt4
8 v" y3 L) H. e4 ?8 q (progn/ C0 X& [8 ?; y
(tempmod pt4 13 ptype)
, V* b! r* ?( d5 v* J# W; I (entmod elist)$ F, S, P* h/ L7 |( G' Y6 q! |- l
)
8 |) M& @4 O `- o! T, J* r5 e (setq pt4 (list x4 y4 z4))
3 i% ^8 ^0 m; U1 `0 _: Y: O! ]8 j )
Z8 g) X R8 U9 Q! }( l )
5 L3 [; y5 i1 s: |% R7 Q# j6 C ;; Xline/Ray
: G% R: T. B- o$ |& w0 w# [ (defun ver_xline_pt1()
5 }0 j8 b( N- o+ q# C (if xline_pt1
' N) z5 a* l& z5 b1 b$ l" y (progn
& A& b( ~% R! N! [' v ;; convert to WCS.
4 U8 @; Y" W, L- T9 d (setq value (trans xline_pt1 1 0))
8 N o; A, B1 z+ [6 B* K (setq elist (subst (cons 10 value)2 U$ h1 y3 X) }& J. a
(assoc 10 elist)2 P& l& ^' z ?
elist1 F0 U5 \( J3 O0 k
)
1 z# u! r, t2 M )
( }7 d/ d& [- z% ?7 U. h )- |' L$ K" P+ Y! H8 v" u5 ~
(setq xline_pt1 (list xline_x1 xline_y1 xline_z1))
/ v! C% X5 I* W )9 u; H) \ `; g7 _; _: s# |
)
3 P( U" A2 g7 E* P; ~ Q9 H% J$ E3 S$ @7 d3 }( H
(defun ver_xline_pt2()0 S J; ^ m% Q7 Y! R. `6 x9 t; N1 @
(if xline_pt2" l. S, Q. U- `$ `
(progn
6 d: N3 w5 s; j( i ;;
% \2 I9 {- ~7 y1 F6 Y ;; Calculate new Direction Vector WCS3 M/ X8 D3 v8 J0 W( @( ]9 R; j
;; x / (sqrt ( (x**2) + (y**2) + (z**2) ))
+ h$ V' C3 E3 L4 i0 v, | (setq temp_dir (trans xline_pt2 1 0))8 Z* J& F5 B0 L0 I
(setq temp_dir_x (car temp_dir))
5 K0 P5 I+ W: n8 a" t (setq temp_dir_y (cadr temp_dir))
3 @3 o7 m N1 l# T) {, ` (setq temp_dir_z (caddr temp_dir))* o) C* l n9 i. b/ r3 M3 S2 i
4 m% b$ {! M! i; s% G' l
(setq temp_xline_pt1 (trans xline_pt1 1 0))3 S* C' B( N! R. A# k& L6 t9 e
(setq temp_xline_x1 (car temp_xline_pt1))
$ I" M, H+ X* K( U (setq temp_xline_y1 (cadr temp_xline_pt1))& y0 {$ l8 @% g
(setq temp_xline_z1 (caddr temp_xline_pt1))
$ B% u* p, d: | ^, ^) X! y6 e/ C. l( D5 W a. v7 w/ S& P# r4 ^
(setq denom (sqrt (+ (expt (- temp_dir_x temp_xline_x1) 2)/ ~" u+ O7 ^/ B- l
(expt (- temp_dir_y temp_xline_y1) 2)
6 m8 Z( {- N1 r3 | (expt (- temp_dir_z temp_xline_z1) 2)
' Y+ `" E" M: s9 @ )))( }3 [' B+ v1 d
(setq temp_dir_x (/ (- temp_dir_x temp_xline_x1) denom))
! F7 G6 ^ U3 G+ Q (setq temp_dir_y (/ (- temp_dir_y temp_xline_y1) denom))
& t7 C J+ I6 O8 {8 u$ [; p (setq temp_dir_z (/ (- temp_dir_z temp_xline_z1) denom))
) G' t# X0 j+ q! n (setq elist (subst (cons 11 (list temp_dir_x temp_dir_y temp_dir_z))
7 r! J8 c; Z" `2 U (assoc 11 elist)
3 F9 l+ S* ~, u elist! w$ q- w/ b2 q
)0 m' P0 c( O( Y- t9 g: B( V
)
0 A z/ A, C& E6 q3 L$ U (entmod elist)( R @7 J3 B8 j" z3 c$ T& b
(setq xline_x2 (car xline_pt2))8 I7 g D( T) x2 p
(setq xline_y2 (cadr xline_pt2))
2 | S0 U5 W* t; d; a. R0 k (setq xline_z2 (caddr xline_pt2))
8 Y* x6 w6 b' m
8 d" W5 |" S4 a7 X2 ^% C! a3 ?' S% J
)
- J1 A: U6 m& P, `. j5 x2 k- L (setq xline_pt2 (list xline_x2 xline_y2 xline_z2))
% f/ b; D- Y3 h- \ )
; r' ~6 x1 w2 R5 j! N+ S )
/ }5 [1 X5 X- E" `3 l- X
8 x x) \- n% F1 d6 k ;;
% n, _- e- C) P& r! m2 Y- e( H ;; Common properties for all objects
/ v' C7 d+ [' e/ o4 W! i+ p ;;
9 o" A8 x7 v, D) o (defun set_tile_props ()
0 D; G3 d' _$ O4 p (set_tile "error" "")2 i, K7 E5 I. g3 N \& C
(setcolor)! ]3 q5 i2 Z H. N9 R R2 V! [
(cond
( ?3 C z* w3 x ((= eltype "BYLAYER")
5 s" p5 W; }* X& y j9 Z* s (set_tile "t_ltype" (bylayer_lt)))
, f) Q3 h: R* G* r6 }% d ((= eltype "BYBLOCK") s, }6 K* m1 {. A) V! j R
(set_tile "t_ltype" "BYBLOCK"))
) z# T8 e1 M1 `$ e- `; G( f% p (T (set_tile "t_ltype" eltype))
/ \1 Z1 E4 M+ b: v5 g ): ~1 v3 L& {; z, p |" y
(set_tile "t_layer" elayer)8 {! h; R6 s0 G; S( Y* p6 q# M# s
(set_tile "eb_thickness" (ai_rtos ethickness))
3 B7 A& G% f$ b8 ^. P/ C: N/ ^ (set_tile "eb_ltscale" (ai_rtos eltscale))% `+ L: C" N3 ?- d8 H: C
(setq which_tiles (ai_common_state etype))5 M, K' l2 K8 N/ v7 Z0 A) y( e
;; Disable tiles if need be...
, V, g4 e' L: c5 e3 E( r
# W; s" D3 S: d& M& ? ;; Layer Button and Text Field5 E' j, R8 \. ]% E7 @2 ]+ H
(if (/= 1 (logand 1 which_tiles))" g X& _+ g3 u! c+ }! X# i( ~- c
(progn
% v+ L- z! V' ] l" i+ q( | (mode_tile "t_layer" 1)
' v: p. V3 f. O+ K (mode_tile "b_name" 1)
( w2 X; ^7 r1 j* K1 k: N6 E" g )3 v: r; g* R+ f! ~: y
), O0 C+ W w/ E% _9 G
;; Color Button and Text Field
0 N+ x- e; J! k (if (/= 2 (logand 2 which_tiles))
' `4 J: w' G# @8 \% G, m/ E3 g3 v+ R (progn5 H; X7 b5 ]! T7 C
(mode_tile "t_color" 1)
7 _) s: T! u& @1 D (mode_tile "b_color" 1)* }1 u' U! h7 ?6 [: y* {
(mode_tile "show_image" 1)
. L) ]& `9 f! [0 q- e )9 @( D; d2 F( E2 U
)
4 k7 W/ n7 Z5 C3 D ;; Linetype Button and Text Field
( X1 L. Z- ?2 m4 | (if (/= 4 (logand 4 which_tiles))
! U% x& M& q- L0 ?4 Z) e) D (progn: h0 D7 N: s* y7 f
(mode_tile "t_ltype" 1)/ m3 E# Z) D. M9 d: u- `0 x2 g
(mode_tile "b_line" 1)
% N, r- i: g" ] )4 s* C0 ]+ p/ a0 p7 k/ _
)
1 k- u" e* A# ]' L ;; Linetype Scale Edit Field2 m8 l, M$ i8 ?* L- R' q, a# \3 j
(if (/= 8 (logand 8 which_tiles)): b) {6 s1 ]6 X& Z& c
(progn
& @2 G4 z- v/ s. N (mode_tile "eb_ltscale" 1)
& _1 H) {( s% _/ u7 R, q3 H )+ E/ J$ C) C. Q- L: t( E& L
)
3 U# O: j6 J: T f* _ ;; Thickness Edit Field.
# H) e6 I& l; J- g4 ^ (if (/= 16 (logand 16 which_tiles)); i1 z* W0 b! h5 w
(progn
, P+ R6 V: z+ u (mode_tile "eb_thickness" 1)# L+ N: c6 K1 K* H1 R' h
)
) ^; F7 y) \. A0 b; ?; X4 M3 a )) |1 c& W; W+ l
)
! N6 D. M9 f* U$ C& J0 b ;;
7 J S; D# G4 @) m% u; U# g7 @ ;; XYZ Point values for all enitites& T- n$ ?3 j) ?. E9 u
;;) S# m0 X% A) Q$ Q) {: v" f1 J1 M
(defun set_tile_pt1 (ptype)% b% L4 ]. K+ t9 m8 G1 u
(if (= ptype 0)
, k, H$ \) M: A$ I$ ], q/ e7 e* v5 o9 _, H (setq pt1 (trans (cdr (assoc 10 elist)) 0 1))
, Y8 C& W* F9 n (setq pt1 (trans (cdr (assoc 10 elist)) ename 1))
& G* n: j! J! E )9 P" T2 O0 i% I. V4 s3 F
(set_tile "x1_pt" (ai_rtos (setq x1 (car pt1))))9 B0 u, C- u) W! E0 A3 w' C* k: N
(set_tile "y1_pt" (ai_rtos (setq y1 (cadr pt1))))9 C( d: `# `/ ?
(set_tile "z1_pt" (ai_rtos (setq z1 (caddr pt1))))7 J _+ q( P' t4 A- F: _
)2 ~* C f' O4 {2 _) j
(defun set_tile_pt2 (ptype)9 A L+ G ~/ B0 T* t: m+ w2 q/ v
(if (= ptype 0)
: F9 t" h7 H0 U6 q (setq pt2 (trans (cdr (assoc 11 elist)) 0 1))8 r& p" _& u6 ]" U3 K6 [/ t
(setq pt2 (trans (cdr (assoc 11 elist)) ename 1))& I% v I% k+ ~/ M+ p) d# [
)
7 L( ?& f& n n& t- A3 e (set_tile "x2_pt" (ai_rtos (setq x2 (car pt2))))
' `& K& T, i4 q$ [ (set_tile "y2_pt" (ai_rtos (setq y2 (cadr pt2))))
' ~! X! F; \! L8 l5 D0 \. a. F3 J (set_tile "z2_pt" (ai_rtos (setq z2 (caddr pt2))))2 N1 q3 M/ d& J# V# b
): n0 c* q3 o0 W' c
(defun set_tile_pt3 (ptype)$ `! u9 ~7 b* {* E& A& W" N4 _
(if (= ptype 0)- [" k9 E, A- E; K! p
(setq pt3 (trans (cdr (assoc 12 elist)) 0 1))
" A, |. a1 H7 B. o/ h5 M" ^. o! N1 b (setq pt3 (trans (cdr (assoc 12 elist)) ename 1))
# |4 @8 ]8 N+ G* A& h# B1 N! K( }- y2 J )
# ?' p3 ^5 R" k$ M3 K0 l (set_tile "x3_pt" (ai_rtos (setq x3 (car pt3))))
- A1 D h" ]; Y8 P7 B' U! Q- ] (set_tile "y3_pt" (ai_rtos (setq y3 (cadr pt3))))
0 |- d8 P% R7 T- U K' l- e& v (set_tile "z3_pt" (ai_rtos (setq z3 (caddr pt3))))
& R- r1 F; p# j8 \. O" L ): j, D/ M0 d. y
(defun set_tile_pt4 (ptype)
) i' W; j) ?) f2 e% z) B (if (= ptype 0)
8 ]& L2 y" {" W/ M (setq pt4 (trans (cdr (assoc 13 elist)) 0 1))& G. D* e& H/ c2 u$ _' o) C5 [
(setq pt4 (trans (cdr (assoc 13 elist)) ename 1))
: U- |" N9 k0 w/ V+ w$ M )
+ ^. W s- |% q* B2 H3 p ~ (set_tile "x4_pt" (ai_rtos (setq x4 (car pt4))))1 P. }% x3 Y D! P. k) U
(set_tile "y4_pt" (ai_rtos (setq y4 (cadr pt4))))) O8 J. A; Y7 U5 r7 k; B& H9 B
(set_tile "z4_pt" (ai_rtos (setq z4 (caddr pt4))))
& T u3 k- _" H8 M# k- t, F )
# K* z; l4 m5 D7 t9 S& j9 N- H ;;/ P' |' T' D; v. m) ?
;; Xline/Ray1 `* q1 S4 N! b: ^5 p: p
;;7 g$ v! k H% {' H
(defun set_tile_xline_pt1 ()+ @) v. r* F' W6 c8 z
' l& q+ }" b* C3 l6 o( H
(setq xline_pt1 (trans (cdr (assoc 10 elist)) 0 1))
0 L; M* K& _" n- L1 X7 c
3 S! x" s- v e; j5 f& X9 G (set_tile "xline_x1" (ai_rtos (setq xline_x1 (car xline_pt1))))
/ A6 C4 ]/ n. i: a (set_tile "xline_y1" (ai_rtos (setq xline_y1 (cadr xline_pt1))))
2 u! k a; W' L/ g& E3 p. C (set_tile "xline_z1" (ai_rtos (setq xline_z1 (caddr xline_pt1))))
0 _. a/ [) U3 _1 S+ { )
2 }/ F# n: B% } i( k9 ^: M (defun set_tile_dirv ()0 b# \3 \6 p! o+ n) o+ u( |7 j$ B
;; Convert 11 group to local UCS (displacement)
( R( c1 I/ @/ W* k0 F Z (setq dir_pt (trans (cdr (assoc 11 elist)) 0 1 1))
! ?! ~ N I1 ]/ E! }' a; W6 v t0 o( x! r5 [% u3 |9 w" R1 I/ h2 T
(set_tile "dir_x" (rtos (setq dir_ptx (car dir_pt))))
6 Y" ] e. K* M$ j, T8 n9 S8 H (set_tile "dir_y" (rtos (setq dir_pty (cadr dir_pt))))9 F( U9 A1 p' C9 I) e
(set_tile "dir_z" (rtos (setq dir_ptz (caddr dir_pt))))9 _; ]) e0 u. I+ E- g j# y8 T
)
$ b# I6 }! x, E( N9 O (defun set_tile_xline_pt2 ()
0 r* H/ }( ~5 G7 M (if (not xline_pt2)" @4 h& ^& P- x, }8 e
;; Initial second point is Root Point + Direction Vector
' Z* n6 W/ P: }8 \: G( g (setq xline_pt2 (mapcar '+ xline_pt1 dir_pt))) T6 B1 {, m/ m" a& `
)2 p- C9 H# P" O
(set_tile "xline_x2" (ai_rtos (setq xline_x2 (car xline_pt2))))
/ T8 b, A4 @4 E9 e/ V8 L (set_tile "xline_y2" (ai_rtos (setq xline_y2 (cadr xline_pt2))))
. a$ A, y8 N- {, {, X, b6 i' ? (set_tile "xline_z2" (ai_rtos (setq xline_z2 (caddr xline_pt2)))), e6 O2 g) |% v" k7 G
)0 J1 i2 q" v* ~/ h* h* }7 c: p( n
% N% u8 w3 U0 O! U1 h
;;
! K3 ^: L, i9 O2 U+ Q# x, P1 A+ G: @8 y ;; Handle for all objects6 R! L% Q$ X$ k% @
;;, ~) {3 l$ J: K& y# e- Z
(defun set_tile_handle ()
1 D& u" M4 j1 o: Z# d. n; F (if (setq hand (cdr (assoc 5 elist))): o, }! m( j/ S' B7 S) Q
(set_tile "Handle" hand)
3 e8 q3 s8 p! ]& g- U (set_tile "Handle" "None")
" Z- t: P$ K9 [7 r& p ), k1 b" y4 U' _8 ^
)8 Y# r2 ]; d- d5 ]" e5 g
;;; }$ g$ [' y) Y$ c
;; Radius for ARC and CIRCLE
2 B. s2 \; ~+ P) Q7 c: r ;;0 U2 K( e9 M7 ?8 q
(defun set_tile_rad ()5 O) k- ]5 u4 h
(setq radius (cdr (assoc 40 elist)))
$ S, {6 \; Z0 y, W8 f (set_tile "radius" (ai_rtos radius))
1 `6 [) L9 j* V: T3 \1 l )
. j I% r2 a9 B0 t ;;
2 Z# Q( W6 Y) S( Y, y2 V ;; Start angle for ARC) x$ a8 s: A, F
;;2 V* ]. p8 \, [1 i' b
(defun set_tile_stang ()! w- T. _8 e% L6 h# G% e3 U
(setq st_ang (cdr (assoc 50 elist)))) B2 v" N0 j5 G) R+ G* x& K
(set_tile "st_ang" (ai_angtos st_ang))1 L: w3 S% x" Q
)% b: V, y5 f6 x8 L
;;
/ L6 b, Z; m0 x: Y8 L. |" v) ]- c ;; End angle for ARC
2 H9 O* C. B. j j! o" ]7 z7 O0 d ;;
- g, s1 L2 |" c' D (defun set_tile_endang ()
/ y( K! {9 y( L3 o. G& C8 ~1 N2 X% U (setq end_ang (cdr (assoc 51 elist)))
7 U/ W* l( O$ v (set_tile "end_ang" (ai_angtos end_ang)), q9 h' {+ Z0 V* t
)
7 d! D \$ [' j1 R* P2 k; ^ ;;' d2 T* s# \$ `4 E( { d
;; Rotation Angle - Text, Attributes, Block insertions and Shapes& P# L; P7 ^& O
;;) k9 V# @& a! ^" E
(defun set_tile_rot ()
; ]" @3 D" ~& f7 c1 @+ K (setq rot (cdr (assoc 50 elist)))
% I' L( k9 T; E2 W; y E (set_tile "rot" (ai_angtos rot))
3 p+ I4 j" P& z. A. o )
- P9 [ x" H( U$ \8 D# F% z( j0 Q6 I ;;
3 I! u; i: w5 R: ` _2 b: W ;; Height - Text, Attributes and Shapes7 h2 u6 B# l0 V
;;
9 s- O$ @- e* J! c# C- [1 F (defun set_tile_hght ()5 O9 Z1 Y" S( V7 G
(setq hght (cdr (assoc 40 elist)))
+ r% @, D( t% [7 x) y3 Q (set_tile "hght" (ai_rtos hght)): ^5 n) W2 N0 V" H
)7 K+ f6 c( ` Q8 o$ q: M
;;/ f" K# h! _& I8 N
;; Width Factor - Text, Attributes and Shapes4 j0 x$ d! S% u' D
;;
' c% K/ x( K% e3 }' f" v; y; G (defun set_tile_wid ()
4 ?7 y, ^4 c) R7 s (setq wid (cdr (assoc 41 elist)))
, @) v0 y4 A5 O( m* B8 `5 w7 \ (set_tile "wid" (ai_rtos wid))! S6 {" p N/ h) v# N! y+ a2 J. K
)
0 h. ]% I# @) W' j, K+ L! |' Y ;;
9 u+ L6 G; @9 o F% z ;; Obliquing Angle - Text, Attributes and Shapes
- @* } Z2 b8 p ;;
( \& `4 f5 w) l (defun set_tile_obl ()
5 M4 {0 d: u# D0 ?! M (setq obl (cdr (assoc 51 elist)))
) Y" w6 ^1 e a1 w, g% Z$ W+ H (set_tile "obl" (ai_angtos obl))9 e" h- x w( o/ V; c6 N8 |+ l
)
1 u/ B) a" V& `3 J0 B ;;
) h8 Y7 X& f/ Y" d8 s$ h8 C ;; Text string
+ b0 m5 x6 a: J; a, p" S ;;
9 T+ E3 j) B; }$ g (defun set_tile_text ()* J% M* R7 O' r D
(setq text (cdr (assoc 1 elist)))% [8 l% M3 V& V k! N
(set_tile "t_string" text), Z# g6 j- h' C
)
4 f) e6 ?0 V: }& s. s; i ;;
, W- G- Z) j$ P, ]9 L% x4 I ;; Attribute Tag
9 L7 a9 ^9 j3 k2 w/ k2 {% H% Y ;;+ ~7 \/ P' |- W5 \0 r
(defun set_tile_tag ()
, [: z8 ]; T! ~% D [ (if (= etype "ATTDEF")
, k m, y5 y8 o (progn9 ]' V: s( i$ ]2 a$ y: q5 @0 Z0 Q
(setq attag (cdr (assoc 2 elist)))
+ L6 D4 [1 m* y' {1 \" \ (set_tile "tag" attag)
. e% S6 Y# V1 F6 w9 V8 h )
: w5 N6 X1 k9 T2 A1 D6 c )) k K$ X" _( D T
)
* ?* c# C4 S" e/ z- L8 s! b( F# s ;;
4 W. Y5 D6 ? u0 A: L6 l ;; Attribute Definition
9 f- U- x( ^1 H7 V ;;& Q H b* j' l
(defun set_tile_prompt ()
' l% Y% V6 ~5 l# I! H o (if (= etype "ATTDEF")
) \9 ^7 |: O0 z0 O$ [ (progn
# Z! P: F% n7 Y8 @9 Y8 ` (setq atprompt (cdr (assoc 3 elist)))# S6 Z! ^6 h; Z: V' I; F5 [7 M5 K
(set_tile "prompt" atprompt)
7 {' }8 D' j$ q )
( M5 M/ ~- }# M8 B! g )
* c3 }& M& }% ]5 f/ D3 ^8 d$ } )% p2 p( |# N$ C6 a7 _
;;
& |' v: q/ [8 Y9 _. _8 Z: J ;; Justification setting for Attributes and Text. Initializes
" ^5 N- {) ^" S0 v ;; popup list box
; i N8 V: X; f) X% ]8 a ;;0 N( R+ K8 A3 R: G6 n
(defun set_tile_just () L8 P [+ k; T8 E+ F; G \0 O
(setq ha (cdr (assoc 72 elist))) ; horizontal alignment" T4 }% [. \+ o( Q W8 p5 o
(setq va (cdr (assoc 73 elist))) ; vertical alignment
* y$ `9 R4 x0 \2 ]+ {0 T6 c1 A (setq ha-prev ha)" Z1 w4 p. H- j4 M# p
(if (= etype "ATTDEF")
* I7 a2 d8 }8 |& [& v (setq va (cdr (assoc 74 elist))) ; vertical alignment
# d0 s5 Z( w& k6 J2 {7 P' b )9 { k8 s) G# ^2 G( A) `
(setq jlist
( h0 S. U& ~, R7 y2 P9 d (list "Left" "Center" "Right"
5 E6 d, c; J% B) v4 U+ P "Aligned" "Middle" "Fit"8 S4 b) S! b R' e O: X2 N, ?
"Top left" "Top center" "Top right"
* ~2 t, {- J! z: _" t6 v7 @ "Middle left" "Middle center" "Middle right"' k9 {& v; R1 F. ~; y7 n4 `4 W. ^% e9 T
"Bottom left" "Bottom center" "Bottom right"
/ H) O: B9 x: _2 @$ K9 t ). E! A% W- c* t0 |! N1 X7 D8 \
)
" [6 z" X- d. t1 i9 ^; H (start_list "popup_just")
% O& {" o9 w6 S. S8 `! x! Y (mapcar 'add_list jlist)
+ w: D; j; E. ]# g7 d, f (end_list)
6 w6 A0 h {9 j# `* k% X7 m (set_just_idx)+ Y, R2 l$ i* R+ z! t1 E8 o, r
(set_tile "popup_just" (jlist_act just-idx)). }% x9 Q9 w4 J) ~6 r. x
)
7 D) `3 u1 a5 I1 n ;;
* m- b0 z, W/ X, D- n8 Z- @3 j1 a ;; Style setting for Attributes and Text. Reads symbol table for popup list0 F: a+ n3 G: v* S
;; box.
1 f6 A% v& U( Q" `9 }9 o ;;. X3 U& T. V& W7 h' G" [% m
(defun set_tile_style (/ sname style-idx tlist)
# ~1 x) K ^$ w" ] (setq tlist (tblnext "STYLE" T): P; H$ F% Z+ I8 [: y, o3 M
slist nil)2 W/ h" j6 }0 _' ~
(while tlist
0 w& F/ K- Q* c. W8 _ (setq sname (cdr (assoc 2 tlist)))
, i( q) T6 U! D7 }1 S (if (and (/= sname "")
/ @! `5 e3 Q! G+ j! l (/= (logand 16 (cdr (assoc 70 tlist))) 16))
+ }6 U* R0 J# v (setq slist (cons sname slist)))
& c! g) ]1 L2 T0 l (setq tlist (tblnext "STYLE")))7 B# q/ h; {3 l2 p" O# x
(if (>= (getvar "maxsort") (length slist))3 G# v! \) f Y9 b0 k+ K* \
(setq slist (acad_strlsort slist)) ; alphabetize style list
9 ~2 i* X- U% f (setq slist (reverse slist))) ; or reverse it to put it in DB order
+ u# S N0 d& f+ E$ |7 P; w
+ z: B" n+ j4 v- w- [ (start_list "style")4 G* \& U/ F, j1 \5 N! s
(mapcar 'add_list slist)
0 `# G3 f: ?# n. [ (end_list)5 p ?( y0 J p3 A
(setq tstyle (cdr (assoc 7 elist)))1 J- ~# n+ A$ l9 W! N/ h
(setq style-idx (getindex tstyle slist))7 G* D+ w& x# h' ~0 v$ T+ ?: ^
(set_tile "style" (itoa style-idx))5 u) B9 C: `8 D+ f( x( S
)
9 O. c* Y3 X' a# |% k1 K- K: ` ;;( X. S4 D: ?+ D6 V7 r) _
;; Text and Attribute setting - upside-down, backwards: ^; T6 q) k9 C- e: a, d6 {
;;
$ y+ q1 J9 H' C0 H; u (defun set_tile_bk-up ()) P* y# ]0 w. T' W- B3 d$ L5 k+ v
(setq bk-up (cdr (assoc 71 elist)))& C& Z+ Q# l' I+ S$ r* i
(if (= (logand bk-up 2) 2)0 u9 g2 b0 n9 p- d ]
(set_tile "bkwd" (itoa (setq bkwd 1)))
) [* U7 p8 z6 S# S (set_tile "bkwd" (itoa (setq bkwd 0)))0 S1 x# y% B- r& X& }
)
' Z. ]& h2 w* @* h4 ^. S$ _! l (if (= (logand bk-up 4) 4)% f9 p, D# s, P8 S) T% K; p
(set_tile "upsd" (itoa (setq upsd 1)))% x. U3 l% p; f
(set_tile "upsd" (itoa (setq upsd 0))), Z" U% Q9 H M9 c
)/ p+ n) p2 I- i Z
). P8 O0 \# N% ?5 ~
;;
! I% @/ W; `- E2 M: a* R7 n ;; Attribute setting - invisible, constant, verify, preset
+ Z% G2 Z: n: F/ X5 ? ;;
7 A' f' w3 w3 ? (defun set_tile_icvp ()# O$ |) }5 F) ~# @( A
(if (not (setq icvp (cdr (assoc 70 elist))))7 J) r0 @: a- Z
(setq icvp 0)
, Y* b; |! V( t* R& {5 {9 g ^ )2 V& p& l1 v0 W3 H; K
(if (= (logand icvp 1) 1)
! o* X3 o* R* W: i/ H (set_tile "inv" (itoa (setq inv 1)))
6 z4 b! l; Z. E; d/ r' r: J8 k* B (set_tile "inv" (itoa (setq inv 0)))
! O' Q- l4 }% a$ H# N )1 R8 `, z6 x; E7 r
(if (= (logand icvp 2) 2)
4 ?, h, F* J9 r& d% h9 g: S- u& L5 F (set_tile "con" (itoa (setq con 1))). O4 g* `0 E0 \9 Z1 G
(set_tile "con" (itoa (setq con 0)))
3 F: {6 D5 q5 S& J )( F8 U/ s: G8 D, a7 e1 F0 q* a
(if (= (logand icvp 4) 4)
* _( d# u3 m5 U( R6 e- r9 D2 Q9 k (set_tile "ver" (itoa (setq vfy 1)))
+ ], u% R- t% C (set_tile "ver" (itoa (setq vfy 0)))
. K+ z# |+ Z: k, a3 ~- C; Y )
4 J. v h, e( J% c (if (= (logand icvp 8) 8)$ |3 w" v# s2 b& C q- I" l. y7 }
(set_tile "pre" (itoa (setq pre 1)))( v4 E$ w. Z& w; C! K
(set_tile "pre" (itoa (setq pre 0))) A* C1 o" d! D$ L; b, C1 g& S
)8 A) @! ?2 W6 h: V" w
)4 g7 ~$ _. }) H- b" i+ w+ N6 T0 V0 ?
;;
1 w# F/ E7 T4 Z) r/ f ;; Scale factors for block insertions
* i/ P& e( `2 f4 e: A ;;
5 W8 _* ]3 I, f8 e5 e! _9 P (defun set_tile_scale (/ temp)
) J. O% {: ?/ m X0 X+ F (setq temp (getvar "LUNITS"))7 w1 {% k0 s$ {8 F6 P6 v' }9 }3 d
(setvar "LUNITS" 2)
$ @& f$ l8 x |$ L8 { (setq xscale (cdr (assoc 41 elist)))
6 \* S* ^7 J) ^' ` (set_tile "xscale" (ai_rtos xscale))
/ T, c* O, M, E5 A7 ?6 j* i: y4 g+ r (setq yscale (cdr (assoc 42 elist))): z) ]) ?/ I! P% C" |
(set_tile "yscale" (ai_rtos yscale))' c7 n. ^" i$ |9 W" ~+ J
(setq zscale (cdr (assoc 43 elist)))0 v2 _% v# f3 k3 L0 S& W8 q
(set_tile "zscale" (ai_rtos zscale))7 l3 k8 t9 e- p; `- s' D& Q' ~
(setvar "LUNITS" temp)
7 L( z- P+ r+ h )
9 x; \% k$ ^6 h+ x" M3 B9 Q' G ;;& U# Q! `) S: U& j. i6 B
;; Rows and columns for block insertions' l7 F5 J' E+ |
;;
# y S( o! J& N* x, f" r& V (defun set_tile_rc ()
1 c$ Z5 l) G. Z (setq columns (cdr (assoc 70 elist)))4 Y( ~3 F! ]5 I' o {7 c9 z
(set_tile "columns" (itoa columns ))
. @ w5 X2 Y& o; W/ l (setq rows (cdr (assoc 71 elist)))* |- b. B+ n4 q
(set_tile "rows" (itoa rows))$ W8 Z+ U6 p: }1 Y7 q
(setq col-sp (cdr (assoc 44 elist)))7 k6 ]9 C- q. E; t$ a3 v; _
(set_tile "col_sp" (ai_rtos col-sp))
6 e% b2 N6 G/ p1 t2 a% Z: I) {+ |! z (setq row-sp (cdr (assoc 45 elist)))
+ s/ U Z- T9 Q! j' n (set_tile "row_sp" (ai_rtos row-sp)) `$ j$ b9 A6 s0 x; \5 Y8 C
(if (/= hasclip T)
3 W C# w0 @, ` b! d (mode_tile "xcliponoff" 1)
0 y! F: s7 y! W' j* R (set_tile "xcliponoff" (itoa xcliponoff))
9 M! T* l* q5 v )
; K" d8 k8 r4 A6 v0 J )2 ~+ i9 @6 ?4 x: `% _
;;
; k9 l8 e0 D/ f6 a1 n ;; Invisible edges for 3DFACE
: j! n, F* A6 t& i0 E8 `; s3 f ;;$ e3 Y$ _( ?% r* K# a0 @3 V; D
(defun set_tile_edges ()
% s1 d, [/ }. u* u- ` (setq f-vis (cdr (assoc 70 elist)))2 a. o5 l- P$ B5 ]+ L# }; E1 T
(if (= (logand f-vis 1) 1)0 E. o8 W# X5 ^6 _ N- G5 o
(set_tile "edge_1" (setq edge1 "0"))
& Y- y" O. m$ K) [- G9 { (set_tile "edge_1" (setq edge1 "1"))) E! k0 y" R5 `% o
)/ O. l3 {0 }6 G; C" o
(if (= (logand f-vis 2) 2)5 T: o( e/ k- ?4 e6 _$ T6 y# `! d
(set_tile "edge_2" (setq edge2 "0"))
& `. s; n8 k; N( Z- R' m3 X (set_tile "edge_2" (setq edge2 "1")): [" D9 c( }9 u1 E& \
), b* x6 C! V* ~
(if (= (logand f-vis 4) 4)
* ^% ?. R, o) v; V5 Z (set_tile "edge_3" (setq edge3 "0"))
3 _! ^4 U+ l* G8 a (set_tile "edge_3" (setq edge3 "1"))! Z( k: M8 }* O- b5 W; k6 e; C* n
)
+ D1 ]& c! k) O% M- ~2 N7 j (if (= (logand f-vis 8) 8)) Q$ {& O4 h9 i5 B `* d/ u1 A
(set_tile "edge_4" (setq edge4 "0"))4 c& X3 A F) p7 J+ h
(set_tile "edge_4" (setq edge4 "1"))
) T( c* m) [% y+ {4 o* c )* p& ~8 h& h5 w6 L) K1 m, {
)9 d9 _( Y1 d+ z3 w7 o" Z3 d" e8 d9 m
;;
; ]: @( s. F1 |: F2 F) t) M5 c; ^0 a ;; XYZ Point values for polyline vertex
$ a) k* H$ z4 u4 N ;;
5 _/ t, C8 [; B5 w% s( \: ^3 C (defun set_tile_vpt (ptype)& I8 {/ T ^! |5 }. T
(if (= (cdr (assoc 0 vlist)) "LWPOLYLINE")
" ^6 U0 x, _6 u! O# X (progn
) D$ W3 n5 ~2 C* o" M ;; ctr is 1 based, vertices are zero based./ w' j; g! r8 j) I& d
(setq vpt (cdr (getLwVert (- ctr 1))))! s' L5 ^( b% C; i+ m' Z
(set_tile "xtext" (rtos (setq x1 (car vpt))))
. T$ ~, ]. u8 @0 f% h (set_tile "ytext" (rtos (setq y1 (cadr vpt))))
. h* t" n" `1 J* R Y3 C (set_tile "ztext" (rtos (setq z1 (caddr vpt))))
2 q4 F" R' ^4 O4 P! t3 O ) b3 P1 _! _8 j7 Q M9 A3 ? I
(progn3 x/ J# W, @: f! k% ~* H
(if (= ptype 0)) d- @. Z+ d5 n- ~3 N" G5 U
(setq vpt (trans (cdr (assoc 10 vlist)) 0 1))
; g/ x) Z) t+ _% u2 ^, U (setq vpt (trans (cdr (assoc 10 vlist)) ename 1))
6 j4 A4 i' X7 R9 n8 i5 @2 P/ Y )4 I4 k0 U& d; a7 q8 s3 t
4 d4 ?8 h5 v' A (set_tile "xtext" (rtos (setq x1 (car vpt))))
8 l, i3 w& Z" r/ [/ K; D (set_tile "ytext" (rtos (setq y1 (cadr vpt))))
( g9 I6 q' j3 @0 |4 Z (set_tile "ztext" (rtos (setq z1 (caddr vpt))))
$ D+ x+ j s- g4 u )1 G! @8 g6 \8 Z6 ?* @
) Y. E3 F# ~$ B/ ?3 r8 T9 ]
0 W H* x3 B) I- b4 }, m' w* d
)
- R( R' A/ ]1 m7 E7 U ;; This is the equivalent to doing an entnext on the heavy weight
% A& D# t7 m; Y7 U8 h' i+ ^) N. J( S ;; polylines. The hard coded '4' below allow stepping over the, Y' Z( C) T2 t- ^6 {2 G
;; 40 41 and 42 group code information. The while loop finds the
, ? w. k0 i4 z; v0 G" l ;; first vertex which will be used as the starting assoc in the
0 \8 c3 E- _* y9 S; L ;; call to nth.
5 }2 B9 w) V. E4 R6 g( L ;;7 C) Z _) I4 Y1 V
(defun getLwVert (tmpctr / count tmp)
& u' ?7 D g- V! a2 V (setq count 0)
# O" u3 [- u6 }, @5 E (while (/= (car (nth count vlist)) 10)
4 S' w2 _4 o. h. n* G (setq count (+ count 1)). _- H1 q5 G- b6 Q* f
)7 u! ~7 _6 E3 T& R+ k- ^
;; If the counter reaches the number of vertices,
2 I( ^+ G+ i% d5 \* ` ;; reset ctr and tmpctr to zero again.. ~8 V) [' b/ w+ B4 x* ^
(if (= tmpctr (cdr (assoc 90 vlist)))
; V) ]2 ]0 x/ Q1 b" U (progn+ P) x/ t% e, D6 g3 H
(setq ctr 0)
( N' b5 K. x# _2 w (setq tmpctr 0)
. m- @' S& f2 v1 g" v )
/ J; b( d6 F4 X+ Q; x9 D1 m )
1 [3 o% t+ L0 @8 d) D2 r( ?: \ (setq tmp (nth (+ count (* tmpctr 4)) vlist))0 }4 `0 u: R! j' R0 Y9 w
(setq tmp (append tmp (list(cdr (assoc 38 vlist))))); T5 x! N) h! A1 Q$ o8 C# z
(setq pt1 (trans (cdr tmp) (cdr (assoc -1 vlist)) 1))! [! ~5 W$ _# Q! h. y
(setq tmp (cons 10 pt1))
2 @% f( _: d5 w5 y2 y (setq tmp tmp)+ ?1 v! T4 o' ?' u1 l: I& D/ [3 P
)
8 {& _ _ z. X" O* q$ [ ;;
) I. \# q, P3 k$ e+ q! p ;; Set tiles for Spline properties. If the spline is rational then we2 v6 l, C3 N) K( P* `
;; need to display the weight values of the control points, so set5 j/ m9 W- _4 }6 i4 u+ I% z1 o$ s/ I
;; flag to 1.! p; W( i/ y5 F6 `6 b. ?" D
;; 1 = rational spline
2 k `( Q: N. I9 J+ R3 H; H8 [# c: T ;; 0 = non-rational spline) w$ g+ W/ z+ d, \* k
;;
) f1 O& T9 T* F$ M7 O9 u (defun set_tile_spline_props ()
& M. |* c* [% E1 D$ O (setq rational_spl_flag 0) ;; initialize rational spline flag
0 E" r* m1 N* Q7 y$ L& D/ S (set_tile "Degree" (itoa (cdr (assoc 71 elist))))
8 c! C0 q! _: U1 h9 l9 E8 B (setq bit70 (cdr (assoc 70 elist)))
0 B+ t* y* {9 |; w (if (= (logand bit70 1) 1)1 q) M/ K" X; U1 y. } A
(set_tile "SpProp4" "Closed")
! ^' I8 R2 w* w. z9 s (set_tile "SpProp4" " ")) |9 ~/ n7 F+ a A) r b
)
4 M9 |8 u/ u8 [7 E (if (= (logand bit70 2) 2)
" w, z& M9 J. u7 L (set_tile "SpProp3" "Periodic")
4 x2 G+ {4 k8 q6 E" G (set_tile "SpProp3" "Non-Periodic")
' D1 Z* |# f! ~. l9 a" I3 P* r4 r ). ^" P3 R9 ^$ y: v7 t) _1 f& k
(if (= (logand bit70 4) 4)( D7 m6 y! _) x( e# o$ W* ^" e
(progn: g5 h0 t" J$ e
(set_tile "SpProp2" "Rational")
2 f( g- E8 g M( c9 f$ |# M9 \ (setq rational_spl_flag 1) ;; this is a rational spline
+ E4 U! J5 V; u1 Z; i; m )
# g) {8 a0 h5 z2 K! s2 e! f* Z (set_tile "SpProp2" "Non-Rational")
+ J0 R: S8 t" o- Q5 C* T& _8 g )' T- `9 ^0 W* H2 H1 y
(if (= (logand bit70 8) 8)9 T# b2 j, s* Q1 D G
(set_tile "SpProp1" "Planar")
+ ~# W, b7 a& Y1 ? G& w! E (set_tile "SpProp1" "Non-Planar")
4 K: E9 d P" a( w$ @8 A3 R )
( K- t3 c# V' J t' x# V (if (= (logand bit70 16) 16), c! y8 s$ T) p& m) W' [. x/ B8 r* [: P
(set_tile "SpProp5" "Linear")
9 Q8 y( r i1 A+ q! j! y% ~; ? (set_tile "SpProp5" " ")2 g" |# C0 Q8 c7 n2 b) c
)
6 m2 P, T; E3 K, W/ z5 c* @7 f )9 B8 ?" O% M# ?/ G5 u$ M; h
;;6 p! z9 ~3 f4 k8 o8 s, k% k* Y
;; XYZ Point values for spline points, ^7 W/ V5 q; ]. M* V: m
;; Need to account for WCS/UCS4 ^' V r n0 L- U) [. s4 Z. e
;;0 i: I5 f8 x! W9 u8 @. g+ o' h0 x
(defun set_tile_cntl_pt ()
+ d9 D0 y# @, ^ T" Y% k (setq cntl-pt (cdr (assoc 10 elist)))
o K# P( y3 n- y) r; {2 y( ?+ G (set_tile "xtext" (rtos (setq x1 (car cntl-pt))))9 D; u* d/ @! X, g
(set_tile "ytext" (rtos (setq y1 (cadr cntl-pt))))
& r( x' e3 r% `- k' p (set_tile "ztext" (rtos (setq z1 (caddr cntl-pt))))* j5 l9 p1 F4 Z
(if (= rational_spl_flag 1) ;; if rational spline' I f% f, a6 w% D& ?1 L/ p
(progn ;; show weight' }8 I- Z* H4 q$ x
(setq weight (cdr (assoc 41 elist)))
# L5 x/ Z: U/ O7 y+ b9 B (set_tile "weight" (rtos weight))- d, _" Y4 Y. ?- \! k" Q5 g7 a
) ;; else* S0 P4 U% {" p% N: ~* W6 v C
(mode_tile "weight_text" 1) ;; disable weight field
" o( b3 G1 u- `5 F' | )
" }8 N! ?1 {- i- Q& a" W8 O$ m+ y )1 N& e9 {: g: ^3 Z6 q* s- O
;;( |9 R3 K: c! r7 e- p3 H- o
;; XYZ Point values for spline points% C& o- y$ L) [" X' I. U( b' S
;; Need to account for WCS/UCS
/ v- v. N0 n1 a3 b: z! H" y ;;
& Y$ U% h# \# S' G (defun set_tile_data_pt ()
W( G2 z' ^1 k& `& d8 v7 F (if (not (assoc 11 elist))
: H' R0 E0 |4 J D (mode_tile "data_pts" 1)+ |, I( ^3 N7 H% v& h& L% L
(progn
3 t+ F) w" Q. J& Z& ~3 }8 o6 W (setq data-pt (cdr (assoc 11 elist))) N9 p: o( @% f- @
;; display points with current precision.( R" _$ o% V5 [# L u: p
(set_tile "dxtext" (rtos (setq x1 (car data-pt))))( M' f4 {# t/ ?& B5 e1 h
(set_tile "dytext" (rtos (setq y1 (cadr data-pt)))) P9 V3 E: \. y/ R. b- e- [
(set_tile "dztext" (rtos (setq z1 (caddr data-pt))))& [9 S: E' T6 j: p- f' T3 W: o
)
! D" k7 r/ `, y) w2 ~0 l e )
; {1 T. |7 F/ I; M) W: T )2 L' o7 w# @' |6 J
;;
; H3 s4 @* Z, m0 |* o ;; Fit curve, fit spline, or smooth spline surface setting3 A4 g! O, C+ X. [0 ?7 w
;;
2 A6 T2 ]3 q- N (defun set_tile_fitsmooth ()
, L& v9 n% T' \ (cond. [1 J/ Q$ [; f8 P Q9 w$ w& l
((= (cdr (assoc 0 elist)) "LWPOLYLINE") Q3 G1 H7 v& H+ ]0 m
(set_tile "none" "1")% o3 @. l" B' A' _: b
)
" b& ~0 K0 H2 h Y6 W, g ((= (logand bit70 4) 4)& f+ }7 h$ @# P% z
(cond
2 y$ B' S' b% ~" A) K& u$ z ((= bit75 0)+ ^9 M7 C7 M: c! w: j# B2 q7 j
(set_tile "none" "1")" b3 ~3 @4 I& J
(setq spltype 0)7 s- b& O! q) ]% j U; L' h
) ^; b+ Y7 B: x8 j/ X8 H; B
((= bit75 5)
) o8 p8 D2 ^/ [& W (set_tile "quad" "1")
) _* B; N( u) |% h3 Z0 l9 d (setq spltype 5)
$ `4 L% X E5 y2 D/ o# f( s9 k )
- W0 x0 k; Z% a. i9 \. r( Y ((= bit75 6), j% v8 d& K% V, p; \ D7 ~
(set_tile "cubic" "1")
* N" i/ ?! F4 n (setq spltype 6)3 h" v/ U9 q1 N: f( M& O
)/ w. Q, E% c7 B; I
((= bit75 8)
3 A% [; r$ r0 t4 g (set_tile "bezier" "1")
% i F7 y/ ]( @6 V; ~ (setq spltype 8)7 {0 I) S- W; F, d) G
) q# m8 Z: H! W# F9 P
)
/ ~$ p3 O/ w! X+ j0 L )
& J% _7 N3 y8 N ((= (logand bit70 2) 2): V4 h! P5 q% g" r5 n$ J) ~0 P
(set_tile "fit" "1")
6 x, X, L0 v# j) { (setq spltype 1)/ m# j; I4 e8 q# a( q/ n9 g
)' B A$ c2 `2 k
(T (set_tile "none" "1"))
/ N9 y1 `$ n& g( x )+ ^6 _0 A% H4 Y- L1 g( C1 q
)
. K+ O2 T6 x5 H6 z ;;
1 b* \. ]# N& }4 `% k ;; Closed or Open mesh and polyline setting4 V; N$ I/ r; x' m' G' ~' L
;;
+ O3 L$ |+ v1 l8 E: G( W (defun set_tile_closed ()3 M% a" z! k/ G' C" D
(if (= pltype "3D mesh")
3 O$ a0 m# i9 v (progn( \" i" Q4 e0 i, V7 U/ R
(if (= (logand bit70 32) 32), X5 Q6 o7 P; S2 D% g) U
(set_tile "closedn" (setq closedn "1")). w% M! r# o( w" A+ v3 B% |& B
(set_tile "closedn" (setq closedn "0"))
( D- Q' \3 f+ ~0 r )
~1 Y6 ]2 D# w1 h (if (= (logand bit70 1) 1)
5 f- x0 o1 I" g D& ~ (set_tile "closedm" (setq closed "1"))
( f E; t* ?) m: L( B, g (set_tile "closedm" (setq closed "0"))% O1 k. q0 s! {; @& e# e% r6 {8 t
)2 J$ s0 H5 o2 \, }4 g
(setq old-closedm closedm old-closedn closedn)% I! z! k) C/ y
)
% J! }8 O2 h% }+ t3 v1 u )
' h' t6 O- y4 _$ c( a8 w (if (or (= pltype "2D polyline")
D0 \9 R4 H% r1 l6 ]3 c (= pltype "3D polyline")' |. K l7 p. D# b5 @7 R+ D* j: Q
)
# v9 t! c; P# L% F (progn
" y6 C! B# A$ E: I1 O# T (if (= (logand bit70 1) 1) \, }7 B) f' l Q+ N
(set_tile "closed" (setq closed "1"))4 s, f( R+ z7 G9 O9 Q. q; R7 X F( b
(set_tile "closed" (setq closed "0"))
& c9 @- `9 Q* `6 ?1 } )7 V& k5 C) X4 C0 q
(setq old-closed closed), ~$ I9 j. z) |- D$ n; E! @
)
# ?' z; u; i; z7 K; t6 T/ m' a3 p )
, h7 V) M; R$ o" y8 e. ^4 o( Y; i )" t8 O8 S: @6 q% G
;; Set common action tiles
2 F3 _3 K# M6 y' q ;;1 Z% A4 s2 K4 s2 `4 ]6 i
;; Defines action to be taken when pressing various widgets. It is called& j4 P! ?0 U# g: Q4 E
;; for every object dialogue. Not all widgets exist for each object dialogue,$ |# F9 y# I# U- \5 Q7 S4 A$ T/ ^
;; but defining an action for a non-existent widget does no harm.9 D, k% Z! c( j9 o" R$ f- ?4 j
(defun set_action_tiles ()
: p1 @* G. H2 p1 ^% T (action_tile "cancel" "(dismiss_dialog 0)")
) v- `* f* E: _! O1 t/ k" { (action_tile "accept" "(dismiss_dialog 1)")& W8 D5 F9 i* h; k( p' [
(action_tile "help" "(help \"\" help_entry)")
/ a' e( D5 I5 v3 W& H2 @ (action_tile "b_color" "(getcolor)")
: Q/ i# O6 E1 o4 D# l2 ]* u (action_tile "show_image" "(getcolor)")9 \2 |! U% O6 W+ `5 I0 R1 D- }
(action_tile "b_name" "(setq elayer (getlayer))")
0 l. R$ N5 e. Q7 M' C2 t (action_tile "b_line" "(setq eltype (getltype))")
3 ]* t& D9 N! g, W (action_tile "eb_thickness" "(getthickness $value)")8 F6 |2 Y5 S9 T4 n& |
(action_tile "eb_ltscale" "(getltscale $value)")
' [6 ~2 C1 G& d. R! _2 M5 M
4 M3 t3 V, t8 M l (action_tile "pick_1" "(dismiss_dialog 3)")
# r. Q& L5 S. i9 o; l, Y2 i/ a' r (action_tile "pick_2" "(dismiss_dialog 4)")
$ { o$ x$ d) ~. G5 B9 Q- T (action_tile "pick_3" "(dismiss_dialog 5)")" b8 e- V" `! {/ N3 d9 u8 s
(action_tile "pick_4" "(dismiss_dialog 6)")
! Y( a8 Z/ P4 F" x$ n, I% l3 f (action_tile "x1_pt" "(ver_x1 $value)")0 |4 H( ~8 b/ p" |3 A/ E0 _
(action_tile "y1_pt" "(ver_y1 $value)")! ]6 B( E/ E( q& K5 a) g$ [
(action_tile "z1_pt" "(ver_z1 $value)")
4 v1 d2 ?. H- g (action_tile "x2_pt" "(ver_x2 $value)")4 R9 g2 r" D7 K2 d$ y5 J
(action_tile "y2_pt" "(ver_y2 $value)")1 _- Y) t, s2 q) l& f$ I1 ^( [
(action_tile "z2_pt" "(ver_z2 $value)")
) s& Z' G; m) j8 h4 E# M& q (action_tile "x3_pt" "(ver_x3 $value)")0 u1 I# T/ y' i- f
(action_tile "y3_pt" "(ver_y3 $value)"); f- I. T; m6 `0 a4 M1 h
(action_tile "z3_pt" "(ver_z3 $value)")
% p" ^6 a5 \+ T# t (action_tile "x4_pt" "(ver_x4 $value)")
' X, @) _9 X$ e6 S1 O& x (action_tile "y4_pt" "(ver_y4 $value)")
/ F) }9 t1 R0 Z3 A. S$ U (action_tile "z4_pt" "(ver_4 $value)")
6 z5 [( Q3 D- K3 l1 H8 t; \1 z, A9 A/ X+ ^ L+ K
;; Action tiles for Xline & Ray
* i- \' f$ G1 c( f1 j% X (action_tile "xline_x1" "(ver_xline_x1 $value)")
5 ]0 K+ U- d' E4 P (action_tile "xline_y1" "(ver_xline_y1 $value)")' q7 O4 o3 b& F. Q4 _* B+ r/ I
(action_tile "xline_z1" "(ver_xline_z1 $value)")9 C* X1 H- P9 `6 K- j' l6 v
(action_tile "xline_x2" "(ver_xline_x2 $value)")
: f( v( @+ n3 T& P1 n (action_tile "xline_y2" "(ver_xline_y2 $value)")& F) A: b3 y$ w$ W1 w9 o, u
(action_tile "xline_z2" "(ver_xline_z2 $value)")
1 u5 V) t: W$ z$ d. b$ g9 O8 t9 R- t4 h4 |/ @4 K8 x
(action_tile "edge_1" "(setq edge1 $value)")
, f! ]+ c- l/ U (action_tile "edge_2" "(setq edge2 $value)"), e" }$ C* c: k
(action_tile "edge_3" "(setq edge3 $value)")$ R9 [5 r% N# H! t. I
(action_tile "edge_4" "(setq edge4 $value)")
P( D8 |5 d" m& X
6 {- a# L/ C) _* X% p (action_tile "radius" "(ver_rad $value)")4 j1 N8 L% s3 i
(action_tile "st_ang" "(ver_ang1 $value)")
8 J& Q% O7 U* I5 j& p (action_tile "end_ang" "(ver_ang2 $value)")
( X2 C' ?3 [$ q% U1 y (action_tile "end_eang" "(ver_eang $value)")7 }/ i& Q8 S1 ?- y9 {
(action_tile "minrad" "(ver_minrad $value)")
/ t& l1 B; U' I- q" T/ J( [ (action_tile "majrad" "(ver_majrad $value)")
& u5 C+ E7 B9 i! |/ y4 }: e" Q, Q$ i( H* q$ ]
(action_tile "xscale" "(ver_xscl $value)"). x+ G: W. o) G. ^! R
(action_tile "yscale" "(ver_yscl $value)")8 ?& J8 n) |% t) r: z
(action_tile "zscale" "(ver_zscl $value)")
. [/ n/ F7 V. ? (action_tile "rot" "(ver_rot $value)")
4 y9 E+ C; w6 X: r& S) P5 U$ t/ { (action_tile "columns" "(ver_col $value)"). G: y" { c- K
(action_tile "rows" "(ver_row $value)")
) W, r$ y. ^* h, O5 q (action_tile "col_sp" "(ver_colsp $value)")/ j: r( h+ T+ o4 T- V9 [8 E
(action_tile "row_sp" "(ver_rowsp $value)")% W H w! ~# y9 _, [; p
) {% U( J. ^, Y. ?& R
(action_tile "hght" "(ver_hght $value)")
2 t# H) g* s: a3 k1 b$ t6 Y/ J! @ (action_tile "wid" "(ver_wid $value)")7 Q+ l& n8 @# t+ T9 N
(action_tile "obl" "(ver_obl $value)")5 }, Y! F2 L4 [9 e' @. ^. x
(action_tile "style" "(style_act $value)")
( P" X' ]9 v- b
/ l% ]$ Q: ]6 B- i, [ (action_tile "t_string" "(ddgettext)")
$ {1 s% T+ k, ?2 I. i J- ?2 S (action_tile "tag" "(ver_tag)")
# f" L4 \) n. X9 W \( X# I, b/ P (action_tile "prompt" "(ddgetprompt)")- W5 `9 q6 L F$ n
(action_tile "bkwd" "(setq bkwd (atoi $value))")9 [& i0 G# n w7 f5 [
(action_tile "upsd" "(setq upsd (atoi $value))")
) Z2 i6 M y* ^3 E: Q) z: X' z* v (action_tile "inv" "(setq inv (atoi $value))")* c9 O L5 e2 S# x
(action_tile "con" "(setq con (atoi $value))")
/ l) g- s# e- S (action_tile "ver" "(setq vfy (atoi $value))")
9 N4 {2 K: P9 v0 k/ c (action_tile "pre" "(setq pre (atoi $value))"); w4 j1 @$ i8 P* u k# X3 m
(action_tile "popup_just" "(jlist_act $value)")* t9 A0 R. h- h9 M5 c6 d6 \
9 }/ R0 ~+ e4 R
(action_tile "closed" "(setq closed $value)"). @- {$ Q9 \- b% s
(action_tile "ltgen" "(setq ltgen $value)")
$ [ M- V9 T. p+ L1 e (action_tile "closedm" "(setq closedm $value)")2 K$ z# V) B/ k- ?. `# `
(action_tile "closedn" "(setq closedn $value)")( h8 ^( r: j7 N' ^% M. W x
(action_tile "next_v" "(next_vertex)")9 H2 p j5 G7 _: y* ?) C% V4 q% \
(action_tile "xcliponoff" "(setq xcliponoff $value)")4 e) q" W& g9 R& J
) d" s3 S5 m% x4 i (action_tile "next_cntlpt" "(next_cntl_pt)") Z8 L6 h5 T+ u$ F- ?5 H" n# }
(action_tile "next_datapt" "(next_data_pt)")% v. |% {' f# j J
c9 q& Z" d6 m) K0 \ (action_tile "none" "(if (radio_gaga \"none\")(set_uv 0))")# B% o- b6 u; Q) E/ H6 M! \
(action_tile "fit" "(if (radio_gaga \"fit\")(set_uv 1))")% a2 `$ Q- N& a+ J9 H; x4 x% j$ L
(action_tile "quad" "(if (radio_gaga \"quad\")(set_uv 5))")
8 Z) C. F' G b( q! ?) z2 d7 r% Z) \ (action_tile "cubic" "(if (radio_gaga \"cubic\")(set_uv 6))")
& X' J4 S( H3 z7 _/ y1 N* ] (action_tile "bezier" "(if (radio_gaga \"bezier\")(set_uv 8))")
( j: t9 f$ l1 A" w% L5 Q9 @, U5 S$ u: f0 t9 y' `; p; G+ P
(action_tile "u" "(ver_u $value)")) d& T7 x* [* D; O K4 d
(action_tile "v" "(ver_v $value)"); Q5 U% J4 @- A7 n
)% [) P( L* f4 i* v* S# L" [- j
- G0 R4 p, K7 H! I" } (defun ddgettext()! [$ c6 I; {# [* Z; d
(setq text (get_tile "t_string")) A) @6 ?8 Y+ E5 h
)( X3 a/ G- X8 o* g
' q; ~/ q4 k- p& v
(defun ddgetprompt(): \+ E, c. _: g! M4 S- Q. g) T
(setq atprompt (get_tile "prompt"))
: U7 i1 _9 n$ _! v2 D5 T )
6 R/ D& v. S7 B! j7 \0 c1 o6 d& @2 W8 o4 c
;; As OW doesn't support disabling of individual radio buttons within
* u1 y9 K& u, Z8 G2 M& r2 v ;; clusters, a check must be performed as to the legitimacy of the+ I7 B/ q: Q4 M* U! k; K
;; button pushed and reset if necessary.
\' H7 Y) i4 r6 w, o. m3 ~8 `0 g; ~* { (defun radio_gaga (pushed)
( Q8 _# B- `( [ (cond* d& w* H, N( `# h; y) i1 }6 X
((and (= pltype "3D polyline")
4 p, E5 l$ ^1 b9 p7 `6 r5 Z (or (= pushed "fit")
+ ]( t7 a& z% c! p8 w (= pushed "bezier")% m! V5 b+ _3 ^* Q
)6 }$ V: H* G2 g- x3 t- ^+ P& L) M
)2 V' a5 N9 G) s U9 ] F0 ~
(set_tile "none" "1")
% T, ~5 ^) Q6 x nil
, v, D- k4 ^2 k3 d+ o& k )
9 w4 q4 i7 x( Z8 p ((and (= pltype "3D mesh")
; j! n! I1 I& G5 o0 u P (= "fit" pushed)& p# _( W& B) C' Q
)
% W* ]( y1 `$ t* I2 T3 _ (set_tile "none" "1")
: y0 d% M! O. A% |% `7 R: Y3 _ nil- p8 l% A/ {, Q% Z# o
)4 |7 i Q# \4 k
((= pltype "Polyface mesh")+ M+ U* K; G+ f: B& E
(set_tile "none" "1"), v0 V( _( c- v4 T' S- L6 r2 D0 m" \( U
nil
* O8 l9 Q/ a" k2 H/ t0 P6 J- m0 | )
2 k6 @0 ~' a' \* t& @2 x& ` ((and (= pltype "2D polyline")# Z* q, u6 F( Y# {! Z
(= "bezier" pushed)
2 G0 l7 v0 |, Q3 ?8 u4 {% n2 i )# j$ c: ?; P- `- o3 V, L" A
(set_tile "none" "1")
& w" Z9 H6 `3 D( x# {3 d nil$ D5 y6 m8 A" f( [& o
)0 t- Y* u8 b% ]1 [! X# U
(T)
! B6 \! b, K) N @- h )
" i/ u$ ?/ z! q' w( i ). a2 A# T O4 Z- \5 @
;;
3 k) a' X; r9 w- n (defun set_uv (type_n)2 y/ x. S0 _' h( q3 \+ Z
(setq spltype type_n)6 E# O0 |! d( N5 H0 }4 g. a+ R4 D# X% N* G
(if (= pltype "3D mesh")
' ~8 B( u; W7 x+ o% X2 t4 n (if (= spltype 0)
/ ^. ~7 X" d' }( y! v w- c (progn
8 J9 m9 h( K7 O' C (set_tile "u" (itoa (setq u 0)))
3 {7 {2 V. n3 W+ c" t (set_tile "v" (itoa (setq v 0)))
- Y& {6 g) k- E4 p5 _# P# D )
7 F. w$ F6 `+ n* D (progn
" R. }1 _0 J+ y c7 m/ b (if (= u 0)
5 L8 X* m2 m; i& S- e7 _ (set_tile "u" (itoa (setq u (getvar "surfu"))))6 ~# P) y0 {' _" V* U. Q* g
)
) F* |. x l F$ l, m( [ (if (= v 0): ] J' }" t) v) S# |! ~
(set_tile "v" (itoa (setq v (getvar "surfv"))))+ F# u6 ]/ P# {' w5 m1 ]
)
. ~; v0 x4 A; o: y )2 w" H* F R3 M" j; L) K
)0 J. M- h+ C7 m! |! K2 c) A
)% k4 x. `; ?9 i6 Q
)
8 W5 j, X& r% z$ }' d
" R: |( K5 G1 `2 d& c, d1 k5 p I5 K
& Y T, Q; H4 P' ~* P0 H, C ;;/ N+ z* P/ V; B, S }
;; Verification functions
/ A0 y N; `) A! j. h; z ;;: g g" w: n) Q' Q
;; Verify distance function. This takes a new X, Y, or Z coordinate or! T2 e: N& d) I" U: I- K* i r
;; distance value, the tile name, and the previous value as arguments.
( a$ A e6 J- f" c ;; If the distance is valid, it returns the distance and resets the tile.
2 w* T V, c9 b: w4 M) G: Z ;; Otherwise, it returns the previous value, sets the error tile and keeps) N! [" _, E: T2 }, E7 J( B
;; focus on the tile. Shifting focus to the tile with invalid value can
$ L. A: w" n; c" K4 ? ;; trigger a callback from another tile whose value is valid. In order
% Z% E" ?' }/ M; B$ s+ L" X ;; to keep the error message from being cleared by this secondary callback,
% d5 j1 m" D3 n: t+ _; g* p- v: o ;; the variable errchk is set and checked. The last-tile variable is set
6 r# B- f8 U0 ?9 ?; c! h4 [ ;; and checked to ensure the error message is properly cleared when the
% ^- X; n' H5 O( {/ a, X ;; user corrects the value and hits return.; s2 S/ r- _% {# R* Y6 m h
;;& V4 T8 x' q. l! v. F: g5 k
(defun verify_d (tile value old-value / coord valid errmsg)/ s$ r) H. I5 ~' a9 a
(setq valid nil errmsg "Invalid input value."); e; `) C" n' `& a& \2 w
(if (setq coord (distof value))
4 |% }) a' i" M; z; m& q3 m/ v (progn
4 l% r0 a2 \# f! r$ ] (cond
* Z1 Y" u! J, T5 h e ((or (= tile "radius")
# K2 y h! K0 P/ K (= tile "hght")
3 F- }9 V3 C1 a" `0 _. ~ (= tile "wid")
. `/ W, y% X- {% x) c6 { (= tile "majrad")
0 P2 s- k/ z9 i (= tile "minrad")
% H c g' g& _! v (= tile "eb_ltscale")2 i5 f$ t! f7 X1 T1 ]+ T
)& X2 e/ }# r5 @) `& K; }( T
(if (> coord 0)6 f* F5 a- u& I
(setq valid T)
) h1 @( W4 G8 _8 \ (setq errmsg "Value must be positive and nonzero.")
: h5 |( _; A. h# b$ [ )2 J- F# a' B4 w& C% w
)) J9 J$ J$ I! Y- ]/ r# y4 i
((or (= tile "xscale")) f$ d* k. ~: l0 Z+ O' L5 g
(= tile "yscale")
$ z. _* x5 {1 h4 G( c! }' a4 k4 J (= tile "zscale")
8 e3 B/ }, Q; b/ a )
7 [& K( b: ^9 p6 E% b (if (/= coord 0)) U0 J3 O7 u+ e+ i3 Z. r3 k
(setq valid T)
* y/ z5 p# U- s: b3 o- p (setq errmsg "Value must be nonzero.")( w0 h0 i0 o$ U+ L9 @$ G5 J
)
, X- ~8 G$ R& b" Q$ B) ^- x |7 y. X" ~ )
# y! W4 Z$ d& n6 {6 I% L! } (T (setq valid T))3 C. [+ Y6 ^! ^
)
" G+ |* Q+ x9 g) x )
! f8 E! L0 F# p; c (setq valid nil)
- v- h/ F$ z7 M7 H& @% I/ G' a )1 w% U/ s. B+ j2 K V
(if valid+ r& t5 _7 u1 _, R4 C3 e( \
(progn
( U& ^8 N% X& ~+ S6 N (if (or (= errchk 0) (= tile last-tile))
: Q; a, V' G2 U$ d (set_tile "error" "")
' o5 L2 |$ G% {. z; t )8 E3 Z9 L* g5 c; w
(set_tile tile (ai_rtos coord)): M3 S( U S% e* Q. j
(setq errchk 0) u9 V5 ~! e1 G8 ]( k% R$ H% W z
(setq last-tile tile)
T! b' i+ q/ p, P0 M" N coord
* l& G2 h4 B, F4 F: A, \ F% T: @ )
! A, J; N0 a" V! } (progn* M$ M) d# o2 F; d
(mode_tile tile 2) ; Move focus to offending field
" A# G: w4 |, w (mode_tile tile 3) ; Select offending text1 F; ^- @1 @: ?/ U/ N
(set_tile "error" errmsg)
# ]: h9 Z' T5 P7 b (setq errchk 1)/ o x" T6 p% |: R
(setq last-tile tile)
& F5 b7 w- p" v! Y! k6 D! }& g" b old-value# r3 q# z8 P; U; Q @3 P+ A
)2 i, [# z+ E0 a( h( x
)
4 q# I5 i' J$ P1 }- [; x( A3 c4 [$ r' f )6 h, O* |# H6 I& a
;; Function for Xline coord edit box checking.
* r6 i0 P6 _. \% c& y9 ` (defun verify_xline (tile value old-value / coord valid errmsg)
- a. T% ?" s& N% S @% t( e (setq valid nil errmsg "Invalid input value.")9 v8 T- R6 C# r: S* ^- e
(if (setq coord (distof value)) ?2 P9 s: {+ U! q4 N0 g7 y1 r3 m- Z" N
(setq valid T)
D" m ~% c$ B0 s' `+ l7 ^) q (setq valid nil)
( j" c2 l6 x. A5 s# g. D ); u$ E# o' q9 e2 g5 K
(if (and coord, |$ F- m; M I Y4 x# ^: a% K
(and (= (atof (get_tile "xline_x1")) (atof (get_tile "xline_x2")) )( d o6 {* |, b. D2 o
(= (atof (get_tile "xline_y1")) (atof (get_tile "xline_y2")) )
2 E$ e% ^; E' Y* |5 C, |% J0 a (= (atof (get_tile "xline_z1")) (atof (get_tile "xline_z2")) )! H3 J3 Q1 G# t. j3 ^6 R3 j3 m$ w7 k
)
8 j b; e2 z8 D( y/ |; l c )
0 B+ Z, @5 @6 b' w* m& X (progn% k& ` E% A: l2 q
(setq errmsg! L/ y, t! }% f$ z3 F
"The Root point and the Second point cannot be equal.")$ V6 m9 K7 } B! J* a( e
(setq valid nil)
3 ^9 z9 W' s" c8 E) x- C ?. ^) N/ X) x )8 ?! J7 n8 b% p1 g3 ^ u
)
7 n1 m5 j. B5 x (if valid
8 ^3 H0 d+ e& c* e5 K$ N (progn
" q: H: a) X6 O3 f (if (or (= errchk 0) (= tile last-tile))# y7 I" O; `" K2 t- t
(set_tile "error" "")" t! t- v! G! d0 \" {5 h5 o
)2 j% R7 [9 T. t# Q9 X/ w
(set_tile tile (ai_rtos coord))
- j- [' t; D ~% I( p (setq errchk 0)9 K: j. v4 B5 U$ h, x4 H* V. R" W
(setq last-tile tile)3 |/ }0 m) H: H7 w% _
coord
, {, n2 w L" p" ] )1 F7 V0 r) | h, G: i' V; e" k: |! v
(progn! Z/ k1 P$ E. ~8 W: H2 D0 x. ^
(mode_tile tile 2) ; Move focus to offending field
7 J' A; l' R; \' O7 d* y (mode_tile tile 3) ; Select offending text
( D$ q. A8 `* y. p' b6 y (set_tile "error" errmsg)
/ s. W+ x7 c8 |( {1 }! z0 ? (setq errchk 1). J% } [) Z1 D+ @8 O" a+ `- E
(setq last-tile tile)0 x m* z) J! l4 X6 v
old-value2 ^/ A9 r. s. q& F: A, ^3 q
)
" j8 Z3 t. i; x& H- s7 @8 u )
% A2 ^& r: M8 @. n5 d0 [# @& } )$ k7 v# B! Z, I" W x2 p
7 S( m$ D( J4 V1 m ;;( P1 U4 w; O& l
;; Verify angle function. This takes an angle and a tile name as arguments.
6 d/ a* u8 [' ~. d* A4 M) x ;; If the angle is valid, it returns the angle and resets the tile.3 @- K3 H" d5 q* C- L4 K
;; Otherwise, it sets the error tile and keeps focus on the tile.6 @ ^+ n+ C- u1 D3 X# o
;;
6 g9 O) Y7 \! H6 f* S+ F! J (defun verify_a (tile value old-value / ang valid errmsg oblqmax)( P5 ~' X H6 _9 @! g) S* `2 ^$ O. m
(setq valid nil
4 a8 K( x5 H1 {+ ^) }# f; U errmsg "Illegal input value."- v! h- t1 U& Z9 j# G8 k" |
) O: Q0 e. j. N. n, a2 n4 `7 A
(if (setq ang (angtof value))
5 M) K$ h. f: P1 l8 p (cond
# w$ S) m. d, \) o/ e+ t ((= tile "obl") ; Restrict obliquing angle
! D' M2 M* `- \. q( w$ i! W (setq oblqmax (+ (* (/ PI 2.0) (/ 85.0 90.0)) 0.000001))
; I( O6 `, g* P0 P4 C (if (or (<= ang oblqmax)
) k/ i2 p- ?! @! f: }( G6 V (>= ang (- (* 2.0 PI) oblqmax))9 m, r& U0 {5 V a
)
0 W: V( Y |% j5 w! C ]) b (setq valid T)4 c4 v- g* V8 m3 w& N% ~ B
(setq errmsg
5 x& r) ?6 t+ g "Value must be between -85 and +85 degrees.")
% c" M! e5 Z2 q k) P )
5 g% p: B+ u+ k8 P: N( X1 O )
' O S. L' r3 J% b% O) B (T (setq valid T)) ; Other angles not restricted9 V0 h, T; \# E8 ?' ^
)
% J, Q- T' y6 g* P+ O1 m (setq valid nil) ; Invalid angle input; Z& z( p3 O+ h) m- Y: N
)$ B/ z0 A) X% y) J) j
(if valid, a! d7 A4 U3 U7 [! T; S
(progn
8 ]' t% u% w# R5 o9 H6 E (if (or (= errchk 0) (= tile last-tile))
8 v, p% N& Z4 d0 P5 q7 o8 q (set_tile "error" "")( u; G+ t- Q( Q1 K% I
): ]. y7 c9 ~+ c' `" v
(set_tile tile (ai_angtos ang))% w( H: j, G- ]* l
(setq errchk 0)
7 f1 y% S6 ~$ @* L (setq last-tile tile)- G! h* M; E2 C: `; s2 R" X1 B
ang
; e3 Z$ {3 S1 l4 f )
0 T9 K6 J' G: ~! C# e6 b6 t (progn
M, Y0 D( a; \ b (mode_tile tile 2) ; Move focus to offending field( L' D: n- g8 R$ o" e
(mode_tile tile 3) ; Select offending text8 w2 p K" \5 c1 Y6 T
(setq last-tile tile)
& k- P7 J+ j. _; q (setq errchk 1): I2 ^ L1 @ O* y* L
(set_tile "error" errmsg) Y# {) e. ]. @) t+ o
old-value
; W8 R! `0 U" i( M )
+ m) c e/ K) A6 _: M )1 L1 h5 \& B& A1 O( U, a% G, |% W, a
); k$ M6 h, B7 _- x' J& @* u
;;9 ^& c3 d$ Y5 D- n; n0 a& [4 C
;; Verify angle function. This takes an angle and a tile name as arguments.
7 a$ i" J1 f/ h' f ;; If the angle is valid, it returns the angle and resets the tile.4 e& ?) W& o# x* j+ v! k2 u
;; Otherwise, it sets the error tile and keeps focus on the tile.
, t4 U3 {4 W* C4 v0 B ;; This function is specifically for the end angle of the ellipse object. If
2 s \, h8 P# W5 D. n: m! [. E ;; the end angle resolves to zero then we want to display it as 360.
& @" z) w# q+ p; g$ h ;;
( ^+ [+ V3 z; D. e+ b (defun verify_ae (tile value old-value / ang tempend)0 }1 e3 k$ s" m m
(if (setq ang (angtof value))/ C4 w( X% O2 O3 \4 t8 K
(progn
! Z: @9 y% B j* m2 X* K/ S1 c (if (or (= errchk 0) (= tile last-tile))
9 I) |5 y8 ]6 Z1 E3 f (set_tile "error" "")
4 \' G3 M) [+ ^0 T4 a! R* | )
- p1 s' {; v1 y0 m# l (setq tempend (ai_angtos ang))
* U$ l) B% K7 K (if (= tempend "0")& D' r0 X$ `0 R/ a4 D1 l3 q8 c8 j
(set_tile tile "360")
# Z: q% c" t) A7 H+ {( t (set_tile tile tempend)
+ F* ~( \ x' n1 V )$ d8 |5 Q; f# t5 O* |1 h
(setq errchk 0)
! @9 Y* O2 h0 q% c" J6 i) L! l8 B (setq last-tile tile)
# H* |0 R. w# Q6 o ang
0 S- ` p/ ?8 W' w2 t+ ~& j )
) |' i3 ^1 B. K- a% A (progn3 d, A6 T1 C) u$ H& x- t0 G' \
(mode_tile tile 2) ; Move focus to offending field
. e$ k8 ^3 W+ `" N1 M. B; R: x (mode_tile tile 3) ; Select offending text
" M# o8 M7 s9 K (setq last-tile tile)
* N O N- n+ p3 d9 G1 f2 J0 M9 R (setq errchk 1)
& R5 E( E% W' [& Z1 ]3 _ _! \3 [ (set_tile "error" "Illegal input value.")5 v2 j* y- f7 M/ l4 G5 R1 n
old-value' T! ~2 K8 E8 s' c1 U
)
! x8 x6 `$ J% g9 _. l+ e )
; [; m. _# t: ]& |' O$ B% h7 ` )
- `& p. I7 o" p' ]* b, [3 s ;;- w r9 Z, P V) M+ I- z( a) ^
;; Verify integer function. This takes an integer and a tile name as V! T, z+ o$ D* b% q% n7 y
;; arguments. If the integer is valid, it returns the integer and resets the, w- ~# o# b: N G
;; tile. Otherwise, it sets the error tile and keeps focus on the tile.; @2 a' O5 k$ [; y9 z( I% ?2 r) c% Q! d
;;
. ]; Z4 d! ~5 x- ?% B7 b5 I6 F (defun verify_i (tile value old-value / int valid errmsg)
( ^) J0 ~/ G" Z+ q) \ (setq valid nil)5 i- b% o U" A$ j: K$ M
(setq errmsg "Value must be an integer.")
0 s# J% K' Y8 s2 ~. \- T4 Y (setq int (atoi value))# l4 J$ v5 A; Q2 f; ^1 `/ P
(if (setq intchk (distof value))
3 m7 M: f( W/ J: C (cond
# e& f+ D6 ]) v ((or (= tile "columns") (= tile "rows"))
5 O) T; i5 Z9 ~4 M, l5 q (if (and (= int intchk)' v- A* m" Z/ k# U& Z
(>= int 0)+ m# X1 I' U1 j5 `
(<= int 32767)2 c5 H; \& R2 a4 M% E
)
, z. l# x, C$ D- ^ S* {: X (setq valid T)3 }/ I1 |) l$ m! v+ V9 m* _
(setq errmsg "Value must be an integer between 0 and 32767.")
$ t: ?$ h+ ?8 q. o, e )
/ y9 @/ X! _, \2 c$ P )
" {& x0 g) h* H+ F; c8 d; T ((and (or (= tile "u") (= tile "v")))
+ X% v' W+ l4 s2 p% B2 h (if (and (= int intchk)
) S i/ N+ ?' \% o (>= int 0)
: Y& U: ^4 e/ c- f9 a8 q9 [' m (< int 201)
* S+ f0 t# G3 E )( }3 j. k1 y* D
(setq valid T)
3 s9 t4 L3 E! A; g6 K (setq errmsg "Value must be an integer between 0 and 200.")
5 X/ u$ k; W7 p" f0 J )) a3 P6 D$ c' x% o
)2 b" J5 B/ T5 j% B/ s
)
( a3 G* _4 u: S* J l )" x8 m6 @! b8 e: K! u
(if valid
/ e: ~" X0 a; ? |6 S (progn
$ H1 t$ D7 }: K4 s$ o1 q (if (or (= errchk 0) (= tile last-tile))* R$ ]- H6 [" V V% h) T
(set_tile "error" "")
! l- G" [7 C2 [" `( d$ Z0 y )/ ~6 ~; @ i: b
(set_tile tile (itoa int))+ O; r# f; ]' w, M5 ]" U
(setq errchk 0)+ j# b6 C8 \1 ~- @. U0 A( b
(setq last-tile tile)
/ h3 _, R. ~+ S9 ?* b$ W0 [" _% j' } int# V/ s( F9 b8 q) y% {3 q! U; D
)
# |6 x6 A: \4 M& h( u& { (progn
3 r2 O% {* L6 v! k! ]/ ?# @4 d0 X (mode_tile tile 2) ; Move focus to offending field: f& U9 b0 |1 z) F- z
(mode_tile tile 3) ; Select offending text
( \% w! K1 @, p' L8 g6 ^ (set_tile "error" errmsg)
& P7 F$ ^. C7 A& P% b' J (setq errchk 1)
, b" F# x: Q9 g1 E: y. f) m (setq last-tile tile)1 C- s7 G w6 K& [1 D! t
old-value
: p8 G" s$ M# F. x )8 J; R7 B- T( b; e
)% Y3 V) P* U4 x( i4 y! V
)0 J5 _* w8 Q5 w; Q
;;& F! x7 b9 Q0 D; Z* b
;; Functions that verify tile values for integers- i. S( y. @& v; ]
;;
" h3 A7 Q, ^" H (defun ver_col (value)
b# ~, s" P+ c" R (setq columns (verify_i "columns" value columns))
- |" u! L$ S# w/ D" P/ |- R) { )# n2 l* f) @5 }% `0 j8 S5 a
(defun ver_row (value)
; w1 O$ |4 l# P! P* o- _9 s (setq rows (verify_i "rows" value rows)); M0 B# V, j; h o, r
)) s }* N" \0 z# ?( ]8 ~( y9 f% D
(defun ver_u (value); c) p8 i1 H% _2 p! A* Q
(setq u (verify_i "u" value u))5 E4 i% y9 V4 r# P
)1 u/ M: o3 v7 a
(defun ver_v (value)+ M. f% V' Q, G7 [0 g
(setq v (verify_i "v" value v))
( ~, k& i! L9 V/ A/ L6 d9 {) t )
6 t; s& f- t. @. }" x ;;
1 d# I/ x; l% i& Z: J: H ;; Functions that verify tile values for reals
" m. j# N0 D3 i' ^ ;;; Y: x8 W' U; M, {0 W& d4 ^, {
(defun ver_x1 (value)
+ t3 X3 k8 ~; E) B9 R (if (setq x1 (verify_d "x1_pt" value x1)) (calc))1 Q9 _: A+ B/ q' N4 b" {6 x- `2 N
)/ a" z9 ~+ \! m# l, J
(defun ver_y1 (value)6 ~: b { k9 a7 ^; K- v
(if (setq y1 (verify_d "y1_pt" value y1)) (calc))
+ e# c0 N& [) R6 w; s0 h )
' e/ A9 C1 P! ~* p" v E9 p6 b* T9 @ (defun ver_z1 (value)% D) b* D* T/ K; r& W8 |* U2 e
(if (setq z1 (verify_d "z1_pt" value z1)) (calc))
! e1 W7 Z6 ^, m1 Q6 ] S5 x )! \0 K; \! z: Q7 @$ }$ \/ q
(defun ver_x2 (value)
6 ~. o" X5 C& R6 h# p (if (setq x2 (verify_d "x2_pt" value x2)) (calc))
& ~' K0 k$ v6 c )
: T" ]6 ?4 _- B& e$ o) e( { (defun ver_y2 (value)# I; E( J0 q! L5 H: K3 M
(if (setq y2 (verify_d "y2_pt" value y2)) (calc))
0 e4 X: k+ q: A4 p& c, p2 Q ); C7 l. E2 T5 e2 ]7 J3 w# g
(defun ver_z2 (value)1 z; U4 b' F% i, @' u! {
(if (setq z2 (verify_d "z2_pt" value z2)) (calc))
8 d1 T; r. C; f2 O. ?6 F ), f! O! F! }( }5 @ k
(defun ver_x3 (value)
; [* T, J+ t B4 B; z& S# u- ^ (setq x3 (verify_d "x3_pt" value x3))$ \8 x3 S5 F3 Q, U( C/ O+ G, v6 D
)
; ?6 x5 o Y( `4 q (defun ver_y3 (value)
" I }5 e. ^" J f1 K (setq y3 (verify_d "y3_pt" value y3))
* W# E" [0 h u ). l( z. ~( o: O
(defun ver_z3 (value)( h1 O4 H# U q/ p9 r6 a3 B$ y! U
(setq z3 (verify_d "z3_pt" value z3))" I. h: I0 ~/ g* M/ V0 N
)
5 B+ } E% w+ V (defun ver_x4 (value)
6 m+ Y& u5 Z9 w$ ^3 M! N (setq x4 (verify_d "x4_pt" value x4))
" \/ q0 a5 {5 n! O )
9 }' l7 j, V4 s. X8 f) N (defun ver_y4 (value)
& j( \& S3 {0 i- a (setq y4 (verify_d "y4_pt" value y4))
- v# P% W0 F" I i% J/ X: m7 ~ )
" }2 \7 |6 J5 k" T (defun ver_4 (value)
. H; m. z. a8 [* ^6 e (setq z4 (verify_d "z4_pt" value z4))
: [1 f& e& t2 l# d- O: x0 B+ b )
1 C0 q7 G6 k+ h$ g7 G. c6 P% w U (defun ver_xscl (value)
+ v- z9 W& r6 R0 g (setq xscale (verify_d "xscale" value xscale))
- d* X0 l$ b Q X )' H# F/ x6 l1 r, ]9 W
(defun ver_yscl (value)+ X& I- R" v9 {9 L3 Y+ V. d# u
(setq yscale (verify_d "yscale" value yscale))5 X1 O2 G. e( Z1 {/ n, Y7 _
)
) Y7 W4 [* @' u, C8 e% q4 v (defun ver_zscl (value)3 s8 w, K9 m$ r& W u u1 O! ]! @- Z
(setq zscale (verify_d "zscale" value zscale))* x: H2 n7 T3 @4 ]9 f; P
)+ c% Y) e7 J: K& D/ @/ o
(defun ver_colsp (value). ~( o% _/ n2 ^( @1 n# e4 a
(setq col-sp (verify_d "col_sp" value col-sp)). R4 D5 @6 e1 t8 b
)
7 T8 f6 [# x: U @5 {& M% } (defun ver_rowsp (value); M$ y* r. P4 ]( O
(setq row-sp (verify_d "row_sp" value row-sp))
; S* n+ c" v O. V! d/ N )
; Q ]/ ~6 [0 a) d# s& {0 P (defun xclip ()
: N8 D2 h/ R! Y$ }% }! \2 n (setq xclipmode t)
7 B g4 p, t/ S5 j (if (= xcliponoff "1")
2 C& ^/ D6 q4 y/ U0 q1 n9 F (command "_.xclip" (cdr(assoc -1 elist)) "" "_on")
, S- |% W8 R7 P' F# I7 K (command "_.xclip" (cdr(assoc -1 elist)) "" "_off")
* u; K3 W4 m t9 I4 y )
/ N- k1 g# L( t )1 i5 {# }/ E0 ?( s' r
(defun ver_rad (value)+ q! b% D, A) D% b' p- e0 ?
(if (setq radius (verify_d "radius" value radius)): c% R8 j2 @7 t- u. t E4 a
(calc)& n9 H+ M2 o& c1 M' Z
)5 }9 Q e) C3 e# v
)
- A3 M: i9 d' s) ] (defun ver_majrad (value)# ~' c; I; U6 u7 S
(if (setq majrad (verify_d "majrad" value majrad))
$ Y( j* K8 Z: Q2 \( |- z8 z (ell_calc_newval "majrad")/ _% O2 z7 G6 ^& J4 W6 T
)
! Q2 V3 w" h: w- S! M" f )
) \: F2 D- o+ z3 [1 f. E1 w9 S (defun ver_minrad (value)
, J8 ]! u/ N* H4 [3 C% n (if (setq minrad (verify_d "minrad" value minrad))
7 U! C9 \: A* V/ ]. k- \8 |, N (ell_calc_newval "minrad")
5 |8 x5 z9 |- f% H. [3 M$ k7 L ): g. r8 \% F( h6 w
)5 M" E3 z0 `) d: J% V a* Z" X
(defun ver_hght (value)
* x. g; H$ a+ Q5 L (setq hght (verify_d "hght" value hght))
0 c# x. M& k2 a- o& Q" w )# q2 n% T) `' m! w% \6 f; p/ k" @5 J
(defun ver_wid (value). J8 l0 c% P# m+ z- b3 ?, K
(setq wid (verify_d "wid" value wid))" i8 ?1 [ {; c- H
)3 p: i& i, N7 u/ y
(defun ver_xline_x1 (value / temp)
! B- m3 Z1 z7 E9 L' P (setq temp xline_x1)' }( J& A9 K; X/ D8 A+ L* i& n4 y
(setq xline_x1 (verify_xline "xline_x1" value xline_x1))8 T! r; G6 F4 q( o8 P2 F. D
(if (/= temp xline_x1)( l# D2 }& _; {" s
(progn (modify_xline 0) (set_tile_dirv) )3 b; E2 }6 S# O( Y
)
: y( E& p9 R4 D( i )4 M7 ^; E) z9 K. p& r! t- k6 m" f
(defun ver_xline_y1 (value / temp)
" ^) y) P( k4 l) p2 X6 N6 U) n (setq temp xline_y1)# k4 ]1 ]- ~( K1 g( ?! ^
(setq xline_y1 (verify_xline "xline_y1" value xline_y1))) D( w Q( _( D" K. U
(if (/= temp xline_y1)
1 @% F+ v: I- i } (progn (modify_xline 0) (set_tile_dirv) )
7 {$ f# ]0 S( f! m, p# E, c! H9 ]2 r )0 k0 [ E2 m" `9 P' Y% ^, h
). T" z. T) Y) G- [) E q
(defun ver_xline_z1 (value / temp)
/ ?% H, T* r" N8 c8 a# j: F (setq temp xline_z1)- X. o. T7 E) _( e& Q, ]& P
(setq xline_z1 (verify_xline "xline_z1" value xline_z1))
! P" z; q% v" @% `2 @: C (if (/= temp xline_z1)+ e; k6 f( x) m$ n" s" q7 C. }
(progn (modify_xline 0) (set_tile_dirv) )& A6 S4 Y$ W. E4 v4 S3 i
)
* T$ o4 G2 T9 m2 R6 S# N7 g$ j )
! R. u9 {! d0 d; v, j# q9 L2 S f (defun ver_xline_x2 (value / temp)
5 S0 i- w$ ]) @7 z (setq temp xline_x2)
* P" Q! |3 W# I- o1 v (setq xline_x2 (verify_xline "xline_x2" value xline_x2))1 i; f; L) Q% {7 [2 h
(if (/= temp xline_x2): q( }# E9 i1 z, {3 |) O
(progn (modify_xline 0) (set_tile_dirv))( F. Z$ M3 K0 f; _8 w7 l
)
8 e- `1 X6 z6 t% F4 I7 C5 x )7 }: @! {+ ? N# d# j
(defun ver_xline_y2 (value / temp)
! _4 h% x/ n' }: a1 v- _ (setq temp xline_y2)
2 p( R+ Z% _. M% t% Z$ ] (setq xline_y2 (verify_xline "xline_y2" value xline_y2))
, `, B& c. n6 V% `; | (if (/= temp xline_y2)
1 v# R! n9 T8 d4 r (progn (modify_xline 0) (set_tile_dirv) )$ l+ \/ F8 f& _$ E2 b8 N- M i. W
)
1 I9 A+ [3 p" F, i; v: | )+ P1 k" X2 }* }$ b
(defun ver_xline_z2 (value / temp), V9 f$ ~1 i: z3 z6 P
(setq temp xline_z2)# e, B) v. y3 E
(setq xline_z2 (verify_xline "xline_z2" value xline_z2))+ _: i) J1 N) y% O
(if (/= temp xline_z2)" U3 E; t9 w4 c' E; i6 O
(progn (modify_xline 0) (set_tile_dirv) )
! q" h2 |: F$ i* h )
3 O, M a7 L8 b! b* @ )
& R4 b& v# X* ^% f* w$ d ;;
+ E3 @5 ?3 B- M5 q# e# q% P' k& v! i ;; Functions that verify tile values for angles
) Q! Y c# e( `7 A- u, N ;;
% z T' e4 C8 E4 M (defun ver_ang1 (value)1 `5 q* a5 ~; I& y3 Y9 r- q
(if (setq st_ang (verify_a "st_ang" value st_ang))# J! g9 X; J6 k5 z+ D* z( b, S, x
(calc)* u" p. Y0 l% J& i5 [) A/ v
)/ ~/ H) E4 i: V$ [* t# y3 ?
)
/ @7 @ l- E4 `& X (defun ver_ang2 (value)
/ d1 O* L. D! a! Z% N1 j0 M (if (setq end_ang (verify_a "end_ang" value end_ang)). Z* q6 b1 ^/ t! m( ^. @
(calc)
! G0 Y! W G }" i )1 N |! [% ^% c
)+ p8 \. `+ x( t( E$ i2 S
;;
8 A7 J$ V" T, ^5 F ;; Verify tile value for ellipse end angle. Handled slightly
- |+ a# _3 A. A ;; differently than the other angles.
+ \: d9 W6 t) n7 D$ G8 C ;;
7 @0 P5 C- u- Z* _/ V (defun ver_eang (value)
* j3 r" ]1 h( E$ A& x& j; E (setq end_eang (verify_ae "end_eang" value end_eang))# D; X3 I# Q9 ?9 x& U/ ~3 M
)# K: u8 u$ e m0 ?
(defun ver_rot (value); d% H) b, t+ z* F: S* b# L- X; Y
(setq rot (verify_a "rot" value rot))
( o; i, M$ ^- Q$ d9 s+ x% k )
: j2 k$ O) i9 S# S+ z/ z (defun ver_obl (value)2 T6 J" N& `) m; U0 k" f( h
(setq obl (verify_a "obl" value obl))
- `& {+ S/ `0 p) v9 r )
9 b; ]7 c6 Z' K6 _ ;;; v$ _; v! V) X
;; Function that verifies attribute tag field for null string,& k/ J: q0 l; @7 n8 E5 j
;; or a string that contains one or more spaces. Tile value
! t8 _8 o3 }( H* T& W ;; is also converted to upper-case as well.0 G. t: t6 h7 c. i3 M
;;& }3 E* J) z& N
;;4 ~) R) ~3 H2 q0 l3 j- n& a
(defun ver_tag ( / tval)5 E1 o) v( G1 a8 S* [# ~
(setq tagval (get_tile "tag"))
. A! G( W# L* e' Z/ j: a- [* k2 ?% f (set_tile "error" ""): L& ?, w% E7 G1 F l
(cond0 C1 | Y r7 E# f) o5 _) z
( (or (eq "" (setq tval (strcase (ai_strtrim tagval))))! i/ e2 I; k: m6 [$ K
(wcmatch tval "* *"))$ q4 V3 J; d H; `$ q
(set_tile "error" "Invalid attribute tag.")
* o0 S E, o: {- \ (mode_tile "tag" 2)
0 k6 p7 v" H; W! t. z) X5 N (mode_tile "tag" 3))6 E# L' h9 a/ w% S
(t (set_tile "error" "")! X: u7 z" [/ i
(set_tile "tag" tval)
* a" Q h; d: @' J. d/ n h (setq attag tval)))2 A# u2 X' n: x9 ~$ b# f( f* m7 ]
)$ m2 i! U- `! w* d' U7 _. @& N
;;7 u- O6 K/ ]" k0 z! H& d
;; Calculation functions
% |' P. s1 j7 T; H+ P5 I M ;;" I3 i$ {3 T! e I3 e5 F/ S
(defun calc ()
* {7 l; N7 |, q (if (= etype "LINE") (line_calc))
! C" U% M- Q% c w8 v' ^$ Z* I (if (= etype "ARC") (arc_calc))
' r0 N( | F6 o% {8 u2 \8 B2 t6 H (if (= etype "CIRCLE") (cir_calc))
( q) Y8 q4 q# O( Z) V )
1 j; C; V$ L: `" v, T ;;# @0 C* ]/ r6 v/ l8 T+ H
;; Calculation functions for lines, arcs, and circles
6 G6 a1 s+ @0 @. l. k5 H% d ;;, `: d- e4 ~/ W; Z4 p
(defun line_calc ()
: b! @9 y+ F* R: e+ l' c (setq stpt (list x1 y1 z1))
! W& N0 ?+ P* P! z! S (setq endpt (list x2 y2 z2)): y2 a' A- P; d; G* A; k
(set_tile "delta_x" (rtos (- x2 x1)))- j$ v! c' X7 _% G2 f) J& x
(set_tile "delta_y" (rtos (- y2 y1))), I1 h4 D k# W; v
(set_tile "delta_z" (rtos (- z2 z1)))
/ V7 Q; w* @/ U) Y" u8 e6 U (set_tile "l_length" (rtos (distance stpt endpt)))
, o8 V5 `4 c# u& H* M( F3 q (set_tile "l_angle" (angtos (angle stpt endpt)))
0 u' X5 V; m" p )
# L7 i: @7 L! B: B' D1 \3 g4 B4 Y* b9 ]( a- @$ V! s0 P
(defun cir_calc ( / area units)1 P" t, _& X' ~; y- X+ T# j
(setq radtest radius)7 T* S* Z" }& v/ ^
(set_tile "Dia" (rtos (* 2 radius))); N4 R& U4 c: @
(set_tile "Circum" (rtos (* 2 pi radius)))
4 D" K; ?% n4 Y- g$ k (setq area (* pi (* radius radius)))
( Z L1 X# n: J8 ]% Q (setq units (getvar "LUNITS"))8 A }2 M) K2 \" {; z
(if (or (= units 3) (= units 4))5 {. o3 V% q$ j# Z/ W
(progn# _# F1 V, B2 P) v L
(setq area (/ area 144.0))9 g9 f2 ^2 \) \/ s2 c: @( r
(set_tile "Area" (strcat (rtos area 2) " square ft"))3 e2 a! O' J- ?
)5 Z" A6 O( I7 D7 I: T. X
(set_tile "Area" (rtos area))& u3 ^1 e6 Q) D) N
)
* p* p* c* m# z, Q )# h, w6 r' s5 ~, z. d' h
4 f9 d$ g6 X! ? P9 a/ L7 A3 W d1 F (defun arc_calc ()! L8 F( M# _8 t' B2 W/ J' U, n
(setq totang (- end_ang st_ang))
$ Z/ {! e" E9 f (while (< totang 0)2 Y+ J' ~+ y1 e9 T4 m
(setq totang (+ totang (* 2 pi))), o( a! @0 V* G' L$ @4 k
)
" J" S/ f& m+ P- _# v% N: j) u (while (> totang (* 2 pi))* e" W# |; |$ U& Z7 |) [3 r: Y
(setq totang (- totang (* 2 pi)))
" g: L% m0 l. p. ^0 p& p ), Q: D& E t& z
(set_tile "tot_angle" (angtos totang)) ?2 j2 x2 t: e% N3 B4 N
(setq arclen (* (* 2 pi radius) (/ totang (* 2 pi))))1 S7 V, a( X c7 G6 R0 v
(set_tile "arclen" (rtos arclen))3 \2 e( E5 f" }$ y* P
)
% X5 t( c2 U* {1 y ;;- E6 d+ k$ h7 w" L9 J' N
;; Calculate the major radius, minor radius, major axis direction.
, o9 s( i* O* s+ }. {9 U2 @ ;; Get radius ratio. Convert Start, end parameters to start and end
: I: y" U+ v" g! y: s7 ?3 j7 o ;; angles. Save Major Radius value in "old_majrad" in case the user" r8 h S. J' J$ ]5 H+ r* k
;; chooses to input a new Major Radius value later. It's needed to# k& \' N3 ]% C+ B6 g
;; calculate a new Major Axis Vector value., E" C5 H0 I3 j: L- @. G. d* w
;;
. |/ o. D* Q. i* z: w' x" R (defun ell_calc ()
/ r5 {. L/ Z# A! G E. S ;; Get major radius from the major axis vector.9 F. I7 U! t4 w% I8 N I
(setq majaxis (cdr (assoc 11 elist)))
; ^' q* F' y+ W. @ (setq xx (car majaxis))9 ]/ {$ f& f9 K" w# U
(setq yy (cadr majaxis))
3 d5 B2 {- g% z( G; n G (setq zz (caddr majaxis))9 p ]' D) n7 J) j0 j# N
(setq majrad (sqrt (+ (* xx xx) (* yy yy) (* zz zz) )))' {3 [: C D4 k, d6 a2 o+ ^
(set_tile "majrad" (ai_rtos majrad))* ]; d- U3 Q" Y/ I
(setq old_majrad majrad)
# b. H: U) Z* {" p" q( s: B ;; Get radius ratio) ]" ~3 s) `1 z3 H
(setq rrat (cdr (assoc 40 elist)))
1 k( L( [+ Q* l' L2 v2 @ (set_tile "rratio" (rtos rrat))
6 _% D' @, D [) I, Q$ z ;; Calculate minor radius
' J# w) G$ k' e4 p! M' Y& ?2 z (setq minrad (* majrad rrat))- Z/ z9 j% g* d* Q
(set_tile "minrad" (ai_rtos minrad)). U9 ^9 m+ K7 A9 B: y0 z# r7 c5 H! p
;; display major axis vector" j" q2 ^ T7 X3 s4 a! e
(set_tile "Majraddirx" (rtos xx))
. _5 m7 L7 t& T (set_tile "Majraddiry" (rtos yy))
9 r( x) U4 y7 O0 ?1 Y (set_tile "Majraddirz" (rtos zz))
% {- E- X3 R+ b* f- j2 T2 q
+ Y6 V( W% G, [* }" A ;; Convert start parm to start angle
# K8 ^, a8 E+ {7 d/ o; W (setq stparm (cdr (assoc 41 elist)))
+ o5 ^9 Z2 j0 W0 n (setq vecx (cos stparm))
! W7 ^, f1 P8 P5 g1 z L (setq vecy (sin stparm)); U* N4 x4 }" m3 x" l
(setq st_ang (atan (* rrat vecy) vecx))
2 Q- a! i+ B. E. o! v (setq tempst_ang (ai_angtos st_ang))
4 J; |8 Y) D# L, H; l. l% ^ (set_tile "st_ang" tempst_ang)6 H' A7 Z' X7 c l% K# J/ E
;; Convert end parm to end angle. If end angle evaluates to 0
* [/ j$ f& i8 `! C! X ;; degrees then display it as 360 degrees.
8 f+ Q- `1 |( }; Y6 |! H1 Q5 t (setq endparm (cdr (assoc 42 elist)))
?' s, _& i7 z% S) |1 y (setq evecx (cos endparm))% G" @- `7 M1 P8 [0 P1 r2 j
(setq evecy (sin endparm))
0 z7 q: k9 ^2 a (setq end_eang (atan (* rrat evecy) evecx))) L2 S) G6 Y* C- I6 Q; R( r0 o
(setq tempend_eang (ai_angtos end_eang))+ |) E6 B( Y# o6 t
(if (= tempend_eang "0")1 c/ I6 P: V6 G% u
(set_tile "end_eang" "360")' L0 r( g; Q* `
(set_tile "end_eang" tempend_eang)
1 I* Q$ j- q3 h# y& C ) w: N7 T q& t8 J2 B7 \ J, G
;; Get area of the ellipse., ], u& \# ]: ^1 c: r( s
(ell_calc_area)5 o/ z. [: i* V, J
)
, g* p1 n/ j. V9 g4 _4 E1 U ;; Calculate area of ellipse. If it is an arc then- [ S+ P# c- ^' D
;; grey out area display.8 R" L" f" C& R6 K+ p
;;% |# F6 Y2 B: J/ |# [/ V
(defun ell_calc_area ( / area units). u8 R% a y1 E: X2 z5 f& E
(if (and (= tempst_ang "0") (= tempend_eang "0"))
% \0 g4 D# ?0 `/ L' @) i (progn
$ |0 P. ~: v4 j" P% n) D (setq area (* pi majrad minrad))
% w) V3 D, Y% E5 r G (setq units (getvar "LUNITS"))
6 H2 B& v+ ]! v1 V0 @0 b (if (or (= units 3) (= units 4))
7 O4 h$ V Z' x3 E$ k5 t (progn- U. e! y' q2 v0 _
(setq area (/ area 144.0))
6 m. D% V: ]3 m j7 R (set_tile "Area" (strcat (rtos area 2)" square ft"))
3 D. N; Z7 h+ x6 a )
( C5 k$ A% Y# ?% s4 F, T$ r (set_tile "Area" (rtos area))1 E: ?9 N, I' Q# X5 F
)
; J2 \# I1 ^0 ]! T )
0 U; [9 S" M7 K7 ] (mode_tile "Area_text" 1)
: ~* _2 V, \' d% @6 @7 O )8 g9 u2 b2 O7 O5 x" z6 i. B# I
)6 g. I- P: B% E7 s3 f
;;
9 e$ {$ o, `& M y- H% L ;; Calculate new values for ELLIPSE
( z) ^- d6 d8 o& L! j% j7 a ;; Minor Radius, Area
4 e- Q& ?8 n: v: j" ] ;;4 w2 S/ s/ p' z1 F$ t& {! @& n1 ?2 J/ i
(defun ell_calc_newval (ell_tile)1 i# g, T$ l* Z4 W/ Z' X6 u6 c
(if (= ell_tile "majrad")# J8 ~% \5 }1 e3 J7 c
(progn
0 F% K% Z3 t0 v% s1 h' Y; c4 R% V (setq rrat (/ minrad majrad))9 T8 l4 h* m* O4 D7 m1 ]/ e g
(set_tile "rratio" (rtos rrat))
4 r& G: \3 c& O5 K (ell_calc_area)1 V/ ~# B3 ?" m: t7 I
)
0 L8 Z0 n9 H7 S0 s )
* o: E" ` a, \& _' v8 T* J9 E (if (= ell_tile "minrad")
1 y, a# c8 y/ G (progn. o; U ~+ v/ T2 ~3 J
(setq rrat (/ minrad majrad))" i7 `. ^6 s3 u4 _& Q5 S
(set_tile "rratio" (rtos rrat)), b9 o: Z6 K& x2 h
(ell_calc_area)$ o/ x6 R- d' Y2 }! j2 i8 G7 W- r, O
)" g7 D' M1 H3 R7 q$ t
)
5 L7 a6 g1 Q# V9 Q )
8 W( n+ Y3 z; I, t
: ]$ P4 w2 e8 |5 z (defun set_dimen_props (/ loop a stl txstyname)
2 n; M( v4 [! u" ^6 |( D
$ u w# q! @* H G- u (setq stname (cdr (assoc 3 elist)) ; get style name# G+ m' H8 r2 e6 N1 n9 @; z
stl (tblnext "DIMSTYLE" T), f' X/ [) c+ h. V" l' |" V
stlist nil)
! N% P5 |9 b6 X& K ;; Get all style names and list them in alphabetical order: Q F' D7 F7 s3 [8 Q+ E$ [+ K# W
(while stl
5 m" a! X/ v1 @& A1 ~ (setq sname (cdr (assoc 2 stl)))9 s0 O( Q8 l) Q7 T5 H7 Q" C
(if (/= (logand 16 (cdr (assoc 70 stl))) 16)
' G9 M+ `6 ^3 ^2 q. i( I2 K! O (setq stlist (cons sname stlist)))3 K( B2 \8 \& Q! E9 Z- w
(setq stl (tblnext "DIMSTYLE"))). [& N- o4 ~: q# \
( U4 e& V* B3 |$ M: ~
(setq len (length stlist)
3 I3 r7 ]6 g. z# I% w; y0 l* c loop 0
8 Q7 N- Q1 O D* m: { K( a dimsty stname) E6 E9 O! W1 o+ X' w# j9 z
)
% }( g! H( ?! [$ m, H6 U- m. e6 S' f* x5 C6 o
;; alphabetize style list, depending on maxsort5 c( s% e% d: x% b: }. Y
(if (>= (getvar "maxsort") len)
% I4 l* v- H7 z0 e5 X (setq stlist (acad_strlsort stlist)) ~7 h3 b0 n* X% P S: n
(setq stlist (reverse stlist)))
+ A" m3 h" d! V7 k$ m4 y* P: J
{3 c7 ]/ \8 {! f ; *UNNAMED style (dimsty = nil at this point) is replaced with. R9 b' d- g8 {* r7 }
; the current style. After R13, we require dimensiosn to have a" z- A8 U; B" f4 v% M/ S
; dimstyle, so we plug any holes where we find them.
( ?2 U6 Z* T6 T6 A0 ~. V0 M (if (null dimsty)
/ H3 J, F. J' D' Q# L% w5 x! m$ n (setq dimsty (getvar "dimstyle")) R. g) f) R6 r2 ~
); \0 D6 o: u" d9 H7 Q7 L( @
; Show the styles in combo box
) s4 ~4 P! R) U8 X1 G, d (start_list "mod_style" 2)
8 q: S* O+ X, m) b (while (< loop len)3 \* |( Y* Z3 ~: v" s% a3 o' M$ | q
(add_list (nth loop stlist))7 \4 R; [8 y3 H9 f
(setq loop (1+ loop))4 y3 r7 o( p) j# U0 L9 A$ @+ J
), d3 f) k: X- G$ G2 v, V9 @
# L' q" l y2 Y# Y/ g6 N, J
(end_list)$ T. c8 j# U! n3 s
0 z5 S, S9 w% r, W- D- v ; Hilight the style name of the selected entity
$ o9 M9 I* Q! F4 W9 @7 A3 A (while (and (< 0 loop) (/= dimsty (nth loop stlist)))
2 d* M [& ` H% y7 Q( {6 @ (setq loop (1- loop))
; {: h# e; c% ^$ C! n# f" b )
; n' Z2 R9 j8 z8 F; a (set_tile "mod_style" (itoa loop)) ?/ Y" c" u6 c, P/ j2 T7 c
( ?. ~ ` f7 V
; The following is the list dimvars. It must be sorted in the same
' o0 p; F5 ^& a% Y$ j0 }5 h/ S ; order as the resfub returned from DDIM (ADS module).; H5 B% E6 `; R& x0 M
6 O( L6 M, Z _# u; H; E( G( Z2 E. C
(setq dimtbl (list "DIMSTYLE" "Style name" "Standard flag values"9 i+ Z9 I* C5 ^8 S: S$ Z
"dimpost" "dimapost" "dimblk" "dimblk1" "dimblk2"' P* W) o* n3 a8 b& R! O# `& Q
"dimscale" "dimasz" "dimexo" "dimdli" "dimexe"9 F5 n1 Z7 c4 ^- u6 l U2 J
"dimrnd" "dimdle" "dimtp" "dimtm" "dimtxt"+ ~& k. @ p" _0 r* T- C6 P5 b
"dimcen" "dimtsz" "dimaltf" "dimlfac" "dimtvp"
3 ?2 ?# {: L9 M0 [) X$ O "dimtfac" "dimgap" "dimtol" "dimlim" "dimtih"4 z& p: X0 z+ `6 `) F0 Z
"dimtoh" "dimse1" "dimse2" "dimtad" "dimzin"0 g! W8 y8 U8 {5 a
"dimalt" "dimaltd" "dimtofl" "dimsah" "dimtix"
+ H# c+ I, \* l8 i "dimsoxd" "dimclrd" "dimclre" "dimclrt" "dimunit"2 `) V7 [8 H% h. P f& @0 b! u
"dimdec" "dimtdec" "dimaltu" "dimalttd"
4 y7 [! T5 {+ a7 w& c% K2 B "dimaunit" "dimjust" "dimsd1" "dimsd2" "dimtolj". v2 w) Z1 j4 i# Z: M) ]5 ?
"dimtzin" "dimaltz" "dimalttz" "dimfit" "dimupt"! v; A) h4 P4 b! b! t Z5 y8 Z1 O
"dimtxsty"
6 x. c' J: y5 \; w ))
: _; r( E1 r! ^' a+ @/ ^8 e8 B- b8 T (progn+ u4 [! T% \# t# ?
(setq sv_dvlist (ddimen_getostate dimsty)
7 ~9 j5 y' {4 v7 ` txstyname (assoc 340 sv_dvlist)
# ~" R* n, S: f! A9 [3 D0 Q. H sv_dvlist (subst (cons 340 (tblobjname "STYLE" (cdr txstyname)))" m; J F$ t9 f$ F% N8 J/ ^) a. R
txstyname sv_dvlist)
* l% U5 c% C& e! o' B, j9 r" s dimlist sv_dvlist
r, e* u' v8 ^% R ), x- o% K Z4 [% I
)
) ~- J1 l& B# q+ h+ F, @8 Y3 | (if (= dimtype "DDLEADER")
" w+ y e- q1 R& e5 N: R (mode_tile "mod_format" 1)2 C0 S9 |3 ?7 q& N8 w
)
* g7 m" m3 E. v3 A! e n; f (action_tile "mod_style" "(setq dimsty (ddimen_style))")
7 M9 l7 [) L) k/ @ (action_tile "mod_text" "(done_dialog 4)"); i$ f9 J. r7 Q+ H2 G+ Y
(action_tile "mod_geom" "(setq dimlist (ddimen_dlg dimtype 11 dimsty dimlist))"), E; Z6 f5 ^' G c# m
(action_tile "mod_format" "(setq dimlist (ddimen_dlg dimtype 12 dimsty dimlist))")
) K- T% D i5 Z! {6 I, U5 y (action_tile "mod_annot" "(setq dimlist (ddimen_dlg dimtype 13 dimsty dimlist))")
2 i7 H; q0 g/ k* F (action_tile "accept" "(done_dialog 1)")! o4 Z1 @* A/ x" g* u
)
- W' G% r6 ?( `# |- V( x% Q* t2 D$ }* x ;;" y- s' n l9 C4 m9 b7 g8 W3 A! ^- ~( b
;; Get dimvars that have been restored.
" Q g$ p4 T8 D* `* \% u' T ;;/ l. V* B* s* @6 f1 k8 e' Z
(defun ddimen_getvars (/ elm dvlist dv i)
& D7 {: v/ V: b, F4 O (setq i 3
$ Z% W4 S. w; y9 @ dvlist (list (cons 0 "DIMSTYLE")
, \9 ?0 f# }7 R( f' V$ } (cons 2 (getvar "dimstyle")) (cons 70 0)); d4 n/ D+ Z4 E
). O2 C2 @5 I9 g% M8 C }# E( L
(while (setq dv (nth i dimtbl))
& d1 s6 F8 D8 R" _" f (setq elm (getvar dv)" c* p: \& s# B0 D* y2 [ O- e
dvlist (append dvlist (list (cons dv elm)))
! N& p2 F( t5 [# e" b i (1+ i)
0 ?) y0 R1 k2 ^! a6 Q7 h; R O% w1 U )
$ r/ w' m& s7 A2 N, k )
4 _4 M! m; ~! c4 _( V1 p" h) O dvlist* b4 Y! ^" t$ x' `# C
)! q6 r" g8 M) E; _
+ Q9 d# g; D- }2 \. K0 [, G
;;
0 E. c6 ]5 ~9 Y ;; Get the original states of dimvars. This is for DIMENSION entities.: @; }; j8 S- s. \8 Q$ o, v2 A
;;2 D8 b9 l8 s/ W) d3 }
(defun ddimen_getostate (dimsty / dvlist elm i dvvars)9 s/ I- p$ i4 z( v7 \
(setq dvlist (tblnext "dimstyle" T) ; Get a skelton list
5 c7 n( C u( @) h6 F$ t+ i dvvars (ddimen_getvars) ; Get dimvars for that entity
) L& B7 [. ?) v: e5 P i 1: w* n+ @# u; l+ P; F
)
$ {2 [" W$ A; w; v
/ A4 F- {9 d- i% H# a ; Create a list that contains values of the selected entity.! [6 k2 L# a; g+ ~
0 Y: B$ J# x3 @' N3 D (while (setq elm (nth i dvlist))
4 f+ |( }3 b7 x! C) z (setq dvlist (subst (cons (car elm) (cdr (nth i dvvars))) elm dvlist)
" n( E* d( d0 ~1 z' K* j i (1+ i)
/ U; \0 `2 C1 t- V H) H )5 K1 u9 W* B' B, F* @( f
)+ Q$ }2 p& A: U* d% a4 Z2 c
dvlist* u: k! {0 ]; t
)
3 \+ A" f7 \$ E9 f5 k- M. |' E; R: {# C1 A
;;! }5 C+ P7 Y- [1 E/ p7 T
;; Restores dimvars of the selected enity.
/ F( K) y5 ~$ ~9 o ;;
! L9 {) I+ k; v (defun ddimen_dimsty_restore(/ dimtbl dimsvcurset en)2 D2 S" e+ F. i
(setq dimtbl (list "DIMSTYLE" "Style name" "Standard flag values"2 K5 A% }2 B0 Z& u. ]& b! h
"dimpost" "dimapost" "dimblk" "dimblk1" "dimblk2"
* Q/ v, E# O- N( t* B) n1 [: p/ d "dimscale" "dimasz" "dimexo" "dimdli" "dimexe"
3 i9 ?7 ^1 X- h+ o' x "dimrnd" "dimdle" "dimtp" "dimtm" "dimtxt"8 f& i) a% u4 j) K- u/ W% J6 X( d
"dimcen" "dimtsz" "dimaltf" "dimlfac" "dimtvp"+ x! H1 k" { ^5 a4 B, K2 M, ~; v
"dimtfac" "dimgap" "dimtol" "dimlim" "dimtih"
/ W# s7 d2 |7 I "dimtoh" "dimse1" "dimse2" "dimtad" "dimzin"
& p! v$ B0 @+ k8 E5 B: j9 g "dimalt" "dimaltd" "dimtofl" "dimsah" "dimtix"9 D8 I" V: N9 V6 Z# ~
"dimsoxd" "dimclrd" "dimclre" "dimclrt" "dimunit"# ^) X" r% V8 I. i% Z0 Z
"dimdec" "dimtdec" "dimaltu" "dimalttd"
$ C8 {* O+ N- s# ~) ^3 a5 L$ U "dimaunit" "dimjust" "dimsd1" "dimsd2" "dimtolj"7 }2 C$ ?8 \# }3 B( x
"dimtzin" "dimaltz" "dimalttz" "dimfit" "dimupt"6 a7 [ J2 P! a% ^$ K' e
"dimtxsty"' t8 Z3 T( N9 u0 a6 L, R3 N4 b
))
+ A( C7 C/ _% o (setq dimsvcurset (ddimen_getvars)) ; Save current variable settings
; G$ ?* Q0 d/ F ?3 e& b1 a% I( ^ (progn# k. b; Q% ^' Y
(setq en (cdr (assoc -1 elist)))# l. [0 r- b9 v6 C2 {5 t
(command "_.dimstyle" "" "" en): O9 [4 k) W" y# I z! |+ ^
)0 _; S7 ]+ Y3 z6 J7 y- w
dimsvcurset
+ W4 k( y: P ]8 s6 L" `0 D )
4 Z6 ]9 ~; P7 {; s1 _- U' _! A6 s ;;
, s: @; X4 l X ;; Modify Leader& g3 \* G4 U+ J4 D
;;
* J' Z/ M- i \3 r& W+ o0 R3 G6 h( b (defun ddleader (/ dtypebit blkname bename sublist a stname n dimtbl
8 h5 k4 |- z) e, z' } dimsty dimlist dimtext svtext dimovr sv_dvlist stlist
6 W5 w9 o# _, p dimtype dimsvcurset)
2 ?! ~, ]# @- ] L' L* T+ S (setq dimtype "DDLEADER"1 ^/ g* ` }2 _- i
dimsvcurset (ddimen_dimsty_restore)
7 f0 N4 I8 l/ }8 D6 g )
% o/ L5 B' E1 L% A (if (not (new_dialog "ddleader" dcl_id)) (exit))
( K( a, K% j/ L C- U( T ;; Set initial tile values
) v+ e4 b* s& O/ R V (set_tile_props)) p6 \; R+ Z) t6 ]0 W
(set_dimen_props)$ e, p& R$ n6 w9 k
(set_tile_handle)
$ j9 P2 B# w( C ;; Define action for tiles
2 ~ d/ m4 m( M) l+ W7 b (set_action_tiles) x& e& H$ T7 f }% ]! Y
(mode_tile "mod_text" 1)
6 ~8 T" `! t* U
& B8 X5 p0 n% V/ X( f (action_tile "mod_style" "(setq dimsty (ddimen_style))")
?) v) A4 C8 F2 w& k8 `! E" R! w (action_tile "accept" "(setq leadtype (get_tile \"s-s\"))(setq arrow (get_tile \"arrow\"))(done_dialog 1)"), I$ X/ q5 a: h
;; Get ARROW and TYPE.: k( a+ [9 J& ]6 d
(if (= 1 (logand (cdr (assoc '71 elist)))) (set_tile "arrow" "1"))% \: C) ?6 Z; O" Z) f4 }( z4 K+ ^6 A
(if (= 1 (logand (cdr (assoc '72 elist))))
+ W+ O( R6 E& g1 d3 g (set_tile "s-s" "spline")
+ p5 s3 V; C" ^7 V. \- D (set_tile "s-s" "straight")+ ?0 q) t6 B# G) @. d$ C4 ?' a: }( a
)
% C0 a: x3 ]" s/ f. H ;; Start the dialogue.# a! }7 L3 n6 p; p& E
(setq dialog-state (start_dialog))( {, x5 d) E; Z2 v+ S( m
(if (= dialog-state 1)
9 i) G, J+ b3 |. K (progn
: Z: S6 x- p' k7 F3 H ;; update the style! W# h( o6 x8 R/ B, l. G
(if (/= dimsty stname)
8 l3 U7 v$ h4 m, }9 K7 f! U. p- w (progn
; i/ J1 A/ w5 u ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case/ F6 `, J' U1 C" N
; doesn't have it.
) i! a/ A" u' [; A; r2 } (if (null (assoc 3 elist))" P7 a4 r) I& E% r9 H
(setq elist (append elist (list (cons 3 dimsty))))
, l; A1 P( Y8 i( y3 R0 f$ ] ; else just replace it.- ^# ^; i& o; ]6 s* J
(setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))
. @4 u! {1 t7 P& ]% M. \$ X4 N )
l5 @* m L' v: y% } ; refresh sv_dvlist with new dimstyle.2 x) {( t; l# n- ~' Y
(setq sv_dvlist (tblsearch "dimstyle" dimsty))
5 ]! J* K W) R2 o$ Q8 o, E/ p )
# [4 N1 x5 s; @. \6 |, @" ` )" I, d+ B' B2 ^! i- ~$ d
(if (not (null dimlist)) ; attempted to change dimvars, V0 C2 i4 V7 Y5 C
(ddimen_complist sv_dvlist dimlist dimtbl)
0 { k" h' g, k1 d )) G" _! L" K: l2 N" D% @/ a
;; update for ARROW.# B! X1 G: |$ X" L C
(if (= "1" arrow)( |, `: d( k* ]! y
(setq elist (subst (cons 71 (logior 1 (cdr (assoc 71 elist)))) (assoc 71 elist) elist))$ U% a+ z1 b p
(setq elist (subst (cons 71 (logand (~ 1) (cdr (assoc 71 elist)))) (assoc 71 elist) elist))
) s' g7 \$ K- E/ d ? )9 Q: F6 f& [% t/ A7 s! h; s: h) x
;; update the TYPE.
& ?, L, X) G0 L! ^1 G# v (if (= "spline" leadtype)
6 u# O0 y( C- U+ }, A (setq elist (subst (cons 72 (logior 1 (cdr (assoc 72 elist)))) (assoc 72 elist) elist))& U$ V. `; N& ^5 X$ D* t
(setq elist (subst (cons 72 (logand (~ 1) (cdr (assoc 72 elist)))) (assoc 72 elist) elist))
7 U' r+ b! V* x )
x* S/ C" c% @+ K @1 B (modify_prop_geom)! c- m; e" j$ \) _
;; update the Color
1 Y# l/ _+ F: p" I" ~ (setq elist (subst (cons 77 ecolor) (assoc 77 elist) elist)). v( k; n1 M5 w/ F8 W: |% X7 m* Z
(entmod elist)% P$ `! ^! W$ Q- e. x% S2 f( p, c, E8 j
)
4 B. v, V" L Y. ?, @2 t )! Z! r- g) s& S
(ddimen_setvars dimsvcurset) ; Prepare to exit
9 n8 O, A/ P- k1 G+ ^; L) C: G ). d* Q# T3 X7 b, l
1 @6 w5 h. i: G6 ?) c
;;3 Q* i' }8 ?' g Y8 R) D" [5 a
;; Get dimvars of a dimstyle with overrides.( g3 Q- D; g& P. g
;;, j) W3 E/ N4 q! B1 H* R
; [* E, t( q* r9 S/ v. M; G
(defun ddimen_getdimvars (dimsty / dimovr dvlist elm i)" m' k( P& ^" W* F7 s* V
7 g8 F0 g1 T0 w$ G ;; Get override information for the specified entity.
, t. P" R% E3 y9 h8 l* w( y ;; Leader/Tolerance cannot be restored by DIMSTYLE command, so we/ ~, P. C2 m4 u& F4 U
;; must obtain override information through this tedious operation.
w- z" K: b6 B g (setq dimovr (car (cdr (assoc -3 (entget (cdr (assoc -1 elist)) (list "*")))))1 F6 \/ Y+ y2 R, B5 j) d
dvlist (tblsearch "dimstyle" dimsty)
& T7 P$ B0 L7 D: y5 T i 2
# ]# f& c9 T# ]: Y3 R* a) F1 o' Z6 g )
& z# y% S6 ?( Q) `/ j Q, T* {- x# U
; Update the list with overrides if overrides exist.
. K% V2 |, N* I ^3 [# ?4 z8 x" b" z% _5 r' X
(if (and dimovr (= "DSTYLE" (cdr (nth 1 dimovr))))
: H& w6 c" T7 d! i5 ^3 n3 Z6 {# A$ g) S (progn0 L+ a8 J( t& L5 }: L5 t- K; ?' U0 Y
(while (setq elm (cdr (nth i dimovr)))! o! [" D# I- ~& D8 W5 N E
(progn
0 K! z% a+ n) F; ~( l' } (if (or (= elm "{") (= elm "}"))# i# o0 g# ~5 l$ h! L2 d
(setq i (1+ i))+ p9 _' w' t. X6 h. X7 s
(progn6 R3 K. r9 ~, [* r. s) b2 m+ ~
(if (or (and (< 180 elm)0 T; P3 Z% e8 P
(< elm 190)! }) C" N) E1 ]/ D) {7 S
)
}# Y7 q3 ~* H! f: _0 C (and (< 80 elm)
8 o& @' {) q( z( G) G* h1 I5 P (< elm 90)
# y' h4 W6 M( n# b+ S )4 k/ Q5 [! @. ?, x3 U- ^0 C
)
7 h U; c: e% D& T& X" \# ^& s (setq elm (- elm 10))4 B. P9 D! U: r' d8 ~3 a- W
)( H6 i. N7 U W! ?) z3 Z
(setq i (1+ i)/ U6 c$ L( e6 y: S' {
elm (cons elm (cdr (nth i dimovr)))* v5 y2 D6 C9 I! _9 s! S
dvlist (subst elm (assoc (car elm) dvlist) dvlist)1 e, N' T: r# o6 K/ w
i (1+ i)$ V, r- g# E8 g0 K8 T
)
8 p' |7 L9 e3 i3 F7 F9 s )
: F4 z h6 k* D& Y" g7 v& j )
3 M m+ X( S/ W- ] )4 [! i: h( z- E8 k- z7 o
). w: u, h. z s9 J6 D7 P& R
)
+ Y* C: y% W B5 K4 b/ @ )- r, Q6 M( j' q! G3 [$ x
dvlist
7 k/ _& [- R* `7 O+ C7 T )
8 O0 E2 J3 j0 A4 n& h: ?1 Z3 L
, f% N5 N( P; b$ Y2 X ;;) g% w* M* ]. r* i$ q
;; Modify POINT
9 i8 [ x2 p9 n' h4 y: {/ B ;;% a* ^/ I8 K( h6 `' s) S
(defun modify_point ()4 X6 U: S A- d) \( Y- U! {
(modify_properties)+ T8 ~. I0 W1 `, c9 p
(setq pt1 (list x1 y1 z1))4 {* v% }7 X" g5 C) y. g
(tempmod pt1 10 0)
6 p( A/ q& D3 J" C% U (entmod elist)
) Z6 v) D: H7 W- O )
; \4 E/ v3 M0 x0 D9 j, s9 F3 e* s1 l, z6 K8 d# t& w
(defun ddpoint ()
4 m4 q+ Q5 v) G. d) S7 S (if (not (new_dialog "ddpoint" dcl_id)) (exit))
8 ?7 n# }7 E n' Q$ k2 V) Q ;; Set initial tile values
# s% Q& v. N, w9 S5 L. M3 N& E0 S1 J6 Y (set_tile_props)4 e* z! V2 _4 C' V4 ^
(set_tile_handle)
$ a7 F/ v3 L( G9 s; s (set_tile_pt1 0)) @9 {5 y' w0 E2 L! b
;; Define action for tiles, x6 ?) V1 X0 d
(set_action_tiles)% ^; D1 `6 o! X1 |# M& {8 G; z
(setq dialog-state (start_dialog)): u" i- E3 M7 I. |, X
(if (= dialog-state 0)
* f, {1 e, I6 K, u. K, p# _5 @ (reset)
( V6 `# L2 N7 {7 Y/ z* t- @$ B6 p )
% L% c' @$ I1 t" i% }# @8 v (if (= dialog-state 3)
6 O) g6 q0 q7 X$ }1 F (progn
7 C, c& b4 d3 Z) i$ M5 A (modify_point)
, G2 c7 F; f) y% o& A4 _5 p' B) ] (setq pt1 (getpoint (list x1 y1 z1) "\nPoint: "))
7 \" `- C( H2 I8 w! d (ver_pt1 0)* A3 _3 F2 e; A) ~' I
(ddpoint)& t9 ?4 M% e' W' u4 F. c
)- b" n+ A N! b: n! w W
)- {& _! j( K" s1 o% O: n2 a
(if (= dialog-state 1)( T _- _( }: ]: u
(modify_point)
4 o9 n- o0 ~+ P% l: X )
( O9 w1 d8 p+ ` )
" Y6 G1 I1 R7 e6 @. P* C% K ;;+ j1 T; v' R- k- I9 }5 t8 Q
;; Modify LINE) W+ [" n7 w& u; V t& o
;;5 I# g/ |/ U, U4 M7 C+ b
(defun modify_line ()
& y8 |0 ]% F, U9 G (modify_properties). T+ E2 C# J) a" l( @
(setq pt1 (list x1 y1 z1))
7 p: v1 z0 q! O, d2 q0 T (setq pt2 (list x2 y2 z2))/ @1 c1 Q; m [* e9 @
(tempmod pt1 10 0)+ V! M% H" w4 M
(tempmod pt2 11 0)% D' I, O0 }. m: K2 t8 S6 n
(entmod elist)
' B+ I1 x3 I* } [) \ |4 R )
% n! e( _9 F* q$ P1 \4 L# W9 j (defun ddline ()9 X. z8 i% J3 l) a
(if (not (new_dialog "ddline" dcl_id)) (exit))' o, x9 g/ k) t0 v1 u1 g$ U2 n' Z
;; Set initial tile values
; N. b. a5 x7 u4 p: P$ `3 S (set_tile_props)8 U( N" t! i/ }% d! {; f4 l
(set_tile_handle)
4 x5 b; x8 C y7 F4 O (set_tile_pt1 0)* e2 S4 s- n& J; T
(set_tile_pt2 0)# Z* s. {0 x1 g+ |3 f# L) {) q
(line_calc)
' Y' P/ \. r- R" {( A0 z* b/ l! [ ;; Define action for tiles# _5 w" Y) o/ |& Y2 n7 s$ K2 J# b8 m
(set_action_tiles)
4 i4 ~. d% a3 C4 D- ? (setq dialog-state (start_dialog))
' @, E) K! n+ b' N (if (= dialog-state 0)2 {; }' }; f% b$ @
(reset)
" S9 s: e0 R8 Z& p0 d- N" ?7 o )
2 ?7 e6 R8 g) B (if (= dialog-state 3)( I4 l+ v& H6 h# I# N* T
(progn* \$ Q( ^, _) T9 L1 p8 `$ Y( r
(modify_line)
8 B+ r) Z& B: _+ B1 g; v' H (setq pt1 (getpoint (list x2 y2 z2) "\nFrom point: "))& ]- r3 j: F: V4 O4 h3 |- t9 t4 e6 i
(ver_pt1 0)2 T4 Z3 k5 n, R2 Y7 E
(ddline)
4 s& k; d9 [% [ )+ ?4 Y9 S+ z& ?' ]/ J
)
& c! ?% ?6 C5 M (if (= dialog-state 4)
9 ^3 P7 n4 e! O7 m) G (progn
4 ^3 s. I8 W$ _# z. a* y (modify_line)
/ u6 ^; V h, ` (setq pt2 (getpoint (list x1 y1 z1) "\nTo point: "))
. z- N) i" J* \* `/ K# R (ver_pt2 0): s3 e: a) ^% \5 c/ Q( k3 e- x
(ddline)9 a: C3 S6 E$ y
)3 k: b2 R; r6 \6 P4 q( @
)
" y F3 t0 M' {1 ]/ J# M* V (if (= dialog-state 1)
8 Q0 U" |3 F+ R( L8 a' Y" y; i$ C (modify_line)4 n) V! R5 l5 I/ Y
)0 D f, ^# w" y( o/ S) ^; `
)
9 q* |3 j/ d- x y* N* D ;;# z, I: {1 d+ i' r0 S/ x8 s+ R
;; Modify MLine* D/ I8 j9 j6 ^9 C1 @- s
;;
$ y& v( k \2 `' ?, x, U (defun modify_mline ()
! C8 r% T' H- P) W: }1 D (modify_properties)- {! G6 p1 n1 _$ T
(entmod elist)6 E. u' [! t9 V1 ^# }
), v h, `9 ]: E
(defun ddmline ()
' I' ^: J. J) D% x; }1 y (if (not (new_dialog "ddmline" dcl_id)) (exit))' V9 u0 s+ S9 X% J
;; Set initial tile values
5 H" D& M7 U/ T (set_tile_props)
. H" y' g- A$ a0 l2 j4 B (set_tile_handle)
/ T. O3 h# S( l& K( z6 K ;; Set mline style text field." Z+ }3 |) g% n8 e. F! y0 c. @
(set_tile "ml_style" (cdr (assoc '2 elist)))
: W c. f' Q9 X& G3 n) h& {& l( L* R! b0 s1 w9 \4 U) o
;; Define action for tiles8 Z( [ [( R* A9 X& j1 R# u" _9 r9 d
(set_action_tiles)9 j c1 f2 C( V: n8 [8 X
(action_tile "ml_edit" "(done_dialog 3)")* A0 B6 s3 h- f7 P! Q
(setq dialog-state (start_dialog)). q( ~7 {9 ?1 S$ H
;; Dialog cancelled, reset to original values.
+ O, e7 l8 Y& O! s& r/ M (if (= dialog-state 0)" s8 y: ?3 d( t# F
(reset)3 E a/ b6 g& y0 s5 V* P, H
)7 c4 z+ }- e) r+ k6 D
;; Dialog OKed, update the mline.* k( u* R6 f( V* ^: E# C
(if (= dialog-state 1)
: [, i8 D* s+ ^% G (modify_mline). z4 r4 o V) w6 {" k3 \
): q% m" E* K' f6 }* u0 E
;; Edit Mline, call MLEDIT.
/ E. z2 Q0 e( x (if (= dialog-state 3). @' I0 \0 P* z$ d
(progn: |4 ^; v b6 g4 C, }6 o" t
(modify_mline)$ k* [2 z/ ]& I7 r8 r
(command "_mledit")
7 d9 C$ ~1 h9 C, y2 h (ddmline)6 g# M) r1 T* A% d: k* r
)& V/ X, l# O5 Z6 o
)
( r* V/ J$ G0 v )
% e) K# \+ A. b' j! f: u5 n0 q& b ;;. J- j' x w/ Q2 b5 f
;; Modify Xline
, k) p, l4 A- b9 T ;;0 Y8 O$ Z- p6 n# ~0 t4 }: ^" h
(defun modify_xline (flag)! ] |! X S# U3 y$ Y; Y, Y
(modify_prop_geom). {% r/ g6 h3 ?; u! E3 m' |
(setq xline_pt1 (list xline_x1 xline_y1 xline_z1)); K3 B9 ]; `/ a7 E
(setq xline_pt2 (list xline_x2 xline_y2 xline_z2))
5 K( h2 ]* y% K9 `9 A ;; Update the Root point.8 O2 Y. ]. P% H: L6 _0 F
(setq elist (subst (cons 10 (trans xline_pt1 1 0))
3 V# ^1 y- {8 L" B0 M1 E (assoc 10 elist)' ^4 w1 @5 G- A' f, c& ~$ z! X( o
elist
) _ v9 r0 |) ?0 _& z: T ), f0 A: p7 T6 w- j4 B% U
)1 X6 c0 x p# L$ B$ i
;;4 S+ {' Y5 X7 [* p4 |0 C% L
;; Calculate new Direction Vector WCS
% J: D2 @6 S! z6 _# O2 e+ i2 X ;; x / (sqrt ( (x**2) + (y**2) + (z**2) ))
$ c2 E: T9 _0 A7 W4 n( r& v% t. u1 Q/ k/ i& i) T
(setq temp_dir (trans xline_pt2 1 0))
2 K4 p! c( u1 F9 H+ L2 d+ D* H$ v (setq temp_dir_x (car temp_dir))
2 j% `* G8 A% l+ f( v& b (setq temp_dir_y (cadr temp_dir))
% f7 ~; z' T3 L (setq temp_dir_z (caddr temp_dir))
; y: {+ p9 A, F% B/ f2 ~
4 t; x3 W. e1 @6 L$ F* V0 A (setq temp_xline_pt1 (trans xline_pt1 1 0))
' j' M' a/ `- R. ?6 U (setq temp_xline_x1 (car temp_xline_pt1))
- w! g; R0 n+ k+ X (setq temp_xline_y1 (cadr temp_xline_pt1)); c' a& {4 `7 i# U5 o. S( p2 d
(setq temp_xline_z1 (caddr temp_xline_pt1))$ f: F8 u+ A% V K* A9 ]# s; I
/ O' G% m' Y7 f) s; R/ E- C X3 W* b (setq denom (sqrt (+ (expt (- temp_dir_x temp_xline_x1) 2)3 W2 N" c9 J4 d. G' ^3 i! L
(expt (- temp_dir_y temp_xline_y1) 2)
# E' ^- m1 D: f (expt (- temp_dir_z temp_xline_z1) 2)& M3 k% ?0 o/ ~* D' m6 ?* ^2 l
)))2 ?3 W) S! A* v6 W$ W. J u
(setq temp_dir_x (/ (- temp_dir_x temp_xline_x1) denom)), Z8 v% J# V; H
(setq temp_dir_y (/ (- temp_dir_y temp_xline_y1) denom))% ` P$ k, ^7 d' {% _8 h4 B( w3 _
(setq temp_dir_z (/ (- temp_dir_z temp_xline_z1) denom))
0 I/ v7 }. D9 f" }- Q$ {! p& y (setq elist (subst (cons 11 (list temp_dir_x temp_dir_y temp_dir_z))/ {& r3 G7 v! L% t
(assoc 11 elist)9 Q# c0 y" O; P0 |! |: y! q8 ~' M/ G
elist
/ g0 M% `. L) V% M ); H' _( ]1 y# \4 ^0 O' q
)
4 d- Q+ f: l& D1 P( w (if (= 1 flag), Z( r3 r% }" J, `$ R
(entmod elist)/ R9 u) @, \4 C! M. ^: e- L1 A* M) l
)
4 Q& f; Q |! O2 P. Y7 T1 |0 [ i6 S4 ^ )" l2 f1 V$ H% _- G' a
! }7 k) A" E4 ?: [( h0 \9 ^
(defun ddxline ()' L4 ~3 y5 R! P% o) k6 n* N! ]0 p
(if (= etype "XLINE")- w# @% S/ Z5 i3 {) Q& m
(if (not (new_dialog "ddxline" dcl_id)) (exit))( \/ h; Y# ?" }% U( F+ C1 e
(if (not (new_dialog "ddray" dcl_id)) (exit))$ l1 u- i, U- d) Q9 Z9 t
)
- j2 d$ b) \7 T, a# h' P8 [ ;; Set initial tile values
' }% a( o& e+ O- K0 N (set_tile_props)1 |/ u0 m# E g! P0 J
(set_tile_handle)
7 L1 [, g+ x( U; `; o# A9 { (set_tile_xline_pt1)
3 `0 |: L5 X! |* k ;; Convert to UCS and post Direction vector.0 I7 v8 Q1 u0 W7 `6 G+ f# E8 x
(set_tile_dirv)
5 v% `( |) [8 F' i3 J3 P! J+ } ;; Calculate second point by adding Root Point + Direction Vector.
7 R- m- }$ o; N$ ?& w! K$ [) ? (set_tile_xline_pt2)
1 E, L. ~! k: J6 k. `4 k8 B( { ;; Define action for tiles
- }+ ~6 [5 J8 H, f1 i: l (set_action_tiles)4 m) n* u0 B' Z! j" X% d; }
(setq dialog-state (start_dialog))
6 B& q3 D% i. j, D3 s# b6 l (if (= dialog-state 0)
9 D2 i9 W% ]' l. B5 R (reset)
* C4 ?) o, W& D; h, i+ J )
/ [: b; E- O4 L ` (if (= dialog-state 3), o" f& z8 m( J; a" p+ b! [
(progn
, m) J5 o8 @. P# D (modify_xline 1), r' y; {. ?/ M. a8 d. y2 Q
(while (equal xline_pt2
" X* y+ e U4 Z# U% D0 T (setq xline_pt1 (getpoint xline_pt2 "\nRoot point: ")) 0.000001) Z" g7 Z2 m* Z) A: x
(princ "The Root point cannot equal the Second point.")
3 I7 M7 G( @4 K, Y. X+ h ). O/ F( Y1 j3 g' b( S9 \
(ver_xline_pt1)
, _0 n2 w$ A& q (ver_xline_pt2)
* p# g7 t ~0 Q1 R1 |" H# N(princ)& H5 B8 k8 [! p) Y: f2 _2 R
(ddxline)
' @% S( G# U9 _* g% B )
9 e" q: G: B O4 l$ x i2 r) j )
/ @2 r* E7 _, F' M; k' B (if (= dialog-state 4)
8 _. r; J, s8 K. C9 X( O2 B+ B (progn
# |( Y* R9 k9 P# r (modify_xline 1)4 D9 V/ d" P" v8 Z
(while (equal xline_pt11 X/ K$ j3 u& t) w. R
(setq xline_pt2 (getpoint xline_pt1 "\nSecond point: ")) 0.000001)8 ~7 f- C5 i& h
(princ "The Second point cannot equal the Root point.")6 J7 I, k6 a" i0 U: b0 }' g. l
)
! ?* A$ u1 ~/ ^, u3 A (ver_xline_pt2)6 u5 N* _& `* q B/ }! Y$ }
(princ)
' R G) _$ t8 ]! X) E (ddxline)- L2 N; a2 f0 Y' _6 @5 V+ O" \+ n# z
)7 K$ j, P! o7 Z' T: a
)
) B3 {3 V. ?7 V (if (= dialog-state 1)/ e6 \2 N8 E5 O% O
(modify_xline 1)
8 g2 x! `; g3 T8 G0 V( Y )+ ^0 ?& n9 t1 D( ?! r9 m; {( r- d
)
; L; C3 Y/ a% R- c1 s) T6 z- n ;;
5 O; ~3 N$ k: z( {9 n+ X( t7 o ;; Modify ELLIPSE
3 i) c* `. ]1 Q" {0 a( \! p6 Q P ;;& @" d. c% ?) z; f
(defun modify_ellipse ()
6 ~: c1 i# K! R! J+ J: t (modify_prop_geom)9 Y* L+ ?, Z9 P1 x" ?2 p5 r$ }
;; Update Ellipse Center Point value.) R$ Q x$ Y. }* k
(setq pt1 (list x1 y1 z1))+ C% _" Z8 O2 x2 o& H4 t: D
(tempmod pt1 10 1)
( ]( p4 Z3 r% h- D1 b8 j! A ;; Update Start Parameter value.
/ d8 |) ?9 I) T (setq y_val (sin st_ang))
( x7 U$ F6 t3 M a (setq x_val (* rrat (cos st_ang)))
) \$ G" B# w, @# ~) L, O) a (setq stparm (atan y_val x_val))0 R' k+ m, I0 g4 o3 U) ~9 h
(setq elist (subst (cons 41 stparm) (assoc 41 elist) elist ))- h# i O7 D- s2 l" p
;; Update End Parameter value. Normalize it, if it's less than
5 R9 x* E+ _; q$ L. I. j6 I ;; the start parameter.
* r( N' @# F z% h2 P9 u" e (setq y_eval (sin end_eang))0 R1 ? |, D9 p2 K
(setq x_eval (* rrat (cos end_eang)))
' p4 Z3 T; d" l5 _' t (setq endparm (atan y_eval x_eval))
X1 L! L* f3 c& G (setq diffparm (- endparm stparm))
' [* o1 y8 z0 A' p3 E, Y2 k ;; Epsilon of 1.0e-6 radians for checking a zero length arc.. f$ Z- i+ {$ N
;; Since zero length arcs are not allowed - construct the full
! z5 Z$ \9 e; t- Q; u) J ;; ellipse in this case.
5 f# x9 p' J3 P* l (if (<= (* diffparm diffparm) 1.0e-12)
/ ~' d' x. O. A (setq endparm (+ stparm (* 2 pi)))4 v8 d& ?; H# p1 X8 ]; b* K
)- _2 F. B& k( R* P @: y% x+ F: Z4 u; Y
(if (<= endparm stparm)+ ^. O- |0 G5 p$ J0 q- x' t
(setq endparm (+ endparm (* 2 pi)))
3 _& v0 Z* |& G& P% w X2 @ )
! ]. ~5 z% s$ u) L0 v- U' P4 C (setq elist (subst (cons 42 endparm) (assoc 42 elist) elist ))
: o9 ]# a2 x8 P3 D' p9 w ;; Calculate the Major Axis Vector by first calculating
! o6 C1 u- x: o& C* Z ;; a unit vector using the old Major Radius value. Then5 K" R/ H' @" j' {7 b; S
;; Multiplying that by the (possibly) new Major Radius8 _9 n/ F! i: ^& ?: L, m
;; value to get the new Major Axis Vector value." t2 ^; I: M1 \& b! s& Z1 c
(setq unitxx (/ xx old_majrad))) M' Y* {" @: P0 v9 s& Q J
(setq unityy (/ yy old_majrad))
, h5 l9 X, a0 A* G: h9 ` W (setq unitzz (/ zz old_majrad))
5 @3 f) j1 b4 R7 ~- q" p, } (setq newvecxx (* unitxx majrad))7 f+ k3 r! X% ~$ [, w5 ~
(setq newvecyy (* unityy majrad))4 p; o+ [2 ?! u
(setq newveczz (* unitzz majrad))3 Q2 S9 T9 ]9 i# {4 s6 s
(setq newmajaxis (list newvecxx newvecyy newveczz))
2 B5 K# @- K. v' p. ^ ;; Update Major Axis Vector value8 C% ^5 |. ~" B+ h! \# D4 z6 e
(setq elist (subst (cons 11 newmajaxis) (assoc 11 elist) elist ))+ [, e0 v, Q; V3 F
;; Update Radius Ratio value3 ?$ `+ s/ s. u0 D( Q4 k: g5 F
(setq elist (subst (cons 40 rrat) (assoc 40 elist) elist ))
# @- o7 B$ {9 {' d (entmod elist)
5 |" C: K8 |* e7 l0 `) ]7 t )& O+ p f( \# L$ n: g B. R- P' v
1 V9 P7 i' M9 `. F* X6 N3 k
(defun ddellipse ()& Y+ T# D1 O8 v8 `$ K
(if (not (new_dialog "ddellipse" dcl_id)) (exit))
, N: L# |! ?' V Y ^4 g Y ;; Set initial tile values
, A8 d; E* a# s: c7 y8 ?) ?+ c! @ (set_tile_props)' N9 { b, v# N4 T1 E; d. j( e
(set_tile_handle)" g" c( ~3 `% w: m" v% Q
(set_tile_pt1 1)
+ v8 z6 n- }- z/ K' F$ {: A (ell_calc)
5 l0 h) z9 g- Q* K; q8 Y ~ ;; Define action for tiles$ x0 w4 e1 W8 `2 w3 h& A, j
(set_action_tiles): a# U7 I c2 t! {
(setq dialog-state (start_dialog))
! S* k% B" L, i9 [% A- Z, Z (if (= dialog-state 0)
. u# n2 E- l% g6 W! Z- H7 U( ` (reset), i; F5 e; v" c* e! V% L
)
# A9 Q& u1 C' z5 T/ p- h9 ? (if (= dialog-state 1)# B! h: R2 h9 {* A, c u. C" K
(modify_ellipse)" T. w/ y! H/ w) r/ c
)& D5 z3 J" Q' U% X
(if (= dialog-state 3)
; q5 c/ u+ o |2 Z) Z7 |5 v (progn
3 F; X0 P7 S1 g/ B (modify_ellipse)/ H N/ n2 O( L! X0 V: _1 T( Y9 @
(setq pt1 (getpoint (list x1 y1 z1) "\nCenter point: "))
: p7 |2 ?- Y* x5 o! C9 J (ver_pt1 1)/ b, B) P0 _+ V- O L" \
(ddellipse)7 x3 q5 W% r3 X1 N5 _3 \
)
! f0 E$ s' l3 X7 s G* j ): S6 h; C8 Y: _! | Q+ x. l
)
5 H0 U( a9 @0 g/ w* q: k- K8 b+ G ;;9 s4 x' _! [! G( Z N# L' y
;; Modify REGION
' `' o# \/ Q" l5 r7 H, w: g+ @ ;;
+ F9 m2 {3 D2 Y& A3 s& l9 Q (defun modify_region (). W! ]$ q% M* J; k% N
(modify_prop_geom)
' {% M7 b# n9 s5 s W1 f/ _$ | (entmod elist)5 h: n5 i- D) u; Q% E; ?2 Q
)
' B& f9 l3 X+ B) a* y' P
1 Q8 a# ^# _# i- f" z (defun ddregion ()$ x1 o+ ^) \9 X' {/ G5 J% h3 Q; T
(if (not (new_dialog "ddregion" dcl_id)) (exit))7 B& Z$ s# J( l# A. M% N" d' w
;; Set initial tile values* B8 m; F# P# T% @
(set_tile_props)
2 n5 [9 J% s0 i: ~& W (set_tile_handle)* t. t5 ^' ?* N/ X! z9 o
;; Define action for tiles% t$ x0 v6 J N+ Z- V
(set_action_tiles)* ^6 E) w! g# t% g
(setq dialog-state (start_dialog))" x/ |% z: R' v
(if (= dialog-state 0)0 o, n' b$ f# G5 K/ O
(reset)
: U& m; C8 I' Z, e7 Z )
+ \* H M( v9 U (if (= dialog-state 1)4 z* e% O6 @' U5 F/ C* i$ a
(modify_region)
& b1 H$ i( c8 G )
% n, X+ M. m2 g5 F3 Z+ I )
; z/ b- @- `7 K+ u ;;9 D4 y, ~4 ]0 D$ i7 t$ E7 Q* a. h) K
;; Modify 3DSOLID' d# s0 Q$ @; V- V0 C
;;5 ^; I$ m2 v s9 z
(defun modify_3dsolid ()
! J6 v+ _# P$ Y' K) D (modify_prop_geom)
( U8 J$ e* N7 K/ t$ I (entmod elist)
3 [/ Y4 U4 o1 h$ d )
: f( V) R) P# G6 y0 s& m7 f: }+ f/ h: w9 \0 N1 T
(defun dd3dsolid ()
l2 s6 k4 O; G0 ?" y* l# q% o' s: X (if (not (new_dialog "dd3dsolid" dcl_id)) (exit))
5 R# Q5 A" Y0 X! c; i7 D# h ;; Set initial tile values7 Q- x8 @+ t' ?+ ^9 y0 F
(set_tile_props)$ n2 q* `7 W% g/ O- O5 I
(set_tile_handle)3 a5 f& T( T$ S; \
;; Define action for tiles. H- h' V$ k. u4 I7 z
(set_action_tiles)
& r) x! @6 q& l9 ~/ f; Y* g1 L, W (setq dialog-state (start_dialog)): L1 x) O$ X4 c8 X
(if (= dialog-state 0)4 k' x: p/ g! E7 p4 ` I& g l1 }4 z5 g
(reset)
* O" O# `- f8 U- l% D: G( z )4 @: a2 a) L' n9 J" ]' d6 S$ i
(if (= dialog-state 1)( s+ P: w% Z' T/ D/ Z
(modify_3dsolid)
. j+ X+ {/ n5 h _+ l0 l )
+ ?8 z. b- J) t5 j" S/ ` )4 o L3 Z/ }& K5 [) s
;;
; L7 x# d4 |9 V+ U# n2 s" A0 k ;; Modify AcDbHatch' u% M z# L! G u% D
;;( B. Q% S6 ]2 z2 u; c; f- z
(defun modify_hatch ()
; `: H% \. K2 M! N( }! \ (modify_prop_geom)
. i: d4 N& B* m8 l8 d' H# J (entmod elist)
) Q1 M' v: e/ P- X$ Y# z )0 t( X. P9 z$ s) ? |' z
; u1 I' R! `4 z7 ~3 k# L! Y' ~
(defun ddnewhatch ()* h- u9 n, d+ Q
(if (equal hatch-elist nil); i' }, _ _. c0 u/ ~
(setq hatch-elist old-elist)' E' ~' K4 g8 v$ ?) j* L4 {; `
)
0 @/ }; X: ^! F+ R7 J4 @: C1 Z( k9 l( T+ v4 |
(if (not (new_dialog "ddnewhatch" dcl_id)) (exit))
: R. u2 R. o2 I7 r/ O, \. S. o( y4 v* ]) z+ H$ k6 E" m9 a
;; disable the thickness tile
; Q2 S N6 h8 h/ A* n% @% P0 |$ [ (mode_tile "eb_thickness" 1)
! l: z [3 n4 W; w (mode_tile "e_thickness" 1)
: o; k0 p& k4 K8 ~- K- f# C7 \/ o4 G9 J% T
(setq help_entry "modify_associative_hatch_dialog")
4 @" o9 q3 Q2 c# V& z3 p8 z! \2 B (set_tile_props)9 s7 j* a J p
(set_tile_handle) D0 Q3 F& h4 a
( Y% `, r- e4 r/ ^+ g ;; Define action for tiles
, Z) k6 p3 K, E# \* t8 u- P (set_action_tiles)
" n& N: P( K9 ]1 W4 B' c (action_tile "b_hatch" "(done_dialog 2)")
$ e/ n( }: y+ s' {& v (setq dialog-state (start_dialog))
( `# h# z* N' f4 U) r& b, D3 K! I (cond
) x/ } N( a& y: ]( l* E ( (eq dialog-state 0)
! [9 l3 e. y$ F+ |: j (setq old-elist hatch-elist)
~7 |( `! r9 h" p! w/ ~ (setq hatch-elist nil)' `# S) W4 G* b( Y! z! u
(if (= (checkforlockedlayer ename) nil)
. g3 h8 E4 i% _) L# z" h( \$ h, a- x$ D (reset)
2 X- J: F" X' U" R: m8 ~ (progn ;;; special handling for locked layer reset* `3 k3 F- K; c) n0 y) [% ^ X# z, q
;; unlock the layer
) F6 w. L& s- T$ E) K# } (setq layername (cdr (assoc 8 (cdr (entget ename)))))
0 Z9 c5 l: z( t% y( [2 P% F) y (command "_.-LAYER" "_Unlock" layername "")8 i' B0 W' j- ]6 {& | j- q
;; reset modifiction5 _4 B# s5 o: G9 X/ f& R
(reset)
' [- P* p" j& `+ }- H- k ;; lock the layer again
$ C- S% L- Q" O5 s (command "_.-LAYER" "_Lock" layername "")8 R1 i8 k& d& ?) K& C
)
/ V# r/ H: E. ^, ?2 U )$ W1 z+ A. [; c) C0 {) D9 L
nil ;;; makes (ddnewhatch) return nil for Cancel5 y" L% b b+ s9 ?6 }& q7 t
)3 Z( s6 Z; Y2 b
( (eq dialog-state 1). q4 N$ Z' V8 M9 y
(setq hatch-elist nil)
) ? v' K$ L. P2 P (modify_hatch)
/ h3 ~( ]# B1 y1 T, x- m T ;;; makes (ddnewhatch) return T for Ok: O7 [! I, y6 B3 R6 E7 D
)
: s' P4 D% N4 B8 F ( (eq dialog-state 2)! H$ K& R5 z/ x/ I$ E4 ]
- m) ^7 D6 [" g! e U
(if (= (cdr (assoc 70 (tblsearch "LAYER" elayer)))$ V, |# e# C7 _6 `6 e
4: Y% E' `1 a) b
)
" B4 e$ I3 p: {& I" N6 G, m ;;; new selected layer is on a locked layer
+ a# L* J3 s1 r, b* M' B, j ;;; we can simply modify the hatch properties
9 f4 v% I( s5 o4 x (modify_hatch)
" s# I. I+ `) e9 q: E* m4 { (progn, _" S* \- h# ?1 s5 D
(if (= (cdr (assoc 70 (tblsearch "LAYER" (cdr (assoc 8 (cdr elist))))))
7 E2 H. m. D1 K8 Z 4* M) t: j& s8 Y# i1 F/ T9 i; y
)
" x: ~, O* l8 _5 ] ;;; We changed the layer previously and now the hatch lies on a locked layer.
" t' q% |3 G8 |6 h3 a ;;; We have to unlock the layer forethat we can update the hatch properties.0 {9 p- m4 l' _: ]; z
;;; If we don't do that (entmod) fails to update to the new layer.. G6 j1 N7 [6 k/ P/ Q
(progn" e3 i$ G% p2 E) N/ v5 k' ]
(setq layername (cdr (assoc 8 (cdr elist))))
C1 h) b2 M8 b: n9 R (command "_.-LAYER" "_Unlock" layername "") ;;; unlock the layer5 u! e; |; |1 C6 a4 y
(modify_hatch) ;;; update the properties2 A: c5 p, ?' m9 o: d( U& h
(command "_.-LAYER" "_Lock" layername "") ;;; lock the layer again1 t4 K1 \" U9 Y ~4 N' h
)8 }# {( G- t, C
;;; All other cases we simply update the properties
) X2 g f2 h- _: h" f( \/ u* c (modify_hatch)! g3 T2 N, E, z$ `! Y
)7 Z6 X$ h! ]. s% y1 i3 _
)
6 q$ T7 ?4 W% _/ C/ s* d6 T' ] ) 8 j! L+ h- S- E. \
(if (= (checkforlockedlayer ename) nil)
; ?! t* q1 X8 V# X; Q (command "_hatchedit" ename)1 D% i3 N4 ?& \' d/ c. [0 O
(alert ;|MSG111|;"The hatch object is on a locked layer.")- s% ]( e5 P- f x) ` A3 X
)* d: e1 C& D- q" a
(ddmodify ename)
8 r. z0 J! o5 ]* J: R( c )( M) s1 O1 m- i) o7 ^9 F4 U( e
)
9 F# ?* u: K1 Q5 b )
& U) ?2 q J$ K ;;
9 G; E. G& T8 d7 g# [ ;; Modify BODY6 f/ d; Q4 m: F6 q
;;
; ^4 l: L/ `' C' A0 r (defun modify_body ()
+ R. m! x `1 V. G (modify_prop_geom)+ g' e9 i# U. D8 ]. z1 O
(entmod elist)
, Z! G q6 ]* E0 ?3 E )9 ] F3 h5 [3 d+ F
9 ?2 l; J8 |3 H
(defun ddbody ()
- {& i. o% k2 W, F2 Q: W (if (not (new_dialog "ddbody" dcl_id)) (exit))
6 Y- {$ [. A r3 B# T2 ` ;; Set initial tile values
: F- ?; ^/ P, @- ]0 d (set_tile_props)
F. L5 @0 s% {. _7 B1 F (set_tile_handle)
1 q+ W( P7 R( C, Y. i ;; Define action for tiles6 F' F8 f u) U% o+ L- u
(set_action_tiles)1 i' P( x. E5 L. l3 M/ |- G8 K
(setq dialog-state (start_dialog))- v) Y9 _! ~' E- Q5 ~: ^+ r3 I, Q5 T
(if (= dialog-state 0)
% W9 B- L D9 w) a, h (reset)
+ r( H8 @& ?' {( I( l: j )
% o# o! K2 P% J m! g, W0 y0 |! C (if (= dialog-state 1), v( P# r0 e$ L5 R7 Z
(modify_body)
9 p% G6 m# [0 X% D )
E: p' g$ s) g, P- {% T )) n8 x" e6 o1 N; a% t, ?* ]% F$ W( F
;;, ^7 J! Y& h4 \- V/ E* d. e6 ?. \
;; Modify CIRCLE
6 V% o! \% Y! q, {6 z ;;4 ^ U7 Q4 U: z7 k9 _* o
(defun modify_circle ()
% t i8 m$ c7 U2 F (modify_properties)
- S' Z& J9 m5 a1 ^; ^ (setq pt1 (list x1 y1 z1))
: o% ]; `, k$ ^! v5 m7 d$ @ (tempmod pt1 10 1)
8 P& p3 Y) j* j (tempmod radius 40 nil)
4 U+ q3 S/ L' c: E) F (entmod elist)
; [% B6 P3 ]* ?& d+ { )
" d) X2 ]' k) K- ?* [9 M$ ]" C2 }" o! y) M
(defun ddcircle ()
+ J* B+ F" V. _, b1 j (if (not (new_dialog "ddcircle" dcl_id)) (exit))1 w7 }; Y/ n6 g( L0 a8 m: e# Z
;; Set initial tile values5 b* c' _, `. n! a
(set_tile_props)% x8 A$ g, J P( R
(set_tile_handle)
( z# l- G. \7 x( U (set_tile_pt1 1)
- c0 r" M& j$ z6 L (set_tile_rad)
( Z/ s+ H+ }8 a& _7 G; f (cir_calc)( |+ g+ \# P" T) H
;; Define action for tiles9 `4 ?3 k, T9 U# l& w/ h
(set_action_tiles)
6 v0 M% N$ d* ]2 z2 X2 A& e (set_tile_pt1 1)
( f. ~: d; r& X2 b (setq dialog-state (start_dialog))$ |6 s3 \5 t* z' e5 p" i; F
(if (= dialog-state 0)
' V/ N+ P; x3 j+ [) r (reset)
- e' d" u7 `; X; u `% S )
/ ?# B! v5 S7 q0 C2 ]& E (if (= dialog-state 1)% k! F# o1 u! ` [
(modify_circle)& }6 _# U4 v1 i8 _# u$ S
) U2 N7 K+ S, i7 i7 R1 ?
(if (= dialog-state 3)
( h( i" E) h; Y (progn B3 n9 _' O7 ^2 Q- t! v- Y
(modify_circle)' H. v- @" J) P5 B
(setq pt1 (getpoint (list x1 y1 z1) "\nCenter point: "))% v T! X* v/ H4 j f- `$ s$ k: v+ u F$ T
(ver_pt1 1)
4 E% m, c$ z$ W9 g1 O( Q+ ^ c (ddcircle)
. J/ {# Q: P- m- s/ L )7 N6 F9 b* y& B4 {- V& v0 G
)
; m: H- z. Y f! {$ b ), X, A4 j1 V8 i3 a
;;
B$ }0 O# H) \6 T" ^& Q, v+ _/ i ;; Modify ARC
* ]- }* q6 y n" n+ h* B8 ^ ;;
7 {/ R6 i0 f/ h. P! k2 M (defun modify_arc (). {3 c: m5 i- J5 m& L. M% _
(modify_properties)1 w) G# C/ T2 w
(setq pt1 (list x1 y1 z1))
7 @8 p. g9 {; r. R$ f& c# ^% v (tempmod pt1 10 1)* u5 z) C9 I- N, f
(tempmod radius 40 nil); K% l# w$ _! f% y" \8 ^; H' W
(tempmod st_ang 50 nil)4 v! [& I: T" B# Z: l i5 ~6 b
(tempmod end_ang 51 nil)* W( a A" v3 z: E/ O7 i' M x' x
(entmod elist)2 r2 Z2 b) }4 d' I* F3 u) L4 m1 s
), V7 E2 U7 v: S H. I( B
(defun ddarc (). _9 R, Y# @5 |, g5 r" b) H# h" @
(if (not (new_dialog "ddarc" dcl_id)) (exit))6 S6 e1 I2 [3 G' E v
;; Set initial tile values
7 R0 v) q9 _' r+ `1 e (set_tile_props)9 i! R; T+ x# e$ S
(set_tile_handle)3 d& o2 C$ O/ p. j- s4 W
(set_tile_pt1 1). S" q" Q8 b/ F, t4 [) N
(set_tile_rad)
$ X- C8 U* U( q: b; W (set_tile_stang)% R; o% j# `8 X- y! s
(set_tile_endang)
0 h9 p7 [9 e, s4 k5 N% K (arc_calc): o2 n% P/ ^, W/ Y6 I, D: H Z
;; Define action for tiles. \* z+ ]8 b$ U7 {2 F0 D0 e6 Q- q! t
(set_action_tiles)
1 c" K M7 o8 j0 @( T1 s (setq dialog-state (start_dialog))3 S: l# |! i6 M( _/ N6 G2 W
(if (= dialog-state 0)
0 D/ i/ e/ Y0 V& I3 m2 P1 q/ ~ (reset)8 ]' Y9 K$ A1 y/ d8 k0 n, A: `
): v: }3 K6 r6 z- R' }
(if (= dialog-state 1)
* K. @ Z8 Z* H (modify_arc)
4 d0 i1 D2 e" L- w+ A )2 a7 x. n: z! M
(if (= dialog-state 3)3 ~- A5 C9 a' M. x' x
(progn$ i; f0 ]# W7 y# a2 [
(modify_arc)+ l: s4 V5 }: p6 Y4 O7 w& Z
(setq pt1 (getpoint (list x1 y1 z1) "\nCenter point: "))' _6 p* t* y* F0 n# G; z, O
(ver_pt1 1)
3 m u5 O: {! U" [ (ddarc)
& d; {0 F1 K: z9 y )
& K v; E. X7 T& u8 F )
. u- o9 o8 }& S" b; h- F )4 `# b! H! P% q _3 ?
;;! x- s) }. p4 a! H3 F
;; Modify SOLID or TRACE
% H% H! p& P, j2 c, j1 e. L ;; Note the Z value of the object is determined by the Z value of the fourth
# |: w. o$ _% A( r( y; C5 a" { ;; point - code 13. Changing the point values of a solid or trace from a UCS* |3 D) {* L( a- j! }/ ^4 j N
;; that is nonplanar to the UCS the object was created may confuse the user.! S' G' t; c; G7 E Y: b1 M( q6 l
(defun modify_solid ()! q# I4 G; U6 Y, X: g/ W
(modify_properties)# k# R: Z* |9 z; _9 v9 a3 F
(setq pt1 (list x1 y1 z4))& I' {. m! H& B
(setq pt2 (list x2 y2 z4))
Y+ F) b( B1 v* m (setq pt3 (list x3 y3 z4))
0 E7 @) D8 |: Y3 s* n (setq pt4 (list x4 y4 z4))
# L( v+ Z2 c: ~1 \ (tempmod pt1 10 1)" f" k3 h. k0 b: V( V
(tempmod pt2 11 1)0 \. g* e# x! p. ^+ m: {8 t- L- i
(tempmod pt3 12 1)
4 z9 G" G3 u* M1 N7 g (tempmod pt4 13 1)
( s" ~4 M+ R" }) x (entmod elist)
- q! \3 R% d' G& E: Q1 U) S, H )7 x4 p6 [3 L' P, R y
1 J% u/ Z; g& i3 ], v, r* s) z
(defun ddsolid ()0 B. g ~' m4 f9 M
(if (= etype "SOLID")
: z& p. P* u5 I; P8 J* S% M1 c (if (not (new_dialog "ddsolid" dcl_id)) (exit))
9 }1 v$ @1 g4 L! J$ U (if (not (new_dialog "ddtrace" dcl_id)) (exit))5 s5 k' M# [( w+ e$ L' G
)( Y3 A; {* U- Q5 ~1 ^
;; Set initial tile values
6 ?$ y6 l/ s/ Q( O T; P3 J/ B) r; I1 N (set_tile_props)
" o, L. @ ?% G9 F& D (set_tile_handle)7 e; S% X' t" k: Y- j
(set_tile_pt1 1); @! K6 V, v7 i" W& f
(set_tile_pt2 1) G4 y: X' e2 i# Q
(set_tile_pt3 1)3 B. q* w4 S7 N9 I
(set_tile_pt4 1)
8 Y6 W- i) S5 n" y* M ;; Define action for tiles2 o* \, P$ V- [! p2 |8 N
(set_action_tiles)' m; L V3 {% O7 }3 x8 S3 C( b
(setq dialog-state (start_dialog))
$ a1 k5 x+ `! a! f# M (if (= dialog-state 0)
) ^5 Z! F) S @3 @# o (reset)7 B1 F: v/ `/ k7 N. w
)
8 S+ D) R: o" h' M (if (= dialog-state 1)9 ~. a( ]4 Z0 h) V) O% ?7 m7 c
(modify_solid)
* A k0 l' M$ k: J% o1 q- i )
1 l& {8 z! L. k# M% L+ ~ (if (= dialog-state 3)# I) f4 t% g: C8 M2 ?
(progn g$ @, Y/ @" V) w' P- w: t6 @
(modify_solid)
& g) B( i2 i, K/ V( e (setq pt1 (getpoint (list x1 y1 z1) "\nFirst point: "))
- M# J7 z' ] l4 ]4 b7 x (ver_pt1 1)
9 Q% u6 Y: A' f! n9 D1 F4 { (ddsolid)
$ l# ?' O8 E9 s0 g7 n1 w2 v z )
% K: V! W9 u- j e5 i9 O )5 t r; O& s' \/ }3 S0 Q$ [
(if (= dialog-state 4)
, U+ ^% z; p5 |* X& d9 @ (progn# E6 |3 E; X3 L
(modify_solid)9 O3 Y7 T% h8 W) l$ p) R$ M
(entmod elist)3 f/ G+ I e: y: P: \, _3 a
(setq pt2 (getpoint (list x2 y2 z2) "\nSecond point: "))9 W- N/ I- F, ?
(ver_pt2 1)
; L2 B$ n3 ?' C* ~# r (ddsolid)% S4 T2 ^, V |1 o7 r& R& h
)
% U& K( C( B7 M )! m' v; P. w0 C4 F
(if (= dialog-state 5)
2 D# N# _4 }$ ^3 P" H( D* E (progn
; H$ d" k% s! i g* F (modify_solid)& T6 X) n/ B$ ~- d6 r4 P% O. m
(setq pt3 (getpoint (list x3 y3 z3) "\nThird point: "))
: y# G! d8 n. A% Z, T (ver_pt3 1)
/ i/ T, A" c* }4 ?- } (ddsolid)
4 k; q5 l5 O' G' m: B F )! K- H n( c2 k, I6 N
)' m4 q! M2 {7 o6 \8 o$ [3 n k
(if (= dialog-state 6)
; v* F" _9 j0 I2 }# ~ (progn
& |3 E# r. a2 |+ t8 C2 S( N (modify_solid)
+ B$ ^( h) i' J) H7 ]( s (setq pt4 (getpoint (list x4 y4 z4) "\nFourth point: "))' T9 A4 i) G- s- {0 v
(ver_pt4 1)
; b! j2 x* j- z0 N0 G (ddsolid)0 K5 f3 e* Q# D8 h. l. n6 @
) {- a+ ^3 }1 @0 F) c2 n
)
0 \) j4 X0 g% [# b4 y )
: v W4 P2 u, E ;;
7 F0 S( [) H- x: V+ T6 A- j$ W ;; Modify 3DFACE
1 r' {. V! P! U0 s( b! C, R: R ;;
+ W, Q0 J* Q, u& K( }4 ^ ;; Check visibility of edges
8 m* @; L! {4 V) s% w) k1 V' B7 p ;;% e" w. q9 ^* ^+ S" F8 M0 p
(defun edgetest (/ bit1 bit2 bit3 bit4)& Q2 d6 r N# X% \. s% O
(if (= edge1 "1") (setq bit1 0) (setq bit1 1))0 v: N* b( B0 B8 e
(if (= edge2 "1") (setq bit2 0) (setq bit2 2))2 y0 v. O1 b. z1 k
(if (= edge3 "1") (setq bit3 0) (setq bit3 4))' q3 @$ C# Y4 `5 t) F2 a1 e" A
(if (= edge4 "1") (setq bit4 0) (setq bit4 8))4 x) S) Z6 M9 Q* w/ m) x: L
(+ bit1 bit2 bit3 bit4), b0 L8 X. Q9 }! S" _) [' e, B8 D- `
)
& {. P9 X7 y) f7 y, {. g. ^; ?4 _; c2 s5 o; l! a: n. r$ O
(defun modify_3dface ()
W5 N! p( |# s7 U/ B (modify_properties)
' u; y% u* P+ H h) [, E* _* G& ~ (setq pt1 (list x1 y1 z1))! @' x4 `; H- W/ t ]7 q3 [2 Z" Q
(setq pt2 (list x2 y2 z2))
, p/ g3 I6 W% y p8 C, O9 c (setq pt3 (list x3 y3 z3)), B. N6 A/ X6 S J( b1 T7 e
(setq pt4 (list x4 y4 z4))
8 E* q) `3 ~5 D" h4 J+ T; K, i! R (tempmod pt1 10 0)8 A1 x- T" [ C2 D o
(tempmod pt2 11 0), {4 V* J8 c$ I; Y' I; F8 @
(tempmod pt3 12 0)
/ q* X6 ], |9 J3 \( [ (tempmod pt4 13 0)5 R7 T# j; x" g( L, B/ ^
(tempmod (edgetest) 70 nil)! G, b, k: M6 w$ Q5 |
(entmod elist)- l3 g% j' Z3 e1 y
)8 b3 i9 N6 a2 w* u1 Z
. J0 V& k. Q$ n9 U- I& V
(defun dd3dface ()4 l5 j$ w7 T6 z5 e7 Y' n7 n; d
(if (not (new_dialog "dd3dface" dcl_id)) (exit))
9 b0 Y0 M; S S( I' A. I/ j% e& V (set_tile_props)) I8 M2 Z2 {& V8 I2 [( ~
(set_tile_handle)
0 U% }4 |/ n# V. V( x. @ y (set_tile_pt1 0)
+ L! {1 x8 C$ C, s: L2 S+ D" }1 S& j (set_tile_pt2 0)2 X: m0 n. {5 X6 H
(set_tile_pt3 0): j; V* G, f! T) X
(set_tile_pt4 0)
9 M* o: m- l! W; D2 v* L (set_tile_edges)
* Q; C( K0 G& ]7 j7 r' P ;; Define action for tiles6 A6 o# t( M+ s3 o1 x
(set_action_tiles)% B. _7 c' T, |. R2 ]
(setq dialog-state (start_dialog))( [5 `" Q9 x+ a3 i. ]; Q, W
(if (= dialog-state 0)# @+ ]' O+ l- c* L5 Q4 ?: e
(reset)
$ k3 _+ u' s$ F+ l0 X )
H3 ?) t# Q. A. x9 x (if (= dialog-state 1)& c' r/ d3 p. l2 g. `% l% U' \
(modify_3dface)* q- L9 O; h& ~$ c
)1 E8 B# u3 M4 f0 a
(if (= dialog-state 3)) m3 M! U" T1 C
(progn8 E' M4 D6 ~' f+ t5 Q
(modify_3dface)
3 w6 _4 q" X& ]2 E' C (setq pt1 (getpoint (list x1 y1 z1) "\nFirst pt: "))) j8 Q" e6 M5 R: S& J. g# f+ Y& i" i
(ver_pt1 0)! L6 q. F" j |% q8 C
(dd3dface)" j5 ^9 f5 V; R% z! I; U$ H4 B
). r$ q- ~2 k$ F! \+ S; F
)
9 H7 @! e# \" n, V/ g$ [. k (if (= dialog-state 4)
* ^, D2 a, c: w' {) X (progn
5 e3 g9 E, j# O2 q5 j8 L: N' x (modify_3dface) h9 `2 p9 x. c# Z
(setq pt2 (getpoint (list x2 y2 z2) "\nSecond point: "))6 ~+ m8 f) H$ c4 }
(ver_pt2 0)( n# A" z1 D7 `& {
(dd3dface)* f2 o: I1 P9 }8 P. b& ^5 b
)1 y# H- m$ E& m7 v# i9 Z& S
)
1 }% k, D9 P$ \! M' N7 V' b (if (= dialog-state 5)
6 Y w' g# T' A n* j( @- c (progn8 z: A; i. K6 i8 B% E
(modify_3dface)
. T# m* F. Y# G, U9 @0 m! ? (setq pt3 (getpoint (list x3 y3 z3) "\nThird point: "))
. k( q2 q `) c# H7 N# A. Q (ver_pt3 0) |" l& T3 m, e E" X
(dd3dface)1 E+ j( R1 V+ s2 z+ [. }) W
)/ R, H9 z0 Q. q
)
" a0 ~8 P( G+ {: \ (if (= dialog-state 6)
- r* I1 z9 L! l$ v2 b' A (progn
J# N9 F1 S/ y5 [3 d2 N$ E6 } (modify_3dface)
2 _/ M- l* F' G8 [% e! P: u; R (setq pt4 (getpoint (list x4 y4 z4) "\nFourth point: "))* A3 j5 A% m/ ^& b! F: o4 ^
(ver_pt4 0)
* k1 H- S8 u/ b (dd3dface)5 r* i Q0 F2 N: {0 i- |$ V
)
; g: ~- b! B" _# s! Z6 w' h" n" X )
; t3 f/ V1 t9 [" Y6 v: Q: {' d ), l6 n3 `& r2 f: f2 P: C
+ B3 \: H1 Z$ ?: \5 D! w ;;
* ?# g, [0 |: y! Y; Y2 | ;; Image functions( y3 O9 e7 t" e* _
;;
. ?* y, d9 E' B" T' T (defun image_scale (/ upixel en n userscale temp)2 {. v' c6 I! J4 @2 Q& Z- I* o
;; Calculate the size of an image pixel in AutoCAD units) b4 M8 H) b' S# i
(setq upixel (distance '(0 0 0) (cdr (assoc 11 elist)))) t2 ^1 m, B' b* k& }+ Y
9 b( `& g2 g% D3 K3 K6 |& c ;; Retrieve the user scale5 A! o( d( I% i) C, I( |( V8 x
(setq en (dictsearch (namedobjdict) "ACAD_IMAGE_VARS"))5 ?, r; E# F0 V) J! |. {% P
. Q0 J7 R0 [0 w, ^4 }' D ;; Next, extract the image units and pixel resolution
# x) C; E: I7 ?2 Y9 K$ c (if (or (= 0 (cdr (assoc 281 image:olist))) (= 0 (cdr (assoc 72 en)))): o9 y) g3 u5 S$ n5 A
(setq image:scale (* (cadr (assoc 13 elist)) upixel))
- N1 B( H+ W% g% ?3 j6 Q1 X$ v4 y0 O8 g (progn7 I/ y. f. r9 z& s! ?+ c
;; Convert the user scale to the proper word
8 m' L5 G1 o/ s& D, O (setq n (cdr (assoc 72 en)))* q+ k' D5 ]; g, B8 w6 q
(setq temp (getvar "LUNITS"))7 |0 e" k( _; f; l. w
(if (and (/= n 0) (or (= temp 3) (= temp 4))) (setq n 5))9 W, T9 U/ j3 v6 @, y I
(if (= n 1) (setq userscale "Millimeter"))
; {! D* ] g8 p: l* y (if (= n 2) (setq userscale "Centimeter"))
+ ` p: h0 p+ v. T& f8 h (if (= n 3) (setq userscale "Meter")): p, M# G6 ~+ h& k3 ]. Q6 f1 J
(if (= n 4) (setq userscale "Kilometer"))
% e. a( ?. n$ ]8 R0 q (if (= n 5) (setq userscale "Inch"))
5 U* G$ N L5 B$ g" \9 h+ a' T# W (if (= n 6) (setq userscale "Foot"))
7 i0 b' h/ L8 t (if (= n 7) (setq userscale "Yard"))' D8 o7 w, b/ H' h, ]
(if (= n 8) (setq userscale "Mile"))
5 \5 `$ Y. m" t (setq image:scale (/ upixel (cvunit 1 "Millimeter" userscale) (cadr (assoc 11 image:olist))))
( i$ V/ V6 b) V )! x9 o& A! o9 u8 T8 \# I
)# H- S+ \! j( e) p
)7 f) {6 S. L. r1 @ G8 B$ H' C
- c2 x- P& M0 x
;;
; J; ^) k5 i$ [2 _+ _# D$ a- K ;; Scale factors for block insertions
0 F/ Y) x* ^' V- b) F# s6 R: e* s* R5 e ;;
' {5 c9 k" G+ A! q3 M (defun image_set_tile_scale (/ temp)
; s8 p' j$ Z8 G1 x: V (setq temp (getvar "LUNITS"))+ @2 w- w) I8 D8 V
(setvar "LUNITS" 2)& O' |* Z0 e% d. ~9 z4 Q( K" d
(set_tile "xscale" (ai_rtos (* image:scale image:mult)))
! \. _8 B* F% b" Z (set_tile "wid" (ai_rtos (* image:width image:mult)))
6 S2 S* W7 F! @9 w& O (set_tile "hght" (ai_rtos (* image:height image:mult)))3 o' M' R/ ~/ l6 V1 D$ [
(setvar "LUNITS" temp)
4 }2 u) ~. A6 \! J )
$ y9 m i; K* [) I+ D3 @' v, d2 i9 ^7 U" Q- |- P* N
;;* q# b! f) A' i: t
;; Set the scale, width and height values appropriately.
8 V$ W; \) U' S+ t ;;
, f1 w8 d9 t4 P: s( R9 o (defun image_update (field value / orig_value new_value mult)# N9 x- H* A$ Z c' |8 @) P4 M7 P
(if (= field "xscale"); ~( ]1 R" q/ z, g5 q) T7 i" y! B
(setq orig_value image:scale)# q( B/ {% Q4 M9 a' e# \
)
4 [% e; h# j$ I; ?4 ] (if (= field "wid")2 E# [1 ^% B) _$ v C, T- t
(setq orig_value image:width)7 U/ z, g( m/ |2 U
): r1 `: @2 X# w+ }/ s0 T3 v0 d
(if (= field "hght")/ P; p2 a% C4 h' D3 p) @, |: N& q
(setq orig_value image:height)4 e% z1 y z/ e0 V, W/ ]
)
- `1 h; ~& P) }- i+ w9 e8 S (setq new_value (verify_d field value (* image:mult orig_value))) _2 q# c" m5 e: I* c' K0 |* H
(if (/= new_value old_value)$ s* ?% g) M7 T# E; L
;; Make sure the user has entered a sufficiently large value
: N( C/ s, o; r6 l4 w4 [ (if new_value2 F6 N* L! b3 h: u9 l6 F4 U$ Z
(progn
+ [$ P- h* ^8 T z9 h1 } (if (< new_value 1e-8)$ [6 n. I8 c( U9 T
(setq mult image:mult)3 h! q3 R0 S8 `7 ^! F# e1 @
(setq mult (/ new_value orig_value))
$ h! g9 x% D; v3 n* N4 Z; N5 q7 } )9 H' ?2 b( S* H$ W/ v
(setq image:mult mult)
& n9 u$ x. V$ \2 G (image_set_tile_scale): l% K j' R r% W1 O
)1 H% V$ Z1 ~5 v
)! k. y: @5 r/ T6 V- U- ~4 u
)& P2 T$ L* S0 m% E0 V
), S& ]( I7 g5 u1 y3 r5 C+ O
& R# p1 \; D3 S+ V' B( n6 I9 f* t/ V (defun image_disp_opt (bit)
$ X) x) j0 n$ ? x' i6 z2 e (setq image:options (Boole 6 image:options bit))7 Y8 C2 p8 S1 ~9 C# @- P% H5 K, F
)
9 e, c2 C+ B2 U" O$ ^1 f* x5 {; ?) z4 _. d6 ^% |- ~* y" r
(defun image_modify ()
# `) J4 p3 W# }3 P (modify_properties)
- c; o! x" \) s* B3 p9 G2 r (setq pt1 (list x1 y1 z1))
4 b/ I. Z. `) y. Y! | (tempmod pt1 10 0)
$ M6 w4 A7 N, ~; F (entmod elist)$ {- k# t2 ~# B
)( }5 s9 `- U6 @
. i( F; V4 @& ] (defun image_clean_variables ()
: c, O* q- [$ N( w ;; Clean up global variables used here `# h8 u$ a. s; U6 p& w4 j& U
(setq image:scale nil)
: D" n. ? M1 |' W% T7 v! G7 l) C (setq image:angle nil)
7 Y4 ]0 G/ a/ q: t/ P7 m (setq image:width nil)9 D# x+ e' F6 `& W
(setq image:height nil)
- n+ D! X/ q! k! R$ c5 E (setq image:options nil)) s& f; T* q, }! t# S3 t3 w4 x8 ?
(setq image:oname nil)
9 z: d& I8 E. r; T (setq image:olist nil)
! u( r. Q% X& y" X8 l: ] (setq image:mult nil)0 B+ }& E" \9 j- R4 i) ^$ R) `
(setq st_ang nil)1 P- b# K) C8 l/ Y
)
% H. G8 |6 q% s7 D& [( r q p, K4 s6 ~. g" Y
(defun image_scale_vector (v1 value)( O* p% }1 g: b* _
(list (* (car v1) value) (* (cadr v1) value) (* (last v1) value))+ M& @1 U' H8 }" E7 f) v+ D" R
)# y" x8 U2 B( t3 m
7 @: `- R1 ^: E- Z. q ^
(defun image_cross_product (v1 v2 / vx vy vz)
- \9 ]1 }3 @3 A2 L* e4 g (setq vx (- (* (cadr v1) (last v2)) (* (cadr v2) (last v1))))- S" q- R1 Z. z* o& O
(setq vy (- (* (car v2) (last v1)) (* (car v1) (last v2))))
# \. C: T h6 |: U4 o (setq vz (- (* (car v1) (cadr v2)) (* (car v2) (cadr v1))))! r1 C: a; U. ]! w
(list vx vy vz)
* n( }3 b6 |" q )
. X; {6 `' I5 f8 p6 r* ~3 |, s
) L/ b$ h- d4 Q5 n! I# ^ (defun image_dot_product (v1 v2)7 F% K9 D' S* O' i. W0 q
(+ (* (car v1) (car v2)) (* (cadr v1) (cadr v2)) (* (last v1) (last v2)))! r% P9 N5 k1 d/ x1 {) b) ^7 ~
)9 O. O% s a& `6 F. c6 T
9 P$ i0 K/ N4 w3 p% b- N' t, y (defun image_add_vector (v1 v2)
! N! Y6 M; S+ a( N, [ (list (+ (car v1) (car v2)) (+ (cadr v1) (cadr v2)) (+ (last v1) (last v2)))$ P4 Q! ^! Y) n8 i+ ~
)( r% I' _5 r/ K3 z+ F( q: g% R- L
?. D" B2 g+ I/ F" W: t
(defun image_subtract_vector (v1 v2)
8 n; h, f, } \7 r2 a$ w0 F (list (- (car v1) (car v2)) (- (cadr v1) (cadr v2)) (- (last v1) (last v2))) c* t- D! P2 z5 a, q
)
) o6 _( Q* H0 D3 [* m8 P' q. H. [, e* o
(defun image_normalize_vector (v1)
8 z, W1 S3 ?5 N# V o _ (image_scale_vector v1 (/ 1. (sqrt (image_dot_product v1 v1))))
# @8 @! J- u3 M5 E; o )
4 e1 L: d, w; q4 h( R, Q
* z& ]' T! B9 c& M8 y( L9 e8 U (defun image_rotate_vector (vector angle axis / along_axis axis_x_in_rot_plane axis_y_in_rot_plane in_rot_plane)7 n5 E! S3 o7 E, j7 d
;; Normalize the axis
( y. F8 d! _, e6 _' P- C (setq axis (image_normalize_vector axis))
2 D/ O' Z$ f- b2 ~ (setq along_axis (image_scale_vector axis (image_dot_product vector axis)))
4 n. X& \- b1 [$ V (setq axis_x_in_rot_plane (image_subtract_vector vector along_axis))* W4 A* _: X* w, e1 ]; y: l" Q
(setq axis_y_in_rot_plane (image_cross_product axis axis_x_in_rot_plane))
0 z- X/ Z5 A4 G" | (setq in_rot_plane7 l& c* a1 [ ~
(image_add_vector
) K6 t# w- p1 E# D" g5 Y; h* [ (image_scale_vector axis_x_in_rot_plane (cos angle))8 C: q4 M( W7 U8 @4 R& d
(image_scale_vector axis_y_in_rot_plane (sin angle))* P& t/ T/ `6 } D0 p
)
# v" v2 w+ _" O )% d& u; U0 g- q1 ~
(image_add_vector along_axis in_rot_plane)
1 b' ~) k3 z: V! R8 }% A! C! O ). d* \6 ~* s m
( @/ Y, j, ?) ^
;;
* n8 F6 F; E. J7 H ;; Calculate current rotation angle if appropriate." u |8 H" N2 e, g1 m
;; If not, grey out the rotation field.1 A% f/ ~8 r9 W6 y
;;
2 j* r; m4 [' j3 M- l (defun image_rotation (/ normal rlength zlength sqrt_tolerance)
1 U! q/ A& G( M& V- h ;; Determine if image normal is codirectional with, y* d' u8 a, G# t) ~7 I
;; the current UCS Z-vector.7 |* H: Z7 m% E( w$ Z7 U5 t
;;
4 M& B% d; K/ ~' W1 |$ T5 E1 U# e (setq normal (trans (image_normalize_vector (image_cross_product (cdr (assoc 11 elist)) (cdr (assoc 12 elist)))) 0 1 1))9 E$ l- @6 X7 a1 M1 W* W6 p) ^
(setq rlength (+ (* (car normal) (car normal)) (* (cadr normal) (cadr normal))))( ^: Q _. j: y# z
(setq zlength (* (last normal) (last normal)))' u: q5 T. c" {# B
;; Note that the value .0001 in the radians is approximately 0.0057 degrees.
( P9 z, E2 F. v- T, J ;;
8 W; l. z' e- ?% o y' G ;; cos(.0001)^2 Z N8 ]* @0 i+ }
;; Tolerance = --------------: m/ \$ t- E u# c N5 ]( F
;; sin(.0001)^2
; Q, `5 z9 S/ ]( U5 D$ }$ ^ ;;
( ^- R3 o2 V7 w8 D e8 t2 U5 x (setq sqrt_tolerance (/ (cos 0.0001) (sin 0.0001)))
$ h8 h. @+ E6 O (if (and (< (* rlength sqrt_tolerance sqrt_tolerance) zlength) (> (last normal) 0))
' x5 z0 ]+ Z' G. b" ~ (setq image:angle (angle '(0 0 0) (trans (cdr (assoc 11 elist)) 0 1 1)))
3 T. M6 |$ X5 T4 \ (progn5 g) p6 s( Y H4 T9 P
(mode_tile "st_ang" 1)
4 j" P# W2 ^5 I0 t1 s. T0 f, I! W (setq image:angle 0)% \7 Y) ^9 X" {. @) d- @8 a* r
); g! [& F. X3 d1 l5 ?
)" `8 z/ A; w9 D- R
)
- ^. a+ U. i* ^, J* z# h
+ q4 O$ {$ c. V) W) M: B% N ;;1 }7 E1 H- E# Z& z, y8 U
;; Modify Image$ y0 Q0 e" z. N9 F+ N G
;;
# w6 h1 X3 `0 U' y' m3 l; x/ [ (defun modify_image (/ u_vector v_vector z_vector)
" v' e! s5 ]& t6 Q* |" @" U (modify_properties)
1 k1 o1 f3 A7 n. }+ m X _ (setq pt1 (list x1 y1 z1))' p |" P+ M5 m6 ]6 L5 i1 ]* o
(tempmod pt1 10 0)
6 V) y5 h, `" a) L8 \3 Y% { ;; Make display option changes to image* t9 D' o% F4 N7 V+ n$ j
(emod image:options 70)8 Y: \) v5 W" C2 m4 d( g" [
;; Get the u and v vectors
' S# l3 u4 Q) a (setq u_vector (cdr (assoc 11 elist)))( e, B( @0 o" A S% O7 {
(setq v_vector (cdr (assoc 12 elist)))
* C( O0 h% @% [) s. w1 L" q: y }4 c2 D
;; Make scale changes to the vectors) _8 L4 z1 ^) x! T3 Z
(if (/= image:mult 1)
9 X2 ^: \1 N5 S6 s: F$ T" ~3 y (progn8 K! \* a% B+ ~- U1 Q
(setq u_vector (image_scale_vector u_vector image:mult))
& n$ {1 D$ M, @ (setq v_vector (image_scale_vector v_vector image:mult))4 p' a K. H2 P
)* { g- `+ M6 N, U1 I0 R0 C
)7 b9 u" N; _( p. ^# m( I
;; Rotate the vectors) \7 A" z( ~7 g1 ~
(setq st_ang (- st_ang image:angle))
" n: E6 o0 j8 R/ S( ? (if (/= st_ang 0)
" w3 Q0 e3 }/ Q (progn
! `7 m7 b2 {# A6 R4 | (setq z_vector
1 x" ^8 V2 l, O (image_cross_product
+ }0 ~4 o% t2 M! Z (image_normalize_vector u_vector)
9 k/ k6 h* G `0 E5 b+ C (image_normalize_vector v_vector)# F) p1 N6 p$ y/ k! h" V: r
)
M, l) U7 V Q( _7 A )" _, a/ y l$ F: `
(setq u_vector (image_rotate_vector u_vector st_ang z_vector))6 R% P, A9 g& n1 H4 ?
(setq v_vector (image_rotate_vector v_vector st_ang z_vector))$ }- I8 P0 b" ?( ?, T0 ]
)
: J5 J4 L% y; u, M D2 Q )
& `7 J$ J3 ^0 e6 p& {! P9 n% \ (emod u_vector 11)
% I8 e9 u' {- d (emod v_vector 12)
+ g1 y# A" g- n# k (entmod elist)9 Y% r* y7 Z) v
)7 P0 s: u0 U2 {2 ~9 B5 J
/ f6 T8 M: a" o C0 W& [" w ;;
. h& H' M/ Z# ~4 t! a ;; Run imageadjust on given entity, working around possible$ \4 W+ @" W, M7 t
;; re-entrancy problems% Y7 |& Z# N) l* @. S2 [
;;2 d+ @! r9 D( p' J
(defun image_adjust (ename)5 A1 E; p, l3 c* [$ G. Y9 F7 |6 M
(verify_arxapp_loaded "ism.arx") ;; make sure it's loaded...$ g* E! |) k( Z1 h$ D( O- }
(imageadjust ename)1 l9 g8 V: k8 G: m$ C$ f
)
, K7 w" b) b& w# h) z5 g) G
; z4 `4 Q) \" I e! ~0 a; Z (defun ddimage ()0 a5 x2 R1 E% ~, B
(if (not (new_dialog "ddimage" dcl_id)) (exit))
: k+ i; b* Q' l4 F
+ v0 J% w* K# p( T ;; Grey out the thickness field.: i. r# u# h: J7 [7 ~
(mode_tile "b_thickness" 1)
$ ?: T" n7 m1 p (mode_tile "eb_thickness" 1)) P* H/ N& g) g. [- [! G% l7 Z
& |) W' x8 y+ ?) E, r; [
;; Get the associated def object.
" B* T, [( C7 S (setq image:oname (cdr (assoc 340 elist)))
- g4 x5 P- i% W% M5 c; [3 }& m (setq image:olist (entget image:oname))
0 u6 y0 [7 j& d' W' X
* J, {7 P, u% R ;; Set initial tile values
) `) p+ w6 n8 a" ^4 u* l (set_tile_props) s! _7 G$ U- ^# \& N, b% I
(set_tile_handle)
% J" g3 A* B5 o" M0 J, @# U (set_tile_pt1 0)
7 Q0 h8 m0 E& }! j1 y (setq image:scale (image_scale))
5 W; s& X e: [ (setq st_ang (image_rotation)); o0 O2 o! V0 {4 V6 |1 @
(setq image:width (* (distance '(0 0 0) (cdr (assoc 11 elist))) (cadr (assoc 13 elist)))); L; K4 B7 P3 j$ P+ |# F
(setq image:height (* (distance '(0 0 0) (cdr (assoc 12 elist))) (caddr (assoc 13 elist)))). x# g: k' _4 q% j& d- Y- \$ N
(setq image:options (cdr (assoc 70 elist)))" A5 z! B: I$ C V1 ?- f, p
: S0 S: z6 r a) e+ t# t- ~/ I# J
;; Record the last multiplier for use in image_update function
9 f- N$ a3 i9 L8 d5 L! Y (setq image:mult 1)3 U& @( H4 j: h. A! r' f [
0 Y+ T. L9 W/ |" t9 g3 T& `9 ? ;; Retrieve the image name3 c) Q% m& p: p( v; ?( _
(setq fn (reverse (dictsearch (namedobjdict) "ACAD_IMAGE_DICT")))
- o- d8 J0 Y( i) e- o; V$ T (setq flag 0)
3 Z% [" i$ W0 R& n (foreach n fn2 ?; l q! i$ F! }
(if (= flag 1)3 l6 ?, Z, z* P, k3 P% a3 {4 P: N. x
(progn* W# F- S- Z# d: K
;; Display the image name
: l1 l+ v3 X# o* W (set_tile "image_name" (cdr n))
( U# b9 g% O) q4 }) c$ m4 Q+ A (setq flag 2)* O# d H2 i U7 e+ }
)
; J- A$ f& Z2 q) G9 J1 X" w )# U& \0 B) q; h, V [" ?! j
(if (= flag 0)
; Q4 W' j( i3 p) c8 a, F (if (equal (cdr n) image:oname) (setq flag 1))) e+ E4 k# ~/ w, x. K- C L
)
. K/ J# {; O+ }2 ^7 F )2 h: F2 v( h9 |, z+ I+ [
1 E! p( `; C! x; G4 m1 x+ b5 B (set_tile "image_path" (cdr (assoc 1 image:olist)))5 f! N! O# [8 i7 f: O+ r% x! M
(set_tile "st_ang" (ai_angtos image:angle))* H4 j7 ^; C- h. T1 n7 T
(image_set_tile_scale)% m3 b: R$ ?+ O" @1 e' c- ~
! r- m7 _/ X F( L% c: p+ y ;; Check the appropriate boxes S$ `1 H+ T' H4 ^, v" ]
(if (/= (Boole 1 image:options 1) 0) (set_tile "image_show" "1"))" i% k {+ e+ y0 ~8 q
(if (/= (Boole 1 image:options 2) 0) (set_tile "image_non_ortho" "1"))$ z1 r2 `( U6 ~5 {1 n* L
(if (/= (Boole 1 image:options 4) 0) (set_tile "image_clipped" "1"))3 p. d: h$ R3 i: B# q
(if (/= (Boole 1 image:options 8) 0) (set_tile "image_transparency" "1")), ?, t, v& b. r+ s
! U! `5 N/ }% f9 z2 P8 Q
;; Define action for tiles
5 H, A" ?% x w, h# p (set_action_tiles)
/ S0 p7 z9 i [8 f, G- S9 G } (action_tile "xscale" "(image_update \"xscale\" $value)")
& }* j" z% W6 O" h0 p# X6 R0 D (action_tile "st_ang" "(ver_ang1 $value)")* f& g! }7 C; Z: @8 b6 s, z
(action_tile "wid" "(image_update \"wid\" $value)"): K* O9 v+ q' l- p
(action_tile "hght" "(image_update \"hght\" $value)")3 V2 y( f% D0 F/ A) `" j
(action_tile "image_show" "(image_disp_opt 1)")
( ?2 C$ x/ s+ m+ k) X1 I (action_tile "image_non_ortho" "(image_disp_opt 2)")
) o( ^# f3 M) w6 l. p (action_tile "image_clipped" "(image_disp_opt 4)")
- }( Y' u. I. ] (action_tile "image_transparency" "(image_disp_opt 8)")8 y" r0 W4 M) H z0 P
(action_tile "image_adjust" "(done_dialog 4)")
; s! X6 b( ]2 ~' H
" j7 b( | f: G& Q3 x- z. G: k (setq dialog-state (start_dialog))# B' O a. E) M
(if (= dialog-state 0)
% o' w$ a. F6 y (progn
3 Z" _, a5 d# x9 R (reset)
c7 K$ t+ Y) y z M( s (image_clean_variables)- l$ A; y ^; L: X% T" @! ^6 m
)
/ _% s, @/ N3 {: w )
# `% C: a! R$ p" F' K. \- x0 `6 | (if (= dialog-state 1), u: p( t% H$ i9 p* p+ V
(progn
1 _1 a2 ]# Z6 Z7 i- E$ h (modify_image)
& [! K" v1 z# d' ] (image_clean_variables)6 V* c( o6 T, @7 P" m
)
' O$ l/ |$ F0 C1 a3 ^. M% o )
( J' g" W& \6 S" g3 n# C# p( B (if (= dialog-state 3)
( ?/ f, T: L, C& u0 x4 p& o (progn5 U& h9 A6 o0 e; v
(modify_image)4 g0 P: |4 r# P N% |1 l& }
(image_clean_variables)
4 O: B) q2 Y6 @1 l) K" E (setq pt1 (getpoint (list x1 y1 z1) "\nNew Insertion Point: "))' k" @, |* P$ j& R
(ver_pt1 0)
9 F6 e2 P. L p8 p! f (ddimage)
: X4 p# k4 Y, r9 l6 j/ B )4 l: O" W8 W* r5 v0 l, H7 C8 y
)
% W, ?$ G. D& g5 H U+ Y (if (= dialog-state 4)
, y+ _& e8 Q& ~3 H! V1 l, y8 r (progn0 e; w! r2 a0 C- m4 U {
(modify_image)
# j- x. ` i* P0 y# _ (image_adjust ename)
2 ~! C) [: y- s W, u z3 _* u (setq elist (entget ename))
7 p+ I% N: ?: x! o/ v) p" N (ddimage). M- l4 p+ u. K' W% R4 m% T
)
% \* q4 i% I+ u1 F0 O. M* o- [ )
2 p6 G% x! O( z5 |$ ` x' y )
! O1 o9 G/ _/ j4 J4 K: K4 Y. \
0 F. I4 S( z2 J- L0 i5 p ;;
; c9 {0 k3 J* n ;; Modify BLOCK (and its Attributes, if any)
* }' S0 B \- x, t4 G* O# I; R ;;3 }$ L3 s2 R% Z$ h% s5 g
(defun modify_block ( / el en2 p1 p2 oldp1 oldp2 new_hgt old_hgt attr
" l# S$ f8 |0 c1 \ o3 ^# R/ q new_wid old_wid old_rot scaling old_scale; S5 e9 r; Z0 [1 U. d! z* z, E# g
xdelta ydelta zdelta xbase ybase zbase ipos)
7 e2 P) \' d8 q (modify_properties)6 a) g+ _) G; S2 X) j" U
" J3 b' U3 A* H% S% K' y! o& Z
;; First, translate and scale the Attributes, if there are any.+ ^% t' y- f1 R( @
(setq old_rot (cdr (assoc 50 elist))% d% Q9 \ m7 Y: v3 ]3 d4 \8 q
old_scale (list (cdr (assoc 41 elist))
8 A5 s! E8 f8 x7 V2 n2 J (cdr (assoc 42 elist))
. C7 V: r3 t! p& |/ E: I (cdr (assoc 43 elist)), L- z. \9 j' X
)- i5 X( `5 W! i: ~3 f* p1 ? e. l; t
scaling (or (/= xscale (car old_scale))
+ H% C G* Z& k% E8 A# I3 k (/= yscale (cadr old_scale))! k' ~* ~1 }; R: {- s
(/= zscale (caddr old_scale))' w; r f& n' F# z1 M+ z% u
)# M, @$ f; D; ^" ]2 s5 f& c# B# o
attr nil ; No Attributes modified yet
, F" R2 F3 ~" h )
" e# I, E ?) P! Y2 S (if scaling s! X" F3 E. q! A
(progn
: p c1 o* ~% J! \; v8 X (setq xdelta (/ xscale (car old_scale))
! Z V, g+ e+ s: r ydelta (/ yscale (cadr old_scale))
+ ]2 O7 M8 \# L! ?. l0 t zdelta (/ zscale (caddr old_scale))
/ M) }" O- U6 X ipos (cdr (assoc 10 elist))
) t+ Q: A) E8 v8 Q+ ]& x- x* l xbase (car ipos)
' h& T0 u3 E6 C. h ~ ybase (cadr ipos) t8 `4 V' h o
zbase (caddr ipos)
* m/ f! ]9 F% x en2 (entnext ename) ; First Attribute
1 E- C( m; B3 r. B5 h0 Y* b$ f )
2 s0 ^5 p. `9 b
" c' Y- y7 @5 J7 n, m7 j ; If the Block is rotated, temporarily un-rotate it, along
: ?. B' t# r# V" M2 u1 S ; with all its Attributes, so the scaling/translation of the
; S3 n& M& t8 n7 @ ; Attributes won't have to take the Block rotation into account.
2 F* j: m* o- ~ (if (/= old_rot 0.0)
' B6 T0 g2 Z) E. j (progn" E/ p+ M. r( U1 P8 _* G' o
(command "_rotate" ename "" pt1 (ai_angtos (- old_rot)))
6 J" E0 `0 M% S) l) q4 T* ^ (setq old_rot 0.0
! J- [4 K; ^/ N% Z% z elist (subst (cons 50 0.0) (assoc 50 elist) elist)1 r0 Z! s4 s: s: i( K
)$ J g3 d# o) p3 G/ [4 V
)
, i# S6 g. T* H. H' F9 W) T8 \ )# D# ~. f6 U& T+ o/ d
) c- G" f1 ~# g (while en2# J/ ?8 e9 {3 {* Q4 S6 e
(setq el (entget en2))' H' ~( o$ i3 {/ B
(if (= (cdr (assoc 0 el)) "ATTRIB")8 I9 [; z$ ~& t9 i+ M0 w
(progn
7 s& R4 [) b8 g9 K (setq old_hgt (cdr (assoc 40 el)) ; Height* {9 O, F# C( Q ~' R
old_wid (cdr (assoc 41 el)) ; Width-factor+ `$ C4 S# h" s1 ?0 ]
oldp1 (cdr (assoc 10 el)) ; Generation start point
( w5 [. N( ]3 v4 J* y oldp2 (cdr (assoc 11 el)) ; Optional alignment pt
- p5 c7 j) r7 t* s6 @" } ha (cdr (assoc 72 el)) ; Horizontal alignment
2 v# a7 `8 l4 ^; _7 Z va (cdr (assoc 74 el)) ; Vertical alignment( b% M8 R& p& P! Y1 h9 W1 f* Y
4 v$ v! L% n+ H( n! ~ ; Translate gen. start point
" o/ w9 ?5 \! t+ } v, K2 F p1 (list (+ xbase (* xdelta (- (car oldp1) xbase)))9 T, P2 H1 T/ b4 S# A' v% L
(+ ybase (* ydelta (- (cadr oldp1) ybase)))
( Z1 {" c8 N$ Q' Z1 C& ` (+ zbase (* zdelta (- (caddr oldp1) zbase)))
: ]: R4 V' I6 W6 I$ T )
, H9 D+ e$ ?: I! G, t el (subst (cons 10 p1) (assoc 10 el) el)
9 B" O8 ^* \7 I5 j, n4 k )
2 q1 E" {3 m% X: x& D
( a* w2 x$ W$ d" B) ]5 h. o5 A ; Translate alignment pt similarly, if present and applicable
3 M! F( g3 a T# H5 h (if (and oldp2 (or (/= ha 0)1 B' z0 n5 X" [( ~2 s. P3 l# Z
(/= va 0)
. o. X. g9 l4 e7 H )0 X5 n2 Z, t8 d2 L5 Q) Q6 D
)3 x3 _/ c9 O' r9 }- V8 \7 B4 a* b6 U
(setq p2 (list (+ xbase (* xdelta (- (car oldp2) xbase)))9 y+ q9 Q2 _9 B+ p, r
(+ ybase (* ydelta (- (cadr oldp2) ybase)))
/ j$ P c: Q6 ]/ w (+ zbase (* zdelta (- (caddr oldp2) zbase))): K* ~9 D f9 U- N/ l2 \# i T
)5 O$ E8 J+ v( D' w* q% h
el (subst (cons 11 p2) (assoc 11 el) el)
0 W* u/ C2 p! z: M! \% ~0 T )
# I! d9 c. |8 \9 F; Z )% h" Z& ?2 _; b5 S. S' |6 F- k
% k' _; l8 K* |; S( B( W8 }9 j C
; Each Attribute's height and width-factor were computed
, c% e1 a& n$ `" o ; based on the Block's scale factors. Adjust them now,: h8 n1 s& B) k5 `2 r$ L
; by first reducing to values for 1x1 scale...' I! E1 ?. B3 f$ w( d/ Y
(setq new_hgt (/ old_hgt (cadr old_scale))
# w- g4 w* f: H' ~ new_wid (/ old_wid (/ (car old_scale) (cadr old_scale)))
3 u$ T. u" p' R/ C0 z )* ?- C( Y$ y% Q4 t
; ...and then rescaling.
7 U' {" R8 R, I2 @6 g (setq new_hgt (* new_hgt yscale)5 x$ |4 J% u( R9 v9 g2 P& j
new_wid (* new_wid (/ xscale yscale))' d/ k5 `6 T) \% b$ A8 ~5 z
)! v; l! ~; f; j
(if (/= new_hgt old_hgt)! l9 @2 ^9 ~; @7 O" o
(setq el (subst (cons 40 new_hgt) (assoc 40 el) el))
8 L/ ~! L% l" F: x: P5 c ), |. D0 [1 l7 o
(if (/= new_wid old_wid)% v+ W4 X6 V6 M- M; e/ f4 c- c: J; `
(setq el (subst (cons 41 new_wid) (assoc 41 el) el))! ?% \8 y3 A( q! T4 m) Q: ?
)3 ]/ E8 P2 q+ F2 t. J' f1 j
(entmod el)
* V; T) o9 }6 @* Q3 d (setq attr T ; At least one Attribute modified
' M% l/ o0 F; D# C& H( Y- `: b en2 (entnext en2) ; Next Attribute6 S% {9 ~1 Q/ h0 X
)7 y0 L: k* F5 {$ P ^( D) c
) t* S7 k* b8 W" i) Z* m4 j
(setq en2 nil) ; No more attributes( ?, b2 G1 e$ T$ P/ C$ |3 c
)
4 u* ]# U1 i1 K0 k# s0 e" w b/ S )
; L2 o8 M5 W! o# k# W- m, K: T )
! A3 n3 J* D9 ~9 l* R! l ), J2 ?7 Q4 O, g
+ l0 `# z, d8 W4 S
(setq pt1 (list x1 y1 z1))% ~3 u4 d, A Q4 L3 a* O6 T7 \
(tempmod xscale 41 nil)
/ z( g. e2 K% d (tempmod yscale 42 nil)& I u" B& c6 z1 j% R/ Y
(tempmod zscale 43 nil), y; h/ I. u2 f, e- h
(tempmod col-sp 44 nil)
8 `0 p& U9 R2 W# P9 i- V" H (tempmod row-sp 45 nil)
7 ]4 I& B2 n5 w. w' ], G (tempmod columns 70 nil)
* q2 w' ?6 Q% z% q1 w$ g+ T. k (tempmod rows 71 nil)
% ^# s3 G; N$ X0 a (if (= xclipmode nil)
4 v& M2 {, O! B% ~5 z% Z; A (entmod elist)/ n; {1 N F- w( K
(setq xclipmode nil)! X# E( u# Z$ V- `& m% D% y
)
5 H" y9 U$ Y8 F (move_pt1 1); _8 h c& i' J3 G
& s' s7 J2 g/ u, M% j: d5 | ;; Now do the rotation with the ROTATE command.
8 p8 Y. X- L/ a (if (/= old_rot rot)
2 I* Q2 F- c3 e, {: Q" T. n4 S (command "_rotate" ename "" pt1 (ai_angtos (- rot old_rot)))' i& M, J6 m4 r/ e
(if attr ; Else, if attributes were modified,
( r0 x4 e2 \" C* i( f5 k" c (entupd ename) ; just regen to force attrib display6 N/ G6 z) E3 k
)
2 `3 ` l3 l/ K; i2 t) l! e )0 z) G& h; u$ _9 u+ u
(setq elist (entget ename))& k0 n# K1 h; x3 K$ F# K. b1 w. @7 Q: X
)
/ f, K6 r" d2 @8 M (defun ddblock (/ temp temp_xclip newhatch blkname blklist blktype program xrefpath)
7 W( D) |8 c7 ^ (setq newhatch 0)0 a; H$ w6 g; p" U: R( b& h
(setq blkname (cdr (assoc 2 elist)))0 y/ ^5 g7 T( [
(setq blklist (tblsearch "block" blkname))' J4 @# Q1 @6 h! U0 N J' _8 _
(setq blktype (cdr (assoc 70 blklist)))
! a. C6 ~% B4 J% X (setq xcliponoff 0)
% m2 o# H) W7 x9 p. b (if (or (= blktype 0)(= blktype 36))
; r. Y" z$ q. k! X: @ (progn
# A3 f9 `. T( } Z (setq xcliponoff (xclipon elist)): m; G! |. s" @9 R X# E5 x' l
(setq temp_xclip xcliponoff)
# ~7 E! y% r6 h1 [! f! E' j7 K) C )0 X/ l0 d+ r- ]7 r
)
6 a4 W" E) e# B! o, G; H) k (if (= (logand blktype 4) 4)
& o' J3 e. Q0 [/ t. E, n8 U; s" w2 W (progn
) Q. N9 W& O1 c3 ~% K (setq xrefpath (cdr (assoc 1 blklist)))
" a8 f5 w6 [6 |: [( b5 g: b1 Q (setq help_entry "modify_External_Reference_dialog")
0 V1 |7 n" h. a$ R# y/ ~* M (if (not (new_dialog "ddxref" dcl_id)) (exit))
6 R. m7 a, e3 h) A1 `# L (set_tile "Bl_name" blkname)6 d- k. ~( i( y; x3 l0 N3 S+ T( N* |
(set_tile "path" xrefpath)4 f; V% [* k! f/ j n4 h6 o4 i
)
" O# ?# U- W& y' R- h1 L) x (progn9 J* p( d9 P" ] Z
;; Get program name for use as Xdata app name
1 Y& F& ~# h! }' f3 c (if (not (setq program (getvar "program")))
0 b L; y6 B% J ?; P: p' K (setq program "acad")- U8 r0 V+ \! ^8 A4 R3 T6 O, X
)
' a* _/ w1 i; K3 G (if (and (setq temp (assoc -3 (entget ename (list program))))4 S+ l3 h& [, C0 ]! U) Q( G
(= (cdr (assoc 1000 (cdadr temp))) "HATCH")
/ k0 a: J* Y( Y+ U# x( @6 v (assoc 1005 (cdadr temp))6 Y+ F4 B1 j3 }6 D
)$ \4 t: F, t. S. @+ W: J0 t
(progn
* X: P6 m) n' i3 ~ (setq newhatch 1)
! m# d) `$ A' P. C; |7 E (setq help_entry "modify_Hatch_dialog")0 R% Z( {( d& x A. ~
;;; convert the object into a new hatch
# i" @& p$ R% a) d (ai_undo_on) ;; enable undo/ @$ Y# R6 B* ?4 I8 s9 r
(COMMAND "_.UNDO" "_Mark")
0 Y) ]/ \" V6 P/ `/ x% T' F V8 \ (COMMAND "_.CONVERT" "_Hatch" "_Select" (cdr (assoc -1 elist)) "")
! p5 K& k! ]' |7 X5 k4 { ;;; suppress nasty message from convert command( M- m1 q. @2 g+ q; q
(princ "\r \r"). O3 j X3 M+ N+ b8 `% H
(setq elist (entget (setq ename (cdr (assoc -1 elist)))))
' i, k+ l: p5 t$ V (setq old-elist elist)3 Y# o+ x* T2 e1 d! Q7 Q- ~/ P
;;; If we have cancelled ddmodify9 h5 n) T7 T+ y( {9 I3 ?8 W
(if (not (ddnewhatch)) ;;; (ddnewhatch) returns nil for Cancel or T for Ok
9 o ~, _) J, ]/ y5 W1 ` (command "_.UNDO" "_Back")
! u- c2 }4 I+ y5 f) E8 c )
4 X5 N, A7 p2 o H7 h6 b5 \: a (ai_undo_off) ;; restore undo state/ c. b- |/ i: l+ j
)! B& ^1 r1 |+ g0 R5 ~
(progn& c, q% b. A9 N1 Y& m
(if (not (new_dialog "ddblock" dcl_id)) (exit)): ?. [* B% L8 q2 E* F
(if ( = "*" (substr blkname 1 1))
! R7 q4 B+ b% ]$ c (set_tile "Bl_name" (strcat blkname " - Anonymous block"))1 f7 g4 B1 Q4 V0 ]0 I- x$ P! {
(set_tile "Bl_name" blkname)& Z8 K; _8 } b& S; A5 r$ Z
)! n5 J! I9 o) D# b6 H
(setq help_entry "modify_Block_Insertion_dialog")$ I& P6 ^" c4 u% V' F' n
)" S% u: }, X# M0 }* T$ h; N1 I
)- t k* ]! A: l* h/ C4 t! D: H
): |& v( U! h2 b% \6 E* G
)
) g$ O- Q; Z8 }9 n6 F8 Y (if (= newhatch 0)
r! E# g0 c h0 } (progn
# u4 h: e( J+ s% ]: d* k7 @' t (set_tile_props)
# ~3 Y8 ?) _: J9 ]2 G3 ^ (set_tile_handle)
2 v- ]" J$ c5 t' B: d (set_tile_pt1 1)
. w% F$ Y) m+ o: D+ U; |$ h W4 E (set_tile_rot)
' l/ l5 C- r6 J) e1 P (set_tile_scale)
( E: {% c& m+ d: @8 I: w% L (set_tile_rc)
" p3 L' J5 `, y, G (if (= (logand blktype 1) 1)
: s' x A: ~% O (progn& \1 V; d6 a3 e( a3 k
(mode_tile "xscale" 1). A6 ?' R2 g. |3 `! z9 `2 K$ j+ Y; b' B
(mode_tile "yscale" 1)
. A/ G( F. f0 t* B (mode_tile "zscale" 1)
/ X2 K7 }9 u% w: F2 H* n1 D (mode_tile "rot" 1)
) k) @; ~+ Y& M: |4 ?, j- u (mode_tile "columns" 1)5 D3 B/ n# J2 h
(mode_tile "rows" 1)) ?# T$ J: Z I7 A; K# l _9 x
(mode_tile "col_sp" 1)9 D" `2 X7 c" \9 K/ y# j: C
(mode_tile "row_sp" 1)
$ s5 k" p7 i* _& z( ?: W )0 `0 t2 M. A6 @! T
)" X, Y6 J1 I$ F
;; Define action for tiles
) ]( p. U% @. O& s; g) F- ~$ T (set_action_tiles)
) k" s$ g# a3 u; ~' J (setq dialog-state (start_dialog))) A0 @. ~" i- [2 ^1 s* m3 M
(cond0 O& E+ I; z# }( b$ H! E$ u7 ?4 O- m
( (eq dialog-state 0); m: {3 d& o \( K: k
(setq pt1 (trans (cdr (assoc 10 old-elist)) ename 1))
+ j9 S% e! N+ L (move_pt1 1): F) }# U5 U- c. ^8 w! |
(reset))
( a! A% L1 B* X& c ( (eq dialog-state 1)- ^8 M, q- V! M: Z4 B# C; f
(if (and (/= temp_xclip xcliponoff) (or (= blktype 0)(= blktype 36)))
" V! z5 p2 l K* T; m: S (xclip)
! Y0 |( ^/ h5 ~% O) t )# J3 b) P; P# r( j" W2 f9 }( L8 Q
(modify_block))
6 W5 f# M! z4 p9 {3 K8 j$ J4 C ( (eq dialog-state 3)
% ?) R3 W5 l$ f N7 D% Y1 L (modify_block)
: v& D& H% t( @+ H (setq pt1 (getpoint (list x1 y1 z1) "\nInsertion point: "))! e7 R: u3 B1 _0 F1 L
(move_pt1 1)% k' A( _; k, X( T* ]
(ddblock))! D4 N) Q3 |& h; ]- w$ b2 ~
( (eq dialog-state 4)7 {1 N2 C8 J1 r
(modify_block)
( t& c& i& g! I# q/ d ;; Get current handle.
" ^( V' _6 e1 p (setq hand (cdr (assoc 5 elist)))
4 O, \* }& n( {' F (command "_hatchedit" ename)
3 S7 c* ], w% S' s" ^ ;; If OK in hatchedit, a *new* entity is created and the old one( I. D: H5 s8 R+ R4 g
;; is deleted. So if the old one exists, it must have been a2 n5 s& z' P9 T+ F9 f$ [
;; so rest the entity.
- V9 I4 G/ p+ j (if (entget (handent hand)) (reset))
& P5 U, e' d2 Z. X: W8 a )
- H. {3 J5 R& R0 ^ | )( G' a; v/ {7 H% K2 D+ f
)
, X- H! X( F( h' l8 U; q )
6 W, P1 ]. v- l$ ?: s b )
. m0 \ ]. I( u) Y: m ;;' c$ F3 _! I4 O0 }. V2 e; T7 F q
;; Modify SHAPE* f2 o$ K+ F8 ^* m( K
;;
* J) P1 F; {% J1 A (defun modify_shape ()2 m& Q$ g: s% N; ^' D/ t
(modify_properties)
8 u. q0 E6 ]2 ^2 l6 E, U (setq pt1 (list x1 y1 z1))% F8 q* N6 }0 T ?5 n
(tempmod pt1 10 1)1 O$ A6 n1 T) t- R( p! u0 `
(tempmod hght 40 nil)- K# T, `0 X4 R [# S# @6 U
(tempmod wid 41 nil)
]5 s! y% d' T! ^9 a1 D (tempmod rot 50 nil)4 T& @: T, L) |. d- }) s
(tempmod obl 51 nil)
0 h( v1 O# C" [ ?% {5 `- s: Y (entmod elist)
/ x, z& N5 h& v- G# m+ v6 m8 N )) e0 p3 m9 P. L
3 ^: @- K4 y5 F1 ^# K/ i' b
(defun ddshape ()
& s: w! c, P% U# }1 x (if (not (new_dialog "ddshape" dcl_id)) (exit))
* _" ]1 s7 p1 X! g' \4 \. ^5 Y. j (set_tile_props)4 P, f0 ?$ U8 q4 n1 ?% F* l" Y( D7 K* w
(set_tile_handle)% ~: H/ \& s* K* [7 H0 v9 _
(set_tile_pt1 1)! l- y% {5 Q4 K* `) S3 S( [4 g
(set_tile_rot)3 O# g8 B5 n. n- b5 v
(set_tile_hght)
9 m; i! G* M$ U (set_tile_wid)
9 Y( l! t$ X! ~4 v8 Y (set_tile_obl)# d9 [, j; _* |9 p( r# S
(set_tile "sh_name" (cdr (assoc 2 elist))), t6 t2 l) V: s w" z1 w
;; Define action for tiles- O f6 `5 N3 E# m# V; b
(set_action_tiles)# u+ x1 i% r7 J8 f- l! } J: I
(setq dialog-state (start_dialog)), b" e2 K" e, c' q2 I. |
(if (= dialog-state 0)2 r+ h6 t7 d" w2 V
(reset)" C7 L$ O6 K- l
): ~! \% x9 I' X3 b1 B
(if (= dialog-state 1)0 c8 W3 O+ C* ]4 o$ N3 Y
(modify_shape)
" d. A3 _5 q+ `6 m( F* i) b1 J6 X. b' G )3 Z6 i0 @: J/ k7 Q* t5 b% ~# Q9 Y
(if (= dialog-state 3)6 g' X: X- x# D$ N* k: S
(progn4 v( Q$ u0 }9 ?( p/ Z
(modify_shape)# }: t0 }) m! g
(setq pt1 (getpoint (list x1 y1 z1) "\nInsertion point: "))8 ^( C5 m, k: e) g7 G3 ?1 h4 y
(ver_pt1 1)
9 p5 ^/ p0 l% f (ddshape)
6 k2 }6 n/ | l9 |- _$ v) C ). q% D" U4 b9 {2 z
)0 w7 Q0 @$ d+ _6 ^% X7 w: y
)* F- G) g7 d* y0 R6 O }# ~( G
;;
- p/ [: |4 [5 L* H9 u$ U ;; Modify TEXT or ATTDEF4 L6 }9 ^. i0 a9 t; L8 p/ @) T
;;
7 P- Q* Z E2 d6 `0 f ;; Set bit code for upside-down and backwards setting
- ]1 L& {! ^5 ]* ` ;;* s+ W! C9 R, J) I9 g& X
(defun code_71 ()* s' H t! Z- G! q3 {% ~: v
(cond ((and (= bkwd "0") (= upsd "0")) 0)
& e: \! L3 z5 a( f4 A9 I' g( i" a! |# B ((and (= bkwd "1") (= upsd "0")) 2)* D: a1 O" t& _
((and (= bkwd "0") (= upsd "1")) 4)8 a) \$ R1 N$ _$ X# {9 ~6 H
((and (= bkwd "1") (= upsd "1")) 6)
$ I* u( ~7 }9 R9 H4 b! f- u )/ P: A4 J; I4 P; Y) `
)
/ W3 a) }% d( G1 {0 U( | ;;# r' j6 c/ `% P& ?5 {3 r7 ?
;; Style action. Reset widget values to style defaults, E$ G% X/ Q& m! W* i1 I
;;
! [, I8 l* T2 L9 t1 F9 w ]7 g4 h8 h (defun style_act (index / style-list)3 o6 ?% m# X: C+ b
(setq style-idx (atoi index))7 e4 ]* r9 B% K& O
(setq tstyle (nth style-idx slist))
- L9 t( d6 a4 Y. I: | (setq style-idx (itoa style-idx))
: A5 j0 U# S6 V) ~ (set_tile "style" style-idx); h# {2 d* ?& [9 w `2 V: I
(setq style-list (tblsearch "style" tstyle))# q" q: V; b8 q J) q: j
(setq shght (cdr (assoc 40 style-list)))! g5 ]/ _. w" B7 P" d9 L { X
(if (/= shght 0)
( u8 z7 T7 s/ N; F: a (progn- a( U4 `4 W& U' a
(setq hght shght)
0 D* u7 f' a7 Q (set_tile "hght" (ai_rtos hght))# |, G' S- i7 \
)
, d+ s0 G" B5 u% ^# K# b )8 {7 C$ v# W2 T& @/ T7 a& c# _$ y
(setq wid (cdr (assoc 41 style-list)))+ a; G9 j Q& a. }, p; k( ]
(set_tile "wid" (ai_rtos wid))
1 E$ E5 d% ~( {) d (setq obl (cdr (assoc 50 style-list)))1 j+ O2 x" [' A% N
(set_tile "obl" (ai_angtos obl))+ g# q' M$ u6 o; l0 [6 j
(setq bk-up (cdr (assoc 71 style-list)))+ a7 @( {6 L4 ]; q3 }* V
(if (= (logand bk-up 2) 2)
9 l4 j3 ^9 M) H& c1 O5 M+ B0 a% V (set_tile "bkwd" (itoa (setq bkwd 1)))
3 X' `$ ~( O! G4 u (set_tile "bkwd" (itoa (setq bkwd 0)))
: j- S! w' }9 n3 {0 y )
6 X6 e T, P; ]! K+ l (if (= (logand bk-up 4) 4)
% a0 u$ i2 z/ p( n8 z) } (set_tile "upsd" (itoa (setq upsd 1)))
& w' ?: p" {1 l/ q4 R (set_tile "upsd" (itoa (setq upsd 0)))
! `1 ~0 u2 u6 [: p/ }& G )% ^; T, w( \6 X; }" j# k
)
1 P* T0 ?, _) x/ X" k$ A ;;
3 }6 Z( |% |' W0 {) z ;; Justification action. Set vertical and horizontal alignment variables,
, G9 A0 x8 V8 w1 i$ h$ i, A5 r ;; grey out rotation and height if alignment = "aligned", grey out rotation
# F: e0 d) ~4 \. S ;; if alignment = "fit".; j N. C/ g+ F+ i. L2 T' b
;;- x* B# F Q: H: |3 A
(defun jlist_act (index / templist)
1 t# q& V3 g1 f2 C# c4 v4 @3 d (setq just-idx (atoi index))' Y7 F3 ?7 ?+ z L5 k% n. k+ W; k
(cond5 `. l4 A3 A1 H. p* c7 p
((= just-idx 0) (setq va 0 ha 0))
" z& q% ~5 Z0 J- V. }/ H8 m) N ((= just-idx 1) (setq va 0 ha 1))
( V" [/ A5 F6 c5 ^$ u ^$ Z ((= just-idx 2) (setq va 0 ha 2))# [% v/ h8 V. g, `
((= just-idx 3) (setq va 0 ha 3))
1 U& K; @9 X3 \5 Z! H) s- D4 n: V ((= just-idx 4) (setq va 0 ha 4))8 j* R& g+ u: H# I
((= just-idx 5) (setq va 0 ha 5)). Z& b) H, A# r7 q; B" `
((= just-idx 6) (setq va 3 ha 0))4 V( _2 ~# z0 S0 [: _
((= just-idx 7) (setq va 3 ha 1))
; s- U7 D4 a9 z* i6 ?- S ((= just-idx 8) (setq va 3 ha 2)): X3 U: D7 l- ?) F
((= just-idx 9) (setq va 2 ha 0))
# ?* U' ?* t( H2 ?! L, } ((= just-idx 10) (setq va 2 ha 1))
9 G5 R. Z8 I7 e; G+ K7 u, O- Z ((= just-idx 11) (setq va 2 ha 2)); D+ E5 L% v7 T, H" z
((= just-idx 12) (setq va 1 ha 0))9 J [7 r' d) j2 Q2 B
((= just-idx 13) (setq va 1 ha 1)): r+ _ @; |, v$ Q, E% K9 e! \" D
((= just-idx 14) (setq va 1 ha 2))
7 D; I0 y$ l u1 {) A( j )+ ^( F% Y, K/ w/ `1 L9 v
(if (or (= ha 3) (= ha 5)) ; If Aligned or Fit text
; h% Q8 h5 k" _. o' g (mode_tile "rot" 1)
6 I" [& B) j& G4 h (mode_tile "rot" 0)3 E" K& J W8 d* ^% M7 F
)
* Z: O1 x9 F5 D, z (if (= ha 3) ; If Aligned text
: v, L2 Z: b8 q (mode_tile "hght" 1)
* I8 x/ F- m; t: H2 U8 v. v1 @ (mode_tile "hght" 0)
% [3 B6 s1 a% _$ c$ r3 R( | )
! ^2 ~' V4 D2 }9 s. A (if (= ha 5) ; If Fit text6 \9 |3 T5 R2 m3 [8 [6 |: i
(mode_tile "wid" 1)
7 g* a' P0 {! u1 K; t (mode_tile "wid" 0)# |+ l9 j% b& K, i. m' V4 ]
)3 L- { h( B5 ]* G" C3 ]
;; Reset rotation and height if changing from aligned.: @6 E+ m9 ]2 J& l$ [( D2 P" u
(if (and (= ha-prev 3) (/= ha 3))
( T* W& m9 n) n8 H U' ? (progn4 n6 d9 ~. s% p7 i* J3 ]: ?+ t X
(set_tile "rot" (ai_angtos (setq rot 0.0)))/ k% {; x1 S: c6 G
(set_tile "hght" (ai_rtos (setq hght 1.0)))
4 y0 f* i" k2 U5 g/ Y )/ q8 `% k0 q, f6 ^; ^! N
)
, r4 u! t7 b( Y" [/ F9 X L2 D7 `$ _1 k' j* e, {
;; Reset rotation and width if changing from fit.
1 {! Y8 n- c# ~$ ^1 w3 T9 R (if (and (= ha-prev 5) (/= ha 5))
. N3 x4 J) e- L9 \ (progn, I+ O8 A* X! |
(set_tile "rot" (ai_angtos (setq rot 0.0)))" ?. O9 B2 a/ j% ?8 g$ y
(set_tile "wid" (ai_rtos (setq wid 1.0)))
4 c( h' ~( a1 R# q7 ~1 z+ N4 i& L9 n( Q8 W )* X* v$ L* v# Y
)' `5 Z- Z( t; ^# e9 \
7 a% _" f( I# Y" O# z3 U8 f$ I (setq ha-prev ha) ; update ha-prev for next time, p) u8 |1 _; q, K
(setq just-idx (itoa just-idx))9 C; X: n# X# I4 P' ~+ J6 ^; ~1 I
)
( g: ?5 q1 `+ D ;;
+ U0 {& l- W) y l1 `/ e. G ;; Set intitial alignment setting based on vertical and horizontal alignment
0 {2 `7 g( }0 K# P3 _3 O ;; bit codes.
% ^: c f) a- {, U! C' i% K3 U& \+ \ ;;
" s3 k; h0 \, ? ] (defun set_just_idx ()
b& P0 e& `. t: k: F (cond
2 I: H9 Z9 i3 a/ @0 f6 U- D3 Y$ H ((= ha 0) ; Horiz alignment = Left
& y; h$ v6 a# ]6 R (cond; Y" Q9 R: H6 w& k* [' [/ N0 R( p
((= va 0) (setq just-idx "0"))
% T- {+ K; `1 L1 t% o7 a$ P- h ((= va 1) (setq just-idx "12"))2 e7 ^7 E6 B! o: L8 T" i- w- D
((= va 2) (setq just-idx "9"))
7 G1 H: M# N3 ` ((= va 3) (setq just-idx "6"))
5 _0 C5 v$ g& z ). p) H$ D/ x- ?( C9 B+ ^7 {" D2 p
)
' B D" g4 G6 _5 `. U4 A ((= ha 1) ; Horiz alignment = Center s4 }) ^8 [1 A( E( p# m- B% }5 z
(cond! u. `: `1 I# h5 v
((= va 0) (setq just-idx "1"))2 f1 g4 h) T3 o4 I! v
((= va 1) (setq just-idx "13"))
9 j! l5 b& I3 B1 A) H# L! y ((= va 2) (setq just-idx "10"))
4 Q( I1 \2 U% g3 S, E$ M ((= va 3) (setq just-idx "7"))% f l6 n. ]+ h- X n- T( h' `; E
)
; N; b( @ j9 X2 G4 _ ); P5 l7 R5 x, T, Y5 C# m
((= ha 2) ; Horiz alignment = Right
/ J6 R% Y9 ?( T6 }3 O/ [5 B (cond
' i2 ~# }. s9 p) @% h: ` ((= va 0) (setq just-idx "2"))
- {7 W( I8 d/ B) ^ ((= va 1) (setq just-idx "14"))
1 m. A1 W ^* W( G( _4 ]4 z ((= va 2) (setq just-idx "11"))
E# |* u8 _: ^* e1 A; r) Z ((= va 3) (setq just-idx "8"))4 s( F2 J- ~* d: ]
)8 Q3 F% |3 ]! z1 z9 S) r) p" O
)
0 e+ O1 n. @' K1 _0 ~ ((= ha 3) (setq just-idx "3")) ; Aligned" [* P" y" Q+ z& q
((= ha 4) (setq just-idx "4")) ; Middle. y- u7 S+ {- g- ^3 M% E: y
((= ha 5) (setq just-idx "5")) ; Fit
7 [0 Y/ I+ I4 g, w9 @, V& G8 l9 X0 W (T (setq just-idx "0"))1 U" z% p: Q3 q* X
); V2 X; O4 H8 Q+ H
just-idx
3 O9 h' L; W: a/ p9 y6 L )' e3 r) r1 V& Q
5 `0 {1 q+ M, N" Y; c (defun modify_text ()' F l! z8 `+ S8 b
;; insertion point5 i4 {8 {" K' {* Y) z/ l s
(setq showpt (list x1 y1 z1))
' n- I6 C( A: t0 I (setq bit-10 (trans showpt 1 ename))
r5 p% o4 U( u4 i- {4 F, O+ n ;; alignment point: z( S# c S7 a# D% j
;; for 'Aligned' or 'Fit', alignment point must be different
3 |' P' z9 B$ y! f/ | ;; for all others, use insertion point' w: }( G9 |+ D5 r& @" d
;; (ACAD will recompute insertion point) ~2 _. X9 N$ ], ]: l7 ?0 @- f
(if (or (= ha 3) (= ha 5))( m- R* j$ Y! M0 \
(progn
, g/ R4 g% V5 i5 k, v$ ^3 O ;; if no alignment point, fabricate one
P5 c! J" P. Z (if (not alipt)
3 N1 q+ j4 Y2 h- ~2 \ ;; add text width to insertion point P+ x/ Y5 A) J$ n
(setq alipt
, W; j% J+ @5 b# N. K (list (+ (car showpt) (car (cadr (textbox elist))))
! l( @6 X" o# K- V0 Z+ ? (cadr showpt)
' q ?! r- e( F: e4 K (caddr showpt)
; S" v" r6 Q2 L. j3 k )
6 Y- O' h8 S4 e )
: |$ L* ~: c( p8 |* b4 d9 O ) ~8 q$ u; I2 k" [' ?4 Z/ N
(setq bit-11 (trans alipt 1 ename))! K g; D& J) s! Y/ Y" r3 k. l
)0 o+ Y1 _ q9 w4 a! M
(setq bit-11 bit-10)% O0 l$ ?; o2 |3 ^, n; ~
)
0 e, ?+ i$ d3 f; E& t- |5 F$ c$ G (modify_properties)
% x+ ?, u; |: _9 p5 G! p$ I' U (tempmod tstyle 7 nil)
" U5 Z6 t0 J$ j' W2 T3 r- T$ ~: N (tempmod bit-10 10 nil)
5 T: R$ d8 Y1 P; P+ x5 Y (tempmod bit-11 11 nil)
8 ]! }: R4 k, Y8 [7 ?' v) w (tempmod text 1 nil)
1 O# c/ f( @, e (tempmod hght 40 nil)
( Y( T3 h: Y" w' j; l* j W/ O (tempmod wid 41 nil)
+ w" `; m/ }: _( Z+ ~ (tempmod rot 50 nil)7 L! z' { I$ q3 P) x3 v+ ^
(tempmod obl 51 nil). p3 J4 y0 E4 p8 [ Q" ^1 z4 G
(setq bk-up (+ (* bkwd 2) (* upsd 4)))" V% H+ _1 l4 T6 U" M
(tempmod bk-up 71 nil)
( D0 B- m7 H3 P' o (tempmod ha 72 nil)! `* x( b, ]/ p* Q0 P1 q4 V
;; Attdefs use 74, text 73
1 @4 P9 E: \' E: [& `; N$ C (if (= etype "ATTDEF")
' n3 P3 ^" t, ?0 ^ (progn* j& b' ^: p+ d3 O# X0 G; W, K
(tempmod attag 2 nil)! a6 O; z9 {% J$ f
(tempmod atprompt 3 nil)
/ b9 B1 K" r6 A$ p, u, s0 ~ (setq icvp (+ inv (* 2 con) (* 4 vfy) (* 8 pre)))
5 T1 t% N) d% g1 O* s (tempmod icvp 70 nil)2 _2 ?! o% Q$ |7 W
(tempmod va 74 nil)$ U9 s H# _0 y
)
3 P& S s; B( A8 x( p- A (tempmod va 73 nil)
. F: B5 h+ J# y7 p @- G# w3 c# c )2 T$ G+ n7 Z' G9 P9 n
(entmod elist)0 L. @" s) {$ Y. F9 C
)
' \( J# |" E+ g* M
- O8 _4 |. ?7 r# r p, i) |# U (defun ddtext (/ 2ndpt slist i)3 t' @# ]0 w2 U v, B
(if (= etype "TEXT")
0 ?1 ?; n; P( p# D+ _ m (if (not (new_dialog "ddtext" dcl_id)) (exit))- g# c5 z3 k( v# g5 e# f
(if (not (new_dialog "ddattdef" dcl_id)) (exit))3 ~# n: V( ?& \# ]( h
)% r& G6 \) q$ H! g! R
(set_tile_props)4 I j8 t9 K+ [9 G& s7 T x5 Z8 D5 m
(set_tile_handle)- l+ j: \3 }) F
(set_tile_text)
5 t1 k4 A. H0 Y/ ?& [ (set_tile_tag)
9 t( k( P* I6 I (set_tile_prompt)
! W( @& G4 j% c1 u1 H7 z! _# r6 v (set_tile_hght)
: n1 j) H! N% J7 c6 ~" c. a8 q. m (set_tile_wid)# y0 Y4 A0 L; ]/ @2 l( R: l6 \' l
(set_tile_rot)$ l: ^9 O& h. a; M/ ~
(set_tile_obl)9 b1 i. f) q4 e+ i: o$ @# L6 Z
(set_tile_bk-up)9 F# z' _' ^. p) d" N7 e) m% n4 c b
(set_tile_icvp)& X0 l4 `5 P5 k2 C
(set_tile_style)& M1 T/ ]+ d$ w( H$ v) K
(set_tile_just). D G# j6 A8 k+ p# b; A* I6 C
(setq pt1 (trans (cdr (assoc 10 elist)) ename 1))
. ]" E- N7 G. x L( H. ? (if (not (assoc 11 elist)) O: i4 F3 S6 }+ t9 y/ Y6 d
(progn (setq pt2 pt1)
9 a1 C& s; W: w( T) l, t$ b (setq elist (cons (cons '11 (cdr (assoc 10 elist))) elist ))! T. ^1 h' {; R, W( G: j8 ~: W( ~8 \
)
) l9 Y5 }4 [2 l- g- F) s% V;;(trans '(0.0 0.0 0.0) ename 1))9 u4 h) h+ d6 J- i1 N; l
(setq pt2 (trans (cdr (assoc 11 elist)) ename 1))
# j5 ^4 u$ h9 U9 L )
+ j# O( z( ^) F% Y9 o (if (or (and (= ha 0) (= va 0))
* O& S: _( G$ h# v7 [ (= ha 3)
& I9 g2 `9 p% l' b$ M (= ha 5). ?9 ^' I1 l/ }# m1 Z1 c1 g3 B W
)7 M4 y. i2 U% l% W% d1 h
(setq showpt pt1)' a7 \1 a* M J( D
(setq showpt pt2)
5 I1 I0 L e: j$ e5 K$ R1 O; f# W )
8 ?2 x! q# O; Z8 Z (if (or (= ha 3) (= ha 5))9 f6 P3 G. |# n5 C2 G* [/ H P. C
(setq alipt pt2). e r, B0 z6 ~1 G7 f& d" f, u& N
(setq alipt nil)
9 c8 u: ~5 [2 b$ n8 q) h6 j )
6 u$ P5 h k1 [3 H0 N: p
, v6 G) D' \' _ (set_tile "x1_pt" (ai_rtos (setq x1 (car showpt))))5 U, r! k! B: |: @! `/ B+ ^
(set_tile "y1_pt" (ai_rtos (setq y1 (cadr showpt))))" J. f' s- x3 e1 E4 L4 K
(set_tile "z1_pt" (ai_rtos (setq z1 (caddr showpt))))* e' I+ z6 y( L! B J+ H9 W, @( j
9 l( F' Z0 S9 V& \5 f% t, |
;; Define action for tiles
5 \* W |; {" e0 p1 [/ m5 | (set_action_tiles)
$ _7 {( E. S4 g) y/ Q5 t6 G ;; Set focus initially to the text edit box.; ]6 ?2 p3 S( B# h
(if (not i) (progn (mode_tile "t_string" 2)(setq i 1)))4 F# t" G. ?9 J2 E+ Z, A8 K
(setq dialog-state (start_dialog))2 e& M+ _% c. M4 l+ v3 l
(if (= dialog-state 0)5 A, J" [+ D9 a! J6 K- l# @
(reset)
) p2 ]4 x/ E# y$ Z' Q4 d2 c& x/ X+ a )9 @5 S' ?1 N; Y
(if (= dialog-state 1)$ ?( z/ E: S! i+ E6 O+ u) z
(modify_text)# K4 Z1 g% ^: ~7 {) A2 i8 u. K
)7 s y) A0 b* D+ D# ]
(if (= dialog-state 3)
: y5 _2 ~- D% ~: E$ \. L (progn
/ m0 ^* r& e! b0 B% j. I& \ (modify_text)- a0 I0 ~* S9 F
(if (or (= ha 3) (= ha 5))5 a# i- Z$ v; d
(progn( {! s- T3 w' p. Y* q2 ^
(setq showpt (getpoint (list x1 y1 z1) "\nFirst point: "))( U3 e$ ]6 Y6 `' m3 }
(if (not showpt)
% |! x2 e- N5 I' O5 g, @( E (setq showpt (list x1 y1 z1))3 m2 W3 y1 {- a4 _9 O
)! p- G: Z2 {6 ]6 a" g
(setq 2ndpt (getpoint showpt "\nSecond point: "))
4 g4 X1 [' p9 {. U( @. @ (if 2ndpt
" P/ N r( q' R7 @ (progn( ]) Q+ ]4 D- v! b
(setq alipt 2ndpt)
* y+ D+ m" Q; k- i1 h (tempmod showpt 10 1). H1 T$ ?7 v h0 Z& W9 x
(tempmod alipt 11 1)
8 P' ^* A& \+ `) ` (entmod elist)+ m) P5 G. g/ N! A! F5 D1 {
)
- G8 P% @& j: ~1 K+ U3 ` )+ X3 v, W* C ^* S
(setq elist (entget ename))# v# W1 `/ J4 m( `6 ?* s( `: H
)2 d# d! a6 o$ O0 u) A# \7 |
(progn1 r& g; Z9 T* ~3 |: R& X; ?
(setq showpt (getpoint (list x1 y1 z1) "\nInsertion point: "))$ N; e8 q$ x. `) L. X6 x9 k7 E3 y
(if showpt
; A7 n G/ \! h (progn: b/ f# \ B8 ^: {& m8 Q% y
(if (and (= ha 0) (= va 0))8 G8 |8 Q4 |; N* }
(tempmod showpt 10 1)
: A \+ p0 H' K, G, d# V* E4 N (tempmod showpt 11 1)
% l2 U3 x4 G' e )
6 G* Z8 I- g& Z C (entmod elist)
% Y5 A! L, _% l$ x6 {; Q/ w )/ I, x* L% K; ~+ ~1 z$ Y
(setq showpt (list x1 y1 z1)), {+ K' V) b3 U: N. y
)6 i% Q1 H; ~3 Z- f: R* W
)# q0 \" Q6 A# X: \
)
8 B/ n. c5 n; ` (ddtext)
, W* \( Y/ v, h4 _* d )$ o$ x% i% m W) N6 t
)
" J) y1 w3 y( ~! ~0 R V) y )9 v% C+ O) l5 i: s; D$ Q
7 X9 T, H- V1 ?1 I3 b) s5 ^. r ;;
. w/ U! ?5 t6 A( o# [ ;; Modify MTEXT# ?; @3 O" @% j" u) b
;;
1 N& A3 v% E1 e, M+ ~( f4 J0 D (defun modify_mtext (): ^: R# J% X. m! Y7 G& v/ P( U; w
(modify_properties)
' @7 ^" f5 [; c+ ~/ e (setq pt1 (list x1 y1 z1))4 ]9 [" l9 d: M9 t" @' F: M
(tempmod pt1 10 0)' E0 y/ {" `3 [& M- m1 {/ |
(tempmod text 1 nil)1 U1 R( @- h& {( P" c% C0 G
(tempmod tstyle 7 nil)
- i" _% Y7 \- U2 Q2 Y3 P1 \) L (tempmod just-idx 71 nil)* A* I' }: n6 w
(cond" H( n" A! J& ]# k( |& t
((= dir-idx 0) (setq dir-idx 1))
2 Z( _1 }4 n [: @' c( C: N" Q ((= dir-idx 1) (setq dir-idx 3))
g& t! q# P8 v" ] ((= dir-idx 2) (setq dir-idx 5))
. S# C7 N& L3 ]' o (T (setq dir-idx 1))
: T* H% X, V" R {1 {7 M )4 A6 d% o! O b& l6 r
(tempmod dir-idx 72 nil); G5 A: i5 |, D: N+ j$ l
(tempmod hght 40 nil)
# q- Y ]3 l, ^ (tempmod wid 41 nil)
" M, R3 w9 y: H( T3 _' u0 x (tempmod rot 50 nil)
; {; z* O; `" E7 Y$ I (entmod elist)! T9 f* F4 i' W# Y3 }
)9 I5 f+ W* Y+ o
, v6 d7 C% z1 D1 P4 F0 `. G* e ;; Set MText text style
2 j! ^6 u8 B( K5 X4 [ (defun MText_style (index / style-list)
- Y6 w8 l2 q; @& g (setq style-idx (atoi index))
* Y. T5 N9 V+ k' o$ S (setq tstyle (nth style-idx slist))/ k* _* i) u) k6 s( V; v% K
(setq style-idx (itoa style-idx))5 I% \/ v/ G! x; \4 _# p4 U
(set_tile "style" style-idx), ?! X% _" o; B6 e
(setq style-list (tblsearch "style" tstyle))8 M2 s7 [! R: b+ h9 |* ~
(setq shght (cdr (assoc 40 style-list)))
9 H' a8 }& {1 O+ a& M; F$ P (if (/= shght 0)
$ Z( m9 p; Y- f. _. p6 S4 o (progn
. P- N- y; D- |, d8 a0 \ (setq hght shght)
1 \/ _% P- E; L (set_tile "hght" (ai_rtos hght))
g; w+ G/ }: G; W( x$ l )
0 C! _& p. @. m( s7 X* e; W9 L$ R )' P7 i `# H( y" s1 N
). q) }4 @, |4 [, r) {. s+ B
( |$ Z2 R1 U- o" T& }6 E( J0 |# q( x
;; Run DDEDIT on given entity, working around possible re-entrancy
# y0 P7 W. D5 H ;; problems with MTEXTED
/ ] ?7 Y+ D% Y/ j' J, C: D: [# E (defun safe_ddedit (ename / orgMTextEd work)8 c3 l7 ~! i) G
(setq orgMTextEd (getvar "MTEXTED"))& c7 I& ~3 v) A& b2 H6 R
(setq work orgMTextEd)
& v2 O9 r& A4 m4 Q3 x, H (if (= ":" (substr work 1 1))
* `7 |4 N# a/ \ (progn
" D5 T! Q, K# [8 J3 d: q% } (while (and (< 0 (strlen work)) (/= "#" (substr work 1 1)))
2 P- ]( ^5 W9 p6 o @. J0 e; r0 z (setq work (substr work 2))! O/ J7 W; g, r: }( ~; D
)
7 O- }4 D8 n8 m' \* X: f (if (= "#" (substr work 1 1))
* `( E7 j4 h" T6 m (setq work (substr work 2))8 L' H- T; y% _+ A
)0 a- v+ N8 B1 @6 o& R
(setvar "MTEXTED" work)
8 M+ g; x) |) i. t+ J+ L% I- ? )
- @& U; C' b2 z )
6 H" v0 _0 K' Z+ Z( s! v# q (verify_arxapp_loaded "acmted.arx") ;; make sure it's loaded...
/ `; _8 }5 n' M& M1 ?! W (command "_DDEDIT" ename "")
- A8 l' C& Q5 I2 c! p (setvar "MTEXTED" orgMTextEd)% `4 }: W# x; g6 O- E
)3 W" h- X4 g. I8 k5 w. Z' }
' E% T* K" n+ S6 s
;; Verify MText object width
' j+ |3 T1 W4 C8 N3 [! Y& I (defun ver_MtextWidth (value)
+ F8 x8 s, R, t1 n (setq value (distof value))3 n. Y: l. Q- Q% s
(set_tile "MTextWidth" (ai_rtos value))# u9 ?9 i& G i! z
(set_tile "error" "")3 S/ N o8 H7 x$ E8 F* t# h
(if (< value 0.0)
: [, j) Y. Y) Y+ g (set_tile "error" "Value must be zero or positive.")7 r8 D2 G( ^7 n# m
(setq wid value)
- s5 z1 K) |; I* D9 [ )% A( h% [ S1 _/ Z U
)6 W8 M& U, ~) Y, D2 s8 S' R" n
& k$ E# }$ z# B! y3 L (defun ddmtext ( / gc3)
9 ?7 c, Q7 y1 r ;; Get dialog
/ B2 g: i$ ]9 g; l2 e3 V' f (if (not (new_dialog "ddmtext" dcl_id)) (exit))( |2 i3 i5 o. A( S1 N B9 v
$ X: ^! V4 t. H H9 \
;; Load list boxes j( W& p% [1 _8 o1 {, a
(start_list "MTextJustify")
! }4 S+ t; M. ]% g3 T( K (mapcar 'add_list '(
. H n7 E4 D- E( Z" y! L( L "Top Left"
, Q0 p" Q" [: |" {2 W' |* t "Top Center"5 g4 |0 C3 E" `* u
"Top Right"* m: m& F7 E- e) L( e( A7 Y
"Middle Left"
( B7 }$ @8 ]0 | "Middle Center"( Y% f- }& i0 h4 Y5 F
"Middle Right"
: v k& ]2 q/ `- E9 v "Bottom Left"% ^+ L6 m, ?9 F* D. p S7 d
"Bottom Center"$ n" [7 Z$ {1 ~# ?. d1 O/ p" [
"Bottom Right"
, _, Z5 _/ P0 o( i# Z" R )3 p- f- o6 \ G9 }/ Y
)
( D* n p% x; W7 z0 i (end_list)
0 K" N# r# s9 Y- V' ^& H
3 g! p4 ^" u/ v% b4 ? (start_list "MTextDirection")6 K" F ]+ y5 @0 q( w% s8 a) `! r
(mapcar 'add_list '(
; V! w1 W- a8 o5 G "Horizontal"
; G0 ^5 ]/ f& t2 u5 q- K3 S "Vertical"
* h6 C5 L# s' I' s7 ` "By Style"
% K& t6 D( z. H- w( {* u, S )
/ V6 i5 r' S; ~ )
# L& M1 {( T5 J' ? (end_list)8 t2 @4 F; Q; i& o4 E+ G1 c
4 W) G, V! G+ n& S6 v7 D! |% |* N ;; Set initial tile values5 }6 A4 N9 ~3 l2 b& P
(set_tile_props)
) ~" Y) B; ~8 l/ A0 a) n% w (set_tile_handle)
) S8 f4 G8 K7 \: } (set_tile_pt1 0)# r/ i6 l6 X, h7 Y+ b' \1 c
(set_tile_style)6 o" x6 @3 M2 i; M" H
(setq just-idx (cdr (assoc 71 elist)))
) a; F9 b! \ v+ u* v/ ^ (set_tile "MTextJustify" (itoa (1- just-idx)))
# [' S5 Q1 |+ b (setq dir-idx (cdr (assoc 72 elist)))
7 g) b7 c7 E- f1 T, t (cond
6 f6 U3 d9 |6 J7 [5 I ((= dir-idx 1) (setq dir-idx 0))5 X4 j' `3 }& q1 W1 O
((= dir-idx 2) (setq dir-idx 0))
9 |! Y# ~0 h$ @3 n' W: k ((= dir-idx 3) (setq dir-idx 1))
! x& F8 y% v+ ~0 c) f4 R( n ((= dir-idx 4) (setq dir-idx 1))6 J" |9 W" a# g* g. o1 L
((= dir-idx 5) (setq dir-idx 2))2 d+ }7 U. X4 v! [9 ^9 E# ]% t
(T (setq dir-idx 0))
9 @" x) b {- @7 g/ l1 v# E0 B )
) g- w8 a5 p# J5 h& S! p- X (set_tile "MTextDirection" (itoa dir-idx)) v) u6 Q4 Y" @) A
(set_tile "MTextWidth" (ai_rtos (setq wid (cdr (assoc 41 elist)))))2 f+ |' X4 c5 w8 T$ R# Z; i& d
(set_tile_hght)
" ]$ z w/ I& ~# ` (set_tile_rot)
/ w2 F3 [* o3 C! d2 J5 D" n8 `9 ?$ z% ]8 p7 u! R' \) f3 c; E
;; Set edit box, disable if too long
6 a1 S4 Z8 ]+ S, a r- V- g* M (setq gc3 (cdr (assoc 3 elist))- [0 Q3 @0 d& A6 D/ K
text (cdr (assoc 1 elist)))6 X) f% m- L# F" G7 C! ]& c
(if gc3$ _$ S4 y0 D9 U3 D" q5 x$ O
(progn ;; Text is over 250 chars, disable edit tile
5 p: {7 E+ b! O5 Q ~; W$ f (set_tile "t_string" (strcat (substr gc3 1 25) " ..."))
5 C$ P# g8 ?( k( b (mode_tile "t_string" 1)+ S6 @- D; J1 r! k. }
)7 l. F! F; e7 p: i4 ^
(if (> (strlen text) 80): L6 n! w( s0 Z! T; U2 a2 u8 V
(progn ;; Still too big
, x, n2 v8 a% C5 m5 w (set_tile "t_string" (strcat (substr text 1 25) " ..."))
* z4 N" d' l* K, ^3 U (mode_tile "t_string" 1)
# C9 |4 E+ @- j1 F/ ]; {# F )
; z/ ?" v& n2 e% n* P- N (set_tile "t_string" text) T( Q5 s* E3 j x3 s
)
0 K( y4 A8 m( ?3 F; ?. k# W; X( W; C )/ ]1 e4 i+ a4 a
& H: N! |6 L$ A% [4 [! K% v4 R ;; Define action for tiles
; i" c* H8 U2 o8 F (set_action_tiles)
( B; F& u0 o4 L5 s (action_tile "style" "(MText_style $value)")5 Q2 S, T( t# N0 L* c; K) L; H
(action_tile "MTextWidth" "(ver_MtextWidth $value)")- U5 P( f2 p' }/ U J% {
(action_tile "MTextEdit" "(done_dialog 4)")6 ^5 s7 F- b/ p P6 M
(action_tile "MTextJustify" "(setq just-idx (1+ (atoi $value)))")
) e2 `9 M, ?- Q (action_tile "MTextDirection" "(setq dir-idx (atoi $value))")
' f N/ v, m& {+ D9 t) ` B2 r; v, j( \+ Z( o9 z. A" {
;; Set initial focus to text edit box.- A6 d1 |1 w, x! T3 o
(mode_tile "t_string" 2)1 e) o$ C: b& D
" \; L, ], x/ B" p" c: w
;; Run the dialog) r9 M8 {: y% b# g% x1 d C
(setq dialog-state (start_dialog))+ A5 b" I( V% e! P# f- D% c7 g! F
(cond/ l; ]2 u/ o3 [; T& x7 o
;; Cancelled - restore saved data& w1 M6 [5 p; K. S, Z) T$ H+ A
((= dialog-state 0) (reset))
* H) i- |% ^# j% p# l" a ;; OK - save new data" ]; O, L7 R5 v! g* D0 x
((= dialog-state 1) (modify_mtext))" }9 w5 H, C0 o8 _/ J$ I( _9 B$ i
;; Pick new insertion point
- C- [9 Q- f" q8 O6 ?, j: P ((= dialog-state 3)& X. y- M- y p
(modify_mtext)
/ t* p: Q& z& ?, J3 H7 F (setq pt1 (getpoint (list x1 y1 z1) "\nNew Insertion Point: "))' q0 @+ @4 G$ \3 Y# a+ N5 `9 E) y
(ver_pt1 0)
$ j! v) q/ b" H9 ]8 e$ x" w8 B, K; Z (ddmtext): [' P3 l" \- ~: W
)
/ R/ i. t; ~3 A( | ;; Run full editor
+ l" Z1 O4 z4 z' p ((= dialog-state 4)) I; k' S$ L" s! D
(modify_mtext)2 j* c4 O6 y# N$ h6 e
(safe_ddedit ename) ^( v' {! ~2 z2 S: M- ~" s, }
(setq elist (entget ename))+ Q/ H5 s% o7 y( u! w4 `2 j" h, I
(ddmtext)/ C5 Q6 b, @9 {* Z4 f) G) R* U% h
)
! a6 H. D; D, B- e( e' H5 L (T nil)' e4 S6 C Q3 C1 s. o
)
b x& b5 M0 r; w: O ). V1 i. W" x6 \5 u8 C
9 s& Q: N& s+ x$ x ;;
0 ^8 }2 s) [' Q4 z8 t# ^; | ;; Modify VIEWPORT/ E1 ~5 w# v; m, X4 d6 {
;;2 B( ~9 u8 G4 A$ j: g1 q. L8 v; Z1 R
7 S' C' O7 w( a
(defun ddvport ()
' V8 T. N" f, X" Y( Q (if (not (new_dialog "ddvport" dcl_id)) (exit)). y* c# a+ F4 [4 O8 ^9 j3 f- B
(set_tile_props)
( k0 G) v7 W: |8 B' W; \ (set_tile_handle)1 ^. l. Z5 f& c6 q4 k
(setq vpt (cdr (assoc 10 elist))), n) j) p2 D0 a/ @ L8 X/ S! `* u
(set_tile "xtext" (rtos (setq x1 (car vpt))))
0 O: z' n2 a9 i" T8 f& y (set_tile "ytext" (rtos (setq y1 (cadr vpt))))
- C: O8 d1 R0 T" Y2 N% m' ` (set_tile "ztext" (rtos (setq z1 (caddr vpt))))
& n B$ b t" d; q i: Y (setq wid (cdr (assoc 40 elist)))
2 n2 l( `/ B, ]! D% Y: n (set_tile "wid" (rtos wid))
) D0 P, d+ ^8 S2 Y$ V (setq hght (cdr (assoc 41 elist)))
: m3 t7 i6 L2 N0 F. r (set_tile "hght" (rtos hght))
/ T" }: S' ^! d0 l9 u+ t' | (setq vpid (cdr (assoc 69 elist)))4 u e9 l* i" I
(set_tile "vpid" (itoa vpid))1 V$ w- x6 M6 o' N. |
(setq on-off (cdr (assoc 68 elist)))
1 ^* k) }- L+ t' U3 ^4 ~+ z+ Q (cond' \) @4 C2 Z, ]1 n7 w1 e
((= on-off 0) (set_tile "on-off" "OFF"))% R( M9 x- G. @( p2 U
((> on-off 0) (set_tile "on-off" "ON and Active")). X7 \( i7 Q6 a v9 `1 }% o
(T (set_tile "on-off" "ON and Inactive"))
" N5 P4 z& \# d F& ?8 R6 Q- h )
1 R6 U$ g, T/ f5 @5 x% ^$ x0 i. x% q% u/ M, S9 U
;; Define action for tiles) U. e- i2 k* P8 ~
(set_action_tiles)
& d0 |" ?; B$ v1 O8 C
M3 I/ x2 k# _ }5 v (setq dialog-state (start_dialog))
2 E! ^* \# X. G+ S$ E (if (= dialog-state 0)5 z! R0 C: b% o) ]1 B& |2 k
(reset)" p" J% m- ^4 V) S+ w& M
)+ c% z: Z8 }* m( B8 U
(if (= dialog-state 1)6 \2 v$ b* ]4 S3 [
(progn* H- j7 K& f/ M+ h5 m3 H
(if (= ecolor 0) (setq ecolor "BYBLOCK")). \1 z( u2 S+ x' K7 k! {
(if (= ecolor 256) (setq ecolor "BYLAYER"))
; G% n1 M2 X, V& B- _) J i (command "_.chprop" ename ""
2 A- }% l. g. z! j' m5 s( F" g "_la" elayer2 L9 I8 I+ M4 R* i: A& E: R
"_c" ecolor ""+ v) N1 ^- [& J4 s
)
7 e9 f0 Z, \. A( b2 u4 \ )3 t9 W( n* ]$ W& d
)
# M! ~% o) W$ B$ Y: N )5 r1 s; ~) P* M2 P6 q
;;. X7 U( I) `# N& k* q
;; Modify POLYLINE" U4 Y: N7 l& S% K
;;2 K7 }. E: l7 ~% }6 M' ^0 X: `/ ?
(defun modify_polyline ()
, W; {5 l+ M$ P& f. r! ]" t (modify_properties)
t. S/ F2 ?6 Z% C5 U6 ` (if (= ltgen "1"), _; u6 {, K( p( r: a6 p
(if (/= (logand bit70 128) 128)
! M5 H ^3 W4 R4 n (setq bit70 (+ bit70 128))
* w+ e2 u H- }3 E/ ^* R# F0 x- U )
% J0 m3 f! b: \8 O1 q1 x% U) S: [ )1 _& k( B7 x$ ~' l1 O% _
(if (= ltgen "0")' P D( ^$ k4 \+ n. K9 ?4 V
(if (= (logand bit70 128) 128)
+ S/ v' q1 D' g: X2 I& F (setq bit70 (- bit70 128))0 Z1 C1 u. h2 g4 c
)- G: q- P) X1 i; T* O/ D9 `8 N
)
% \+ i9 j5 s+ ~7 \: B" Y1 U2 y (setq elist (subst (cons 70 bit70) (assoc 70 elist) elist))
6 Z2 ^ O. E/ L$ e (entmod elist)
. j9 U" ?* s% X8 ], S ;; Added to take care of updating Vertex information for color
' ?$ _2 T4 ?" B* j4 W1 q ;; and linetype.! U# B( c1 I4 P$ b7 D: `/ m
(setq save-ename ename save-elist elist); w D( ^7 ]5 g* b; I
(if (= (cdr (assoc 0 elist)) "LWPOLYLINE")- K8 p e, h9 N( A9 }! x4 ]
(progn0 v; X5 R! h7 @- D6 x2 p$ p+ [
(emod ecolor 62)
8 N( Q4 s% l% p1 g# Y8 K& K (emod eltype 6). ]3 J* k! h! H% S2 I* i, s9 T# y
(emod eltscale 48)
/ s' o3 Z3 } O+ R2 ~- a (entmod elist)
2 I: g" r! g) f) }" ^/ a( a )' {9 ~! [1 y: V Q% i: }
(progn
3 E# v7 `+ ~/ H3 N& U, `; a% m (setq ename (entnext save-ename))) V7 F1 T. e. G' Y+ \0 ?5 ]
(setq elist (entget ename))
1 M( t# w* P5 k" N1 g$ W0 e& l$ z; C6 {9 J7 X8 G. S
(while (not (= (cdr (assoc 0 elist)) "SEQEND")); i1 T% ^5 ^4 E0 Q2 R' `
(emod ecolor 62)
& @* r# |0 W2 V! c (emod eltype 6)
, @/ }5 ]1 ^0 e0 U (emod eltscale 48)
# G6 _7 s$ H: Q8 \1 |; h (entmod elist)7 y. D6 h$ K+ |* n( |+ G
(setq ename (entnext ename))9 l" I* e6 T: x7 F
(setq elist (entget ename))8 u1 G/ k, v5 J) ~! |+ v$ p
)
, p6 _4 O" F' w) n( F4 W )
8 I2 x3 ]. Y* H )2 ~; L/ q- S1 [( P' N& z
;; Update the SEQEND! f* M0 s- ^: ~1 t
(if (= (cdr (assoc 0 elist)) "SEQEND")
( N f# D0 M; I! T2 ` (progn
/ ^2 }7 ~6 @; N (emod ecolor 62)0 F4 F9 d; z' J/ U
(emod eltype 6)
( c, `. H7 {0 s (emod eltscale 48)! K" A! o. o3 L
(entmod elist)
, G: o- ]# O" z1 t) A5 M! U )
0 P& I5 c" _0 g( T; V) D8 n )+ d) I5 s I2 ?5 D; I3 u
;; Go back to header.
- o! {0 z- w6 k5 f% w8 ^ (setq ename save-ename elist save-elist)7 I; l. @* M+ f0 r2 J0 V: H2 d
) n; J7 j& U5 d) n7 u4 N% E& b (entupd ename)
* @2 R* a* [2 Q! Y/ X )
2 @, E& e5 A+ ?' @
" z x! |( z( n4 t ;; Increment vertex. Set tile values to next vertex$ x, i9 c4 f! u! V0 Z
;;
7 T) V. U! g% g% d. n (defun next_vertex ()& o% Q6 i! }8 g# e
(if (= (cdr (assoc 0 vlist)) "LWPOLYLINE")
2 T, Z) y: U( ?& z: T+ h* I1 u { (progn
2 `9 d. g# y$ m8 H6 }+ i: V4 N$ ] ;; If the counter reaches the number of vertices,
! x+ p8 H+ L& _8 Z. f ;; roll it over to zero again.
4 T- \6 J0 b9 g0 J (if (= ctr (cdr (assoc 90 vlist)))
( ?! P! ^, u2 ~4 @8 V3 ? (setq ctr 0)$ v* t6 N+ n( w7 ?4 p' U! ^
)& M3 c& C" b! X: w7 _/ `, F
(set_tile "ctr" (itoa (setq ctr (+ 1 ctr))))4 X2 X! ]! g* M5 p: o9 ~; C, M
(set_tile_vpt pointype)2 S. y& o5 D! J& n
)1 P5 b$ M8 U# x0 I6 w# c) W
(progn
& L; I0 ^( j$ V( V3 k0 p' l (setq vname (entnext vname))
: X' }; q1 @) v* B (setq vlist (entget vname))( ` C2 z& L3 U" |
(if (= (cdr (assoc 0 vlist)) "VERTEX")
. X3 i: }/ Q. ?" a1 F$ h: O$ @; E (progn
$ [; G: g/ Q# N N2 b6 z& ~0 C (set_tile "ctr" (itoa (setq ctr (+ 1 ctr))))
0 L( N0 |5 Q6 N3 u u" d (set_tile_vpt pointype)7 D" U* N4 T0 Y) |; K
)4 c" H7 a: a; I K1 l! w2 Z+ C
(progn
- M# z% Y. j" i8 u! [% e (setq vname (entnext ename))
/ o, V$ V F7 O3 _% E" ^ (setq vlist (entget vname))
1 l& Z& a1 \0 J! O9 X& f3 e (set_tile_vpt pointype) m- Z, l$ B; u4 @% {0 w
(set_tile "ctr" (itoa (setq ctr 1))); }/ ^/ z% A: @, ]4 U
)
1 G0 \) y5 {% b5 Z N )
. P7 p1 W% _# f2 i )) k( ~* p5 o& t; W4 A* n$ |
)$ q+ d" s4 a% z( ^ ^9 @9 H5 t
)
) u7 K% s6 y. u7 v8 T
) X% F) f0 f1 L0 `8 t/ A- p6 m$ ^( { (defun ddpline (/ oldecho)
. o- x, V; I# n/ E& a c (if (not (new_dialog "ddpline" dcl_id)) (exit))
( v7 R+ B6 F- N" C: }% u: d: v (set_tile_props)% x; E3 {/ o& \8 `% t
(set_tile_handle): |) V k. F5 R+ Y
(setq bit70 (cdr (assoc 70 elist)))
6 d2 v' ~% {9 f3 r; v, b9 u (setq bit75 (cdr (assoc 75 elist)))
! ?, p' z% t& E) ~4 P (cond
5 f# d2 h2 d6 j+ j5 W ((= (logand bit70 8) 8) ; 3DPOLY2 v7 `1 s& V% z
(set_tile "ptype" (setq pltype "3D polyline"))" z! ?) }* J2 ?% ]2 T( u% {2 q
(setq pointype 0) ; WCS or ECS point values
+ _% ~, S1 D6 c) M" G; r& N (mode_tile "fit" 1)
: e7 g! C1 m0 T- C0 Y (mode_tile "mesh" 1)
0 Q- t$ K# S {( t7 x (mode_tile "bezier" 1)
! E, C5 @5 K8 H4 X9 D (mode_tile "ltgen" 1)2 p) K* T* H* v$ l
(set_tile "none" "1"). O1 V4 ?5 `4 O( ?) D
(set_tile_closed)+ J$ J; A5 G" ^# ^* {+ u
(set_tile_fitsmooth)
' [; n3 z* T8 o* J1 Z )
- P' k2 L& ` R; ` ((= (logand bit70 16) 16) ; 3DMESH
8 J- y5 O8 ?( ?# c1 s0 u7 Q- [ (set_tile "ptype" (setq pltype "3D mesh"))8 R m7 _/ R% c+ ?7 R- Y
(setq pointype 0)
% [* Y! n( J) R1 _7 M, l a% K8 d (mode_tile "pline" 1)
# r. c$ n0 i5 N8 u& J4 e4 ^# ? (mode_tile "fit" 1)4 t g# x2 e0 P* ]0 ~0 F2 U6 F. a6 X
(mode_tile "ltgen" 1)
! \' f5 j2 \8 b" i1 m5 y (setq m (1- (cdr (assoc 71 elist))))7 a" O) ?$ x6 l; J) Q3 ?
(setq n (1-(cdr (assoc 72 elist))))8 {& T; e% l$ j4 v3 e, \0 A
(setq u (1- (cdr (assoc 73 elist))))
+ v$ G9 C% J0 M$ U (if (< u 0) (setq u 0))
& C" ?1 `- i- I. X z3 V; i7 f2 v; |% ] (setq v (1- (cdr (assoc 74 elist))))0 n7 r! f" i* r) I" O
(if (< v 0) (setq v 0))& M" F, u k3 d! g# o/ O/ G
(set_tile "m" (itoa m))
8 ~- E% B7 t4 d( H* l- F (set_tile "n" (itoa n))
( D3 ]: Z* r( I& F9 P! M8 D: {) _ (set_tile "u" (itoa u))
3 }$ D, s8 t: y5 b (set_tile "v" (itoa v)): }5 I% Q* e; C7 d3 M
(set_tile_closed)
2 W3 g1 l7 G3 ^7 n (set_tile_fitsmooth)* p% ~ I# C8 R
)
" Z9 e, V9 u4 ]) f4 D! M ((= (logand bit70 64) 64) ; POLYFACE MESH
; T8 \5 T' w0 {" s3 Z (set_tile "ptype" (setq pltype "Polyface mesh"))
5 T4 z9 y% x3 B1 k, t ~ (setq pointype 0)
2 L0 }9 M( Z" }; l5 C4 I6 |0 e (mode_tile "f-s" 1)
9 V4 E! @% Z% `1 {! ]) S& u% ^ (mode_tile "mesh" 1)
$ s& T4 U. ]8 k/ v: A8 K (mode_tile "pline" 1)
6 ^/ N2 }9 @, _ )7 Z4 W* t* _" l3 ^ j; N
(T ; 2D POLYLINE; X; c6 }5 v. H# K) j
(set_tile "ptype" (setq pltype "2D polyline"))
3 j7 h0 y1 }, j$ t (setq pointype 1)
4 Y" R6 _: L% u1 H2 `3 C) v (mode_tile "bezier" 1)
5 Q" A- H1 g" ]& Q3 f6 ? (mode_tile "mesh" 1)5 `9 H% J- m3 @
(if (= (logand bit70 128) 128)
+ i. d( r F& |) @$ [ (set_tile "ltgen" (setq ltgen "1")). ^% x" _. H# O! d
)
% W. P' d' i2 W8 W (set_tile_closed)% Q* R$ w0 o8 ~- h; c
(set_tile_fitsmooth)' O# M3 R2 w7 f6 D- D9 t3 s
)7 T/ v9 ?, L! y V
)+ P1 T0 C2 p, e% }
! [# a. [% p1 y
(if (= (cdr (assoc 0 elist)) "LWPOLYLINE")
) a7 x( c, U, o (progn# h# L2 h- f4 q4 `# ^
(if (not next) (setq vname ename))
% j" s6 [- j/ J l; _9 u (setq next T)! U; ^9 s7 E) S! B( e
(set_tile "ctr" (itoa (setq ctr 1)))
8 Y" i8 c% ~8 \1 ] (setq vlist (entget ename))- y. c8 A, z/ U7 O
)1 P9 D( [9 X1 R' M
(progn9 h* Z0 j5 C% ~+ l" u
(if (not next) (setq vname (entnext ename)))6 k9 r# N0 j+ }7 j
(setq next T)% ~ K# g/ v3 w9 U& d) i
(set_tile "ctr" (itoa (setq ctr 1)))+ |+ C! L4 y9 r1 {
(setq vlist (entget vname))
+ d& [9 S1 I# [% i3 O6 L! w4 ~ )0 M( W8 }$ [% ^3 S( q3 J7 z
). t8 r( Q8 g- K4 Q
(set_tile_vpt pointype)
8 C) ?& W1 j; V1 S8 U2 Q1 S( f ;; Define action for tiles! j4 |( U% q3 A- H7 C: h0 d& g! ^
(set_action_tiles)
6 W3 K, n( l2 T" U. i7 t/ V+ |( n (setq dialog-state (start_dialog))- T* ?* h9 }* U/ B
! d8 n, @4 m4 O f (if (= dialog-state 0); r/ c4 Z5 |7 q& F9 m- P! s& _ `
(reset)2 j+ X7 `, r* i4 Q. s
)
0 J% q' b' W& S( e5 A, C (if (= dialog-state 1). v) q. c. n8 O4 u3 L
(progn- A( w7 W3 J. r% x( d. C' c% z
(modify_polyline)
% w! g6 Y6 X7 m7 g: u (if (or (= pltype "2D polyline")% h) u! i+ E6 G$ r D7 N
(= pltype "3D polyline")0 C* t- d2 D; z6 f" X9 G
)& x+ Q1 p7 e: F' v6 a# H) t$ _* N
(progn
( Q% P2 _3 N& Q4 \7 R (command "_.pedit" ename)# \" {$ n5 W" i$ L7 W* e+ S
(if (= spltype 0) (command "_d"))
; x! V5 J. L3 U6 H) J" l2 v (if (= spltype 1) (command "_f")); u" [8 d# {7 `
(if (or (= spltype 5)
' D% B! _, Y( B: ?: ` (= spltype 6)4 k9 `* R/ R# J1 h; X, u2 ]
)
+ L* w. P$ E6 f (progn
* c$ h' @! l) O; r& `1 E (setvar "splinetype" spltype)
; ~# f9 W$ ^7 v& @9 Z0 |% z) F (command "_s")
2 A6 ?% ~4 t2 V )
# s! q- y. N7 ?& I ) V5 D }* ]# q
(if (= closed "0")- V7 C) r: B1 C& Q
(command "_o")$ y% }2 _9 u) I9 q2 d' y3 V
(command "_c"), g) h# ^. y7 r. G( ^4 l/ M
)
, u0 `+ A$ P" M. Y) l (command ""). P8 \$ p* y. \3 E! c$ m# h
3 U( X- o, J& j6 T0 X4 P. x7 r
(if (= spltype 0)
& @: B8 [# q% s U0 I (progn
, `# ^# L. n9 A, h' c (setq oldecho (getvar "cmdecho"))
6 Q/ ~+ x. H$ _$ p j( C (command "_cmdecho" 0)4 u" B x& a. i s
(command "_convertpoly" "_light" ename "")
: P! q+ f" `' i3 z# T/ U, [( r (command "_cmdecho" oldecho) M5 D2 A. V9 E; E+ I- M
)
. n+ {6 ~( }" ]* ] )
7 L2 v; M0 C8 V )9 j0 a( j) Y, q; q+ X/ K W
)5 J. |. Q' w9 z3 Z
(if (= pltype "3D mesh")
5 w% e% N$ J" f% \) \/ E$ C2 i$ t: @& `0 I (progn
; L6 N, J& G3 H. G) I (command "_.pedit" ename)* }* ]1 j/ {* p0 `+ g7 \
(if (= spltype 0) (command "_d"))
- D' T! d9 O: T6 H0 t; Z2 L (if (or (= spltype 5)
6 g+ w. h# u1 V( s( _9 E (= spltype 6)
' m$ I) A# v) r8 \6 X+ q (= spltype 8)
9 |( L, o$ b0 D# `3 W% h )
( A5 [3 e# k* q: g8 C% V0 [& e (progn
/ k) |3 _, y3 e B% a& T (setvar "surftype" spltype)
! ]; f8 Q' a0 w (setvar "surfu" u)
4 W& F1 r: e% T* T0 u# l( j5 o( d (setvar "surfv" v)/ W) {9 I# h1 r2 S6 I3 x
(command "_s"). X" s+ {+ z! e5 M: ^* _
)
% B! ? I7 x( {4 G )
$ [8 L: ?" C, `8 _( s5 { G7 m (if (/= closedm old-closedm)9 t5 b( a2 x2 n+ [& @# l
(command "_m")
9 U% b1 M- m+ t: o4 g! H4 w+ Z k3 z )
7 J& M- T' {( Z A: H (if (/= closedn old-closedn)
i( L% Y7 v1 \7 [1 _+ S% |% c (command "_n")
2 s2 T6 W! T ~- x0 T" l O8 \1 @ ). {' ]/ b4 d4 H$ A
(command "")5 }5 v; H" b! @
), X0 ?+ U+ G; |9 }+ g# T
)
4 H, f+ O# Z2 O, P1 V& B/ r ); R3 t0 q; h9 O" ]0 u
): C; w" E) S1 {2 L
). o# S- c+ _2 t! I- T
;;0 ^0 S/ y9 H+ q$ p+ f7 O4 u
;; All the spline data is contained in a single elist. We must do some
4 r; j, ]( ~9 M6 J' g ;; tricky list processing to loop through the elist in order to display
- j! [ ^2 V9 M" L5 ~2 m ;; all of the control points.9 t( ~( n- d4 U, J! @
;;
8 K' o6 |! J7 k Q" }4 r# b3 o ;; The structure of the elist is different for rational and non-rational
, t& V5 U! Z% q, k2 c; w4 J ;; splines. Therefore, we check the rational spline flag.
' r$ x, v2 e+ ~7 V, z# ], H ;;
2 G/ U% O, \. b/ @ (defun next_cntl_pt ()" r7 v5 n& I: j" [! G
(setq elem-no 0) ;; elem-no = element counter% A$ l% A5 K# o- k1 s+ c4 f
(if (= first-10-time 1) ;; If first time, find location of first2 |& `# b6 d8 J. y& Q
(foreach list_item elist ;; cntl point element in elist( I7 j& l5 a# o* _ `+ U, z6 y: N
(progn0 ^) n5 H O3 P- u! {5 A
(setq elem-no (+ 1 elem-no))
7 e5 ~9 `' B* Y5 c7 k+ }, R. s- s, V (if (= (car list_item) 10)
F: Q$ I5 j: L6 R& |3 U& y (progn' T! _9 ~! K! ~; r" d8 F
(if (= first-10-time 1)
* @+ w& y& S3 J9 G b. Z7 G8 }4 ] (progn
/ c) u2 {/ I7 l1 X- t0 w9 q3 r& Q; S (setq first-10-rec (- elem-no 1))7 E3 b; k+ q4 B/ W
(setq first-10-time 0)
3 K& e0 s1 X; X- Q# w6 _ (if (= rational_spl_flag 1) ;; if rational4 N; ^* q) T8 \7 h( s- U
(setq cur-10-rec (+ elem-no 1))' s% k+ z" s7 u1 ]: n, o/ v
(setq cur-10-rec elem-no)
0 [1 H$ F/ e+ R% D )8 K: o; ~; C4 k
)
7 f# z2 |2 B& T( V6 m )
' L' |' h& x# X R9 ~! [. ~ )
8 N- P* ^7 @/ ]! l, ~5 L )0 X% d9 W/ D- R+ T* ], w
)# e1 Q X, D& @# ]
) ~1 X% V a3 g- z
)
( V5 w, Q; Y" u& F ;; Now we know the location of the first "10" record; it's stored# C9 v; r' A- E! u0 Y1 b' I( H
;; in first-10-rec. The first 10 record was already displayed when; e- k6 t) e& U; ~
;; the dialog first came up so let's display the second one when
: y" Y* y: P2 v0 y+ ?) R3 i ;; the user presses the "next" button (the first time through).* H. S$ G( C5 z, E5 j8 i& v, a
;;
- F/ r) y& L D+ B& U% U; @, ? (setq temprec (nth cur-10-rec elist)) D; q9 S* V5 P/ t$ W3 S4 T
;;
/ C! p U- Y; w; w$ z% @ (if (= (car temprec) 10) ;; if 10 record, z2 S) @: |! h A8 V6 K. b
(progn
3 v: }8 Z6 @5 }' R- c+ _ H (if (= rational_spl_flag 1) ;; if rational spline3 W7 J8 p) Y9 k7 f ~
(progn' k4 P, m4 f L3 D- }) x
(setq tempweight (nth (+ cur-10-rec 1) elist))
0 N4 `" o. o+ n (setq cur-10-rec (+ 2 cur-10-rec))
; V5 `3 Z8 D# ~1 e! f )% h ?/ l1 D K# ^2 p
(progn ;; else8 p9 x3 ^0 n4 |3 E! t# @
(setq cur-10-rec (+ 1 cur-10-rec))
" J2 _' ?4 B$ Z+ i2 B, n# A )
7 p9 n4 c9 O u$ h7 T) {, y$ e )
, s$ k+ U, T2 K1 D2 y9 P ) ;; end if rational spline- k# r* w& o2 o- P8 ^
(progn ;; else reset counters
! W: ]4 E5 o5 N" ]9 d+ S8 c (setq temprec (nth first-10-rec elist)) ;; get 1st 10 rec9 D: K* m/ i$ X. S$ H, l% L
(setq tempweight (nth (+ first-10-rec 1) elist)) s! J3 y: u9 w+ ~' X @
(setq cntl-pt-indicator 0)
* h! b9 X8 X( L4 M( z (if (= rational_spl_flag 1) ;; if rational
! X- E ]( P! E% O7 r5 y2 h (setq cur-10-rec (+ first-10-rec 2)) ;; point to 2nd 10 rec. ~3 Q3 }6 ~" I; W# L; E0 u* ~5 d
(setq cur-10-rec (+ first-10-rec 1)) ;; point to 2nd 10 rec
" w$ A# ^0 U) h( r* y )+ Q6 @4 n: ]/ u; J
)) m! x6 N4 j; T" F2 O) g" o% o! }9 G% @
) ;; end if 10 record, |9 q% V( e( E, f6 P. ] F+ ~0 d$ ?
2 h' v2 O5 x1 Y5 o
;; Display cntl point, weight and ctr. Increment ctr.
" }4 Z3 \( t: s) w) _' @ (setq cntl-pt (cdr temprec))" g/ Q; n+ c2 ~* S" Z
(set_tile "xtext" (rtos (setq x1 (car cntl-pt))))- \) |. D. ]5 q( K. q3 x# i& p) C
(set_tile "ytext" (rtos (setq y1 (cadr cntl-pt))))+ w. l3 B6 [" r1 b6 Q' a4 t" j( s( S
(set_tile "ztext" (rtos (setq z1 (caddr cntl-pt))))
/ T- r: E7 i3 | (setq cntl-pt-indicator (+ 1 cntl-pt-indicator))
5 Y0 D$ q% o* Y) M/ n j0 w2 a (set_tile "cntl_ctr" (itoa cntl-pt-indicator))
; Y8 b4 r& ~1 ]- Z% i/ a0 F( [ (if (= rational_spl_flag 1) ;; if rational
p: r/ `+ [! j& l+ w, ~ (set_tile "weight" (rtos (cdr tempweight))) ;; disp wght
9 @! x2 w, y+ k7 u7 d0 `( M3 F (mode_tile "weight_text" 1) ;; disable wght
. d5 K$ G1 f+ a4 |" _+ ~ )# b" S; R4 ^9 j. \
)7 L& n9 }8 l7 r" G( z! C8 V
;;
5 h+ V, Z3 Y3 [' H ;; All the spline info is contained in a single elist. We must do some, _- O' Y& ~$ X/ V* Y @ i
;; tricky list processing to loop through the elist in order to display
n) m) b* K% K2 c5 I5 _% A; l$ j ;; all of the user data points.
9 i I$ t1 [5 y! r ;;
. @6 u& r5 F* @- F- F5 V U (defun next_data_pt ()
! z* {' T5 B& c (setq elem-no 0) ;; elem-no = element counter- ^; D; D* E/ U! l A
(if (= first-11-time 1) ;; If first time, find location of first
: ]0 J; |" K) H; P" T5 w9 W (foreach list_item elist ;; data point element in elist
: H4 _0 ? Z+ x X% W9 C- L& j) L (progn5 Y9 j; p. r; j( k3 R6 w
(setq elem-no (+ 1 elem-no)): E; [ [) g; l" C/ l& {
(if (= (car list_item) 11)
9 T3 {; [0 l4 I, P( B! t/ p8 L/ D (progn
v$ F) [( _. D (if (= first-11-time 1)
/ p/ e& ^8 w/ [" U* r (progn
5 [# m. C D. J6 E$ T (setq first-11-rec (- elem-no 1))9 n9 d+ D/ U) b8 v/ C1 a
(setq cur-11-rec elem-no)' d7 H* n! Q8 n& e; m5 ^
(setq first-11-time 0)
9 T4 K; s9 D4 ]3 w )! w( i- ^& q9 ?9 _6 d# |2 o
)
- \& r p1 C3 f3 Y5 h* D' D$ h )- c0 N$ y( q2 \
)
2 ?, l6 ]7 a0 I8 u% L: W0 B0 v# ~ )
& g! j& C! S! U$ z" m2 B )
8 y& f5 k! W! V )
5 j8 Z6 E( R; N; Z% z( T1 U (setq temprec (nth cur-11-rec elist))3 i) l. v; m- ^$ J& [. E
;; If it's not a DXF "11" element then we've gone past the last
1 H% J6 J4 K7 [ ;; "11" element. Go back to first "11" element. Reset counters.8 B# z% K: `0 P& U
(if (= (car temprec) 11)3 K# R7 r* H' a/ K8 X& g) M! a3 f
(setq data-pt (cdr temprec))
" |0 g+ O) q8 p: F (progn ;; else" g+ A" D) }( z8 c" q7 A+ V2 q6 \
(setq data-pt (cdr (nth first-11-rec elist)))
/ K6 p2 h2 P! @4 m& ?5 y, \& h8 C (setq cur-11-rec first-11-rec)
1 Y. }. {9 F! x8 l+ c+ b2 i) p (setq data-pt-indicator 0)
8 P* e6 k4 ~# i2 }0 U' j( i* i- Q )
# c) E0 L7 ~! Y! S2 z )% W9 r- J0 z7 p
;; Display data point and ctr. Increment counters.
* v) r: H7 K+ i) K' @: s (set_tile "dxtext" (rtos (setq x1 (car data-pt))))
) }4 x! v* g1 y2 s& Z3 w: p6 o: i (set_tile "dytext" (rtos (setq y1 (cadr data-pt)))) z- ^- m" B/ ~7 e+ `
(set_tile "dztext" (rtos (setq z1 (caddr data-pt))))
1 H% Q2 M0 g# N$ f (setq data-pt-indicator (+ 1 data-pt-indicator))
) `+ W% E. L, r (set_tile "data_ctr" (itoa data-pt-indicator))
5 `. B D6 C: i$ L) u (setq cur-11-rec (+ 1 cur-11-rec))0 b/ ^$ D. \& |1 Y
)
9 E, K0 V! M, t9 w: L" z* x ;;1 y l1 p* K! |# ], P& p$ O
;; Modify SPLINE
! x! P4 ?$ k0 [6 d ;;
8 N9 B4 ~( c, j (defun modify_spline ()
( Y) {# b$ S' N (modify_prop_geom)6 ?( _' n J% ^' S9 I$ v I8 A
(entmod elist)
: G! A5 x" q1 b2 t3 R4 T8 } )
, b+ u7 k8 v4 f) L) L
$ v1 U. T. S4 G (defun ddspline ()2 D: v7 S* Z, _, i# N& K& R
(if (not (new_dialog "ddspline" dcl_id)) (exit))
0 I8 _, a+ B0 o1 h% A9 c (set_tile_props)
7 c/ t9 }0 r; b7 c3 U* D' @& G (set_tile_handle)" |& j6 @. |! a% v A- Y% m
(set_tile_spline_props)$ \3 g' L+ ]& E' @3 ~# h9 u
;; Display first control point" ~9 b: ^9 }. A7 s1 I# h) f
(set_tile_cntl_pt)3 ]$ c: e1 A5 ?! @# E7 o
;; Display first data point# A. h) t. q% G' G; a. g
(set_tile_data_pt)7 e0 c9 z1 F, t
; j4 l) f5 O6 l ;; Initialize flags to indicate first time through the dialog.
2 Z/ j9 S0 `! ^. r ;; For control points and user data points the "next" buttons
/ _2 g! c# _3 }% U# z) a3 G; |! Y ;; in the dialog call the appropriate functions.* Y, H1 H. X& v, ~6 b) Z) {
(setq first-10-time 1)
' {$ E3 p3 n0 ~, s! `5 w* h' p8 @ (setq first-11-time 1); W6 H& O* m* \1 y/ D$ K2 W
;; initialize control point number counter! O9 l. g- p/ E) |9 ?7 ]7 H
(setq cntl-pt-indicator 1)
( S9 a1 G% n8 |# j6 N (setq data-pt-indicator 1)8 x3 u1 |0 B' R: K1 D" ]
(set_tile "cntl_ctr" (itoa cntl-pt-indicator))
0 @. J" p$ d" G: Q! O (set_tile "data_ctr" (itoa data-pt-indicator))
1 R% F! `$ c2 t (set_action_tiles)* ]( A/ i9 g8 s) V# i
(setq dialog-state (start_dialog))
( T, I( R1 U2 h' R, v, E- {6 C' A4 }
, U9 L5 N* E) K7 a$ x) w (if (= dialog-state 0)( Q9 F; b: a `# H% P7 S/ B: Q
(reset)
$ D8 w$ Q, @( Q4 M )" y2 j* D* W/ X: i7 \5 v
(if (= dialog-state 1)
! a% j1 ]( N6 K! E% R (modify_spline)
, q) C: a5 A. p6 [6 h1 T )- [& @+ X) h& u% a
)
* F2 \9 q8 R/ W$ @4 ~- t2 C
- [8 w+ Y" ~& n: a1 c5 T C
! @7 b1 B) m# O o* e* D" P$ B$ b5 u6 S8 c& a1 V$ O8 r+ r
;;7 f* |' N: u5 u" n/ f9 e
;; Modify DIMENSION
) E1 f( c6 Z2 z& J- o& X ;;
# d- e5 W+ b. ~ (defun ddimen (/ dtypebit blkname bename sublist a stname n dimtbl
0 L F. m8 J, p; c0 @ dimsty dimlist dimtext svtext dimovr sv_dvlist stlist2 t6 J0 \! H% s# k) N; D
dimtype dimsvcurset)
( A# B* z- E: {5 B; F& a l (setq dimtype "DDIMEN"7 `& ]* O! I+ w; r2 O* d* }
dimsvcurset (ddimen_dimsty_restore)8 U @1 X1 j `) w) ~
)
/ s/ j1 O- D. P: _8 ]! h5 s- G (if (not (new_dialog "ddimen" dcl_id)) (exit))
3 m3 {2 B# u# a$ e2 q" F2 i7 C (set_tile_props)3 n1 b6 f1 J7 u
(set_dimen_props)$ b$ f" G/ w9 Y5 K9 x
(setq dimtext (cdr (assoc 1 elist)))# z7 x: u" d" U2 l
(set_tile "t_string" (if (= "" dimtext) "<>" dimtext))" J' v+ P/ k0 R+ s
(set_tile_handle)5 W/ l) ]8 r' p- Y7 q2 V
;; Define action for tiles: o: O' g" ?. d1 b* O
(set_action_tiles)8 x/ f( A9 S8 f7 v* @/ i+ X
. F3 i- N0 W4 o! y8 i3 N ;; Set initial focus to text edit box.0 s5 O/ ]6 o! C. m
(mode_tile "t_string" 2)& J) C. H6 E- }3 w. W9 y
$ Y7 g* T9 a/ U5 m' A- _! H (setq dialog-state (start_dialog))
( A8 @7 w4 R; O9 p6 A! }' T (if (= dialog-state 0)
0 L& G0 p- _4 ?& G (if (= ddimmt 1)' r7 D8 q; C) c6 f
(reset)
v* s, F( x+ Z4 M' x )8 S3 G8 f$ C: A: [- O: C
)
) k, u8 O' N5 G* Y, b3 h+ [ (if (= dialog-state 1)
, O+ P& l1 @! [: s- O (progn- y; d. U$ q. O+ [
(if (/= dimsty stname)$ v+ X( _& {( D6 w# E
(progn
K# G6 W, R e$ ]% w4 x! H& j* i ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case9 U! p3 V1 y2 e
; doesn't have it.
4 i4 _7 B! A1 [- U" S: ? (if (null (assoc 3 elist))
" \( A+ b" m% ?" y (setq elist (append elist (list (cons 3 dimsty))))5 l4 E* L6 V) _# n
; else just replace it.
& R" g2 x" p2 M7 r0 p; ^1 v+ V (setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))
; B# b0 J3 j* w* b/ H& e, x. x )
' ?$ d3 \& j. B ; refresh sv_dvlist with new dimstyle., t( t: S! w# ^8 [# j' A
(setq sv_dvlist (tblsearch "dimstyle" dimsty))
4 w! k2 w: O" [/ X )
( M. D# l5 Y: v. R )8 c) \% r$ }/ g6 C
(if (not (null dimlist)) ; attempted to change dimvars
, p* t; _ m4 ]# i/ E3 U8 k (ddimen_complist sv_dvlist dimlist dimtbl)
: P }7 X. [& t; D )8 H. B$ g5 O: f S; _- C e
; Modify dimension text
2 F; P. b' f; L8 g* M) \ (if (/= dimtext text)
8 }+ c! k9 i6 \) t( Q) ?: R7 f (progn
9 P9 o- K. a. g G (setq dimtext (if (= text "<>") "" text))
0 f; Q3 F! a8 b7 w) X; P0 R (setq elist (subst (cons 1 dimtext) (assoc 1 elist) elist))
% B/ N- \9 K8 h u: w/ } )& r. Q2 J' M i) F/ q, b; G8 ^; q
)0 u K! l, \6 ]- y" B
(modify_properties)
/ ^3 M5 L9 x3 o& X& s6 Q (entmod elist)7 H0 h: y# y) ]: N p) c
)
% W' b+ o9 X, f0 f( A# |$ W )
3 G4 c6 s# | U3 G: _' r4 w (if (= dialog-state 4)2 b) O2 ~( V( {7 d- N
(progn2 |' G+ Z+ F; K6 U4 I4 K6 E @8 L8 r/ O
(setq ddimmt 1)
) r1 n: Q$ }) z7 ?8 g6 R (if (/= dimsty stname)
$ I7 K1 |# l# X4 c; L3 b (progn7 l- M& `6 _3 @1 m
; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case6 d3 g2 H1 \5 z5 v' n: S( \9 N
; doesn't have it.
4 |% n% j% Y8 D% g (if (null (assoc 3 elist))
$ ? W6 S, c1 p& I (setq elist (append elist (list (cons 3 dimsty))))' z5 @6 U- P' d0 N% H* g
; else just replace it.% ~. x& G/ ^0 a" h# C8 ^3 R, d
(setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))
, k$ T, \' W1 ?/ r+ b( a )
& [" B, D2 s2 o+ R7 j, v% y ; refresh sv_dvlist with new dimstyle.6 j3 J" S" K, O
(setq sv_dvlist (tblsearch "dimstyle" dimsty))& ^2 F$ _6 ]9 s, {7 K2 L/ e6 O* `
)
2 L- h. x% h+ A5 |0 K )
3 L' X1 N' S; h- c* P& Z4 i5 u (if (not (null dimlist)) ; attempted to change dimvars2 U4 O2 y f+ w5 p* z& g
(ddimen_complist sv_dvlist dimlist dimtbl)
" }, l+ x( I6 [ )) H- w+ k) O1 {2 t T- ^; G
; Modify dimension text8 o m6 F7 d, u: J5 D4 z) D2 L
(if (/= dimtext text)
! w$ }* T& i( y+ \8 w% @ (progn/ |7 N) p8 G8 X5 s$ X+ n+ Z
(setq dimtext (if (= text "<>") "" text))
2 @' `5 x9 S, j, H (setq elist (subst (cons 1 dimtext) (assoc 1 elist) elist))
. F) w9 W; [3 g# q" W )
7 v0 s" F; C+ F$ o9 Q3 i# p; h g )+ i5 D1 K# m* B3 x
(modify_properties)
+ E: r5 F$ ^* }1 |& E (entmod elist)
4 V1 ~& d# |% L8 T* \' y (safe_ddedit ename), n- ~& t* t* r: @6 H5 K2 r
(setq elist (entget ename))
+ j& z6 e# \+ L- g: l (ddimen)
; F, X% ^. F, R b )
3 ~! M# r$ D7 [2 W6 ? )
% `( d8 ?" |$ l0 ^9 m# s1 W( ]6 F (ddimen_setvars dimsvcurset) ; Prepare to exit8 S( ] P, q% u- E
)1 q* | Y8 Q% r% X2 o9 Z: w# p+ T0 `
+ K, `9 D. f+ I. i4 Z3 s ;;3 x3 _$ z; T' G( k+ v
;; Modify TOLERANCE
# W2 u! l7 _* l ;;
. F! Q; N$ X0 I% k (defun ddtolerance (/ a stname n dimtbl1 H3 k6 n( Q9 d$ ^5 N, u! Z' k
dimsty dimlist dimovr sv_dvlist stlist dimtype+ Z; ?/ R3 p2 c! o: e( Z" ~ }
dimsvcurset)' m w" C- n5 U! t/ P
(setq dimtype "DDTOLERANCE") b* i- S: y c0 t
dimsvcurset (ddimen_dimsty_restore)
- Z6 K x6 w4 e, S' ~) k9 v: O )3 W% M o/ i1 |! A
(if (not (new_dialog "ddtolerance" dcl_id)) (exit))$ B/ h* R$ h/ k
(set_tile_props)
7 A4 Q9 q W# i2 T& {5 } (set_dimen_props): R% A+ N/ m: N1 m, h0 h
(set_tile_handle)
& m: Y' J2 r; _' y- }2 I" Q: i (set_action_tiles)0 T- Y8 B. K" P- A
(setq dialog-state (start_dialog))
: S& A+ D8 d) j (if (= dialog-state 0)
6 L" z7 Z! \6 q/ \5 } (if (= ddimmt 1)
# c! s7 r. R- o1 R (reset), E' _7 {1 u! W
)
8 x4 z: d/ E/ a )2 a4 p; T) F l, Y
(if (= dialog-state 1)
) F/ v/ O' v+ [0 f7 u8 h (progn5 S8 j% h* L0 ?; w
(if (/= dimsty stname)
8 X3 ?2 N8 b. i) h- j9 C( Q( G (progn
) n( o/ ]2 N, t* p& V% f9 R ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case6 u7 P N) q Z8 s) p, V
; doesn't have it.: A- a1 H, c2 |2 D! f5 E! z$ s+ I: d
(if (null (assoc 3 elist))
! ?& f6 V; o4 {7 j# v& u' o) } (setq elist (append elist (list (cons 3 dimsty)))) v, L& I/ z$ F! L- F
; else just replace it.$ T: Z$ L4 L, A, U7 _1 [
(setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))
/ T6 R9 \4 G1 M+ T! B9 i )
2 c( x; n! s$ f: b' h ; refresh sv_dvlist with new dimstyle.
r7 ]6 c" h; l# ? e (setq sv_dvlist (tblsearch "dimstyle" dimsty))
. ~# s& f1 W6 a. y: i: x5 \ )
# U# n" d( W$ R5 J )
" ]. l- m% a+ m% r/ w) R (if (not (null dimlist)) ; attempted to change dimvars) R; c/ j' t8 B* H$ X
(ddimen_complist sv_dvlist dimlist dimtbl)
% H7 D Y M" H+ X9 P% [( v' u ); E* K. D' M! i* f
(modify_prop_geom)
9 b& I; J* Q6 s& b. H (entmod elist)! ?. A% ]+ ]# G/ q" C
)
4 K* d _9 C, S; G )& z$ H3 ^2 r4 W2 u* W) ]
(if (= dialog-state 4)
6 p9 N. v# R) @* C [ (progn3 V h* a/ B8 Y+ v' \& Z0 z
(setq ddimmt 1)
( {" o9 a* C! g" y4 y (if (/= dimsty stname)
$ b5 a, u) y: d$ @, O; ` (progn' u. V8 }5 k6 Z# X% s r3 \
; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case# |0 R& u' r! p* a7 ]% k
; doesn't have it.
+ a% V/ U( G( I$ E2 D (if (null (assoc 3 elist))5 v, [, W! y5 z3 ^; L
(setq elist (append elist (list (cons 3 dimsty))))
1 Y" |' l5 ]9 P3 c* |1 c ; else just replace it.+ x6 q) |- E/ I/ B4 |
(setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))
9 V% p; g( u. d c. ?$ y )
3 g5 r' L" a' G' X) c7 p ; refresh sv_dvlist with new dimstyle.
. {8 e" }" b) w7 I (setq sv_dvlist (tblsearch "dimstyle" dimsty)); }; W. S7 g1 w' z
)
! j+ C: p, H# b )
& S$ r9 v( f8 C- m. P (if (not (null dimlist)) ; attempted to change dimvars. O; E$ s5 A; j( B# h
(ddimen_complist sv_dvlist dimlist dimtbl)' E! w, x6 z t8 p2 r
)! Y) u' W$ \! S7 @7 \0 _
(modify_properties)
# a# w5 p# }" F' c' m! @ (entmod elist)
" B7 y% I; ^( }9 w. c( c/ C& x (safe_ddedit ename)
4 `0 _" M+ R. B7 K$ Q& T (setq elist (entget ename))
* j1 |, M( ]' h- |/ [4 K (ddtolerance)1 [5 ~, E# Q# g
)
/ l5 h+ j2 O( N )
1 V0 q/ i' F( O' [4 H, h (ddimen_setvars dimsvcurset) ; Prepare to exit
# V$ y& l s# I9 ~0 K% o I)
! B7 j; W& c# m7 |/ u$ D+ y8 [8 v* i* }& G
;;: V- o' x5 R8 ?: \1 k5 [8 E1 R
;; ddimen_dlg - jump to ADS ddim module
9 h" d2 s+ ~+ @# a; J$ G9 u ;;9 K$ t: f. C; s9 |7 \
! G( X) k' A2 P; e4 B9 a (defun ddimen_dlg (dimtype tile dimsty dvlist / dimlist)
6 r: Z" k% M% b0 P8 y# L* V0 d* @9 o2 @2 a' ~$ w( s
; Jump to DDIM with overrides if any.
$ Q+ H( d% }2 g3 O (cond ((= tile 11) (setq dimlist (c:ddim "DDMODIFY" dimtype tile dimsty dvlist))) ; Geometry% r. ^& i: R$ P# ^
((= tile 12) (setq dimlist (c:ddim "DDMODIFY" dimtype tile dimsty dvlist))) ; Format
; _5 E5 ]# {0 ` ((= tile 13) (setq dimlist (c:ddim "DDMODIFY" dimtype tile dimsty dvlist))) ; Annotation
, k# a4 T3 b2 h6 n, | )* O' l6 z3 c; v
)
# d- I" x$ P) s3 R1 F
3 x; u y. m2 i3 P: k' F ;;. y0 }6 n5 j" @* c! Q
;; Dimension variables updated are stored as overrides.
9 ]7 I v* {. T ;;' G6 l4 A& x7 W h
7 I) {6 p. B& c5 t8 q5 l) o# i- T
(defun ddimen_complist (dimolist dimnlist dimtbl / i odvar ndvar
6 I7 N( H; L# V. h5 c dv dime commandIssued)
K% D( s T% u! {' m( T: i/ p2 l4 x, Z; J
; Here we skip the following first three items:
+ \; d+ T9 O/ w+ E ; (0 . "DIMSTYLE") (2 . sylename) (70 . 0)3 x* o$ A i, Z4 e
;
- z% p+ D5 ~8 s! q1 a& F ; The list comparison immediately begins with dimvar.# V$ C& y4 \: `
;
& z, S' L( J3 z, Z, \8 X ; dimolist - original states of dimvars6 H9 t: U! ^. O1 j G' B
; dimnlist - new dimvar list which is of the resbuf's3 G2 w0 C: B" n; g& `
; dime - entity name for the dimension
2 }9 M- k& t+ L* F# c4 Y ; odvar - value of dimvar for the dimolist
. ]% F, u, @8 ?) u: ^! c! E+ g! l ; ndvar - value of dimvar for the dimnlist" z2 J! y6 i) h( [$ b- t
' ~2 `( e3 Y6 j1 F$ I1 W$ z6 k (setq i 3
7 [5 L7 B7 Y& b6 f( j dime (cdr (assoc -1 elist))6 @% v$ G- F( c, s* a: _0 ?9 |: b; B
)
4 j3 _0 f* s8 X! s1 R9 V6 K (while (setq odvar (cdr (nth i dimolist)))
2 S) U1 _- h6 F) j( t0 ~5 S4 o: O. [- s (progn- Z$ L/ S3 |" z c# q* U" Q4 g
(setq ndvar (cdr (nth i dimnlist))), s7 M) I' L S3 W! V1 h
(setq dv (nth i dimtbl))" f; ]# u6 H& A7 v
(if (eq dv "dimtxsty"). Y; l" F8 v: G* C( _5 [. T( H. f9 |
(setq odvar (cdr (assoc 2 (entget odvar)))
$ x$ x% O! ?" s6 I ndvar (cdr (assoc 2 (entget ndvar)))1 j' D8 U5 u9 s7 M+ o4 V
)
% ?4 `/ m9 ?! F( \/ |& E2 j )
2 Z0 ?& c2 m& T3 `% j. p$ Z* Y2 p }. R3 Y- g" U
;
: B+ D1 J: H4 n ; In order for DIMOVERRRIDE to operate correctly with string
3 Y4 [! A, Y' u2 g5 ]! X e ; based dimvars, we must pass "." versus NULL strings.
/ Y: M& S8 ] m7 a9 _5 r ; In this case ndvar is the new dimvar value the user wishes
" N' Q; A% P; g9 C ; to update on selected dimensions.
' |8 L: Z8 C" m' g: ? ;
6 N5 s4 v! e x$ v (if (/= ndvar odvar)
3 n; O# P1 F8 w3 D3 ? (if (= 'STR (type ndvar))
! K( x! G# a$ h: a/ V+ o3 @ (if (= ndvar "")7 K; |: _* o$ \' s" H0 X
(setq ndvar "."))))
- c3 X- M3 o) _3 U" b/ t. t9 T0 H$ k# p5 C! }( r
(if (/= ndvar odvar)! q S& x l: p% |
(progn
( F% `) ]& E: Q% G (setq dv (strcat "_" dv))
' q7 _" {/ ?$ S ;7 C7 D4 x! d5 u1 N* e! e% H
; Start the dimoverride command
' e. ]; }! Z6 v& D% u ;0 r& O3 r. Z) l5 x
(if (not commandIssued)+ f1 F, q# p. ` Y; |0 e
(progn
, }# X+ r- @" a& C" @ (command "_.dimoverride")
; h! F2 @( O9 w1 ]# N! l7 n$ J/ S/ r (setq commandIssued "T")
+ Z) y( H) Z' |- |2 \ )+ H5 n* @* B- G d5 m8 X$ z4 G
)0 F/ G+ x, f. J5 z) y
;
& T! }8 P n, r8 s" m8 O7 l% n K ; Issue dim overrides! U E- }2 p6 O
;- U6 l; H% Q( F+ s
(if (and (or (= dv "_dimclrd") (= dv "_dimclrt") (= dv "_dimclre"))9 L5 }- \# K/ v0 a9 s2 H0 r
(or (= ndvar 0) (= ndvar 256))
. ?3 _# M6 s5 p. l0 T )' x5 h4 J& \! [" z; \4 _3 a# `
(progn" B' x& H; b9 _0 x7 t% h" U, \- C9 s
(if (= 0 ndvar) (command dv "BYBLOCK"))
* e% b0 w5 G3 ~1 L- l4 ~6 d0 h5 _ (if (= 256 ndvar) (command dv "BYLAYER")); s9 a1 d0 i8 v0 k# {9 M
)( o7 J; z) c, v' @% i
(command dv ndvar)
# f5 O5 v/ x, u, l( C )
8 W, D3 t. t$ v/ \5 n8 r )+ m: L3 F8 i) a9 Z6 c) E! W
)1 B" ]" H9 Y+ `% O( Y; L, H
(setq i (1+ i))) [. ^5 ~. x. j& W& Y' Y& f# f
)
1 F( \* D6 v/ T# h4 n7 V )( u$ Y$ b% `6 n" `! Q3 V$ L& J
;
- j; \0 Z4 ^8 e8 S% e- @& K ; Select Entity and terminate command/ t7 C. S: g4 ]" \9 l: [9 G1 z
;
% s- b4 A% p! A2 c9 b) ^$ W (if commandIssued7 \# Z9 S4 C# F; [9 h1 w" p
(command "" dime "")) A" @5 I: s [6 L
)
2 U" ?1 I7 W" G' K: o% P* \2 U' g& { )% s, n4 k, L# U" P7 ~- @7 b1 S2 P: w
3 c! o9 Y$ @% l; s: W& T5 q% g6 C
;;4 f- Z& e" o M2 q! g- W& Y) z
;; Get style name currently selected style name.& N' ?- c3 ]* O7 K8 f& E
;;4 b/ A2 N( V& r2 E( F$ I6 d/ Z
; A$ P: |* w0 |
(defun ddimen_style (/ dimsty)
O* K! j0 f; R+ o (setq dimsty (nth (atoi (get_tile "mod_style")) stlist)$ w9 {" U4 s' ]
dimlist (ddimen_getdimvars dimsty)
& d& N- Z& X4 B- W3 c )
: |4 m% h# C1 S, Y8 O dimsty
7 ?8 G# e" W* r8 Q" b )8 n0 V) u, k O& |7 q
1 k% L, N. w/ N- T2 A4 U7 ^' ]7 K' i
;;6 J1 j; i' y' c" U4 Z% m( E P9 g
;; Set dimvars
1 s+ H! e/ _" F6 p; ?7 U ;;4 [) C: B; V' y, m
(defun ddimen_setvars (dimsvcurset / dv i)
0 S# p& ?6 [* z( w5 a8 D5 F% ] (setq dv (cdr (nth 1 dimsvcurset)))
4 r" @+ v3 {& W r- l& F. g (command "_.dimstyle" "" dv)
3 z c8 R9 @/ a- k8 F7 {0 @9 p9 O (setq i 3)
5 G) P( d/ \. C! u (while (setq dv (nth i dimsvcurset))
9 ^! v+ ` D6 e6 W% d S2 o. S (progn$ ?9 k6 \, L2 m1 P
(setvar (car dv) (cdr dv))
, E, D. D3 O; [ (setq i (1+ i))' b0 P8 V, l( R' p
)
4 }3 {: `1 ]7 N )4 F* V+ k7 ?9 U8 `" A
)
8 D1 c5 e& P0 ]( U ;;' v) z5 r/ V! I- G' S# j
;; End-of-dimension5 `( M. e! L) g. y
;; ==================
( R. L: N: e0 a, o7 q7 n3 C7 b$ P7 p/ X, q/ r+ e0 [
;;
9 f& ?8 A% U2 s7 y* \* X ;; Sub-dialogues for properties. Common to all object dialogues
* ^$ b5 K6 B) |3 t/ N3 I* Q9 |( B9 y2 V% } ;;
( O9 h5 G8 T% Y3 {% O0 Z ;; This function pops a dialogue box consisting of a list box,image tile, and t' L' i0 T1 j1 s6 {0 g. h+ J* I' i
;; edit box to allow the user to select or type a color number. It returns+ @% y# Q0 r ~% [, n3 o: V6 s4 d
;; the color number selected.
" ~* D0 F. E0 C! x/ B$ L& q (defun getcolor (/ old-idx colorno cname lay_clr)
6 z3 `& G( F) @- f1 Q- u; ^ (if (= (get_tile "error") "")" b, K }& X8 `* B1 ~; G
(progn( U/ S" \* `4 y* s
;; Get the color associated with this object's layer, for use
0 S7 @) o: y: p3 L# ~0 ~ ;; in the color swatch if the user selects color BYLAYER.
8 W/ C5 u: S4 @! z (setq lay_clr (cdr (assoc 62 (tblsearch "layer" elayer))))5 C \1 p7 S# Y7 Q$ }0 ^# G% {
(if (numberp (setq temp_color (acad_colordlg ecolor T lay_clr)))
5 L( a$ B% X+ V8 N9 r (progn
+ r! V: K+ H% s; F( ` (setq ecolor temp_color)6 o, i P, K; ?
(setcolor)
5 ~3 p2 E1 D& ^4 e )
& Y8 U. k2 Q% ? (setq testcolor temp_color)
8 W6 H1 ^. _0 o0 F- m: B0 Y )0 P- y; M A& u1 F7 {
)
/ v/ z9 A, r% x u$ Y# k& H! b )
- l7 b: E9 J, Y% H1 t# u' h ecolor) N4 M" x: C$ w% [# k9 A8 A
)
1 o" X3 \% @' m ;;4 G# P0 Y# V- W# P; [0 ~& l y
;; Function to set the color tiles.- N8 e0 d6 P A B7 r" ?
(defun setcolor()$ G3 p- N/ o" ^- I* H9 |! w) ~
(cond
+ g+ H9 l3 m" u# u ((= 0 ecolor)
0 L5 I" B2 p1 e% G: z6 \ (set_tile "t_color" "BYBLOCK")8 e0 S& j3 K- E. N7 X' ^
(col_tile "show_image" 7 nil) ; show BYBLOCK as white
; o7 b; Q C8 u# F5 {& j& J ); R Y' ^0 `3 T, k6 r7 H
((= 1 ecolor)
7 c! v+ Z2 P/ y; n (set_tile "t_color" "1 red")
0 b( y+ i0 d4 g. C& P (col_tile "show_image" 1 nil); `7 h$ F6 p! I/ r) r
)
/ d; O0 d- h2 R1 k; U ((= 2 ecolor)8 G2 j3 x/ z! ~1 G2 ^# _
(set_tile "t_color" "2 yellow")
6 c% P; Y" C' ~ (col_tile "show_image" 2 nil)& L% a5 o5 y" x5 c& g- \/ P8 s
)
: J! Q0 P+ n: @' D! V ((= 3 ecolor)
7 A E) ?& Q* A9 ]6 ~8 r# a (set_tile "t_color" "3 green")) w! O M8 T# |9 P) e$ R% V
(col_tile "show_image" 3 nil)
% _% G3 g! v7 a )- k6 E5 G( Z7 Y* h6 {# ~
((= 4 ecolor)# Z }0 u( z F2 G" L* T8 p
(set_tile "t_color" "4 cyan"); k% ~ h% h% r3 T
(col_tile "show_image" 4 nil)9 v; `" j/ o& B
)# W9 b" p' m: B/ x% r% g" H) T
((= 5 ecolor)% ], b* S# _ E, x7 i
(set_tile "t_color" "5 blue")
/ J }- t! W3 {' Q: X3 s (col_tile "show_image" 5 nil)# c8 T$ q0 A+ A3 H
)
; C- B& @ p8 W3 V$ M; x4 B4 T ((= 6 ecolor)
3 b1 w. N+ p# p. j; q" e9 w (set_tile "t_color" "6 magenta"), `7 U. X4 A9 K Q
(col_tile "show_image" 6 nil)8 i, V# y$ w- S, e
)
$ Y6 l; q7 |$ r# a' _8 i ((= 7 ecolor)
. O% [( `$ p( G/ T (set_tile "t_color" "7 white")3 d/ c) U9 F9 _% |' U5 u, |
(col_tile "show_image" 7 nil)
3 c' V& D* w# F/ A Q )
+ V9 X" m) a6 r$ E+ x7 E2 I# D ((= 256 ecolor)
% _% k" B. |% I; j( Q (set_tile "t_color" "BYLAYER")
' y1 i+ {/ T! {/ m (col_tile "show_image" (bylayer_col) nil)) D8 o2 u9 i# m( C: r, f' e
)
) l' E' J: p' z/ O (T' a9 [# X7 W4 R/ H! H
(set_tile "t_color" (itoa ecolor))5 e9 I n6 P$ N' C
(col_tile "show_image" ecolor nil), `5 R# ~. r& z; @0 Z+ x) q' ~5 x
)4 l; E- v6 D8 w |; H( ?5 ]6 I8 h
)$ ] O( I4 S8 x$ W# n: L0 i
)
! }6 E* V, @# ?3 f( P' V! V ;;0 j$ |# M; E3 |4 a7 \7 Z$ _
;; This function pops a dialogue box consisting of a list box, image tile, and# S" g" M! Q% k! X: s
;; edit box to allow the user to select or type a linetype. It returns the
* }' [0 M* X2 s ;; linetype selected.
( L) j) A( {; Q+ A& h5 y* j V ;;
; b# ~8 @6 R3 V& W) O3 _$ z6 R (defun getltype (/ old-idx ltname)% q7 i1 Y* ?% ]2 k! \
(if (not lt-idx)/ |, i$ ]8 O( D6 g9 d
(progn( P, U/ r1 ^, @; ]) p$ G% M! q7 z
(make_lt_lists) ; linetype lists - ltnmlst, mdashlist% ?6 h4 M( q( n2 S: G
(cond
, X: o) z4 p( ?8 E6 u$ n ((= eltype "BYLAYER")) n+ h4 T% w+ n# z, y
(setq lt-idx (getindex "BYLAYER" ltnmlst)))
5 y5 I& X1 g3 { ((= eltype "BYBLOCK"): b4 r# F5 w; Y; L7 M
(setq lt-idx (getindex "BYBLOCK" ltnmlst))): B; ?# b" T0 ^) x# u
(T (setq lt-idx (getindex eltype ltnmlst)))5 B: b- N5 f! _- S& _9 c. J3 W6 [
)' r; m* y* _4 H$ S( R
)" G4 t8 n) Q2 q& t5 h
)3 D, p3 b5 M& c0 z) o
( T+ J- j# U" p4 N (if (= (get_tile "error") "")
+ ?9 e! s+ Y' V3 d" Y1 ~; i (progn
1 V4 R$ @7 g1 X- d k3 n' ] (if (not (new_dialog "setltype" dcl_id)) (exit))
3 E4 |4 \ [3 p# g2 D! ^3 B (start_list "list_lt")
8 f/ a( T k7 y {- p (mapcar 'add_list ltnmlst) ; initialize list box
2 [& a- D, t' |0 O (end_list)
& c9 n6 e, x0 D9 s3 Q6 g (setq old-idx lt-idx)
, f$ P) e! |% e9 g (ltlist_act (itoa lt-idx))- K$ n/ O" Y q5 g- w1 X2 M3 U
- m6 R+ r" q O/ C- Z5 Q+ `
(action_tile "list_lt" "(ltlist_act $value)")
9 i* N6 D8 s4 q* Z$ q (action_tile "edit_lt" "(ltedit_act $value)")1 @- o& _9 X' ?$ C7 R
(action_tile "accept" "(test_ok)")# O& x+ C1 M. _1 K+ k% D
(action_tile "cancel" "(reset_lt)")
) s. D/ k$ ~: J5 i' u3 \/ D: P, G6 d B. R( A0 G/ P
(if (= (start_dialog) 1) ; User pressed OK# E. n2 O$ {' e+ B2 ]' n
(cond u( h+ e, [! F8 r0 k# N- j' i0 A
((= lt-idx 0)8 B0 K' F$ Y: g# z; v
(set_tile "t_ltype" (bylayer_lt))- o/ h5 j( I. l5 q% O+ Z* I9 B8 a
"BYLAYER"
2 @& ]" h5 F5 a m/ b; L' m )3 ^1 A/ S/ D: ]- [) D/ j9 q
((= lt-idx 1)
4 A% R) B( N! O* N (set_tile "t_ltype" "BYBLOCK")
4 F8 b) x7 Z d$ t$ R0 V "BYBLOCK"! R( }2 G5 a( U- E
)
# o; {9 H6 n6 E/ B (T (set_tile "t_ltype" ltname) ltname)% X5 ?5 e& S) c- w# y- u, _3 E. f
)& \/ I' y2 u8 x8 g- ]& I( `
eltype
4 y" x0 m3 K! l5 u/ [* \9 S ). [4 {) X% g! G# T
)
0 n% m2 A1 v" g eltype
; S' S" ^% \6 V7 ^( L* P ): Y( w! F; Y' J0 B7 M* R
)& I6 R: n. Q N/ f+ o
;;, J" d0 @# }: J' ~' B; l
;; Edit box entries end up here
" b1 |/ l' U7 u! Z' q1 R (defun ltedit_act (ltvalue) x1 z% Z+ w1 ?: [' p# ~' P
(setq ltvalue (xstrcase ltvalue))
d* W7 x; G% y (if (or (= ltvalue "BYLAYER")9 f) [) ]) p. f; ]) [
(= ltvalue "BY LAYER"))
; h3 h* E+ v7 C8 _- p- p (setq ltvalue "BYLAYER")
, ^* D, U$ M0 n4 _ )
% v( y* Z* n% ^' M, L$ s (if (or (= ltvalue "BYBLOCK")
0 U: P/ t7 M6 K( k) ]3 j. j (= ltvalue "BY BLOCK"))
( k' I% Q. S5 e$ U (setq ltvalue "BYBLOCK")' d2 y6 ~6 z$ k C+ F9 Q
)
% b$ C' z. z; O3 K4 V (if (setq lt-idx (getindex ltvalue ltnmlst))
' R0 s9 T% U; _' r V (progn
) Y' B) I1 A4 _9 p (set_tile "error" "")
( V( U4 \- n( U) z( M; l (ltlist_act (itoa lt-idx))" G4 F9 ~7 Q* N8 Y& }6 ?# T
): `# R h: S3 r8 T% d4 c
(progn5 c$ _/ ^: P9 a- Z8 B. C8 S/ G+ o' a
(set_tile "error" "Invalid linetype."): q" e: a$ R& x" K" k
(setq lt-idx old-idx)
; i) z) X7 ]* g. w3 h;; (mode_tile "edit_lt" 2)% @7 z2 a5 G& k4 l6 G- w
;; (mode_tile "edit_lt" 3)
$ X1 O- R3 V" f' n1 H8 [ )
" t# T P2 y! ^ )
( R# b6 c A7 B )( t6 d1 x7 I- F3 S/ _
;;$ t" t5 {, j9 m3 Q) Z
;; List selections end up here. Update the list box, edit box, and color6 C2 k) V! _ j3 D" q0 v. o
;; tile.
' z: {, z& z' F5 ~/ t ;;8 n4 r7 M* Z- B5 V; z3 P$ `
(defun ltlist_act (index / dashdata)
, i0 B9 l) I$ R7 J$ N/ S (set_tile "error" "")
5 Z3 e t5 H- e" v! y. n6 O (setq lt-idx (atoi index))
% V' p8 d8 X% I+ N& x (setq ltname (nth lt-idx ltnmlst))" s2 \6 O- j0 I$ _: r$ x
(setq dashdata (nth lt-idx mdashlist))
! o, K* A- f/ z, m; P (col_tile "show_image" 0 dashdata). q6 C6 p l% |3 u/ l( O/ m
(set_tile "list_lt" (itoa lt-idx))/ v8 D9 E2 l% ]$ V
(set_tile "edit_lt" ltname)
5 d1 b$ @6 d' | )
8 k3 _' P3 m O+ {; c4 K8 _ ;;( y6 Z) G! G8 K: |& x' J
;; Reset to original linetype when cancel it selected
6 }7 E/ w% A y% s: p4 Y ;;- R8 G, C9 \9 R3 R; `
(defun reset_lt ()
, J. K+ Q7 W' g% Z (setq lt-idx old-idx)$ Y2 A0 a& v( a- c
(done_dialog 0)0 ~+ t) H2 u0 W4 m' j6 g) L4 B. T" d
)
- G, A* {7 u/ {3 U ;;6 A: K5 H8 x, S0 O& x4 v. i
;; This function pops a dialogue box consisting of a list box,image tile, and
* k7 q; l* C& p+ R" [% P$ g ;; edit box to allow the user to select or type a layer name. It returns the
4 D0 u; K- j g2 Q* n" ~$ b7 Y( Y3 e ;; layer name selected. It also has a button to find the status (On, Off,
( k) P, N* |5 e( ]; K. g' D0 a ;; Frozen, etc.) of any layer selected.
# \( J6 G) O$ ^- d4 I% E ;;- E4 u, u# B# x+ k- e; E
(defun getlayer (/ old-idx layname on off frozth linetype); [! c2 L1 k# J9 Q4 c- U6 P! N
;; Create layer list the first time the layer! r! U9 C" e: w. ~' G. Y2 ~
;; dialogue is called.
$ w& H( V0 {3 T4 o (if (not lay-idx)
& X9 @6 F5 S/ x- Y2 [4 E, e) m# a (progn
$ P4 h$ b) }" k2 N, J. e+ C (make_lay_lists)' M" E* a5 N1 H/ M/ Q! t. X
(setq lay-idx (getindex elayer laynmlst)): e' \! M6 e% i2 b
)2 z# M* O# D# B( @7 R' s
)
]( P9 _; ?8 O, T% @" S% o1 p. v" [: A
(if (= (get_tile "error") "")
1 A5 H0 E6 w3 J% n+ n% Q( d4 k (progn
) F8 X2 |: x, F2 [5 E( g (if (not (new_dialog "setlayer" dcl_id)) (exit))
8 V& ?2 E P4 h9 F9 _9 Y. e: k (set_tile "cur_layer" (getvar "clayer"))
4 g6 T3 G x: z- C5 C (start_list "list_lay"): [" ?9 g& Z8 @0 Y6 Z- n
(mapcar 'add_list laynmlst) ; initialize list box8 }: |2 |1 `/ x
(end_list): U8 b% o# t. n& u6 i5 G" ?
(setq old-idx lay-idx)+ C) {; F# r, Z; h! p- _- p1 `
(laylist_act (itoa lay-idx))2 N6 |9 `9 T" c$ r: l
(action_tile "list_lay" "(laylist_act $value)")
5 G. e4 b9 M7 j8 Q0 M/ c (action_tile "edit_lay" "(layedit_act $value)")! d! y" t5 Q- o b
(action_tile "accept" "(test_ok)")
+ H/ s: @* \4 d7 T! r: E) X (action_tile "cancel" "(reset_lay)")
: D5 Q6 K6 O) G; a (if (= (start_dialog) 1) ; User pressed OK
! u5 r# _1 m2 S5 ?3 x4 h (progn7 g% J7 k+ x. Y0 Z
(set_tile "t_layer" layname)0 X: y4 ?9 u9 _6 Z- k0 G, ]- b
(setq elayer layname)8 @* T( b1 e- C: x+ D" s# h
;; If layer equals bylayer reset color tile
% K! b2 Z1 Y9 G7 t$ q8 f9 S$ j/ ?9 { (if (= ecolor 256). u4 }0 W9 n& Z
(col_tile "show_image" (bylayer_col) nil)
+ ^! \% f4 a: Z2 w, @, t )
7 L8 I8 `7 \# s* l/ X layname7 \- w. O2 }( y( [0 y+ B
)
5 p- j& @" D2 b. D elayer
! H% t- B/ C: v( W/ s )2 A) y8 K, ~$ A+ z
)1 c* w& g+ ~ A' N4 e8 a
elayer* ] J; g; f" G0 B/ Z
)
) j' C/ r1 T# K; [6 ~9 |8 k ), N1 t$ z* |/ `
;;
! ^' y( E! l# {; I; ]3 t ;; Edit box selections end up here. Convert layer entry to upper case. If) E! {$ D& w( N
;; layer name is valid, clear error string, call (laylist_act) function.
9 C- K; H' X8 P P ;; Else print error message.: D1 f% _) A3 y8 Z0 H
;;
5 W3 Y# k4 _/ h& E" i1 ~% Q& { (defun layedit_act (layvalue)& I$ d2 p9 K( Z2 R0 V7 N# J+ |- ^
(setq layvalue (xstrcase layvalue))
5 m4 [9 y& [9 X& X6 O' y* b- \$ } (if (setq lay-idx (getindex layvalue laynmlst))' S# ]7 j7 I' a$ k! s1 j( t
(progn
8 ~8 I' L% T5 d0 U# ?: Y (set_tile "error" "")
' u# L: j3 r& Q. _& h4 a (laylist_act (itoa lay-idx))
7 w" T5 s" d; a& m2 [4 n )! I4 |7 y. ]4 t% e$ A- A: ?
(progn
! ~5 i6 |& P! q9 a0 x& k (set_tile "error" "Invalid layer name.")( u. s1 u: ~8 b1 ~# n! j
;; (mode_tile "edit_lay" 2)
3 |' v/ }5 F$ y+ ` n$ t6 [: E;; (mode_tile "edit_lay" 3)
' t5 p* w9 N; |2 a" i (setq lay-idx old-idx)
) g |' a1 `2 f$ m4 `9 B* O# B )
( f2 f1 [( K. } )
9 d# _1 [! R/ W. E; E! Y% {8 N )
! b* m- n& }: q) m, z ;;" ?7 `/ U; ~- S
;; List entry selections end up here.
# M* v/ Z' C( w- _ ;;
8 q+ n! T0 y+ B: p- \3 @) T. T& k, w (defun laylist_act (index / layinfo color dashdata)% ?) p+ U, ^9 Q" [& v
;; Update the list box, edit box, and color tile.& ]* j# [7 z5 J' y& l
(set_tile "error" "")
, P* [/ Z1 ^ S: l7 R (setq lay-idx (atoi index))! S4 h8 @' q" ^. `$ `
(setq layname (nth lay-idx laynmlst))
9 X+ u2 m) j" R (setq layinfo (tblsearch "layer" layname))- C# e3 q+ c# t3 u7 g
(setq color (cdr (assoc 62 layinfo)))
8 I* F5 z4 M$ u: a" J2 L5 Z (setq color (abs color))
7 B3 f' m/ n- r* E (setq colname (colorname color))1 `4 a) k$ n1 M- u" v% Y+ k
(set_tile "list_lay" (itoa lay-idx))' D" O, f" Q7 L% S0 ^& P
(set_tile "edit_lay" layname)+ {; D6 H/ u+ q% b* n& w7 n. ]
): N; ^$ x8 I5 V+ G+ L! t
;;
. V. x$ E2 {- e6 I ;; Reset to original layer when cancel is selected.( ^4 Z- |: [/ m& V$ \+ x. X
;;
" \' S9 z% I* M$ B# J$ F7 } (defun reset_lay ()
& Z) W9 B( j, Q5 O% n% Y: {; S# _* t (setq lay-idx old-idx)7 v' h% A7 _; n8 I
(done_dialog 0)
4 @, x% |2 s! T( Q0 ? )
$ a; w( I7 ], N+ ` ;;
# H7 B9 q$ [% z$ B ;; Checks validity of thickness from edit box.3 ~& d( M2 ?/ L, V1 G6 R
(defun getthickness (value)
4 B( ?2 K% m8 l) u (setq ethickness (verify_d "eb_thickness" value ethickness))5 ^/ k3 E. x$ g8 Y. I& t
)
0 O1 L6 ]4 R1 z5 F: @: q ;;+ d) ?: E9 k1 l! w5 r) q
;; Copy of (getthickness) for ltscale. If more, make this function
: o1 w+ \0 o# h ;; generic.
% Y6 y" {9 v" L' ] (defun getltscale (value)& m' m; b7 f; J9 o6 o `
(setq eltscale (verify_d "eb_ltscale" value eltscale))
, g6 X) c8 S- Z9 q0 A, v6 ^ )$ R6 O+ B6 a# `+ m: S
;;
2 [- p3 W- q( }/ s' J ;; This function makes a list called laynmlst which consists of all the layer' y; H& Y$ V2 c- P a
;; names in the drawing. It also creates a list called longlist which
& g; x6 h& y+ ~( u& e ;; consists of strings which contain the layer name, color, linetype, etc.
$ Y. Y9 P9 a% H2 Z9 P ;; Longlist is later mapped into the layer listbox. Both are ordered the
1 ]4 M$ U; B, d' }6 ~1 Q ;; same.7 S+ H$ ]8 _. y* r# _- ~
;;: L* p3 e9 h E( b0 |+ k
(defun make_lay_lists (/ layname sortlist name templist layer_number)8 p. U6 {1 g0 H( e
(setq sortlist nil)
2 H( J1 z# L' b* U (setq templist (tblnext "LAYER" T))
& L: O' c" x5 B8 \ C (setq layer_number 1)% p5 O/ }) y! O/ e9 R6 w
(while templist
* w6 O; d, `! w ;; No xref dependent layers, please.- k1 D5 p7 U7 o6 S
(if (/= (logand 16 (cdr (assoc 70 templist))) 16): r, W9 @5 g0 I( o6 F
(progn7 e& e' [- p0 F2 D" M4 }
(setq name (cdr (assoc 2 templist)))( r) r0 ]/ |/ X* a8 y& K
(setq sortlist (cons name sortlist))
. [, c, I5 O6 Q! z8 {% n5 l: e )
2 D: c+ e" h% M3 M )1 }, C0 R# l4 Y1 o
; Get the next layer." J) X3 j" v5 h3 j6 i7 x$ V/ x
(setq templist (tblnext "LAYER"))4 h3 l3 A/ c; F- P9 o) e& y
;; Not dead message...
' P/ L* v1 K5 ~& U7 o$ e; l (if (= (/ layer_number 50.0) (fix (/ layer_number 50.0)))$ Q) U& K$ R+ E1 R3 v. B
(set_tile "error" (strcat "Collecting..." (itoa layer_number))) G/ K) _ k+ y$ S* ?3 s' O; v0 L5 b
); r9 X" g8 @7 H, v# l7 e. @2 l
(setq layer_number (1+ layer_number))
$ J b3 H6 t/ W, @8 B5 F )1 [8 s- _& A+ t3 y- e4 G
(set_tile "error" "")
/ y2 B( m; q% g4 X) a3 z (if (>= (getvar "maxsort") (length sortlist))
* K( X0 R! X+ f8 @ (progn
, W# F$ q5 d2 X3 Z (if (> layer_number 50)! ~5 i4 O% k7 |6 Q+ P, e
(set_tile "error" "Sorting...")1 B( ]( L4 t% s& m v
)
; L/ q2 T3 Y4 P (setq sortlist (acad_strlsort sortlist))
% x0 m; ~) q8 ~) I0 Q8 S- } )
2 A& \! j+ s5 _0 |- \ (setq sortlist (reverse sortlist))
$ I, i8 J0 u" A- t# p )
' M& ?3 o/ n5 T, ?" R( l& B (set_tile "error" "")# d6 w; M5 M7 k& Q: d; z$ A$ f/ E; u
(setq laynmlst sortlist)
! }4 x8 N" Q( S) N+ H5 r6 W )
! G1 q+ B3 R: b/ i2 U D ;;
9 M9 ]3 M* }" O7 p( `& M ;; This function makes 2 list - ltnmlst & mdashlist.
+ H8 y8 k8 l o+ b ;; Ltnmlst is a list of linetype names read from the symbol table. Mdashlist5 `: \+ }5 m! R
;; is list consisting of lists which define the linetype pattern - numbers5 }" }9 ~# u8 X: K F" J9 X
;; that indicate dots, dashes, and spaces taken from group code 49. The list
, |( J5 I, z0 j9 t( G5 ? ;; corresponds to the order of names in ltnmlst.( _9 O$ N3 b" x; K; I5 P
;;* L9 f- w! n; P- A" w' o0 O$ `* |
(defun make_lt_lists (/ ltlist ltname)6 k7 u5 g; J; Y e% }
(setq mdashlist nil)
2 @* f9 J" f) | (setq sortlist nil)
$ }$ k; i0 P1 ^" g8 ` (setq ltype_number 1)" ]# V% L S0 t* o1 Y" }$ k4 d
(setq ltlist (tblnext "LTYPE" T))% K1 P& ~+ x0 c5 l- {: p
;;(setq ltname (cdr (assoc 2 ltlist))); i/ j& X7 }6 z n
;;(setq ltnmlst (list ltname))
* `* |/ V: F) P (while ltlist1 f1 { g/ o) f2 {3 U
;; No xref dependent linetypes, please.# a* m* k6 L: l9 m
(if (/= (logand 16 (cdr (assoc 70 ltlist))) 16)
) B. i$ f1 u; Y& D# Z. ` (progn
' B9 t) `1 q$ u! b" i; y* u- k2 @" q (setq ltname (cdr (assoc 2 ltlist))), K3 }7 f. Y- E0 H/ |( l4 o
(setq sortlist (cons ltname sortlist))
; v- x3 N, [6 z$ Z+ H )/ a4 T" Q; i, a x
); W/ U0 r- p- _. N, ^8 h
;; Get the next linetype.
9 R/ {; A- | `" R (setq ltlist (tblnext "LTYPE"))
. s3 [" Q; W& c, s( N7 ]2 i7 ~! x: s5 ~: F" U
;; Not dead message.../ r4 W5 ~# F! c" q. d
(if (= (/ ltype_number 50.0) (fix (/ ltype_number 50.0)))4 u4 z3 c% E1 j. y1 q& x
(set_tile "error" (strcat "Collecting..." (itoa ltype_number)))
5 D2 k1 B" T6 A3 Z )
, s0 F7 M( T9 K/ } (setq ltype_number (1+ ltype_number))
+ r+ d( e: I/ J( d! l1 z: y, j# @% Z$ V5 }
)/ U) q& q2 E" D6 L9 F7 e
% O. |# B2 X: {$ b
;; Remove Collecting message.4 `$ R9 I# D' b* x: u, y) e# n, u
(set_tile "error" ""); l+ q# Y7 ~! C" X( K- q# r
`, \6 i) [% C+ C; P* F) |$ h ;; Sort based on maxsort.9 c; }! P/ P! f: \/ \% M2 J' T
(if (>= (getvar "maxsort") (length sortlist))
; ^4 p3 W9 K; Y$ A; m (progn* m0 a8 j0 j0 c5 V
(if (> ltype_number 50)' L+ e7 n3 [9 b: l! ?
(set_tile "error" "Sorting...")/ g( k7 t( X8 T6 T$ q
)9 ~! o% o2 U, M6 G* P. a
(setq sortlist (acad_strlsort sortlist))+ k. f, g* h# s4 q
)
9 L9 B+ r# m [ (setq sortlist (reverse sortlist))- s" L1 ^. S5 _" O7 R( G: \! I
)
, H3 l: _( Q! q, r- [# Y/ Y4 R; w (set_tile "error" ""). {8 S" x# o3 A, t8 ~0 {
(setq ltnmlst sortlist); d0 o) U0 W0 e: z3 B0 Y2 S5 m
& C) V) y+ Y6 ^* S8 A- M! Y (foreach ltname ltnmlst: N* Y2 O7 f' _9 J9 G
(setq ltlist (tblsearch "LTYPE" ltname))
9 u. {. Z5 `, V* { (if (= ltname "CONTINUOUS")
5 [" `: r% E, U( U (setq mdashlist (append mdashlist (list "CONT")))
5 o4 J& D* @- \% f. v0 F4 q0 j (setq mdashlist
$ v. @) T1 D9 e* K; s* g) m$ w, O (append mdashlist (list (add_mdash ltlist)))2 p# B n5 |5 t% {
)+ v+ _( N$ f8 \0 o
)- z- F4 g, B' P1 _0 |
)/ @" T) N- ?0 h" D; \) f! V' E
(setq ltnmlst (cons "BYBLOCK" ltnmlst))3 g5 p& p8 d, r8 U2 h
(setq mdashlist (cons nil mdashlist))
+ p9 J' ]* K; l (setq ltnmlst (cons "BYLAYER" ltnmlst))
. g5 N& y; n1 O% F: b8 Y# z, n (setq mdashlist (cons nil mdashlist))" j4 S' S0 x3 R0 J2 M# n$ P, V) E
)
& G; r8 G+ O: z* I ;;
' i$ U, x7 T. \ ;; Get all the group code 49 values for a linetype and put them in a list- |" H' }" `. N0 n; c1 m) x6 B
;; (pen-up, pen-down info).4 X3 @1 y2 N7 z& D5 H$ [: q" ?
;;
O- G# ?, O5 F: D3 I0 v. R# e (defun add_mdash (ltlist1 / dashlist assoclist dashsize)
- P; y: x. _0 x) i9 x6 i8 T Q (setq dashlist nil)1 J0 w" X* U4 f
(while (setq assoclist (car ltlist1))4 E) S' |/ ~& r4 T# V, X7 X, ^
(if (= (car assoclist) 49)
: w* Z$ i0 G% G (progn# y& s' u% x! [) B
(setq dashsize (cdr assoclist))8 N; [/ Z9 K: F2 h
(setq dashlist (cons dashsize dashlist))& H6 M+ j5 k/ B# J
)- v# U {- w8 z/ `4 g. ~9 ~2 g8 S( M0 \
); U8 d7 j2 A3 n1 t
(setq ltlist1 (cdr ltlist1))% Y- M# E# C0 p$ N: [; j8 m
)4 X* z; t- Q1 T3 W$ S
(setq dashlist (reverse dashlist))
0 y. C4 Q! ?7 C9 |% |0 u3 F )+ W8 ~# Q6 H/ K
;;; |/ y+ z: V Q" _7 _
;; Color a tile, draw linetype, and draw a border around it
$ f; [, z6 E* c) f# @ ;;
- |% j* S% G% y% a. p (defun col_tile (tile color patlist / x y)
. j2 M, n# i8 H (setq x (dimx_tile tile))- j; w, e: O4 [ z
(setq y (dimy_tile tile))
3 v1 u9 r$ ?: n: r0 B (start_image tile); C) v) k; d, m2 k
(fill_image 0 0 x y color)
# l- F, H% ?" {7 z; q (if (= color 7)
: @3 Q- v0 z8 A' ^ A+ b (progn
/ b' ], E- V7 t G& A: G# x (if patlist (drawpattern x (/ y 2) patlist 0))% \! r7 U5 |- u- K8 s/ D
(tile_rect 0 0 x y 0)" e/ y" B5 G; A6 z( I) v8 J
)
: b0 O" I6 U: K$ N. f# e* O n (progn
6 r7 `1 y' ~: S3 t (if patlist (drawpattern x (/ y 2) patlist 7))
( ?5 _7 F! b8 |5 G) ~ (tile_rect 0 0 x y 7); |# e$ Y+ P4 Y, V% G ?
), B. n, [8 M3 {
)
1 M& J+ e# g& ^9 @: ]# J7 }0 V (end_image)
2 D2 n" p* {8 e$ _ )# W5 B, M( P5 E
;;* p8 P# [$ L0 t
;; Draw a border around a tile- h- l. Y) R5 s9 b$ [
;;
6 F1 E# c7 p* p; C4 t* e (defun tile_rect (x1 y1 x2 y2 color)
7 A$ X* ?3 r* |3 e9 i- @! M2 C. T (setq x2 (- x2 1))
* z8 z7 Z0 [7 Y& f/ ] T5 K (setq y2 (- y2 1))
$ u. C1 o8 Q: Z; [0 J) f/ R* H" W7 P (vector_image x1 y1 x2 y1 color)5 G* H8 @: G( \; n4 }+ k
(vector_image x2 y1 x2 y2 color)
" F5 q g0 t$ s7 W, \ (vector_image x2 y2 x1 y2 color)
[! P. z: J+ ~% r% R. g" `6 _ (vector_image x1 y2 x1 y1 color)! o X, h8 W& t
)- P, A- m5 E" M! r, d( v' T3 [
;;$ G/ h- {# A: E5 g/ w
;; Draw the linetype pattern in a tile. Boxlength is the length of the image# C* N& S- k5 }6 h8 Z3 v& x- p
;; tile, y2 is the midpoint of the height of the image tile, pattern is a+ ~) w; a: q6 r
;; list of numbers that define the linetype, and color is the color of the+ I' M* z1 Z+ M) R, _
;; tile./ Z4 r! C# _' ?7 J& x0 g8 w
;;8 K# d9 d' Z" |" ^$ P: m" a) L
(defun drawpattern (boxlength y2 pattern color / x1 x2
6 O, d6 @- D+ Q- [ patlist dash), ]3 h' S6 o+ ~
(setq x1 0 x2 0)
" x- j! [2 ]2 k1 A$ H" z (setq patlist pattern): o" l2 {( G2 x/ J: B' ?8 y R' U
(setq fx 30)/ @6 c r7 j. n, \- x) o6 e8 L
(if (= patlist "CONT")7 }* t# s+ w. }, z/ D+ ^
(progn (setq dash boxlength)
% w% `! {0 {2 f7 N* y# a2 o% r5 ^ (vi)
1 N, o# @# J5 E (setq x1 boxlength)1 W+ F: ]% }+ f5 h; m
)
: u' v7 r5 h# X$ D% N (foreach dash patlist' G) }4 s6 @& l M. |4 s
(if (> (abs dash) 2.5)
m" H. g/ O9 P$ a. H+ P (setq fx 2)
* _7 x# i5 z! K* L4 k )! U# z6 t3 c; J7 z" p% i! B( \3 l3 U. `
)
6 k* q8 C; ]# X/ ~ )
' \# x% V/ z4 j (while (< x1 boxlength)
! Y- w$ T' S) u# i- ^1 [ (if (setq dash (car patlist))
8 _; l5 n( D5 C H S8 p$ Q (progn( N* H9 Y7 q/ X9 j
(setq dash (fix (* fx dash)))
: L, W6 I7 I/ h+ O( Q1 v7 q (cond- ?7 s) L: g2 A, s
((= dash 0) (setq dash 1) (vi))
# R2 [4 F$ m2 D; ]6 N! ? ((> dash 0) (vi))* A' f8 z/ e$ J* R3 o, I
(T' t% J0 `9 L2 C+ l3 N
(if (< (abs dash) 2): k1 y! L8 F4 G, E$ _# |4 X, ~
(setq dash 2)
/ y2 q. U/ ^# H) l. I )
+ q1 f8 S Z8 c3 K3 g; o+ V (setq x2 (+ x2 (abs dash)))
; P& T" Y; T( m1 R0 Y )
) E) h, P- s0 c+ z+ E )- N$ @9 E6 F! j. b
(setq patlist (cdr patlist))
8 |0 W S' u1 T: ?, u) X" Z0 } (setq x1 x2)
' }4 d1 h' d' |: k+ c, d: Q4 Z& H& B )
1 F- L2 M0 |* H5 ~, l% z (setq patlist pattern)
$ |& d& E( V& j0 a" {3 C: L( a )
2 H Y6 N/ u7 P& u' l- Z8 m0 c )
* W0 P u1 k/ @* V4 A' I5 [# ^ )
f0 e5 R% D$ f& \" {: d ;;
/ _3 P: F& y( u' ]; C ;; Determain state of xclip3 G/ A" [# p+ p `4 I
;; Returns the group 71 value of the spacial filter dictionary.7 p9 L" F7 q: Y. F2 q/ \4 J
;; If the entity doesn't have a spacial filter dictionary, this& ^! \$ ]' M; `8 G
;; returns 0. If it does it will return 0 or 1 depending on the3 |( Z6 O- R8 @8 q$ S* H
;; current setting of the state of the clipping visibility. h, Z z+ w0 v% T' S7 A
;;. D6 r3 I) @! \8 c$ U
(defun xclipon(elist)
- w' G7 K- p# E2 u (setq hasclip T)
. F# x& w- M# t4 `9 G7 D4 Q7 i9 e (if (/= (assoc 360 elist) nil)
( c5 t% T \% Y, { (progn$ r+ w' [% |( |4 f- L4 M2 X
(setq tmp (entget(cdr(assoc 360 elist))))
- T4 z+ _3 K5 U! L (if (/= nil (assoc 360 tmp))# @0 u8 v6 [" R {' Y
(progn
" N K% \( W8 Z x6 i) @ (setq tmp (entget(cdr(assoc 360 tmp))))* s/ s D1 n( E
(if (/= nil (assoc 360 tmp))# c5 d* r% F/ Y$ c4 u5 N+ X
(progn
/ r: }2 A7 }9 t# n4 B9 {" Y (setq tmp (entget(cdr(assoc 360 tmp))))+ _; d4 e" g! l7 @8 ^+ ]
(if (/= nil (assoc 71 tmp))
: L! j3 ~% |8 Y9 _4 } (cdr(assoc 71 tmp))) L# C/ i0 S9 L0 i6 x5 [
(progn
& D) }' B" s3 m8 K0 [& P, F- Z (setq hasclip nil)
$ `$ Y/ r+ R- P$ r* t. P: F (eval 0)
1 ~- @2 L1 B! ^# L3 _ )
u* j5 ]/ {% B. {9 } m; y+ D )1 n" s* q# ]) B& w$ p \# N/ q
)
3 \) S& o3 ?: S8 N# y+ c+ d (progn ; V$ Z4 ?, \4 V6 S1 b6 k6 i
(setq hasclip nil)
6 c0 Q- c0 @% v" d& W* R4 d! Z" D, l (eval 0)
! I9 q3 ]! c( F, Q& C$ M$ @ )
7 w2 b# J9 K4 K! D% ?2 l )
. e7 @0 k; v- |) ~) v( X )3 \% [7 Z( r( `& u
(progn
3 I; ^' \/ a9 D! V (setq hasclip nil)
9 c9 S* x* X) G0 H (eval 0). K! s! a3 q( _
)# V* \+ f3 \+ @3 O- m
)
( r- t! \& `& \. h2 C )
5 \; e. b% t2 u! e0 J! Z (progn
: H e i" n3 {! I% U/ ~" [$ v9 m4 i (setq hasclip nil)9 ~$ k( |* A0 y# o' C* N
(eval 0). V7 `2 f2 ]+ J2 `& u/ n# U
)$ P" \; D* M3 y+ P
)
; i/ X- V! p. B5 I) o* G )
5 [& h6 L, J1 r8 F6 C) O$ G$ k' r ;;
6 p4 ]* d" p' \% H ;; Draw a dash or dot in image tile1 n5 Y5 T4 y! ~% t- ~
;;* }0 m( R" \. z
(defun vi ()
5 i$ T# s6 b. C8 w- x" | (setq x2 (+ x2 dash))
4 L# s u2 e) M" w2 u1 b+ g (vector_image x1 y2 x2 y2 color): i$ H* v3 ~/ ?9 B! b' [2 Y1 h
)* I2 ^; R+ d# G6 V5 [4 S
;;
) y& ^0 Y9 y! X8 U; C8 H ;; If an item is a member of the list, then return its index number, else
1 i. b0 p' } Z% [ ;; return nil.3 T- P" e/ P. A0 B
;;
' ^6 b6 c# o# g- n/ i: M( [; }+ g (defun getindex (item itemlist / m n)6 A& A% q7 }$ u& g( V! L8 P; t
(setq n (length itemlist))
& M" a/ ~2 k7 i# x5 a5 n5 l (if (> (setq m (length (member item itemlist))) 0)
! U* M( F5 c) o9 Z9 H2 `- t (- n m)7 g1 T' f0 [( I6 o6 v* w
nil
( n$ m/ K4 z8 i+ a4 e1 E, \/ b. d )0 }0 M3 M* f) ]+ H9 X& B2 A- L
)
7 q8 j6 G* M: p( R0 @. P ;;
8 @. m2 d: S+ f7 h/ G ;; This function is called if the linetype is set "BYLAYER". It finds the
# H% G) B1 [1 x: D ;; ltype of the layer so it can be displayed beside the linetype button.4 E% x4 O' j- q% T# Y! f
;;
- Y" p1 v& D; j5 J6 Y$ X% i (defun bylayer_lt (/ layname layinfo ltype)% x! l5 F; I& P% J0 f
(if lay-idx8 }/ L7 Q, x! d: O3 y" M; E
(progn
& L# j8 F6 u; V9 s; ?# j- ?0 M1 x (setq layname (nth lay-idx laynmlst))1 S, s& |$ b1 z8 D* k
(setq layinfo (tblsearch "layer" layname))
2 Q7 `, Z2 x) U& }5 C" S2 `8 _ (setq ltype (cdr (assoc 6 layinfo)))$ v: {$ M+ Q- z/ k1 K- x3 w, |
"BYLAYER"+ o4 V) @ l6 D4 s; q. f6 ~7 f
)
: p+ Z9 S$ _- @4 ^ "BYLAYER"
5 H2 g8 }6 ]% g0 |5 e6 ` )/ u7 _1 y6 T2 ]/ E" y$ E
)
% V8 x/ @, M% g2 ^ ;;6 W+ a+ R/ u6 |! Y" N9 N
;; This function is called if the color is set "BYLAYER". It finds the color
- i6 }- j, Q" H6 k0 J ;; of the layer so it can be displayed beside the color button.2 ?: m; h* M3 I- n: _* i6 h8 |3 b6 l
;;: a1 S, Z ^& }; }" I6 a
(defun bylayer_col (/ layname layinfo color)/ t# _/ y4 E2 Z6 F4 M8 M
(setq layinfo (tblsearch "layer" elayer))+ ~* e+ Z# [) s7 E9 i
(setq color (abs (cdr (assoc 62 layinfo))))
8 C' G- h, r+ f* P4 \ )
! v/ D9 S# [# t$ Z ;;. G- L- q, \# X- Q
;; Used to set the color name in layer subdialogue.0 f* P1 g' K- Y# D1 T% v9 D0 K
;;3 J. @ L9 l; d$ q
(defun colorname (colnum / cn)+ [; L8 B# O# i4 W5 F$ w. T
(setq cn (abs colnum))
/ ^+ M; F( Z. u$ ~3 P, s S, ?' J (cond ((= cn 1) "red")
1 g5 s! \# O+ t" d1 E ((= cn 2) "yellow")3 K& n1 O2 q) b( z7 s
((= cn 3) "green")& i3 }* M7 h0 l" ~8 T
((= cn 4) "cyan"); Q% @3 ^+ Y) c3 A4 H
((= cn 5) "blue")2 ?: L# n- v3 K, }) r
((= cn 6) "magenta")5 E4 T/ j* L$ j9 \
((= cn 7) "white")
: R2 x3 Y. B1 u# U# G0 j8 v (T (itoa cn))
1 K9 I. n4 F; f1 b3 B )) @, X' \% k, _8 [/ g
)
! N. W# ~! I8 @9 }& J( _9 [ ;;
- ^: U8 M$ H5 q ;; If their is no error message, then close the dialogue.
" k) Q8 \5 R4 s! q3 z { ;;
H( i8 k( ~6 Q: u8 D (defun dismiss_dialog (action)
) W' x% s$ [" _; g( @ (if (= action 0)3 w; Z3 l/ r) Z3 W
(done_dialog 0)9 h' Q( B. M9 y9 o5 b
(if (= (get_tile "error") "")
+ a5 p" n5 H. F6 D T6 j (done_dialog action)0 j+ b/ V) E' p4 A& Z
)
1 E: J* d8 J7 v& x )
, `; f; m5 P6 b9 J# n )
% ^; B+ P( G. o! [/ d; B% k' a% q; ~; J8 F" `1 G
(defun test_ok ()5 q* N) ~ f) |+ P8 X; f! X
(if (= (get_tile "error") "")2 S5 |# }$ j2 f& F9 c
(done_dialog 1)5 k$ L& S f2 O1 c
)
! ~7 J2 Z" N# c" {- g )* N4 O5 B. K L$ g
& N9 f. T# Q1 U (defun cancel ()
" o" D5 \# A& [$ Y (done_dialog 0)
) j! t) }' j5 h, }- A )
' m9 t/ O+ t* X" M9 j! P7 s- ^& Q6 F6 I5 w) k8 o
;;; =======================================================================
5 |+ m2 R( t( I- |; r. x;;; SETUP layer and linetype lists for application, and initialize all
/ Z/ y3 m2 G7 j. m6 u5 t;;; program variables.# p/ Q m$ G( q/ Q. c L3 m* |
. C) j% Q0 w2 { |8 o
(setq elist (entget ename)
, Z) z5 q+ ^/ k& i$ ^) R9 V old-elist elist
6 l f! a8 a# I5 x5 D9 |9 A modlist elist
! z" Q- z6 h9 ?$ F etype (strcase (cdr (assoc 0 elist)))8 X% M _( b+ C. A, x4 ^" J$ ~/ \
ecolor (cdr (assoc 62 elist))
8 i' [8 m" T- p2 ^% h+ G8 V! u! h: C elayer (cdr (assoc 8 elist))) ^, M* F/ V* I! P
eltscale (cdr (assoc 48 elist))
% O. j6 N" U) D* p5 _ ethickness (cdr (assoc 39 elist))
4 ^+ A4 I4 w+ U5 G ~ eltype (cdr (assoc 6 elist))7 N) k) h# }' `; @; k. `7 _
)
2 H& e5 z y, {1 S& v! x# M (if (= (assoc 210 elist) nil)
4 H0 |% I2 k' g4 a* I/ L5 ^ (setq extru (list 0.0 0.0 1.0))
( U2 J% B4 U4 N' q% ], v! y1 i4 s% x (setq extru (cdr (assoc 210 elist)))% r/ f) `' |% o6 Z8 }
), x: E, T8 B0 F" \7 t- f$ G$ X9 C, c: O
& E8 E# i# n' Z0 P (if (not ecolor) (setq ecolor 256))
% {% E$ r. N- z' [* d (if (not eltype) (setq eltype "BYLAYER"))
( c# n+ s: W# D" V9 s6 @ (if (not ethickness) (setq ethickness 0))+ }- z" g8 ? G. F
(if (not eltscale) (setq eltscale 1))
- j0 H, z4 }7 u! c& X5 S) ; end ddmodify_init" k4 T4 M) `# i( A$ U8 l8 O% `0 z
# U8 u [: h7 `;;; --------------------------------------------------------------------------- F, ~* O* M4 [. ~& d4 A
;;; Function: DDMODIFY_SELECT$ b, d7 R: q/ E
;;;
3 B2 X! x& z h;;; Object aquisition function.: a# v0 V) l# O
;;;/ u0 I% n: D* J7 X
;;; (ddmodify_select)
3 j. X7 S1 p L1 A, y;;;8 ~3 r0 R5 }) D5 n3 y
;;; Obtains object to be modified, in one of three ways:
" X2 j6 ]/ b5 P U;;;
( B4 m. u# B3 d;;; 1 - Autoselected.
; r: Z. s! q O; D3 i: ~0 ?;;; 2 - Prompted for.$ d. q$ o( O8 `
;;; 3 - Passed as an argument in a call to (ddmodify <ename> )
2 O. r% ]- @; L;;;
3 Z2 k. g5 n# P$ S2 y# R;;; The (ddmodify_select) function also sets the value of the
, I% g+ W3 c7 A. p! f, v;;; global symbol AI_SELTYPE to one of the above three values to! B0 b4 f2 c4 ~: B! d) g' Z
;;; indicate the method thru which the object was aquired.. B1 j: U' J" p; ~
;;;( l# b, ~3 h! W/ `, C4 } @
;;; This value can be useful to applications that want to RESTORE U- Z- T1 ]: s; X
;;; an object that was autoselected to its previous selected state% r/ _3 x& d2 ~* G9 d
;;; when they terminate, although there doesn't appear to be any
5 W( y$ b6 M) B+ ~;;; way to do this right now.
Y, q5 n& N6 p! [0 a4 J7 ^! T0 e! {9 H/ j7 d. `
(defun ddmodify_select (): A3 b' J9 T' \9 A( r3 C: x6 e7 t8 ^
(cond
1 k# k2 p3 \1 |6 { ( ename ; (ddmodify) was called& P1 j2 _: s8 A' I, s! x, {
(cond ; with an <ename> argument3 f/ n M& V% d& t5 I
( (entget ename) ; If object is non-deleted
; n* Y$ i3 C7 V. Q# c% H (setq ai_seltype 3) ; then return its ename.
" j" I/ ]9 R* H$ d! p1 G$ d1 { (ai_return ename))))
0 d; [3 C9 n4 p
+ T5 G' ~& l B" O ;; return auto-selected , see ai_utils.lsp* N7 P( j7 d' \
( (ai_autossget1 "\nSelect one object to modify: ")) ` i/ \1 I6 Y& N; I c* E- Y0 L
+ t; W! [" x2 Q2 ]0 N% K. I% m (t (princ "\nNothing selected.")+ A( P" c/ Y3 G% _! @2 b1 J& s6 U. i
(ai_return nil))+ ?; m% k& n! ?/ s X/ R
)7 i7 E% |& J x; D m# k$ n
)
Y# M7 ?+ J" O/ n
& d$ m) [9 Y1 h( e;;; ============= Command line interface function =======================6 ~0 p. z1 a" j S. G5 y& k; o
" P( F+ P, Y8 |- z$ f# {7 f
(defun C:MMO ()
% M% D+ R1 K( e (ddmodify nil)
3 a4 V( g- ^+ m% }* c! m; J (princ)* C+ a3 V; Z: A G3 P Q' r* g
)
% W9 U& H3 D! h ^- K# E8 F# v! e. o! K( J4 S! w. A
;;; ================== (ddmodify) - Main program ========================+ F! J9 h9 s! v. f8 x2 K2 \) j
;;;
( T. P5 R' q% u8 ]; s- Z' ^;;; (ddmodify <ename> )+ ?8 H7 j6 V: F1 }
;;;
8 J% d" d9 W3 d( d( b0 b# \;;; Main program function, callable as a subroutine.( I, m9 e4 l- ?! ^( G
;;;* T' `* c* A: \+ s: `1 a2 R
;;; <ename> = object name of the object to modify.4 z* ]3 E4 f8 O; z
;;;. T' h7 q: R {, S) @7 z
;;; If <ename> is nil, then user is prompted to select
) V6 H( u( d0 p- S$ Y' F9 P;;; the object interactively.- q% |* K$ ^$ z( ~2 E
;;;4 ?' d. B9 I& f& N/ X* C0 u% v% F
;;; Before (ddmodify) can be called as a subroutine, it must, s) s8 O- e. h X# M' h* `
;;; be loaded first. It is up to the calling application to
" ~3 _! B. m3 {;;; first determine this, and load it if necessary.
) p. L! u/ V6 ~) l0 B' t* ~; t6 V6 {3 M
3 x2 L/ q- r3 }; m) O3 V7 F(defun ddmodify (ename /
E! M* k! p( `- e: V. G2ndpt ell_calc_area move_pt1 templist0 t2 {9 C2 q9 u: N- {8 l& v8 X W
add_mdash ell_tile n tempmod
2 ]1 \5 I$ I% j9 P$ f$ @3 ialipt eltscale name tempst_ang2 }% K3 G7 ]/ p" j" g
ang eltype newpoint test_ok5 ]* G5 Z9 i/ s; o- z! x# Y. L
arc_calc emod next text
6 c$ K& p- {) i5 L9 I- Darclen end_ang next_vertex th-value
5 p. u; W9 c2 k# _/ uassoclist endpt obl tile
5 P _9 ]) l5 x3 g0 oatprompt errchk off tile_rect/ U1 s1 n) D( ?$ P
attag ethickness old_majrad tilemode
+ x6 x% F0 `6 Z8 `+ |3 s6 s" O' \attprompt etype old-closed totang
% ~ _& h0 k, G. ^3 A# H4 Obit extru old-closedm tstyle
0 d2 ?7 h( S- g* Pbit1 fchk old-closedn u
% _ o' W6 U& z: c) _. t& M+ |5 lbit-10 first-10-rec old-elist undo_init: i/ f9 r4 R G. J* t
bit-11 first-10-time olderr upsd# Q& H' F0 n6 A9 \2 C" {
bit2 first-11-rec old-fit v
* \% N6 e) `/ M5 n1 }: y# _6 L* cbit3 first-11-time old-idx va
8 O& H7 [& j# f0 R1 X. p5 C! o( F' H3 jbit4 fit oldlist value
" J/ E: X2 j$ p' _3 `4 B0 L, N; nbit70 frozth old-spltype ver_4
7 k( T( o# U, N& G1 z4 f& S+ Z1 Lbit-70 f-vis old-u ver_ang1
, e6 w5 Q* g# P# p. @7 Z. E; n( Cbit75 fx old-v ver_ang2
' A/ O( T: s0 M- L+ b; n. ]bk-up get_color on ver_col
! [: c: W8 r8 o# C4 g+ t7 p( kbkwd getcolor onoff ver_colsp
3 u' H9 [' @% m" e$ rboxlength getindex on-off ver_eangle
" s1 x t% P$ O6 p: @, dbylayer_col getlayer patlist ver_hght
, _& k9 V8 G2 G. mbylayer_lt getltype pattern ver_majrad2 I, e, u& K& ]6 P, |; i& L
calc getthickness pltype ver_obl" v- C' D: H7 N: O5 O8 U
cancel globals polytype ver_pt1
+ c" K. `8 m4 F7 Zcir_calc ha pre ver_pt2; i+ |8 u5 \# q, U
closed ha-prev proplist ver_pt3
. F# D5 I1 O3 m1 N, Lclosedm help_entry pt ver_pt4
% o9 r* z( o, O5 j. j0 zclosedn hght pt1 ver_rad
9 F0 F7 l) n6 v& s/ scmd icvp pt1_eq_pt2 ver_rot
$ J/ u# M* E( w) K: M4 Ucn image_add_vector pt2 ver_row6 h5 s: B2 e E) d
cname image_clean_variables pt3 ver_rowsp" _& i/ c a7 D9 h# l: s0 [% x
cntl-pt-indicator image_cross_product pt4 ver_tag
k+ W4 H1 M, }* a0 gcode_71 image_disp_opt ptype ver_u
3 D& b1 I E5 c5 y4 ^col_tile image_dot_product radius ver_v
8 A0 w2 t* E* U; i4 X! ^col-idx image_normalize_vector rational_spl_flag ver_wid( d2 j# v! W/ F. l; g8 j
colname image_rotate_vector reset ver_x1
3 t$ M: J3 ^6 c0 r" Hcolnmlst image_scale reset_flag ver_x2
! w; g; z( w6 `# Q/ }) wcolnolst image_scale_vector reset_lay ver_x36 h4 ?3 n. V, h* E/ r! k; W
colnum image_update reset_lt ver_x4/ E; n; _/ {, ?5 [
color index reset_uv ver_xline_pt17 t _: z( F$ |" ~
colorname inv rot ver_xline_pt2
% G" X7 G+ n& L* kcolorno item rows ver_xline_x1
! @2 K; E$ I: t) E [col-sp item1 row-sp ver_xline_x2
# [' t3 c. u& `# Icolumns item2 rrat ver_xline_y1+ U* ?5 U; w6 p! T: J" z. H
con itemlist s ver_xline_y2+ V, d; C9 K( H
coord jlist set_action_tiles ver_xline_z19 y2 p3 G0 n; [. c l* ^
ctr jlist_act set_just_idx ver_xline_z2
6 d" s$ _/ ~$ F T7 }cur-10-rec just-idx set_tile_bk-up ver_xscl+ v |; o. }; n5 j* t" l
cur-11-rec layedit_act set_tile_cntl_pt ver_y19 [/ v% W: v, Q- M1 ]' `( v
cvpname lay-idx set_tile_data_pt ver_y2, x$ W+ o5 _. J! }: A' n5 ?
dash layinfo set_tile_dirv ver_y3; t# B% }/ Q6 n, Q: x( U
dashdata laylist set_tile_edges ver_y4
1 H9 O9 I$ r1 S7 F+ fdashlist laylist_act set_tile_endang ver_yscl# Z" V$ a- t' c) |
dashsize layname set_tile_hght ver_z1
6 N J: ^$ w2 d$ C3 zdata-pt-indicator laynmlst set_tile_icvp ver_z2
& A1 r0 S; h+ wdcl_id layvalue set_tile_just ver_z3
8 y0 x* B$ Q9 k, {9 Odd3dface line_calc set_tile_obl ver_zscl
O( B5 E/ b4 R `, Q4 Vdd3dsolid linetype set_tile_prompt verify_a
9 H8 b# W* Q0 ]* Kddarc list1 set_tile_props verify_d/ l" n% t( ?% [- a: W
ddblock longlist set_tile_pt1 verify_i
! v, C- \1 u# G5 e% E- uddbody ltabstr set_tile_pt2 verify_xline
4 S% x% C5 {9 A1 C' ?8 dddcircle ltedit_act set_tile_pt3 vfy
: N% Z+ w: X& a4 P! q6 L; Sddellipse ltidx set_tile_pt4 vi( e e2 n. g7 x) N/ F" M
ddgetprompt lt-idx set_tile_rad vlist
& Z# h" q5 f2 {ddgettext ltlist set_tile_rc vname: b8 i' l( l! F" c
ddimage ltlist_act set_tile_rot vpf
i3 G4 U6 v5 [6 b& Jddimen ltlist1 set_tile_scale vpid
. E! T; Z+ o+ C5 m. ]ddleader ltname set_tile_spline_props vpldata' M' f0 [. N) ~0 J( ` t
ddline ltnmlst set_tile_stang vpn2 |; W# |; E( e# r0 X- l$ ]
ddlist ltvalue set_tile_style vpt
, O# r, n. M8 d/ tddmline ltype set_tile_tag which_tiles
+ [8 ?7 [% P' j# pddmodify_err m set_tile_text wid/ A9 X2 m, b8 ]& g" A
ddmtext majrad set_tile_vpt x6 j; p8 {! y2 X% a2 T1 K
ddpline make_lay_lists set_tile_wid x1" x3 h0 Z( e" G( J, A$ h' @6 r) H; i4 z
ddpoint make_lt_lists set_tile_xline_pt1 x2/ w* ^- a$ T: [/ {7 I* d9 w
ddray mdashlist set_tile_xline_pt2 x3
3 {7 }# w9 k1 o, F" cddregion minrad setcolor x4
( p# w( ^( @, x' D* Wddshape modify_3dface shght xdlist
3 v1 z$ x* [& D3 B5 O8 dddsolid modify_3dsolid showpt xline_pt12 a5 `1 M b. P
ddspline modify_arc size xline_pt2
8 Z# A" ^1 f) X+ b) o( Eddtext modify_block slist xline_x10 h' Y8 U5 h" s$ X" L, A8 W/ @+ @
ddvport modify_body sname xline_x2# k. Z% T* C& b1 |, o, I
ddxline modify_circle sortlist xline_y1
; z9 @# S7 G% R) N9 x( Sdenom modify_ellipse spltype xline_y2& ^' n$ t) k8 H' F- ]
dialog-state modify_image ss xline_z1
$ x, W2 B5 S& ?" ~$ V$ R3 a" Adir_pt modify_line st_ang xline_z2
& l" U: p3 }, @/ J2 d; o2 F6 [dir_ptx modify_mline stpt xscale9 O5 v' z, O1 G* k0 h" o6 { F
dir_pty modify_mtext style_act xx3 A+ G1 [5 s s7 V: @: Q
dir_ptz modify_point style-idx y. ^& e ~3 v0 P! Y5 \; M
dismiss_dialog modify_polyline style-list y1$ Q- f$ ?5 x/ v0 c* b; [5 F! R
drawpattern modify_prop_geom tagval y2
& g( M: A0 B' ?, {- Secho modify_properties temp y3
; ~+ Y3 W/ w8 T0 Aecolor modify_ray temp_color y41 ~5 p9 c# G1 W- }( e
edge1 modify_region temp_dir_x yscale! P1 @3 o- w+ ?3 v
edge2 modify_shape temp_dir_y yy
+ q1 M/ J7 P, f4 zedge3 modify_solid temp_dir_z z1
/ W& e& M' k, |* @0 uedge4 modify_spline temp_xline_pt1 z2
, v: [8 x: w: |0 J# C/ Nedgetest modify_text temp_xline_x1 z34 W7 v# T$ J( `( R* E+ x: J
elayer modify_vport temp_xline_y1 z4
! v- j F+ n4 ^0 jelist modify_xline temp_xline_z1 zscale
7 L# u7 O- n6 I9 qell_calc modlist tempend_eang zz* o% D3 d( g* ]! N) c
dir-idx safe_ddedit ver_MtextWidth xcliponoff+ N, @5 z7 z( a: u
MText_style
/ d X* G$ F% k7 X )
5 ?: s9 J& L- k; r5 P. d* d, q: P; h9 k* j* i0 y9 \
(setq old_cmd (getvar "cmdecho") ; save current setting of cmdecho0 x$ i" ~7 L3 o9 r: @, R! M2 G
old_error *error* ; save current error function! v3 S0 x1 y% |+ V8 n+ z, o
*error* ai_error ; new error function
4 I2 u* ]1 _) S0 X0 m9 m )2 F- z5 [/ Y/ L) C3 Q/ W" p9 ]
; H2 e1 X# p: |0 G2 z3 K; S0 O/ u (setq old_pickstyle (getvar "PICKSTYLE")) ; save old pickstyle, |$ }8 P( {1 |
(setq new_pickstyle (logand old_pickstyle (~ 1))) ; turn off group selection9 R- X* O1 b% S' B1 O6 C, Z
(setvar "pickstyle" new_pickstyle) ; bit and set to new value6 ~$ R: Z0 z$ E+ @/ \3 Z) g( [" Y
% Q2 Z# V$ A+ r) y8 `
(setvar "cmdecho" (cond ( (or (not *debug*) (zerop *debug*)) 0)* e G2 l* G' s: f
(t 1)))
# j! {( q' u% ?; C (cond) B8 a t& t9 \1 X; O1 ]
( (not (ai_notrans))) ; Not transparent?( K. L: U' E8 P+ x7 u" q6 i
( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
+ o4 D; w% o7 o2 R# X ( (not (setq dcl_id (ai_dcl "ddmodify")))) ; is .DLG file loaded?* [* B% e' c( Q8 x4 B
( (not (setq ename (ddmodify_select)))) ; object to modify?; Z- E% B% \5 \% x$ g: A/ P
8 y+ ]$ O6 j+ w0 ]( n
(t (ai_undo_push)
9 y8 X7 Y& A4 B6 G (ddmodify_init) ; everything okay, proceed.
' V+ O# z4 T5 Z# Y' C" ? (cond+ N. [+ e' w/ u
((= etype "LEADER")
. R) G7 \$ z9 V/ p (setq help_entry "modify_Leader_dialog"). a' {' B4 E2 u
(ddleader) F0 s) f+ S. p. L' R
)
+ i3 N% j$ c2 H+ P ((= etype "ARC")
! X* W) ?8 \% w2 C n (setq help_entry "modify_Arc_dialog")" |0 u$ B8 {! j
(ddarc)
9 ?, b0 R2 e$ R% W/ X [/ j )9 r. U2 O2 ~! A) Z
((= etype "ATTDEF")
/ P% G7 b$ r5 j& _. b (setq help_entry "modify_Attribute_Definition_dialog")
9 G8 {) H( H c& r3 p (ddtext)
8 ] i) A* x. z# j; u0 P v: i )4 x( Z; v+ d& |4 o S
((= etype "CIRCLE")9 z1 z( B. i( S. F. c# {4 @
(setq help_entry "modify_Circle_dialog")
/ G5 J |/ L0 d5 {+ r (ddcircle)
$ C: \& i1 _: ~* Y7 y )6 L* `, z, @0 A0 C
((= etype "ELLIPSE")
( t" O) t' l8 N! p (setq help_entry "modify_Ellipse_dialog")0 l- f4 Z. _# e& Y( y
(ddellipse)
4 a: j2 h# S% l7 u6 u )8 p* g) \' V: M% U
((= etype "3DSOLID")
5 O8 N. O" I2 L9 D (setq help_entry "modify_3d_Solid_dialog"); Q+ n* i# U) h+ l b) i
(dd3dsolid)
* ~+ t E5 k0 h+ H2 h' ? )
* A9 [ w" c6 t ((= etype "BODY")7 H+ O, V9 L6 S! \
(setq help_entry "modify_Body_dialog")
: S" j+ V: W/ Q8 C0 S, f* { (ddbody)
; e5 k8 p! G" D6 y* f) Q ) a# F- A3 A2 G
((= etype "REGION"). _6 j. @3 i- r' p( i; A% |& F+ i' [( o
(setq help_entry "modify_Region_dialog")8 @6 W2 M D- h& X, c0 N
(ddregion)
3 H3 g- Q8 y( E/ Y )
; L: C" {9 o& J' x- h# D- p# G ((= etype "HATCH")
" g' }2 \% r2 q6 y1 F' Y (setq help_entry "modify_Hatch_dialog")
7 \+ M5 u& K3 ?' G* y q (ddnewhatch)
1 `6 S; M4 v% X+ y# ^. n )0 u, b' J" k$ [6 L9 a
((= etype "SPLINE")0 t2 T$ m6 i# l' _: L8 c
(setq help_entry "modify_Spline_dialog")
) T! \1 u8 {' ]3 y (ddspline)
X1 [7 g+ h& V+ V )" a9 |0 M+ ~2 W
((= etype "INSERT") ; see ddblock for help_entry s% n3 p" m4 ]1 B
(ddblock) a& `+ p, d, U. O6 C" c
)
% @6 A& B [# m# G. { ((= etype "LINE")
6 c7 r4 {: P4 A* w' T% |. f! f3 V (setq help_entry "modify_Line_dialog")" ~* X, V; C! B
(ddline)8 E& E9 I5 \: K- T7 y/ R* D
)/ Z0 ?/ T5 l$ s" l
((= etype "MLINE")
6 n. B8 q7 O, l2 }+ _, t$ q (setq help_entry "modify_multiLine_dialog")
, y# n" D" }/ J$ y (ddmline)
; w3 F2 U% y5 p! [ )0 X9 Y3 y8 t2 b) P3 z2 L
((= etype "RAY")
4 H' q& i. N1 Q4 |3 R) W8 U" B z (setq help_entry "modify_Ray_dialog")3 v5 u7 F# H9 E6 [ t/ p5 S% t
(ddxline)
' u" |4 U+ _2 O$ i0 d) C )1 Z- `9 J- q$ L# }5 f+ g
((= etype "XLINE")7 s5 P7 x# Q% e0 R0 i0 {
(setq help_entry "modify_Xline_dialog")) X' e/ U& b2 e) Z- P% H7 H
(ddxline)
/ V; j! J4 \# R* O8 \: a )
d: j/ S( V5 H3 \ ((= etype "POINT")
$ s8 {. l; m8 d9 p! ^ (setq help_entry "modify_Point_dialog"): x0 w6 E" U* I
(ddpoint)' z) q; i. I% W4 _. F+ U$ d1 w
)" u& K- a' X2 }; C( s. G
((or (= etype "POLYLINE") (= etype "LWPOLYLINE"))
1 D( w* B/ N) M! F$ F9 Y; d (setq help_entry "modify_Polyline_dialog")& S! d+ _ `) C6 Q' t- D E/ m# Y
;; If a 2D pline, check to see if it is planar to the current
( l$ X0 E* o& A+ c, [. }) R, G- Y6 { ;; UCS, reject if not. To see if the pline is parallel,
2 N; R, j$ G: I' @& T8 M ;; the 210 group (WCS) is added to the current UCS origin (WCS)* l* k# |6 h2 `
;; and then converted to the current UCS and checked to see if- n# Q* n" x) j, |* ~8 _
;; it is equal to (0,0,1).
5 x! a# V2 B6 N& g% l
# |! T5 T: @% q& s( }3 G* v V0 }3 ~ ;; Incase the 210 is default and not in the dxf list.; T5 }+ E0 a3 v8 E: ~' n" M
(if (= (assoc 210 (entget ename)) nil)4 G9 s4 X; f: ?% e) i
(ddpline)3 b$ O1 y9 y- @- s( N3 Q
(progn
2 u+ R" i0 }; S+ { (if (and (zerop (logand 120 (cdr (assoc 70 (entget ename)))))
% p9 y5 F6 G+ G; G (not (equal '(0.0 0.0 1.0)& ^) B# |: ]' O2 e" o1 }2 w
(trans (mapcar '+4 [6 J5 x- P% y% q: _
(cdr (assoc 210 (entget ename)))* n1 D3 b# d0 Y5 ~
(trans '(0.0 0.0 0.0) 1 0), T' r* }+ O) L! R2 l6 @
)
$ |9 @' r9 r$ I 0 1
& \* T/ j) _! v' N6 `) m0 V )& j* g2 M* I s) q6 R7 Q
0.0000000001 ; fuzz
( X; g ~# n, J! r' H2 D9 V ); g/ [8 @, g5 a% B; n
)/ \- {+ x# e0 j0 o, ~4 o3 {
)
4 h; A3 {1 h/ r" s (princ "\nThe 2D Polyline is not parallel to the current UCS.")
- X: s4 x$ q* J6 c0 z1 t$ J" T (ddpline)
( P- y/ m ?' a, e4 N9 V )( z# V6 F4 {: A% T) S8 [' B
)& Y; Z7 `7 X' B2 g
)8 a" i) w q4 i: H L# X% o4 I0 B7 K( d1 K. R
)
- L& S/ I1 {4 H0 f( C* G5 |1 @4 b" U& ?; ~9 l1 z0 N/ |
((= etype "SHAPE"): E9 K/ m& u- q* F
(setq help_entry "modify_Shape_dialog") j6 g8 N H3 C$ h4 u
(ddshape)
( P6 W8 v" m$ M7 t! Z )- C9 c- `+ A0 c" Y0 g
((= etype "SOLID")
* [0 e, V- }' P6 D' {9 c2 |5 } (setq help_entry "modify_Solid_dialog")
, s# A) S8 @/ Z) S6 x (ddsolid)6 J. O5 F* B) p1 i. p& |
)
, `1 ]/ y/ \2 R0 |2 l4 w3 q ((= etype "TEXT")
. W5 E3 B: t% |/ W; w: ~% a (setq help_entry "modify_Text_dialog")
. ^. H, x- m$ s, _7 [ (ddtext)
5 { c: I! o: M; u )+ @7 N- X, w* o8 K. g9 T% j
((= etype "MTEXT")& [, F4 l; U' i$ P
(setq help_entry "modify_MText_dialog")
# w# X# C H; P( _( k) C3 X8 U (ddmtext)- d: o/ s- T% \! a8 ~8 J
)" X! ~: n9 `6 u \
((= etype "TRACE")* a5 o* i" D( j4 L* X: T& j
(setq help_entry "modify_Trace_dialog")7 t0 m; R6 y' T$ z& P
(ddsolid)9 k% y$ ~) j: R# l& [/ E
)
+ s& S4 e' N, C! `& R! y ((= etype "VIEWPORT")( _) v l# v2 B
(setq help_entry "modify_Viewport_dialog")9 k# u3 v" j$ c3 T
(ddvport)0 j3 J. u* p7 q) G* m! t
)+ V7 }& l% X# I% h: H# X6 y
((= etype "IMAGE")
) `8 }* a a. t5 [8 y, z2 c (setq help_entry "modify_Image_dialog")" J' M- p, p' `
(ddimage)
2 b" J7 x+ \# G3 R2 S6 C" i/ c ); Z2 @: c# N7 B2 l, Z- O
((= etype "3DFACE")& Y; o5 C# h" X2 u) l, C- i/ l5 w
(setq help_entry "modify_3D_Face_dialog") J- r6 R- k3 G: J: `; S: i
(dd3dface)
* C% O. L, c" f/ C& k) x) ? )4 l( w9 ]% C' v3 h; ^2 x C
((= etype "DIMENSION")
% g0 ^4 j) h3 r" C( M" T! h (setq help_entry "modify_Dimension_dialog")1 l4 ]6 A* J$ E
(ddimen)
% Q) s" `- U! ` )
% d, Z: I+ ~2 p4 j& n ((= etype "TOLERANCE")
0 R& B7 ^) Z6 P0 @2 P S; K (setq help_entry "modify_Tolerance_dialog")
# u! G% V8 [3 H7 b0 t1 j! B8 F$ u (ddtolerance)' m5 p' D/ V$ c! X3 |' o3 o2 c
)
( h- N& I+ n) c ]0 g: ?3 D;; Fall-through condition changed by MCAD for MDT 1.1 release.& O7 H7 g8 V& Q0 ^
;; This allows DDMODIFY to work on any custom object or any new object type8 p* h) P0 Z) ^# W4 f2 j
;; that isn't specifically handled above by calling the more generic DDCHPROP.
4 w: I$ x4 X# t% i, a: ]. Y (t3 W/ C' C; t- `9 w
(if (and (not ddchprop) (not (load "ddchprop" nil)))
( a% I4 c( f3 f H (princ (strcat "No dialog support for object type: " etype "."))), a# Y' I6 m, h' {/ j& ~
(progn
& B. v0 @1 A- E) f (setq tempss (ssadd ename))
3 d! q! c$ D; V" b2 M2 D. K8 |; N" c (ddchprop tempss)- a$ I5 _( G2 t
(setq tempss nil)3 a/ S n1 O5 w5 V9 @- v. j1 U. p! C
); w1 x' C; Z) [( o5 ~7 ?
)8 c, ^/ Q, N7 Z' V% H$ F- y3 G
)1 b F8 h0 t M# Q7 \
;; Previous fall-through condition. C9 |! o2 a. H; Q2 t
;; (t (princ (strcat "No dialog support for object type: "
2 X0 M4 W- b3 P2 k |;; etype "."
. s+ q' B( X& `;; )! Q0 ^+ O }, x7 G; m2 r3 `
;; )
% Z3 s) i* @. U, V;; )! B; u# F$ D m" p+ A, I; \# L
;; )
0 k* C! _* Z; E# T (ai_undo_pop)
- J- f2 U5 P: P. Q. K8 n- e )
" T) A$ b1 ^7 C, `% D )1 T ?0 [) H2 @% z3 H
" E3 T6 \0 E7 `- T8 [
(if (eq new_pickstyle (getvar "PICKSTYLE")) ; if user didn't change pickstyle
2 l' c1 H4 s% I/ I, \: D+ D (setvar "PICKSTYLE" old_pickstyle) ; transparently then set it back
9 K+ X* N* P2 \4 d# { e ) ; to what we started with7 p* B. w! l4 g8 O, E3 o
9 j& ~" U4 S0 o/ i (setq *error* old_error), V h0 z1 U- [; j
(setvar "cmdecho" old_cmd)
2 a& `" r, ?4 F) Z' G (if (not reset_flag) ; if object was modified, then
! d" ~0 u9 I7 g) w3 y. D. e (ai_return ename) ; return it's ename to caller( {3 c3 z$ P; f" I8 @
)3 E, _/ E. r* i; \% `
); d( u( ?/ V' K/ s' P' O- v& o
& J9 {3 v2 B+ I+ V, l0 e! p! n: Z
(defun checkForLockedLayer (ename)
# a+ A) o$ U% _ (setq layername (cdr (assoc 8 (cdr (entget ename)))))
2 L$ K2 L. A% B( F5 y/ Y( _- ^0 T' _ (setq layerflag (cdr (assoc 70 (tblsearch "LAYER" layername))))
+ I" x( v9 Q; P r ^, l" P (if (= layerflag 4)
# c, T& ]. G: N" a- C% h T
E! Y5 U6 T% ]( G3 H* h nil
' K" D' x! W6 B$ H2 G2 a6 \ )& ?4 C2 J3 d% J- [
)+ H+ r( l8 x; o' M, o
' F) r" A; Z0 s! F
(princ " DDMODIFY loaded. ")3 @( I+ q5 O& M* p
(princ)
6 a7 }2 @) G+ L1 X;;;???;;;---------------------------------------------------------------------------------------
% _' o2 _6 |% L, z8 A. z2 n0 _9 J, p, Z8 c5 o8 a
; Next available MSG number is 8 ! b: ~9 W! U" o5 o2 d
; MODULE_ID DDUCSP_LSP_
& _# w& l0 f2 V+ u E;;;4 P! ~5 Y+ }; ]: A
;;; dducsp.lsp
- E/ q# r' b( j0 s/ ~;;;2 S0 i" {' ^. b: l6 e: a
;;; Copyright 1992, 1994, 1996 by Autodesk, Inc.
& H" ^9 X m6 ~) c- Z, h5 M;;;0 e* y! K1 g/ v7 {
;;; Permission to use, copy, modify, and distribute this software1 |" o" h8 d* B( W! D, U+ J
;;; for any purpose and without fee is hereby granted, provided# f. |2 Z) k# s# B
;;; that the above copyright notice appears in all copies and% J9 G9 \! x1 o' s R
;;; that both that copyright notice and the limited warranty and- O$ C. L) [6 Q) b
;;; restricted rights notice below appear in all supporting( d+ O% H% k9 t1 x1 `
;;; documentation.
) o q# _- E+ J( i) w. I, i L7 `7 H;;;! a( b4 p3 Y% y( I+ s# h, s
;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
+ i, W- }1 A% p4 p2 G$ Q$ m6 p;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF* r* N9 ~/ g; l6 f
;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
4 T [1 z0 ]( k# p;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
. u7 T1 T0 o( s" ?+ R0 `;;; UNINTERRUPTED OR ERROR FREE.( s: f0 {; _9 K
;;;/ a, p' o! z0 K% L2 j' F
;;; Use, duplication, or disclosure by the U.S. Government is subject to$ h5 q( _8 l6 ?: e
;;; restrictions set forth in FAR 52.227-19 (Commercial Computer* W3 G5 \3 y9 D3 S) |2 X* @5 p) M0 A
;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
2 N' b T. y1 `; y4 U;;; (Rights in Technical Data and Computer Software), as applicable.) R8 J1 E8 Z: m4 Q D% ^$ b4 o
;;;
3 q4 p; Q* t% S1 ~;;;.# {0 y) _$ Y8 R+ F! ~/ E! R5 s
;;; C:DDUCSP - User Coordinate System presets dialogue.% \( b, U4 G7 K0 b' n+ w
;;;
0 n1 A$ Q3 T3 d+ T7 @; }; t;;; Uses DDUCSP.DCL for the dialogue definition. The- p9 R3 @9 c4 a) p
;;; slide images are in ACAD.SLB.+ ]. w/ C& W: j% G1 f
;;;
" G1 _9 z) X) `* t;;; ===========================================================================
8 T, `$ d6 S# y;;; ===================== load-time error checking ============================
+ w: j6 B+ B& O. |- q: c6 y;;;
# i h; H. k: W9 Q8 C. l* E X6 ]* x
& v+ H E! {' F% K (defun ai_abort (app msg)5 c% n3 D9 R! d( w" L" t
(defun *error* (s)
' G1 ?( r% Y; i (if old_error (setq *error* old_error))
- G; t$ _. m/ E3 ?) r! @. L$ w (princ)
5 B: u W0 K' q, g, c/ K )' `- ]# w5 X4 N0 _+ w: h
(if msg; l C; I1 b5 H. h9 F& Z+ c& t+ v* K
(alert (strcat " Application error: "& E b3 K& I* y' U% _3 U+ Z
app
9 U9 E! h2 O" G2 N' t0 s " \n\n "
$ x) ^# Y* R- o: ` m5 } msg
: A* g( [- D; m! c " \n"
2 B4 Z" ~% m2 N6 e" x ?) _ )
: }' V& X9 y% L )
7 U5 f1 A( J& H0 ]$ @, m )& H4 n( q3 L& y$ S d
(exit)
/ j! V. P) z; z# n! @* R8 l )
6 f% w- Q: c) ^0 s0 S0 A! w' v; @. o' R
;;; Check to see if AI_UTILS is loaded, If not, try to find it,
, q! W) X+ N( Z& a;;; and then try to load it.) ^, R6 E" I1 N. D1 I2 y5 u. p
;;;9 }/ q s3 C# x) Q8 c2 _6 v
;;; If it can't be found or it can't be loaded, then abort the
% T+ i2 |- R) ~+ |# y _ H$ o;;; loading of this file immediately, preserving the (autoload) I+ M- a% [0 n. ^$ p; s
;;; stub function.
( z& U. ~, y; C0 L. h1 d3 N' G) f. O; k5 d+ ]/ v
(cond3 o" ~: @! A c* R3 w2 |3 t
( (and ai_dcl (listp ai_dcl))) ; it's already loaded.; [- q2 \$ w- [/ G9 ^ ]
( U$ Y4 n. u F% Y# v" k- f. Y# K
( (not (findfile "ai_utils.lsp")) ; find it q2 m) i9 i# k- S, }" J
(ai_abort "DDUCSP"8 s/ [ h' k0 g7 ~9 {1 ~# E
(strcat "Can't locate file AI_UTILS.LSP.") ~; F( L7 ~" n7 J7 v# R; s
"\n Check support directory.")))
: a- n5 `* C( T+ K
8 }/ h1 ?- b6 T5 d% w, e! ~ ( (eq "failed" (load "ai_utils" "failed")) ; load it6 V6 o8 r1 F$ a: M% c
(ai_abort "DDUCSP" "Can't load file AI_UTILS.LSP"))
) Z9 c3 G4 Y6 X$ l ? v2 z( X3 k, A )
5 C2 W& L0 p5 ?$ T: p
% O! @" c0 Z* I8 N$ p: W0 G (if (not (ai_acadapp)) ; defined in AI_UTILS.LSP
3 ]8 _, b; h4 h5 J+ C- j% _# f- M5 X (ai_abort "DDUCSP" nil) ; a Nil <msg> supresses
' j2 c8 u1 \$ @; Y7 I ) ; ai_abort's alert box dialog.9 d2 b5 N& v0 H2 b% S& ]" ^3 Q
8 c# t3 E* T# C/ o& m, L' V; _;;; ==================== end load-time operations ===========================7 v5 j( k" O+ Y# I K; G& m
' {- r: M6 B6 b6 v+ U( R8 n/ H(defun ai_ucsp_start ( / program)# J7 ? X( S& }
;; Get program name
; M# ]8 y n# | (if (not (setq program (getvar "program")))% j5 m: i7 x/ y8 l- s* @' w
(setq program "acad")5 ~* H. K- s. }/ C% ]
)
3 f8 _/ v4 R; h& W* f. m: P# J- ^$ e3 r (foreach v0 '("world" "left" "cview" "top" "front"
# n0 q6 Y0 z4 Y9 |; f, N "bottom" "back" "right" "prev")3 ~# ~7 E: P' ~& a
(start_image (strcat "ucsp_" v0))8 ~8 F! Z1 Z% w& b$ q
(slide_image
1 M; b, c2 O9 y4 O1 u- N 0 0
( ^. s- H! r; }( v1 i3 W (- (dimx_tile (strcat "ucsp_" v0)) 1) (- (dimy_tile (strcat "ucsp_" v0)) 1)
% _, Y. ~1 r2 \' X" Y0 a3 V+ p (strcat program "(u-" v0 ")")
- _8 [9 C, c0 ^) U* q/ r )1 G1 e; ?& r% `8 t" M2 g8 y, {
(end_image)4 [2 b" B7 C9 N/ [
)# [9 |* G3 E& m# Y% }
)
" U3 O9 @5 a; Q
9 F5 X7 ]5 o* W(defun ai_ucsp_set ()
* V; ~2 W0 d+ Z$ h, t6 ` (if ai_ucsp_sv8 d9 E3 |& O: ~) X; t; H$ k ]
(command "_.UCS" "_V")
2 H9 K+ z) J+ ^ A (if ai_ucsp_prevs2 p- W& e, ^" @) S5 L
(command "_.UCS" "_P")
) T9 V% U7 f C/ h* N1 A (if ai_ucsp_chg
& b0 `# N6 j/ l4 y' L7 z. k, @ (progn9 P+ _) I' K- A6 i/ c4 Q o
(if (/= ai_ucsp_a "*")
. c8 G( t! s D% \( R! g' A0 e* @ (setvar "LASTPOINT" (trans (getvar "UCSORG") 0 1))
3 ^/ x( {0 M* @ )0 g, d7 C# h5 O0 ^! Z- @% B
(if (< ai_ucsp_pick 6)
" i) }! M' y! | (setq ai_ucsp_set0 "@")
" Y7 t: p$ B* Z: o (setq ai_ucsp_set0 "*0,0,0" ai_ucsp_a "*")& E5 v$ z. X. I6 s+ V
)
/ u2 ^( u. s9 Y6 {1 `; N (cond ((= ai_ucsp_pick 0)
9 \2 K2 G" ~5 P' j) C& y (setq ai_ucsp_set1 "0,-1,0"( K/ j$ S4 ?; w2 D6 ]3 p1 Z
ai_ucsp_set2 "0,0,1"
. T& _; _! r" \5 o# v# i )
6 g! F7 s! f, n1 ?' a- O0 S )+ W5 s2 ?3 j$ h
((= ai_ucsp_pick 2)/ ~. \2 e* i3 M9 @5 g
(setq ai_ucsp_set1 "1,0,0"
+ H3 A5 s6 | L# Z, A ai_ucsp_set2 "0,0,1"5 @+ I& f1 Q6 ~1 _, S) G
)
4 G7 T' ~" F$ T! \ l* k5 f )
' a- g. T) B7 Q: ?* L ((= ai_ucsp_pick 3)
n! \0 D ^- N/ t7 r (setq ai_ucsp_set1 "1,0,0"
9 {5 V) q' | c* a ai_ucsp_set2 "0,-1,0"
! {7 p6 ] h4 f& `& f- T9 T9 z )
2 r% [' j3 {! u* a% B )
0 T6 R% {6 V5 M3 A ((= ai_ucsp_pick 4)
7 V0 }# Y8 n% J; [. ~ (setq ai_ucsp_set1 "-1,0,0"6 U; m" h9 q$ ]% P
ai_ucsp_set2 "0,0,1"+ W: m" s6 u+ r3 B; b6 w1 d/ a
): ^2 W# E" [0 t7 n6 c$ n9 F/ h
): C- X$ m( B0 j) A2 j
((= ai_ucsp_pick 5)( K% ~% r: P$ [
(setq ai_ucsp_set1 "0,1,0"
" }( S6 \ X: d: s# Y ai_ucsp_set2 "0,0,1"
) L1 k- R; S0 |8 p/ R, N1 M' y ); q+ x. i( m9 K+ I9 _
)0 V% c' o3 m. W! k# A( C9 e$ {
(T
# z1 E5 `% y2 |% c! ] (setq ai_ucsp_set1 "1,0,0"; a$ X2 B+ O6 x
ai_ucsp_set2 "0,1,0"
, K7 L+ U9 I, ] )' ~, U1 X; C* s6 h+ [. Z {
)
; U2 I2 T3 q: v& H. F# n) j )
1 c# @4 J$ a- Z4 t (command "_.UCS" "_3P" ai_ucsp_set0
: V9 c8 z/ N8 j; N& M (strcat ai_ucsp_a ai_ucsp_set1)
5 f( h3 L7 D4 O% b7 T (strcat ai_ucsp_a ai_ucsp_set2)# @* }# l+ `& j- L
) 9 S6 H& f: s+ b
)
) ]4 V' x2 |! |& v3 e, t )- R; y8 E8 m- N1 R+ m
)
( A s$ d& ^* S )% X4 j) X* Z ]7 u6 H, `
)- R2 Q# C D7 U3 {
2 j3 ? p7 ?5 Z) Q7 o2 R2 {5 s(defun ai_ucsp_p (val currtile)
+ T0 K# j, H3 h5 p' a. p: } (mode_tile ai_ucsp_currtile 4)
/ b2 B; X. L% l (setq ai_ucsp_pick val" V' Y; W! _; W3 o
ai_ucsp_sv nil+ H' I6 B7 L; {: H" Z4 K
ai_ucsp_currtile currtile1 s7 x5 Z2 q3 c2 {8 L3 e; K
)
/ K7 l2 J X: N+ Y: ?9 ^" V/ P (if (/= val 1)
$ ~/ \: T+ u( [* p. x. i5 x (setq ai_ucsp_chg T)
: B4 `6 T& z$ W0 U4 Y )
8 W2 }/ o- s: t) p+ T (mode_tile ai_ucsp_currtile 4)- f' m$ j5 o( o/ y8 p
)" {2 d2 @3 A9 e& M+ G0 X
7 m( e* q8 i' U+ G0 i
(defun ai_ucsp_swcs ()6 j2 x; z2 F7 b- P T/ f5 \# K% s. O
(mode_tile ai_ucsp_currtile 4)% i; ]; D- F: N0 j* w r5 I
(set_tile "ucsp_a_wcs" "1")
) j, B9 ~4 h* x" S* h$ g) A (setq ai_ucsp_pick 63 l+ U% U& J3 a$ _& J
ai_ucsp_sv nil
6 i$ Y8 M% [" ?8 I5 j4 _ ai_ucsp_currtile "ucsp_world"; S9 f f9 {: T# L3 P
)2 f( w S, O9 I
(if (/= 1 (getvar "WORLDUCS"))" n& r9 V1 E1 V/ T3 y, |" U& R
(setq ai_ucsp_chg T)
- o2 P" ?* [$ }. b (setq ai_ucsp_chg nil)
6 o9 }( d& J3 z) X )( C4 _! s9 c0 j$ _3 k" m7 l
(mode_tile ai_ucsp_currtile 4)% \% d! v! F+ [/ e! r1 R# a: i
)
5 ^, ^6 ?- w {+ v1 u
4 ~8 s$ V- P7 w7 `9 U9 R(defun ai_ucsp_cview ()& h {/ Z( `# \1 e
(mode_tile ai_ucsp_currtile 4); |/ r: V3 ]. v5 O5 z6 z9 U
(setq ai_ucsp_sv T
3 X2 X8 u5 z) k& Y, L ai_ucsp_chg nil U8 Y6 N, ~+ h/ o' j
ai_ucsp_currtile "ucsp_cview"3 X( C5 j, ~9 t: M x+ i; s' D
)
5 ^ D" B. I3 X8 ` (set_tile "ucsp_a_wcs" "1")
3 ~! g# J) b$ Y (mode_tile ai_ucsp_currtile 4)
- L6 d+ e( S* r+ |9 \, {' p" I)3 F3 t+ L# c6 u# @3 I1 ^
* n7 M+ ~! d: v- p(defun ai_ucsp_rucs (typ)
. V$ G, x; v$ ]/ }9 c3 @7 N (setq ai_ucsp_a typ)
5 n& P4 K0 k; B r0 g3 ` (mode_tile ai_ucsp_currtile 2)( \: ~9 L; P b6 y+ f8 H1 e$ j
)
& M1 J3 m& i3 K' S3 s3 A
* s6 f) ]7 ^ l5 A3 ? i$ z+ _! w(defun ai_ucsp_prev ()
3 }0 u! q |4 G( _ A! n (mode_tile ai_ucsp_currtile 4)
: D0 r9 ]! q U* y! D (setq ai_ucsp_prevs T1 Z/ S( L( O) S7 t3 ~: }5 u4 ?3 V
ai_ucsp_currtile "ucsp_prev"
2 b$ S9 B. g$ T0 s1 }2 V )
I( @/ h- Z N5 o (mode_tile ai_ucsp_currtile 4)
2 t- [5 i( Q+ `) Y)
4 Q) q* d; z/ C. K7 v3 F5 f: g7 j* N7 M3 k
(defun ai_ucsp_main ( / ai_ucsp_pick ai_ucsp_sv globals)) o6 I7 F6 ~' o: c
(if (not (new_dialog "dducsp" dcl_id))% L9 p+ Z/ I; j+ ~+ R" @
(exit); X) c* F8 u; {; j: ^/ a
)
6 V" X* j/ C# U3 @) j w+ |
. r' t2 W. T2 M; F" Q (ai_ucsp_start)9 x. O3 V# m7 ?
(setq ai_ucsp_a "@" + [" o" \/ O0 W: E
ai_ucsp_pick 26 a) n. U) y! i; I$ _, @2 `
ai_ucsp_currtile "ucsp_top"$ ^; l K' J2 C3 _# K. c
): ~2 p) _. k( F' ]
(if (= 1 (getvar "WORLDUCS"))
2 |- {4 Y8 c: Y; N9 E (progn2 k! y" ?8 |4 t1 n2 B
(set_tile "ucsp_a_wcs" "1"). R: z: l! E( L% s$ e
(setq ai_ucsp_currtile "ucsp_world")
: K, Q- Q K' q" Q$ \ )
/ b& j( Q: w. X- t" C* W (set_tile "ucsp_r_ucs" "1")
4 ?& v: r3 J+ C8 X w ) _: t- J L5 t8 ^7 {
(mode_tile ai_ucsp_currtile 2)0 Y C5 M* t6 \% O) x# I9 C; Z+ h
(mode_tile ai_ucsp_currtile 4)+ ^% K8 t' l9 j1 A
(action_tile "ucsp_world" "(ai_ucsp_swcs)")
* q# @7 Y( |$ N# Q1 [9 _1 `: E (action_tile "ucsp_cview" "(ai_ucsp_cview)")+ b% z8 d4 a4 {: h6 Q) v( u; J& Z1 o
(action_tile "ucsp_left" "(ai_ucsp_p 0 $key)")
4 |; V! v! T" }, W (action_tile "ucsp_top" "(ai_ucsp_p 1 $key)")
6 Z/ b% c& j9 F: `$ U (action_tile "ucsp_front" "(ai_ucsp_p 2 $key)")
% g& s% _2 x8 i (action_tile "ucsp_bottom" "(ai_ucsp_p 3 $key)")3 m# n3 w6 c- e7 V
(action_tile "ucsp_back" "(ai_ucsp_p 4 $key)"), j+ F# L, ]8 n
(action_tile "ucsp_right" "(ai_ucsp_p 5 $key)")3 [0 X6 c1 [( a
(action_tile "ucsp_prev" "(ai_ucsp_prev)")
& z. N' h6 k; w( W (action_tile "ucsp_r_ucs" "(ai_ucsp_rucs \"@\")")
0 d% B& r9 l( n) e, E (action_tile "ucsp_a_wcs" "(ai_ucsp_rucs \"*\")"); f3 w) ^$ Q0 n6 |( p% S
(action_tile "accept" "(done_dialog 1)")3 H! w7 Q8 n' Q t6 V2 r
(action_tile "cancel" "(done_dialog 0)")3 s8 L! _; ^& ?% a5 a1 r
(action_tile "help" "(help \"\" \"DDUCSP\")")7 P# t/ f0 C- w" m% r$ B0 c
(if (= (start_dialog) 1)
. U, o e( j) c3 C1 [ (ai_ucsp_set)
8 c7 m! Y1 T8 G1 @5 G) L. P% e) [; y )8 i. @3 B/ k9 z. K6 y4 l2 ^
)
: J2 Z' n3 T4 D. Q2 g* Q6 {# ~6 s/ G2 Q. F E
(defun c:UUS ( / app dcl_id old_cmd old_osmode ai_ucsp_prevs
; v% K& g& X; z. G3 J4 `7 R ai_ucsp_sw undo_init)
: s! w Z. m7 p, R3 ^, z" V8 N% D: N
;; Set up error function.2 S. o( ~" O* C' }
(setq old_cmd (getvar "CMDECHO") ; save current setting of cmdecho
+ \# j8 I7 G, { old_error *error* ; save current error function) c3 Z/ w9 \5 m% x* h( {) l
*error* ai_error ; new error function7 W; l- f$ s+ ~; H; _
old_osmode (getvar "OSMODE") ; disable OSNAP for duration5 t8 S, O, R) Y( K7 [' @$ g
)9 x" P }2 B0 C! K
$ Q, u" H! P6 i' |# d0 I7 h& K' [3 ]( w
(setvar "CMDECHO" 0)
% V- N% k/ k3 X' Q0 F! E$ }
8 k+ Y. { i! v" ~; w! A (cond
' E& v6 _% j/ `7 P2 P ( (not (ai_notrans))) ; transparent not OK$ s }0 b; {; @& t5 L7 l
( (not (ai_acadapp))) ; ACADAPP.EXP xloaded? V& N' ^( Q N: i2 @7 b
( (not (setq dcl_id (ai_dcl "dducsp")))) ; is .DCL file loaded?
3 j9 G4 C% A7 Q( h3 m (T (ai_undo_push). Y8 P$ l* t- j6 D
(setvar "OSMODE" 0)
9 i" ?2 h$ N! n& s2 s9 s) v2 Q% q (ai_ucsp_main)2 U9 o1 U/ C; p# t% Y+ N0 D0 T6 R
(setvar "OSMODE" old_osmode)
+ v# j7 e8 a, Q7 V' r (ai_undo_pop)
2 ?) h: y g- }& {0 O )2 ]$ _7 J" ], D( ~; s
)1 s7 a. g! S* ^4 Q
2 Q) M4 G+ m" W8 r3 y (setq *error* old_error)
5 C0 C$ G( q+ [; ]( B (setvar "cmdecho" old_cmd)
3 S; l) x' t$ B1 |* s4 ]3 P; _, H+ N5 U
(princ)3 R( _% d# f$ X6 N
)
9 |( B- p+ X1 u' w6 [$ q4 q3 j, C s, H8 [. |
(princ " DDUCSP loaded. ")
# f6 q) g( J0 M2 [7 b5 S(princ)
0 e2 z2 J- p R8 \) @4 e& F* C$ ?0 N; ^+ ]
;;;???;;;---------------------------------------------------------------------------------------, ^* ^ S5 `7 D- j$ j+ Y4 z, Q' ~- I
6 o, W* |" z% f4 @2 x5 a, U% H;;;----------------------------------------------------------------------------- n' n. [3 b n4 H3 b; X
;;;
5 o! C( `7 _( d: O) e) T;;; EXCHPROP.LSP : f( m3 I) ?% S- a" F2 ?7 K
;;; Polyline and text modification capabilities added by ) U* r/ Q) p2 P3 k/ ]% B+ z( f$ G
;;; Randy Kintzley % g; E9 V0 G7 y/ k/ b
;;; ; W2 \% `' f- b+ |( d
;;; Copyright (C) 1997 by Autodesk, Inc.8 g: m2 R: u- k0 ` k1 K' W
;;;
& ?; }4 ] [$ j$ f M6 o$ I;;; Permission to use, copy, modify, and distribute this software& z) `3 m5 `) B7 Q3 K: _5 p# I$ h
;;; for any purpose and without fee is hereby granted, provided3 |9 W) _2 a7 O' W3 O
;;; that the above copyright notice appears in all copies and, m; t5 W% y% v$ z b1 S6 M
;;; that both that copyright notice and the limited warranty and
# }* u4 R$ p# b3 k8 H9 w0 N# Y* U7 O1 };;; restricted rights notice below appear in all supporting% _9 o- W0 C' p: G
;;; documentation.
j1 r. V0 a: }8 G8 @) K* p1 k;;;
8 M4 ]; T( K( G3 D0 };;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
% ^( C4 I) l; F! C" @: x! P# i;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
7 t% N) E4 g+ I7 Z! ]; n;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.# N" r. n8 x, e1 r; g; K
;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
. Q4 [" m$ q/ q; A0 X; z;;; UNINTERRUPTED OR ERROR FREE.5 W) T1 [, ^1 G) Z
;;;3 ^8 Y7 h+ q# e( R0 V
;;; Use, duplication, or disclosure by the U.S. Government is subject to
- L7 l0 B( n6 a0 e- h+ q;;; restrictions set forth in FAR 52.227-19 (Commercial Computer4 ]# K! Y& @* T3 ^* o, M
;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii), J) q" Q x" T I6 I) D+ l
;;; (Rights in Technical Data and Computer Software), as applicable.6 y# R( n2 N s, ~
;;;: X/ h& b* Q# X$ ]
;;;.
* c" x) P* R5 ]% N) I;;; 28 February 1997
$ G: p. ^ E) ]9 p, s2 [; P! P;;;
" B' p5 I0 F' m! \* `6 a& };;;
: \" o; t) W, E: Z: ];;;----------------------------------------------------------------------------2 I( W- a& `5 N$ f
;;; DESCRIPTION3 F# u" g0 k! o$ F( i7 S
;;;----------------------------------------------------------------------------' Q$ U9 x4 M+ }1 j: \
;;; C:EXCHPROP is an extended or enhanced version of ddchprop. This
+ [+ k. U+ V7 G, B/ w, a;;; command gives the user the abilitie to change several characteristics 0 {( k3 A2 w0 J) @1 H
;;; of selected polyline and text objects.
5 D* ~2 J) [) Y) x& T3 Z9 H;;; The style and height of selectected text objects can be modified : \2 S! g3 |$ ^2 \% O8 J
;;; (including text, mtext and attribute definitions) as well as, width and . J- e4 j3 g$ V
;;; elevation characteristics of selected polylines (includes lightweight and
4 K- B) t& s' @% s: m;;; traditional polylines.)
$ z2 o& y; l* l# X" X5 s$ F/ J1 O$ [% v;;;----------------------------------------------------------------------------
8 q, i7 |( V F* {3 o' N& y9 d;;;----------------------------------------------------------------------------
9 G' _7 o9 Q7 \/ W;;; Prefixes in command and keyword strings:1 y e+ J7 o* \9 Q7 y3 @
;;; "." specifies the built-in AutoCAD command in case it has been
1 L& C7 z: E w;;; redefined.
" d' P" A4 L! k5 n4 G;;; "_" denotes an AutoCAD command or keyword in the native language
G% k5 W5 t% M3 B1 d; @& H;;; version, English.9 T( h6 \4 m* u$ }5 g5 c- g
;;;----------------------------------------------------------------------------9 }; g% M* ]6 j" b
;;;/ s; @5 ]! P1 _$ J6 |& R: p+ t
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
% A4 ^' c; u& P;;;;;;;;;;;;;;;;;;;;;;;;;;;;GLOBAL INFO.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8 @) ?& |0 s* P% y
;Functions created as result of loading file: exchprop.lsp
# Y3 p x: Y& N/ X6 c; DDCHPROP2
; x$ t. G6 x8 |- M% `; DDCHPROP2_INIT! A1 W; H" q+ W/ u6 o; ~
; DDCHPROP2_SELECT/ V: O; ^- ~1 |0 u
;. V5 n" @. e0 p
;Variables created as result of loading file: exchprop.lsp
; G$ ^9 B- Z+ G8 O K* H% J1 o; OLD_ALLOC
3 ?3 r. c( @+ Z# L;
3 h! T' O, |; b: |;Functions created as a result of executing the commands in: exchprop.lsp/ c; O5 e" w5 `; [' r$ Y) z
;
2 s' p. s( w Q) T: v;Variables created as a result of executing the commands in: exchprop.lsp7 l+ }1 ^ Q" B0 o: G& O9 q
; AI_SELTYPE4 v5 R' H, Y* ]1 x+ `/ s2 Q
; BONUS_ALIVE; W8 j' W2 I c# |+ g
; BONUS_OLD_ERROR
( q& C. e4 i; a3 I+ k- H5 ^;;;;;;;;;;;;;;;;;;;;;;;;;;;;GLOBAL INFO.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
! @$ r/ t/ O, h6 a" g- T;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;/ O6 N. \% f- Z1 _* K
$ z9 H8 L4 i5 c2 h+ C;;;
H% I* J: g9 M( E7 r;;; Avoid (gc)s on load to improve load time.
' ?/ T$ @0 r0 D) ~" };;;
. r) m# r ]2 C(defun do_alloc (/ old_allod new_alloc)
2 X- b2 ], x/ i7 Z6 W" D* K& r V& O (setq old_alloc (alloc 2000) new_alloc (alloc 2000))
! s3 a5 D3 b7 W5 k8 b: }/ x (expand (1+ (/ 4750 new_alloc)))
5 J0 J- @/ Y1 f0 m (alloc old_alloc)
5 v' q! B# x+ Z* ?+ ^1 D);defun
# ]' _* M" j. B% k7 l, L5 w9 f
) v" R8 M: b" }+ ^6 D* Y0 k( h;runs at load time - rk1 l. t9 p1 a. C/ G( D/ _
(do_alloc)$ M+ Y8 C! v$ j& M$ S% V
(setq do_alloc nil)% `; W- g y1 r) Y- P
;;;# R: w. y9 I! m% W3 x. @
;;; ===========================================================================
# M" p0 y+ e- D0 v- c+ t# I$ A( A( p;;; ===================== load-time error checking ============================: M5 E6 D- U8 K8 e' \* p4 T3 ^
;;;
# n0 ?+ H8 b& ~& L
4 Q' p3 f$ ^! I: ~ (defun ai_abort (app msg)
5 K; p/ \2 J2 S# R* i7 t- _ (defun *error* (s)
; n: b7 ~5 G* _( ` (if old_error (setq *error* old_error))7 x3 x. P! z/ o0 ^
(princ)
; I& W8 y2 r7 M+ @7 i );defun
M0 c) N, r9 P* U: ]4 N (if msg2 B: U2 [1 B; i( v; T' i
(alert (strcat " Application error: "9 ]0 i l0 M& Y6 Q. u8 W
app3 K5 W" Y. G# |/ L b
" \n\n "% q' a" N0 {2 n! [
msg
3 N) E5 \) Z* n, d# t* @3 }2 Y " \n"
" q4 r* ^$ ~5 X; w% Z )9 L: o* }0 g& S& c+ T
);alert
8 o0 T/ A! F# I) U0 N$ x/ ?4 p- p );if
3 V: p) X7 X; e2 z. _1 B* @ ;(*error* msg)
S' ~+ ^) T. F/ g9 v6 b (exit): U5 B3 {8 _8 j
);defun ai_abort' |! G Q, ?9 P( W H# P6 R+ u
' r7 q8 z( F Y9 E;runs at load time - rk o# z% n& C! a5 f9 l$ B$ n
;(if (and *error* ;added the if wrapper around this - rk.1 O5 Y2 |" w8 O+ s1 k! i
; (not old_error)
8 |4 A0 `# Y/ D8 u8 n" }$ Y' S; );and % z. z' b0 o% r1 o9 \
; (setq old_error *error*);setq! r/ v7 @% n% v
;);if# A/ G; d+ q9 s, d
! ~6 M3 [5 u! s4 M0 s7 d- m" O" ~4 U; j, W' e
;;; Check to see if AI_UTILS is loaded, If not, try to find it,3 m& M) d: B5 y
;;; and then try to load it.- j1 v& L1 y1 Q; X0 i5 f
;;;
- c8 ]5 ?* q/ U8 G1 E;;; If it can't be found or it can't be loaded, then abort the
- l5 L5 }7 y- S* e4 K;;; loading of this file immediately, preserving the (autoload)/ s1 U6 F3 E. z7 P
;;; stub function.* g. Q2 z( N, j! ^0 ?- p9 r+ V- m
5 R# S: w7 m5 p4 X# Z: I
;runs at load time - rk." W, K" F: X& w6 Y$ V4 v
(cond( E3 I4 ?& x3 a8 F
( (and ai_dcl (listp ai_dcl))) ; it's already loaded.
, p' D; l5 ]4 [' r" K i/ ?5 y ( (not (findfile "ai_utils.lsp")) ; find it
, S- H* V; W- l' I: m (ai_abort "EXCHPROP"" u1 C. H) I) v. z# _) ]
(strcat "Can't locate file AI_UTILS.LSP."
* N/ _7 {) I# k* x) a "\n Check support directory.")
4 u4 a2 e/ {' [1 z5 r4 J+ m5 K8 j );ai_abort
# w$ L, z) W) x1 e, X1 ~ )
! G. {; m! P1 f! f# g ( (eq "failed" (load "ai_utils" "failed")) ; load it& q& a! O) H$ Y5 S) u0 A# l% l
(ai_abort "EXCHPROP" "Can't load file AI_UTILS.LSP")
8 x& I& M, z4 z+ r# `2 P- T# D% t )6 H! s0 C- U1 Q3 w
);cond close
& V* r% U" H1 N% A" v
. y# k! K z6 j2 F2 F9 Y( ^(if (not (ai_acadapp)) ; defined in AI_UTILS.LSP
1 E- M. h/ c4 s' u! `' S2 ^) e# t4 l; f (ai_abort "EXCHPROP" nil) ; a Nil <msg> supresses2 i" H* h. A% D; s
);if ; ai_abort's alert box dialog.8 |' H2 k% V" M* @+ y. \7 X
0 _0 ?& V6 D- b5 N
;;; ==================== end load-time operations ===========================8 q- B4 H- S( O) T* i( a
- @* @4 u: k6 y8 e+ `5 h( _* Y
;;; Initialize program subroutines and variables.
$ _% r4 F- W$ P' n6 Z& q& F0 ^1 C! I
(defun ddchprop2_init()
% U4 m3 j* d6 \$ Y
7 O) ^% I p) ]& ^4 A {$ x% ?5 H! y2 g, k
5 v5 q# f/ z( w k" E3 R% c r
;;1 X. l! f* V7 i7 \/ `1 J4 w
;; Define buttons and set values in CHPROP dialogue box
; b* B3 E6 t1 `: B ;;
' M7 M3 n, n, n2 j6 O( r! `) z% q (defun call_chp2 (/ cmdact p1 p2)+ i" G l: V( W1 t4 }
8 w3 n# d) J, \# o
(if (not (new_dialog "ch_prop" dcl_id))
9 D- I; O8 y0 s$ v3 O0 G' ` (exit)# I9 ]9 n8 a& n6 H; V$ t
)
8 A5 h& r. _/ n. r& q5 X. \! |5 ~7 ` M2 y2 P% |
(set_tile "error" "")
4 x0 ~& U; x& A- [ ;; Set initial dialogue tile values; T$ A8 Y J ?& B% j9 X
(set_col_tile)
0 Z6 }0 s4 _+ [2 j. l, ]) j (set_tile "t_layer" elayer)
% }+ X* L% H+ S) b9 U
/ q9 V5 K! K( L& p4 [5 {# E/ F (cond
4 u) ]) F! ^5 _, \: f* _5 k ((= lt-idx nil)
5 f( O K1 i7 e5 q, l2 W. ?: W (set_tile "t_ltype" "Varies")
0 P8 h2 @7 y' n3 g5 r/ W- y0 K* x; ] )
$ l9 q; Q i v! _3 S ((= lt-idx 0) ; set tile "By layer & layer linetype"
: u8 S3 q5 j9 w8 T (set_tile "t_ltype" (bylayer_lt))
3 X D N: \) K4 p* [" P/ T )
3 `/ `8 G8 ?; a (T0 H1 W9 [) b8 q, z
(set_tile "t_ltype" (nth lt-idx ltnmlst))
' T e# D+ m- O$ V) ]) E: P; U2 I1 q )9 W# I/ c% i' D2 y2 O5 C/ m
)
) K# e5 g, J3 }8 N4 g! y h7 [- y/ Y* l/ ]2 n; s
(if (or (= ethickness nil)- W" w: A* Y: T- c t+ G
(= ethickness "")2 J$ K8 d% u* u
(= ethickness "Varies")
$ x& s. k$ ]% E! o0 S );or
8 U2 D. V) |. @) A7 v0 h% I (set_tile "eb_thickness" "")
M/ F$ \' a7 a1 U (set_tile "eb_thickness" (ai_rtos ethickness))) _5 F. f4 h9 r3 m
);if
9 w( \; v2 \; K: j& f9 j2 C (if (or (= eltscale nil)) b7 V* n- ]1 u9 M: a, `
(= eltscale "")
" X! v. H; z5 M7 G! C5 W (= eltscale "Varies")) U' i, |( [! u& B' b5 s
: g/ c' }4 _* S9 q9 v% T+ I
)
6 c/ U3 {3 d1 j8 j (set_tile "eb_ltscale" ""); m/ D" d! d! ~0 u
(set_tile "eb_ltscale" (ai_rtos eltscale))
9 w( G6 R: k7 d! X& M )& u* H9 j" {% b! U" W, K
(if
& @4 U& R/ a" T) @ (numberp ewidth): U- _5 J4 L: \$ G- E- J7 v. `, F
(set_tile "poly_wid" (ai_rtos ewidth))
( j( H+ n( Z( ?5 M, _ (set_tile "poly_wid" ewidth)! M* d. v3 S( h7 H! V% L5 \" _
)
7 U2 Z# q* B5 _8 {8 P* K (if
0 b# h; K1 L g0 r: @$ r (numberp eelevation)
: K9 U) o6 B" N$ P (set_tile "poly_elev" (ai_rtos eelevation))( j0 y) w$ E! o/ _0 y' U. L
(set_tile "poly_elev" eelevation)& c8 N& |: }) T! b
)7 [8 H' Y- O, z
(if
2 z6 N; m5 D: W1 S (numberp eheight)* ~0 r; ]+ r1 L+ T
(set_tile "text_hgt" (ai_rtos eheight))
3 I* U$ e: f/ L- j7 z" | (set_tile "text_hgt" eheight)" Q5 K+ d8 ]" e! d" Z1 q. m
)
% p6 Y+ l5 g c6 z (if (not estyle)
K6 {5 D- X+ c+ O: v (setq estyle "")
& {+ a# _8 I; J7 ] );if
/ {2 @* d7 d7 C1 m6 y (setq hair_style_list (tnlist '("style" 16)));setq7 C. ?, l/ U: O7 h) \# g
(if (not (member estyle hair_style_list))
, R8 N9 O" s' J: \7 y9 X (setq hair_style_list (append hair_style_list (list estyle)));setq- {( L" ~ L% o
);if
* c$ A* P: f& d. Y2 t
, I% {7 v5 Q( b, I1 x/ ^2 V( W N (setq hair_style_list (acad_strlsort hair_style_list));setq6 ]: D0 M9 k! C: d' @0 d8 f' O
(mpoplst "text_style" hair_style_list)& {, z' P% h, X5 w+ X; J
(set_tile "text_style" % {% W; c3 }+ i: y+ F
(itoa (position estyle hair_style_list))& t) k' K" g5 z. M! g( E' V
);set_tile 9 D8 \# _5 D8 G" X, D" Y) C9 A. f
; k6 n7 C9 i) T0 C$ _! G
;; Disable tiles if need be... ;@RK
. H' u" E6 h( |4 o (setq a 0)
; c9 z& a6 M- E/ c (while ( < a (sslength ss))
- O$ r2 Y' Q$ H( T (setq which_tiles) E ~/ ]# v) t: U& ]& P" l
(ai_common_state (cdr (assoc '0 (entget (ssname ss a))))))# e7 x0 w( {$ c3 q9 w& O4 j" ?
' p& j0 l0 D- |1 N1 V ;; If all fields are enabled, don't bother checking anymore.
; o( I+ w' V% F: \. I; ` (if (/= which_tiles (logior 1 2 4 8 16))
. [2 p1 ]! A z2 E' w (setq a (1+ a))2 G8 n/ a. E4 n2 {& t5 W0 ~
(setq a (sslength ss))
; b$ v. ]+ U, G& v. U- X+ D% j. R5 | )
9 A9 G y6 M, Q5 w; M2 a3 e* y )% B' Y4 z: W& n( r
;; Layer Button and Text Field
, E, h) [- C7 ]. I" _0 e2 c: X- u" }' b; [% i
(if (/= 1 (logand 1 which_tiles))2 J$ x' @4 C2 J% X
(progn* {3 D& i1 A# s( o* x* W
(mode_tile "t_layer" 1)2 w1 ]( K& i! ?5 R; C4 u" q7 B
(mode_tile "b_name" 1)+ `5 F$ V, ~! ] D" q w8 I
)
- P% R& m5 O3 \$ S. h9 _) S, j+ l )
5 ]" Q' u9 _6 E: B- H; i
7 C8 i# h6 W) c* O. w0 g1 y7 } ;; Color Button and Text Field- |9 y& H0 d- v& j S: v, W
(if (/= 2 (logand 2 which_tiles))
" G" p/ J& ^! v0 @! s) o (progn4 Z' K: w5 U" i- ` J
(mode_tile "t_color" 1)
, X7 O8 h! i/ R (mode_tile "b_color" 1)4 i/ e' x S% q, R
(mode_tile "show_image" 1)
; K; q. \* z8 Z7 f( K+ P8 e+ y3 D )
) T' Z5 ?- ^1 @; \ )8 c6 q" ^' U9 w' ?9 K8 ~
;; Linetype Button and Text Field( R1 R1 U/ b% k, ^
(if (/= 4 (logand 4 which_tiles))+ Y3 v! o4 e, I$ p6 N4 g
(progn
- X8 T9 l- g b' M (mode_tile "t_ltype" 1): P% [! n, i: F. `$ A1 @: E
(mode_tile "b_line" 1)
: L; ]: L# V" M" L) m }, K1 p )+ r; r# G! `% W, t' H
)
( p% M$ G: N3 ]6 G+ h ;; Linetype Scale Edit Field' j- d: Z/ `) P+ k8 L8 T) T) z- Z
(if (/= 8 (logand 8 which_tiles))) e9 G! c7 M8 P5 D
(progn
' H8 d. i7 A2 [; p% x (mode_tile "eb_ltscale" 1)
' z7 A$ m, A% L5 j1 G, Y1 k2 k. @ ); l5 w+ }( [/ k
)
4 C. ]4 T; X5 x# z9 | ;; Thickness Edit Field." s$ s" B, M) e+ i, t% L% O9 E
(if (/= 16 (logand 16 which_tiles))8 D; e$ l9 i5 T$ g0 ?0 v
(progn1 y; `: f1 M; Z, |, S2 j4 \
(mode_tile "eb_thickness" 1)0 F; S, L; [2 y9 ]
)
' C; F5 Z t6 a% v( T0 t )
/ S. t4 k! v' G; I6 x
5 M4 P* C# \4 u. | ;; Polyline box and tiles @rk 10:05 AM 1/30/97' `5 Y7 ~6 d" K, B
(if (not (= 2 (logand 2 eflag)))2 o" u4 d+ a, r z( n/ B& ]
(progn% n B# a- }) F; K0 U
(mode_tile "text_hgt" 1)
' f; U1 H0 p0 R$ O+ e _ (mode_tile "text_style" 1)5 ^% ?3 ]+ ]# Z; I$ m
);progn
( k0 G% i% U" Y" T );if
- d) [: S4 L' b n# x) S (if (not (= 1 (logand 1 eflag)))
0 E; W9 ?9 L% k- W& c Y (progn
5 t4 H5 k7 C2 {/ J (mode_tile "poly_wid" 1)9 p& x# ?2 y5 E
(mode_tile "poly_elev" 1)
- l+ ?, _8 M& `# @% Z. ~( x9 A );progn then disable polyline fields0 S. B* S# D8 s# e; H
);if
. A3 l1 x$ B/ V7 P* q0 D% F: t E h2 V& w+ x. B) F
;; Define action for tiles
% L: U n# Q9 b" |' o% t! S (action_tile "b_color" "(setq ecolor (getcolor))")) u/ Q! v0 K$ t7 z
(action_tile "show_image" "(setq ecolor (getcolor))")6 L* N& `' D% J" Z4 q6 o( R) `
(action_tile "b_name" "(setq elayer (getlayer))")
# T# C& P6 [& d: I (action_tile "b_line" "(setq eltype (getltype))")
. n& i8 U7 f2 m5 {! U6 S1 S" ~ (action_tile "eb_ltscale" "(getscale $value)")- p. O2 n( D3 Q/ j' i3 E
(action_tile "eb_thickness" "(getthickness $value)"), o6 S! t% M8 Q. T! i
(action_tile "poly_wid" "(getwidth $value)")
+ j3 ?3 B% m+ m (action_tile "poly_elev" "(getelevation $value)") K2 b* u U: P5 O, p0 Z
(action_tile "text_hgt" "(getheight $value)")
% M3 c$ ]2 h( V8 T8 r2 ]- A( ^ (action_tile "text_style" "(getstyle $value hair_style_list)")
$ x% J5 Y, w) q6 c1 E1 E' Q (action_tile "help" "(help \"AC_BONUS.HLP\" \"EXCHPROP\")")' j1 ~. T* j* T! Q8 ]8 ]. e0 L
(action_tile "accept" "(test-main-ok)")1 d/ p; R0 R0 c3 c1 |0 ?: k' h
7 x b, z- b9 Y, l, o
(if (= (start_dialog) 1)
! |5 P1 m* z* S/ e2 Z+ C( _9 s# l (progn6 _3 f! R" s' ]5 u
; Update special properties for polyline and text selection-sets.
# p8 g Q- V0 a7 h5 j. p2 \
* ~2 G6 g O, p" X | (if (and (= 1 (logand 1 eflag)) ; polylines rk chprop
. s: q. G1 Z1 ~& y, o( o (or ewidth
; z9 M3 C4 r3 q0 K n eelevation
) O6 N, c* d1 l7 ]3 y! W7 s );or( v: t1 V- V1 {/ R4 e$ ^* P y
);and
$ K; a) K' o) Y+ x (progn
% m% b9 C$ F& s7 ^0 M z (setq ss-index 0
9 w$ y$ o1 q% e7 {- l5 X) l ss-length (sslength poly_ss)
$ e3 P+ |4 G; h );setq
0 V$ C8 q( m( p4 z' v7 s (while (< ss-index ss-length) e; @- x0 A4 Y$ J4 D: H0 w; f: h
(setq ename (ssname poly_ss ss-index)$ ?6 C2 E9 s6 |1 t% c) S
elist (entget ename)( V! S5 `) Y T4 i; f0 ^
);setq* Z- p4 @& }, U+ j+ [ ?
(ucs_2_ent (cdr (assoc 210 elist)));this function lives in ac_bonus.lsp6 M! U6 F+ g1 d" S
(if ewidth
' _' h: h5 I& u (command "_.pedit" ename "_W" ewidth "_x")$ Z* r5 K6 i+ q' o' o" r7 a
);if ; a8 e+ [! x, R, [" z
(if eelevation
/ K9 n& V6 f; v+ `% f9 a/ Q( _ (progn9 a' ~# l: i* D( J2 H
(setq p2 (list 0.0 0.0 eelevation));setq, {3 M4 r) K5 I3 E. u- G, V
(if (equal (cdr (assoc 0 elist)) "POLYLINE")
/ P0 b3 A6 p" @, D w- n (setq p1 (list 0.0 0.0( @# I8 Q; f. j/ k
(caddr (cdr (assoc 10 elist)))
4 u: R) P0 ?( f3 C: U- | );list
2 X' u- h% _/ Y; A1 y# y );setq
% e1 @1 x8 G) z( P1 l (progn r% a9 @4 ]9 N
(if (assoc 38 elist)9 T. e8 @* C2 N- ]+ Y% [
(setq p1 (list 0.0 0.0
4 m ]; u, ?- w. h3 h (cdr (assoc 38 elist))
8 J0 |, P: o9 V; f );list
e( W- }6 Z; C# _( e. p- o );setq
- m+ i/ X6 J0 j7 j" o6 E5 a5 g (setq p1 '(0.0 0.0 0.0))/ a) X) H7 N7 D( J! t5 ]
);if
; L/ e& [" q$ Y o6 F5 O );progn
/ T" s" n8 ^- [+ ~# a );if
. d8 G8 `6 V; B0 h6 c/ Z- b (command "_.move" ename "" p1 p2)
6 M# H) Q7 R( U ]2 V/ j1 k );progn then change the elevation of the polyline
) i* ?# B- T$ w! `# n );if
$ p2 P8 {2 A x& h2 I4 c2 y (command "_.ucs" "_p")/ p/ V) e( {4 q) {
(setq ss-index (1+ ss-index)); n3 x' @; L9 l# E1 M
);while7 X) G' Z4 W1 W
);progn then polylines are in the selset" p+ O: _5 G3 U f. W0 n
);if
8 e! j1 T( B$ Q. Z7 s7 g6 G (if (and (= 2 (logand 2 eflag)) ; text, {9 g# q; k) I) v- d
(or eheight
0 R3 q1 C& T _& u4 y: c0 O) Z estyle: ^. N+ r' T n6 |3 v0 Z
);or
+ f2 [2 p/ C; m, {2 I* h );and" Q& h+ L9 i+ j- e& C* n; _
(progn; ~( ?- I( y8 _! y4 z$ V
(setq ss-index 0 ss-length (sslength txt_ss))
0 B: q# O |9 g" q (while
* g8 }9 _6 F: i+ O (< ss-index ss-length)
9 x- P6 y C. A. r (setq elist (entget (setq ename (ssname txt_ss ss-index))))3 {( ~2 N* W( q+ e
(if (numberp eheight)
; N9 r7 X+ n. W. I2 H. B (setq elist (subst (cons 40 eheight)
9 I) n9 H* J/ q (assoc 40 elist)" l+ C- S3 K/ u6 H; Y4 F
elist
; C: C+ i, m* c' F2 Y );subst
9 k/ b# V6 F1 G/ b7 K" M );setq
* A7 U' I; d1 U5 Y$ p( _ );if
- H- Y+ Y, ~5 O( G (if (and estyle ;(not (equal estyle ""))
- J) s* I1 `1 L$ j8 ~9 c1 j (not (equal estyle (cdr (assoc 7 elist))))5 s3 M$ a5 I' g: B
);and
: v' K1 n) y, l (progn
, t! z# A' X# h$ H8 p* L ;rk. This needs to be implemented as per mtext font issue in ; ddchprop_notes.txt
8 l' v6 F3 ` c( k7 u ;(if (equal "MTEXT" (cdr (assoc 0 elist)))
0 _' C& P; {* w- T ; (setq elist (fix_mtext_fonts estyle 5 c0 T# Z4 P6 |8 F
; elist
+ Z& E, l4 x" n& ^! q ; )/ A$ X& p& f- J( L) p; D; b
; );setq then
7 [( l2 R9 B2 c( q& q (setq elist (subst (cons 7 estyle)
: d/ ~9 s. g! t (assoc 7 elist)7 g/ O) ]; A& n: K
elist( ^9 d0 U" |2 ~+ M* c. E/ |
);subst
! ?/ I- o& ]2 T; ^ );setq else
* H2 t6 p% D. X1 i6 ?" ` ;);if
/ `( X- W" E3 [7 Y$ V | );progn% Z. i6 G& e y& q6 q8 q5 h e. v
);if) }) o! S- K9 X+ E
(entmod elist)
3 {. @1 a: h* W: N/ F2 K (setq ss-index (1+ ss-index))6 O; K( R8 i* i/ a
);while
/ B$ y$ M0 v5 t, m- M$ @( n );progn then
' Y0 ^6 N% g$ K6 @( V& S7 t* i1 a );if! S: X' g5 k6 ]) X6 R( M2 @! J
* Q0 t8 v4 }& ?$ Q1 l( X
(setq cmdact (getvar "cmdactive"))
; O$ z2 |: M6 R5 k (command "_.chprop" ss "")0 y8 H+ c/ @4 K i8 B
(if (/= cmdact (getvar "cmdactive")) ; Is CHPROP actually running?
+ k; Y( ^* ? V7 U) L1 ?- ?0 @! H (progn
7 R% J7 a& T; _/ s5 A# m* O (if ecolor
r- A1 k4 B9 N+ q- k, s! d (progn
. |+ {0 d, q6 q+ v* k) g/ w4 u# H; S (if (= 0 ecolor) (setq ecolor ;|MSG0|;"BYBLOCK"))3 m5 {! G, z9 V* V" n# k
(if (= 256 ecolor) (setq ecolor ;|MSG0|;"BYLAYER"))
0 {5 j' W3 l4 k1 V+ L (command "_c" ecolor)- E% x# c) t( L' }% L ]
);progn then
4 t$ ?' I8 X2 v/ D )' E: W% o& J+ B% ?: y9 K* @5 \1 H! o
(if (and lt-idx
& X! h& x& F1 Q1 e+ O (/= eltype ;|MSG0|;"Varies")
# T" [4 }3 ^8 v! y. s% Q )' u5 O) C: o- ]7 i- ~5 M$ Q, R0 |
(command "_lt" eltype)- e4 \8 O4 ?4 i. Y7 D9 D
)
" v( R0 { W' h5 j8 {8 h; V$ h# v! K* M (if (and lay-idx 7 h. F: G* U0 ?- X0 T
(/= elayer ;|MSG0|;"Varies")- d& h/ I3 w. k% _* z2 g6 v/ J
)
: @8 f( A. g* F# l: ^" ?1 K (command "_la" elayer), g' p& D0 ]; Z- h
)
5 ] D* N: N4 S9 i3 J9 N9 M (if (and ethickness
2 ]: Y+ c' y+ A- [ (/= ethickness "")# V% I8 g; n$ W3 `
(/= ethickness "Varies")
8 f& x6 z( \( s; i, ^! B9 \ )
% h6 S' r; R9 C0 U (command "_t" ethickness)
% w$ W, I1 ^+ u6 e2 ?+ {# [( ]$ V )
; ]6 `3 Q. _/ z5 ~" Z6 @ (if (and eltscale (/= eltscale ""))6 A2 c6 G" b4 [; X. t. |3 A
(command "_lts" eltscale)
2 e. A* Q r2 g) t" G& E' D );if
/ o/ }& U- {4 u* ^. A (command "")( ^4 N! O" o9 y9 l1 j
)
! |) y9 b$ q& m8 I- K7 m' t- J, x) ~ (princ "\nProperties unchanged") ; CHPROP didn't like our SS set6 b: ~7 z! O$ I! W S6 a
)4 O# a# ^. ]# E4 g, `: V
7 h( C3 f; N5 N& e% \
);progn then OK was picked in the dialog.: S/ H- d6 H6 \" b6 U- [, T% m
; F7 f: a* ^$ m" J
;; Fred GERBER - 25-AUG-94
5 l: z/ C# R/ Q ;; Don't print the "Properties unchanged" message when the user cancels
' J( o, V W! R U* y" {3 q* ] ;; the dialog because he knows that already (otherwise he would have
3 M% C: E) ]; X1 m. S. L ;; hit the "OK" button). Display the message only if CHPROP fails for
7 \6 ]& [& r5 e" Q, n. r- R ;; some reason, because it is not the expected behavior of the command.! |. p8 d, W' C' j
;;
! h$ T' Z% F. e0 N2 O- Z: T ;; (princ ;|DDCHPROP2_LSP_8|;"\nProperties unchanged")
# a$ H5 A5 N2 C' ^4 r2 G );if
! J0 [$ h7 c6 r2 E) ^9 k1 H: @# c. o (princ)
$ ~6 s! s: \0 x! y. t. m# S );defun call_chp2
$ A/ P# L5 Q% l ;;
2 J$ C$ r; d! T ;; Function to set the Color text tile and swab to the current color value.2 R4 x2 s0 e3 k
;;
5 i! a& S8 b1 \ (defun set_col_tile()
, m+ {: {( c$ T2 ]% D (cond
% v, F" P5 z* o) r ((= ecolor nil), d6 Y. b! _& Y5 ^* j- F
(set_tile "t_color" "Varies")3 k7 Y3 _+ D, A* a- e
(col_tile "show_image" 0 nil)
% Z- `! `! r2 Q )
3 k7 o: F% l# j4 b. v( w6 V. b. l* W' v ((= ecolor 0)
) O9 X3 {8 X9 m, i7 T$ g (set_tile "t_color" "BYBLOCK")4 @" {, K% a4 A3 d5 m
(col_tile "show_image" 7 nil) ; show BYBLOCK as white
: P& g/ i- U, z4 B )6 e7 d0 ^9 c" d+ K# K3 z
((= ecolor 1)
) l! o4 a( c- f+ U2 m2 C9 E (set_tile "t_color" "1 red")7 ~' V; c6 }$ k" O3 P a4 j: u
(col_tile "show_image" 1 nil)
|* M2 h" k K4 Z0 E )& w' ~& W, J/ B8 @. f
((= ecolor 2)5 r+ U& _6 n7 I0 a' [; S6 X- D: b
(set_tile "t_color" "2 yellow")
V$ \% @2 \4 Z6 V* M d (col_tile "show_image" 2 nil)
9 S1 i* r1 v) {; p3 o# W' r# F )8 U# q3 w; h% C/ N
((= ecolor 3)
+ p1 Y9 w _3 j2 y- e1 ?% i; f3 S (set_tile "t_color" "3 green")/ ^1 _* h H4 `6 ~
(col_tile "show_image" 3 nil)# E! N- p& a7 t( a4 _
)
$ R) x6 o" B9 s6 b o) G ((= ecolor 4): s" n1 p) l2 @5 y7 k* t
(set_tile "t_color" "4 cyan")) V% X% A+ \+ ^! ?
(col_tile "show_image" 4 nil)
l( B; ~/ A% ?$ A: |$ U, | )
% s9 ]- W8 l5 m9 Q# u- V ((= ecolor 5)
4 z0 P8 G* X1 w (set_tile "t_color" "5 blue")
; N Y+ D3 [- A. X7 E1 w (col_tile "show_image" 5 nil)
5 ?& j7 p) x3 i( R# G! o4 I )5 ~. j/ U/ F( z; m
((= ecolor 6)$ z( m! T- `: r1 v, P
(set_tile "t_color" "6 magenta")" X+ ]: o) D- o4 t& w/ i: Y
(col_tile "show_image" 6 nil)" n. ^) O4 ?) B) I: Y
)7 J, S ]/ G* o$ [/ a4 M/ e
((= ecolor 7)5 D. C% V9 B8 s. m3 X
(set_tile "t_color" "7 white"). c# d: g: e3 b. \
(col_tile "show_image" 7 nil)! Q2 N4 s5 n8 N
)
( e: E$ P1 Q- `, `& r& a1 S3 B- H ;; If the color is "BYLAYER", then set the tile to5 o$ t& E' ?2 D5 ]( ~; W
;; show it's set By layer, but also indicate the Z- F0 ]. M2 |+ p0 Y, o" w
;; color of the layer - i.e. By layer (red)
& }$ Z9 O1 @$ Y3 g6 e, x ((= ecolor 256)* T: L5 p8 X5 E7 ~6 m- ?# d4 S
(set_tile "t_color" (bylayer_col))
9 { ~8 \" C' [ l (col_tile "show_image" cn nil)
: Z+ l0 ?: @/ J/ n% ~" Y( A! k ). `3 P# G; K" ?. r) o- w1 E3 t
(T* r _3 `8 ]9 v7 G8 ?9 M7 R
(set_tile "t_color" (itoa ecolor))0 z1 M' L7 e2 \3 u$ X' _ d
(col_tile "show_image" ecolor nil)& ^5 {1 F: M t% X+ d) K1 W
)5 K, ?& I4 j( F* k5 F5 ` O
)! s' \' R( Q5 u! O8 f0 @0 P2 S f
) J T0 j- D3 T8 S3 U% Z
;;
0 L5 P: j6 h% g. N ;; Function to put up the standard color dialogue.
/ J% I- K- J. P; E: t/ W" I8 S& V6 R ;;6 x2 u, U, b; x$ ^' y/ X
(defun getcolor(/ col_def lay_clr temp_color)
3 ]" j/ J' ]( Z4 L4 } ;; col_def is the default color used when rq_color is called. If ecolor4 r- e/ j b: r' K6 l9 O" b
;; is nil (varies) then set it to 1, else use the value of ecolor.2 ]7 k/ F |$ _
(if ecolor
! {) n( M& Q- U9 B. ^+ @; ` (setq col_def ecolor)
$ `, G0 K R8 n0 ~6 p* L (setq col_def 1)
4 U7 K/ n" |3 {# R, Y: K | )2 {4 o& j6 X5 D9 O( P+ _' G
' e% L4 N3 o9 r/ S c2 t& w
;; If we're working with a single layer, get its color' g8 M# c7 g4 I$ N0 L
;; for use in the color swatch if the user selects color BYLAYER.
% o) i' c1 w- R, b (if (/= elayer ;|MSG0|;"Varies")# @: _! Y% p1 V# @6 D* a3 a' \
(setq lay_clr (cdr (assoc 62 (tblsearch "layer" elayer))))7 C: c4 m. {/ A9 m
(setq lay_clr 0)
3 e" ]2 U6 y E& Q& _9 j2 ~/ x6 m' q )
/ k3 l' |2 G8 Q; h2 I9 @2 D (if (numberp (setq temp_color (acad_colordlg col_def T lay_clr)))
8 @& z3 S2 W) g: z3 u1 ~2 i (progn. ` o& M0 q, s$ V' Y
(setq ecolor temp_color)
9 @# \" h9 a/ X1 Y (set_col_tile)
% \) |/ {+ t% K ecolor
7 A4 K7 b$ G" G# }0 ]1 ` )
& A5 e+ H+ g% R5 c. O% ~ ecolor8 E. L8 E+ X; q- T* o' q5 p
)
2 Y) F3 G! D: T )
! ?, r4 h, ~1 P% n* h# I# h( ] d" x ;;- {! q3 A! x# w) K C7 l
;; This function pops a dialogue box consisting of a list box, image tile,( R1 S9 ]$ a3 G' C, t: I8 w
;; and edit box to allow the user to select or type a linetype. It returns
" L% p( C8 p# D+ \ ;; the linetype selected.
/ i- h7 d1 w1 ~# b# R ;;" |- {$ }* @& W' V; F4 V
(defun getltype (/ old-idx ltname)& [ @3 n H: e& a7 L
;; Initialize a dialogue from dialogue file& D6 b8 {/ ^( q7 K2 j5 b5 g) I
(if (not (new_dialog "setltype" dcl_id)) (exit))9 W5 f+ q( G) J# I
(start_list "list_lt")
% ?4 Q9 u1 a$ a$ c (mapcar 'add_list ltnmlst) ; initialize list box$ n' o5 }7 N. ^2 ~& R" c4 B
(end_list)
3 d4 O* [# e2 J (setq old-idx lt-idx)" Y) Y) [3 \5 E$ s
;; Show initial ltype in image tile, list box, and edit box
6 i- K9 ~$ n- [+ z6 ^' ~: H* s( Y (if (/= lt-idx nil)
% I5 O4 s7 T4 ~1 {( G# y (ltlist_act (itoa lt-idx))
9 o3 ]& U; e) c* I2 h (progn0 a a' j& R# o, J5 B
(set_tile "edit_lt" "")
2 k: C# _6 k1 H6 y (col_tile "show_image" 0 nil)5 w% I: t8 `) ?; _9 L0 `. q& c1 W
);progn else2 V; Q% {) n/ v- n d( z
);if
# G3 \5 g/ {& x, x/ c (action_tile "list_lt" "(ltlist_act $value)")5 C5 l J0 n: m# s# L
(action_tile "edit_lt" "(ltedit_act)")- o8 p9 N+ H2 o0 }
(action_tile "accept" "(test-ok)")3 c0 ^2 e# J# Y! c2 q
(action_tile "cancel" "(reset-lt)")% L% b7 J. d" T B# L
(if (= (start_dialog) 1) ; User pressed OK/ V) F' X$ S; J8 V* z
(cond- ?9 S) s" C# w2 C8 ]
((or (= lt-idx nil)" [! ~' S- J/ q
(= lt-idx (1- (length ltnmlst)))- \9 U/ _" S. r6 r% z: v) J
);or( X, y5 B' V$ Q* a* @& C+ ?6 Q( a7 H
(set_tile "t_ltype" "Varies")8 k" B# s% R. c$ L2 \0 c1 v; s
;|MSG0|;"Varies"
* {: ?' p+ j, Z )0 @' a& j( Y3 ~% V
((= lt-idx 0)- u: }& b4 ~3 ^- n9 f/ }) R( C
(set_tile "t_ltype" (bylayer_lt))% `' u& b+ l) A% W
;|MSG0|;"BYLAYER"$ F* |5 m1 o# C# k7 M, v
)3 U2 a) N2 s' b6 \$ B0 l: y
((= lt-idx 1)
+ ^. W% A, |- ]% [ (set_tile "t_ltype" "BYBLOCK")) _# n$ q* Y& L
;|MSG0|;"BYBLOCK"
4 t) ~: c0 a& z5 _/ d ). b, ? k$ j5 H
(T
* L! @# o# D* ], T, r' W (set_tile "t_ltype" ltname)
1 X7 s \; P3 b* |( g, w ltname
: F2 j" Y5 [% w6 C; R9 m$ D )
6 v0 p% P7 Y3 B2 Z% O/ C/ D. W );cond then& [1 m; F' g* h. ]
eltype: a" I& c8 r6 ]! D
);if5 P4 `1 M: e- n! u
);defun
0 o. z1 ~# ~+ ~% x# @, C ;;
! ?5 O6 s$ R6 Y# G _ ;; Edit box entries end up here7 D3 e, o6 N- V; s! t
;;& V! l7 f" z j* n7 ]
(defun ltedit_act ( / flag)
& i" l6 {3 D1 x1 @# G R' A ;; If linetype name,is valid, then clear error string,' F. E z* g1 p, ~' f% M
;; call ltlist_act function, and change focus to list box.3 u% j0 D) y" r0 r _$ c ` c
;; Else print error message.
: O7 Z' I0 X7 Q8 H$ w7 f! ^
D% T+ s6 l( H/ { (setq ltvalue (xstrcase (get_tile "edit_lt")))
3 A B C, ~) q9 f; L7 ] (if (or (= ltvalue ;|MSG0|;"BYLAYER")
/ @" t* n' k. y" g- v (= ltvalue "BY LAYER") U2 ], E- B, S3 h( Z
)
7 ~% j5 ?2 o4 \2 b (setq ltvalue "BYLAYER")+ ^% @) k2 Q2 v1 u
)
" c( z( R5 R7 k3 S* g (if (or (= ltvalue ;|MSG0|;"BYBLOCK"), R1 ^- l7 R8 C6 \* c3 X) @
(= ltvalue "BY BLOCK")
: f2 ~& w& |* t; R! g ); V! @6 f6 W# Z: s& R* ?& R
(setq ltvalue "BYBLOCK")3 {. {1 d4 L j
)$ Y- B1 v. t- Q; ~4 @7 b& |, [
(if (setq lt-idx (getindex ltvalue ltnmlst))8 \+ I, p+ X2 s9 v/ X
(progn1 O- a9 `* B" h3 y$ o7 E/ S3 B7 u3 ?
(set_tile "error" "")
+ Y; d$ M: M7 t: W. n( V1 a" q (ltlist_act (itoa lt-idx))
6 V4 i# M3 B9 Z3 @+ U, e5 P9 M/ X! D ;(mode_tile "list_lt" 2)3 n, N; I p& T i$ b; I& s$ i
);progn then
! U5 v+ ?+ }/ F2 P (progn
) d5 p7 W# w, c8 T% ] (if (/= ltvalue "")
& s+ K6 T$ L( s5 i (progn
' j* y( A# k; B9 {9 D (set_tile "error" "Invalid linetype.")5 ?: R8 N7 k, ~+ ~- H
(setq flag T)
2 w% g" G1 O8 M" @: U );progn
/ {4 K0 ]' v9 j2 r: ] )
9 V. X, r% e s/ X- Q (setq lt-idx old-idx)
. G( N0 Z! ^+ R. q2 r" A2 e );progn else
2 E: `4 T* m5 ?" O, Q/ u3 \ );if
! ?, q! u; b/ _$ H/ r* n& y& \ (if (and (not flag) ;added so a return will take you out of the dialog.$ L# l" |4 j( D! m; T0 E1 F- {
(= $reason 1)
. y% K1 _( B, Z) A& ~0 T );and
; D5 H( J+ e K" A (done_dialog 1)
- D$ I- X9 h1 [' X9 M3 ?/ h' N0 i- _ );if
8 b. ]; }" l* @6 v5 N );defun ltedit_act+ u( G$ o8 l _8 f, X* L
;;
7 |5 n/ r8 b8 A' ~, Q g ;; List selections end up here, y* m! n! L* R% D8 J1 v2 X
;;# `$ j9 U- w4 v& h% J+ A
(defun ltlist_act (index / dashdata)
: [& G6 F$ h' I8 W, q9 ? ;; Update the list box, edit box, and color tile
6 R I6 F; m0 d6 h/ s, i) \ (set_tile "error" "")
; J" q; \- X5 h* r6 Q) s" h% r (setq lt-idx (atoi index))
/ T, S' O% ?& N/ a (setq ltname (nth lt-idx ltnmlst))
( `0 J7 C, @; _# \& z. {- T% y (setq dashdata (nth lt-idx mdashlist))
% p' T( V% `. h' W9 {+ C+ E (col_tile "show_image" 0 dashdata)9 R4 ^& H* S- B
(set_tile "list_lt" (itoa lt-idx))
: r# @& W+ N C0 C (set_tile "edit_lt" ltname)
* M+ g6 R" P t$ d) g0 r/ m4 d" J )
' f: {4 u+ \+ g2 q1 Y8 ?: u ;;
+ d6 y) W7 D& y4 }# J ;; Reset to original linetype when cancel it selected$ V& q$ U- Y1 r* F
;;
+ U8 G: ^( Q5 Z (defun reset-lt ()
& y. o y# e, |: d9 ` (setq lt-idx old-idx)
" E+ b7 j- a2 Z$ j6 ~" g (done_dialog 0)5 N" |: Z9 V. K0 c& o
); J& H9 S3 V2 Z5 F4 ?
;;
' A3 J8 `! `4 x9 B- Y" ] ;; This function pops a dialogue box consisting of a list box and edit box to
0 ~8 D `6 X9 |7 @ ;; allow the user to select or type a layer name. It returns the layer name1 d. |9 e, h8 X; y2 K8 x: k! |& C
;; selected. It also the status (On, Off, Frozen, etc.) of all layer in the6 B( H( P6 R3 V2 U, @2 P: C
;; drawing.4 J: z: Y4 {9 ^1 N& |( S
;;
% V& _* a# J8 S: d (defun getlayer (/ old-idx layname on off frozth linetype colname)
( [" m3 ?& b1 `! B) N8 f0 \ ;; Create layer list the first time the layer
; J. I2 V: b* g$ H) L7 w( T6 h ;; dialogue is called.
8 Z% B1 i: e: e, x; r; Y (if (not lay-idx)
1 U6 B& }5 R2 {! J9 W4 m% J (progn, n1 i$ j4 B3 ?# A5 p \% Y9 d
(makelaylists) ; layer list - laynmlst+ S9 e% N6 n3 ]5 S" V% A& }
;rk' U% h! q; k% N) r) b
(setq lay-idx (getindex elayer laynmlst))( v; T5 a' i7 q- Y3 w
);progn( P0 J, C" C3 t( t/ ?
);if h+ E8 j- h% {. g- f& R
9 ~2 ^& t6 U& J, d0 |2 Q' p ;; Load a dialogue from dialogue file7 |+ x+ ^2 _' _
(if (not (new_dialog "setlayer" dcl_id)) (exit))
$ h N/ x: }+ Z( L5 y' Q' a: O7 _ (start_list "list_lay")
$ s2 @9 M9 W+ C& x (mapcar 'add_list longlist) ; initialize list box" E. U: _& N4 W1 |" V8 D
(end_list): G ]8 P4 K5 T( P. {, r
;; Display current layer, show initial layer name in edit+ r: z$ p" L/ z& B5 X$ C; |/ k( A
;; box, and highlight list box.
) d/ F# N: n" E7 @2 K. ~5 { (setq old-idx lay-idx)
- d k# N! O/ K, R (if (/= lay-idx nil) (laylist_act (itoa lay-idx)))( M9 g4 u8 B+ Y* p# o/ ~, v
(set_tile "cur_layer" (getvar "clayer"))
+ d# w1 K" J# G B" k- l (action_tile "list_lay" "(laylist_act $value)")4 E6 \% i: k0 h M
(action_tile "edit_lay" "(layedit_act)")7 ], S5 T1 m5 T x: Z# [1 ]
(action_tile "accept" "(test-ok)")
' O9 F/ f! m; n9 W/ ? (action_tile "cancel" "(reset-lay)"): H9 z, G/ K* `7 x# @% ]# r
(if (= (start_dialog) 1) ; User pressed OK5 s/ i' k" A* Y M1 W
(progn
! D; s+ B) O! X c, w5 x7 d: f. p (if (or (= lay-idx nil)
5 X; Z- P& S T0 i, i! P- v/ d (= lay-idx (1- (length laynmlst)))
* D8 Y+ A7 @& d* z( l( \6 \ );or0 f5 o1 U- n F# V( {5 b0 `3 p
(progn
& E {0 f8 d- j* T8 K (setq lay-idx nil)
) R- S- S0 h" o! s; W* y (setq layname ;|MSG0|;"VARIES")
3 i& W$ W3 Z2 t6 M, d6 { (set_tile "t_layer" "Varies")$ K2 e1 P' P# H% _! Y% Y
(setq layname ""): ~" c* A p6 t _% ~
);progn1 {/ T+ Z2 r2 I
(set_tile "t_layer" layname)1 B _, _4 W4 H g: M. y2 b1 [" p
);if$ m# Y- U- C; u3 g# S5 K- y
; If layer or ltype equals bylayer reset their tiles
9 I3 J2 M* `% ~$ r& Z; }; m, U' I' a (if (= lt-idx 0)
1 B! C& r- G- D (set_tile "t_ltype" (bylayer_lt))
; E! E$ u& e6 B b );if1 q4 h& s3 z7 Z( J# ^6 W
(if (= ecolor 256)
* C: M, j3 Y1 V (progn
$ @, c F: P! w' k4 a4 F6 ^ (set_tile "t_color" (bylayer_col))
0 @: y1 M. P3 I& n- P (col_tile "show_image" cn nil)
9 E* Z8 ]! U1 \ ): g6 G* y R6 P$ ?
);if7 { q$ C7 _$ t' c5 t4 E
layname
1 E8 r( s0 A# Y3 {. ~ );progn, p+ }9 d6 p. G! S/ d
elayer7 W' ?, O* V8 Q8 D+ v q* m
);if
* o" d. U# f4 m+ I. W! ?4 b )
; j! g; e* A% U3 p1 [" G5 [/ N ;;
% t" d# R. Q! J ;; Edit box selections end up here' j8 X" ]& I+ Q- a( y! U4 w2 L9 a. }" @
;;: h3 l3 t% S2 f
(defun layedit_act()
- I% t/ l# f4 ] ;; Convert layer entry to upper case. If layer name is0 s$ {9 B6 ?% k! o5 r
;; valid, clear error string, call (laylist_act) function,
6 w! s* x# c- k( x ;; and change focus to list box. Else print error message.- G, b( u2 j. o' [3 Z
(setq layvalue (xstrcase (get_tile "edit_lay")))8 `1 y# Z( p: _
(if (setq lay-idx (getindex layvalue laynmlst))
) \" l5 s' l" x$ k Q# ~ (progn
0 e, B1 @8 t: U4 [2 v (set_tile "error" ""); D! ]$ [( X: \( Z
(laylist_act (itoa lay-idx))* |; F ?3 L: w6 ]; G
)
! _# k4 R: J" z9 |5 G (progn- K+ I/ {: E/ t! R, w( e
(set_tile "error" "Invalid layer name.")
- t f3 n0 Q" ]. ~4 s0 T: Y9 H (mode_tile "edit_lay" 2)4 U) v' B# f* u
(setq lay-idx old-idx)' \ i# L0 ?, E$ ]
)$ K' [2 X! G7 S% N& c5 V
);if! ?/ }# g2 p' j, F& W
);defun+ D1 `* P8 E) R+ e
;;
) r, d. ^. C( a) { ;; List entry selections end up here
3 }! F; t2 L5 V: a ;;
; F/ n6 T3 i& w1 B/ M% L \ (defun laylist_act (index / layinfo color dashdata)3 }9 X9 W" w! p5 k8 D' [, G, K
;; Update the list box, edit box, and color tile% b$ `+ _: P4 N; C, A9 F
(set_tile "error" "")% a# `' V" B; x
(setq lay-idx (atoi index)), \* U; A& Y. Y5 C- s3 q
(if (not (equal lay-idx (1- (length laynmlst))))
% x! C8 {. e: D5 Z- B (progn
' m* i4 O ~' S7 m' E% k (setq layname (nth lay-idx laynmlst))+ {- ^, _3 m. ~- z; A( W% ]4 e
(setq layinfo (tblsearch "layer" layname))
' i* [/ y8 r3 C (setq color (cdr (assoc 62 layinfo)))! B+ N4 ]0 k+ c) z: c: ~
(setq color (abs color))0 ~5 e+ V# a6 _/ c8 |8 L
(setq colname (colorname color))
& E9 G: |5 X; Q (set_tile "list_lay" (itoa lay-idx))
4 ]0 R1 Y* A2 K( G5 ^1 L6 x( }2 R/ {* [ (set_tile "edit_lay" layname)
8 G: y) a1 `: O: Y ;(mode_tile "list_lay" 2)9 ~$ N( G8 k z: j) A! s
);progn then
2 ?3 l. U1 Y; t6 O/ m+ D/ ? (set_tile "edit_lay" "")
* m" b* R. S+ O+ H$ L" ?' h );if * e3 m$ h _. \: @9 P
);defun laylist_act# [1 [7 T4 W6 W- m7 O K. F- C" [
;;
, {- s% o# N/ t& X ;; Reset to original layer when cancel is selected1 D) B% _5 j0 ^% i& ]5 O
;;+ M1 A. P& b4 }2 `# v0 C# ^
(defun reset-lay ()) P+ k0 d% [+ A' X' N
(setq lay-idx old-idx)0 ^' U/ a# a( ]! k0 p5 i
(done_dialog 0)% h. a: u3 }5 p4 Y" O8 `. j
)3 l* s/ _3 \3 y( C- M3 W
' o' } B& y& z+ p/ Z7 w ;; Checks validity of linetype scale from edit box. It checks to+ X" Q# e6 H+ g9 w; g* N
;; see if the value equals "Varies".
+ k/ F3 p+ ?, p5 w3 H" Q& e" p# W; i- f& j' A# h8 B
(defun getscale (value / rval)
& \& Y9 G3 O* w. Y* ~; L8 { (setq value (strcase value)
% Y( V8 e1 j M6 ] O- X$ n rval (distof value)8 {0 D+ o- s# U4 s1 ?3 F( F5 f8 G
);setq! O7 W0 o* b: P' [4 V# l: j
(if (or (= value "")8 q8 G+ x( c+ J8 u. A
(> rval 0.0)! P( m# e. s9 w+ s; m5 h
)) g# O7 o& R U% R$ r* C, c0 i
(progn& s0 F. p# S& b3 @0 g( R
(set_tile "error" "")( `+ V/ y( @/ [! L h1 t# K1 ]
(if (= value ""), ?6 N! V3 m# S+ u. k; F
(progn/ o& F/ ]3 w1 R6 J/ @7 B" A4 A
(set_tile "eb_ltscale" "")0 |# W" Q: M5 `: X3 ?& H( j8 v5 q
(setq eltscale nil)- T/ a0 x! I. f' L3 h/ T4 x
);progn then8 z7 K$ E& L3 d o$ J6 d- T Y, F! y( G
(progn
% l9 P9 j+ X+ Y+ u3 i (setq eltscale (distof value)), z" w& X" A3 Y
(set_tile "eb_ltscale" (ai_rtos eltscale)). c) C2 b+ C; q# t6 e4 Q0 g1 N
eltscale
' F5 A# [9 D! Z: k9 k );progn else8 _* k, J8 R* ~* p" B0 a
);if
# k, t: Z( n- R. x6 |+ \ );progn3 I1 w2 _+ d, P0 v3 U
(progn
M& m0 q3 N$ ?, ~' i( `* w (set_tile "error" "Invalid ltscale.")$ M( ^4 \, B! ?( C
nil
6 L( q7 t9 A2 K3 X8 a );progn else' f$ E% F. W8 d$ n# e! Y
);if3 a4 U- I' K5 {& s8 s- T4 z# O& m
);defun# S8 }, X' W2 `# L5 m+ v
;;
/ a( N! O3 E: ]8 t z0 S- P ;; Checks validity of thickness from edit box. Since (atof) returns 0 when a( S8 K- F. D1 z
;; string can't be converted to a real, this routine checks if the first
/ y( L) {9 t3 k/ P ;; character is "0". It also checks to see if the value equals "Varies"." `& I" t" G( f& O; ]2 n" p( a0 a6 ^
;;. K" b; @$ g; X a
(defun getthickness (value)9 E. O& H2 Y. Z3 ^8 I9 \1 n
(setq value (strcase value))
' m# K8 g+ j6 A" [; c2 w (if (or (= value "")( ^* [% L1 q) o1 M
(distof value)
7 G9 Z" j$ e; z+ R );or
8 f+ `! j; ^; m" s) K (progn
" w* w' A v0 P, Y* G- G (set_tile "error" "")
$ v$ V# N$ z3 P J- f2 R. t (if (= value "")& L2 A, \0 G7 n$ o5 {
(progn
, S' }, e0 g8 _) t (set_tile "eb_thickness" "")6 \, }4 d, K) V4 E9 @9 |* `# k
(setq ethickness nil)' v0 I# P& Z' [# J) `6 D
);progn
0 t& K/ D0 y; N+ A (progn' ~6 R; N+ L$ B! L
(setq ethickness (distof value))/ M' W( E; U! W$ G/ O0 O0 x
(set_tile "eb_thickness" (ai_rtos ethickness))9 M" y+ h, s, J# W9 y
ethickness# \0 M Z6 [% i* M: E3 w& \
);progn: W5 k' G8 ]: p, l' m
);if+ t/ R( f1 i" V2 l6 B; X
);progn
0 o7 `/ l) a2 o) s4 l# S/ m (progn
" Y% o, \+ W* ~4 L (set_tile "error" "Invalid thickness.")
9 G/ `/ z7 i+ R# B nil. `( W- h- ?7 }9 y- q# {( [6 A
);progn g! l/ }8 F3 {- @2 I
);if
( ~0 H9 \0 X1 d );defun 0 F' l# h% t7 O1 o
;;
# [9 d0 o/ w/ S6 n5 w. y" I ;; Checks validity of polyline elevation from edit box., ~, W6 l, w" {& A! \6 S a
;;
0 [% e: {( j |/ e. |% s2 p (defun getelevation (value)- f5 E/ J* p+ y9 S. s
(setq value (strcase value))
0 [+ W. m9 ?% D4 f (if (or (= value "")
5 D }$ f8 w, S; I (distof value)
* M$ f9 b7 M: k' q )& }# e) {7 B1 R1 |3 b
(progn
" d$ b% H3 y* U0 O& E (set_tile "error" "")
. F3 t# w }9 o( n! u6 Z (if (= value "")
7 _2 K6 \+ C J; v- q+ p. j5 Z' D (progn& y& L/ Z2 m! |# y3 B6 j' C
(set_tile "poly_elev" ""), V' }7 C3 @6 O! f4 N! `
(setq eelevation nil)+ h8 ?* L1 W5 h) ~
);progn2 O0 U, O/ ^1 A0 `
(progn/ q/ [: ?, A0 c8 x2 v1 j9 O# L4 [! U Y
(setq eelevation (distof value))/ b2 `6 y- i* u6 M' W1 I3 b: L
(set_tile "poly_elev" (ai_rtos eelevation))
* R% o) {0 c) X eelevation
' }+ X/ |" c" j" m/ a* p7 j+ k# N );progn i/ b' Y2 H( K1 \
);if
- A& ]5 L; B- {4 u! C+ J8 r );progn
, w3 j9 Q& P4 T# ]2 ^* } (progn' c1 H, G: @2 E$ H. m. u( i/ d& d Y8 d3 ?
(set_tile "error" "Invalid elevation.")
& L# ]# |8 I, O6 t, Z9 x nil
) U, ]+ P+ [# V, ?5 \( N );progn$ \3 M8 H& i6 B# r1 Z* x
);if
, y! ?6 n3 a! ~/ K );defun
$ `6 Y8 u9 s1 B ;;
# |9 G9 Z: Q+ h5 _ ;; Checks validity of polyline width from edit box.
: O2 o! A6 m9 _$ E7 _3 z ;;8 g' M+ Q/ j+ w2 r- \
(defun getwidth (value / rval)
5 O" M5 \- t: d4 P2 L" q/ }: G- S (setq value (strcase value)4 t% k# P+ Z$ f# \- H0 G( Y
rval (distof value)
5 Y0 h: j+ u7 A7 W9 u )
$ I* n) V1 _% n1 V/ I (if (or (= value "")
' r$ i. A2 w/ i (>= rval 0.0): I, f5 M, z6 j* u6 ~
)) \$ D* W) c B- P
(progn! M1 u# v5 D# M" z+ B; h. g' B( [& f
(set_tile "error" "")
" W8 I9 ?: |- B. h! p1 Q& C$ h% d3 U (if (= value "")& n8 j2 e4 ^1 n0 y/ Z& }6 c
(progn- ]$ k- L. N. c3 N5 m9 ]
(set_tile "poly_wid" "")
* E+ I% ]! J& C& \3 Z( B9 Z (setq ewidth nil)' Q6 _/ O5 v3 I C
);progn5 v2 S' g6 _( I7 T
(progn
2 W8 R; E6 D: m' ^7 c6 ^ (setq ewidth (distof value))
, {* B& n, t/ x2 N: G (set_tile "poly_wid" (ai_rtos ewidth))
7 M$ }0 C: H- G0 v ;width
& V9 M# v1 R* y8 q+ h' j );progn( h8 B* G- F; s/ w
);if" y$ \& z2 H: R7 ]" u: `7 U
);progn
) G5 U1 ]2 G6 _( c3 t) K% I4 [% x5 J (progn
1 D2 b; Z5 {* L/ o# w# x (set_tile "error" "Invalid width.")
; L# g) ~" {& I: l" ^! q ;(setq ewidth nil)
2 {5 g6 x9 R+ E i0 t0 K1 U- J4 t nil
8 w3 W p7 T& v! O2 B( y% E+ } );progn
" H$ D% p. \! V& } );if
7 S( P/ P- a* l$ P );defun
( ]$ ?$ j) _' t+ u! @# k/ G ;;
; T$ k9 }9 P; X% @ ;; Checks validity of text height from edit box.
& p; S+ O' G/ n0 B; Q- F ;;
) @8 L" R7 i/ h* R" K p6 A (defun getheight (value / rval)2 e) C" @4 t* m2 u; L
(setq value (strcase value)
, Y: W5 ~0 D8 Y5 Y3 j& g rval (distof value)- [9 q. M& L: x9 P; ]# X- m
)
/ e! |: [, F: i! V9 S; }( m! O* | (if (or (= value "")
& @4 Z$ Y, h: u- ~$ ~5 r (> rval 0.0)
$ C) ~! _5 M) z/ u( K& \ )- M( u3 D8 R' S
(progn+ k# x$ N' `, L6 V# y
(set_tile "error" "")
/ \, P2 j/ o5 @& X+ o# _ (if (= value "")
" m( I1 k/ T; G. e& C. ` (progn- Z6 o6 e# N& ^
(set_tile "text_hgt" "")
; Q% {7 C0 f1 u3 t# z5 R! e; y (setq eheight nil). Z- Z% W* {, @( }1 |7 n, z. t0 Z
);progn
; f6 i$ B! w9 i( B0 P5 j- } (progn6 O2 u( o) x6 ?, }8 r4 }3 g
(setq eheight (distof value))
$ A' B) \' B' S* ?# D R7 d (set_tile "text_hgt" (ai_rtos eheight)); `9 s5 n6 T" ~4 Q% L
eheight
% _- ?4 b9 b( f# I8 b+ f% w6 b );progn
9 l* X: o' T Z5 b M2 ` );if
' i, w0 _& M$ ^0 e8 n; j );progn
9 m8 h1 t. X0 t (progn
6 O* k" O- v3 U! @( r (set_tile "error" "Invalid height.")
9 X% g2 @6 _5 V& ~ j+ t nil
6 y1 o6 Q( k0 n1 P9 M$ z );progn
) ?7 E6 S; Y% D% B6 T& a );if/ s" }( p" x, L, m
);defun q4 g( _! E# J5 ?, V: P
' P8 R$ g# P8 Z2 r
(defun getstyle (value lst / rval)
8 y3 {2 T0 t0 t# W ;(setq value (strcase value))/ z' }7 u% K& T' }
(set_tile "error" "")
% n9 ^4 M4 u# J3 f8 N" @# V7 Y. [ (setq estyle (nth (atoi value) lst))8 i% g- k- v B: S3 e
(if (equal estyle "")
8 O# T2 z3 ~- y! @7 L) o (setq estyle nil)
( N: ?2 R) l. T- s1 r! A6 k y );if
/ S& ^$ Z2 H4 ]+ H) K$ w" Y% N3 _) Y: C7 W0 s9 R e) t4 @
);defun getstyle3 l- ^$ P: e: f2 @% r
9 I9 A- h2 t- u! Z
;;0 m p! G4 I* }
;; This function make a list called laynmlst which consists of all the layer
$ C+ f. l' s7 {: } ;; names in the drawing. It also creates a list called longlist which
4 M+ E3 Z! w( H9 K. _ ;; consists of strings which contain the layer name, color, linetype, etc." l) v& T" v- [- y2 J% |- s, A& J
;; Longlist is later mapped into the layer listbox. Both are ordered the
: H! ]/ H* S+ G4 @ ;; same.1 Z- K m. `: @
;;
7 M- k0 I3 |! u, t+ C (defun makelaylists (/ layname onoff frozth color linetype lock vpf vpn ss cvpname* |0 ]7 P; F& O1 q/ t9 O9 q+ L
xdlist vpldata sortlist name templist bit-702 V1 p+ e* H' `% d
layer_number( g% b2 w/ R1 U+ P2 U. a
)2 w/ u% X9 Z# |; A* n. l
(if (= (setq tilemode (getvar "tilemode")) 0); ^4 C& F0 ^9 K8 W
(progn
0 X; p' c$ Y X4 O% m, W9 k9 A4 x U (setq ss (ssget "_x" (list (cons 0 "VIEWPORT")! F# V* {0 c/ q
(cons 69 (getvar "CVPORT"))
9 t2 `1 ]9 S( i5 R- d )
' J: H G A( t4 I )
- O% ]9 L u7 C4 |; g+ d7 ]7 M5 Q H )
# a( f; i" ]0 p7 t0 o2 o (setq cvpname (ssname ss 0))2 U3 V7 Q- e, Q9 N7 r" B
(setq xdlist (assoc -3 (entget cvpname '("acad"))))5 v+ t) j, V: E Y+ X& [
(setq vpldata (cdadr xdlist))- z; a+ Y9 X% b3 T( [
)
$ O8 h2 J& Z- d0 Y' o% w )
2 @1 C3 y- a- Y2 c/ W6 g" ? (setq sortlist nil)
$ t s" y$ z ]# }/ [% q (setq templist (tblnext "LAYER" T))
" C( m8 c% b- P (setq layer_number 1)% A$ f! o) N2 B7 t
(while templist4 ]: S; F$ ?0 n$ M6 ~& J
(if (not (equal 16 (logand 16 (cdr (assoc 70 templist)))))
2 l3 [; _9 i B* G& a# I! F (progn
|2 k4 i/ u( Y2 Z8 R- E7 M5 M, i (setq name (cdr (assoc 2 templist)))+ J4 q+ ~! a* v: C2 i! E4 h
(setq sortlist (cons name sortlist))2 X- ?' \, s8 [6 g
;; Not dead message...
% x* n3 o" Y* _! k (setq layer_number (1+ layer_number))" E- D8 }, T1 W8 C6 q
);progn
" u7 ~, s7 k& T );if: x+ F6 I: D }. K2 K; u% H
(setq templist (tblnext "LAYER"))9 z/ j; B6 C* `6 k1 P4 p& o
(if (= (/ layer_number 50.0) (fix (/ layer_number 50.0)))
" K! J" Q& c$ S( d! s5 ]% F" o1 g (set_tile "error" (strcat "Collecting..." (itoa layer_number)))
- t# r0 i+ E2 I! \ );if
: S# `& y3 o8 T )) t% ]$ c2 b+ H; }$ S0 E9 w
(set_tile "error" "")& a$ |& a: T, a4 u& l; V
(if (>= (getvar "maxsort") (length sortlist))
( T) a: [0 P, G8 I! \5 F+ w (progn- K7 c3 T. N8 k0 x
(if (> layer_number 50)
& Q) m6 I3 i; v1 |4 Z, ]6 X (set_tile "error" "Sorting...")7 h3 A( @9 z f/ d5 c
)
- v( g6 Q0 f9 U. ^7 W7 V5 N- s& e (setq sortlist (acad_strlsort sortlist))$ h* b# R4 E" l, C) }
)- c) m) q" q3 U+ P$ [
(setq sortlist (reverse sortlist))
. W1 p' X4 |7 Z3 J/ }. T. X- X )
8 N* y+ b# l0 e& f$ |/ {" I. z) }4 P (set_tile "error" "")
8 H1 p# m# E+ \/ E2 j+ H) n5 M (setq laynmlst sortlist)
# I% Y2 h2 t3 r ?" X ;rk 2 W0 h$ I& Z3 i4 t; L/ K, B
(setq laynmlst (append laynmlst (list "")))
4 ?9 |! j% J7 \% I6 R1 r( {5 D
(setq longlist nil)" z0 P! N# e7 ^3 g0 i3 @
(setq layname (car sortlist))
0 E0 S6 E- _5 P- c+ {1 @/ f( C* ^ (setq layer_number 1)8 g4 E* w9 V4 Q/ q2 l. k- f# L
(while layname
# k# V+ T2 q* S- w2 u0 o (if (= (/ layer_number 50.0) 2 C+ L! R) |. W; R( ~1 U- }
(fix (/ layer_number 50.0))
! T* w; t. }$ D6 n( N" k )
: _2 x) L% \* J1 Y9 c; h# n2 T (set_tile "error" (strcat "Analyzing..." (itoa layer_number)))$ ]) b/ q$ n* M% D
);if
, T4 M5 A& h) X$ `8 h* G- P2 F (setq layer_number (1+ layer_number))5 B1 a1 V& ~; M% x) Q% r( f
(setq laylist (tblsearch "LAYER" layname))+ I6 D& g- z! r
(setq color (cdr (assoc 62 laylist)))
+ I' E/ K1 F% K9 D (if (minusp color)) w1 H$ `# y! Y. A
(setq onoff ".")
! K; \2 a& a- z4 g" Q& i; `- m (setq onoff "On")
; |# {5 f' R9 D, d )
/ u- A8 n6 @+ E# g (setq color (abs color))
: z0 h+ C: n7 ~3 L8 W. T' {9 R' u (setq colname (colorname color))
8 t( M% R7 f: o4 f2 ` (setq bit-70 (cdr (assoc 70 laylist)))
0 r9 w" z9 F! k2 ?7 r$ \ (if (= (logand bit-70 1) 1)' z. L9 o/ H0 y+ k I f) a+ l5 p$ k
(setq frozth "F" fchk laylist)
& }* l# U# }- Y0 l; W7 z2 P (setq frozth ".")
, R1 Y# ^+ x7 p( t, B )1 s; ]' o' r8 g& X6 F
(if (= (logand bit-70 2) 2)0 t1 t b" b' A- G8 Q/ M% t# h; f
(setq vpn "N")
$ u8 A% o0 H, Z0 L0 D (setq vpn ".")" x& T8 n* q" ^% }) q5 f/ z
)
$ |$ f4 K6 T2 ^; T (if (= (logand bit-70 4) 4)
3 p+ K/ V) Y7 r ^ (setq lock "L")# i0 w2 ]" ?. P! I! M v3 v
(setq lock ".")7 F: u5 A0 M$ R4 F/ u
)
5 z: i8 b; L/ H- K% p$ s (setq linetype (cdr (assoc 6 laylist)))
2 n: E) t! T9 B: k (setq layname (substr layname 1 31))# z: r6 s% S" G, l
(if (= tilemode 0)' n9 c/ |6 I5 E
(progn
0 d- y3 g' ^4 P& ?& R (if (member (cons 1003 layname) vpldata) P- ~. K1 g, N7 L
(setq vpf "C"), g, L9 }+ I. d$ O+ o7 Y
(setq vpf ".")& h- C \7 u1 [. x" U8 a3 H
)
, _% z5 f/ D2 i6 b' A# J )8 [; Y( a; T8 w6 L5 D3 a+ s4 M+ A
(setq vpf "."), X# _; I: a- _' n5 o3 o
)
5 K; \1 e! `2 A (setq ltabstr (strcat layname "\t"; e3 b& y5 E1 F
onoff "\t"
- l, e6 y: F1 v: P5 s0 s- f frozth "\t"; v0 `8 V7 J9 b, h
lock "\t"* \8 {, W' e$ R. E
vpf "\t"% W% I8 O8 S3 @4 K6 d! O
vpn "\t"" _* c) Z' m& K4 W" m- y2 a
colname "\t"
& O ]' @( P1 a& p/ n/ `1 o6 @ linetype
7 i1 O7 n7 A# v5 c1 ^1 X4 m/ l7 _ )
- D! c# g! Z1 X3 p* R )
+ u! \! P' U7 v( ]9 Q$ c6 a, W# q a2 R (setq longlist (append longlist (list ltabstr))): X3 }, x2 ]+ @$ j2 @
(setq sortlist (cdr sortlist))8 i; \2 \9 ]6 D
(setq layname (car sortlist)) c ~" |* I% I6 J" N& U
);while) v6 E7 Q' D7 z& |1 u6 E3 c a
(setq longlist (append longlist (list "")))
% B: X0 r( }+ Z (set_tile "error" "")
T9 X6 j; O7 A: B# z1 Y1 F )9 M2 o1 L% Z5 T
;;
5 m8 ?3 t2 r9 x9 U8 j ;; This function makes 2 lists - ltnmlst & mdashlist. Ltnmlst is a list of
1 r4 g3 F) K. j' J1 D ;; linetype names read from the symbol table. Mdashlist is list consisting
" p# B/ Y' q7 K' S9 X- }5 h) ^ ;; of lists which define the linetype pattern - numbers that indicate dots,
5 c# O# s' c) g: `: f# e6 E ;; dashes, and spaces taken from group code 49. The list corresponds to the
) `. R$ l# l5 A8 p) Q ;; order of names in ltnmlst.6 s0 |- u a) C5 ^
;;
# x$ k4 U5 ]/ Z, C# _4 v5 w (defun makeltlists (/ ltlist ltname)% S; m) e- L8 C8 e6 ^" p
(setq mdashlist nil)
/ L% |% w4 N2 f- m% G' _# C- r (setq ltlist (tblnext "LTYPE" T))
: w3 r, F& A! v7 I& ~4 k (setq ltname (cdr (assoc 2 ltlist)))1 J9 m8 {. [6 ~1 a
(setq ltnmlst (list ltname)): T9 s5 @& z9 _7 Z
(while (setq ltlist (tblnext "LTYPE"))
6 L0 E( T' g* M4 w. @2 a; q (if (not (equal 16 (logand 16 (cdr (assoc 70 ltlist)))))
) H# u' ~/ E- V% h- E (progn
/ `: }& K$ h, Z$ h7 L* |8 Q3 X (setq ltname (cdr (assoc 2 ltlist)))1 k: s7 |. g$ J$ d) Y
(setq ltnmlst (append ltnmlst (list ltname)))
0 G. A) B5 O% t2 @+ ` );progn
# ], f+ M4 z# Y8 o$ j. k" z+ D );if 4 p! D" T( m& h$ \: v3 h
);while- _' x+ i) U' o+ f8 ?
(setq ltnmlst (acad_strlsort ltnmlst))8 G! ]3 I8 x4 Q1 V+ l
(setq ltnmlst (append ltnmlst (list "")));add by rk
' S4 [; b/ x% ]" j3 `6 C- ` (foreach ltname ltnmlst
, m5 n3 P* Y9 r6 x, T$ O; }. F6 V (setq ltlist (tblsearch "LTYPE" ltname)) Y" W2 \ P4 @* w5 G
(if (= ltname "CONTINUOUS")
. S. m8 P" w: R, C% F (setq mdashlist (append mdashlist (list "CONT")))
) {+ D) c3 ]5 M W& O2 E (setq mdashlist/ u5 ^9 y2 o6 Z* [! I5 L2 K' [
(append mdashlist (list (add-mdash ltlist)))+ q/ p8 }! V/ e* s, t
) i2 p$ m1 O7 \& f
)
/ T" o/ }/ V% ] )
2 i4 t4 y3 @, O5 B! P5 _. L (setq ltnmlst (cons "BYBLOCK" ltnmlst))) x9 W" q& C S: j' w
(setq mdashlist (cons nil mdashlist))# E4 D. s1 I* A( c8 S6 o
(setq ltnmlst (cons "BYLAYER" ltnmlst))
- [, v# J' v% V% Y! l$ r3 ` (setq mdashlist (cons nil mdashlist)); z/ n; Z/ H1 n" C4 O% _( j5 k
)+ ^8 Y& p/ ?; u2 e8 K! s
;;
+ M' d' x1 X) M- Z+ K7 @* I ;; Get all the group code 49 values for a linetype and put them in a list
7 C8 H- k% h/ \. G7 k5 S! O ;; (pen-up, pen-down info)$ X' K2 L E9 |; h+ q* m
;;2 g. z ?1 S3 x- K" a
(defun add-mdash (ltlist1 / dashlist assoclist dashsize)
, I1 X M: g6 h: [& ^* u* V0 F* R (setq dashlist nil)
2 h7 N( O: g3 [. \+ R8 v; E% Q (while (setq assoclist (car ltlist1))
" w& u+ S6 j h! k (if (= (car assoclist) 49)
2 U9 s9 I: S- r6 p9 w (progn
1 L! q( Z' d+ L3 J' V9 h (setq dashsize (cdr assoclist)); K5 Y3 L: I3 e
(setq dashlist (cons dashsize dashlist))
8 j2 b$ G- q- o+ e! L6 E )
; j: O5 C4 M0 }* W )
% [6 ^$ o* e2 ]$ V9 L) W) u3 h) | (setq ltlist1 (cdr ltlist1))
8 G; _9 ?' ]/ L* G" k# H+ } )3 a9 w& y V* \8 c$ }
(setq dashlist (reverse dashlist)): n8 _2 D( M* Q+ Q
)
: z! S% D L0 l) `6 w% c( { ;;# A0 X' r. [8 l1 l# h; ]3 t
;; Color a tile, draw linetype, and draw a border around it9 J- u" W% N6 t+ e& P
;;
$ ]' H; M( ^3 z0 [3 v4 |# E' F (defun col_tile (tile color patlist / x y)" q7 z2 E4 B/ l! o u8 Z8 R
(setq x (dimx_tile tile)). \& f! [: V# s4 S* F) m C
(setq y (dimy_tile tile))- j& r+ ?3 |3 B; [ r- i( E. G4 K
(start_image tile), }/ U* J& b# z& H
(fill_image 0 0 x y color)
- o7 I) A, g5 [3 [7 ?" Q3 ? (if (= color 7)8 ?. [5 }" U y1 M( ~: l
(progn5 z( }: `2 M' o' O
(if patlist (drawpattern x (/ y 2) patlist 0))
3 I, o; |/ Z* I) O$ _+ ] (tile_rect 0 0 x y 0)
# X+ t" W" k$ A# u. ^# U )" K2 f5 h3 e' o0 w. G; a9 i' a1 p
(progn8 t- y1 j( S0 i6 X5 S
(if patlist (drawpattern x (/ y 2) patlist 7))) M+ B2 t% D, }: g3 N n
(tile_rect 0 0 x y 7)7 c$ v* I$ B* k5 X( L
)' n& R" n. z# n7 Z( |7 q2 ^
)
. H% w$ ?" \" b, p4 w1 _ (end_image)
5 w, G& o6 O: o$ U )
+ |& D$ K7 Y* U; ^2 h6 b ;;
- {% p4 k; j* y! o7 q ;; Draw a border around a tile4 S' }7 G% C0 h- _4 `/ l
;;
; e! W0 X6 B. ~1 @$ k (defun tile_rect (x1 y1 x2 y2 color)+ ~* j: z1 a$ x- t1 {) B& l
(setq x2 (- x2 1)); J0 e: r9 M# z: {& Q$ B) g
(setq y2 (- y2 1))
( }- g/ m" g) w' V0 ~ (vector_image x1 y1 x2 y1 color)
3 ] D _+ k& W6 |& h (vector_image x2 y1 x2 y2 color)
& I3 u0 q5 e( a+ k( a2 [ (vector_image x2 y2 x1 y2 color)
- L/ I5 e a" `, U* E (vector_image x1 y2 x1 y1 color)
# V2 s0 {5 v7 j4 N: N/ K ); p3 l$ o; ? b. a/ @4 y1 S
;;3 b [5 a6 I+ Y4 y; T# e+ M$ `
;; Draw the linetype pattern in a tile. Boxlength is the length of the image7 @. _" H7 O x" E( S8 H: F: ?% _5 b
;; tile, y2 is the midpoint of the height of the image tile, pattern is a
) v5 R' H/ F+ X* G% A8 E ;; list of numbers that define the linetype, and color is the color of the. l, ]* Z7 p7 u8 y. e! X
;; tile.
6 v' Y1 |9 L2 @& n$ L3 E) ?; L ;;
7 w6 c% P" a/ S. Q (defun drawpattern (boxlength y2 pattern color / x1 x2! q& R$ ]7 X \4 O4 H
patlist dash)4 {" m' V4 b: {7 ]
(setq x1 0 x2 0)- k0 j- m0 K9 G7 q/ T i6 V5 z. F
(setq patlist pattern)
! L( M9 [* E. s+ [$ } (setq fx 30) [. x, I8 o' L! A2 M
(if (= patlist "CONT")4 N# ~$ c# d" x7 b
(progn! j! P I( E: i
(setq dash boxlength)+ X+ C! [4 b, b' W4 @. ~9 a
(vi)
7 ?' F) [+ z3 O1 X (setq x1 boxlength)
; Y w6 a7 m! y3 @+ Q( } A )
* X H, L0 N6 r/ p7 n# ^5 J2 @ (foreach dash patlist
3 H3 Q, S: K6 r8 y (if (> (abs dash) 2.5)% y2 [; v7 I v- z6 x7 p
(setq fx 2)- E5 M4 u# s* S3 }2 F: M6 O: l
)
) h7 M" s5 C) C. U6 T5 W2 _/ n0 ] )
8 J! t3 F9 M+ g) r: ^; x9 u )- W* p- f- S% Z. q1 u8 }
(while (< x1 boxlength)
3 R- \. ], M9 B7 {3 B (if (setq dash (car patlist))
# V, ?! C0 D% U6 c9 R% T/ m (progn
2 J+ n$ F1 N3 T. \; B2 U; W (setq dash (fix (* fx dash)))
8 [ [2 z, f$ R5 \: _3 I2 v (cond
$ C7 g3 |5 i. o5 @6 N: ^8 r% I# K ((= dash 0)) ^. [6 p. d3 f" g# F5 e3 J# B$ t
(setq dash 1)
2 A6 s5 a) y M- s (vi)! c0 }0 a# P n$ c, S1 B& }
)! o& y' j) G* I6 `$ }7 Z- Q
((> dash 0)% n* L0 Z* ]8 U% Z I
(vi)
6 \3 b- ^! x/ b* r )8 a5 y0 {. e9 g# i$ G5 W ^
(T$ `' m# [( E2 I' P
(if (< (abs dash) 2) (setq dash 2))5 o# S! P# q$ b W
(setq x2 (+ x2 (abs dash)))- f* \4 E4 l# ]3 h" \- y
), f* M6 Q8 n" z6 g4 j
)
7 G9 ^$ Y* W" Z! n5 t (setq patlist (cdr patlist))
/ X1 ` _* x- N1 G# L5 X5 W' ^ (setq x1 x2): `+ E' h2 W/ W* d, A5 Z
)) e8 w/ p6 x. z9 q& ^$ z9 a
(setq patlist pattern)
; X4 G+ x. V% I$ ^& @ )& D+ I8 L& J2 H. v- l& j2 e+ R
)2 l. ]+ g& k$ i& n1 _
)
# N+ O+ T K! U L; Y% o ;;
$ w! d# k" x0 r4 @$ d7 Q! a0 V6 D `+ c ;; Draw a dash or dot in image tile
6 X% R+ S# r# t! x8 i* y" l Q+ L* ?. t ;;
1 |9 z; T5 Z$ n4 ^! ~9 D (defun vi ()
( ?$ @& E0 w) U' _9 K% [ ? (setq x2 (+ x2 dash))
. {- p3 l: V& ^- J' t1 B$ u (vector_image x1 y2 x2 y2 color)+ `% ]7 W7 F/ T. J5 [, D
)* f2 V* d, I5 G, U. Z8 q& v
3 h) W( O) f+ J( ~6 M
;; This function takes a selection and returns a list of the color,5 p5 Q; l4 s ^
;; linetype, layer, linetype scale, and thickness properties that
9 r# w& K' F9 i' l0 w ;; are common to every entities in the selection set - (color
2 N5 `8 T- ^* J& \* x ;; linetype layer thickness). If all entities do not share the same; b' _- i' A5 d3 t# F, `
;; property value it returns "Varies" in place of the property1 W( g* v( M; h2 i
;; value. i.e. ("BYLAYER" "DASHED" "Varies" 0)
4 \8 _- {. b, A6 Z! }) q; m ;; The last item in the return list is an integer flag for the
) M: X3 |- X8 d/ k5 c& y" q ;; homegenity of the selection-set object types.
0 Y; Q" z) {8 Y* P ;; 1 = All polylines, _5 Z) [( W. b
;; 2 = All text or mtext or attdef, or a combination of the three
/ A' L+ g/ [4 j$ e, d- P ;; -1 = Any other mix of objects
& J% L+ w6 T- H7 e$ X/ g- c8 |" l3 t3 s2 z9 a+ j
(defun getprops (selset / sslen elist color ltype layer ltscale thickness
' @: O! b: |0 a6 t width elevation height go ctr $ N7 r2 @6 B. z/ i
eflag
% b4 |5 x3 M4 q6 N [0 f0 m* Z etype temp & ~8 ]# L- U' [+ S- U- d
txt_ss ;;;;rk 11:24 AM 1/30/97
( X) C0 @1 A- o! h: U$ v" U0 C( q) o tmp
) w) R! ^6 G4 }3 e }+ y poly_ss 8 s1 ~4 @. j5 u, b
style
; V% W3 D+ n8 H5 u/ ?5 X9 M )
" d/ x- x$ X" W0 S% v7 |, O: H* d$ h A( e2 S
: e" R, P' [# C9 n
(setq sslen (sslength selset)
" ]2 ^+ L7 C7 k4 e( ?( V elist (entget (ssname selset 0))
3 R1 H) k Z* x3 F; _9 V ^ etype (strcase (cdr (assoc 0 elist))). l. l8 b" ]. d: f% ^1 }; Y% k0 A; D0 a
color (cdr (assoc 62 elist))
W1 U6 E1 g$ [8 i- z ltype (cdr (assoc 6 elist))
2 X/ E4 \, w n) O" z- W layer (cdr (assoc 8 elist))8 F, q: W4 i" D" j: O
thickness (cdr (assoc 39 elist)): s* K; Q3 N/ H# P3 ?' u
ltscale (cdr (assoc 48 elist))
3 F; ~4 U- ?& u0 G! n* T3 u; M- G );setq2 k6 U& o9 A# u; E
, M) e, W" R: j5 G (if (not color) (setq color 256))0 ]4 |# Y$ n. q/ z; C
(if (not ltype) (setq ltype "BYLAYER"))8 b& \4 D; G7 e1 w& N3 |5 Y
(if (not thickness) (setq thickness 0))# g0 @6 V9 s9 n3 M; p/ H9 f
(if (not ltscale) (setq ltscale 1))0 k% c$ P$ S2 s, j9 u
7 x8 f# }% }. \7 Y
(if (not width) (setq width ""))
) l2 T* _) _; w* W+ m% q! Q (if (not elevation) (setq elevation ""))+ k: R' D4 E5 E+ x& x- s* ~( R1 B+ X
(if (not height) (setq height ""))4 j8 q, c3 p/ U" }2 A. k/ d; W
. ^0 ]$ _# O" g* | (setq go T
* a. L$ d/ b B Y chk-col T
5 w5 ] c! H3 y6 G/ d chk-lt T 7 G" `( T- K$ K6 t& N, J/ z
chk-lay T
* y2 c6 r0 \% Q |7 h* a/ ? chk-lts T
: O( e- w% c R& L! B4 h chk-th T
6 O# e# ?$ ?8 G$ J% q: C( [ ctr 0) W: {6 n7 ]/ r% O! l
);setq
% c; g. a: ]0 _2 @( L+ R* R5 [! q% s8 P: N7 N! q) g
;; Page through the selection set. When a property
. n; f7 h, W1 m2 E; J1 n9 a ;; does not match, stop checking for that property.- k6 r, \7 x+ D! ?8 v6 j8 H
;; When the selection set is not homogenous, stop checking.
9 _- t1 P! X, [; V# z ;; If all properties vary and the set is not a type 1+ z: ?$ R3 c" e$ h
;; (polyline) or type 2 (attdef/text/mtext) set, stop paging.# ]# K# d+ s3 ~) C8 g Q
" y! e8 g. A( j% Q" _- g/ ~& f- j ;Lets set the eflag so we know if the selection set includes any 6 C& `. M: }! S& o: T
;combination of polylines, lwpolylines, text, mtext or attdefs.( j' I! F6 S# O: q& i
9 p0 D+ N0 ?$ [" B& l+ n) q7 F; @2 f
;watch out for 3dpolyline and 3dmeshes here! @rk 10:17 AM 1/30/97 j5 T# e+ c# v1 T3 a
(setq eflag 0)
, o; h' s- x* {% _) e8 N+ U- i4 ?+ q (if (setq poly_ss
6 g9 w( ?* z" h5 _ (ssget "P" (list '(0 . "*POLYLINE")5 X+ ^4 j+ j0 ^1 Q, E
'(-4 . "<AND")
" a' Y5 x) }/ m$ Q '(-4 . "<NOT") '(-4 . "&=") '(70 . 8) '(-4 . "NOT>")1 K0 ]& S; B' h' p! G
'(-4 . "<NOT") '(-4 . "&=") '(70 . 16) '(-4 . "NOT>")
: B7 J6 z9 y4 | '(-4 . "<NOT") '(-4 . "&=") '(70 . 64) '(-4 . "NOT>")3 U r! A6 a; t0 Z9 h4 [; p# z# d; {
'(-4 . "AND>") 6 U4 C m/ q( \4 S& x Y
);list
+ P t5 g) T( C1 G+ [ );ssget get 2d polylines (legacy and lw)* B4 y o( t& U5 |0 R+ i. u
);setq1 \/ J9 d! T. [. u6 ]$ c/ d1 M7 K
(progn7 U# ?# p% @% r6 y8 s& E& ^
(setq eflag (+ eflag 1))
& I0 z* V+ a/ G+ _7 _: R; X: d" l$ \* z
(setq tmp (entget (ssname poly_ss 0)));setq
' g: L2 Z" h% t$ w4 B$ N
( F9 m& [! Y- g/ E5 J {$ t$ S (if (equal "POLYLINE" (cdr (assoc 0 tmp)))/ M- v: T" U+ U( a& x
(setq elevation (last (cdr (assoc 10 tmp))))
4 z: u U4 b0 G2 Z: k. N (setq elevation (cdr (assoc 38 tmp))); o: z7 Y, k1 x
);if
% }2 P- s: T3 ^ (if (not elevation)% G: P- T9 m' }* c3 [8 b" x6 b. ^; J
(setq elevation 0.0);setq/ K- M: J6 C- ^( \2 `# C* ^4 y* D
);if8 z8 B; Y4 n9 D1 {& G2 A+ C6 `
$ ?9 `+ I; G4 J (setq tmp (ssget "P" * V" w1 q. N1 c) F/ ?
(list ( K+ s9 a W$ d1 P
'(-4 . "<OR")
% Q8 f6 ], {6 H0 @ '(-4 . "<AND") " G& |* ~2 u* k
'(0 . "LWPOLYLINE")
1 }, ^# S- E; `0 U- u% a. F (cons 38 elevation)" M6 `9 t0 n4 G o
'(-4 . "AND>")8 z+ N* I+ m0 Q! b: `0 q; Y( H& p
'(-4 . "<AND")
, y( ?$ U, |3 S% J4 {; I& V& ]; {" H '(0 . "POLYLINE")
' u- |, w. D$ }$ k' W '(-4 . "*,*,=")
0 C0 X# Y+ r! J8 b7 j* B$ B (cons 10 (list 1.0 1.0 elevation))0 H2 K3 r: g; W! l
'(-4 . "AND>") 5 v" F4 {- R2 x
'(-4 . "OR>")
/ m ^1 f: o5 [# u );list8 N- G# d' X+ B) k; P3 Q! f+ {
);ssget+ {! E) ?2 C8 y2 o
);setq/ {8 s# ^7 Y$ G; z2 b
( I1 b/ G' l% G; D( S" \$ S
(if (and tmp ! d7 Q; U, n9 D9 L* u | P
(equal (sslength tmp) (sslength poly_ss))
, c7 z4 A2 ]4 ~* j0 Y* v );and
1 p/ t+ c" [5 a: A7 S& N (setq elevation (ai_rtos elevation));setq1 B) a3 ~7 ^; I( ~; x2 A
(setq elevation "")
2 T- |* X# y7 K! c# f0 g$ Z: | );if! e$ ?# P# V2 q. h# }+ l& z
! [) y2 k B& H/ \0 z) g; P0 a (setq width (pl_width_getter poly_ss));setq4 Z5 l# D% v$ b# ]3 E
: p8 S* M) |" D, \ );progn then 2d polylines and/or lwpolylines are in the HHHHHOUSE!: ?2 G2 k( Z9 P9 n5 R. W/ b: H
);if5 G% j g% W2 q
(command "_.select" selset "")
- `5 b" B8 x4 H9 C% ^& _ P6 W- z, M# V% x( z5 `
(if (setq txt_ss , V z" y3 E7 c
(ssget "P" '((-4 . "<OR") (0 . "TEXT") (0 . "MTEXT") 9 F; K/ y& y# c2 J
(0 . "ATTDEF") (-4 . "OR>"))
# v/ v& A! S. h$ T6 b )
8 `7 n& J2 }; k! D" k );setq
3 m3 T* L1 m" t% g* L. w* V (progn8 M: x: |) @4 I8 R+ k# X& \
(setq eflag (+ eflag 2))
5 n, i1 r0 b( W1 v% K% B (setq height (cdr (assoc 40 (entget (ssname txt_ss 0))))) W$ g( r* D' L% v. i
tmp (ssget "P" (list (cons 40 height))) d5 P5 U6 c( }2 k% w
);setq 9 H# T2 z6 n. Z" O; \4 \0 E$ M
(if (and tmp( z) H. |1 O3 p' g E
(equal (sslength txt_ss) (sslength tmp)) % n: e! _. c+ n9 j8 @. L/ N
);and
2 r: o( U! G9 H( L" a. A (setq height (ai_rtos height));setq ;@rk need to translate from float
( K4 e: C& f( U2 X' s9 d1 R ;to string and back again easily
% {5 t: l, |! U1 E! i5 e (setq height "");setq else the height varies 8 N- Z7 ~( N7 m* F& N+ v/ E q/ \
);if0 ]& {$ O* A: P: Z. f
(command "_.select" txt_ss "") ( l% C% _- Z" l; ? k
(setq style (cdr (assoc 7 (entget (ssname txt_ss 0))))8 i/ J9 X: W9 L1 D4 c
tmp (ssget "P" (list (cons 7 style))) 0 m h! B* x7 L
);setq & M& i D' `! ~5 c& s
(if (not (and tmp8 |. H" s$ I b& \5 l; l# H- i& _
(equal (sslength txt_ss) (sslength tmp))
- l. c7 F6 q+ p) C# A: N: r3 h' g );and
- ^# s' Q" T l7 v6 S );not% A- c- V: Q2 d* F8 F2 x5 H2 Q
(setq style "");setq then the style varies - |, V8 i( |" {. G6 k
);if6 v1 j! V- b0 t7 t) X+ s% O& q/ | u
);progn the text type objects are in the selection set2 Z1 N+ v4 w4 f, r, _3 I
);if
: r: U# b( Q: M3 f4 t. ^ (command "_.select" selset "")) C: W" n5 p6 ~5 T2 M- B% l
% J* \2 l/ z; G
(while (and (> sslen ctr)
, Q! f5 |) j% ~ go
7 O& w8 d, b* m& ?. J );and# h0 j! d' L4 Q5 T P
(setq elist (entget (setq en (ssname selset ctr))))
* N0 d. l4 S6 f, B7 `/ D4 [8 d9 r) Z% {1 j' s
(if chk-col (match-col))/ r; Q0 n/ l: S, ?
(if chk-lt (match-lt))0 r' S3 `; X/ b2 A
(if chk-lay (match-lay)): D( P5 @% l; D, m' H) p
(if chk-lts (match-lts))
! @, O+ g( C) b0 H6 ` (if chk-th (match-th))% `. s, j3 ]1 L- y7 M
" h+ {/ D3 c ?0 x! n" H- _ ;(if chk-etype (match-etype))
% c9 K: C8 a. g0 |
- v+ k) T+ X" Q. U (setq ctr (1+ ctr)): }9 ^8 W& r% i0 M0 a
(if (and (not chk-col)2 t0 u+ X) M2 Y* T& q# ^
(not chk-lt)$ \$ d. \' C/ {* o+ A: @
(not chk-lay)- F3 m2 \8 a; A# `
(not chk-lts)6 T& F8 m3 M; ^+ M
(not chk-th)
5 h# V$ t! U7 v; e2 i ;(not chk-etype)
& K [, C5 {# i2 v$ p );and
$ ~& B _5 ~9 e J/ [$ P (setq go nil)1 S l5 M6 n, k9 \ K% R% _: M
);if4 @ A# f: L0 K+ Y4 C
);while
" e- Z5 F- m! J5 P6 m V9 b1 o, S8 `: n; Y" M" [; B
(list color ltype layer thickness ltscale
" L8 ` T- ~ G4 v width elevation height eflag . q! \- ]& q0 |. ]
style poly_ss txt_ss
) E1 ?2 s* Z/ P$ H/ ^3 `+ s+ y: } )" L7 ?3 [9 X# z7 k0 ^
);defun getprops
! H o3 v* u/ J7 ?9 o, \+ Y. U( t2 r' L& i# H q
; This is a speedy little routine to tell whether the polylines in
/ J: T) M( {! r2 O& Y ;the selection set argument are of varying width or a constant value. * z9 X# U, ~, M- s2 m: A0 K
;Looping through the vertex's has to be done for old polylines when
5 ^" N9 X6 o$ D, k7 F( I ;the polyline header has width values of 0.0. Basically, in this case, 8 }: I( V4 I2 W. X/ f
;information in the polyline entity header is abmiguous. Width values / H$ V u4 _- B& t. V
;of 0.0 in the header entity could mean the polyline has a constant
8 Y- X! q5 m9 e- L ;width of 0.0 or it could mean that the polyline has vertex's of varying $ R$ ]0 J# Y/ I H |1 {0 G0 ?
;width.
4 P! {- ]& o: h2 d" Z- r ;, o" S8 i8 |( J' b* \
; It's all in wrist. Err a.., I mean it's all in the 'if'; K8 H; u- a) r. m4 t/ `
;;3 n* P( T$ M5 A& C6 o" o
(defun pl_width_getter ( ss / ss2 ss3 n na e1 width width_a width_b flag flag2)0 _& ]% j Y6 [# e. e; }0 a
" @( Q. d9 c9 w3 B& |
(if ss
. X" V- S6 u' b! O (command "_.select" ss "")
. Z0 n" c7 X g- n2 q' r );if
$ ]5 G3 N6 P, ^/ C' m3 ]% W2 m (setq width ""1 {5 x; S& B; I5 }
flag nil
; s( ?& X/ Z8 n* h5 O# @: U: } flag2 nil
8 d1 j. s7 |# ~ );setq
; P2 L6 j( G( @2 t1 c (if (not
0 g- W7 b, G X+ Q/ p- \1 H (and ss
3 O+ p( \2 ~9 O, i! f7 A% r( b% y (setq ss2 (ssget "p" '((0 . "LWPOLYLINE"))));setq
3 S5 r5 v' G5 K) e& ~# K (setq na (ssname ss2 0)
( H) s0 n8 f$ x7 V: O width (cdr (assoc 43 (entget na)))
5 r+ \/ q( R2 @8 h );setq$ b7 L# I; H2 o% a
(setq ss3 (ssget "p" (list '(0 . "LWPOLYLINE")
5 r1 _5 v4 _$ f9 s8 N (cons 43 width)
% i3 G* Y2 ?+ H7 C; } );list3 u; L7 V1 }& @9 V2 r; c1 ~7 S
);ssget
3 T6 j+ u" w! ^$ u );setq
- |3 L" H% G) P" M# H' ^! D (setq flag T)
' \9 a p* m5 `, _( D7 r- S (equal (sslength ss2) (sslength ss3))
4 X/ M Z6 z. [; l$ r );and( k$ q0 `" J- `* o- [2 X( o7 R
);not) b' N/ U( y' @7 Y; J+ i/ Q
(progn2 @. F1 Y! g. n ]
(if flag4 R2 O( t9 U( S3 I2 @- D6 C
(setq width nil)
% g' m7 r# c$ ^ );if9 P: k: ?. P' I; t
);progn) W' X( P8 u' t6 D
);if # } y. y% e7 s/ i: |1 c! E
6 T$ F7 P. W; Z8 M- B9 B" V
(if (not
/ Q5 L' ]; c# z (and
2 i5 c3 n& j, Z$ W" {2 t9 I ss" ~; L; J8 O5 \' ~
(progn (command "_.select" ss "")
/ O; \$ B, \: X$ e (setq ss2 (ssget "p" '((0 . "POLYLINE"))));setq* H9 ?' N, A4 J; i: p8 n% ?3 f" o
) 3 O$ i% M2 R" I/ g
(setq na (ssname ss2 0)
. Z( |0 U# H6 d5 o. T% ~ e1 (entget na)3 A+ s8 @" _" K% j) D P9 z0 B
width_a (cdr (assoc 40 e1))
. E' V. v2 U. F* w+ J4 _ width_b (cdr (assoc 41 e1))
' b3 ?' b# w- l1 J5 l( B& p) T );setq
* ~8 G1 @8 W' s6 D+ e" u (equal width_a width_b)4 Z, \* v9 F6 |4 `$ n" ^0 u
(setq ss3 (ssget "p" (list '(0 . "POLYLINE")
8 v7 [2 o2 g* |1 n (cons 40 width_a)
% m; b, o& r& P (cons 41 width_b)
3 ?) G6 k8 k, y& s );list* G8 v0 y' O% f9 \* Y) g5 X* _; O4 B: J* [
);ssget) L9 d8 e3 y: k- I; X
);setq
: u( G! A& S: Z- P. g (setq flag2 T)
5 i' b" B+ i; u: U6 R, I4 q% r (equal (sslength ss2) (sslength ss3)): U$ G8 w. n: O. E) P7 `
);and
$ \/ d4 a) b4 B );not
- D0 ?: s/ \3 i7 B# U# \ R (progn
" I# ?( b, w$ E6 e3 ]; k! d3 t (if flag2
3 J8 g! ? E) x; J. Y+ G4 Y# } (setq width nil);setq" C3 k" Y6 J. O2 I+ D
);if
8 s! K: Y# C& ~+ l) Q );progn then
: z% f- _+ D4 Y1 g: c) g8 r (progn
2 } i7 `4 E5 i" A3 _) B! o (if (or (equal width "")
) G3 G f* w$ N (not flag)% v4 u% P |) l0 N* o
);or
. ~- }. i$ w4 e# B. m (setq width width_a)
& k4 e# L3 j6 a" d5 O6 D& `; k (progn# v1 I. C: b+ ]4 C* F# ?5 `" J2 N
(if (not (equal width width_a))% G# a* ]. c6 p' ?. u- e+ o6 o" A
(setq width "")3 ^' G) w5 o# M4 w, v" L
);if 8 D7 T9 X+ q) c& U3 x9 z0 m$ M: z
);progn" z( O- N' Q. H7 U8 C
);if
4 ^: j3 e& B! o );progn3 ^4 @0 T' l% }& W5 `1 j
);if
+ k% @2 k+ Y4 w& ~- A0 e- x7 P, t! q+ {: ]% |) K+ u$ |9 u2 b
* a- I. Y. M, [9 {! e, u ;now for the special handling for old polylines
( u7 a2 f8 ~6 l3 F" {) w (if (and width
7 e2 D% C* r. w' `# a- J3 N7 n (equal width 0.0)& l, Z9 l2 L# `: @; w
flag2
W. W7 l- B$ c );and
2 e6 x0 i0 w! N' Q( o (progn |# t( B" A) K5 b
& p' D: t6 S! j O (setq n 0);setq' K+ ^. A: H G7 p# S. T9 a
(while (and (equal width 0.0)6 N7 {/ G3 l' _. @1 q
(< n (sslength ss3))
2 C7 a4 K6 P: n+ P0 P% r0 q );and
1 _2 o' Z5 i( `9 r# L: V4 v# E3 Q2 S, u (setq flag nil0 ?! V- }" c/ D- x; x" x- t
na (ssname ss3 n): y: A( n8 Q3 o. O9 {
na (entnext na)6 `* R p+ i/ n% d# M4 f
e1 (entget na)' G3 r4 x B* H; c c& c0 Z
);setq
3 A. A" e6 o5 v% H( @ (while (not flag)
" D7 A7 D' Q l7 h/ j! {4 J (if (or (equal (cdr (assoc 0 e1)) "SEQEND")
5 e3 W! }, o3 v) A# K0 O5 W (not (equal (cdr (assoc 40 e1)) 0.0))
$ i2 `: i6 P6 e# k8 K; z8 r (not (equal (cdr (assoc 41 e1)) 0.0))
\& ` [' V V; e. w );or
% q% R% a5 l+ x) D (progn
1 O! c% p; E0 R" ? (setq flag T);
, U; r+ l2 }# s O) u+ Y& ?+ S (if (not (equal (cdr (assoc 0 e1)) "SEQEND"))2 ]- L1 ^/ A4 ]- l- c1 y6 p# i5 u* W. u
(setq width nil)
% Q" ~( u2 o m1 M$ C' H6 @; u );if/ E" v X! _& J
);progn then jump out of the loop5 ?8 c" t3 C. l/ W/ y+ {- v. s2 p
(setq na (entnext na)1 A7 M) E" F. w7 d
e1 (entget na)
6 d2 D& |, `* N );setq * v' G; L @2 q# u9 Q
);if 0 A; b+ _1 {6 V% C- X9 g6 f
);while
8 g9 E: P# s8 t6 w; y, T (setq n (+ n 1));setq
6 w! l( K' c" j) l );while
$ l( p, V9 [0 c) T! u9 z. m/ @# T2 Z
);progn then it's a legacy - }( C" o+ M- n& D1 G. w5 g4 }
);if ;legacy polylines that may have varying widths 4 i2 F' m/ C9 k Z, e. q7 F, g% o" S
3 \$ W O4 P, P8 J
(if (not width)
% j$ S& R4 {( Z0 U1 K5 H3 o8 } (setq width "");setq7 E: E7 \# r" O8 Y- J* @
);if' E8 O2 I* z; v' d8 z
(if (not (equal 'STR (type width))), _4 A4 `3 m0 r% }
(setq width (ai_rtos width));setq
! G) d! E8 `" ?7 Z! T; p* H& K );if
7 |) s: I% o9 Q8 i/ z9 N% S7 X# w
8 ?" U/ T+ U @3 X width
8 U" v1 `; \4 e7 ]7 C/ c* b! C, F7 J );defun pl_width_getter
; Z! }& X# s( v7 P8 F ^( ~- n
, D' S) d; i: C* q% \- n7 C" a
+ U; Y! G1 D( N6 ^. v9 z (defun match-col (/ ncolor)
! d+ c5 U ~# n2 V" ^8 Z (setq ncolor (cdr (assoc 62 elist)))
0 z* e* ~4 t& F( G- h6 d- F" K (if (not ncolor) (setq ncolor 256))
* m; `% R8 _' \' b$ P& Z# N3 L, V (if (/= color ncolor)
! k) e7 p: m1 @ (progn
6 T5 h6 p9 [; w& k7 {( S2 P0 Z (setq chk-col nil)
! W( ?1 X% I' j* u, r (setq color nil)
% `( r/ f7 S# {/ F& e* I ) Y5 X, b8 d& e, D1 y7 _" R
)
- l6 I8 y% T) n( O% M0 L2 } )) X! w, T) e3 k, d: H7 r, e$ Q8 J
3 x: W" Y; i1 @
(defun match-lt (/ nltype)' l! M2 }% s8 ]2 r) C
(setq nltype (cdr (assoc 6 elist)))) x" z! ^+ h$ m, {( B8 \ H
(if (not nltype) (setq nltype "BYLAYER"))6 Y$ `- _1 h$ W5 }2 r& p9 o/ r0 `
(if (/= ltype nltype)
( u$ W U, u- M3 K- H9 j (progn
& G$ c" R( p* Y1 G# Z (setq chk-lt nil)
( [8 O; S: R: a F6 ^' P3 Y (setq ltype ;|MSG0|;"Varies")* n+ p% ^- ^; T2 L* u! d0 D
)
J5 r+ O: M. C# ]0 Q7 d )
2 p" j( A4 |+ |" s; H3 w) k )
( y: ^) b8 E, v
. p. P, M1 |9 U; |* _/ `' Y, { (defun match-lay (/ nlayer)6 L1 m6 ^, P0 F w" m
(setq nlayer (cdr (assoc 8 elist)))
$ M$ j3 r% w; j/ o$ y4 X% K7 F2 z (if (/= layer nlayer)/ }0 r3 P2 D6 o7 J/ F
(progn
2 N, W& J1 |( p2 S \4 ` (setq chk-lay nil)
k- Z9 Z) b% K (setq layer ;|MSG0|;"Varies")
7 U: v% m+ E/ D) z: ]! U+ c% u5 F )
$ n2 E. x1 X8 Z' | )
# q9 I; N7 k3 E( Y: u; u )
8 @+ j& T5 W* f+ [% f @4 A! K0 R+ l3 H6 j' l
(defun match-th (/ nthickness)8 F3 ^' N" ?! b( W& \
(setq nthickness (cdr (assoc 39 elist)))9 X+ T) }) o U' [# v4 G7 [
(if (not nthickness) (setq nthickness 0))
5 q3 h7 C/ A2 k( L, \* ^ (if (/= thickness nthickness)0 V% z7 g# E" p; @
(progn" A7 a" c- n- ?/ ^6 U
(setq chk-th nil)& E6 Y! w/ S: B+ j [0 m6 N t2 k
(setq thickness ;|MSG0|;"Varies")4 Z( a) U+ N0 [ c- {) t
)
! R- d( K/ r1 K9 k; Q )8 z% K, r3 }& L! Z( ^: h
)9 T, z1 B! {' Z. |* N
1 f! @ P! x, h; \( d (defun match-lts (/ nltscale)- J, n! T# ` h6 {* }0 ]5 V6 _* N
(setq nltscale (cdr (assoc 48 elist)))
- }5 {+ n1 T# Y4 e% ?# p (if (not nltscale) (setq nltscale 1))
0 W2 @$ N, G# ~, z z# Z- L (if (/= ltscale nltscale)1 y F1 O ~/ t
(progn! Q, q9 t8 S5 A0 w! g( h
(setq chk-lts nil)
0 z; s( W( Z% k) E# ` (setq ltscale ;|MSG0|;"Varies")
; a' T+ J* B5 k4 i1 _2 \* w4 M/ s7 t" X )- d9 y. q0 ^ m: F3 ^% i J# z
)
# Q! S! i/ O) S1 z- e& v% B) L ): z$ T0 [& L2 q, W9 R W5 F
" p" z7 Q: F: G
;;$ B1 Q& t; m% P& k3 [1 z
;; If an item is a member of the list, then return its index number, else. l |1 O4 \# E) |
;; return nil.
" D! W1 A+ `: W3 y6 o" @! u* U/ U3 b ;;- |3 g5 [2 ]0 [) R2 J
(defun getindex (item itemlist / m n)
% a3 p! u2 v7 H+ \% p (setq n (length itemlist))
6 ~' [/ S, q j c( {& t (if (> (setq m (length (member item itemlist))) 0)& B9 U' K! E9 u1 F0 U, `! X- `
(- n m)2 X3 i5 p, C7 {! X" y3 r# i" {
nil& S9 T; I. S6 Y
)6 o8 F+ i9 f9 J$ f
)
: W5 Z' `+ } [3 c, i ;;! C E" g% `* P Q- ^( ]
;; This function is called if the linetype is set "BYLAYER". It finds the
4 }( E0 `9 _/ x; n0 F* j8 ^ ;; ltype of the layer so it can be displayed beside the linetype button.- S* }) [0 o7 u* t( _5 ~4 y, M
;;
0 {# S/ J9 D7 O5 L/ O (defun bylayer_lt (/ layname layinfo ltype)
" J; e* l: f9 `8 o- c (if lay-idx
, a* L/ L7 _4 P( v2 y+ m& o (progn3 |0 h, m* g- }, K, Y2 K
(setq layname (nth lay-idx laynmlst))3 B3 e, V' Q# U5 F
(setq layinfo (tblsearch "layer" layname))5 Y5 J* J z5 K5 A
(setq ltype (cdr (assoc 6 layinfo)))/ V% n& M, M: V1 q7 E
(strcat "BYLAYER" " (" ltype ")")9 P; M. a7 Z m+ [6 b6 `
)) q; b: f2 K5 _2 L3 `/ M9 |% u
"BYLAYER"
- V4 X# S# s5 }, l4 y8 X )
! k5 N0 e% d/ K3 `/ \6 y )
. k1 a9 q! }, D5 e" ?+ `; f! i ;;
0 \8 G, P* J( q+ W ;; This function is called if the color is set "BYLAYER". It finds the( r; W( n% w+ @8 h& R
;; color of the layer so it can be displayed beside the color button.
' T4 I! a& g# n( W ;;% w- z6 d# l+ j0 {$ x0 M
(defun bylayer_col (/ layname layinfo color)" j8 E* G0 i9 b9 l
(if lay-idx$ I8 Y$ p* Q1 r) s4 E
(progn7 l! d l+ L3 s$ f$ v# |+ O
(setq layname (nth lay-idx laynmlst)) H2 M+ U) E' L7 c2 i! X
(setq layinfo (tblsearch "layer" layname))0 N, d. G) | }! n0 P/ f
(setq color (abs (cdr (assoc 62 layinfo))))7 o+ U7 {' M: p2 _) k
(setq cn color)8 t* V. L4 d; i" c% u y+ A q
(strcat "BYLAYER" " (" (colorname color) ")")
" A' g, c' m. N+ ?/ ~, W: H# U )
( O: I/ P1 v' ]- Y (progn0 ~3 a# U7 K( k& j! a
(setq layname elayer)
- M; a; S z- N% m6 A (if (and (/= elayer "")+ s& E* r7 B4 ^, ^: n' v
(/= elayer "Varies")' ]% |) I3 @- [/ J$ o
);and
/ k/ @' p$ E/ {# _ (progn
! a1 |1 a! r; T# _- _: }) v- f (setq layinfo (tblsearch "layer" elayer))
" [ v( H; D; G- `/ R* c+ M, R (setq color (abs (cdr (assoc 62 layinfo))))
. `# |+ o P. u6 w, e! ]0 [- M (setq cn color)0 x: B( D- h, O0 c( i# u9 F5 x
(strcat "BYLAYER" " (" (colorname color) ")")
$ C z- W" ^5 S1 B )
; t! q- u8 F& H6 ] (progn" @6 [$ G- M( Y' k7 B1 Q
(setq cn 0)
9 ~5 ]) }1 z' y W" j6 d "BYLAYER"1 ]" P" t% ^/ { I2 y+ v" R, t$ f
)% C; G/ D# l, y. @. S- \1 ]1 L
);if4 J, |% X* t5 q0 m% u
);progn
; l2 L: T. }7 \( g3 H E );if
) A8 O0 `8 ]6 h6 F3 j )
8 }7 w9 |% u) z" ~2 `+ L ;;
! J+ d- V" _" Z. ~2 u9 W. N ;; If there is no error message, then close the dialogue
# h6 Z9 g4 d1 Z2 R9 ?' _: ~5 ^ ;;# E" s0 {+ ~; m% i' q* ]6 w9 D% h
;; If there is an error message, then set focus to the tile1 m! ~6 i# z! }- N0 l: c
;; that's associated with the error message.; \/ }& r M+ V: Q; x+ z9 n
;;! V2 u( L! X/ Z7 F" I+ J
(defun test-ok ( / errtile)
: m/ @" P* V7 S$ a' A$ \3 ~; O (setq errtile (get_tile "error")). s* O8 K- q/ W! H! \) G% F, `+ ~0 m
(cond9 l% F) Q8 u6 ]" a. o* K
( (= errtile "")
_$ {" i: c/ a$ t. |* C (done_dialog 1))! k' M0 W! P' o1 m$ q1 N; P6 y
( (= errtile "Invalid thickness.")
% J2 r c4 K& m9 s6 i0 j2 [9 x (mode_tile "eb_thickness" 2))# A, B' k- U4 E# v& Z& K
)7 z, W/ ]$ [8 s. B9 `1 h, z
)
) M1 p0 C) [1 o5 U ;;
7 J7 K! e( E( d* D ;; OK in main dialogue.( n$ G% R: D4 q: S4 @5 b
;;
, Z2 x5 k! Z% ^2 `7 X (defun test-main-ok ( / flag)
, w2 V; n- C! M8 h& L8 X (setq flag T)
' T5 _8 m* J+ d& J7 u! j (if (not (or (distof (get_tile "eb_thickness"))# _+ O4 f3 e. V% Q( q9 M
(= "" (get_tile "eb_thickness"))
( j. V# u7 T* g" G2 w* L );or
9 y3 J) \- c& B );not& J( c& @7 i! j( O7 T5 z4 y0 A
(progn0 y4 I8 L4 a- Q6 L
(set_tile "error" "Invalid thickness."); [5 c0 S, N6 |/ z2 F+ O3 }9 q5 _
(mode_tile "eb_thickness" 2)0 K: Z2 y7 Z6 c; `
(setq flag nil);setq1 j0 i/ L! X, w8 M
);progn
7 v4 J: y6 X# I1 \# F4 ] );if( G# w' L$ ]0 J" p2 b/ r$ o* ?
(if (and flag; _7 A# B+ h" w: Z$ ~
(not (or (< 0 (distof (get_tile "eb_ltscale")))
. L$ q- @% G( _* y: K5 M (= "" (get_tile "eb_ltscale"))
9 u" k$ W4 i- Z- }3 H5 G$ O* l0 n7 s );or : S0 P1 B5 z; G+ T8 B
);not
8 D9 ?' |" H8 Y );and ! f& t6 ~6 ^' `: r- i t8 B
(progn1 g$ u+ t/ _, a! g. y4 o
(set_tile "error" "Invalid ltscale.")
' v# C% r9 p4 U+ ~' Y (mode_tile "eb_ltscale" 2)
8 v9 J8 L# i m1 H$ l- b4 X% N (setq flag nil); 9 r' m( [% z# J9 [" D7 E# E
);progn then
4 z; r/ M9 e9 G4 }* y );if
9 L5 e1 C$ I k& S8 O (if (and flag
5 K' D5 A" C Q3 { ; Don't test the tile's value unless it's enabled.
' ]5 i7 q: Z/ J7 d$ } ; We're not set up for the display-only value$ z. ^# k Q1 Y6 U2 [
; of "" here in the error handler.
4 y# K. j3 \9 \- j+ ]. k (= 2 (logand 2 eflag))
/ X5 Z+ j4 U: L4 Z: |, T (not (or (< 0 (distof (get_tile "text_hgt")))
6 q8 X4 y% M& A4 e* M9 ^/ _' m (= "" (get_tile "text_hgt")). J9 [$ B q$ n3 L7 {+ M
);or
+ h1 }9 j7 o' Y: F% z );not1 h; s! O+ [$ p: m: b* V
);and
5 a M9 v6 r/ ` (progn
" x+ C! z3 l) m$ f: s (set_tile "error" "Invalid height.")' f1 X( R2 s8 G- F/ w9 ^6 P" @' d
(mode_tile "text_hgt" 2)$ o% X; u! g4 D; K3 x! C
(setq flag nil);
( |5 d- H/ P1 q* T) Z9 J );progn then9 x0 L$ C+ ]' x
);if
# h, P* j. i, b5 D (if (and flag! b/ Y& l; \6 @0 A K6 y5 x6 Q' ?
(= 1 (logand 1 eflag))) @& V( x8 n3 N( A3 i
(not (or (<= 0 (distof (get_tile "poly_wid")))2 {5 o$ M. j5 L, f' }8 F* `8 }
(= "" (get_tile "poly_wid"))
& Q, \+ H+ d$ Z/ `" l8 w );or, w! d! K) o% L$ D
);not" n( ?" n6 U7 d5 h4 W% `/ _/ W$ M
);and
* o+ Z3 W1 [1 T (progn
6 v* g2 R7 s( o) P+ z (set_tile "error" "Invalid width.")2 F. \" q' F x0 q- B% O
(mode_tile "poly_wid" 2)
; P8 p; l) u6 U7 P0 ` (setq flag nil)
+ R! E B- B$ _' J7 l );progn then
. v- m2 A0 C" Y( i$ C- k$ b );if , W; p1 s# u0 [3 p0 e M: D2 R9 ]$ f
(if (and flag! m, ^" ]/ S* U. [( B8 ^
(= 1 (logand 1 eflag))
; _% o0 o& {) D7 z; I (not (or (distof (get_tile "poly_elev"))# w7 `" F: F6 {+ { K+ H' S1 C0 T
(= "" (get_tile "poly_elev"))
7 K, `( H, E( }- n );or
" V" p9 u) O4 S/ [ );not8 A9 W# v r9 A1 W
);and
% ~$ O. w; }' p H! K- q) S (progn
) A: S2 e( Y2 u! } (set_tile "error" "Invalid elevation.")
0 m3 C: o6 l$ t (mode_tile "poly_elev" 2)
5 |- F, ?! X& O' v (setq flag nil)9 ^2 {. z. f9 S4 s
);progn then6 B3 U% ~# e4 f3 H; x" W: n
);if
7 D2 r# p; t Q (if flag
5 T( T" p) o4 q& J1 [% t+ ~( q (done_dialog 1)
: F+ c% \' h* k, k );if1 |! E9 R" R7 V1 |0 F, b
);defun test-main-ok3 z+ V" Z: q4 W4 z$ C
; ]5 B2 P4 J9 C ;;
, ~ d2 h2 |) _+ e ;; A color function used by getlayer.7 E. J7 w6 Q$ A$ e
;;
. b1 ^4 f$ q* ^2 `0 F% g4 S/ t (defun colorname (colnum)6 i/ V; U0 [9 {) F; X0 R
(setq cn (abs colnum))5 s+ k/ t/ x% s$ z" _, \3 S- i
(cond ((= cn 1) "red")5 Q: R: F; z1 o8 v1 p, f( {# Z
((= cn 2) "yellow"); u" {& G, [ J- n2 Q, p! v& Y) `
((= cn 3) "green")
& e+ _0 M# t/ ^* I1 { ((= cn 4) "cyan")3 j5 X5 X) z& I- E$ F! @' U4 v) q
((= cn 5) "blue")
% ]' { m) o3 h" ~ ((= cn 6) "magenta")
6 @2 w1 k+ `8 ?) l0 t1 P ((= cn 7) "white")# i8 _9 ^ T, F7 s
(T (itoa cn))
) @) Q1 o3 S% ] )! g- }9 h: D7 p, c3 O: } F
);defun
; B1 ?! ` e3 C4 }5 }4 u! O( H' Q B0 |) l# R+ a- C J D
;;; Construct layer and ltype lists and initialize all3 S6 ]4 h9 @ {9 _) G4 C
;;; program variables:, y- U0 [$ q# |( |" e: y1 Y% X
5 e7 s" ~0 F! Q6 I" e4 o0 I; (makelaylists) ; layer list - laynmlst; U- D% W: ]$ h0 c6 {
3 r! J, `! T& A' }$ Q, V# K* D
, a8 \/ T" x' |( [
(makeltlists) ; linetype lists - ltnmlst, mdashlist
, E5 W% {0 s5 M* Y7 m) J9 ?' z! T. E" g; c) T/ {2 J1 m2 S
;; Find the property values of the selection set.
. }/ N- X0 E; W- A, Z. ~2 L N B ;; (getprops ss) returns a list of properties from+ u. }9 L0 z$ T" L
;; a selection set - (color ltype layer thickness HEGHT STYLE WIDTH). z6 S0 e; u; J
4 f# H! g$ L3 W I d# Y' c6 [ (setq proplist (getprops ss));@rk interesting things happen here
* t& p$ O& h) t- f( c+ O# ^. W/ J& w* k
(setq& e" D% G% \% c: }8 Y) I
ecolor (car proplist)! d2 Y9 c) P$ R* w: }& s
eltype (nth 1 proplist)
' h$ r' `' x. `7 U I5 P% c4 @ elayer (nth 2 proplist)
r- l$ n: ]8 r: j ethickness (nth 3 proplist)& R% ^* G2 g- A! e" Z S* P
eltscale (nth 4 proplist)7 H, O; _/ V w, [' L8 j# l! W0 V" Q
ewidth (nth 5 proplist)' y1 ?0 a1 ^9 J/ u8 {
eelevation (nth 6 proplist)9 ]9 H# u! K6 \) g. W/ C
eheight (nth 7 proplist)
1 b6 s9 ?( [" g. f& V ;etype (nth 8 proplist);commented out and replaced with the line below. RK.
# n! I9 [3 j6 m, M eflag (nth 8 proplist)" r% |- S2 ], u" x
estyle (nth 9 proplist)" z) t& j/ X0 i8 ~0 L! v$ \9 q
poly_ss (nth 10 proplist)2 w7 R. Y( S: K$ [' i% D
txt_ss (nth 11 proplist)
" g# b/ w( V3 z );setq
8 V0 ~/ E& M% l/ i! j( w( j5 A% H) \: t7 w4 B5 ?# F
;; Find index of linetype, and layer lists
% U$ h9 x1 e F7 t& g0 w (cond
9 O# `9 X t6 b/ L ((= eltype "Varies") (setq lt-idx nil))
; Y; q4 m \5 B) U: X9 t, d ((= eltype "BYLAYER")' Q' X) B1 `) P5 b, ` p- v
(setq lt-idx (getindex "BYLAYER" ltnmlst)))9 B/ L* Y& W' n1 d2 j& l7 t
((= eltype "BYBLOCK")
( k* m! ]% g: E (setq lt-idx (getindex "BYBLOCK" ltnmlst))) a- N) W; x' w6 ~& G' Q
(T (setq lt-idx (getindex eltype ltnmlst)))8 S: {0 Q7 w0 l% H1 c1 o$ l
)" @; H2 a0 z2 }; ^6 t
(if (= elayer "Varies")& `8 j$ I) x- R
(setq lay-idx nil)3 D6 Z/ }! l( y% C, v- _3 L
(setq lay-idx (getindex elayer laynmlst))
( _- n T: E8 l3 l/ O. l' B7 k );if* y/ V h- W/ ^: a7 q* d
(if (= ethickness "")8 c$ v" a+ W& H M& y
(setq ethickness nil)
^7 L) s& \ U9 G. G );if V9 d4 H. V" |6 M4 ?" |: T+ b
(if (= eltscale "")% D1 c: O) j6 J' A3 ^7 {5 x" U
(setq eltscale nil)7 `. b* @% a- Y& Z; O J
);if
/ s3 y! b9 p' H) ~
m# h0 _, ^$ f- C" g5 a);defun ddchprop2_init ; end (ddchprop2_init)
4 q2 {0 Y! \$ k& P
9 M" Z+ K/ D/ A2 j* X;;; (ddchprop2_select)
1 R5 `# W' w7 f% ~;;;
( E, {0 {! @4 h;;; Aquires selection set for DDCHPROP2, in one of three ways:& {8 G! k% T! I) v
;;;
8 m4 l+ \2 D/ o;;; 1 - Autoselected.
/ }/ y3 C) Z! u% }$ B# u;;; 2 - Prompted for.
+ u$ C. p5 B& o- W& A;;; 3 - Passed as an argument in a call to (ddchprop2 <ss> )
! R" }2 ?8 A! I3 J;;;
+ l9 L s6 X' b( I+ `* u# X;;; The (ddchprop2_select) function also sets the value of the
1 c) J( a/ a0 O& ]4 O9 P;;; global symbol AI_SELTYPE to one of the above three values to% T% W1 X, i0 @8 m L
;;; indicate the method thru which the entity was aquired.
* w$ h0 I4 H; |% X# O/ @
/ \1 T- s6 ]& B( b' Z
% @" C" g1 e) ?, m) Q: n8 z(defun ddchprop2_select ( / )) S$ F- r: N$ U9 h, a& V) e
* E8 T9 B* S; @% U4 L: y C1 {) m; ^- I
;returns only entities in ss that are in the current space. $ n4 ^2 v( b4 C5 c2 r
(defun ss_in_current_space ( ss / a cur_space ss2)% n7 L5 a2 T7 r, N) F$ z$ a
) R/ \9 V$ J7 K
(if ss5 F0 \' g3 @1 l8 {! ]% o7 t/ l
(progn+ t' o% G/ Y9 B! S S
(if (and (equal (getvar "tilemode") 0)' n6 G2 Y# K! M8 R8 h
(equal (getvar "cvport") 1)
" C. I" V& f! {8 o6 X( f) p9 N );and ( v Z& U7 m- e, l- ~8 ?- q
(setq cur_space 1);then paper space is where we are./ j4 j, |8 S f) m1 v
(setq cur_space 0);else model space.( W& y0 u9 e% S5 B
);if
5 g' c2 P3 O5 l0 ` (command "_.select" ss "")
4 H( }2 U' S7 Z# |5 g- |) E* g3 t; r (setq ss2 (ssget "p" (list (cons 67 cur_space))));setq- Z3 f! p8 f8 j, r" y: P' j5 m
(cond ;;;;;tell the user what's going on.0 s8 i: h v ]- L
((not ss2) (princ "\nNo objects found in current space."))
: _6 P$ y: Q2 A8 O7 @ ((not (equal (sslength ss) (sslength ss2)))
, \% a9 G: K! Y/ g (princ (strcat "\n" (itoa (- (sslength ss) (sslength ss2)))
3 s, A5 Y& U- L( G! A' O! ] " object(s) were not in current space."
6 w, Q6 x! J* B. D. d B )9 @( D) O1 {2 B1 E
)
1 j5 l1 A F8 T. D& N )
; x- g k7 l0 X5 B8 B );cond
6 j B* H4 |, _( h( N/ b );progn then+ w E/ [ E* n. ]: O6 Z, z9 |
);if
1 r# I/ j. q/ b+ x2 O ss2
$ e& ?5 q" @2 m& l);defun ss_in_current_space
6 p( r" r0 [! M) P
: O0 n l4 t7 M- f7 b* B6 z0 ^2 i8 R- {
;;;begin the work of ddchprop2_select
7 J9 n4 K! m1 E+ p- W5 ?# {5 V/ E, E/ {. E# b* Y7 m9 `. r% K% d( m
;; temporarily restore original highlight setting., I, x( t% j0 B) f" V# H+ [
(b_set_sysvars (assoc "HIGHLIGHT" (car bonus_varlist)))
- f0 M( v" y5 j) v8 l$ E2 P# W, t5 W (cond
: R" l; g) |% G, J f ((and ss 6 v1 m& G; z+ P, z# G" @
(eq (type ss) 'pickset)
V" v# Y5 g# r7 P# [3 R ) ; selection set passed to/ E7 @. V! |, `' g, O9 d3 B
(cond ; (ddchprop2) as argument
" r9 ?% a8 D& o$ F3 C5 ^ ((not (zerop (sslength ss))) ; If not empty, then1 ]: a- x. c" K) J
(setq ai_seltype 3) ; then return pickset.* d, s) V2 t( d+ U! R
(ai_return ss). s5 X. i) Y9 D4 a
)
" g O0 }6 I& S }. L );cond close
! ]3 E% I$ r* y6 Z; p );cond #1
4 x: s+ H3 a/ j ((setq ss (ai_aselect))) ; Use current selection1 M7 H. B W" {3 r) c6 }
; set or prompt for objects) P" B* {4 M: u4 H; Q
(T (princ "\nNothing selected.")) V2 `. e+ {4 x |
(ai_return nil)
+ P3 n6 q+ D! X: J1 Z )
* f/ b) H* d# C+ k );cond close& g Y0 b( n! q# y6 i- ?( ~
(b_restore_sysvars)5 i2 ?% e, I) C. @- r
! z! Q2 h ?. \6 E% l6 v6 `4 j# t
;(if ss8 y5 o, f) I9 R$ ]9 L, i7 W: C
; (setq ss (ss_remove_locked ss)) : {3 f0 _, E p) G% X# F: B
;);if. u( u: l) w. i& Q* \+ m5 |& |# |9 s
(if ss0 f4 n5 [2 {. Q4 A* j1 {9 E
(setq ss (ss_in_current_space ss))
4 S' ]7 ^0 F* @/ {9 | );if
) ? Y2 g! v r; R- z4 g
( R, U- f) x3 h0 ~) X( f6 b ss4 s K3 g9 l$ [
);defun ddchprop2_select
P- ? U0 A1 Z/ i" ]* j0 A
4 r% B; J9 \4 l. [5 o
: H; w" B& _0 }$ W2 q;;; Define command function.% ?: u# u/ T. T7 \* u: k0 v
(defun C:CCH ()! J) J8 t4 U; Y; E4 n
(ddchprop2 nil)) Q t" x6 Y4 H# C) y3 K9 M7 m
(princ)* a9 y$ ~2 _2 K' \" Y! A+ p/ R
);defun1 l" ?. A) L3 m3 x, \# m6 w- U
2 x+ a( u7 H! G! C) J% j
4 |+ ?8 ~# N! J# ~8 f h
;;; Main program function - callable as a subroutine.
& m1 J6 e S. H7 t;;;
3 A. z/ ]; A1 Z& B1 s/ Q7 K- U;;; (ddchprop2 <pickset> ). S4 g$ b7 P$ ~" \* n
;;;- t, P* \8 ~6 }! R
;;; <pickset> is the selection set of objects to be changed.$ A% U. h3 ~4 `2 E9 f7 a4 ~
;;;
. r0 v j2 G$ R% n( J3 S) `% C {;;; If <pickset> is nil, then the current selection set is
# r3 l3 b. K5 S/ i; @;;; aquired, if one exists. Otherwise, the user is prompted- s; I0 \+ O" V; o
;;; to select the objects to be changed.
/ }6 D# D! x7 Y# ^& }, l;;;
* Q4 F$ v6 j! u- C; i+ Z8 k8 _- i3 A;;; Before (ddchprop2) can be called as a subroutine, it must" o& }$ P$ t) c) k& a1 P2 J
;;; be loaded first. It is up to the calling application to5 z8 F4 L# o3 a. X
;;; first determine this, and load it if necessary.. S% n/ }! s4 S. Q
3 X1 _9 _& x9 a3 o/ v4 G/ V(defun ddchprop2 (ss /) r. c+ C; z( f% u
1 m z) S: Q' t, s. v" k$ z- k5 Z
a$ ?% `) t6 ]+ y! q$ l& T6 z
add-mdash
# _8 p/ X% M5 J8 \( {6 G: m7 ]- b assoclist) J6 j# y, j0 M; ~
bit-70, d' a0 D1 p" A" _; B/ E
boxlength
9 R( A4 }9 ]! L$ l% r8 U bylayer-lt
4 P* e6 {: w) y* y bylayer_col
/ e( ]# b7 {; }. g6 V: M bylayer_lt& y c |# X- V5 T+ {9 s0 l
call_chp2 z0 Y1 h+ Z. |7 b' Z' h, d% R
chk-col, v: p) f* c& {" Z9 U9 O
;chk-etype ;var removed by rk ! R5 s9 B9 k& a& g: T
chk-lay
2 o! s; l8 @+ l. B- { chk-lt* J: o% A6 m! X' M) O$ }% c
chk-lts ;var added by rk . H( A$ X n* B$ Y* E" ?
chk-th- u+ r# P% Y q
cmd6 i$ S* e7 M, i' V
cmdecho2 R* J9 ^3 @* p, S$ C
cn
2 s1 l! S# j( t* k" Z' J cnum
: \3 D5 s d5 g" O! P0 |! x4 t col-idx
7 H" l% m) Y3 c Y: E- L0 } col_def
7 @& y- ]8 N# g) F- E# c8 m col_tile
* D: X" `) Y9 K. d colname
5 i6 y2 H/ I$ p* X7 y# E! q colnum! J6 z) ]0 |, N
color
: M; b, x. A$ q: [ colorname6 V, ^# a7 L6 O7 U$ |+ U& e1 T& d" f' y
cvpname
+ Q3 _5 `+ K0 Y; K9 Y* Q dash% f; y$ J+ V) {; x! t6 m
dashdata) W! D. o- }/ a( s, r
dashlist4 A: W6 I' R+ D4 J* N6 J; h) m
dashsize
1 f/ F: o. l" X; V dcl_id
$ L8 |6 k+ Z6 c) t$ w ddchprop-err
: P. B9 V- v- g) c7 I3 ?% g drawpattern- w% D& D( @7 w5 w* g/ ^
ecolor9 h' H; b4 [* J: [: Y/ i* Y) `
eelevation
9 @4 t! v7 n. q+ @/ ~" P4 j# q eflag% Z! s" d f V9 B
eheight$ o: }; ?( r* v- J
elayer
( ]; X9 } N+ k* m+ I4 O elevation
' z" V p/ j* Y' Q! z1 S4 _* r, j* E elist
* Z9 e7 S& n; @& l" a8 R- p eltscale& @, G9 H6 ~' a9 `8 W! T4 X
eltype! C1 Z: u9 c* x% b8 n, O; w" C
en
& m/ A! }9 _2 h) _ ename
3 f- y( s- c* ]& p/ T2 I6 \ ESTYLE ;var added by rk
4 K9 d1 O- j/ {: t; f4 ` ethickness
( b2 z; k/ G8 {: K& q ;etype ;var removed by rk
) S$ Q; ^8 Z; E; I% c; J ewidth
% f( Z" s: R9 N2 b fchk' [+ `, {2 \ D+ s3 L: q( ]1 y2 x
frozth% A+ v3 R3 ]: m" h! i
fx
- U. W' t+ x( B+ \9 J) w. [+ _ getcolor" k% V8 a* x: f, f' ~$ M& o1 O. d+ @
GETELEVATION ;function added by rk
( q2 g- `7 F8 Q4 X; K GETHEIGHT ;function added by rk
! x2 d e+ Z; H( }1 x* h: X( C getindex$ V: y8 P! s" t- p
getlayer- }2 k4 E, I2 S& g
;get_locked_layers ;function added and then removed by rk ) c1 c+ p2 \+ ^: N
getltype
. c t0 M% o0 q3 r& V getprops
% V Z* o$ D; }5 V' p- R* ~, O$ U getscale ;function added by rk
- J+ X7 x- U7 X+ V9 s6 @6 j- x GETSTYLE ;function added by rk
6 @1 }( `( r: S2 l getthickness
2 A7 ]7 N! D2 j, j GETWIDTH ;function added by rk
' A" U# P5 i( `4 ?9 o o globals7 c& P, M1 Q1 r1 ]9 Z Q
HAIR_STYLE_LIST ;var added by rk6 b# R% Z7 e6 i- c1 T
height
1 j( J% I" K% @/ P2 {( p index
- [8 \, D; j8 _7 X3 ` item
, {/ f9 R% x+ S8 q( U- z item1
3 z% P, A! Y! w* V& v% U' z item23 H$ Y9 h& i# Q; s0 O) t; s
itemlist; @5 y6 ], Y- p+ D( P7 ]
lay-idx; {2 p" [1 X5 E t1 a
layedit_act3 x7 D8 v6 i% Y8 m6 w
layer
1 G8 \; f5 s C3 | layinfo
' G2 g, o: b* u- x! \ laylist
: W$ _/ G+ O$ m) L8 l laylist_act
& i1 Y* u; [" z" g9 r) U layname
' n1 I* w/ @9 O- D# f# B! G: z2 l laynmlst: M2 r$ @; D8 k1 ^
layvalue
9 t; w9 D$ f1 N1 k linetype) i7 L5 b! K- j4 ?3 |
list1/ b4 |5 }" T8 j8 G- D. _% J
longlist& Z5 ?( S* ]0 R# m3 A. ^
lt-idx/ a2 \3 ]2 h- T# z W6 y7 J& I
ltabstr
# S: s- g; N/ D5 ~& k7 Z$ c ltedit_act( E) Q$ W/ [3 h
ltidx4 z' n* ^, n" d2 Z* X. E
ltlist
8 n3 M X; n' ^2 r3 k; z* e$ P ltlist1! ]2 N% s/ y$ l# i* e3 p3 i
ltlist_act' B: t# ~( F3 W4 { I; z7 O
ltname
, t7 m4 ~8 J% g2 d2 a ltnmlst( p2 R. x: q+ W3 u5 P6 `
ltvalue
. z$ W9 b, s& c `- }! ] ltype
7 C3 x3 J# F, }2 z! Z" ] m8 Z$ J! L, g+ Y$ e
makelaylists
9 H* r4 q# H0 V5 u' v. J makeltlists6 E* j' M% c: w
match-col* e) r# U# @# t* R0 I; z; C. P4 T
;match-etype ;function removed by rk3 |# q3 d: p' ~
match-in6 @+ |- z8 q6 k5 G- s) Q
match-lay
6 ~5 V7 G, I! `7 a match-lt
, ^' ~/ a, ~: X, A9 f match-lts
, Y$ T% g$ v, J" E! i! p1 R/ C9 s match-th! b+ t. `8 _% O: x9 ~6 _
match_col# ~. p# l o1 ^ n2 w1 Q2 P: y
mdashlist
1 b9 b: b8 }9 s( _6 K3 x, | ;MPOPLST ;function added and then move to ac_bonus.lsp by rk
8 a+ y; `$ H6 ~: X n" F9 M; [, j R0 |) b
name
4 H& l3 v7 F. G$ [ ncolor$ \$ T/ S) ~- @$ w* t/ }9 ]
nlayer% _6 s0 z7 M8 P9 H0 G' E
nltype
4 j1 H9 f5 |0 ?6 ]+ r nthickness
! _& E" a. Q6 Q3 l' x0 v off$ [0 u4 @9 r9 ]7 T- t* s4 t) B
old-idx! \6 Y7 \2 V+ z! k7 D. X1 Q. k! \
olderr0 z- y6 J+ I+ z9 [5 e8 I
on
4 m0 l: d2 ` v: b% o8 S" q onoff, C1 q0 R! L! M+ s+ Z- |, F4 F* V8 D
patlist, A5 y( g+ U/ h7 j2 q* r! p
pattern
$ v. _4 ?( `/ M+ T& i- T, d PL_WIDTH_GETTER ;function added by rk2 q e0 r1 c, D$ I1 c0 k9 b+ x
POLY_SS ;var added by rk! |. S. ^ m7 v4 [% Q* A% B
;POSITION ;function added by rk and then moved to ac_bonus.lsp
+ H4 b5 Q# y6 f" J' a7 n. T proplist& m; G/ r2 b$ |
reset-lay
( i. o3 U: U Y. P reset-lt
: l" U& p; b2 y P+ e s$ ^/ ?3 y8 i" |; B6 I
selset
+ {" Y. B4 z7 J) m+ E; _ set_col_tile( {! y+ N2 r5 m* i! m' c3 W
sortlist; l3 O, h* D8 H* F' \
ss
' ~$ C: l, Z% P ss_in_current_space ;function add by rk.
* _1 s1 |, u* z% J& h ss-index- j4 u5 j' \7 x6 L V0 |2 z! B
ss-length
* a2 c2 r' Y+ @ k4 r& J ;ss_remove_locked ;function added and then removed by rk.+ q: h) z- Q( _$ G3 T
sslen, }# M# k" ^4 E: j, X& ?3 ^, k
temp_color
! X; {% s, o8 `9 z0 y) J$ L( i& c% T templist4 T1 K7 ]2 g$ H" C; e
test-main-ok
2 Q7 K7 s8 j7 `$ B: b- w7 W test-ok
9 V' B; o5 S9 q; V# @ testidx
) c# D9 l" n) Z testlay
u. i2 ~) R# A. l! p$ }. h th-value: W5 [; i3 Y& U# ]9 R* \- `; B+ W, k
thickness. G6 M1 F4 ^: G5 H' r
tile$ I3 ^4 Z; ~9 S3 C# j; ?, Q
tile_rect- ~. u' B( h& ~* T7 e+ j
tilemode
+ |! Z1 m5 z+ F; ` T9 t ;TNLIST ;function removed and moved to ac_bonus.lsp by rk X3 @5 G* \, z& z0 N
TXT_SS ;var added by rk6 n# t$ Q6 e+ m0 z) v2 D3 B
;undo_init ;removed by rk.
0 w" F3 g8 I9 \! p, ^/ q vi; A% c7 |6 [" h; \4 O" r
vpf ^ ?3 f/ O( t5 z6 z" l
vpldata
. v- W* u6 J0 o( Z7 R) T- | vpn
* }- Y# q k/ W8 S; T which_tiles0 D+ N# p3 U k7 e$ ~1 H
width) s3 n( M3 b4 ~( P. ~ W2 {
x
4 c* ]9 s1 d# ^- m x1; B) w0 Y' O' Y; y' @4 h; p+ t) p' W
x2* T9 U6 `4 y) \1 X
xdlist
F7 j# m% J. N% Q y8 e0 J. F6 N* T. P/ h% U& f
y1$ J6 y& S+ s( o3 W
y2' q. o3 ]( l b: e L
)
' B0 k2 e9 R! r1 r& K) N0 D, }' v& a1 k, A( h
(if (and (not init_bonus_error) $ A6 S3 l6 z1 S) X+ D2 m& S
(equal -1 (load "ac_bonus.lsp" -1))
v7 j9 Z9 I% e );and
9 M& r4 h9 T, V& p( | (progn (alert "Error:\n Cannot find AC_BONUS.LSP.")(exit)), Q5 X& A/ q9 L* m: {
);if) Y; P$ c* G& {9 H4 Z
(init_bonus_error (list) [. A; L( k1 A( @' @ W
(list "cmdecho" 0
$ X' j( K- V# ?: n6 h% Z. o- g) f "highlight" 00 n& Y) s) G! H! f/ W" ?3 S
"regenmode" 1% l6 t5 O& h, g- Q' G
"ucsicon" 0% u% s: r8 n% D: V
) 7 V: z) [5 k! c
T ;flag. True means use undo for error clean up. : y O1 v9 N1 {% |0 z% N- `
);list 4 k5 I3 z3 E: ]; l+ B x- r) N1 c
);init_bonus_error1 _/ x5 }: d$ s/ n' A( j( z* r
* C0 N4 i n8 X6 ?# H; A2 U# v. J (cond- Y2 |1 U }' ~% ~$ @8 r; T
( (not (ai_notrans))) ; Not transparent?# T5 X P2 S5 V+ E! z
( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
* n, C& S+ h3 P ( (not (setq dcl_id (ai_dcl "exchprop")))) ; is .DCL file loaded?/ U( |+ I3 \4 B5 f1 o- o
( (not (setq ss (ddchprop2_select)))) ; objects to modify?
# \# @4 I1 k0 L+ ~3 H (t 8 i" v4 T* r- J5 t7 U
;(ai_undo_push)4 m8 g t% \0 d" C# ^- g
(ddchprop2_init) ; Everything's cool,- P: L6 Y* ]$ h0 u( y# _
(call_chp2) ; so proceed!
3 a4 C' v+ b. N& n( R# x ;(ai_undo_pop)3 s5 P+ @# F) [$ L' [
)
5 c" R& f1 h6 d1 Z+ p+ V' q% Y );cond close
. _0 x- U7 F1 Z# y2 U P- a3 ^9 v! K3 z
(restore_old_error)9 U: A; G9 v+ @2 `$ M) |
: Q) E$ N% B) @7 u
(princ). u. T: N6 ~; _2 o
);defun ddchprop2
4 B# k; t( ]1 r: ^" A- g8 n% ? V
;;;----------------------------------------------------------------------------/ T# c+ c7 w# Q7 M0 `2 I
* D" i# ~* L' p( D( f(princ " EXCHPROP loaded.")" ^$ ?( x J$ F& R
(princ)2 |* P( Y/ w& {
- s& _1 B) `$ y! z8 c- S* ?$ I;;;----------------------------------------------------------------------------# P, Z+ e& N3 p+ E" h
;;;---------------------------------DDCOLOR_LSP--------------------------------: K9 V( H! W. H
;;;----------------------------------------------------------------------------
* ]) R% g. @2 q. f. H. J) C* T6 J. \( g0 W% ]+ N
; Next available MSG number is 24
) I3 D4 h1 y z Z6 v7 J5 g; MODULE_ID DDCOLOR_LSP_
% P" {3 p4 D; Q0 L9 C9 n;;;
7 K; x# O1 g* |* L8 O' d& e9 r;;; ddcolor.lsp' P6 k. \2 T" `8 {: s: [) e3 A
;;;
; r0 Q' |$ _6 B% P6 d;;; Copyright 1990, 1992, 1994, 1996 by Autodesk, Inc.
, F1 [! B' x* r4 D;;;4 G9 t4 A3 A2 k4 A! A3 w7 |
;;; Permission to use, copy, modify, and distribute this software. F0 v0 j1 T, e- b& M
;;; for any purpose and without fee is hereby granted, provided
$ b2 v4 Z% _- ^% b$ }1 ~6 T;;; that the above copyright notice appears in all copies and- b6 I& K; l6 h
;;; that both that copyright notice and the limited warranty and$ S5 b/ Z# c% ?0 k4 t, h0 {
;;; restricted rights notice below appear in all supporting
" Q/ i; n) @) y% e; E5 h' z;;; documentation.
6 Y- | {+ E9 z8 Y;;;2 O' O; s7 L( }" m
;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
& V/ J- a% V% ~( n, ` K;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF. D. H, z7 ?. |8 I2 C
;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
) z6 W7 J& h+ X, S, w;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
$ D% ~& {0 @- c% c5 d+ Q( M; h;;; UNINTERRUPTED OR ERROR FREE.3 z, F9 F0 K9 e8 q
;;;' D p/ D2 w7 Q% \
;;; Use, duplication, or disclosure by the U.S. Government is subject to
9 J3 j1 p) Q% [8 }: h' V3 }$ {;;; restrictions set forth in FAR 52.227-19 (Commercial Computer! |1 ~4 T: y0 o" j8 G' N
;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
4 w* ? Q4 Q: G) l- S/ q4 y1 M v2 z) Z;;; (Rights in Technical Data and Computer Software), as applicable.
. ]8 j! L+ R6 Z/ o. J;;;& e1 g* u; H: j. X
;;;., W6 c( ]2 V0 h
;;;
. i# Z$ p5 y+ p. {' O$ I;;;----------------------------------------------------------------------------- R' G: t- l' v1 T0 H7 E& A/ i
;;; DESCRIPTION& i7 D0 X4 r& I/ z: M3 B
;;; 2 F/ n6 u7 O3 m/ d
;;; Chromatic Pallete style color selection dialog.
, d3 U0 i7 q# S;;;
; U) M* ^$ e E! w1 C' p8 `" q;;; Globals:) R3 H8 V- a$ C8 L: }9 s
;;; 6 m' Y% r6 k! b7 x/ @% Q6 w
;;; chroma_color - Integer color index. The last value selected
& h/ Q4 o$ m+ F" Y# I0 Q. D;;; by the user in chroma dialog. It is not cleared or reset0 E2 P" H' m o
;;; by a cancel. Only used for communication between callback
% O' e3 } G" R( L d. U+ `1 };;; functions and the (chroma) funciton.
. W. P# L4 }: u' b;;; 2 c. h: n* c' C1 f& d5 x
;;; Depends on the definitions for the dialog provided in chroma.dcl.
" m* D# i9 Y4 r5 m# b! P$ N6 M;;;
$ E5 \1 M$ D. s( K- s;;;
0 U+ ^2 y8 p3 n;;; C:DDCOLOR -- Dialogue front end to the CECOLOR sysvar. Uses the chroma
# a8 Z( o1 }0 X8 w0 x$ |0 X;;; pallete style color selector.( Y1 G' v) j/ ]/ F
;;;
. q5 f: u6 q* D! g& _5 m;;; ===========================================================================. P) ]5 y& A( [8 [5 D2 O
;;; ===================== load-time error checking ============================
/ q: L" I# p% {;;;
9 `/ C% `9 {( C
% I" W! e! D1 ~0 X% L (defun ai_abort (app msg)7 a) g2 I# n. ?6 Z
(defun *error* (s); G/ [. [: ]2 ]# H
(if old_error (setq *error* old_error))1 b* J% N; Z/ |
(princ)
8 G* s. J" c8 m# w1 X$ T: [1 x: N )1 V/ _1 K+ Z* i5 h! p
(if msg: m+ |4 L+ {6 C% [6 q; k5 D/ Q
(alert (strcat " Application error: "
& s b \7 Y) z1 R3 ~1 B; B5 F app
0 ^* F5 `' B. D0 k! o5 a8 r A " \n\n "
% [4 U0 A8 w4 T: v msg% q# ?3 s; H/ |, i8 P1 ~( }
" \n"- f! w# }. g u8 P
)
) n8 \$ h3 |7 y/ A: S4 [4 m: x )2 J* t" N1 f: E6 P$ b+ T
); C; w# s1 w" W/ U
(exit)
1 V5 t$ P% y& [1 } )3 g% h) e$ ]/ h8 R# _/ L
% I" \9 Q8 D& Y6 `: d F5 w' l: J;;; Check to see if AI_UTILS is loaded, If not, try to find it,1 O" T* k8 q' m, x1 }
;;; and then try to load it.) {1 {& }8 {, P# U# B+ d) z' w
;;;) N& U9 F, v0 S( [' @9 e/ N: _+ n
;;; If it can't be found or it can't be loaded, then abort the
# E* _! x4 W# X. `8 E( q2 l;;; loading of this file immediately, preserving the (autoload)
. _0 l% s' r: |/ h8 n;;; stub function.
1 `6 z; B, d+ h7 x+ _
% }% H" ^5 I# e' D8 e (cond
5 x* |6 m+ B% i" r0 ]# V7 e ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.
5 I8 N$ |3 K6 K6 z) A; Q8 o' V" a* M- P1 \
( (not (findfile "ai_utils.lsp")) ; find it# R1 n x, ^) p) n5 [
(ai_abort "DDCOLOR"
& A" ]2 k% c, k (strcat "Can't locate file AI_UTILS.LSP."
' V0 x5 Y4 |5 u. N" T/ m4 s5 X "\n Check support directory.")))9 L" s e& g: v9 z) [
$ A& S) i- _, v0 v1 m
( (eq "failed" (load "ai_utils" "failed")) ; load it2 R1 Y( W P" h1 ?3 e1 o' J
(ai_abort "DDCOLOR" "Can't load file AI_UTILS.LSP"))9 }2 D6 N9 A0 [, a, ^
)% Y% i9 B' E9 V+ w3 r; ^! @
@% T3 U" w) c2 l/ I" e (if (not (ai_acadapp)) ; defined in AI_UTILS.LSP
1 X" \$ N( K, ]9 R1 t" t, K (ai_abort "DDCOLOR" nil) ; a Nil <msg> supresses
( I1 a) K9 ]* t7 ?$ x ) ; ai_abort's alert box dialog.! o! J$ }7 ?: X$ G
; [' Z: T9 p7 F h
;;; ==================== end load-time operations ===========================
7 r5 b4 m8 I: D- ^: G) K. K3 {, u* V- ?* l
(defun c:ccc (/ co_oce clrx co_err co_oer lay_clr)) r8 G. c0 @, l. c# \! p2 T8 c
2 P, C2 l& i9 F0 J0 y- q; A' H ;; Main Color function, called by setup code.4 d! f$ c+ R* `% y7 e# \# Y
(defun ddcolor_main()
% U% H; @1 L4 j h
6 B2 s" ^; D) d( O (graphscr)
; p+ S2 m* n2 ~6 f% e1 U' Z/ t
- f% x0 D: v6 n6 t- k5 T# ? ;; Get the color of the current layer, for possible BYLAYER color swatch. M3 M6 R2 Z* Y0 x% Y9 F
(setq lay_clr (cdr (assoc 62 (tblsearch "layer" (getvar "clayer")))))
# }' m" K) p, ~+ C9 f* ]6 V% q1 c r% Y/ d
;; Call the dialog here..., N8 p9 y$ {8 u
(setq clr (acad_colordlg (cstoci (getvar "cecolor")) T lay_clr))
3 f. k+ E$ R% t
1 \/ i% f1 ^" O x (if clr8 c. z8 @6 J9 }" h+ p) S
(setvar "CECOLOR" (citocs clr))); X: Z) {9 a9 D5 K8 N* E2 T
). p) \$ B; Q2 l' C4 H
% ]6 E- g) Z7 ? ;;;2 c& R5 i# O! m' g4 x/ s
;;; CSTOCI -- Color string to color index
' Q- n5 o3 K' S: L+ F3 Y ;;; Convert an arbitrary case string into a color index.
2 L- g# H$ r5 K1 y1 _: j+ V ;;; Returns nil if string is not a valid color.: T6 u. i2 E" d5 I% S) R
;;;. S j# J2 i' ~* J0 J+ ~$ L
(defun cstoci (str)
, W( Q* h) C) P! u8 t (setq str (strcase str))
3 Q( H9 g# ~2 `5 Y$ W: d* G (cond1 B8 |: _3 p5 j; ]3 S5 U
((= str "RED") 1)
* G4 y1 u- P! W/ L% U& V* m ((= str "YELLOW") 2)
- V$ u) o) Q" V' b3 |3 ^ R% p$ { ((= str "GREEN") 3)8 E) d: h0 E; ` u' x- s
((= str "CYAN") 4)
M* E( q5 l; K: K ((= str "BLUE") 5)
; r: |# ]* ^+ N3 D# N1 g# ] ((= str "MAGENTA") 6)
' B P+ y# f2 `+ y$ i% L ((= str "WHITE") 7)
+ ^4 N. f$ l, y* t. g, v* [' W) t ((= str "BYLAYER") 256)
8 F) n. R9 V2 r0 V5 t# W ((= str "BYBLOCK") 0): V+ m% ^" V, h: A9 g
((= str "BY LAYER") 256)
6 H- M% B6 L% V ((= str "BY BLOCK") 0)
. s( J, E3 J# W0 B) b' F ((and (< 0 (atoi str)) (> 256 (atoi str))) (atoi str))
& @6 C4 \8 W+ @1 A( I (nil)). O0 h) r/ ^* q- _
)) \" s, U4 w/ [( ?! u
- P& z1 W& Y" ~, x1 s/ G8 r1 ?
' S; i+ v9 N4 Z% i
;;;9 b. N5 X, ] z- M m& S0 D, G/ H1 t
;;; CITOCS -- Convert color index into standard color name.- n; o. ^6 m$ _6 ]" U
;;; Will return the standard and logical color names as text
6 a8 g2 {/ q$ Z! s! ?, \ ;;; strings. Returns nil for out-of-range color indicies.
/ W( ^5 T$ y8 d! ^" y+ r ;;;
+ W, h c6 N" P Z4 w( D% g (defun citocs(i)
/ e9 y! g! U) ~" s$ A" Z8 ^$ U+ V9 j (cond
8 w1 P) o7 x" V3 l k/ z* \6 ] ((= i 0) "BYBLOCK")7 K- E: n5 ?5 a
((= i 1) "red")
% r( a1 j3 w. R ((= i 2) "yellow")7 r m) f b- E
((= i 3) "green")5 a2 D$ b7 h3 j0 _
((= i 4) "cyan")1 p9 B& T$ R+ S+ I& }; f8 P1 R
((= i 5) "blue")
; N4 j" r+ P: F+ \/ K, c m ((= i 6) "magenta")# C$ \9 X" Q2 u) ]
((= i 7) "white")
: Z# Z J |. X9 j' f ((= i 256) "BYLAYER")6 I. \' w+ {9 @- G, f) y9 j' E
((and (< 0 i) (> 256 i)) (itoa i))
7 M- Y5 u b4 w; r2 F$ | (nil))
! T9 O! X8 f8 q/ u/ A K; f )
% Q( w$ q6 i& v( b' d0 e+ \0 h5 ~' q9 S+ s- X, g0 \# j- }
;; Start of ddcolor
" j; n- O- B4 V; N* ^, ~" ` (setq old_cmd (getvar "cmdecho") ; save current setting of cmdecho4 R) k0 i# S7 l* T& ]# z+ F1 I
old_error *error* ; save current error function
5 Y6 }1 X$ I7 o r *error* ai_error ; new error function) |1 g. F7 r& `7 L
). G. q, [+ a7 m1 I0 E* H8 F
# b! B* k* _2 z( U, g1 C- l
(setvar "cmdecho" 0): B+ S3 `9 i; A: U$ c
8 ~' |% P$ W( k" d. e; K (cond/ N) D" e1 m c- h) M, ]2 d& v
( (not (ai_trans))) ; transparent OK% p( E: [, N& Q1 M& Q, O& s. \% d- ]
( (not (ai_acadapp))) ; ACADAPP.EXP xloaded? ^8 ?4 y( F7 S( A/ l2 \
$ M$ x K9 R/ b1 h2 v! X (t (if (and (/= 1 (logand 1 (getvar "cmdactive")))2 G9 F' a$ j8 l5 c) o8 p2 X5 i
(/= 8 (logand 8 (getvar "cmdactive")))2 M* X4 M3 h6 L# ~, L4 Q- v
): `5 `% p9 T j# P+ k8 \
(ai_undo_push)
6 O9 z8 \1 M, B- ? )$ m! q; ? n q9 G( Z) T4 F
) r6 V8 O" q3 @: B9 \6 ^9 u
(ddcolor_main) ; proceed!
: M8 w+ {; w8 i g) N% b' G+ _3 W) F, r- l& q
(if (and (/= 1 (logand 1 (getvar "cmdactive")))+ E+ S1 j9 ~6 A- x9 K5 g3 n
(/= 8 (logand 8 (getvar "cmdactive")))4 l; Q, h; E4 ^3 {& m% w0 F
)
: T" H5 d$ h. [8 ?2 }+ N' F: q (ai_undo_pop)
7 B/ D) G; t6 ^/ O )+ [) R( R+ C6 g
)" {0 Q% h9 L% l2 w
)% @% i8 K: S M6 }. P
2 ^/ h4 ~- ?' Y0 n( }( c
(setq *error* old_error) 4 W+ \9 a" h5 g+ R
(setvar "cmdecho" old_cmd)
& Q. C0 c5 Q8 K5 N2 S6 L (princ)( l6 L! a) U' k* e; k& p" C9 P4 A
+ i/ ?' q8 R/ y% h( V. i
)" d: x9 i* P0 h9 ^* N
0 T/ }3 J& F) n+ k" Z
;;;----------------------------------------------------------------------------
3 r( }/ j$ g1 ?1 J# Z0 R. g; Q8 O; @& I. z
(princ " DDCOLOR loaded. ")0 w- ?& z0 S4 k# \6 D) _/ b
(princ); O% _8 H. v9 _, m
! `0 e8 L2 F0 |- T. [! Y
;;;--------------------------------------------------------------------------;. W( Q% ^: W; b1 z
;;;---------------Chon NHANH Nhieu Doi Tuong GIONG THUOC TINH----------------;
: W6 I% A1 P3 s& w& m;;;--------------------------------------------------------------------------;
% n4 Z$ J0 n }9 ?8 X$ ~- c;;; ssx.lsp( Z! w: L* V0 a) w' O/ C1 d+ f
;;; Copyright (C) 1990 by Autodesk, Inc.( R- X' ^$ ] g7 @; T/ K
;;; Copyright (C) 1991 by Control Systems, Inc.
8 }- r! i8 B2 h j1 N+ L* g3 T;;;
4 x& T" y: s P# X;;; Permission to use, copy, modify, and distribute this software and its( Y: I% ?+ z' g" ^ S- `7 O2 b
;;; documentation for any purpose and without fee is hereby granted.
- q$ h7 r! J7 g6 q1 `! x;;;/ n# n3 K6 E1 ~) f0 A1 c. s
;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.- C1 K7 _& W6 _
;;; ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF6 w8 j2 {9 J) ] O' O9 E' {
;;; MERCHANTABILITY ARE HEREBY DISCLAIMED.* }$ a9 t" g: l' D7 M
;;;& I! Q/ v7 l0 r9 p
;;; Larry Knott Version 2.0 7/18/885 s% s% F# Q4 @( g: c
;;; Carl Bethea & Jan S. Yoder Version 3.0
- Z) H R- T6 ]4 [# A. A;;; Enhancements to (ssx).0 E w4 D1 ^2 v* X8 r7 X
;;; 15 March 1990 3 O% T1 t3 C; n" Q) X
;;;
F1 n, i$ h- Z# W& [/ |, V4 l;;; ARTIST Software, Inc Version 4.0 December 1991
8 V/ R2 f! J$ J/ R7 [;;; Modified for FLEXICON usage. If the variable FLEXVAR = 1,
' q/ i% d7 Q' T9 I! {5 m) Z7 C;;; use Flexicon menus5 ^1 ? O7 j9 T0 W' ?) {' ^
;;;/ n% K( t. B! l7 k- }- g
;;;--------------------------------------------------------------------------;, q S, T% j+ f- d9 b7 q5 r
;;; DESCRIPTION
4 k7 y% W. c" v, U, @' v;;; SSX.LSP
3 z2 {& O$ _: h. l0 o+ n' n' d;;;
T& W+ b9 Q! Q' i0 u- y;;; "(SSX)" - Easy SSGET filter routine.
* J( F/ x! [: B/ t- @;;; / L' o0 N# w" I K
;;; Creates a selection set. Either type "SSX" at the "Command:" prompt
/ o, t7 e. |8 O& z;;; to create a "previous" selection set or type "(SSX)" in response to $ P) C5 T; P+ J; |
;;; any "Select objects:" prompt. You may use the functions "(A)" to add
- ?/ v* @4 i) q$ n6 }8 r r9 Y+ U;;; entities and "(R)" to remove entities from a selection set during
( F2 k# Y) G/ S6 ]2 q6 n: m;;; object selection. More than one filter criteria can be used at a
; t+ Y8 ]+ | D8 d$ M0 e;;; time. ' J9 w2 V) L4 z, y9 o+ p! i
;;;
$ X# j9 s) w) d* b% P. _;;; SSX returns a selection set either exactly like a selected
9 s' |1 K0 h, c% U% {/ \+ {4 `;;; entity or, by adjusting the filter list, similar to it.
5 s, a- z/ k( d. |" R;;;
8 t- b/ O, h: @/ n/ E1 S;;; The initial prompt is this:3 V. f/ k9 U5 K% T" n# S( l0 G2 d
;;; - w$ O% a6 |* F2 U3 |0 P: `
;;; Command: ssx: c6 E. k. A# b/ ^
;;; Select object/<None>: (RETURN)- U1 O6 @2 f3 G( p$ v5 |
;;; >>Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector: # W. s3 e$ @8 M. h: e& `& Q8 @
;;; % }. @- J7 ~0 A9 D
;;; Pressing RETURN at the initial prompt gives you a null selection
0 X5 J: O8 L: D; t$ z- {;;; mechanism just as (ssx) did in Release 10, but you may select an
2 R7 r) @8 {& }, _- b0 ^;;; entity if you desire. If you do so, then the list of valid types
$ o+ V x8 m9 W8 ~' p2 {8 Q- G& Y;;; allowed by (ssget "x") are presented on the command line.5 w; q. L" n( `, S& S
;;;
6 V r* [/ }0 J1 `1 G* @- L;;; Select object/<None>: (a LINE selected)) s0 Z# L3 h- g6 V0 Z- d
;;; Filter: ((0 . "LINE") (8 . "0") (39 . 2.0) (62 . 1) (210 0.0 0.0 1.0))
* l' v( u6 Y6 T7 Z- Z;;; >>Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector:
) t& ^3 H1 x" q: P% N;;; ; P" z1 ~/ N/ _
;;; At this point any of these filters may be removed by selecting the * Q" v. Y) f- s! s* o
;;; option keyword, then pressing RETURN.
% y; `3 N9 I C- b* H;;; # H+ j9 _) n4 w, j7 v
;;; >>Layer name to add/<RETURN to remove>: (RETURN)
7 k( Q: L- k& f2 T! _;;;
& I+ F7 C7 e, G" k;;; Filter: ((0 . "LINE") (39 . 2.0) (62 . 1) (210 0.0 0.0 1.0))
) q7 |: R; M1 r( c;;; >>Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector:
0 O& m* K' Y% |3 Y6 K( I;;;
0 f& S2 e$ V; o( R; Q3 [;;; If an item exists in the filter list and you elect to add a new item,
) ~% u7 m# e3 }% ]9 F$ E* D;;; the old value is overwritten by the new value, as you can have only $ o% C) S: L0 O7 w# q, \! [
;;; one of each type in a single (ssget "x") call.8 S5 c" k6 i, M
;;;
, }0 a. b" _! [ @- V" B* c7 X; v;;;--------------------------------------------------------------------------;
8 ~2 d$ `2 T. {2 f' _4 x;;;- D" t4 u1 Z; K
;;; Find the dotted pairs that are valid filters for ssget
5 e3 B5 ]; P# v; v;;; in entity named "ent".5 t4 e: D" D% N7 ]
;;;1 L- c5 v- f: M+ |. @
;;; ssx_fe == SSX_Find_Entity
/ Y) `9 p C( n;;;
% h2 m5 B' M/ {' x0 k$ N7 k# ~(defun ssx_fe (/ x data fltr ent)! W2 ]4 u- p" ~* L$ H& I
(if (and (= flexvar 1)(/= t2 "Pick"))
: F) h0 @' Q/ L. B, T' ?- [ (setq ent nil)
! S; E/ Q. d0 j$ [* ^ (setq ent (car (entsel "\nSelect object/<None>: ")))
7 [' z- R* @0 U D+ B1 e4 B )
! H+ Q. o1 d8 \: N, z$ D8 U7 i (if ent
) T; c! T' q1 J+ l (progn I P; a0 E5 @4 n
(setq data (entget ent))
. L: F; ]( c/ C" u (foreach x '(0 2 6 7 8 39 62 66 210) ; do not include 38* Q/ U& P; e% F$ F! A) P. k7 S
(if (assoc x data)
7 s% w$ Q+ \( W, U. B' B1 N (setq fltr
x% A) Q9 N8 y0 J/ G( | (cons (assoc x data) fltr)9 G. U- @8 y7 ~% E; |9 ?
)
$ p7 G, C$ p( j# f) U6 k) T- @' J )
& V% O5 D' w# M& v9 E$ Z ) - C6 p' {# a/ f7 N
(reverse fltr)2 [' z6 b0 ?' `
)
% d/ Z$ I' C5 m5 m ) + R9 B3 A8 V. W/ e G
)
: x6 a; Q0 m. r, i- N' F;;;
1 N) N; R9 [5 A;;; Remove "element" from "alist".
8 {9 Q# ]. X, S2 V;;;. U3 m8 s5 C: y: t) a
;;; ssx_re == SSX_Remove_Element
8 d& a" ?% }8 @- T% u4 q;;;% R0 }. |4 U% c0 S7 o& R+ ^ s, E9 D
(defun ssx_re (element alist)
, {& t' }5 K/ H* K' W+ O (append9 Y) q* }- ?0 \9 l$ F3 @: @6 Z& j
(reverse (cdr (member element (reverse alist))))5 O/ u, j& C3 p9 p% S2 o
(cdr (member element alist))
6 o' p6 ]$ b/ @$ k! m+ p( G )
9 E% {6 v$ i7 H7 G" B5 i2 R* a5 Q)/ F8 R Z4 y: V2 K9 a' d
;;;
! E/ O1 W, z$ ?! P2 \;;; INTERNAL ERROR HANDLER
+ ?: ]$ B9 |+ P C1 p;;;% F4 ]$ W# P" Q
(defun ssx_er (s) ; If an error (such as CTRL-C) occurs1 W* T: P7 Z- D/ S# ?6 {% R
; while this command is active...6 Q+ ^% {) E1 L+ q
(if (/= s "Function cancelled")
3 \/ w- l& m0 ^( \' K; m (princ (strcat "\nError: " s))
5 Z1 d" {7 i8 z a! L% f5 G* k )! ^. S0 s9 Q* h5 m% J) j0 U+ ?6 ]
(if olderr (setq *error* olderr)) ; Restore old *error* handler
4 y6 G% Q6 {* ^3 O; T/ _. h (setq flexvar 0)
0 _: B. @ z3 d8 d (princ)
7 l% v1 L) q; Z4 Q% |; K)7 ]3 F% i7 {5 M1 e; a
;;;% b( D* |( H6 v3 c
;;; Flexicon call routine
1 y3 r, f9 j! K j+ O3 l;;;) S0 b! _, M5 Q; d: \0 E
(defun flexmnu (a)( c4 v. d L1 _* Q! ~
(if (= flexvar 1). ~9 ]* @! D- ^! U9 {% b+ M7 ]
(command "FLEXICON" (strcat "FLEX" a))8 }) K& I" m2 \. N( y
)
. g- O) P$ ?3 Q3 U$ u8 x9 U+ H)" `2 k! Z, H0 y: Y6 X, ^" `) z' a
7 M* F2 U! b/ V2 t7 F- p4 g1 d;;;
2 o7 E8 W, [% z( u7 u) };;; Get the filtered sel-set.$ S, i1 H3 l M2 L. D; `: A
;;;
; d9 y S$ N8 d$ j! K4 ]2 e! T% _;;;
, K8 M; o1 c+ W" T6 S3 V8 @(defun ssx (/ olderr)
' l G2 W+ H: }4 _ (gc) ; close any sel-sets
$ P9 E4 U& [* j3 b4 J6 [8 ?! |4 K (setq olderr *error*
+ J5 u1 i; }/ N' K$ X4 { *error* ssx_er
5 ~' [* E0 l% V9 j. N2 o8 `& o )
* q4 o3 J3 ?8 Z( y1 C" O2 Q! v& S: h (setq fltr (ssx_fe))
2 [( j( D* `5 n (ssx_gf fltr)
8 `* H$ ~& l1 [/ l (if (= flexvar 1)
+ z$ N" W/ a' `2 ~ [% C (progn
: }% j& n/ c# ?8 _, } (prompt "\n \n \nNow select the required EDIT command and (P)revious."): E' a, s2 Y. \7 C& G, W! A
(flexmnu "EDIT")
+ K1 U7 x' |4 k% F3 R: d6 D )* n+ @0 H/ H2 _0 l8 F; V4 \" p( |% f
(command "p")- t& N* F* {2 @: w; m9 b
)# v- \9 a8 i( K7 ~% v- _6 s
(princ)6 g! J9 B# ^7 G& @2 R! [2 n
)4 _. x9 I* f" w% B: ]% M9 B2 v
;;;7 X- t6 R4 T# M) |1 {, T7 b( Y
;;; Build the filter list up by picking, selecting an item to add,1 v4 Z# X9 @. }5 Z4 h) s& _
;;; or remove an item from the list by selecting it and pressing RETURN.
# G2 G7 }2 g5 y# }+ t;;;8 E+ h, ~; \8 a& H, F$ U9 U
;;; ssx_gf == SSX_Get_Filters
! ]5 s* ?. L0 [5 E;;;
% f: l4 {7 I( f4 S+ |8 h' z(defun ssx_gf (f1 / t1 t2 t3 f1 f2)
5 v& Z, }! R1 p+ e' f# S (while + I! H- J" T* S5 m5 o
(progn
% I" N$ ?. C" n! [ x2 _ (flexmnu "SSX"). u- i% u3 h- u5 Q3 k- s+ C
(cond (f1 (prompt "\nFilter: ") (prin1 f1)))- P8 D" @, ]( A! v1 Y& E
(initget
5 z* k2 E$ ]9 w9 w) z1 K# e9 y "Block Color Entity Flag LAyer LType Pick Style Thickness Vector")
# A- K$ d+ z; e+ \ (setq t1 (getkword (strcat9 q! D8 a9 y* ~. ^; o7 X" Q
"\n>>Block name/Color/Entity/Flag/"3 @6 s4 S% k4 M# }/ K
"LAyer/LType/Pick/Style/Thickness/Vector: "))) ' o$ c4 N( ^8 F. e8 k h9 Q
)
( K$ k( n( C4 U8 [! u @7 t (setq t2; w! m" N* X+ _2 {1 W) [
(cond/ M5 @9 p4 H) q
((eq t1 "Block") 2) ((eq t1 "Color") 62)9 `) H( L$ \ n
((eq t1 "Entity") 0) ((eq t1 "LAyer") 8)# ^- Q+ ^8 A! O% C2 L
((eq t1 "LType") 6) ((eq t1 "Style") 7)
( [5 n- m" e1 ]% ]- f% K- c ((eq t1 "Thickness") 39) ((eq t1 "Flag" ) 66)- Y( ~0 @( Q* V' ~5 S/ D/ H: r
((eq t1 "Vector") 210)4 Z2 s B4 }) ^
(T t1)8 n% {! ^% k9 }/ u& I% z& {' L
)/ @3 X, C0 o7 `) b; q
)$ W0 m( \5 j8 X
(setq t3
6 n! y+ d" g9 Z7 D" f. n! s (cond4 O0 T" |8 d3 \2 P
((= t2 2)
* @& c' [- |* g (if (= flexvar gtads 1)
* J- r7 L( G* j8 N; l8 t2 a4 s: H (progn
/ c# z2 W/ L& [8 y8 I- D (prompt "\n>>Block name to add/<RETURN to remove>: ")" p+ g5 ?1 X" H' {3 U6 H. Q% ~8 d2 R
(gttable "BLOCK") U0 H9 [6 Y5 b5 @* T
)
; D$ D# a4 f, [4 q$ l A0 m0 |- n (getstring "\n>>Block name to add/<RETURN to remove>: ")3 w5 _. B! R% C+ N, R7 X% F
)
% o/ k2 \: J4 F. { ) ~. S$ R6 u0 y5 Q, L: A3 o0 @
((= t2 62) (initget 4 "?")* o) v: S6 i0 e% w
(cond3 Q/ p2 \: `, k
((or (eq (setq t3 (getint
2 ]2 Z! p! u' a K# ] "\n>>Color number to add/?/<RETURN to remove>: ")) "?")
5 {5 n ]) [! { (> t3 256))
, @6 m/ P t/ A- t (ssx_pc) ; Print color values.
' |# O- t, q" K* `, Q* Q; D) g nil
5 m9 p6 Z2 @# p: ?2 ] )
, x& _; s/ l& ~. t (T
+ A& j2 s0 k0 j5 r2 w% e b* R- [ t3 ; Return t3.
; M) B/ S" }# v' N ): j5 Q' b+ V, O. I
)5 @* T! d8 \0 L3 D3 X
)! l& M# ^& o2 R- H9 q) x' I i( F
((= t2 0) (getstring "\n>>Entity type to add/<RETURN to remove>: ")) n, D1 R* v% A. P, `0 H0 m2 }
((= t2 8)
; r& O2 o/ {7 v! B1 p (if (= flexvar gtads 1)8 Y: a8 L4 f7 w7 ?
(progn9 F/ O/ B. D" g6 X3 o6 I4 {
(prompt "\n>>Layer name to add/<RETURN to remove>: ")% e/ h4 o+ Q- |" G9 ]
(gttable "LAYER")
, S: z7 v _! d4 R8 k- X! _ )% O* ]1 _0 Y" b
(getstring "\n>>Layer name to add/<RETURN to remove>: "). a! {/ n) |8 D
)" K* A6 I$ Q3 H
)$ K8 L' U. ?* t' a
((= t2 6) , K: D5 c0 F: L6 F" A* M
(if (= flexvar gtads 1)
2 H, z& S" D y$ R; V, U5 z (progn
& T$ Y( j- w9 T# x (prompt "\n>>Linetype name to add/<RETURN to remove>: ")& N/ g- E' M+ f7 o! O
(gttable "LTYPE")
( r1 S; S- S9 N, a: N5 ~' R )
' l2 f' ]1 t5 m. G1 W' k/ t- i (getstring "\n>>Linetype name to add/<RETURN to remove>: ")
% c9 o( Z& X" w4 G4 y" K+ r$ D2 x/ s )
$ M; s' \7 J @0 R( h3 `+ x )
5 D8 F% m! [) D- d' Y- P ((= t2 7)
& z* y/ ], o+ W6 x& C' ]* h (if (= flexvar gtads 1)
6 z8 ?' K M/ M (progn
: b6 }0 l+ G$ H! ~ (prompt "\n>>Text style name to add/<RETURN to remove>: ")$ ~; _! l* V8 f6 X
(gttable "STYLE") o& m! k: Q3 _
), o6 n; {: s& }) W0 \% S
(getstring "\n>>Text style name to add/<RETURN to remove>: ")
' m+ o6 M6 e+ \ )
; e6 ]& Q& h) `6 h& t )
, [! Q- k+ S- w ((= t2 39)
1 {: g) d$ ~+ ?( L (prompt "\n>>Thickness to add/<RETURN to remove>: ")- i6 p6 g1 H. v. o! T* `, W
(if(= flexvar gtads 1)(gtfnum"Thickness to add:")(getreal))( @2 }: k5 ?3 f8 n; n' f
)4 S, F3 e; i8 @3 L4 ^: T- P! P: `
((= t2 66) (if (assoc 66 f1) nil 1))" \& J( [8 D; N( v) j; a3 Y
((= t2 210)
, d& H# d, L/ ]- o. F% N$ ] (getpoint "\n>>Extrusion Vector to add/<RETURN to remove>: ")
& F" K2 q7 D6 B) d' b4 ? )
2 K. n' a1 h, }0 H5 m# i m (T nil)$ F7 d: X# s0 w# y6 J4 N
)
* j$ V' A3 D% T ^* n: G0 L )# }% L' R1 ~, l# {
(cond
6 V- g0 R+ Q! C- }3 b9 p9 k( G ((= t2 "Pick") (setq f1 (ssx_fe) t2 nil)) ; get entity, W( S( }% Z6 G% q' O& Z2 e
((and f1 (assoc t2 f1)) ; already in the list- Z# u9 \& h# o, C" {" `" Z5 U
(if (and t3 (/= t3 ""))
% k: j& P: G7 ^% V8 {/ d& l( I ;; Replace with a new value... 3 P4 `; |9 i' B2 X) t# X$ A, n' U( s
(setq f1 (subst (cons t2 t3) (assoc t2 f1) f1)) 2 D0 [+ T" t& k! R3 \
;; Remove it from filter list...1 e* z' h7 s) G0 K5 K& M
(setq f1 (ssx_re (assoc t2 f1) f1)) 7 A% D+ C9 M3 |; x
) ' Y) h: t1 K5 M' j2 g
)
7 `9 l. m {+ I ((and t3 (/= t3 ""))
- \4 c3 E* m' }6 N1 [. f; l2 u (setq f1 (cons (cons t2 t3) f1)), X- C7 J6 m. \. C& s$ h0 M
)
: b! D) j, Y6 L% q' t3 u (T nil)% d1 @7 X# i3 y/ W4 a6 F
)
$ L' J) c! K5 F1 R! S3 a3 N* W )
- M! {: N6 r- Z) s1 \$ D% j (if f1 (setq f2 (ssget "x" f1)))( Q9 K; ~! H; |7 q: R
(setq *error* olderr)
' |5 J+ B& ^( l (if (and f1 f2) ; s! z ^# n( s5 r4 @* n1 s
(progn
6 L, y6 K8 Z4 e1 o$ R3 ~8 E (princ (strcat "\n" (itoa (sslength f2)) " found. "))
5 x2 L7 k6 A) U2 I4 ^' h f2
8 e h" F' _9 ^1 @/ c O )
4 v* f1 A- G# g' N2 B) o5 `; c4 Z5 s (progn (princ "\n0 found.") (prin1))
. j2 j8 B5 ]9 k5 ]" P )" S- e/ A9 e2 F* L) M% ~! E) U
)
# k' \3 o4 L5 O! V% C. w, A;;;
) K# y9 _$ M' ?- {0 S4 k;;; Print the standard color assignments.
: { \3 m% r9 I ^;;;
3 i. z. B: y) R! F;;;
l/ J+ T5 p2 R4 ^0 X; W& a1 u(defun ssx_pc ()
0 _* W' o" L* M( z- O (if textpage (textpage) (textscr))0 U, n# S2 |( r
(princ "\n "), U% z6 m- C9 C5 P$ i! o
(princ "\n Color number | Standard meaning ")# i/ Q- e; ]( s, @
(princ "\n ________________|____________________")
' J+ }9 g, t) |5 n( E: }5 A" ? (princ "\n | ")- e3 d( T8 ^. |2 x: {# U$ I/ h
(princ "\n 0 | <BYBLOCK> ")
; m- I: F1 |( e! U; c+ h (princ "\n 1 | Red ")
# Z" G, N& y+ o# d (princ "\n 2 | Yellow ")6 f9 c' d1 m6 M
(princ "\n 3 | Green ")- r; r: \4 p6 H% c- c% [0 B, A
(princ "\n 4 | Cyan ")1 s5 [ t* Q V
(princ "\n 5 | Blue ")) w0 }2 A+ a2 P. I- n
(princ "\n 6 | Magenta ")/ {+ T6 R5 u5 n$ B/ Q2 k7 z
(princ "\n 7 | White ")
! e5 `8 w2 p! M0 G8 x% z- m) t (princ "\n 8...255 | -Varies- ")
# w% c+ u4 [+ e; @ (princ "\n 256 | <BYLAYER> "): Y& q5 M/ J1 K" T: o1 s
(princ "\n \n\n\n")
( q- y$ t& j3 w G9 [)8 Z, e: t0 N- L7 d) a ^
;;;
' {$ U9 G! o2 m- B5 [) H F. T9 X) }* };;; C: function definition.
8 G6 R) g. p- V% [;;;
& t2 q4 a# ~7 C' {3 o5 ^/ u(defun c:ssx () (ssx)(princ))
* c+ Y. w; Y! {0 M* U) O( n(princ "\n\tType \"ssx\" at a Command: prompt or ")
9 h3 b. t$ z S# \(princ "\n\t(ssx) at any object selection prompt. ")# r- t) d* r7 E1 z9 ? ?& t
(princ)
2 a) o( N( p6 C2 z R6 f+ j
$ Y) F( }: D5 w- x;;;--------------------------------------------------------------------------;0 `: _2 ?- T8 C) ]/ d9 V% R2 Z
;;;--------------------------------------------------------------------------;
" m: \1 e* B0 \. k1 U# X; l; p;;;--------------------------------------------------------------------------;6 a/ r) Z) i, z1 ^; Y
(defun S::STARTUP ()( G2 J6 ~ f T& e
(setvar "cmdecho" 0)0 a& U# C7 |' u1 _( b. _3 b9 c- `! Z
(setvar "cmdecho" 1)0 v0 {: h5 L! Y4 z- J9 y2 ?3 v
(setvar "LTSCALE" 10)
1 c4 t7 F9 b# X9 X3 Q/ D z
! x2 j7 x. m) i. i3 }# y& @) E* Z
;(command "_load" "chenKH.fas")
2 g2 x& h: I/ b% N;(command "_load" "ctcot.fas")
! j1 E) e9 g& p& F; e;(command "_load" "damdoc.fas")" N* ]. o/ a$ T8 o p* [) h
;(command "_load" "ghichu.fas")( o! A- J) U9 ~1 k Y# N
;(command "_load" "hamtutao.lsp")# V) u; ^! V# Z+ Y4 q; Z8 o
;(command "_load" "KHOITAO.fas")9 o Z. }" {8 J$ Z: A
;(command "_load" "KHthep.fas"). V: a0 N6 |. M2 y
;(command "_load" "mbmong.dcl")" L( x t; q1 z1 S$ ~2 S
;(command "_load" "mbmong.fas")5 w2 Z# a) H& s e/ Z$ r8 [, S) ~
;(command "_load" "mccot.fas")
A, T% @% M5 g, o* O% w4 A;(command "_load" "mcdam.fas")
( T: S2 p$ {7 h! @;(command "_load" "mcmong1.dcl")" L( {& H' Z% `* ~$ U$ _ s
;(command "_load" "mcmong1.fas")
' ^, A! i3 w; A4 ^, a4 _+ c, C;(command "_load" "mcmong2.dcl")! I! ?4 B# Q. G) J* f# r! @/ I
;(command "_load" "mcmong2.fas")# U; L- x k ~4 e1 f: I
;(command "_load" "mcmong3.dcl")
1 P% ?6 t, O' J% ] i5 P" |;(command "_load" "mcmong3.fas")
T" p0 D4 F9 h# d& j;(command "_load" "mcsan.fas")
J& q# c; k! K' s;(command "_load" "thepdai.fas")3 _5 D. a' y r7 N) _# R
;(command "_load" "thepdoc.fas")
9 `) V6 H, O1 z( O- D5 D9 e;(command "_load" "thepmb.fas")
7 M4 ]1 P l, F+ y. I;(command "_load" "thepphbo.fas")
% _; q/ T* S" u ]2 v) E& q(command "_script" "thongso.scr")/ |+ n% z$ _9 o( _% r' `8 i. `
;(command "_load" "thongso1.dcl")( p/ T. h% f& l8 o9 z& w
;(command "_load" "thongso1.fas")
2 H- f# `9 [+ h& S* t# I;(command "_load" "thongso2.dcl")! @7 \. @ a: [: V5 P) X9 p/ i
;(command "_load" "thongso2.fas")
: L- c4 t: E. m( W;(command "_load" "tietdien.fas")
* K/ E B' k7 ]! _& ~;(command "_load" "vehan.fas")" q. {- w. @( |) n4 A
(command "_load" "phamduy782006htd.dcl")! O" J. F3 v q! H0 L
(command "_load" "DDCHPROP.dcl")
* G0 V9 O6 d7 |(command "_load" "EXCHPROP.dcl")5 H! {1 q- _5 b6 N
(command "_load" "DDMODIDY.dcl")
% V/ m' C- W% f% C(command "_load" "TK.dcl")0 B: g: s- Z" E" n5 _
(command "_load" "TK_LIB.dcl")0 w7 @( e/ J/ D$ O& S+ u
(princ)! I% U+ v/ [ }" J) ]# C: R _
)
, o4 H" U& U- f4 J! Z3 i+ d/ N4 K; R: ^
(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\DDCHPROP.LSP")
! O4 l+ h+ j& h$ w+ l$ @ K8 }
+ ^/ q0 n. m) @" M. b) Y, W! |! {(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\SSX.LSP")
' R' P( v1 d0 {3 X# S8 j
; x4 G0 }( m6 f5 u9 y ]3 E ]0 u2 v* L;(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\phamDuy782006_TKT_VNI.LSP")& h$ t* ]7 d/ k9 r
;(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\phamduy782006ganhtd.LSP")! m4 ]. F% m( d/ a
;(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\phamduy782006ganhtds.LSP")
% q* X( {/ F8 m, d) F2 X$ y' Z; ?6 @$ S' w/ a' C+ F; f) x
(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\THONGKE-THEP\\TK_EXP.LSP")( z/ \* O3 d: a
(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\THONGKE-THEP\\TKN.LSP")
! _; M) F* b# k1 _4 n6 O
8 _1 }9 i5 |% k! I;(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\ACAD iit insertTEXT - iiT.LSP")
0 H( R+ P' U/ w% z5 w
3 k9 H0 s3 |9 Q;(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\ACAD iit insertTEXT - iPT.LSP")' f$ Z- L: }# I; s
4 x) f. x# A3 {0 d# F(load "D:\\S E T U P Thuong Xuyen\\1st OFFICE\\0st RUN-2000\\ACAD insertPOINT - PTA4.LSP")
% a+ h- X# c2 L) \
; t4 \: ]4 J; X) ?8 l( A [;; Silent load.
1 m& h3 d- H @8 z0 k# M(princ)6 S6 K3 R, s% G8 f* H) y
0 p F" p+ _8 Z+ N. ~& q; M$ H
* b4 W0 y) a/ t/ h9 m) Z Z- Q;; Silent load for the Express Tools.
! b* o) f2 ?+ Z1 I: @0 f, g" N9 c;; Altering this line will affect Express Tools functionality4 W8 x( }6 Y& ]: Z
(load "acettest.fas" (princ))
$ w& s( z( [6 C( r6 g0 e7 v0 r7 s/ j# @5 P
;------BLOCK NAME Put The End because ERROR other LISP-------
. X, M2 R1 b s& Z* j9 P;------------------------BODER HATCH-------------------------
( A9 U/ e- Z) c
0 K" v+ M+ `. v) S4 |;;; HATCHB.LSP ver 2.5
) C1 g% v0 _; Z3 [, @# }' r;;; Recreates hatch boundary by selecting a hatch" R7 R7 R! b% [3 D# m- N& b
;;; Known problem with some elipses and splines
1 z1 a8 Q) p" u3 s) p1 n3 e5 H;;; By Jimmy Bergmark
6 s( _! Y$ V- l;;; Copyright (C) 1997-2008 JTB World, All Rights Reserved2 S9 Z/ M+ z0 M" h+ o0 X& l
;;; Website: www.jtbworld.com0 ~& i3 d- t k* x
;;; E-mail: info@jtbworld.com
8 g* Z, N7 y f+ k& ?;;; 2000-02-12 - First release
; I9 A6 p9 A' d0 p; }* z. J;;; 2000-03-27 - Counterclockwise arcs and ellipses fixed9 P' `- p+ Z1 A0 C, m5 Z5 A }
;;; Objects created joined to lwpolyline if possible
, C0 A& [! @' j" K/ n2 i;;; Error-handling, undo of command
o$ `& f/ O5 Q4 e! V;;; Can handle PLINETYPE = 0,1,2; {9 A2 J& s( \" o7 A
;;; 2000-03-30 - Integrating hatchb and hatchb149 H2 X7 `/ c) f6 d
;;; Selection of many hatches
# F, Q/ @4 P, l; d* e;;; Splines supported if closed.
6 f* e% P3 J3 D) }+ f;;; 2001-04-02 - Fixed bug with entmake of line with no Z for r146 v3 g2 J, b5 p1 j
;;; 2001-07-31 - Removed an irritating semicolon to enable polylines to be created.
$ r9 i/ O# [7 U8 V/ e! b- E4 ~;;; 2001-10-04 - Changed mail and homepage so it's easy to find when new versions comes up.- R0 D2 T" E8 o9 z8 }2 H0 ~2 N
;;; 2003-02-06 - Minor fix
, @' y( u- |1 A. m; n$ \: y1 ^3 Q;;; 2003-02-17 - Area returned if no islands is found since it's not consistant
& j7 ~/ l4 g/ X: v. }' Y;;; 2003-05-19 - Fix to take PEDITACCEPT variable used in AutoCAD 2004 into account
9 t7 Z! k/ W e7 A9 a;;; 2004-11-05 - Minor bugs fixed! R3 ?3 w& q) K
;;; 2006-03-18 - Nothing changed from 2.1 other that it's been confirmed to work with AutoCAD 2007% E4 k3 S! }* z
;;; 2006-05-13 - Create the boundary on the same layer as the hatch using the hbl command and
! M6 `( q4 s9 y6 I8 ]& u;;; on current layer/color/linetype using the hb or hatchb command
, _1 R2 s6 }8 y7 };;; 2007-02-08 - Fixed a bug with the hbl command
4 I2 t# O* R" q- D; y, w* L9 ];;; 2008-02-29 - Support for hatches in non WCS thanks to xiaocai, K5 T o5 n. G) @5 X
;;; Tested on AutoCAD r14, 2000, 2000i, 2002, 2004, 2005, 2006, 2007, 2008, 2009
. R4 u; A; v5 a0 a;;; should be working on older versions too.
+ O3 v; R- ?* O2 x+ t! N* |
o. u* {# ~; }+ x(defun c:hb () (hatchb nil)) ; this line can be commented out if there is an existing command called hb$ e! c$ r6 D/ i
(defun c:hbl () (hatchb T)) ; this line can be commented out if there is an existing command called hbl4 z; z6 D. `% ]7 I% M
(defun c:hatchb () (hatchb nil))& N+ E/ U: l8 b) G, t* M: I" U* V; Y
(defun hatchb (hl / es blay ed1 ed2 loops1 bptf part
7 J: v0 {: d/ w9 e! y3 F et noe plist ic bul nr ang1 ang2 obj *ModelSpace* *PaperSpace*
% C7 P5 J G' h* @ space cw errexit undox olderr oldcmdecho ss1 lastent en1 en2 ss lwp
& H/ J1 r5 w. d* y+ S& { list->variantArray 3dPoint->2dPoint A2k ent i ss2
6 r1 J8 |1 }$ ^* @" n knot-list controlpoint-list kn cn pos xv bot area hst noarea
' z2 \4 u* Y3 t8 k$ \" B( f" P )$ S" r {9 B; y: s
(setq A2k (>= (substr (getvar "ACADVER") 1 2) "15"))
, x$ i. D8 H* r( V8 B; c# \+ C3 N (if A2k& Q Y0 u+ z8 ?& T- ~( W8 g( S5 |6 r
(progn
3 |( X+ N- X- f7 O (defun list->variantArray (ptsList / arraySpace sArray)$ |' Q$ b6 S9 D0 _/ Q
(setq arraySpace
0 B3 z2 @' }, k% G* h (vlax-make-safearray
8 V/ j) M8 t! e! T. D7 [& f vlax-vbdouble9 K0 Q2 |8 X7 e8 o# |8 P6 a8 d
(cons 0 (- (length ptsList) 1))4 j" F: f) u! g% V' }
)
3 x2 L" o* i5 w )0 s" K7 J% E$ f0 |9 @; I, D
(setq sArray (vlax-safearray-fill arraySpace ptsList))
9 Z n, B: V1 L/ i: a8 b (vlax-make-variant sArray)
8 j" S% d, c; R9 g+ V4 U! h7 \1 ` )* `) o$ P$ Y8 W$ R' B$ ?/ l i3 M( A
(defun areaOfObject (en / curve area)2 Q% s; R e" n
(if en# v1 ^: x+ a9 e# T% j0 p. g
(if A2k
3 @7 f! a- }) U# K) \) ?1 D (progn7 ^9 ]# J" { _9 ?% s1 [
(setq curve (vlax-ename->vla-object en))
" i" \. E Y! ~3 A9 ~3 X2 P (if. y1 e: c: w6 ~9 @5 ?4 ]6 P
(vl-catch-all-error-p! C, E' K G7 y% c2 [
(setq
3 H/ j; N; s4 K area. O0 s( B9 J, t. A' k
(vl-catch-all-apply 'vlax-curve-getArea (list curve)): B! ~' R3 S* b5 G- I; A" C6 e
)
- E4 N5 U0 j: r% P1 B! M )
; q9 A9 _9 S3 b$ i nil
4 F$ R) @3 W2 W9 F. x# \- M area9 h- E& _# _& f& R! d1 I; | f
)
0 T& Z+ z) |2 A )+ D9 t) g5 w0 @/ L; H" i1 r
(progn0 k& d! B0 g- ~$ m
(command "._area" "_O" en). a Y% _0 U/ X' t
(getvar "area")
- a5 K& c% D% P- b )0 `3 G! V0 X) c) e
): z% {- }/ Y* _4 E. e& m1 D( U
). D/ k4 }. v9 q! F, D& ]4 [ {
) W; A* ~# y* I3 Q
) j6 k7 Z b5 W7 `- C" F! _
)
2 |& X/ E1 C4 C$ y( x1 I0 f8 a (if A2k4 E# J: [( ^3 W$ p; A. K) S9 a
(defun 3dPoint->2dPoint (3dpt)
- @( T' j9 b0 J (list (float (car 3dpt)) (float (cadr 3dpt)))9 Q/ |* h- P' U3 j% R. A0 t/ v1 }
)! @( C* R4 r8 w0 E2 w
)
6 f' `: \7 Q2 e+ R) \
1 _/ A- ~" S: l" Y, P( b (defun errexit (s)
4 g; m0 l, s7 s {+ b$ T5 v (princ "\nError: ")) B4 a3 Q: o* `. Z3 R7 y
(princ s)
; M: o6 v0 I; |" D0 ^/ E# R (restore)8 r4 r& K9 _! Y; k# J
)9 u+ M6 P" K) y# w: V: z7 c( F1 v
- z2 R+ \ m! g- j- m$ C
(defun undox ()
* q' e) }( X/ q+ G+ G0 X, C3 P+ l (command "._ucs" "_p")
) x6 s- j- M/ v; e (command "._undo" "_E")
3 y& j2 n/ k9 f) m (setvar "cmdecho" oldcmdecho)
: @" c0 P" I n1 C6 k3 A) ^0 _8 M (setq *error* olderr)
! T7 o; Q; H4 g d5 Y4 @; \, x (princ); Q5 L; o6 c" A
)
$ }- J: K, |& w3 W$ E6 u
2 f/ N) \, t) v5 |0 B (setq olderr *error*& a( Z) b: X" s0 d0 n/ s
restore undox& j" s& H7 Y" @$ A+ Y+ N5 M. Y5 x- }
*error* errexit6 G k) R, L3 Y Y' [8 U1 ]
)/ |5 r+ ^0 S& F8 }
(setq oldcmdecho (getvar "cmdecho"))
0 \" C: ]! q1 a- `2 E, } (setvar "cmdecho" 0)" a# c) w: x8 y7 a$ \& K* Z* f
(command "._UNDO" "_BE")
/ `. P$ }, h# i# s, T1 y- N: Q; D (if A2k (progn
" A0 H1 P6 `3 D+ ~6 l4 f: k% u (vl-load-com)
! J1 R: [: f, g4 p (setq *ModelSpace* (vla-get-ModelSpace
- F2 H0 @4 j$ d4 c6 H$ l (vla-get-ActiveDocument (vlax-get-acad-object))# |# e2 q5 V# x4 w
)2 q1 h0 U7 s- n# @( o
*PaperSpace* (vla-get-PaperSpace$ e5 j9 {* h3 r
(vla-get-ActiveDocument (vlax-get-acad-object))
4 h9 }# p9 {- I )
/ E* _6 {5 \8 o1 l7 ?, z3 E( ^ ))
( U) u" X/ Q8 o" v5 l. @# a )8 ?: V; \. ?% }* x% N4 @% v: K' E
, z" M' i; q( L% |3 U) a) L2 ?1 M8 `& D& m
; Remove for testing purpose
# o+ V1 H( l1 f' Z! F* `$ v) ?; (setq A2k nil)
, ^! C# l+ J3 K( s9 i' ~0 r L; y3 _( z$ r; _
(if (/= (setq ss2 (ssget '((0 . "HATCH")))) nil)
! [4 l% c+ @6 ^% R (progn/ N- j9 \" t2 X% E8 U2 F
(setq i 0)8 Y5 ?: Q) y& m; X# q
(setq area 0)/ I1 z+ o m/ Y" V: l
(setq bMoreLoops nil)
T3 n1 W3 z6 ^! @( _ (while (setq ent (ssname ss2 i)); ~# o" b; g* s. h0 n j" I0 l8 O# Y
(setq noarea nil)- [1 x, ~" U; S) U6 Y
(setq ed1 (entget ent))3 U6 b9 \4 l: `9 P7 c; K% L
(setq layer (cdr (assoc 8 ed1)))6 I( @& A; M! O
; (if (not (equal (assoc 210 ed1) '(210 0.0 0.0 1.0))) (princ "\nHatch not in WCS!")) ;modified by xiaocai, D5 P. n5 h$ ]' Q. h8 W+ G
; (setq xv (cdr (assoc 210 ed1))) ;modified by xiaocai
\, J' k- l: g8 I (command "._ucs" "_w")
3 V4 R* ]$ \1 U" Z( v (setq loops1 (cdr (assoc 91 ed1))) ; number of boundary paths (loops)% P: O; k7 N# o k
(if (and A2k (= (strcase (cdr (assoc 410 ed1))) "MODEL")), d x6 {- d$ _5 ^7 t
(setq space *ModelSpace*)
$ d- U+ M: g& r (setq space *PaperSpace*)
5 ~/ d1 b. _% {/ Y2 W )
8 O/ t4 w/ C/ L3 _8 [! p, V! X3 q (repeat loops1- Y( g' W$ M- U0 H& q# K
(setq ed1 (member (assoc 92 ed1) ed1)) {4 f9 H, G, d. S0 s3 c( T
(setq bptf (cdr (car ed1))) ; boundary path type flag
1 t$ d( ~+ o3 v$ a# M (setq ic (cdr (assoc 73 ed1))) ; is closed
2 w) v0 Z; |* g* g/ u# I (setq noe (cdr (assoc 93 ed1))) ; number of edges! e" \" Z |. i0 z
(setq bot (cdr (assoc 92 ed1))) ; boundary type& ]7 f& t9 y- A) y8 [' M
(setq hst (cdr (assoc 75 ed1))) ; hatch style, T9 c8 z A3 S' t2 o. H% D, K) C
(setq ed1 (member (assoc 72 ed1) ed1))
6 b8 `+ m$ s" r1 u5 T Z (setq bul (cdr (car ed1))) ; bulge; J1 U1 |1 ]! G" ^
(setq plist nil)
* A5 y- A! D/ i" H& V2 r (setq blist nil), j0 ]: |- W+ |4 l
(cond* F6 @% ^6 }5 J; q6 j! |
((> (boole 1 bptf 2) 0) ; polyline0 f& r" B1 }* Q/ v S# H- ?9 `
(repeat noe
$ g/ t/ l b( M (setq ed1 (member (assoc 10 (cdr ed1)) ed1))
# v% N0 F" D( o: @5 b (setq plist (append plist (list (trans (cdr (assoc 10 ed1)) ent 0) ))) ;;add trans by xiaocai
6 M! d! K& m( U( ^, R (setq blist (append blist
0 ]% b# ~+ ^ O (if (> bul 0)3 G1 l+ X) F/ y+ G9 S- l4 X
(list (cdr (assoc 42 ed1)))' _9 O# {" E) H: S8 w
nil
& o- ^! G$ T7 b' j# G, f )6 I4 N& d) b* b3 G" g$ G
)
" l7 v. k$ k* a5 G' G" `. K: ` )0 \4 E7 k8 j2 v" Y
)* c6 p- M6 o3 q6 B; c. \9 ^
(if A2k (progn
$ A! ~/ ^+ `2 F (setq polypoints7 W! D2 B# b! r! K
(apply 'append. X+ D3 m" k% B' Z
(mapcar '3dPoint->2dPoint plist)+ r6 I+ K7 M+ }! b0 |
)' |$ G- O4 m$ c8 c3 A
)
" \ t) [- |" u! u) {8 j v% Q (setq VLADataPts (list->variantArray polypoints))7 S% g0 _, p( \" u% P% c z
(setq obj (vla-addLightweightPolyline space VLADataPts))' H/ Z5 L% n$ w
(setq nr 0)
! j/ f1 h" k* I (repeat (length blist)$ A) O V) `* d4 \& @- Q+ P3 Y$ m1 e
(if (/= (nth nr blist) 0)2 R' z; Q$ Y6 n
(vla-setBulge obj nr (nth nr blist))' l0 J6 b% d9 h2 e# q! s
)
; i7 c: W B$ V5 W- Q1 g (setq nr (1+ nr))
: n$ g% I! S( m2 Q y8 Z* p )
. [, @8 @5 N: G6 M! r (if (= ic 1)
+ N; z2 j. f4 c' C0 x5 l# ? (vla-put-closed obj T)7 ?! p3 A+ S% b! V0 e; n- c, W0 v N
)
! I/ Z3 A6 j# z* d" T/ E/ u( C (if hl (vla-put-layer obj layer))2 @% \: [6 a+ F$ U" g& x) r
)
; c( U" T- u7 h; Y0 V& ] (progn. R1 G' G- k- |& d) O+ T7 J
(setq ne (append (list '(0 . "POLYLINE")) (list (cons 66 1)))); n' a$ q7 Y/ x9 D& b/ ^
(if (= ic 1) (setq ne (append ne (list (cons 70 1)))))( N# ~1 S4 u+ j' D4 C8 V
(if hl (setq ne (append ne (list (cons 8 layer)))))
! ~) [9 y& s! t) O# N% A (entmake ne)! u# s/ Y1 r) Q/ s: G* c' v
(setq nr 0)4 F# Y' }- s* g* n, ~; Q L
(repeat (length plist)
9 t% k# y' Z* f$ q/ C/ o2 q; G (if (= bul 0)- ]4 w- \+ q% B7 G/ d7 T8 b/ `
(entmake (list (cons 0 "VERTEX")
2 _0 _9 A0 l# U. S) R (cons 10 (trans (nth nr plist) ent 0) );;add trans by xiaocai
) D; i$ y* ]+ P' S I )( w- R1 t9 Q# O# H4 m" U, c
)* i' t* P0 q3 ]
(entmake (list (cons 0 "VERTEX")
0 k( |+ B# h7 S" O/ I: c (cons 10 (trans (nth nr plist) ent 0) );;add trans by xiaocai
- t8 |: ]8 d: l! t7 r (cons 42 (nth nr blist))
# G$ e9 w: j+ b$ R3 Q5 Y! I )& Z* g C# R) R N X6 K* l
)1 b/ F7 X* O7 _0 m( u4 S6 a( U, _
)3 Z" o: o7 v/ o" m
(setq nr (1+ nr))
! R" S, F" R+ g1 }( x: r )6 L* r8 }6 N. k8 h3 B
(entmake '((0 . "SEQEND")))
5 Z7 K& B, a- r n& T )
; q: \' t6 O1 K$ L' K3 ? )$ \4 t+ {4 A1 }$ A
)3 U5 }3 [) V! Q
(t ; not polyline
! K' \. I0 D+ ?. q! w (setq lastent (entlast))
* f" V, T* q/ ?8 s; }+ \ (setq lwp T)+ v5 y) S( V1 G" G. o" N' X
(repeat noe( V; D0 ?7 ~2 y. ?8 l/ ?5 }
(setq et (cdr (assoc 72 ed1)))
. }5 A2 I1 `* n0 \/ d5 s, @/ u (cond
/ w# \4 U6 o7 Q" x ((= et 1) ; line( y8 e& h% e0 R
(setq ed1 (member (assoc 10 (cdr ed1)) ed1))8 s1 Y# M0 s7 |2 i7 c2 H
(if A2k
( y3 {' B. e- h) B. W/ X( D (progn& `# t# J' B, n
(setq obj (vla-AddLine
& l( n$ i& }6 g; n' W2 V space) S6 f# {! c& K! E3 t) }1 ~; J
(vlax-3d-point (trans (cdr (assoc 10 ed1)) ent 0) ) ;;add trans by xiaocai
9 q! m2 Z4 z9 k9 v$ Z (vlax-3d-point (trans (cdr (assoc 11 ed1)) ent 0) ) ;;add trans by xiaocai% ~! ]+ w$ R: w4 H0 U& r
))1 ^/ ^& X7 k9 U4 @ m
(if hl (vla-put-layer obj layer))
9 s) {* C/ a( g )
9 z6 c1 j! M0 u6 L+ T3 ]$ i (progn
9 l5 c# E/ U. B @: { (setq ne (append (list (cons 0 "LINE"))7 p/ o: U( S* n2 a
(list (list 10 (car (trans (cdr (assoc 10 ed1)) ent 0) ) (cadr (trans (cdr (assoc 10
5 F" ^' F. [4 P" m3 e: W5 V6 e; X; O+ ^+ V( g( ]) j
ed1)) ent 0)) 0)) ;;add trans by xiaocai. r7 ~. ~/ D$ E/ F/ L/ I7 c' C0 Q) E! ]
(list (list 11 (car (trans (cdr (assoc 11 ed1)) ent 0) ) (cadr (trans (cdr (assoc 11 ) s( ~8 x" m: N! ^; T u5 J2 f8 U- I
! b4 g0 y" e0 F: I* s
ed1)) ent 0)) 0)) ;;add trans by xiaocai) C8 V5 n9 z$ ~/ |1 n: C
;(cons 210 xv)+ y- s2 h8 \" P4 Z$ m
)( W$ z( L& @( }' c2 g1 u8 A. Z# t
)2 G! w |5 o% j/ K9 u5 G4 B
(if hl (setq ne (append ne (list (cons 8 layer))))): B% a5 N9 O( w$ i! g2 U
(entmake ne); v9 e2 v3 E7 |" m2 _
)
% X$ O1 c- o9 | e2 q ) m5 E! S3 b; S7 P# B
(setq ed1 (cddr ed1))
4 N1 }$ A7 Z+ v" J' b) d& l9 w )$ V" m, T1 c1 I4 T
((= et 2) ; circular arc
- f: o. R5 b6 `9 i( u( S (setq ed1 (member (assoc 10 (cdr ed1)) ed1))
. a: M: R) B7 p# @ (setq ang1 (cdr (assoc 50 ed1)))
a- { P$ E' Q$ j( J( _, B6 U8 n0 L (setq ang2 (cdr (assoc 51 ed1)))
; Q: y& I+ Z1 ?8 H; M) {# ~ (setq cw (cdr (assoc 73 ed1)))
+ {3 m4 ^5 |" } (if (and (equal ang1 0 0.00001) (equal ang2 6.28319 0.00001))
. ~2 {2 e7 |/ \2 X7 |, Q! ~ (progn
% Z) l' u. p, a: l( O (if A2k
5 X9 }1 j7 `* D7 v; K0 H+ k& i (progn
. d, }# N# J' E9 n: S8 T (setq obj (vla-AddCircle6 J K" j0 f) q/ V
space
6 w3 W. ~/ T5 [' `4 v (vlax-3d-point (trans (cdr (assoc 10 ed1)) ent 0) )* U4 M `4 o: K1 b+ _8 h
(cdr (assoc 40 ed1))
, G5 j1 }/ N9 w; i ))
6 L9 J1 b1 Y6 D) z6 \2 z s6 u7 X (if hl (vla-put-layer obj layer))# k2 M. C% H U: Z) w
)* ~" O0 ~* x" d* z. v7 @! I
(progn
' K) i9 {( W4 | (setq ne (append
/ V2 Y, R) ^" D (list (cons 0 "CIRCLE"))
7 b+ M3 c+ q, n) Q6 ]0 b! u (list (cons 8 layer))# P3 |, }9 j6 e2 k& D+ O
(list (cons 10 (trans (cdr (assoc 10 ed1)) ent 0)));;;add trans by xiaocai
$ K. E, ~: Z7 o' N (list (assoc 40 ed1))
4 b- |6 e: n. b# R* q" S )5 o% t! O" I( B+ Y
)
9 ~' p) [! }! K/ [2 W (if hl (setq ne (append ne (list (cons 8 layer)))))
7 j: z9 N' n4 E1 F$ ]! i6 e (entmake ne)9 b; V# N$ x" g6 u* p/ x: g
)0 k: R( `: O+ @( ^; [- x; P$ H
)6 A* g+ `+ _) B# S
(setq lwp nil)
: _5 D+ ~. K# T8 X* u9 h+ I7 f )
8 q& g" o _, Y+ t e m' U+ C- W (if A2k5 ^. o4 I) l3 }2 {9 H9 _2 u' S
(progn" C; p1 n: K8 q- h
(setq obj (vla-AddArc
N( q) R0 ^/ [ space
' t ^0 \: s( w8 C l! q6 o (vlax-3d-point (trans (cdr (assoc 10 ed1)) ent 0) );;;add trans by xiaocai0 d! `" j' h/ _2 D
(cdr (assoc 40 ed1))4 q( w& }( W: X3 r! O* o9 J% n
(if (= cw 0)- \) s* x4 m$ H9 f+ L; K+ A
(- 0 ang2)
. D; c: ]8 h( i, q/ o% H ang1- r/ f7 w% r/ t0 f
)$ Q7 y2 m1 ~& p3 T
(if (= cw 0)- R& l$ ], s2 P" N4 | g" F# A; G
(- 0 ang1)
4 ]' E) V, ~! x0 s" C! T& ] ang2
% \: z8 l/ E' d( i3 u+ B )
& s2 \, o8 e4 z4 C ))$ V5 P, p0 _5 M
(if hl (vla-put-layer obj layer))' a) z* V9 i9 d1 ^$ ?
)
' T O% E" q3 `" n$ G x (progn
) s$ A+ }2 Z" D (setq ne (append (list (cons 0 "ARC"))
+ C1 S0 j! @3 F; m" s7 y; N (list (cons 10 (trans (cdr (assoc 10 ed1)) ent 0) ));;add trans by xiaocai
4 r3 W# B( R1 _; G3 m7 E (list (assoc 40 ed1))7 R! \# z. V9 H/ d
(list (cons 50
+ d) c) M' l s- ? (if (= cw 0)9 F: I2 l! {& b
(- 0 ang2): V0 f, \" b" ?$ L! H. [
ang1
, y4 m" ^# r- Q )* u/ l2 P. L6 a( ]1 R
))
0 O! D+ U% m+ x4 _! U4 a T (list (cons 51
) D& M/ N8 b3 D/ X; o& p9 D- \% { (if (= cw 0)" h; X0 ^4 m* W- k
(- 0 ang1)( V( J; n4 G+ l6 ?; p9 m$ z
ang2: `! I' C6 P- v: p+ B3 w) Z
)) Q6 h9 C: R& h- }, G
))' e9 N( U# Q5 P T5 P) @
)' H1 F5 l/ k) V0 N9 `5 i$ x
)
3 E, e9 k; w! ]9 B (if hl (setq ne (append ne (list (cons 8 layer)))))
; ` n5 E! V7 K6 E (entmake ne)+ y$ l$ R4 b) B" O4 x, q
)+ Y9 E. F0 Y! r! n) B! [* a
)4 B+ H5 s- F4 _. f* t! W( M: T
)) @# c- k& m, Q) [
(setq ed1 (cddddr ed1))
: B3 K/ d/ V. Z( ] )
- }& Z, l- b/ s8 S, r ((= et 3) ; elliptic arc4 Q. p" P5 L' N# t5 h
(setq ed1 (member (assoc 10 (cdr ed1)) ed1))
0 E0 ]/ _6 M9 I- y% [$ f) @) L (setq ang1 (cdr (assoc 50 ed1)))
J. d) p1 C0 J7 Y (setq ang2 (cdr (assoc 51 ed1)))6 _# q$ j' M/ M4 l
(setq cw (cdr (assoc 73 ed1)))
) T7 w) I4 [9 e& e8 j& U (if A2k (progn
6 V4 b |7 {: [7 X (setq obj (vla-AddEllipse0 V4 s! |3 p5 [) r* K9 K) g
space
; ^( X1 i+ q. H) J2 o (vlax-3d-point (trans (cdr (assoc 10 ed1)) ent 0) )
+ `4 j H3 J* l4 i (vlax-3d-point (trans (cdr (assoc 11 ed1)) ent 0) );;add trans by xiaocai- o/ K! W! [" E- ^
(cdr (assoc 40 ed1))
" @* ^6 q0 D B: g4 D )
6 P6 C$ L8 f) K( y6 F: e% Y7 A )
# a* \" T+ v. Q4 Q( Y: a' k9 a (vla-put-startangle obj (if (= cw 0) (- 0 ang2) ang1))1 d B8 o7 |( L: P, e
(vla-put-endangle obj (if (= cw 0) (- 0 ang1) ang2))* h" A4 ^1 I, c8 t
(if hl (vla-put-layer obj layer))
6 K5 E9 D/ r- [- |. c ). t# o* a) Y- J, B" o) s
(progn5 e" ]" A D$ c
(princ "\nElliptic arc not supported!")
! r/ E( u7 U7 X; Q# X5 B k (setq noarea T)
9 r$ F7 n- E' | )
- j( I# x4 i% M' t- R6 _ )
6 N# y7 W0 E" A) D% i; h (setq lwp nil)
4 s( C' |" N# k/ T8 C ): {% u o& n7 ]! r, R: e
((= et 4) ; spline
7 O) S* j. r7 J$ w3 d (setq ed1 (member (assoc 94 (cdr ed1)) ed1))
2 w7 y* L& Q8 ~ ?# Q8 B (setq knot-list nil)' [ p# U( u( `2 i3 c/ ?
(setq controlpoint-list nil)
+ D9 N. p% F' Y" F2 L. g (setq kn (cdr (assoc 95 ed1)))# g. X- v4 r# k5 I: Q, A% z5 R4 u; A
(setq cn (cdr (assoc 96 ed1)))
3 A8 r8 z' x/ ~' q (setq pos (vl-position (assoc 40 ed1) ed1))" Y% D; x$ P p r# G- f! V
(repeat kn
7 @1 u4 x0 \0 o$ E+ C- g2 T8 D (setq knot-list (cons (cons 40 (cdr (nth pos ed1))) knot-list))
: Z+ ^0 d: T0 h: M0 ~9 [ (setq pos (1+ pos))
" z) X2 r7 A; b1 U+ M& z ) m# |# m4 z( X; S0 P0 D
(setq pos (vl-position (assoc 10 ed1) ed1))
" x, q8 q5 I) A/ L$ o& n. k/ |) e (repeat cn
4 V7 k' V0 d! S( ^' g (setq controlpoint-list (cons (cons 10 (trans (cdr (nth pos ed1)) ent 0) ) controlpoint-
2 v# m: Z/ I' g. x* q2 z& m( f$ l- W3 y+ K8 U( J O7 P
list));;add trans by xiaocai1 R1 X1 l5 r$ P3 ]5 K. h2 [/ c
(setq pos (1+ pos))/ c) k. Q G/ O; r1 c) Y5 u
)4 D! ~+ n- {# m; P& N3 t. [
(setq knot-list (reverse knot-list))2 Z; H( r7 S+ R3 u- O3 C
(setq controlpoint-list (reverse controlpoint-list))! R' S, W, F/ K$ ?1 [
(setq ne (append6 }9 X& {3 c6 e3 \* J
(list '(0 . "SPLINE"))
7 l- e5 q) o1 k4 C, G2 f (list (cons 100 "AcDbEntity"))
: X1 o1 V9 _& a (list (cons 100 "AcDbSpline"))
: B/ ]' T% W4 E# z# o (list (cons 70 (+ 1 8 (* 2 (cdr (assoc 74 ed1))) (* 4 (cdr (assoc 73 ed1))))))
4 i# P7 z$ a% I3 c2 p# O/ Z' ?& j$ y2 h (list (cons 71 (cdr (assoc 94 ed1))))
+ q3 m$ V# `. A! w' P' e2 d3 \9 D' w (list (cons 72 kn))
- W) d' x0 M1 N; Z6 ` (list (cons 73 cn))
. j3 @3 T* \1 N c knot-list
8 G. X5 \$ \ S' ^4 o% _6 u9 M0 @ controlpoint-list
?0 ]" G" Y/ a r# o/ K )
- M# q/ z1 w7 e )- N" |6 r. o) K) P. k
(if hl (setq ne (append ne (cons 8 layer))))
: g5 t! _& m9 a( u$ I: Z' a, ^ (entmake ne)7 ]1 T+ `0 f8 c! m% H3 k2 A( _
(setq ed1 (member (assoc 10 ed1) ed1))
3 Q" u+ ^" F" {, m, f7 S4 `# A (setq lwp nil)
; I6 C- a f1 }4 d& h ~ )7 s# _7 n+ R! w, n% U2 I3 H4 y0 A
) ; end cond: F1 `- {6 F7 H, V
) ; end repeat noe( `8 L! f f( f' E) n. j: y
(if lwp (progn
' D* b. X+ I: }% Q (setq en1 (entnext lastent))
g, a+ r2 m1 N: y& y1 P# u/ V (setq ss (ssadd))# ?) U: `( |) r3 E6 l( m" ^# ?7 Z
(ssadd en1 ss)
# i" [4 ]3 x) V" l6 D3 [ (while (setq en2 (entnext en1))
% j# U# x3 \& Y' I f (ssadd en2 ss)5 L+ G9 |* ]5 F
(setq en1 en2)
3 S' D, X5 m: F4 u' g )
; E# v2 A' `* R4 R- l5 O (if (= (getvar "peditaccept") 1): J4 X! o: g; c! j
(command "_.pedit" (entlast) "_J" ss "" "")5 v0 n' D/ Q N9 I
(command "_.pedit" (entlast) "_Y" "_J" ss "" "")- B* l. ^; ~" m% \3 k
)
" V; E, H2 D& x( T )) l" J' T. L4 p6 }1 w
! F g7 w/ S# R1 D2 [ ) ; end t. A$ S0 D- j+ H: M
) ; end cond' s" t0 `; g: D( ^2 K4 I2 J
; Tries to get the area on islands but it's not clear how to know if an island is filled or not
7 p9 k$ X0 N& u T. Z& m2 |6 B, L# c; and if it should be substracted or added to the total area.
% ]9 b" `% H8 F2 D Y, c! g; (if (or (= bot 0) (= (boole 1 bot 1) 1)) (setq area (+ area (areaOfObject (entlast)))))
6 H4 q2 f0 {# W- \; (if (and (/= hst 1) (/= bot 0) (= (boole 1 bot 1) 0)) (setq area (- area (areaOfObject (entlast)))))
0 @' m5 E( t) F, ~4 d- C* M& \; (princ "\n") (princ bot) (princ "\n") (princ hst) (princ "\n")
: O' k4 h* q# E. u1 m; (princ (areaOfObject (entlast)))
' N* X: j c. ]# g$ o5 A" q! k4 ` ) ; end repeat loops10 a2 l5 ~) \( ]# i* ?+ e% s, x
(if (and (= noarea nil) (= loops1 1)) (setq area (+ area (areaOfObject (entlast)))) (setq bMoreLoops T))
A; q& [8 {$ l" P (setq i (1+ i))
- ^/ z' n5 e, p( E7 b: C )/ f3 e1 ]* I8 W) B# Q
)1 G; q6 N+ f1 W3 g
)
) R4 I6 G+ [1 y& r* ?1 ]8 A (setq ss2 nil), t5 |9 T8 u0 ?1 W. |# f
(if (and area (not bMoreLoops)) (progn Z' A* p. A$ W9 X
(princ "\nTotal Area = ")
# ]3 B6 o) {* D9 G8 c- {) ` (princ area)$ v9 x ^; ?; b( k1 z' v
))* R1 e1 ~: Q( _& [
(restore)
; Z2 g' b7 C* @9 `5 a/ ~ _( Q (princ)
5 f0 s* ~5 K( G! O. m' A; W){\rtf1}
J, W7 a+ p/ {
+ W4 d6 M+ d6 b(defun C:BN (). F! R- ~$ p0 j8 B3 C' R' a+ n3 L
(princ "\nAdd block name to drawing."), }& }3 G# f3 M: `+ G' @
(setq pt(cadr(entsel"\nSelect Block:")))
* R. B" ?- }* x (setq e1(ssget pt)) . u4 z+ t2 G% J3 x! k
(setq e2 (entget (ssname e1 0)))0 Q" T" |* j6 S/ y
(setq blname (cdr(assoc 2 e2)))
" }9 y* N( t) [, {$ c (setq pt1 (getpoint"\nSelect point for block title:")); z: Z! P- T. B, v
(command "text" "c" pt1 "" blname))8 U! F2 s8 G5 Y7 T7 |
(princ "\nType BN to execute)
# \! f. ^! C& }+ ?�32
3 p( M$ y! r, Z6 Q8 s- U
" h. t. S7 A! A1 X5 |1 r R
( X7 L3 s, X. E4 g+ d0 g, B |
-
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ề: 340)
-
2025-04-21 Layer.jpg
(26.81 KB, Lượt tải về: 348)
-
2025-04-21 AutoCAD Message.jpg
(8.58 KB, Lượt tải về: 340)
-
Screenshot_20220406-091212_Facebook.jpg
(306.88 KB, Lượt tải về: 337)
-
00st Cách Thêm Menu & Lisp Vẽ & Fonts Chữ mở Gõ Chữ Administrator để G.jpg
(249.66 KB, Lượt tải về: 361)
-
Untitled-1 Da Xong Trump Putin 0 Hoi Xong Chua copy.jpg
(299.44 KB, Lượt tải về: 338)
-
-
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
|