|
|
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 |
- ********************************************************************************: b7 M U, a7 r, V
- * ACADLISP FOR AUTOCAD R.14 -> AUTOCAD R.2012 *$ l0 r. \3 D2 ]# a2 F) n. U
- * Tran Ngoc Thang DHXD-HaNoi41 from years 1999 -> 2015 *4 U- m, N2 F' k& s w( d8 u
- * Suu tam & Soan *4 [" J* v/ `; Z) q
- ********************************************************************************0 ?0 { P: ^8 J& D0 m5 p
- 2 K% U- q4 v: W8 M
- ; Next available MSG number is 104
( `# A, b1 V1 F2 N* T' d - ; MODULE_ID ACAD2000doc_LSP_
+ T8 S- M! Y+ D7 p1 |, K - ;;; ACAD2000DOC.LSP Version 1.0 for AutoCAD 2000
- {) M# f5 m. m - ;;;
2 [4 `$ C( {) v2 U+ ^, o6 G - ;;; Copyright (C) 1994 - 1999 by Autodesk, Inc.
( ~# P- [( G( s0 \ - ;;;7 |( K j; V3 x( M. c
- ;;; Permission to use, copy, modify, and distribute this software
# u- F% E5 T" u - ;;; for any purpose and without fee is hereby granted, provided
' Q) S- g. {8 \7 K - ;;; that the above copyright notice appears in all copies and
) j2 U( |. U9 g- J) W1 C% d - ;;; that both that copyright notice and the limited warranty and
/ x" Y& r7 c% ~/ q! [' B7 O - ;;; restricted rights notice below appear in all supporting! A: \8 U" |+ B: k7 \
- ;;; documentation.
+ q- Z% m c5 B. e, X3 m - ;;;+ M1 X% H( \+ g- v: I
- ;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.7 j E$ X8 b9 W1 f& d
- ;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
* [; ?2 t) M2 r# p& H - ;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.8 S& d8 G8 y% P5 m7 d' S: B
- ;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE) I: @0 ~: _2 h6 S7 i3 A/ w+ x
- ;;; UNINTERRUPTED OR ERROR FREE.8 g* _; v1 |: b0 c! a4 d- N
- ;;;+ C/ {# O2 v6 L: _( z
- ;;; Use, duplication, or disclosure by the U.S. Government is subject to& k5 e+ j+ {/ x: I6 o& j
- ;;; restrictions set forth in FAR 52.227-19 (Commercial Computer3 }& p+ B- f) {) k: K8 ^- n
- ;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) & n& \' p8 n2 M. [
- ;;; (Rights in Technical Data and Computer Software), as applicable.
+ @9 ?3 a$ C; P: ^/ P - ;;;1 s* w) U! i7 `; d. O# o; b
- ;;;.+ g) p7 ], _* v$ u) i e
- ;;;
' Y" ?2 o4 ^ w0 {( D) E - ;;; Note:$ U. Y: v( P7 W$ e/ [
- ;;; This file is loaded automatically by AutoCAD every time 2 Y; q$ x# C4 f+ _
- ;;; a drawing is opened. It establishes an autoloader and
- O9 c, M- H1 C) M9 z+ y - ;;; other utility functions.
3 R4 Z8 N1 H2 a) U6 E. V3 S - ;;;
9 i. O+ A3 l. Z7 L. v0 I; ?% o - ;;; Globalization Note:
5 e. }" ^0 `( v$ d - ;;; We do not support autoloading applications by the native ( I' o/ d y% X$ Q" H _
- ;;; language command call (e.g. with the leading underscore1 d4 Q; y: g- B1 [8 n( A
- ;;; mechanism.)
5 m: G9 ^6 i0 M! Z
! U7 k) f: A$ y5 @% m( S2 R
2 u5 E' f3 N0 [: W- ;;;===== Raster Image Support for Clipboard Paste Special =====( C+ E4 ^. I/ p8 F" j# W
- ;;1 ^2 A0 g7 N0 f
- ;; IMAGEFILE1 p% L1 T0 j o; N7 D4 ^' M
- ;;
# q' r |0 n1 t! v: i - ;; Allow the IMAGE command to accept an image file name without
! [* k* A9 b! q9 I1 Y. m - ;; presenting the file dialog, even if filedia is on.( ?' U$ N% N' q9 K4 n- Z1 F j
- ;; Example: (imagefile "c:/images/house.bmp")
" L2 o1 y% Q2 w& O0 @ - ;;
s! b8 g3 W& C# i, } - (defun imagefile (filename / filedia-save cmdecho-save)" D1 o5 V3 B- H6 ^; Q$ Y/ Y- z& |4 k
- (setq filedia-save (getvar "FILEDIA"))8 e ?, p! z" i* v
- (setq cmdecho-save (getvar "CMDECHO"))
; f5 R1 B a# o# P( e, e - (setvar "FILEDIA" 0)
" S! N& e' C) w1 R+ P6 P" B$ E - (setvar "CMDECHO" 0)
8 J: d$ d, P p. X8 } - (command "_.-image" "_attach" filename)
2 S7 D6 n0 f" P( m: F% R2 N0 Y - (setvar "FILEDIA" filedia-save)7 y) _3 b& [/ M7 Q
- (setvar "CMDECHO" cmdecho-save). {. [* W" R% Z
- (princ)
; X! K% [0 ?# r5 O - )& @, A1 E# \+ v( u8 R& x g
6 ]- `# J- ~2 `' v- (defun c:zx () (command "zoom" ".5x"))7 a4 Z+ d3 ]1 p5 L; {
- (defun c:zz () (command "zoom" "p")) A0 d# K1 v; Y Y2 L
- (defun c:za () (command "zoom" "a"))/ ? p: i5 R7 ~9 o0 G! d+ n$ c
- (defun c:zd () (command "zoom" "d"))
% ~9 t# @2 K- T$ f9 y" n' ^1 m - (defun c:ze () (command "zoom" "e"))
! s+ V# x. C- d. [ - (defun c:zr () (command "zoom" "" ""))
% {$ u" I; n' f/ M - (defun c:vv () (command "ucs" "v"))8 r9 O- l# Q0 X6 n) ^
- (defun c:co () (ssget) (command "copy" "p" "" "m"))+ R q5 a% _$ r o N
- (defun c:c () (command "circle"))9 C' g5 y5 ?9 {: N
- (defun c:rt () (command "rotate"))5 |, ]& b# U6 D# z3 U5 \! w
- (defun c:3q () (ssget) (command "_rotate3d" "ANGDIR" "value" pause (princ)))
2 b5 [. l5 t0 `2 b" n - (defun c:30 () (ssget) (command "rotate" "p" "" pause "30"))
2 |0 t w0 O3 v: V5 Q7 h" j - (defun c:-30 () (ssget) (command "rotate" "p" "" pause "-30"))
% l; o7 g# Q% v& Q6 T4 D# g - (defun c:45 () (ssget) (command "rotate" "p" "" pause "45")), E$ A$ B3 T2 W H
- (defun c:r5 () (ssget) (command "rotate" "p" "" pause "5"))
7 A7 a2 g5 y) X. z# {8 J - (defun c:60 () (ssget) (command "rotate" "p" "" pause "60"))0 `9 S! Y- i6 f* g! |' l7 ~% ]- O1 S
- (defun c:-60 () (ssget) (command "rotate" "p" "" pause "-60")); M) s1 R8 j4 H" f5 t! _# e
- (defun c:90 () (ssget) (command "rotate" "p" "" pause "90"))
% L1 U5 Z4 ~8 `9 U6 { - (defun c:180 () (ssget) (command "rotate" "p" "" pause "180"))
* k4 K; l5 z4 k - (defun c:-45 () (ssget) (command "rotate" "p" "" pause "-45"))
0 F' y, z2 x' R" R7 B( G) m+ j - (defun c:-90 () (ssget) (command "rotate" "p" "" pause "-90"))6 ?3 v. Z2 y0 p- w" f4 U' l& R
- (defun c:md () (ssget) (command "mirror" "p" "" pause pause "y")). b: S' e; o4 w) H" \
- (defun c:fd () (command "find" "p" "" )(princ))(princ); k6 b/ S7 G$ B" A v: G
- 3 W( q2 `8 N3 o/ Q* S' O( D5 w
- (defun c:romantdim () (command "-style" "ROMANT-DIM" "romant,vnh.shx" "200""1""0""n""n""n"))(princ)
. h( C( m5 n, F* M, u1 M2 K P9 V - (defun c:romantext () (command "-style" "ROMANT-TEXT" "romant,vnh.shx" "200""1""0""n""n""n"))(princ)
" q4 y5 X7 C6 I( A3 U - (defun c:vnhelvthuong () (command "-style" "VNHELVLT-Thuong" "vnhelv,vnh.shx" "500""1""0""n""n""n"))(princ)
& J, \4 t' F3 ` - (defun c:vnhelvhoa () (command "-style" "VNHELVLT-Hoa" "vnhelvh,vnh.shx" "500""1""0""n""n""n"))(princ)7 _: H0 G! Q( X K
- (defun c:truc () (command "-style" "TRUC" "impact" "0""1""0""n""n""n"))
$ e9 E0 x; N# G; o) ]& Y& m - (defun c:chu () (command "-style" "VERDANA" "verdana" "200""1""0""n""n"))
% k+ E- d- H- G5 _ - (defun c:cot () (command "-style" "COTES" "verdana" """1""0""n""n"))
# R/ g" Y& F$ H$ c3 P, c+ d - + }3 }) z0 f- P3 Q
- (defun c:an () (command "-style" ".AVANT" ".vnavant" "200""1""0""n""n")), K; v. [3 Q8 F* W
- (defun c:ah () (command "-style" ".AVANTH" ".vnavanth" "200""1""0""n""n"))
; D% s& D+ A3 ~2 M+ p; T% _ - (defun c:ha () (command "-style" ".ARIALH" ".vnarialh" "200""1""0""n""n"))
" I& b/ x0 k6 s: Y; T# M; f - (defun c:na () (command "-style" ".ARIALNARROWH" ".vnarial narrowh""1200""1""0""n""n"))3 b" y$ {1 G$ N
- (defun c:vn () (command "-style" ".VNTIME" ".vntime" "200""1""0""n""n"))
2 | Z" z5 r6 G/ X; {0 n - (defun c:vh () (command "-style" ".VNTIMEH" ".vntimeh" "200""1""0""n""n"))2 }) q' `0 Z" b
- # M; c( J/ B- y2 b+ H: y8 A6 [8 }
- (defun c:ps () (command "PSOUT" "CorelDraw-import-Photoshop" "W"))(princ);export the current view of a drawing as an EPS file& {) ~" r! k7 x
- 1 u$ C7 p- E1 Z4 k1 s' _+ L
- ;free lisp by cadviet,cd2k44
# T4 _! Y2 P1 C/ l! J* l - ;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830
Z3 y: q6 X, ^$ k; b. A& ^! [ - (defun c:FTEXT (/ ent tstyle )
% @$ d- S+ D/ L( Z x, J - (command "undo" "be")1 n+ f# {. L5 s) P' K8 {& L
- (setq ent (entsel "\n Pick text :"))+ N; c' x* L- G) P; `# ^# S
- (setq TSTYLE (cdr (assoc 7 (entget (car ent)))))
0 }& {% l/ [, N% u - (command "STYLE" TSTYLE "romant.shx,vnh.shx" "0" "1" "0" "N" "N" "n")
) w5 c- V% ?; ] - (setvar "TEXTSTYLE" Tstyle)! a ]- o6 ]" o% T2 T- |9 [
- (command "undo" "end")+ r7 M# Q) P% [8 s. t0 J/ Q
- )
2 W6 x3 N. {! W - ;Cam on cadviet nhieu 27-11-2023 04h15p36s (thanks cadviet)+ _# w) P' \, g
- * X& Q0 G! x* }
- ;free lisp by cadviet,cd2k44( e% @8 |% F: B. E% v) r) T
- ;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830
; ?( ~4 ?/ j' n* n+ N - (defun c:Fvnh (/ ent tstyle )
6 e1 I: P0 P; \# p* @ - (command "undo" "be")
7 j3 j4 V6 }/ ]: t* k% Z! f - (setq ent (entsel "\n Pick text :"))
2 U& A8 s' `3 C' z1 G8 n) Z/ j - (setq TSTYLE (cdr (assoc 7 (entget (car ent)))))3 L3 P& l# W7 a0 l, z+ ~
- (command "STYLE" TSTYLE "vnhelvh.shx,vnh.shx" "0" "1" "0" "N" "N" "n")
7 T8 W, D. h# X! v. j% H) J - (setvar "TEXTSTYLE" Tstyle)% A- W1 d- @5 E7 k- E7 _6 T
- (command "undo" "end")2 q' m- K7 v5 r
- )
+ _( m3 C. w- K) V, y - / V' R! z4 c, }/ L% x6 U
- ;free lisp by cadviet,cd2k44
, ~ y2 N- ?8 ~ O& p6 t - ;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830
% X3 w0 e/ x% u/ k( [ - (defun c:Chbg (/ ent tstyle )
6 n o+ M7 I' F. h - (command "undo" "be")* n7 Z2 g; m7 S1 b1 O8 P2 }, k: k
- (setq ent (entsel "\n Pick text :"))
! _9 Y. M: y- c - (setq TSTYLE (cdr (assoc 7 (entget (car ent)))))
' n: z$ i s7 { a8 @' e3 K% o - (command "STYLE" TSTYLE "chhbg.shx,vnh.shx" "0" "1" "0" "N" "N" "n")
+ f% W8 j0 C& _9 a+ h - (setvar "TEXTSTYLE" Tstyle)0 Y+ b7 H) k! z, u# s
- (command "undo" "end")
, s r0 h8 w& J$ O u$ Q r - )
8 c* \( |8 R T. E6 ]. q
% y" G% P/ O/ [/ Q1 j$ f9 U! \2 ~- ;free lisp by cadviet,cd2k442 m8 w" C& T6 |9 l
- ;link bai viet http://www.cadviet.com/forum/index.php?showtopic=538307 y2 j$ e; I+ ^3 [, X! @) \( ]
- (defun c:Chsm (/ ent tstyle )
1 a. \8 A6 ?9 `8 L - (command "undo" "be")
5 E% S1 ]& e3 [1 a( ^1 S - (setq ent (entsel "\n Pick text :"))
+ `, L( }; w. y* {: u4 w( X5 Y7 ? - (setq TSTYLE (cdr (assoc 7 (entget (car ent)))))
6 Y1 r |9 S3 T! E - (command "STYLE" TSTYLE "chhsml.shx,vnh.shx" "0" "1" "0" "N" "N" "n")
/ L% P: D4 m# I3 g5 r* @ - (setvar "TEXTSTYLE" Tstyle)# z7 B, v' V5 Q2 \
- (command "undo" "end")" [4 Z* q& c# E% Y( q
- )
1 e: @% r6 _, g2 q4 x6 b4 ~
5 Y. I- f1 k% m6 a) e: v" A- ;free lisp by cadviet,cd2k44
1 R1 @- O* N. \* S! y0 u - ;link bai viet http://www.cadviet.com/forum/index.php?showtopic=53830
6 U5 G- Y9 |+ V _5 Z - (defun c:Fttf (/ ent tstyle )
+ e* `! ? }2 s - (command "undo" "be")0 ]$ B6 d7 X+ |
- (setq ent (entsel "\n Pick text :")); H+ G" K+ o* ^1 J; t% }
- (setq TSTYLE (cdr (assoc 7 (entget (car ent)))))# p9 y; y& J% f9 A
- (command "STYLE" TSTYLE "verdana.ttf" "0" "1" "0" "N" "N" "n")/ V; t) I* Z6 [4 h6 `7 f0 k
- (setvar "TEXTSTYLE" Tstyle)7 M' K3 D' E: x8 o. L0 ^
- (command "undo" "end")2 @+ k# N* D5 f: k
- )! \" `0 {' {: b1 X" W5 |- U
& p% J$ H/ t. V. _! m6 s+ m- ;;; ============================================
; M6 f* F3 t- k1 l$ D% ]1 j - ;;;; [& Q; T: `8 V/ N& I2 l4 `$ y
- ;;; LISP Creater Tao Duong Dan AUTOCAD2000, B- T% M. G0 s" U/ g( F
- ;;;
& v' k4 j* \3 e. S, J0 p - ;;; ============================================8 b# O( A+ d: W$ q& ~
- ! W6 O( B J( M4 O' o
- ;;; ============================================
) S- ?1 l9 Y9 X$ S; p8 Z - ;;;; {" ]- n" W/ T* K) Q/ k
- ;;; CREATING FROM AUTOCAD20009 u! s# M' V" z5 [+ q" I
- ;;;
3 `/ c$ I" t4 f$ C r4 ?8 @ - ;;; ============================================
8 M! h2 ?, ], L7 g4 ^9 F9 ]
. b l8 q* n/ n- (setvar "INSUNITS"4)
" m: G7 }7 @9 H2 t4 k6 d5 | - (setvar "ANGBASE"0)
- Q+ U2 s9 n& S. J8 g9 h+ C2 a - (setvar "ANGDIR"0)" E' `! V. [) t% a; }0 i
- (setvar "AUNITS"0)1 O' _5 A- T7 C- r& D3 X' ~
- (setvar "AUPREC"8)
9 s% w, H8 Y0 d% D; u6 E/ T - (setvar "LUNITS"2)/ r9 q2 y; J& }2 {4 e
- (setvar "LUPREC"8)
+ y/ i G) V! ~2 U1 W$ j/ l - (setvar "ACADLSPASDOC"1)
- |: z% m! \; F8 r - (setvar "pickbox"5)
& d& o! C8 Q8 p - (setvar "blipmode"0)
; W% h1 Y" e5 R - (setvar "mirrtext"0)# _$ D' s, ]' J" ?+ g: l* G
- (setvar "cursorsize"100)
3 n+ O, ?7 n2 ?9 y. L+ z9 f8 O6 e# f - (setvar "ZOOMFACTOR"75)
6 o) R1 C6 e) H# V" s+ P h - (setvar "LTSCALE" 10)2 U. }- i% t* f1 [) P
- (setvar "lwunits"1)1 R/ A. l" m6 h8 l2 j! o
- (setvar "DIMBLK" "Closed")
. _* `4 W. {' ~, N7 n - (setvar "DIMGAP"0.0693). G, [+ x, {. b$ G* c2 {
- (setvar "DIMASZ"0.20)
/ l. c8 F# ?3 V, R. x+ U/ q5 e - (setvar "DIMCEN"0.2)& w! _$ w6 Q8 S
- (setvar "DIMDLI"0.1)
- e( q' C* T0 r' Y4 d$ Y - (setvar "DIMEXE"0.0693)7 U: @7 \) U1 e5 ]7 `% p
- (setvar "DIMEXO"0.25)
+ l" a& `6 D7 J9 E8 K) W# |1 b$ h - (setvar "DIMDEC"0)0 B5 N0 ~0 \& A
- (setvar "DIMTIX" 1)
; G; r% K/ r# r4 W* N - (setvar "DIMTXT" 0.099). e- c) T* w) W! \
- (setvar "DIMCLRT" 7)4 m8 P% x+ h1 A( u
- (setvar "DIMTVP" 1)& O2 H8 T, s' X% C8 M7 c
- (setvar "DIMJUST" 0)4 Z* D; B e6 u* R
- (setvar "DIMTIH" 0) m9 c! u' ~5 B7 j% L
- (setvar "DIMTOFL" 1)
7 k" [& S: ~; }7 k/ y4 a - (setvar "DIMSCALE" 1111.1111)
5 ~# y- f' O1 `3 [! @1 H, D7 Z @ - , `. Z) M: D' z' c+ h/ k# t
- ' w# D3 x9 m2 k4 \$ S) V
- 7 P$ V4 Y9 J1 x/ _4 `, N
- (defun c:zp () (command "'.zoom" "p"))
0 R i8 M& g# o9 d3 z' X% O - (defun c:zz () (command "'.zoom" "p"))
. i) X% A" v9 |. k9 } - (defun c:ze () (command "'.zoom" "e")) z1 z9 l7 }; Q$ Q8 N
- (defun c:za () (command "'.zoom" "a"))
& G6 q. K/ I- t7 n- ~+ h/ v - (defun c:zd () (command "'.zoom" "d"))( K7 A- h( i3 _8 R3 s, j- k1 e
- (DEFUN C:ZZZ () (COMMAND "ZOOM" ".25X"))
3 D r9 M9 k e - (DEFUN C:ZX () (COMMAND "ZOOM" "2X")) L0 G4 y K% Z" h* I
- (defun c:de () (command "ddedit")(princ))
) i! A$ g& |! d2 J - (defun c:dda () (command "Dimaligned"))
; s3 c5 F' d, R1 v1 c2 P6 Z0 E - (defun c:ddb () (command "Dimabaseline"))
r% Q: b3 a! b1 T& j: T - (defun c:ddc () (command "Dimcontinue"))! x. V: m4 Q4 z" h& t
- (defun c:dde () (command "Dimtedit"))
! R; B6 U' t8 B - (defun c:ddf () (command "Ddattdef"))
& V3 V2 [+ [7 W2 u2 ^ - (defun c:ddi () (command "Dimdiameter")): k O/ w# m6 w+ d4 D- O* p
- (defun c:ddl () (command "Dimlinear"))7 Z B# ?+ g( J& g7 s' o5 r
- (defun c:ddn () (command "Dimangular"))/ r$ {4 {6 P- Z
- (defun c:ddo () (command "Dimordinate"))
P2 D& \" ?; [0 U$ q* I2 q* |* l - (defun c:ddr () (command "Dimradius"))
3 K5 A. \* o1 o, g - (defun c:dds () (command "Dimstyle"))% _, H; O; w+ N9 `& ^. a i
4 ^- |$ k9 D) X# G' E2 o! @" z- (defun c:DU () (command "dim1" "up" "select" "exit" pause ))(princ)% D" z X- B* P6 O; D
- (defun c:DH () (command "Dim1" "home" "select" "exit" pause))(princ): K+ _5 Q1 _+ M- _/ k
- (defun c:UU () (command "dim1""update""all"))
% ]& ^% @3 p' H; T - (defun c:ded() (command "dim1""tedit"))
: r- G+ W; n; {, g9 ]3 p" f - (defun c:da () (command "dim1""ali"))
9 n9 k6 V" e0 U5 G - (defun c:dll() (command "dim1""l"))
- e7 @# y3 T& y, h& j9 C - (defun c:dan() (command "dim1""an")); X9 {! |# }) p. W
- (defun c:d1 () (command "dim1""ra"))
: ^/ O- n( E$ x - (defun c:n () (command "dim1""new"))& d2 q0 W6 I6 R0 P* g- {' V: ]& `
1 n9 ^' y% b% W: w$ y5 X1 D- (DEFUN C:PE () (COMMAND "PEDIT"))* d; U( E$ T; x8 P/ e
- (DEFUN C:PL () (COMMAND "PLINE"))
" }* |( X K2 |4 w - (defun c:dd () (command "dist")(princ))% W0 v. V& p1 X6 Z) I) y7 T' w
- (defun c:w () (command "pedit" pause "w" "au")(princ))
) Q5 q4 \; l4 c0 o, R0 o3 U" l - (defun c:pg () (command "polygon" "polygon"))
' V1 K/ N' `- W* G, W - (defun c:el () (command "ellipse"))% J) m! G' v4 E3 ]. Y* B
- (defun c:xe () (command "explode"))
; [# u2 ~8 F! s" h$ B - (defun c:eex () (command "extrude"))- A1 K: J" H) E
- (defun c:xg () (command "xline""a"))5 m4 f9 K7 \. r* D, o4 e
- (defun c:xh () (command "xline""h"))/ P! ^+ r* ^; y0 i# N6 N! n! Q# q
- (defun c:xv () (command "xline""v"))
- `8 C8 ^1 X t: e' B" O - * [& J/ J- [ H8 d2 w' u% X
- (defun c:oc () (command "osnap""cen"))
5 C- @4 n/ p s# H$ } - (defun c:od () (command "osnap""nod"))* L$ c7 }" j4 ~) L+ p
- (defun c:oe () (command "osnap""end"))
7 r! @# }$ @2 ~' k - (defun c:oi () (command "osnap""int"))
. }3 Z. G p/ j# V3 b- i* j0 \3 X: k - (defun c:or () (command "osnap""per"))
- O" i! V$ Q) V - (defun c:on () (command "osnap""none"))
0 r. i# `; ]- s- X5 \ - (defun c:oq () (command "osnap""qua"))
" ~9 ~4 J/ P0 S& ^8 R* D7 M - (defun c:om () (command "osnap""mid"))9 X9 C2 r3 u: N9 y
- (defun c:ot () (command "osnap""tan"))
' m A9 d* x3 b, D - (defun c:oin () (command "osnap""ins"))
3 X" B. h7 b: e( w! S - (defun c:oa () (command "osnap""nea"))
9 q/ p% m3 b9 d/ a - (defun c:ol () (command "osnap" "End,Mid,Cen,Node,Nea,Int,Perp,Qua")(princ))8 `* w! S0 X, \
- ;(defun c:du () (command "dim1" "up" "s" "pick" "other"))
3 E7 r+ p, b# \$ n. Q1 w# i3 c | - ;(defun c:nn () (command "new" "y" ))
) ^$ V7 H y! G3 M/ R - P0 @* U( \( h6 a0 g
- (defun c:/ () (command "limits"))# g$ j+ v3 \- l* `. {9 q, S$ Y+ y
- (defun c:`1 () (command "region"))
' n* b j. b \8 z, F; w2 }% g" p - (defun c:`2 () (command "subtract"))$ O. U) {/ n( h# M# K1 y5 k, c% |4 [' I
- (defun c:`3 () (command "union"))
6 c0 c6 n8 G" o* v - (defun c:`4 () (command "intersect"))
7 O' i6 D4 i' z; b; J - (defun c:`c () (command "cal"))
7 d. N4 c3 X( `9 Z" W - (defun c:`g () (command "Polygon"))
& y: D4 b3 X& `$ C
8 v$ M" v9 L2 }( L8 Q- (defun c:lmi() (command "LIMMAX" pause "" "zoom" "all" )(princ))
- n2 _3 _% L: T3 Z" \8 e& ^ - (defun c:drt () (command "DRAWORDERCTL" pause "Integer" "" "" )(princ))
" s- j3 L+ k0 v: B - (defun c:ip () (ssget) (command "print,_plot" ))(princ)4 L, ?3 Z5 o: O. {$ E3 j
6 k8 y; |$ h+ z/ k3 g0 O- (defun c:ddm () (command "ddlmodes" pause))
4 @ W' T6 J6 A& V
- m$ c @! a7 z/ w) ~- (defun c:sha () (command "shade" pause))
8 X5 [0 H5 w+ j/ q$ e3 ^ - * H+ b8 y" d: l9 d$ M
- (defun c:sr1 () (command "surftab1" "p" "" pause))' d, o* q3 U. `. r* T# S0 c- b
- (defun c:sr2 () (command "surftab2" "p" "" pause))
( J5 r" w5 u9 \! Q' M% }2 p2 V- H
9 g7 b( k! J* [8 l( P8 p7 b$ K- (defun c:ad () (command "audit""y"))
# g% S' e$ R+ L0 H) ^ - (defun c:q () (command "quit"))1 b) U) B) Q( p/ ~
. N, @) s9 F5 J1 V6 }: P) o' U" K- (defun c:30 () (ssget) (command "rotate" "p" "" pause "30"))7 o$ M; a8 @% |8 x& K
- (defun c:-30 () (ssget) (command "rotate" "p" "" pause "-30")) _4 _( ], T9 m" u% y7 r
- (defun c:45 () (ssget) (command "rotate" "p" "" pause "45"))
- V# P! m9 k5 O - (defun c:-45 () (ssget) (command "rotate" "p" "" pause "-45"))/ j8 W! m# V2 E4 g! T/ {3 h: b
- (defun c:60 () (ssget) (command "rotate" "p" "" pause "60"))
7 z1 u. Y8 g( e - (defun c:-60 () (ssget) (command "rotate" "p" "" pause "-60"))
. r) ]( K6 A. V5 b - (defun c:90 () (ssget) (command "rotate" "p" "" pause "90"))
* F8 o9 E. {/ I3 b) R - (defun c:-90 () (ssget) (command "rotate" "p" "" pause "-90"))
! B, J4 d' x" _% b) D+ F - (defun c:180 () (ssget) (command "rotate" "p" "" pause "180"))
- K6 ^: F2 _" V9 a
, }: K" T( K# [0 N8 y* B8 |- (defun c:u3 () (command "ucs""3"))5 E" b& Z6 P1 |# D, u
- (defun c:ue () (command "ucs""o""end"))
, H) Z' l. z1 d1 d; o' _' l5 n& G - (defun c:ui () (command "ucs""o""int"))7 V7 i9 g! X) ^5 R
- (defun c:um () (command "ucs""o""mid"))3 F7 e# w9 y$ Z& ?
- (defun c:uc () (command "ucs""o""cen")): Z4 ?, W5 y& z @% ]
- (defun c:uq () (command "ucs""o""qua")). c/ J' u7 h0 i1 @
- (defun c:3s () (command "ucs""3"))
( J0 b7 ]: M6 D: D0 r- [5 Z% n - (defun c:sx () (command "ucs""s"))
8 C6 \& y1 x, t) y$ `$ V! z* N - (defun c:sf () (command "ucs""o"))8 V6 h2 N. C6 X. y6 u# y
- (defun c:sz () (command "ucs""p"))
* A( Z! v: V3 w6 E# z - (defun c:sr () (command "ucs""r"))( q: N* P0 I" e2 d" O; [" m: R, G
- (defun c:sw () (command "ucs""w"))7 x5 ]) h$ q' ^/ p* S3 n
- (defun c:fv () (command "ucs""v")) j/ d/ V2 ]3 B
- (defun c:ux () (command "ucs""x"))
4 @! ~7 t& Y E$ R' z2 E - (defun c:uux () (command "ucs""x""90"))
& ~9 S2 C; U$ Y4 U - (defun c:xxu () (command "ucs""x""-90"))7 h v1 v1 W$ d
- (defun c:uy () (command "ucs""y"))" R; q" f0 w$ {* B5 H
- (defun c:uuy () (command "ucs""y""90"))
1 r8 @: c( T$ \ w - (defun c:yyu () (command "ucs""y""-90"))1 P5 Y: C) ]$ }
- (defun c:uz () (command "ucs""z"))9 K1 f7 N7 _7 d8 F3 R
- (defun c:uuz () (command "ucs""z""90"))
. j# s# I# P0 E3 k0 H! _ - (defun c:zzu () (command "ucs""z""-90"))
+ P( D) _: \. b. [. I: Y - (defun c:uci () (command "ucsicon" "Properties" ))(princ)
( R/ A' o# Z' d- y# P - (defun c:ucm () (command "ucsman" ))(princ)
% l8 r% u* o1 t5 p8 o9 _6 ?
1 k9 I- E7 l7 p8 o+ _- (defun c:sa () (command "vpoint""_non""-1,-1,1"))
# }. Q3 L) B ` - (defun c:sd () (command "vpoint""_non""1,-1,1"))' K$ F0 ?2 R# _1 Z4 V
- (defun c:se () (command "vpoint""_non""1,1,1"))
& ]. E- x/ d( a9 v9 I( w - (defun c:sq () (command "vpoint""_non""-1,1,1")); j- q/ J3 Z% ~ g8 F& W, r
- (defun c:vc () (command "plan"""))0 \& d: k" _1 B4 I' O0 i4 e7 _- d7 ?
- (defun c:vd () (command "dview""all"))
3 F5 m; L) `5 O4 O, U! u) S: w8 x - 5 u' n5 G! X& v+ n/ h3 S* G. D+ c
- (defun c:TT0 () (command "tilemode""0"))" |$ B+ o2 v" u. o, e: |& n
- (defun c:TT1 () (command "tilemode""1")). u6 l, ]* t; V0 C0 p! E- B
) {$ C1 r' k3 M- d, K4 @! p. O- (defun c:vt () (command "vpoint""_non""0,0,1")), I1 }" E0 u! V0 A' t5 @* s, \
- (defun c:vb () (command "vpoint""_non""0,0,-1")), v6 U8 v& j M: j! g5 I5 y
- (defun c:vl () (command "vpoint""_non""-1,0,0"))
$ A$ \+ X1 L8 b0 _. c, h3 h - (defun c:vr () (command "vpoint""_non""1,0,0"))+ A- ]2 \6 w! R
- (defun c:vf () (command "vpoint""_non""0,-1,0")): L6 d( [* _" { _3 j! C, Q$ V
- (defun c:vk () (command "vpoint""_non""0,1,0"))
+ C5 M5 Q6 O$ S8 J* Q7 x8 r - + C1 _) ^8 Q% o/ ]* M3 J
- (DEFUN C:MM () (COMMAND "MIRROR"))% F/ d8 `% e ^" G9 S9 L, ^
- (DEFUN C:MP () (COMMAND "MOVE" "P"))
# j7 Z; r3 _2 f/ z - 6 X3 Q. [% T* x6 k. [# V
- (defun c:mee (/ a)
- [. ?4 u' K5 S - (setq a (ssget))(command "move"a"""end"pause"end"))
) ~0 R1 `" Q Q3 n - (defun c:mc (/ a) h, G9 m# D6 T- b) v
- (setq a (ssget))(command "move"a"""cen"pause"cen"))
+ F5 Z. d+ n7 l5 S - (defun c:cc (/ a)
, u" o7 w) p9 U - (setq a (ssget))(command "copy"a"""m"))8 a+ u+ d, f; [$ x6 D4 f
- (defun c:ce (/ a)
5 D! b7 u+ T5 A- U' z2 U$ i - (setq a (ssget))(command "copy"a"""m""end"pause"end"))
9 }4 A5 X% H) j3 O! p - (defun c:cn (/ a)9 ?) E9 {/ n% u
- (setq a (ssget))(command "copy"a"""m""cen"pause"cen"))! u! P0 _3 M8 R; p, {# M: V' Y
- (defun c:tl ()(command "trim""l"""))
& @+ T4 Y' v' ?$ G6 f1 J, O - (defun c:tf (/ a)3 Z0 x4 d2 [' e% b B6 [& m F: ]6 S
- (setq a (ssget))(command "trim"a"""f"))9 z! ^& B0 X( g. L- k7 k; i
- (defun c:el ()(command "extend""l"""))5 l% [9 X4 N5 a' B0 v. a/ A6 Q, ^6 M
- (defun c:ef (/ a)% A9 ]4 o# ?4 }. k
- (setq a (ssget))(command "extend"a"""f"))
2 ?2 }- _6 M& v2 J* a - / w3 s2 e7 y# v# c* X: h, z9 ^
4 p6 a0 @9 J9 V* b# M- (DEFUN C:110 ()(princ "\nChon doi tuong can offset ra 110.......") (COMMAND "offset" "110"))
8 o; c' x$ t" [' E0 H% s - (DEFUN C:220 ()(princ "\nChon doi tuong can offset ra 220.......")(COMMAND "offset" "220"))2 E& i) V- L" Z+ P- Y
- (DEFUN C:330 ()(princ "\nChon doi tuong can offset ra 330.......")(COMMAND "offset" "330")): C4 _7 H% A. L h& f
- (DEFUN C:400 ()(princ "\nChon doi tuong can offset ra 400.......")(COMMAND "offset" "400"))* l# O3 m: g8 A4 K6 D
- (DEFUN C:55 ()(princ "\nChon doi tuong can offset ra 55.......") (COMMAND "offset" "55"))
/ l: s E" ^$ a' s) X& U - (DEFUN C:600 ()(princ "\nChon doi tuong can offset ra 600.......") (COMMAND "offset" "600"))& o9 f' O: V# f% E, I0 R: |3 h
- (DEFUN C:700 ()(princ "\nChon doi tuong can offset ra 700.......") (COMMAND "offset" "700"))2 `5 H w9 [5 q9 J4 ^
- (DEFUN C:800 ()(princ "\nChon doi tuong can offset ra 800.......") (COMMAND "offset" "800")); y+ l5 B6 K* V5 q1 a
- (DEFUN C:900 ()(princ "\nChon doi tuong can offset ra 900.......") (COMMAND "offset" "900"))- I# B5 H9 L G3 U* }3 N; O
- (DEFUN C:1200 ()(princ "\nChon doi tuong can offset ra 1200.......") (COMMAND "offset" "1200"))
) \1 F* G7 N+ X' x3 | - (DEFUN C:1500 ()(princ "\nChon doi tuong can offset ra 1500.......") (COMMAND "offset" "1500"))2 @# ?- c* l; H0 b9 ^5 ^( q' x
- (DEFUN C:1800 ()(princ "\nChon doi tuong can offset ra 1800.......") (COMMAND "offset" "1800"))
$ m8 X! \) L& f3 P, H3 `9 N& | - (DEFUN C:2400 ()(princ "\nChon doi tuong can offset ra 2400.......") (COMMAND "offset" "2400"))1 j5 }2 s- j& q' B
- (DEFUN C:3000 ()(princ "\nChon doi tuong can offset ra 3000.......") (COMMAND "offset" "3000"))
/ v$ X' }. ^" c1 w3 o; V+ V - (DEFUN C:3600 ()(princ "\nChon doi tuong can offset ra 3600.......") (COMMAND "offset" "3600")). f# S. q0 _! @) }5 g! g
- (DEFUN C:4200 ()(princ "\nChon doi tuong can offset ra 4200.......") (COMMAND "offset" "4200"))
5 R7 |' h& T3 j e5 I$ X - (DEFUN C:5000 ()(princ "\nChon doi tuong can offset ra 5000.......") (COMMAND "offset" "5000"))- K. z0 W7 F; F, F. A2 v
- 1 o5 ^) H- \1 c
- (defun c:mla () (command "-mledit""av"))! R2 o3 x/ W# V' ~8 e0 g+ }; s; P+ s
- (defun c:mlc () (command "-mledit""mc"))
! k, P8 \1 h$ {8 `! K0 m- z9 p - (defun c:mld () (command "-mledit""dv"))
7 f- }2 F) G4 ]3 I4 i* I# h! { - (defun c:mle () (command "mline""end"pause"end"))
# Z$ U% x4 `; ?5 Y, p& j& E - (defun c:mli () (command "-mledit""ca""int"pause"int"))- S/ P3 w4 l2 ^4 F
- (defun c:mlj () (command "-mledit""cj"))
0 e4 t; }3 @' Q( H6 h1 k - (defun c:mlt () (command "-mledit""mt"))% M) B4 H; g* b: ^* f: ]+ \
- (defun c:mlk () (command "-mledit""ca""end"pause"end"))0 z/ h) ~# o' i1 R; K! e% `
- (defun c:mlw () (command "-mledit""wa"))
) @4 a9 E1 A2 T$ k3 N - ( n" t) |% ]) {! D) |
- (DEFUN C:DCA () (COMMAND "DVIEW" "all" "" "CA"))
7 _. d# G: B3 D& Y - (DEFUN C:DPA () (COMMAND "DVIEW" "all" "" "PA"))
8 V+ P4 C) n5 o. J; e# w, N. D" U - (DEFUN C:DPO () (COMMAND "DVIEW" "all" "" "PO")). V& o: p9 G# U
- (DEFUN C:DDD () (COMMAND "DVIEW" "all" "" "D"))
3 U [1 a- T0 G4 }# I+ \4 Y# S$ ]- e - (DEFUN C:DZ () (COMMAND "DVIEW" "all" "" "Z"))
2 a7 n7 ~ w& O3 r" J- ?3 @
' E: P% Y3 Z# J; ?- (defun c:p0 () (command "pline""""w""0""0"))4 m! u7 E# { m- c+ G5 i
- (defun c:ot () (command "offset""t"))
/ g. }) L' z2 w J: Q; b/ ] - (defun c:t () (command "mtext"pause"j""bl""h"pause))
% S( F. i+ h/ l ? - (defun c:uo () (command "ucs""ob"pause))% Z9 V4 m* i( C) ]+ W
- (defun c:f0 () (command "fillet""r""0")); Q# p6 `( c. B. H; r4 r7 k; t
- (defun c:fr () (command "fillet""r"))
/ k- z# b5 n. `) q - , q5 m+ Q9 @1 Q' `9 Y4 ~5 S
- ;CHAMFER
6 L* O4 e% p" r* B - (defun c:cf () (command "chamfer"))' W/ o0 b9 D& y; J e1 h# Q
- (defun c:cfd () (command "chamfer" "d"))
/ f, A! ]7 [0 E% q. T - (defun c:cf0 () (command "chamfer" "d" "0" ""))% M# U: e' H7 i# A
- 2 o& |9 p1 w2 s/ i% t" y0 D
- ;FILLET% H6 _) E- z+ Q C' u& g& \2 s
- (defun c:f () (command "fillet"))+ q+ L3 o/ l& p- w* E7 B4 o( _
- (defun c:fr () (command "fillet" "r"))" B9 l# C e N
- (defun c:f0 () (command "fillet" "r" "0"))+ m8 R* ]; L" [# C& z
- # c7 h5 U" j" O) ~
- (defun c:OO () (command "oops"))
4 h2 @: m4 p; Z7 C& H - (defun c:dln () (command "dimlinear"))- Z% u; [. w, z1 g. ^2 q: C2 H
- (defun c:dan () (command "dimaligned"))9 a) ^! l( e' W; M- Q1 J. k
- (defun c:ddc () (command "dimcontinue"))
( S) }+ H5 X3 ? - * h$ u3 R$ V# W, w( s
- (defun c:sc () (command "scale" "auto")), q4 O' W ?% K
- (DEFUN C:XO () (COMMAND "snapang"))
; G* T5 a, v/ K% h - (defun c:cc (/ a)0 n" z8 Y( c. h6 @& c- j! X
- (setq a (ssget))(command "copy"a"""m"))2 V0 s9 ]5 }. D# K0 \) P
1 k/ y+ p8 o& U' F- (defun c:PJ (/ a)3 q, q: F8 e* h, X5 }+ q' ]
- (setq a (ssget))(command "pedit"a"""j""all""y"))
% ^+ ~: G5 l% ~. f( W, R - (defun c:JJ (/ a): g u+ P& Q) w6 c
- (setq a (ssget))(command "pedit"a"""j""y"))
4 n5 [: ^+ a( ~' N3 r - (defun c:TN (/ a)5 U$ |( w9 l+ M0 c9 u0 q! D
- (setq a (ssget))(command "change"a"""p""T"))
% X; ~2 C6 `. b1 J3 W6 } - , H9 D) ^2 u. W" q( U
- % E: n8 `+ U7 O, u/ y8 \
- ;=======================Tran Ngoc Thang - Tu nam 2000 - Hoc nam cuoi KTS . DHXD=========================$ Z$ [ K" \2 L3 {2 m) o
- : L9 }4 {# n1 h. n
- (defun C:IB ()(setvar"cmdecho"1)
- b7 U& p8 q& @5 q* c/ U - (setq pt(cadr(entsel"\nSelect Block:")))
( }3 q% Q. |+ B) S# F - (setq e1(ssget pt))
2 h0 D, Z( @9 ? - (setq e2 (entget (ssname e1 0)))
: ~: G4 N, O( P" V0 p! {' {( a - (setq blname (cdr(assoc 2 e2)))
! r8 y1 [: B' ^1 Q5 B+ q5 w% B5 _ - (setq oer *error* *error* err2)(command ".insert" blname))
0 k$ c0 ?8 K( @5 { - + N6 s# ^; C+ z0 a: b5 m3 r
- (defun c:II ()
, B& W. R) D7 _ - (setvar "cmdecho" 0)3 x5 a( ]& K C* L
- (setq olderr *error* *error* myerror)
# T0 J4 l, u3 j4 U4 l1 H - (prompt "\nSelect objects: ")
- b$ H" W) G- t9 Z( ^4 z5 ~4 S- ]4 J - (command "select" "au" pause)
/ U; b4 z0 V9 U6 ~, v& F4 Y - (setq sstxt (ssget "p")* X# p2 U4 a: M8 O% g
- sslen (sslength sstxt)/ ^7 m+ I, X+ B3 c% Z
- ctr 0, w( b+ k6 C) A. y. K! ?, U
- )- m* g7 v6 Y- S4 u+ f
- (command ".undo" "mark")6 e2 |% r a/ i7 i7 e& e, m4 r
- (while (< ctr sslen)' @' u3 [' U$ t5 G$ o: t; Q9 i
- (setq listxt (entget (ssname sstxt ctr))- h" p! h. G4 z# ]" e
- txttxt (cdr (assoc 1 listxt))8 S8 |+ g+ F* A6 k' R
- enttxt (cdr (assoc 0 listxt))
! b, [6 x/ O' u# {! K% b7 z' ?" x - )/ ]# ^/ G3 ^7 m; I
- (if (= enttxt "TEXT")
. W, F" R9 |) W - (progn
! U. [# x* t" X; e5 ^ | - (setq testxt (substr txttxt 1 3))5 H6 i; P6 c9 P, L* } [7 L7 z5 p1 o2 Y
- (if (or (= testxt "%%C") (= testxt "%%C"))- s) ?5 ^7 C) Q+ y
- (setq newtxt (substr txttxt 4))
9 s- U5 k0 q2 u! ] - (setq newtxt (strcat "%%C" txttxt))& }8 W2 }$ s* n! S8 v E
- )3 A: W |0 ^0 c1 a
- (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))
% r+ k. r: H8 g K - (entmod listxt)
2 V2 ?3 X& n9 x3 `, {# o - )
3 l) j( Z2 T# v! u e8 @/ l) ?! N$ K - )5 @, J' z1 U9 ?) l/ }! Q# w
- (setq ctr (1+ ctr))& M, ~" e' i' E L: v' C
- ) u' i# ?# x5 @, y! V& L/ }
- (setq *error* olderr)
4 H' C/ ~: C3 [$ I( {5 ~ - (setvar "cmdecho" 1)# i9 k5 Z4 ?. F3 g# a3 d
- (princ)3 |$ B3 f0 Z3 D$ N8 t5 |- F
- )
* w+ i3 |3 B2 X' Z
+ g- P% c" J9 ~8 ^- (defun c:DG ()/ S$ k( I, p7 E/ ~, X( s
- (setvar "cmdecho" 0): f) ?5 t8 e# X; r% X9 R
- (setq olderr *error* *error* myerror); k1 D2 Z3 J2 f. R7 i5 N5 d* W" g8 D
- (prompt "\nSelect objects: ")
1 a. L: V% `+ [& Z7 }% q. t+ j3 d! s - (command "select" "au" pause)+ y* R S$ J* K' x' M% [% R2 C, _
- (setq sstxt (ssget "p")3 B* ~) a# W0 D% t7 Y+ I3 m
- sslen (sslength sstxt)
% Z' o+ l4 C1 k' i - ctr 0
, O- n$ U L# C3 p- R. p - )$ X) l* J( Q: A( G- [& R
- (command ".undo" "mark")3 N8 P+ l0 \6 ^: Y6 n' U* r
- (while (< ctr sslen)
5 X3 u( \2 ?( @ - (setq listxt (entget (ssname sstxt ctr))8 s* F) s* h$ G |" Y6 w( m
- txttxt (cdr (assoc 1 listxt))
) n. m G1 p# {0 c7 a9 z ]: S - enttxt (cdr (assoc 0 listxt))# M2 r& Z4 g6 z
- )9 @2 K9 E# V, g+ G# a
- (if (= enttxt "TEXT")$ y- C# y' O/ }$ o
- (progn2 W5 z& r/ Y3 s. L# O5 ~
- (setq testxt (substr txttxt 1 3))+ @9 ~5 x% [$ k3 E" n n6 A S0 G
- (if (or (= testxt "%%d") (= testxt "%%d")) T$ Q1 y- p M
- (setq newtxt (substr txttxt 4))" h5 u: z+ H \+ N
- (setq newtxt (strcat txttxt "%%dC" ))9 _" l0 z. o2 {+ w+ @$ w6 |
- )
% |6 Q% q2 y0 H8 a0 A8 {* w+ l3 h - (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))- \6 ~* m0 p8 ^2 k0 j {
- (entmod listxt); b- T* f3 @1 N7 S
- )
9 e8 F% B+ n, V" m. a5 Q - )
% V" I8 `- W" M1 s! `3 z - (setq ctr (1+ ctr))6 }, J1 w3 D$ D4 R
- )
+ |% j4 J* a/ R4 \3 Q: E0 L, O. `( t - (setq *error* olderr)6 G' U0 n3 Z' S
- (setvar "cmdecho" 1)
P. k" z% t1 ~ - (princ); h0 a, _6 \: ]* q7 J0 V6 Y$ T
- )
; c$ d6 |5 S4 f( `7 z+ Y) ^
$ u' D9 ^4 y* I% P7 d [( z: m8 G- (defun c:PI ()
z" X5 t" ^" u/ f' r3 @2 t - (setvar "cmdecho" 0)
4 p( o6 j |5 L3 c7 w - (setq olderr *error* *error* myerror)3 W' |9 b9 G" E1 V% z# A4 a
- (prompt "\nSelect objects: ")4 d/ l2 f4 {: U; ^
- (command "select" "au" pause)2 m' c) I, d2 Q" i
- (setq sstxt (ssget "p")% |$ _4 I0 c+ j+ N) v* x
- sslen (sslength sstxt)
# C3 P1 k; j) \/ E6 X2 m0 G - ctr 0
6 _. Q5 p* m9 w( E - )8 E7 J& w6 O m" W1 [7 S' h9 A
- (command ".undo" "mark")
- _* d, y; h0 j q+ j6 B7 K% C! C - (while (< ctr sslen). R, h2 I( P2 ], c
- (setq listxt (entget (ssname sstxt ctr))
& o. y* o8 _2 K( S0 l - txttxt (cdr (assoc 1 listxt))
" M# W0 [/ ^4 b- E! A& E- j - enttxt (cdr (assoc 0 listxt))
7 R! \1 H& {" @, h9 w; T - )* v% Q3 i* K- c& X& v) P0 p
- (if (= enttxt "TEXT")" ]+ ]3 e: t; @. M
- (progn
I* t) n) |$ W, c - (setq testxt (substr txttxt 1 3))$ p8 i- b, X( X9 C3 x
- (if (or (= testxt "%%p") (= testxt "%%p"))+ y, _- p# U4 M% b/ F
- (setq newtxt (substr txttxt 4))' U2 U" Q ~# L# P
- (setq newtxt (strcat "%%p" txttxt))
/ r4 U7 z4 Q& G3 \3 \ - )
9 C; y& g" D* r7 E" \- v - (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))
$ O4 \( z. Y! e5 u - (entmod listxt)
5 f- P: u b" U0 u' a" h- c: X' l - ). ^* t6 b8 E8 e9 u- v+ l
- )5 b3 r) P8 h2 |4 U% z# l" o) D5 i
- (setq ctr (1+ ctr))* y! h1 N: k3 J! `: \% Y9 k1 h8 Q
- )# R% w8 f4 K7 o1 }7 K) I" @
- (setq *error* olderr)/ y/ ? f P# ?
- (setvar "cmdecho" 1)$ l( e! ?/ f% {* Q8 t
- (princ)# E: ~9 U" [1 v9 P
- )% @0 G( z; m4 w! K
/ u+ U7 J8 `$ Y2 Z& f: |) @- (Defun c:CB (/ a): s: P% F i9 d$ w7 p, E2 I* T7 M
- (setq olderr *error* *error* myerror)
% k3 h6 r6 O: @! s# ^ - (setq ocmd (getvar "cmdecho")) ?" S4 e! p4 ~/ i0 o
- (setq oblp (getvar "blipmode"))% Z" O! [' [( K
- (setvar "cmdecho" 0)
( g/ C0 G5 q" h x" F - (setq a (ssget))8 t8 G) N' N6 R$ K0 a
- (command "CHPROP" a "" "C" "bylayer" "")
4 J8 D: d# X7 N3 b+ T - (setvar "cmdecho" ocmd)- K( x2 g$ W8 p1 P4 F
- (setvar "blipmode" oblp)
) x! S, ?. S8 i8 e" K$ G- { - (setq *error* olderr): w9 U7 Z" f+ T" c- c
- (princ)# { | ^" D, N+ \! i3 y, S' o
- )
) b( D( N! d3 q
! k: M# n+ S: n& y- (defun c:LCC (/ co43 obj23 la23)
& i$ o% f1 w! W" h* ~* H - (setvar "cmdecho" 0)
& I, W; e, {8 Z4 i7 N0 R - (setq co43 (getstring "\nNew color : ")): B+ W% w3 M' V5 Z
- (setq obj23 (car (entsel "\nPick object on desired layer: ")))
+ ?; v! F0 W$ m4 u- C- S - (if obj23 (progn
8 c6 Y; o2 A& h* ?5 B5 u2 T1 H - (setq obj23 (entget obj23))+ A# z0 Y- a g
- (setq la23 (cdr (assoc 8 obj23)))
2 ]: g: i, H& F( n4 o- r - (command "layer" "c" co43 la23 "")
- O" i! r. R% i - )5 [9 V3 ]% h, b, _4 D! G% s
- )
; V- K+ T$ @" ?. {* \/ b* ~ - (prompt (strcat "\nLayer has changed..." la23))
$ _# p) C) A. S7 |; \% D5 @ - (setvar "cmdecho" 1) M" V: g7 k4 ~- \; x K
- (princ), [7 V3 c2 B1 l0 y
- )
% o7 z, Y4 D0 E0 y% G3 _8 J - K2 ^$ |3 z5 r' A9 B7 Y" P
- (Defun c:RP (/ a)
" N% @. q& V: N8 T3 M; C - (setq olderr *error* *error* myerror)
# g0 Q3 q# D4 y6 v9 M - (setq ocmd (getvar "cmdecho"))3 J+ n# O* i6 f+ V) B( |
- (setq oblp (getvar "blipmode"))0 D4 [' }7 W7 y
- (setvar "cmdecho" 0)! |- d( f0 V4 |- u4 a7 e% Z# O/ F0 {
- (prompt (strcat "\nUSE: Delete object(s) belonging to"
5 v, f; c! D- g5 p3 i( \ - " the layer of the entity picked...!")): b0 S7 d8 ]$ l1 _8 X1 Q
- (setq a (entsel "\nPick the entity with the desired layer to delete: "))( E- w, Y& l @
- (if (/= a nil)( s0 S* f4 b. C
- (progn (setq a (cdr (assoc 8 (entget (car a )))))$ R* ?. Q2 K4 U8 V& M5 o! D3 d e
- (command "Erase" (ssget "x" (cons (cons 8 (eval a)) tempword)) ""))
1 N# u) V, y2 A' y) V2 B - (prompt "\nNo entity selected!"))
! p! L3 _& ?& q% ~* i& n - (setvar "cmdecho" ocmd)8 ]$ G" u0 N! a* z& S+ G
- (setvar "blipmode" oblp)/ {# v, ~# c' ]& q
- (setq *error* olderr)
2 e' {$ r0 F3 V# ?# t# o. {, a - (princ)
: e4 j6 t0 a; M# Q" B9 K2 |1 k - )) e$ r! |! e, e& F
- - @1 n: U+ G# O8 T" A
- (DEFUN C:WL(/ SSET NET SSL M)
! b4 M7 j; _$ A( \3 t - (PRINC "\nSelect lines :")/ p" N" r* i, `! Q$ l( R3 L
- (SETQ SSET (SSGET))
& ?' A1 e$ f* n$ u' Q; s; } - (IF (/= NIL SSET) (PROGN' H) E. z- ~. r9 a! F: B* q
- (SETQ SSL (SSLENGTH SSET))6 h7 W& [# i( o! T
- (INITGET 4)' o/ \# J7 ^4 j6 R7 L; Z/ {
- (SETQ NET (GETREAL "New width : "))
& h/ @) I% U, q$ S9 B - (IF (/= NIL NET)
. g, I& W, Z6 ~+ I$ H8 s( r - (WHILE (> SSL 0)
$ k6 y9 l$ e4 c. j - (SETQ M (SSNAME SSET (SETQ SSL (- SSL 1)) ))
" D( ~+ c+ O1 U2 l - (IF (= (CDR (ASSOC '0 (ENTGET M))) "LINE") 3 Y- q6 }# H. N0 ~$ _# h" d+ e* S" \
- (COMMAND "PEDIT" M "Y" "W" NET "")
, |1 b' r: X$ z; O* z/ O3 a - ) " J& p# u+ Q/ N. ^* D7 l
- )
- k5 o# c+ U3 x N4 |* f' s9 J - )))
. W% H1 P: J& t; B - (PRINC)# a2 c6 f) y3 r9 ?; J( h
- )+ _! { Q+ ]8 F' @0 C; t
& S- ^: Z+ X M( r' W- (defun C:MML ()
5 Q- s8 G- j! E) N/ |/ O! E - (princ "\nSelect objects to move to another Layer.")
7 t Y, W& V/ ?4 ]5 t - (setq ss (ssget))5 I' s# ]3 ]! j v. Y, x
- (SETQ UL1(GETSTRING "\nLayer to move entities to : ")); l, i1 L+ }6 e7 ^
- (setq counter 0)
( \3 F2 S# n2 i. R - (prompt "Moving to layer.....")(princ ul1)
" J$ w( o8 [$ b7 j2 c& a8 R - (setq e (ssname ss counter))
1 i4 u& S) Z' e - (setq l (cdr (assoc 8 (entget e))))' P5 V' _7 b& ~. q( p
- (setq S (ssget "X" (list (cons 8 l))))1 b% Z! _& m. C4 |, D9 F0 n
- (command "CHANGE" ss "" "P" "LA" UL1 "")
. o5 n+ r4 a; H, o- J - (setq counter (+ counter 1))
! A6 `# t5 l* n. _: C! ]' D- L - (princ)
1 J/ v$ H) B, |" x - ) & \, @3 n: j+ D3 O x6 X
- - D7 J$ D7 r2 D* r2 W
- ;;; ================================ GHI CHU ============================! N3 c+ z' X3 J+ `* c, o) t
- ;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========
( ]/ c+ [9 E( L- }. ~5 J - ;;; =======================Thuong Dung Font Romant.vnh===================$ \: g! L" P9 L) j. _( \9 \
' w, A5 r0 k5 a3 y- (defun c:RS (/ pta ptb ptc ptd X Y X1 Y1 rmsz pl1)) U) a/ ^2 H# F2 q
- (setq oer *error* *error* err2)
4 }$ O: [: |8 A% J" R7 n& d - (PROMPT "\n(UNICODE-Verdana)(D)ining room. (S)torage. c(L)oset. (C)onference. (O)ffice. (K)itchen. (B)ath. (M)aster Bedroom. ")- ~2 `* x$ P I3 }- d% r
- (SETQ Cpt(GETSTRING "\n (ROMANT-vnh)(DD).(SS).(LL).(CC).(OW).(KK).(BB).(MM). (UNKNOWN-font)(oD).(oS).(oL).(oC).(oww).(oK).(oB).(oM)."))/ x5 [- ]) F+ F0 A) I
- (IF(OR(= Cpt "K")(= cpt "k"))(SETQ CPT ' "Nha` Bê´p"))
0 E3 I2 b1 L, u- ` - (IF(OR(= cpt "B")(= cpt "b"))(SETQ CPT ' "Pho`ng Vê? Sinh"))
+ m& l. P) x c% l4 I1 r% ] - (IF(OR(= cpt "C")(= cpt "c"))(SETQ CPT ' "Pho`ng Ho?p"))7 h4 l% M& Q C9 V
- (IF(OR(= cpt "O")(= cpt "o"))(SETQ CPT ' "Pho`ng La`m Viê?c"))) J, S9 J" I$ A% k: i: T
- (IF(OR(= cpt "M")(= cpt "m"))(SETQ CPT ' "Pho`ng Ngu?"))
9 Q" d# z) F8 p; Q - (IF(OR(= cpt "D")(= cpt "d"))(SETQ CPT ' "Pho`ng Bê´p + An"))
S H) _8 d. d( y+ x" R - (IF(OR(= cpt "S")(= cpt "s"))(SETQ CPT ' "Nha` Kho"))
2 s+ f/ \1 N7 M5 m4 a8 u6 p o$ i - (IF(OR(= cpt "L")(= cpt "l"))(SETQ CPT ' "Pho`ng Ðê? Ðô`"))
1 ]& g5 s2 P$ O, y
' g, I- h- Y1 Y- (IF(OR(= Cpt "KK")(= cpt "kk"))(SETQ CPT ' "Nhµ BÕp"))7 |. z" N* S4 ]; Z
- (IF(OR(= cpt "BB")(= cpt "bb"))(SETQ CPT ' "Phßng VÖ Sinh"))
( F+ W/ H% `( d _( O - (IF(OR(= cpt "CC")(= cpt "cc"))(SETQ CPT ' "Phßng Häp"))
) l; l9 V8 ]9 M9 I - (IF(OR(= cpt "OW")(= cpt "ow"))(SETQ CPT ' "Phßng Lµm ViÖc"))
T7 P5 }4 O, D# E' p- A) } - (IF(OR(= cpt "MM")(= cpt "mm"))(SETQ CPT ' "Phßng Ngñ"))
2 J: d0 ^- X) y0 D - (IF(OR(= cpt "DD")(= cpt "dd"))(SETQ CPT ' "Phßng BÕp-¡n"))8 t3 S, ]( ]# Z
- (IF(OR(= cpt "SS")(= cpt "ss"))(SETQ CPT ' "Nhµ Kho"))
/ H2 f# q# I5 m" Z2 b - (IF(OR(= cpt "LL")(= cpt "ll"))(SETQ CPT ' "Phßng §Ó §å")) x- r' H$ q! ~* Y4 h4 T
- 5 `* }: R, X& b+ A
- (IF(OR(= Cpt "oK")(= cpt "ok"))(SETQ CPT '"NHA/F BE/M/SP"))
# i0 g* P' V9 F" T0 e. X - (IF(OR(= cpt "oB")(= cpt "ob"))(SETQ CPT '"PHO/F/NG TA/W/SM"))
9 n% I) N% U' V7 X0 T4 d8 t - (IF(OR(= cpt "oC")(= cpt "oc"))(SETQ CPT '"PHO/FNG HO/JP"))
0 Y) `3 Z' e, K1 p8 h - (IF(OR(= cpt "oww")(= cpt "oww"))(SETQ CPT '"P.LA/FM VI/E/M/JC"))3 \) p$ l8 q6 O- S
- (IF(OR(= cpt "oM")(= cpt "om"))(SETQ CPT '"PHO/FNG NGU/R")); T8 D! H5 t4 V/ h4 x& y
- (IF(OR(= cpt "oD")(= cpt "od"))(SETQ CPT '"PHO/FNG A/WN"))8 U2 [& x: d, X* n Q6 Y" c
- (IF(OR(= cpt "oS")(= cpt "os"))(SETQ CPT '"NHA/F KHO"))
/ [/ p } k$ _ - (IF(OR(= cpt "oL")(= cpt "ol"))(SETQ CPT '"PHO/FNG /DO/M/F"))2 [' g, j8 {: w! k$ t
- (setq pta (getpoint
# r: v* j* H" ~2 D - "\nPick first corner. : "))5 b9 B. B7 _/ h7 z+ z- S W
- (setq ptb (getcorner pta
) W" } ~( N2 i - "\nPick second corner. : "))
2 h6 n1 c; c+ \2 f, ]# Y' f+ e - (setq ptc (list (car ptb)(cadr pta)))
6 @! [/ ?9 L4 P% X0 {1 x% ]- Z - (setq ptd (list (car pta)(cadr ptb)))
! A) r0 ~% r7 ?! ] - (setq ang (angle pta ptb))
8 N6 F; s0 `% z! e4 T - (setq d1 (/(distance pta ptb) 2)); `$ _, ~2 f. P4 c2 n$ \; W3 Z9 t2 y
- (setq cp (polar pta (- ang (dtr 0)) d1))* \! }5 Z( u1 k2 S9 w$ S# K8 w
- (setq X (distance pta ptc))6 Y: y7 W) Z, q6 o( k8 ^. `. M' `
- (setq Y (distance pta ptd))( R0 [4 M# T2 h
- (setq X1 (rtos x 2 1))
+ b) ~4 G0 G6 e - (setq Y1 (rtos y 2 1))
0 a6 p3 d8 u' W - (setq rmsz (strcat "(" X1 " x " Y1 ")"))
! F) u6 D9 I j$ L# Q - (command "TEXT" "c" cp "0" CPT "ROMANT-TEXT" "" rmsz))7 x) y* \ Y- Q5 M( W$ g
- (defun dtr (angg)
; i" @* k! q& q- L - (* pi (/ angg 180.0)))
. u/ a2 m9 V4 J5 l4 S3 J3 u, | - - w( Z. a; r" s3 E; e
- (defun c:WS (/ pta ptb rmsz pl1)
* {. V9 q1 p7 j* ?5 }4 A+ S% q: m - (setq oer *error* *error* err2). X7 `+ e" a# v
- (PROMPT "\n (RomanT.TXT)floorp(L)an.(E)levation.(S)ection.(M)planFoundation.(C)Found.(K).(P)."). r1 X' }6 U" H! u2 [1 q6 `
- (SETQ Cpt(GETSTRING "\n (VnHELVH.Vnh)(LL)floorplan.(EE)elevation.(SS)section.(BM)planFoundation.(CM)foundation.(KC)Structure.(PP)perspective."))
) W' q( v9 Z) @. J% ]. X
/ U- y/ w7 L9 t0 l- (IF(OR(= Cpt "LL")(= cpt "ll"))(SETQ CPT ' "MÆt B»ng TÇng 1 : TØ LÖ - 1:100")): _: c. g7 [ [2 G
- (IF(OR(= cpt "EE")(= cpt "ee"))(SETQ CPT ' "MÆt §øng Trôc ?-? : TØ LÖ - 1:100"))" l& A! b! b/ e& F* ~' w% B& k
- (IF(OR(= cpt "SS")(= cpt "ss"))(SETQ CPT ' "MÆt C¾t A-A : TØ LÖ - 1:100"))& d# q6 A7 r7 @- h/ T
- (IF(OR(= cpt "BM")(= cpt "bm"))(SETQ CPT ' "MÆt B»ng Mãng : TØ LÖ - 1 : 100"))' p2 u) q/ y2 }
- (IF(OR(= cpt "CM")(= cpt "cm"))(SETQ CPT ' "MÆt C¾t Mãng : TØ LÖ - 1 : 100"))
2 Z6 L: W& X ?1 U( v2 Q - (IF(OR(= cpt "KC")(= cpt "kc"))(SETQ CPT ' "KÕt CÊu Khung Däc Nhµ : TØ LÖ - 1 : 100"))& \/ x. Z3 T3 q/ E4 \3 p* |
- (IF(OR(= cpt "PP")(= cpt "pp"))(SETQ CPT ' "Phèi C¶nh Mét Gãc Nh×n"))+ w1 ~* H/ h. `
- + H n( ^& [1 x9 V- T; e3 X3 ~
- (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"))
9 z0 k! u) F6 M" Q) P- d Y - (IF(OR(= cpt "E")(= cpt "e"))(SETQ CPT '"MA/W/JT /D/}/SNG TRU/JC ?-? : TI/R LE/M/J - 1:100"))
( s, I% _/ q( d7 ]. o$ P - (IF(OR(= cpt "S")(= cpt "s"))(SETQ CPT '"MA/W/JT CA/W/ST A-A TI/R : LE/M/J - 1:100")): P& M( m! U; }( V" B5 |# ^2 x; d O
- (IF(OR(= Cpt "M")(= cpt "m"))(SETQ CPT '"MA/W/JT BA/W/FNG MO/SNG : TI/R LE/M/J - 1:100")): a0 \& d+ P6 t$ M$ [5 {
- (IF(OR(= Cpt "C")(= cpt "c"))(SETQ CPT '"MA/W/JT CA/W/ST MO/SNG : TI/R LE/M/J - 1:100"))
! ^) [- Y; }$ ~6 U5 r3 j) { - (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")) _* T$ X* T: M# C$ N! i
- (IF(OR(= cpt "P")(= cpt "p"))(SETQ CPT '"PHO/M/SI CA/R/NH MO/M/JT GO/SC NHI/FN"))
- f" X0 t6 G* c% @/ Q G - (setq pta (getpoint% U3 E+ {; E$ ` ?$ O
- "\nPick first corner. : "))( B; Z, P; a( u3 g" G
- (setq ptb (getcorner pta9 Q; ]1 y5 Q/ O) S {" f6 W
- "\nPick second corner. : "))
8 a" Y0 N- X, f( ` - (setq ptc (list (car ptb)(cadr pta)))
1 | H, @: ]" f) B G$ D - (setq ptd (list (car pta)(cadr ptb)))
4 ?: z& u% [( X - (setq ang (angle pta ptb))
! F" j& U( I" I8 _6 ^ - (setq d1 (/(distance pta ptb) 2))
& B/ Y* j7 L$ w3 R* M - (setq cp (polar pta (- ang (dtr 0)) d1))
, i; \" T# Y0 [; A - (command "TEXT" "c" cp "0" CPT "ROMANT-TEXT" "" rmsz))& {* h( f" w5 b& k
- (defun dtr (angg). P9 W: Q2 G6 C; a: U
- (* pi (/ angg 180.0)))/ c3 @; \( C0 R, z! e p
- 6 |" `; R3 t: y7 q6 M& {
- ;;; ================================ GHI CHU ============================
/ X3 g6 G/ R& T5 v, }1 D - ;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========
0 [4 f; T) S" s$ ^8 u - ;;; =======================Thuong Dung Font Romant.vnh===================
" \5 t* }9 X1 V- Y: ` - 6 d/ Q! t8 Q. {% B- h3 N
- (defun c:RRS (/ pta ptb ptc ptd X Y X1 Y1 rmsz pl1)! w G0 W9 q: S' n
- (setq oer *error* *error* err2); J9 J6 x& B% t
- (PROMPT "\n(D)ining room. (S)torage. c(L)oset. (C)onference. (O)ffice. (K)itchen. (B)ath. ")$ a8 F$ N$ M% Z6 ]6 ?# g5 @8 Z
- (SETQ Cpt(GETSTRING "\n(M)aster Bedroom. (DD). (SS). (LL). (CC). (OO). (KK). (BB). (MM). "))
: H" P; D5 W: F2 f M! ^5 _ - (IF(OR(= Cpt "K")(= cpt "k"))(SETQ CPT ' "Nhà B?p"))% w& Y; V( A$ w8 S
- (IF(OR(= cpt "B")(= cpt "b"))(SETQ CPT ' "Phòng T?m"))
9 h( s8 j1 G K+ |% b9 k k7 { - (IF(OR(= cpt "C")(= cpt "c"))(SETQ CPT ' "Nhà H?p"))
- A7 |4 I8 F5 d$ X; G, H - (IF(OR(= cpt "O")(= cpt "o"))(SETQ CPT ' "Phòng Làm Vi?c"))
! s( }3 ^/ w. f3 {: e% Q - (IF(OR(= cpt "M")(= cpt "m"))(SETQ CPT ' "Phòng Ng?"))
+ b) H5 B# B7 r2 c5 O% ?( M: a - (IF(OR(= cpt "D")(= cpt "d"))(SETQ CPT ' "Phòng B?p-An")); S8 b; a7 x9 e9 k- B2 G
- (IF(OR(= cpt "S")(= cpt "s"))(SETQ CPT ' "Nhà Kho"))0 E& ^; @* c0 r/ O
- (IF(OR(= cpt "L")(= cpt "l"))(SETQ CPT ' "Phòng d? Ð?"))
/ \0 x8 g& @) @2 r4 _ - (IF(OR(= Cpt "KK")(= cpt "kk"))(SETQ CPT ' "Nhµ BÕp")); F5 D( _; M0 P7 s0 X: b
- (IF(OR(= cpt "BB")(= cpt "bb"))(SETQ CPT ' "Phßng VÖ Sinh"))
( u! ]3 |& |8 p - (IF(OR(= cpt "CC")(= cpt "cc"))(SETQ CPT ' "Phßng Häp"))7 }6 [- b/ b( m6 }0 A6 f0 u
- (IF(OR(= cpt "OO")(= cpt "oo"))(SETQ CPT ' "Phßng Lµm ViÖc"))6 k! {4 T, D7 _1 L: w6 }( \
- (IF(OR(= cpt "MM")(= cpt "mm"))(SETQ CPT ' "Phßng Ngñ"))/ v `, H! k$ T V( c
- (IF(OR(= cpt "DD")(= cpt "dd"))(SETQ CPT ' "Phßng BÕp-¡n"))& R& `1 P& a4 h8 |! b( k" b
- (IF(OR(= cpt "SS")(= cpt "ss"))(SETQ CPT ' "Nhµ Kho"))8 [5 b/ u+ [$ Q5 \
- (IF(OR(= cpt "LL")(= cpt "ll"))(SETQ CPT ' "Phßng §Ó §å")) ! g1 C9 A; l+ S1 E/ G
- (setq pta (getpoint
: T( T# X z! q! w( e% [ - "\nPick first corner. : ")); M3 d/ b5 \* o; z# S
- (setq ptb (getcorner pta
4 M2 W& p" m1 N& ^3 e6 ] - "\nPick second corner. : "))' `% K* B, n* d; h8 a4 b2 |8 [
- (setq ptc (list (car ptb)(cadr pta)))1 ?! w& i: J. k. q- L
- (setq ptd (list (car pta)(cadr ptb)))
3 c; O, Y! E/ i, O; ? - (setq ang (angle pta ptb))$ q, q9 H" u& `- u) x1 p
- (setq d1 (/(distance pta ptb) 2))
! \( `' y' X8 U; e% H - (setq cp (polar pta (- ang (dtr 0)) d1))# R/ q/ ]6 x/ \' R% _+ H) u
- (setq X (distance pta ptc))
0 k$ K8 E" }2 x9 ~( } - (setq Y (distance pta ptd)); O" E8 c8 W2 ^; a, c0 O
- (setq X1 (rtos x 2 1)), `2 e5 \8 a% j {0 L$ V8 L
- (setq Y1 (rtos y 2 1)); s& b) N& `4 v
- (setq rmsz (strcat "(" X1 " x " Y1 ")")): _0 R0 e! R6 x
- (command "TEXT" "c" cp "0" CPT "text" "" rmsz))
# n4 ]0 V; B, d# z; \8 Y- y - (defun dtr (angg)
" f+ m; q, u- |8 D - (* pi (/ angg 180.0)))8 \' a" x _4 J3 K, b0 O
- 4 ^/ l! t# o, v, |( {0 M/ G
- ;;; ================================ GHI CHU ============================ \/ B# y8 s$ D. `; I" H! \+ _
- ;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========8 E( W' t% H& I4 `( r m
- ;;; =======================Thuong Dung Font Romant.vnh===================
6 a# ]6 A; g5 m* Q8 U+ p - . g6 a& a, B" Z
- (defun c:GS (/ a b c d)) S( u( }4 d1 d g
- (graphscr)
, P) c/ W. C$ D/ W/ ? - (prompt "\nSelect text to set style....")
# a% J4 q/ R$ t W7 ^5 M - (setq a (entsel))3 ]8 J2 h3 y9 V* ]# D6 \
- (setq b (entget (car a)))" I, l9 o+ X% b$ W r+ c
- (setq c (cdr (assoc 7 b)))/ o3 m( W! I2 |3 q
- (setq d (cdr (assoc 40 b)))* U/ K0 _, b9 ?
- (command "style" c "" d "" "" "" ""))
0 ] O+ Q' c- G5 m7 f0 _9 w8 M& Y - (princ "\nType GS to set text style.")8 Q8 d/ h" h$ p5 g
- 8 z g4 g$ @1 S% }6 E, Q
- (defun c:RC (/ olderr ocmd oblp pt1 pt2 pt3 pt4 l w)# e' M0 [; C4 ], l3 Q6 e
- (setq olderr *error* *error* myerror)- f2 r; C8 ]9 X' `. S& Z* m
- (setq ocmd (getvar "cmdecho"))
1 a8 T2 l, Z8 l) e. _$ l' J4 R - (setq oblp (getvar "blipmode"))9 D5 w% @ f. j4 S+ }
- (setvar "cmdecho" 0)- d( O$ R+ [; Y5 _$ W
- (initget 1) ;3D point can't be null9 O* K* Q$ c4 O9 `/ |
- (Setq pt1 (getpoint (strcat "\nCorner of rectangle or square: ")))
( x" o; s* F' k# S" }* _, C/ e - (setvar "ORTHOMODE" 1)- \& j. A- I% Y0 k# i. e
- (initget 7) ;Length can't be 0, neg, or null
% Y! e; c1 A. h4 V0 c7 E0 O" O: J - (Setq l (getdist pt1 "\nLength: ")): h/ g- v5 k+ w. Y! d) a
- (Setq pt2 (list (+ (car pt1) l) (cadr pt1) (caddr pt1)))$ H l: {. @7 j8 O8 t6 J
- (grdraw pt1 pt2 2). G- A9 u$ O) `3 ]6 K
- (initget 7 "Square") ;Width can't be 0, neg, or null( ^8 b% d7 z1 R1 X& y5 R! M+ z
- (setq w (getdist pt1 "\nSquare/<Width>: "))
+ j8 i6 Y Y; w5 y - (if (= w "Square")
' d6 \, J3 l) V0 @0 n - (setq w l)$ s& w! Z+ Y0 A+ s. y( G
- )/ H- E6 b: B9 t9 V
- (setq pt3 (list (car pt2) (+ (cadr pt2) w) (caddr pt2)))6 p8 U; L: M0 f1 v- n6 C
- (setq pt4 (list (car pt1) (+ (cadr pt1) w) (caddr pt1))). T( C' n [+ J+ I+ b a
- (grdraw pt2 pt3 2)1 H& A: @9 T# C3 G- x7 V* N
- (grdraw pt3 pt4 2)
- G; b T; P* m - (grdraw pt4 pt1 2)
* `: e4 \- a) V7 H - (setvar "ORTHOMODE" 0)
' g) ?$ U# ~# H - (command "pline" pt1 pt2 pt3 pt4 "close")% L& ]- ]; M. @( q9 }
- (setvar "cmdecho" ocmd)
. K7 x7 |3 }1 B, s7 C! Y - (setvar "blipmode" oblp)9 g7 K1 r) _. a! b4 ]
- (setq *error* olderr) ; Restore old *error* handler0 W. J1 [+ r! j/ L) ]/ c" h% {* [
- (princ)0 Y0 a3 Z. |# n
- )
+ H0 j G( Y6 O) C( Z* H0 x( `
6 U4 ~' X$ f& ]$ e9 o( s- (defun c:SG (/ ent pt1 pt2 ang)
1 {: G" u0 s- s8 x - (setq cmd (getvar "cmdecho"))- N% d% B( J& \5 v1 Z8 _) \- U! r
- (setvar "cmdecho" 1)
% ^* N1 X; S; I5 T - (prompt (strcat"\nSnap angle will be set to angle of line"))
* G5 _- @# e/ p9 ^* v - (setq ent (entget (car (entsel))))5 \) ^* D- t: i* N
- (setq pt1 (cdr (assoc 10 ent)))
( y4 `9 R, ^ Z. J- m) H6 [0 b - (setq pt2 (cdr (assoc 11 ent)))
/ x; ~; D# E+ B - (setq ang (angle pt1 pt2))
+ Z9 b4 D* C$ K+ g7 Z - (setq ang (/ (* ang 180.0) pi))' P& c* x9 m+ B; Q9 G$ n8 u/ I
- (setvar "cmdecho" 0)
" u2 @. e9 h9 s) Z - (command "setvar" "snapang" ang)
( c- c0 e; b* m5 a - (setvar "cmdecho" cmd)
0 i' k$ J- b6 e& E - )2 ~: r7 j# K$ P8 \3 d- ~) P
, F8 `: a9 ~3 S. C x- (defun C:TG ()
+ b0 {+ @ D* n- m& }0 i" B - (initget "Increase New")* C. K/ [( l) D( E; k
- (setq ans (getkword "Increase/<New>: "))# S( {6 M+ k( E# D, _- Z
- (modang)0 y. n; a8 l& z) j
- )
1 T2 k& ^3 N, x/ X$ g& F - (defun modang (/ ang ss ca e na ssl)
: k5 H( ~3 t2 I5 O* ? - (if (= ans "Increase")( S4 {' A! ^. I5 e+ H5 T
- (princ "\nIncrease angle for text by: ")
; Z" H! V Z3 r; S8 e1 V, k% E, U - (princ "\nNew angle for text: ")
0 q" E& ~) \0 e5 U; L+ m$ o - )" B" |) b/ J: ^
- (setq ang (getreal))/ Z' b* V) Z& C% b' j% a
- (setq ang (* (/ ang 180) pi))% R8 }4 g0 \& c
- (setq ss (ssget))
+ ]9 f, }) s, N! R1 F - (setq ca 0 ssl (sslength ss))# C2 _: K, H2 x6 P
- (while (< ca ssl)6 J# h) X' a* A" }5 ?& _& L
- (if (= "TEXT" (cdr (assoc 0 (setq e (entget (ssname ss ca))))))
+ K* g# p X* U3 J: M( y+ K7 K: K - (progn
! V) O$ V( @/ O' }* I4 |: P+ B - (if (= ans "Increase")
6 W' i, ]* J: l4 r2 ~- ? ` - (setq na (cons 50 (+ (cdr (assoc 50 e)) ang))); T1 q, [7 ?# U2 u
- (setq na (cons 50 ang))0 U5 D/ a; d; n$ |
- )) k1 c4 q0 T2 ?! Q7 @
- (setq e (subst na (assoc 50 e) e))
1 b" A8 m' {5 S5 U - (entmod e)
: i7 E/ j8 ^% o" j - (setq ca (1+ ca))* k2 Q$ t8 r# k$ K
- )
3 P3 d) N, b* b0 l# [5 K" a2 }8 z5 q - ): k7 E9 T# p. e7 o2 U; q
- )
1 R) D" J! s+ J, F - (terpri); Z6 E+ O& C, X2 b# M& s4 y' u0 S" S
- )
# v$ v# u* l- W3 A. C- x- P - ; Z) m5 J" p7 X# r) j% V( p
- " Z- ?/ V5 J/ S7 ~6 k
- (defun c:WL ()' h& A# n+ u& A) J% @" P1 m
- (setvar "cmdecho" 0)
1 b3 q8 C% [3 S: @- d - (setq a 1)
/ C0 g5 Q, M o ~+ j" v - (prompt "\nSelect Polylines to change: ")
6 x, l+ Z$ x/ v( F2 n. p9 f - (while (/= a nil)8 ^' u1 U( t% s$ q8 Q0 F7 w8 @
- (progn
+ R5 a* r* l- g+ H- n( q - (setq a (entsel)), Z8 T/ v7 Y+ l6 O9 L9 n& m/ o8 F
- (if (/= a nil) `6 r9 i$ R0 u s! t+ H' S
- (progn$ h2 {! N" n9 W- B/ ?
- (setq b (entget (car a))). v9 v+ d/ n8 F7 e0 k; G
- (setq c (cdr (assoc 40 b)))
+ Y( A' R c8 r" l; V# n Q% {# O - (princ c)# u I+ N; r4 T4 V% j; s
- (command "pedit"a"w""lw""")4 N- }0 J) g2 c* p
- ))))
/ a8 s2 J# N5 J8 G7 V/ H - (princ)
* \ t0 t2 D4 b0 u - )
% A. ~8 c/ c8 M3 L6 ~
4 o" X4 J/ c4 ]& q& h- ;;; ================================ TEXT FIT ============================
+ j" V5 R1 P$ a, _1 t7 w7 P
$ J7 i' _" O0 a' L" u- (Defun c:FT ( )
f) Q3 x- Y1 n- F5 r& u - (defun setsnapang (arg /) (setvar "snapang" (angtof (angtos (cdr (assoc 50 arg)) 0 8) 0 )) )
: A5 v. k3 y0 C# q5 t7 ? - (Defun LL-xyz (arg) (CAR (TextBox arg)) )6 l( s, @7 [* m4 h6 a" ^+ w* ^# h& B
- (Defun UR-x (arg) (CAADR (TextBox arg)) )
9 G+ b+ e' U' G n8 s - (Defun LL-y (arg) (CADAR (TextBox arg)) )- t/ t2 r# k1 R0 e$ q) ]+ Q
- (Defun LR-xy (arg) (List (UR-x arg) (LL-y arg)) )
5 B& N' i$ H% F8 w+ r# A - (Setq ename (CAR (EntSel "\nSelect Text to stretch/shrink:" ) )
/ a R& i; {0 e0 u7 O: ^ - Textent (If ename (EntGet ename)) ) 7 j1 t/ }; y1 l: M" l
- (If (= (CDR (Assoc 0 textent)) "TEXT")
0 H/ O F& D* s* C" w Q, O6 x - (Progn (initget 0 "Start")
4 G% h8 ?+ n: K& x3 F+ ] - (Setq NewEnd (Distance (LR-xy Textent) (LL-xyz Textent) ) )
, e1 `. U6 ?" a5 p - (setsnapang Textent) ;set snap along text entity" m! g$ X. W! X
- (setvar "ORTHOMODE" 1) ;drag along the text1 n9 U1 |& w6 R5 P( o3 w/ A
- (setq , @, Z# |1 ~. M, X1 A5 z
- TMP (getpoint (cdr (assoc 10 Textent)) "\nStarting Point/<Pick new ending point>: ") )
& m0 G' Z% l! J+ ^( ?3 R - (setvar "snapang" 0): c( G5 x" N U, C
- (cond
) g# t& L2 V u6 B4 [. o - ((= (type TMP) 'STR) ;;new starting point to be selected4 k8 Z5 n7 O( V4 \0 l
- (setq Start (getpoint "\nPick new starting point: "))( D7 A$ [) c8 z2 t4 z. |' x& Z
- (if Start (progn' K2 z' E' \1 `% B
- (command "_UCS" "_E" (cdr (assoc -1 textent)))
7 y" a; j& ]5 M' g - (setvar "ORTHOMODE" 1)
* n9 F" m+ V: ^" R - (setq NewPt
- s0 P% ]# F7 Q1 L) ?" Q2 N( @5 p - (if Start9 U, k; J/ L$ B* c- l; g
- (getpoint (trans Start 0 1) " ending point: ") nil ) )
( s6 @- \0 h6 {) ]# |# k - (if NewPt (setq NewPt (trans NewPt 1 0))): c1 |9 N! R1 A! x
- (setvar "ORTHOMODE" 0)8 z# S1 W1 Z, e# X+ R# _8 h. R
- (command "_UCS" "_W") ) ) )7 T1 _! _; M# w- X
- ((not (null TMP)) ;;new ending point selected }4 W9 i5 Y. c. `" n
- (setq Start (cdr (assoc 10 Textent)) NewPt TMP) )
3 D+ U/ l+ O9 p7 w# ~. t& @+ z, W - (t (setq Start nil NewPt nil) ) )
" H! N% ?* }1 J/ H s+ p# h' Q - (if (and Start NewPt) (progn d$ p- y: f& x7 H7 X+ x0 r. }7 B5 e, r
- (setq Val (Assoc 41 Textent) ;;current width factor
& Y$ Y# h0 _3 i+ d8 w+ } - Val (if Val (cdr Val) 1.0) LTC_%
) Y& z8 F1 p' ?! r' N& [ - (* (/ (Distance Start NewPt) NewEnd ) Val )
5 `6 F/ S8 E/ h, g( q6 F1 \. Q, K8 l9 f - textent (Subst (cons 41 LTC_%)9 ]6 O7 f" L+ r# q& o' Z
- (assoc 41 textent) textent)
6 N) Z2 h# ^. m/ _& ^, Y - textent (subst (cons 10 Start) (assoc 10 textent) textent)2 B9 A9 t n) k" d l3 t* P
- textent (subst (cons 11 NewPt) (assoc 11 textent) textent) )6 V. _8 W6 r9 J
- (EntMod textent) (EntUpd (cdr (assoc -1 textent))))))) (Princ))
$ h; V- U2 X5 p/ \0 ?5 ` - ( H+ e+ u/ \5 \3 E
- ;=====================================================================
: O7 p: m9 y# [7 a - ;=========================COPY + ROTATE ==============================- C' o9 v% A) C8 b6 a2 \6 a* P
- ;=====================================================================& f1 E1 T# n+ d4 K( |5 B# {, I R" ]8 T
- 4 }/ {. z0 N* u2 b9 @0 ?1 E# h: Y/ o
- (defun c:CR(/ olderr cm loop ss1 ss2 bp mult lent ss2 lp1 lp2)$ }. A1 m! i+ q& X
- (setq olderr *error*6 ~% b( j5 L* L( J) i( ~) ~6 @
- *error* croerr)& K; c* X9 z. l/ z0 @
- (setq cm (getvar "cmdecho")); Y- X0 @' r8 f# A
- (setvar "cmdecho" 0)
' i$ A" V, s4 k) f - (setq loop t)+ P$ m j3 `8 q9 h; `! ?) _! o
- (while (not (setq ss1 (ssget))))' a \0 H; F/ f. Y* i
- (initget 1 "Multiple")4 r2 }# R8 M5 ]' m/ K( P
- (setq bp (getpoint "\nBase point or displacement>/Multiple: "))+ j9 g) M% n7 Z
- (if (= bp "Multiple")
( F5 } I6 M% P3 a& }+ u& z - (progn
6 R! F2 y1 X, c8 ~ - (setq bp (getpoint "\nBase point: ")). n/ ?! f" S& D9 d" l
- (setq mult t): ^3 y$ U" O1 ~) l! D
- )" a. k1 g% a! z9 J$ o
- )5 H- |' t% J- S) }5 n
- (while loop
. C5 ?+ o0 C, i; @5 [ - (setq loop mult)
4 p1 C# a I0 E7 j - (setq lent (lastent))
! r6 ?- d A, t* [" L' E$ a - (command ".copy" ss1 "" bp bp)# b+ j% L+ ]/ D. l2 W: E" `/ m
- (setq ss2 (lss lent))
0 H) d6 K% \% E, E( u, V - (setq lp1 (getvar "lastpoint"))! ~6 k6 e8 _3 Y) p1 S$ f8 Z0 u
- (prompt "\nSecond point of displacement: ")8 C6 E3 {# ?+ S
- (command ".move" ss2 "" bp pause)
' ]' k- M3 O, v- T0 f) { - (setq lp2 (getvar "lastpoint"))
4 ^5 w+ X5 E, @3 F3 t0 \3 V! |6 ?# r - (redss ss1)
6 }. D7 d p" y5 W - (if (and (not mult)
7 u6 q: I2 P9 q* S6 t! l/ U; V" r: n - (= (distance lp1 lp2) 0)
2 R" O9 G4 m q% h/ Z5 | I* @2 e+ A - )3 @1 U+ g& R. Q O) E
- (setq lp2 (getpoint "\nRotation Point: "))
$ }7 r+ d. _# v4 }3 H8 ^' [+ U - )
! ^% @$ g: D6 O% o& x; [# A - (if mult
6 ~! ]! j3 F' W% K' A2 O) Y' }0 L - (prompt "\nRotation angle ")
, K' {( F& e, B7 B# L! G2 g; o - (prompt "\nReference/<Rotation angle>: ")
# z* R0 i4 k& k4 x1 a - )
# W! h4 L1 n$ ^3 o% A* J# U2 L - (command ".rotate" ss2 "" lp2 pause)# | e3 m, L/ f4 u+ c D0 L" |
- )4 }6 E2 W; i' P7 L8 { u7 e
- (setvar "CMDECHO" cm)
/ L3 n8 T8 T' j - (setq *error* olderr)( e/ y' O* h D
- (princ)
" o$ p7 O$ \' d& K1 d - )
0 V9 F+ w6 k1 b8 N! s$ W - (princ) v+ d% G3 u6 _/ N1 h. z" g3 E& b
- (defun croerr (s)
! K9 s: K6 S1 D6 [+ ] - (if (/= s "Function cancelled") , D. X9 }/ _& _9 A2 ]5 s' Y
- (princ (strcat "\nError: " s))
5 {; z2 b/ L9 G9 p - )
$ K0 n T. C6 J - (setq S nil)
; C1 q/ f( R H+ P( Y4 e( o& o - (setvar "CMDECHO" cm)' }% G# I% h/ L, {2 P
- (setq *error* olderr)
& M; n* a8 _6 Z0 b+ t- ?; } - (princ). t2 v. z F" B" C
- )
% @9 `7 g. P% j) D6 i - (defun lastent (/ a b)' q+ b6 ]" a2 f" K
- (if (setq a (entlast))
5 L* t& p7 I, c0 u E+ U! }, T6 I - (while (setq b (entnext a))4 O! e- g3 E, V+ b
- (setq a b)
# F' d' J* U$ m; M( ? - ) H6 z& l, A7 I3 e! C Z
- )
$ j) N- S2 h( Q& p# h; x2 @ - a
2 H4 m1 |3 K2 t. K - )
" M. g. N$ H4 [- P3 ]9 X - (defun redss (ss / en i)
6 E7 k6 M* O" i4 R* f; p; R - (setq i 0)% _! w" \% j$ N$ `. \! p
- (while (setq en (ssname ss i))
' Y/ \9 d. D% s. M$ ? - (redraw en 1)
: l5 I0 Y2 s: \ - (setq i (1+ i))- }& H6 {/ j6 ]( |% o
- )
' \+ a, y% n+ C" f: w& {9 s2 Q - )4 y5 t8 W% M5 A$ u( ^9 r+ a
- (defun lss (en / sels ed)
5 W% r8 n+ X4 T1 R - (setq sels (ssadd))
) h$ l A4 Q" } - (while (/= en nil)
- D3 ?. M2 K2 n# H$ R - (if (setq en (entnext en)) (setq ed (entget en)))
; u; @. N7 I% I9 ]2 c2 B+ \" x - (if (/= en nil) (setq sels (ssadd en sels)))
5 R8 Q% k( }' k1 k0 Q7 b: f - (if (or (= (cdr (assoc 0 ed)) "Polyline")
: f# _3 A* u1 I6 K8 b- h - (= (cdr (assoc 0 ed)) "Insert")# v- l, ?% k& ~4 e# p
- )
8 O' Y: x2 q* w - (while (/= (cdr (assoc 0 (entget (setq en (entnext en))))) "Seqend")); W, S7 c0 A# F# J4 Q
- )9 N. }! F6 R4 E" T% \. k
- )8 J- |; E/ B; J3 P1 o$ C
- sels' {& h/ q# Y6 v9 A4 t
- )( e% D3 u. T' l- V7 K
- n+ |7 B# z; g) t* e I
- ;;;; ================== CAC FUNCTIONS DUNG TRONG ACAD.LSP ==================$ X" _0 b! ?) @- Z. M
- 4 F% K, w0 r3 L% s, \$ i8 i; K
- (defun c:00 ()(princ "\nChon doi tuong net Defpoints")(ssget)(command "change" "p" "" "p" "la" "Defpoints" ""))
7 Y% g, P& d6 r - (defun c:0 ()(princ "\nChon doi tuong net 0")(ssget)(command "change" "p" "" "p" "la" "0" ""))7 \! V* v! D5 _
- (defun c:1 ()(princ "\nChon doi tuong net COT")(ssget)(command "change" "p" "" "p" "la" "COT" ""))8 D6 v& D6 n4 y
- (defun c:11 ()(princ "\nChon doi tuong net DIM")(ssget)(command "change" "p" "" "p" "la" "DIM" ""))
* n8 g1 Y3 W$ e6 \ - (defun c:22 ()(princ "\nChon doi tuong net MANH")(ssget)(command "change" "p" "" "p" "la" "MANH" ""))
8 g4 w2 y& Y! B. v/ N - (defun c:33 ()(princ "\nChon doi tuong net NETMANH")(ssget)(command "change" "p" "" "p" "la" "NETMANH" ""))( p# B8 L6 X0 w- d$ K4 s) ~
- (defun c:2 ()(princ "\nChon doi tuong net NETDUT")(ssget)(command "change" "p" "" "p" "la" "NETDUT" ""))
( `4 p* F- N* N9 F' Q - (defun c:3 ()(princ "\nChon doi tuong net NOITHAT")(ssget)(command "change" "p" "" "p" "la" "NOITHAT" ""))
& i$ q& a( l5 `* o - (defun c:4 ()(princ "\nChon doi tuong net TUONG")(ssget)(command "change" "p" "" "p" "la" "TUONG" ""))
( c, b" ^/ P8 H - (defun c:44 ()(princ "\nChon doi tuong net KHUNGTEN")(ssget)(command "change" "p" "" "p" "la" "KHUNGTEN" ""))
]% g$ ~. z3 y) s5 Z; R - (defun c:5 ()(princ "\nChon doi tuong net TIMTUONG")(ssget)(command "change" "p" "" "p" "la" "TIMTUONG" ""))
/ L6 D2 z' U$ X$ y( U - (defun c:6 ()(princ "\nChon doi tuong net CUA")(ssget)(command "change" "p" "" "p" "la" "CUA" ""))
3 K+ A' a$ D9 t q6 O - (defun c:7 ()(princ "\nChon doi tuong net THAY")(ssget)(command "change" "p" "" "p" "la" "THAY" ""))
: t0 x4 q- G) m/ b* z' n. C - (defun c:77 ()(princ "\nChon doi tuong net NETTHAY")(ssget)(command "change" "p" "" "p" "la" "NETTHAY" ""))( N6 |! i; @4 O# L' Z! n6 G
- (defun c:8 ()(princ "\nChon doi tuong net HATCH")(ssget)(command "change" "p" "" "p" "la" "HATCH" ""))
! q. Z0 b Y/ b1 p) _9 o/ G: [ - (defun c:9 ()(princ "\nChon doi tuong net TEXT")(ssget)(command "change" "p" "" "p" "la" "TEXT" ""))2 x& _/ Q0 {( T" H( {
- (defun c:99 ()(princ "\nChon doi tuong net CUAMATDUNG")(ssget)(command "change" "p" "" "p" "la" "CUAMATDUNG" "p" "C" "bylayer" ""))
0 D! H" V: g5 h( p/ a - (defun c:td ()(princ "\nChon doi tuong net THEPDOC")(ssget)(command "change" "p" "" "p" "la" "THEPDOC" ""))
1 }" T1 j; }6 L2 D9 o. }0 p* K k v - (defun c:ddt ()(princ "\nChon doi tuong net THEPDAI")(ssget)(command "change" "p" "" "p" "la" "THEPDAI" ""))
# o r+ t) N2 Z - & g+ g! O. O- C& m
- ;=============== DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =============( s4 E" e s; n* S0 i$ f
! w# U1 ]) `' K" c! _- ;=============== DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =============
: y2 P% o' y: ]% P% ]7 M
% f, `: H! [' U: U, M+ L) I- (alert "Using the NetXuatAnh-[ 5940.00 x 4200.00 <pixels> ] command!")6 Q" m' z7 }/ F2 o$ G& D$ t
- (princ "\nEnter (DEFUN C:netxuatanh () to get to real LAYER command.\n") (command "NETXUATANH")
* A5 _) Q# M/ g! T2 X9 D+ e. p
* S- ]% d7 V- \4 k6 g- ;=============== DAT LAYER NET de xuat anh JPG [W x H] [5940.00 x 4200.00] ===DRAW===
) I' n& r, S! W' a3 ^ t8 \ U7 Q* h - 9 U" j- }; \% `9 \1 `+ O6 Q3 B1 L
- ;(DEFUN C:netxuatanh ()7 J6 f; j' g+ L( r& b2 W! X0 W: T) L! S
- (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.6" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "5" ""# Q+ ?' \) f _8 w; q( |
- "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "1.58" ""
. ]: i$ D" j4 U- k - "M" "MANH" "C" "9" "" "Lw" "0.5" ""
P4 W! }( z5 p/ ~# { - "M" "TEXT" "C" "7" "" "Lw" "0.5" ""! s. Q, E7 c/ g5 v! a
- "M" "DIM" "C" "1" "" "Lw" "0.6" ""
( }* i- v4 U$ p. j1 ^4 _( | - "M" "THAY" "C" "7" "" "Lw" "0.7" ""( C" Z1 F0 N) \ p* B
- "M" "NOITHAT" "C" "3" "" "Lw" "0.5" ""
9 Z; R8 `. p4 Q! K - "M" "HATCH" "C" "5" "" "Lw" "0.35" ""
8 @1 ~. b3 ^% c% W& U - "M" "COT" "C" "2" "" "Lw" "2" ""4 b2 t& B" T) S1 U: Q2 Y
- "M" "Defpoints" "C" "7" ""
9 ?! o# r9 D( ^& z! [6 [ - "M" "0" "C" "3" "" "Lw" "0.5" ""
( d4 b" k+ G8 }- J. z; B - ; "M" "1" "C" "1" "" "Lw" "0.5" ""
9 I l" q) ?/ W/ J1 h - ; "M" "2" "C" "31" "" "Lw" "0.5" ""
9 ~1 _( S2 r/ i* ?8 |0 H. I* s - ; "M" "3" "C" "8" "" "Lw" "0.35" ""
: I) G) q* e/ [6 Y - ; "M" "4" "C" "4" "" "Lw" "0.8" ""
( v# B: P5 u4 Q9 p; v6 R( J - ; "M" "6" "C" "6" "" "Lw" "0.35" ""! p* B+ T7 s' J7 x ~& x
- ; "M" "7" "C" "7" "" "Lw" "0.4" ""& p* R; d% [: D# ^: _
- ; "M" "8" "C" "8" "" "Lw" "0.35" ""% B& I7 _, H# `8 a
- "M" "DAY-DIEN" "C" "3" "" "Lw" "0.5" ""
0 [: ~* ]! F; K# e q - "M" "DUONGBAO" "C" "7" "" "Lw" "1" ""
4 P" ~! J! k9 g# o/ n - "M" "KE" "C" "8" "" "Lw" "0.3" ""
9 ~. E+ y2 G* U1 G# u - "M" "KT" "C" "9" "" "Lw" "0.35" ""- E+ |* B) t: Z8 T( ]8 W3 |# z% |
- "M" "NETTHAY" "C" "255" "" "Lw" "0.7" "" c' X& K# _# O7 M% I, f/ ]
- "M" "NETMANH" "C" "43" "" "Lw" "0.5" "", L$ b( @2 E! x- n, P, Z# {: f
- "M" "TBD" "C" "2" "" "Lw" "0.8" """ Z9 t5 [' o3 q
- "M" "TEXTTXT" "C" "7" "" "Lw" "0.4" ""
/ b' ^4 \& B3 h8 `" y2 F# M - "M" "TEXTVN" "C" "132" "" "Lw" "0.4" ""- g! C( B6 g# M
- "M" "THEPDAI" "C" "3" "" "Lw" "0.7" ""
$ P( y0 j# G- v) H9 @6 P - "M" "THEPDOC" "C" "2" "" "Lw" "1.58" ""
( s0 B/ D i* N0 \1 b - "M" "CUA" "C" "6" "" "Lw" "0.5" ""
6 I" V: p, c" V! J/ g - "M" "CUAMATDUNG" "C" "6" "" "Lw" "0.5" ""6 L/ f9 I3 `8 O$ ?3 l
- ! L7 \' {, q, V; E
- ;=============== DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] ===NUOC=== @/ E; x# L" n
- 0 q; Z1 V- y( `" z: x" U
- "M" "10-VAN_KHOA" "C" "10" "" "Lw" "0.5" ""' U/ D% _ g) n1 V. W
- "M" "4-WateR_IN" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE1" "". U+ |3 I# t" K
- "M" "4-WateR_OUT" "C" "4" "" "Lw" "0.6" "" "LT" "FENCELINE2" ""
+ K3 v# N2 C7 U- i - ; "M" "250" "C" "250" "" "Lw" "0.35" ""
1 M9 l: u( o0 \/ \! L6 a8 _ Q - "M" "KHUNGTEN" "C" "4" "" "Lw" "1" ""0 n# m* V2 k# G& C( ?. a8 Y+ {8 [
- "M" "TIMTUONG" "C" "5" "" "Lw" "0.5" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "10" "" )3 r% M0 z0 U/ ~% C# O+ b
6 W2 E% v* t8 d- ;=============== DAT LAYER TEXT de xuat anh JPG [DIM] [TEXT] [GHI CHU]======" |; g, l/ e9 P8 ^
- ;===================================30|04|2024==============================# L4 d# x4 Y1 w
3 N' k: ^ ]" N5 F. R- (Command "-style" "Vni-VietNam" "vn_vni,vns.shx" "0" "1" "0" "n" "n" "n" )5 @0 ~9 N% ~- v# x* [' K
- (Command "-style" "Vni-ROMANS-TEXT" "vni-romans,vns.shx" "200" "1" "0" "n" "n" "n" )
+ ]/ Y+ I" A z7 ] n; { - (Command "-style" "COTES" "verdana" "" "1" "0" "n" "n" )
$ j7 i7 C5 g7 V/ L* z5 N. r( q* N - (Command "-style" "TRUC" "impact" "0" "1" "0" "n" "n" "n" )
8 V# R, F5 U/ q h5 `. y0 T - (Command "-style" "VNHELVLT-Hoa" "vnhelvh,vnh.shx" "500" "1""0" "n" "n" "n" )# t, m) j& {& m1 D5 l
- (Command "-style" "VNHELVLT-Thuong" "vnhelv,vnh.shx" "500""1" "0" "n" "n" "n" )8 R. p0 W8 P5 i& @- A) e0 R
- (Command "-style" "STANDARD" "Verdana" "200" "1" "0" "n" "n" "n" )
# T% h7 F; A: u* M* E6 s5 E - (Command "-style" "VERDANA" "verdana" "200" "1" "0" "n" "n" )
5 z4 I5 n5 ^9 }2 e* r& S6 y - (Command "-style" "ROMANT-DIM" "romant,vnh.shx" "0" "1" "0" "n" "n" "n" )- c# n4 Y7 `, U% O0 K9 O/ L
- (Command "-style" "ROMANT-TEXT" "romant,vnh.shx" "200" "1" "0" "n" "n" "n" )(princ)
, z: d9 E9 {/ v - " r/ K) G a4 R! W/ ^5 ^' o
- ;============= DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =DIM-STYLE=
% b" Y) ?( }3 ~ - ;===================================17|10|2024===================================; G7 O0 Q! }# ]; M$ U+ G
" N/ g3 y# I2 u7 b" c: M- (Command "DIMTXSTY" "ROMANT-DIM" )
! d1 c! [9 g6 c - (Command "DIMBLK" "" "Closed" )
! J) c4 D" g; p" |, N: f) @
# C! R! b9 L! [- w- ;============= DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =DIM-STYLE=
+ m% h6 d/ @/ l8 {6 f4 e4 R - ;===================================17|10|2024===================================- L" W6 T. F8 Q: s; D& Z# h# ~
$ ~0 k9 q* d! v7 Q, p1 F; o% n* g7 ~- ;(Command "-units" "2" "8" "1" "8" "" "N")- p! o( Y/ ^! o2 [$ c! B8 X( Y% ^) R
- (Command "-plot" "Y" "" "publishtoweb jpg.pc3" "User 1 (5940.00 x 4200.00 Pixels)" "Landscape" "N" "Display" "Fit" "Center" "Y" "monochrome.ctb" "Y" "")(princ)- M) X2 h) M; }+ J/ f- ?+ X* V" e
8 |) K5 J- ?2 P/ J# h/ p% r- ;============= DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =DIM-STYLE=4 _# Y4 ?! P7 X1 J+ n6 U1 M" l
- ;===================================17|10|2024===================================6 @+ j3 [& p; i5 n+ ?" V9 k; }
1 Y# o' e, h% F h0 W$ E$ f- ;======== KET THUC - DAT NET IN de xuat anh JPG [W x H] [5940.00 x 4200.00] =====
" X/ m. m# F Y8 m/ \1 c( _
$ {4 R/ ]2 T- y- ;======================== DAT NET IN & TI LE BAN VE =============================4 G+ ?" N+ e1 ^7 e
, k* W& z& G7 U$ @+ s& k% `- ;=================LENH VE KHUNG TEN - Tieu Diet Lenh==================
/ D" s( s& x: x( V+ k4 t - ;=============== DAT KHO GIAY BAN VE - KIEU KHUNG TEN ================1 ~% ^$ S# v. `6 i: S
- ;=============================11|07|2025==============================
) X4 h# F! X5 u - ;Ti Le Ban Ve - 1 : 100
! y G- Y. T& M - (Defun c:kta4 ()& S. M; V( C( |! O
- (setq mv_sc 100);Ti le ban ve
1 l k( b. E9 X$ {$ U& `5 t) G - (setq x4 297)! H& L1 a g: r
- (setq y4 210)# A& a \( J+ {1 R( f+ n
- (setq x4 (* mv_sc x4) 9 ]$ e" o! ~2 L
- y4 (* mv_sc y4) )8 J+ u, X0 P1 o: G* v3 `4 N& d2 d
- (command 3 a" [& u' Q: L- [+ E2 e
- "LIMITS" "0,0" (list x4 y4)
" @- [, h4 o' Y" O8 h - "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"- A+ O# c4 B: k0 t8 l
- ;Khung CHU NHAT Chinh
/ t) @8 E+ ]0 X6 k3 p; l" [( e - "RECTANG" "500,500" "@28700,20000"- l3 u7 ?! ~6 U2 {8 U
- "RECTANG" "700,700" "@28300,19600": j, S9 ^0 s8 \4 C7 E0 d
- ;Khung Ten Chung
2 A* ] ?' X6 M% c; g5 k2 F$ F - "RECTANG" "700,700" "@8000,1250"1 x% E3 T* e4 S) u5 b' w4 s
- "RECTANG" "700,700" "@17300,2500"/ | o% I% b) Z
- ;Ten Ban Ve* K" T) `6 i9 t- q) r
- "RECTANG" "18000,700" "@11000,1250"
# \) |8 b% Y3 C m - "RECTANG" "18000,700" "@11000,2500"
, r2 v% v% U1 R) Q5 D - ;Khung Ti Le + Ngay Thang Nam
) _ m1 c- S! Z6 s) O6 T - "RECTANG" "22500,700" "@2000,2500"
7 c( V$ E Z+ t - ;Khung CHU TRI
* G+ C6 Z# j" v9 P - "RECTANG" "8700,700" "@3800,2500"
1 y2 @5 j$ y. I4 {$ P - "ZOOM" "_a" ))# B g8 R8 l/ C9 X8 d2 K" V
- ;=====================================================================0 A! {3 f+ h) R- }* T4 d+ Z
- ;Ti Le Ban Ve - 1 : 100
1 h# v+ V7 n& U V- r" ?3 E E7 H - (Defun c:kt4a ()1 v; C. X' ?' o
- (setq mv_sc 100);Ti le ban ve
: I5 u$ m# P2 t# q e2 H$ \: B6 i - (setq x4 297)
2 H1 B4 ^0 b+ q7 z6 _% d - (setq y4 210), F% ]8 {) u5 H9 \/ N/ D3 {
- (setq x4 (* mv_sc x4)
) i& \8 A2 ~. V# g - y4 (* mv_sc y4) )
! L& U/ y0 V- `; Z3 Q4 Z - (command
( J3 Z0 C* o' ?/ h" [" I, Z - "LIMITS" "0,0" (list x4 y4)
5 R% |$ `" G4 H! K' D - "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
1 y9 f' l, i9 s3 T% n% h& k$ i - ;Khung CHU NHAT Chinh
4 W! w0 y! }) T6 K - "RECTANG" "2000,500" "@27200,20000"
. |/ a3 H8 I6 r, ` - "RECTANG" "2200,700" "@26800,19600"3 [' m% m# \. }* c7 k% |
- ;Khung Ten Chung
7 C- k* u, f! W$ T9 I - "RECTANG" "2200,700" "@6500,1250"
6 [7 w3 e! z( z! t- ^1 Q - "RECTANG" "2200,700" "@15800,2500"# ?5 w3 G- b h( B" L E
- ;Ten Ban Ve
+ s8 I! |2 n: X) V - "RECTANG" "18000,700" "@11000,1250"
4 N y+ k# s6 b: W2 @! U - "RECTANG" "18000,700" "@11000,2500"$ K9 ^( u9 ?& y* @+ ?; F; d) t& a
- ;Khung Ti Le + Ngay Thang Nam5 r+ Y$ }0 W+ P' ^7 f; ]
- "RECTANG" "22500,700" "@2000,2500"
- G5 A6 r! [# Y8 Y. r - ;Khung CHU TRI- ^" o& N* f' r8 t9 ]/ R% K
- "RECTANG" "8700,700" "@3800,2500"3 H+ m. J) G2 n% D$ X4 N5 v
- "ZOOM" "_a" ))( p D: L2 Z" ~0 `% u! ?8 Q1 h
- ; p) K# Y# c+ W9 Y! F/ o
- ;;; ============================GHI CHU Khung Ten========================
4 r* l6 K* N; Y6 g# L1 B4 ]4 ] - ;;; ======== Phai Vao STYLE Tao LAYER Ten TEXT + Phai Dat Height ========
, u& X* w% Z* i3 } - ;;; =======================Thuong Dung Font Romant.vnh===================* W+ b5 |/ s5 @: f; ]
4 y( @8 Z) P* z! `, f1 S- G+ A5 h- (defun c:GhiChu (/ pta ptb ptc ptd X Y X1 Y1 rmsz pl1)
6 N: P9 C' O+ W- l1 z - (setq oer *error* *error* err2)
% U5 ~: y& _9 i6 s - (PROMPT "\nChuTri. ThietKe. KiemTra. TiLe. Ngay. HangMuc. QuyMo. KieuNha. CongTrinh. KyHieu. TenBanVe. Kts. TranNgocThang. ")& `0 e9 C$ q1 u3 A" P
- (SETQ Cpt(GETSTRING "\n(CT). (TK). (KT). (TL). (Ng). (HM). (QM). (KN). (CTr). (KH). (TBV). (Kts). (TnT). "))
; ?! t- w+ j( e' x0 Q7 c - (IF(OR(= Cpt "QM")(= cpt "qm"))(SETQ CPT ' "Hå S¬ ThiÕt KÕ Nhµ D©n Dông quy M« :"))
8 T* z! u1 D* ?' c( K% r) D - (IF(OR(= cpt "KN")(= cpt "kn"))(SETQ CPT ' "2 TÇng 1 Tum Thang"))! w7 G0 R& V, X' W6 v7 c9 r5 ]
- (IF(OR(= cpt "CT")(= cpt "ct"))(SETQ CPT ' "Chñ Tr× :"))
% g5 i, `* n0 t- x - (IF(OR(= cpt "HM")(= cpt "hm"))(SETQ CPT ' "H¹ng Môc :"))
8 t2 B9 z% y7 r. N2 o- L7 H1 a - (IF(OR(= cpt "CTr")(= cpt "ctr"))(SETQ CPT ' "Nhµ ë Gia §×nh - Nhµ LiÒn KÒ"))2 }7 G5 w) K" f d4 G
- (IF(OR(= cpt "TK")(= cpt "tk"))(SETQ CPT ' "ThiÕt KÕ :"))
$ L1 I1 [$ L8 _1 v - (IF(OR(= cpt "KT")(= cpt "kt"))(SETQ CPT ' "KiÓm Tra :"))
- |- K7 G. ?- n, {# y- H) I - (IF(OR(= cpt "TL")(= cpt "tl"))(SETQ CPT ' "TØ LÖ :"))
8 w0 e% S; }* k5 C/ l! ^ - (IF(OR(= cpt "KH")(= cpt "kh"))(SETQ CPT ' "Ký HiÖu :"))
8 Z4 J5 m, r$ x - (IF(OR(= cpt "TBV")(= cpt "tbv"))(SETQ CPT ' "Tªn B¶n VÏ :"))* g9 @9 z- t- `
- (IF(OR(= cpt "Ng")(= cpt "ng"))(SETQ CPT ' "Ngµy :"))' c) `2 h( o4 k8 A9 p, |! m# l; N' I
- (IF(OR(= cpt "Kts")(= cpt "kts"))(SETQ CPT ' "Kts. TrÇn Ngäc Th¾ng"))
7 [$ X+ Q% [% I9 l+ L/ h" O - (IF(OR(= cpt "TnT")(= cpt "tnt"))(SETQ CPT ' "TrÇn Ngäc Th¾ng"))
$ `! Z2 R" r5 A& Y0 p4 G - (setq pta (getpoint
5 C# u" G$ C0 l- x" N& d9 n C. I, K& c - "\nPick first corner. : "))) R/ B1 m2 Y/ x5 V' o4 R$ ?2 k3 P) K
- (setq ptb (getcorner pta
) D1 a& c0 `5 b+ m5 k - "\nPick second corner. : "))
+ c8 ~+ a4 O5 P! r0 Y - (setq ptc (list (car ptb)(cadr pta)))
) _& S0 p" U w! J - (setq ptd (list (car pta)(cadr ptb)))
$ K% W% s8 E& m* J" m- n8 q# H - (setq ang (angle pta ptb))
+ \. K# S6 \! ^0 f" W - (setq d1 (/(distance pta ptb) 2))
7 ^, ?* a+ D k& P- X* V- d - (setq cp (polar pta (- ang (dtr 0)) d1))
. A0 A4 Z: l! y/ s4 P - (setq X (distance pta ptc))% D* f3 _) M: v6 F+ u: x
- (setq Y (distance pta ptd))
0 Q, s: p6 Q& ^, `( j7 D e: f - (setq X1 (rtos x 2 1))1 j w( x8 Z9 V; n# b( O) @
- (setq Y1 (rtos y 2 1))1 n: q& s4 G/ [: q8 P
- (setq rmsz (strcat "(" X1 " x " Y1 ")"))1 b! \3 u/ Q! K
- (command "TEXT" "c" cp "0" CPT "text" "" rmsz))2 [, n% s% ] g
- (defun dtr (angg)
5 x; t A$ }, s1 R$ y9 R- p1 G: Z - (* pi (/ angg 180.0)))3 r1 J- i4 q, q1 e0 @2 W
- ' ]2 a4 d l0 O h% r
- ;=====================================================================' E2 a! h/ y' A4 w+ F7 D+ F K
- ;==========================DAT KHO GIAY BAN VE - KIEU 1========================
1 g* Z% Q$ ~# f6 ], f - ;=====================================================================$ T3 k* N! C8 C0 h
' I6 v( q# E- ]7 z$ P- M- (Defun c:a6 ()- v7 y4 g% e0 U4 ~ I
- (setq mv_sc 100);Ti le ban ve3 a8 P) w+ Q) H2 m0 Q: t8 I5 d* H
- (setq x4 74.25)1 v" t# f6 T% H) D! L
- (setq y4 52.5)5 [" F& S) {% x! W$ x* S7 V) H
- (setq x4 (* mv_sc x4)
9 \7 L/ a9 c0 Y' X - y4 (* mv_sc y4) )
% A1 w7 Y. M# O6 \ - (command
5 A9 p! U$ M3 P! m _: | - "LIMITS" "0,0" (list x4 y4)( ]8 h1 |" [2 W0 i% E- p
- "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"! U5 i% z+ W' {! `5 q
- "RECTANG" "125,125" "@7175,5000"
5 g2 z% k# `8 q6 [ - "RECTANG" "175,175" "@7075,4900"5 h+ r/ }3 Z# N* }" Y5 x' R
- "ZOOM" "_a" ))
! ]( u+ G4 M4 x* B - ;=====================================================================
9 }0 H7 R6 x4 ~" n1 _ - (Defun c:a5 ()
& [7 M9 u9 Y! z/ x( l; ?# i - (setq mv_sc 100);Ti le ban ve) h* G7 r& _4 u5 I" _5 ]$ h+ D
- (setq x4 147.5)% W* A$ F) i+ `: a+ `
- (setq y4 104)9 Z5 ], W. V- {
- (setq x4 (* mv_sc x4)
. L% w! U4 z& p - y4 (* mv_sc y4) )
7 I0 V8 m( m" h; B) U; L4 \ - (command ( D6 A1 |* Z; I
- "LIMITS" "0,0" (list x4 y4)& _, s1 G' J5 W* q3 l7 a* F
- "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"% R' ?) d" I( V
- "RECTANG" "250,250" "@14350,10000" h% J/ x# o% U( t0 k, {
- "RECTANG" "350,350" "@14150,9800"" a3 M- t% x _4 ?: X
- "ZOOM" "_a" ))/ F9 c9 Y7 q4 }+ P
- ;=====================================================================5 d. b$ E" v/ m; Q# N. a$ w, ^
- (Defun c:a4 () N) N9 ]. _" E3 z3 T6 {+ y
- (setq mv_sc 100);Ti le ban ve
5 b( x2 d- t5 C/ z! B# h5 ] - (setq x4 297)9 ?. _7 S" s/ n$ _% i; [3 y, e6 j$ E6 b
- (setq y4 210)
$ L$ i" Y# Z# S# W$ L - (setq x4 (* mv_sc x4)
! ?" ]# _& e9 B; `/ X% n Y - y4 (* mv_sc y4) )/ [* {% m, N% t% X- |6 z2 l: `
- (command
1 Q3 x4 [8 C5 ]3 o7 f - "LIMITS" "0,0" (list x4 y4)
% s! q; }! h# U& z5 m+ ]( m, o - "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"4 v4 K0 k- \& v7 F- a2 d
- "RECTANG" "500,500" "@28700,20000"
}& @& u& g9 t' N2 J) s - "RECTANG" "700,700" "@28300,19600"3 R: a9 Y: V) m# T9 p& @. ^9 e
- "ZOOM" "_a" ))
5 C5 J& m) D1 u6 w# c- J' G! W - ;=====================================================================5 ^# C) j1 H! J5 r ]4 a
- (Defun c:a3 ()
% K+ \5 G c f% U0 j+ Z; o - (setq mv_sc 100)
$ F9 |+ s# Q, M6 G5 W; f+ f - (setq x3 420)
! O( [8 A9 o3 W I) q3 F6 C# t# u" U6 h1 B - (setq y3 297)
# H. P( W# ^ I5 m2 P- q6 a - (setq x3 (* mv_sc x3)
; \& y5 _. m h, A8 ~( j% C/ | - y3 (* mv_sc y3) )
; M8 u' L% ^. V/ D9 U# P' B3 e - (command
# \# D& {8 q$ Y! o# A" G$ s - "LIMITS" "0,0" (list x3 y3)2 p& F" H7 I7 {/ ?1 _
- "PLINE" "0,0" (list 0 y3) (list x3 y3) (list x3 0) "0,0" "_C"
2 T) {2 G9 u/ G4 I: a; n+ H3 I - "RECTANG" "707.14285714,707.14285714" "@40590,28285.71428571"
# `8 X4 `0 F! }7 n1 M. V x - "RECTANG" "990,990" "@40024.28571429,27720"% L8 A Z0 J2 C( A8 B
- "ZOOM" "_a" ))* ]: c" g u& R( \
- ;=====================================================================
3 t" K w/ @+ X - (Defun c:a2 ()* i$ b& o2 O9 E
- (setq mv_sc 100)
6 O- W; @# D: \! v( q1 D! n ? - (setq x2 594)! ^) {0 p. w9 O$ R
- (setq y2 420)& ~0 G8 \1 R- r4 j
- (setq x2 (* mv_sc x2)
3 h- r; e/ E& a% s8 `. @ - y2 (* mv_sc y2) )9 a* g) F& m' L, ]. v
- (command # ^, r: {+ d' a. e v" F
- "LIMITS" "0,0" (list x2 y2)! N8 Z. e8 p! ^ _1 ~6 [
- "PLINE" "0,0" (list 0 y2) (list x2 y2) (list x2 0) "0,0" "_C"% g- j m6 ?8 }+ N
- "RECTANG" "1000,1000" "@57400,40000" ]6 g8 ]0 J6 P- e! O
- "RECTANG" "1400,1400" "@56600,39200"
6 F/ r! r, f) |& N; B/ ] - "ZOOM" "_a" ))
; }& o0 I, g F& m. S3 Z+ V - ;=====================================================================
9 g/ J/ n, _ X( W5 ]( D - (Defun c:a1 ()7 e, {% j" a, T9 l6 r' R
- (setq mv_sc 100)
6 X \; d1 b/ t& W0 \4 C A( q - (setq x1 840)
8 i3 q/ [5 S. ?- s - (setq y1 594)- W( X1 Y$ D) W6 { a$ |
- (setq x1 (* mv_sc x1) * ?# ^& ]4 o& d
- y1 (* mv_sc y1) )7 \( _: K+ G$ w/ a( Z
- (command
1 B( n5 `' A: D0 t - "LIMITS" "0,0" (list x1 y1)& i# f3 ]* j" C: M3 B% a
- "PLINE" "0,0" (list 0 y1) (list x1 y1) (list x1 0) "0,0" "_C"
" B( p# x) T& z$ l. H: | - "RECTANG" "1414.28571429,1414.28571429" "@81180,56571.42857143"
8 k* `: B8 _& l - "RECTANG" "1980,1980" "@80048.57142857,55440"" P5 M8 x, L9 O* H' a
- "ZOOM" "_a" ))8 }2 z2 ]( b# }" H' A$ p: R: j l0 U$ P
- ;=====================================================================
/ K+ j# G" @+ J; t* `% U* j - (Defun c:a0 ()# B5 @+ G7 m! x( ~! Z4 o
- (setq mv_sc 100)2 H, J: z" x% N
- (setq x0 1188) d& `3 I/ H' l& G1 D" ]. h9 _
- (setq y0 840)* y) r3 }! i3 _. J n2 o
- (setq x0 (* mv_sc x0)
! o ~6 u0 F5 N# g f4 a9 `( C - y0 (* mv_sc y0) )3 E# ]0 `. [0 O- i
- (command
0 _3 R# ]7 W, |! w2 y2 q - "LIMITS" "0,0" (list x0 y0)( {1 l* r1 {4 ?( l/ B" Z0 h
- "PLINE" "0,0" (list 0 y0) (list x0 y0) (list x0 0) "0,0" "_C"4 {9 [: X- |' R4 T6 p
- "RECTANG" "2000,2000" "@114800,80000"$ K7 [% k5 P' s; g3 L6 s/ H
- "RECTANG" "2800,2800" "@113200,78400"$ p* F/ j& ]: q( K
- "ZOOM" "_a" ))% S; n+ `+ p# F5 T1 i' ~' f0 I7 _
$ V$ k M/ {. X) }; n- ;=====================================================================) N, k% H0 K4 c- O% i4 V* C
- ;=========================DAT KHO GIAY BAN VE - KIEU 2=========================$ _4 c! u0 T/ m! M( y
- ;=====================================================================7 f# ?. R, ?, ]; r4 n
( i" v: N7 m, a3 {' W8 t- (Defun c:6a ()% @ f" n P, W, x; o# c
- (setq mv_sc 100);Ti le ban ve" V& ?: v8 Q+ l/ X
- (setq x4 74.25), S0 p8 R; j' u( p5 n0 d. c
- (setq y4 52.5)5 Z! _7 ^& z- W
- (setq x4 (* mv_sc x4) + c% V6 e8 R7 M9 G& i( M. y, f8 U
- y4 (* mv_sc y4) )0 b3 X5 E. g1 A
- (command
6 J+ @8 \, v& o" h0 l/ G( O% y - "LIMITS" "0,0" (list x4 y4)7 [$ b9 W* [) G/ y2 U
- "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
$ j" [, P0 E! ^/ H8 S - "RECTANG" "505,125" "@6800,5000": a7 s2 I. U8 s+ p$ L) W! ?# v
- "RECTANG" "555,175" "@6700,4900"8 Q( a0 M" T) H; W, R# Q
- "ZOOM" "_a" ))
/ g/ j! {+ C3 R! d+ a - ;=====================================================================& X' T! T$ l% ^7 s; Z E7 Z' F8 G
- (Defun c:5a ()
- K4 A& r6 ~8 s) f5 W5 {; [. U - (setq mv_sc 100);Ti le ban ve
* y/ Q4 J! X9 m0 | - (setq x4 148.5)
0 N) k( b$ b3 ]: W - (setq y4 105)8 G. I8 a# u! n2 }
- (setq x4 (* mv_sc x4) % F" ]- d+ l6 z. o
- y4 (* mv_sc y4) )0 u" ], \/ U* {( V! y' I3 ^
- (command 0 ^% t3 h& z( p7 c( ~
- "LIMITS" "0,0" (list x4 y4)0 H: g. ^& [) o8 {
- "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
* c. T1 D( H! b) F1 w - "RECTANG" "1000,250" "@13600,10000"' s! Y$ ~( F# ~
- "RECTANG" "1100,350" "@13400,9800"
9 l# Z, h4 p* r3 P+ ^2 e - "ZOOM" "_a" ))- f( i( q/ ^( p0 m$ e x- X* `
- ;=====================================================================
) ^3 a9 m) f% b9 C& T0 G( k0 k( \9 @ - (Defun c:4a ()5 N3 Z( ^ [5 A2 j0 E' ^
- (setq mv_sc 100);Ti le ban ve& o/ L- L* ^1 e M9 j
- (setq x4 297)8 F: g" F( e4 ]
- (setq y4 210)
4 e8 ^+ J: _' q! ~5 [- J# v - (setq x4 (* mv_sc x4)
$ L6 K3 Q1 N& Q3 i) T - y4 (* mv_sc y4) )% v* T% B( l4 P
- (command
7 l! o9 I& i# z( Q, c3 `; t, B0 \ - "LIMITS" "0,0" (list x4 y4)
; x3 c0 u) [6 g5 {: P- _ - "PLINE" "0,0" (list 0 y4) (list x4 y4) (list x4 0) "0,0" "_C"
2 n K4 p: X2 V- v+ o - "RECTANG" "2000,500" "@27200,20000"# ^, p7 c7 V8 d; k0 m1 s3 @
- "RECTANG" "2200,700" "@26800,19600"# w/ q4 W7 X! Q
- "ZOOM" "_a" ))
6 Z5 P% O8 K; | - ;=====================================================================
) |: U' X; I# l; r - (Defun c:3a ()
" K2 @2 G' w8 T5 E* b( g2 N - (setq mv_sc 100), `/ B: z8 P; `2 F0 d0 V' x! }
- (setq x3 420.0428571429)4 s' X4 |7 i! y! |9 H: r0 E. W1 H
- (setq y3 297)
% H- e* P# s. }% H& ~ - (setq x3 (* mv_sc x3)
1 i1 A* `* f1 o - y3 (* mv_sc y3) )
9 o8 p6 h4 n: `* o n - (command
4 f- e8 T: z1 z' p* ?4 F, \! u) p) D - "LIMITS" "0,0" (list x3 y3)
8 }0 v4 S4 r: o9 v v: Q8 `3 P - "PLINE" "0,0" (list 0 y3) (list x3 y3) (list x3 0) "0,0" "_C"
) Q4 q6 E% C, W: i - "RECTANG" "2828.57142857,707.14285714" "@38468.57142857,28285.71428571"7 h0 e' P6 b8 {3 h$ e+ W4 ^( U
- "RECTANG" "3111.42857142,989.99999999" "@37902.85714287,27720.00000001") o1 p8 W/ j# s
- "ZOOM" "_a" ))$ a$ j/ x3 a# f: u$ v, `, {
- ;=====================================================================
/ ^7 t2 {9 ?( k8 c; N/ g* q" Z - (Defun c:2a ()3 p8 M) r, U0 f1 @) N- G
- (setq mv_sc 100)
4 a# l) `9 _' J: x8 T) r( h: L - (setq x2 594)% p7 ~) H$ h4 J
- (setq y2 420)3 O6 Z- w: n8 O! a
- (setq x2 (* mv_sc x2) 8 \6 _0 z, }0 I. V- I2 ? {8 V
- y2 (* mv_sc y2) )
4 ~" Q. {0 d3 ^1 r! L% \) y' [/ u! C - (command ' j* H3 Q% ?* C @9 \
- "LIMITS" "0,0" (list x2 y2)
' u0 ^+ K# x) M |6 | - "PLINE" "0,0" (list 0 y2) (list x2 y2) (list x2 0) "0,0" "_C"4 U6 w4 O" s) k& b7 y
- "RECTANG" "4000,1000" "@54400,40000"; I" @, G7 _7 B$ K* |# K& O
- "RECTANG" "4400,1400" "@53600,39200"
4 Q- g& j8 N4 r5 ~ - "ZOOM" "_a" ))) |' y9 I! a; L6 a
- ;=====================================================================
' L, E3 L, q: u- j( A* k6 v- q - (Defun c:1a ()
7 z7 t' L* h, r - (setq mv_sc 100)
, j& a, A) K/ Z - (setq x1 840.0857142857)+ F) z8 i( O* n8 _$ m
- (setq y1 594)
$ c! ?# z) V& C- W% ?0 W - (setq x1 (* mv_sc x1) / Y+ Q0 i u6 f8 g
- y1 (* mv_sc y1) )
: E3 k: B' @ D, j0 ?3 x - (command / ~6 _5 r. B& k% W( X
- "LIMITS" "0,0" (list x1 y1)
+ K ~( d" P- ]6 @! S - "PLINE" "0,0" (list 0 y1) (list x1 y1) (list x1 0) "0,0" "_C"
: x$ ^) J0 m6 @$ Q4 c' r - "RECTANG" "5657.14285714,1414.28571429" "@76937.14285714,56571.428571436") {5 a8 U# k* `; X
- "RECTANG" "6222.85714286,1980.00000001" "@75805.71428570,55440"" n, A2 M, ?/ m. b' H! d
- "ZOOM" "_a" ))
3 {: x, N( m# e9 F5 K - ;=====================================================================! D# [+ C4 H* r& f& b; U* W2 @4 m
- (Defun c:0a ()
d2 |/ B. Y3 W - (setq mv_sc 100)& U7 P3 `! v# h; e
- (setq x0 1188)' G: u; g# L! |0 m' P% D
- (setq y0 840)- U/ k( \' X- t
- (setq x0 (* mv_sc x0) 9 D7 j N o; e6 c; m5 i
- y0 (* mv_sc y0) )
' k: ?" t9 e! }8 ^! b8 j6 j7 H1 X - (command
! }: W) w) x/ N1 g6 @5 E - "LIMITS" "0,0" (list x0 y0): l8 q1 S1 o9 a" k
- "PLINE" "0,0" (list 0 y0) (list x0 y0) (list x0 0) "0,0" "_C"
0 ^6 \5 t0 v2 Y* E2 A - "RECTANG" "8000,2000" "@108800,80000", p4 \: R$ _: y: }
- "RECTANG" "8800,2800" "@107200,78400"
, f/ b$ J$ t' M( E1 ]7 L - "ZOOM" "_a" ))
- J0 u& `& N2 s) w
5 S- y6 b1 b6 m4 T( ^1 A- ;=====================================================================* l1 {1 B9 u9 z3 n6 p4 D
- ;==================DAT KhoGiay Theo KHO GIAY BAN VE===================4 x7 d( w. F- x' G ?
- ;=====================================================================- m' O% f# e9 N+ H: q% C
- (defun c:khogiay (/ oldlst a b c d e f g h kho TL)0 {- h( S5 F. Q( Z$ Y
- (command "undo" "be")
) `% w; f. H3 o2 ` - (setq oldlst (mapcar 'getvar (list "CMDECHO" "OSMODE" "cecolor")))# f4 y, H. S0 F) h9 m9 p, A% V
- (setvar "CMDECHO" 0)/ @: ^. p x6 p$ W6 C1 }( x
- (setq a (getpoint "\n chon diem chen :"))
. n; h q( ^2 T - (if (not TL) (setq TL 1.00))+ {! e( h' \! P0 {# ?: Y+ g
- (setq TL1 (getDIST (strcat "\nScale <" (rtos TL 2 2) ">:")))
. ^7 T) |' s! R n$ w) J; }4 ^& | - (if TL1 (setq TL TL1))& F8 g7 k$ n) O/ D
- (setvar "osmode" 0)! ?1 ?# o9 _' P- ^
- (if (not (tblsearch "layer" "Defpoints")) (Command "layer" "N" "Defpoints" ""))- f/ @ [9 N+ B
- (initget "0 1 2 3 4")0 t* K1 G" ~$ V% B2 S; V) q
- (setq kho (getkword "\Kho A0 _ Kho A1 _ Kho A2 _ Kho A3 _ Kho A4 [0/1/2/3/4]? <0>:"))
9 g/ P9 x8 @0 s' Y- E& k - (if (= kho "0")3 b+ d* h4 ~7 \
- (progn
+ \, _4 ]0 @% | - (setq b (polar a 0 (* TL 1189)))* r+ S! _5 o0 Y: u$ a2 s" Q7 {+ K$ r
- (setq c (polar b (/ pi 2) (* TL 841)))% E4 K0 i& L; ~; J U: b9 M3 p- ]
- (setq d (polar a (/ pi 2) (* TL 841)))
W$ p6 t8 I5 y5 ?0 i0 Y& b - (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 12 12)))))
4 E& d* Y: f) t3 t. x - (setq f (polar e 0 (- (* TL 1189) (* TL 24))))
! F Y; V% f) X; u' C - (setq g (polar f (/ pi 2) (- (* TL 841) (* TL 24))))
1 \" ~2 x% v' g. f8 f& R E6 [3 { - (setq h (polar e (/ pi 2) (- (* TL 841) (* TL 24))))0 {1 C& g+ w" w% V" C$ W9 `6 z
- (command "Pline" e f g h "c")
6 T: v( p! G& O - (command "change" "last" "" "properties" "layer" "0" "")0 S' X2 v3 J# ?+ z: Z
- (setvar "cecolor" "4")3 q: H7 n) ?, Y7 \1 L" ` I' `/ K0 y! h
- (command "Pline" a b c d "c")2 B9 w* \/ S. @# V6 |+ b. F
- (command "change" "last" "" "properties" "layer" "defpoints" "")))
% S$ f. }$ P& v2 c; L: V7 W2 j - (if (= kho "1")
* I/ n% j& _; x- W8 R' k- {2 p - (progn
0 P0 W; D L& K" y% A# k - (setq b (polar a 0 (* TL 841)))
3 U* A& Q F+ j I( u4 G - (setq c (polar b (/ pi 2) (* TL 594)))
- f4 N( z$ _( O: |. a' K- \) J: h - (setq d (polar a (/ pi 2) (* TL 594)))5 N! u" Y+ V6 u) }
- (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 12 12)))))
9 G) l( Z1 k- q5 h, c# T - (setq f (polar e 0 (- (* TL 841) (* TL 24))))" u1 D% y) b' M3 b) s# ]+ F
- (setq g (polar f (/ pi 2) (- (* TL 594) (* TL 24))))
! K! e, v y& b i$ B& o - (setq h (polar e (/ pi 2) (- (* TL 594) (* TL 24))))/ H/ ]( q# g7 O
- (command "Pline" e f g h "c")
4 i! i( K/ @* ]7 F- h - (command "change" "last" "" "properties" "layer" "0" "")2 K9 u# D5 X+ D* D$ p% |0 j
- (setvar "cecolor" "4")9 l6 }. p: d- w3 B7 ^
- (command "Pline" a b c d "c")
1 U# R: Z( O/ X+ _( a; k - (command "change" "last" "" "properties" "layer" "defpoints" "")))
/ z( g1 C) j* s* E" N2 Y y - (if (= kho "2")! S+ V: X5 [3 l* x: j
- (progn9 x8 {# S; D3 G5 A
- (setq b (polar a 0 (* TL 594))). p8 C# B) m: `
- (setq c (polar b (/ pi 2) (* TL 420)))7 {9 k, h( h3 d2 k Z
- (setq d (polar a (/ pi 2) (* TL 420)))
; h: t: @& g" P! E4 E0 ^ - (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 100)))))0 ?5 [1 y' c5 w, B1 t$ ]
- (setq f (polar e 0 (- (* TL 594) (* TL 20))))/ n. g) l& X: @- V5 R
- (setq g (polar f (/ pi 2) (- (* TL 420) (* TL 20))))0 S+ [- F- T' g/ g% A: W0 y
- (setq h (polar e (/ pi 2) (- (* TL 420) (* TL 20))))/ y* F) V! j7 e. Z2 L! E
- (command "Pline" e f g h "c") * W, d# c+ u4 J/ O' v- l- g3 _
- (command "change" "last" "" "properties" "layer" "0" "")4 t( E1 |" @8 T4 ?+ g4 ]( Y
- (setvar "cecolor" "4")3 \9 Y, u+ ]( R* ]5 t/ Y- s+ P2 S, k% I
- (command "Pline" a b c d "c")
! b s0 f2 ?" G& Y - (command "change" "last" "" "properties" "layer" "defpoints" "")))
# q& R9 ~7 {' ^ - (if (= kho "3")
& \ U1 D( F! R3 y. Y, n0 S/ c - (progn7 K- s* H' f7 r x0 S3 F5 M- s
- (setq b (polar a 0 (* tl 420)))& @' K! a/ l: A5 {6 Q% E3 j5 Y6 ^
- (setq c (polar b (/ pi 2) (* TL 297)))
! X* g, Z, C2 H - (setq d (polar a (/ pi 2) (* TL 297)))
) F1 R2 s& v- k8 k6 H& R5 V1 K4 J% h - (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 100)))))
' [. Z; i* M" |! T: X4 x - (setq f (polar e 0 (- (* TL 420) (* TL 20))))$ x1 F; p- v+ y, m# B
- (setq g (polar f (/ pi 2) (- (* TL 297) (* TL 20))))
7 N4 S" D5 O+ @1 c0 A - (setq h (polar e (/ pi 2) (- (* TL 297) (* TL 20))))
" I4 r8 z& ?& m/ d - (command "Pline" e f g h "c")- y8 O8 |6 t" Z( S0 n
- (command "change" "last" "" "properties" "layer" "0" "")7 L F. ?0 I9 |7 G0 {: i
- (setvar "cecolor" "4")1 w2 ]( `% P% `7 S8 ?
- (command "Pline" a b c d "c")8 Z* Q+ X8 c+ r' ?0 h4 I
- (command "change" "last" "" "properties" "layer" "defpoints" "")))
6 t. Z. M; i5 k - (if (= kho "4")
9 M1 L5 k8 K' H* y! f - (progn
1 F e) N0 {: y. K - (setq b (polar a 0 (* TL 297))). ]$ Y$ L0 B% y7 S
- (setq c (polar b (/ pi 2) (* TL 210)))2 v! J/ c. b0 T2 _4 G! t) [
- (setq d (polar a (/ pi 2) (* TL 210)))$ a% O; l+ L k3 Y3 _+ w, n4 @7 y
- (setq e (polar a (/ pi 4) (* TL (sqrt (* 2 81)))))
0 t' Q7 V$ l; T, ^) ? - (setq f (polar e 0 (- (* TL 297) (* TL 18))))/ K# X$ g) M& h4 B: B3 X
- (setq g (polar f (/ pi 2) (- (* TL 210) (* TL 18))))9 g7 w I: z6 E; x) q# d
- (setq h (polar e (/ pi 2) (- (* TL 210) (* TL 18))))
" O9 Z$ y4 `0 G0 ` - (command "Pline" e f g h "c") $ t3 V6 R- i; W+ Y4 h& I
- (command "change" "last" "" "properties" "layer" "0" "")
! |2 V& ]0 c( d+ d - (setvar "cecolor" "4")
0 j/ a& \8 E" b - (command "Pline" a b c d "c")
5 X* B4 ]3 d$ f) Y - (command "change" "last" "" "properties" "layer" "defpoints" "")))& ~3 k: Y+ j$ C: _) ]
- (mapcar 'setvar (list "CMDECHO" "OSMODE" "cecolor") oldlst). O" l N# X8 Z
- (command "undo" "e")
# t. ?, Q; h4 S - (princ))& V0 b& F* u7 s k
- ;=====================================================================
1 u6 K- v6 E* e - ;==================DAT KhoGiay Theo KHO GIAY BAN VE===================1 q% @( U; D0 t' V
- ;=====================================================================
q8 G) B9 C6 J: O+ I
! ?0 [! t9 {& `/ k/ w- ;=====================================================================
/ Y, G9 S$ Z! M) W, O - ;===================DAT Ti Le Theo KHO GIAY BAN VE====================
% u6 U! Z0 ^; S2 {4 F$ D( ?7 W - ;=====================================================================
* @ _; H) N/ ~- x$ g+ N# v' a - ( k3 n- ]5 r3 ~! h3 I; K
- (DEFUN C:SA6 () (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.1" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "5" ""
0 z9 ?% e8 S/ D. v) T) E8 o( M9 I - "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.3" ""' L# n n9 t% a
- "M" "MANH" "C" "9" "" "Lw" "0.1" ""' t: U6 [" o( K3 t8 g& V
- "M" "TEXT" "C" "7" "" "Lw" "0.12" ""
3 ?; c; _3 u$ {5 z; E1 ]5 _& t6 z/ v - "M" "DIM" "C" "1" "" "Lw" "0.12" ""4 F5 Y6 H5 ]9 e) ]8 c
- "M" "THAY" "C" "7" "" "Lw" "0.2" ""
f& G5 `: f Y2 M. `8 Z; Z - "M" "NOITHAT" "C" "3" "" "Lw" "0.12" ""
9 b1 ~6 p% O0 J5 _ - "M" "HATCH" "C" "5" "" "Lw" "0.1" ""3 V1 g( V; W) Y; O/ y
- "M" "COT" "C" "1" "" "Lw" "0.3" ""* w2 Y3 J, c5 ]
- "M" "Defpoints" "C" "7" """ c [' c8 w7 [. ^# q$ Y
- "M" "0" "C" "3" "" "Lw" "0.12" ""- |& D! X* a) M! M ?: Q
- "M" "CUA" "C" "6" "" "Lw" "0.12" ""
4 }0 n _0 U( @9 [7 i. ]( W u - "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.12" ""- ~' Q$ l. L+ X
- "M" "TIMTUONG" "C" "5" "" "Lw" "0.1" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "3" ""))/ y$ f2 C1 ]' N6 Q P, u# H
- (DEFUN C:SA5 () (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.12" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "10" ""9 R% w G$ J+ o
- "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.4" ""
$ K0 Y$ l! H% Y# D6 T, ?9 I - "M" "MANH" "C" "9" "" "Lw" "0.12" ""% l; e7 E( f2 p1 p, g, V5 X2 y3 A
- "M" "TEXT" "C" "7" "" "Lw" "0.12" ""! ?2 E! M4 K1 K& S, g: p
- "M" "DIM" "C" "1" "" "Lw" "0.2" ""
4 n& L) ~7 I5 p9 W2 l4 ^9 f- r( E - "M" "THAY" "C" "7" "" "Lw" "0.2" ""( @; W$ i, L" Q! Z& y$ b( C7 p
- "M" "NOITHAT" "C" "3" "" "Lw" "0.2" ""& G, Y3 {+ q- ]2 E" o# m
- "M" "HATCH" "C" "5" "" "Lw" "0.1" ""& C+ c$ W; T# f1 u. Y+ C
- "M" "COT" "C" "1" "" "Lw" "0.4" ""+ I- v* d- `1 l- }1 V
- "M" "Defpoints" "C" "7" ""! {2 w/ o' n9 t/ s; [
- "M" "0" "C" "3" "" "Lw" "0.2" ""! d0 U: a" l. A+ y# j: _! b$ ~
- "M" "CUA" "C" "6" "" "Lw" "0.12" ""1 R2 ?3 F& k' m; B+ W5 a# E6 f
- "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.12" ""- K( X5 J2 @$ [" ~9 {( p
- "M" "TIMTUONG" "C" "5" "" "Lw" "0.15" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "5" ""))
6 H" ^. j3 Q( \, k5 Q$ o5 F/ s - (DEFUN C:SA4 () (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.2" "" "LT" "ACAD_ISO03W100" "" "" "LTSCALE" "20" ""
* K9 c5 i: x3 l- D8 S - "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.6" ""! b3 T" `3 t/ d4 c/ n
- "M" "MANH" "C" "9" "" "Lw" "0.2" ""% |, t8 a! i+ x1 Y6 x/ ?
- "M" "TEXT" "C" "7" "" "Lw" "0.2" ""8 S! k' o: l" d# G% w0 P0 ~
- "M" "DIM" "C" "1" "" "Lw" "0.25" ""3 _; M" v, {6 _/ a+ }" B( i
- "M" "THAY" "C" "7" "" "Lw" "0.35" ""
& ]3 ~3 o) Q6 I6 ~ D! e6 s - "M" "NOITHAT" "C" "3" "" "Lw" "0.25" ""
6 D2 P: j+ ~0 |% d - "M" "HATCH" "C" "5" "" "Lw" "0.15" ""& D# W9 i/ v3 S8 \" `( R1 N% I/ S. @
- "M" "COT" "C" "1" "" "Lw" "0.6" """ X5 u- g4 ~3 v# {7 J
- "M" "Defpoints" "C" "7" ""
: ]& r ]6 @: L1 a/ h! A - "M" "0" "C" "3" "" "Lw" "0.25" ""6 D7 I( |: D# z
- "M" "CUA" "C" "6" "" "Lw" "0.25" ""
, z% w o; P d# E ? - "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.25" ""
* B: X0 ^# t1 A- _& X& Q- m3 p+ G0 k - "M" "TIMTUONG" "C" "5" "" "Lw" "0.2" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "10" ""))
: f$ j! s4 h% Z2 p - ) C ]+ v7 c% R% D
- (DEFUN C:SA3 () (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.35" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "30" ""
9 X. o& b# w* q) y. h% E; a - "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.7" ""
$ A5 c0 g5 \' R - "M" "MANH" "C" "9" "" "Lw" "0.25" ""( u/ D' n2 [( b# i
- "M" "TEXT" "C" "7" "" "Lw" "0.2" ""9 [/ r- J7 u* Y2 K8 J6 N5 T
- "M" "DIM" "C" "1" "" "Lw" "0.35" ""
/ |& o0 V1 O9 \4 n h - "M" "THAY" "C" "7" "" "Lw" "0.4" ""- v. ?7 z. P) U1 D0 c3 d. v
- "M" "NOITHAT" "C" "3" "" "Lw" "0.25" ""- ^. v" y, |8 p/ z% A3 W
- "M" "HATCH" "C" "5" "" "Lw" "0.2" ""3 z) H/ }6 m! }- ~4 w
- "M" "COT" "C" "1" "" "Lw" "0.7" ""
: y( ~4 u! X# `: Y3 i" t2 G) t - "M" "Defpoints" "C" "7" ""& a' J* J7 l* v' G; {0 A4 _
- "M" "0" "C" "3" "" "Lw" "0.25" ""
' P3 `4 p4 U2 {$ X' p/ t1 r - "M" "CUA" "C" "6" "" "Lw" "0.35" ""
/ ^ G. x3 I2 d4 O& I- c - "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.3" ""
! Y; A/ A0 }$ w! j) ]' C5 f3 Z$ b. @$ G - "M" "TIMTUONG" "C" "5" "" "Lw" "0.25" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "20" ""))(PRINC)% O, |' Z+ @$ }1 k
- 0 c# g+ C! B4 p; g2 W2 @8 V+ O
- (DEFUN C:SA2 () (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.35" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "45" """ p/ P: b: t( |( B
- "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.7" ""
$ ]9 J2 ?; q+ W8 T9 a - "M" "MANH" "C" "9" "" "Lw" "0.25" ""
& v5 K7 b. M5 P; T* N/ B - "M" "TEXT" "C" "7" "" "Lw" "0.25" ""; U% x6 Y# B6 N% E/ \
- "M" "DIM" "C" "1" "" "Lw" "0.3" ""6 ]( X( C0 u( M* Z7 G2 K
- "M" "THAY" "C" "7" "" "Lw" "0.4" ""
2 b" t8 N6 L' h. f0 W; v - "M" "NOITHAT" "C" "3" "" "Lw" "0.3" ""
+ j, Z$ E" i/ n - "M" "HATCH" "C" "5" "" "Lw" "0.2" ""+ \; e2 T% e4 i) {. Z
- "M" "COT" "C" "1" "" "Lw" "0.7" ""( D$ K X U# M- Y* ^
- "M" "Defpoints" "C" "7" ""
5 i& j( L0 x6 d! O - "M" "0" "C" "3" "" "Lw" "0.35" ""9 h& j2 Q: g3 g' C! Z( m" [
- "M" "CUA" "C" "6" "" "Lw" "0.35" ""
2 `3 |1 g& Q" g8 } - "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.3" ""
" I& b$ t2 I. z: x' C4 v3 r - "M" "TIMTUONG" "C" "5" "" "Lw" "0.25" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "30" ""))+ ^* @+ M1 }. T
- ' e+ @" `$ k! e5 ?2 w) ?
- (DEFUN C:SA1 () (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.4" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "60" ""% {+ ]) Y, j5 g1 i
- "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "0.85" ""
6 W7 a7 I0 w( x - "M" "MANH" "C" "9" "" "Lw" "0.35" ""
$ `/ r9 o: x# h) h: V4 }1 m6 M - "M" "TEXT" "C" "7" "" "Lw" "0.5" "" m* O& U/ u/ [) ^/ X
- "M" "DIM" "C" "1" "" "Lw" "0.35" "". B. _$ u$ |' l0 Y3 D
- "M" "THAY" "C" "7" "" "Lw" "0.4" ""& r/ U! o8 ]9 \3 i8 K
- "M" "NOITHAT" "C" "3" "" "Lw" "0.35" ""
. E2 f# Y2 X; c4 l& H - "M" "HATCH" "C" "5" "" "Lw" "0.25" ""
1 |( U, D$ k5 \: |) J - "M" "COT" "C" "1" "" "Lw" "0.85" ""8 ^% o: Q( {$ L8 P6 _; p% |+ j
- "M" "Defpoints" "C" "7" ""6 s' r& P0 ]" w8 I
- "M" "0" "C" "3" "" "Lw" "0.35" ""- U- E: \! n" a1 A
- "M" "CUA" "C" "6" "" "Lw" "0.4" ""
/ Z9 m7 a5 C$ b+ ~- d7 o/ l- ^ - "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.35" ""
; [( j6 R8 v' d+ h {+ Y - "M" "TIMTUONG" "C" "5" "" "Lw" "0.3" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "40" ""))
Z' j3 L8 U- u# o, J - ' o' Z- f% e2 R3 I) c+ a; |2 n, `
- (DEFUN C:SA0 () (COMMAND "-LAYER" "M" "NETDUT" "C" "8" "" "Lw" "0.5" "" "LT" "ACAD_ISO03W100" "" "" "" "LTSCALE" "85" ""
/ l+ G/ f1 J# H# U - "-LAYER" "M" "TUONG" "C" "4" "" "Lw" "1" ""/ n* ~1 c; T1 T2 U; Z/ V
- "M" "MANH" "C" "9" "" "Lw" "0.35" ""2 J; k9 [/ y3 u/ s9 L
- "M" "TEXT" "C" "7" "" "Lw" "0.5" ""
* q7 C9 }! ~+ y& X - "M" "DIM" "C" "1" "" "Lw" "0.35" "": c9 k: Z* W: L: W8 b0 a
- "M" "THAY" "C" "7" "" "Lw" "0.5" ""
; ]. p6 R3 v+ p3 k( c; \ - "M" "NOITHAT" "C" "3" "" "Lw" "0.4" ""
6 X8 J1 j G& K7 x8 V6 @ - "M" "HATCH" "C" "5" "" "Lw" "0.35" ""
4 V6 m5 l U+ Q" @. O# R9 W - "M" "COT" "C" "1" "" "Lw" "0.1" ""
?1 ^8 |9 k8 O/ X - "M" "Defpoints" "C" "7" ""3 R# A! G V) }' K
- "M" "0" "C" "3" "" "Lw" "0.5" ""0 k5 S7 r$ S; n& B0 B
- "M" "CUA" "C" "6" "" "Lw" "0.5" ""
7 s" e, G) t+ Y ]" z# M' a' T - "M" "CUA MATDUNG" "C" "6" "" "Lw" "0.4" ""
( B7 ?7 c, L$ S5 R) p5 ?8 s - "M" "TIMTUONG" "C" "5" "" "Lw" "0.35" "" "LT" "ACAD_ISO10W100" "" "" "LTSCALE" "55" ""))
, ]2 _# }3 G2 c2 x' E* A8 W3 b$ k& c - (DEFUN C:O () (COMMAND "OFFSET"))
; z( ~! D' Y# Q( E9 q K& b- M - (defun c:s1 () (command "surftab1"))7 N4 @: j6 I. \# b( p
- (defun c:s2 () (command "surftab2"))& d" u& {% B6 Z0 s
- (defun c:ep () (command "explode"))
+ _: z& l1 j- N7 B$ {: u - (DEFUN C:QS () (COMMAND "AUDIT" "Y" "purge" "all" "*" "N" "QSAVE"))
7 q, q) T/ S c$ H# n' h, B - (DEFUN C:QV () (COMMAND "QSAVE"))
+ G& D; \: W2 T& Z7 z1 e- F1 q - (DEFUN C:S () (COMMAND "STRETCH" "C"))' n0 \ p. D/ [' _
- + x0 x2 `+ O5 Q; C& M4 U! f
- ;************************** CAT DIM **************************
% [4 H/ L4 P3 x# ?' b1 @# O+ K. S, ]* }
+ T1 d: ^! y- [) b8 m. H- (DEFUN C:DC (/ CMD SS LTH DEM PT DS KDL N70 GOCX GOCY PT13 PT14 PTI PT13I PT14I8 a4 r$ j Z+ a0 t& q
- PT13N PT14N O13 O14 N13 N14 OSM OLDERR PT10 PT11), F/ I1 q6 V Z( H
- (SETQ CMD (GETVAR "CMDECHO"))- {# V9 w9 M8 m+ N" ?& K
- (SETQ OSM (GETVAR "OSMODE"))6 u4 i8 a0 E4 T9 |
- (SETQ OLDERR *error*
& |( m8 q0 C8 z1 q - *error* myerror)+ t) ^6 p9 x- \: c) m2 O$ O
- (PRINC "Please select dimension object!")
0 u7 k! k" }5 Z# {" ` - (SETQ SS (SSGET))# X: c( U* h) k1 r
- (SETVAR "CMDECHO" 0)- l0 e3 T( M' c0 h9 n3 b
- (SETQ PT (GETPOINT "Point to trim or extend:"))
! j) P* V6 \0 g4 Q1 T. A- Y0 @ - (SETQ PT (TRANS PT 1 0))
$ h# x G3 f" G0 t7 X8 Z4 { - (COMMAND "UCS" "W")
' H: D/ S: r4 `1 z6 U3 z6 @0 v - (SETQ LTH (SSLENGTH SS))
l# d4 s. h1 a, N - (SETQ DEM 0)4 W t; s" t1 F6 r9 M& F/ Z4 I1 E( U% J
- (WHILE (< DEM LTH)$ a$ Y: V* |- z4 }' T
- (PROGN! }9 {5 ~. z6 p9 E6 F' P( [% r
- (SETQ DS (ENTGET (SSNAME SS DEM)))
" p( A1 S; W5 T* p* S/ O% V - (SETQ KDL (CDR (ASSOC 0 DS)))" h/ s/ z$ a1 L6 x9 i7 B+ k8 C" ?# x. q1 v
- (IF (= "DIMENSION" KDL). z- M& e8 t3 N" [2 g' r
- (PROGN
' `4 g9 I) g5 _- n" d# o - (SETQ PT10 (CDR (ASSOC 10 DS)))
7 u# h3 i" v: r! V6 j - (SETQ PT11 (CDR (ASSOC 11 DS)))
3 j; @$ ]# b4 v4 O9 x4 H7 m - (SETQ PT13 (CDR (ASSOC 13 DS))): M) s) s4 [, b* e2 p+ M$ V! J/ g5 O
- (SETQ PT14 (CDR (ASSOC 14 DS)))2 y# Y# d0 v0 z
- (SETQ N70 (CDR (ASSOC 70 DS)))9 t3 [) ~. |5 A! J& {4 ]1 `' n
- (IF (OR (= N70 32) (= N70 33) (= N70 160) (= N70 161))
% b4 ^' v* k9 C3 C( K8 }) v - (PROGN: x) Q) O; e/ F* ~% Y z9 Q/ \& h
- (SETQ GOCY (ANGLE PT10 PT14))
/ C. {. z9 B/ |$ U- G w; M/ p - (SETQ GOCX (+ GOCY (/ PI 2)))3 a0 T- a( p5 m7 \1 u
- )( [' f) a, e( @7 \; C) R; U
- )
1 l& N* A9 v: Q7 O. i - (SETVAR "OSMODE" 0)
( z4 C+ S& o. X/ e- s% l6 U - (SETQ PTI (POLAR PT GOCX 2))* r" `4 }; ~3 g0 P5 m
- (SETQ PT13I (POLAR PT13 GOCY 2)); |% R* C( Q) r/ D
- (SETQ PT14I (POLAR PT14 GOCY 2))
( I o: T1 |* G; e( Y# [ - (SETQ PT13N (INTERS PT PTI PT13 PT13I NIL))$ V( m, N% b: r' s8 I
- (SETQ PT14N (INTERS PT PTI PT14 PT14I NIL))) k2 E7 U; C; Y- n
- (SETQ O13 (ASSOC 13 DS))- {7 U" Z. Z0 w$ I. I
- (SETQ O14 (ASSOC 14 DS))* ?, h0 o' d6 s9 \" e
- (SETQ N13 (CONS 13 PT13N))
- f" [# V, Q7 T! ^" G: n: x5 a0 \ - (SETQ N14 (CONS 14 PT14N))$ F p9 d Q9 U; f7 p
- (SETQ DS (SUBST N13 O13 DS))) ~% ]! L% F6 p/ c% z& D3 A9 w
- (SETQ DS (SUBST N14 O14 DS))( z1 N5 P7 s, z% z4 a
- (ENTMOD DS)
3 X; _9 G+ |1 _! {2 s; q - )
' Z: J- n+ s' g9 E* t- V - )
8 g( e# j& p# {! u - (SETQ DEM (+ DEM 1))
# I7 t4 p6 t3 c8 U - )
, m* W8 F* m5 Y: I* c& N- p, \8 M - ) f q& e- r! f6 M% s
- (COMMAND "UCS" "P")/ h" p5 z2 H0 [2 y2 t3 i/ j `. C
- (SETVAR "CMDECHO" CMD)4 l& C2 i, r: x. D) C
- (SETVAR "OSMODE" OSM)1 x- }# B _! I, L$ M* U g
- (setq *error* OLDERR) ; Restore old *error* handler' m- D$ r9 B( i" q. s" M
- (PRINC)' K: l4 @: Z0 M& o7 d
- )
( k; C% Q! z* d2 e
) n# a% ]- j0 ]- (DEFUN C:BD (/ CMD SS LTH DEM PT DS KDL N70 GOCX GOCY PT13 PT14 PTI
+ Q" U6 z, Y. g. ?$ _+ S% E - PT10 PT10I PT10N O10 N10 PT11 PT11N O11 N11 KC OSM OLDERR)( V& M$ \; W; a" {& R5 T% g9 `
- (SETQ CMD (GETVAR "CMDECHO"))8 h/ b* c* [- a, G$ Q& \2 }
- (SETQ OSM (GETVAR "OSMODE"))
- n/ ~2 S; T/ V- O# H# v - (SETQ OLDERR *error*! X" a+ G/ x4 A1 \: w, @; Z
- *error* myerror). t# h& f2 X9 M
- (PRINC "Please select dimension object!")6 ]; j! T- ]5 y2 |8 p a3 i" [
- (SETQ SS (SSGET))
! N6 q2 N- [: `9 `* @1 m- b - (SETVAR "CMDECHO" 0)
+ T2 h$ n( l. E- K, x - (SETQ PT (GETPOINT "Point to trim or extend:"))
5 i5 g8 m* h" w; N - (SETQ PT (TRANS PT 1 0))
, x. s/ @5 E; s - (COMMAND "UCS" "W"); k7 R, g1 G8 g! c- u
- (SETQ LTH (SSLENGTH SS))2 ]! M1 x8 V( m
- (SETQ DEM 0)9 `$ i: {& ^% [" F& ]& S! E! l) g
- (WHILE (< DEM LTH)+ l- v; m- j3 v6 T
- (PROGN
& v7 A: r/ F+ B* }3 v - (SETQ DS (ENTGET (SSNAME SS DEM)))' n& @0 o3 G! W' g
- (SETQ KDL (CDR (ASSOC 0 DS))), V% e# M6 v2 G Y# E
- (IF (= "DIMENSION" KDL)
% @' ]( g# F2 o. j. T - (PROGN& c& M! T. d/ [. [
- (SETQ PT13 (CDR (ASSOC 13 DS)))
% |) j$ c& y: Z: q0 a% g - (SETQ PT14 (CDR (ASSOC 14 DS)))
7 d+ `) E( I, ?+ t, i7 n% t - (SETQ PT10 (CDR (ASSOC 10 DS)))
/ Q j5 z: [+ P9 g. u& {8 T - (SETQ PT11 (CDR (ASSOC 11 DS)))
& x! l& ^( e4 u, Z8 W, O. p7 v - (SETQ N70 (CDR (ASSOC 70 DS)))
$ v1 A1 N" @4 ?5 b+ ~8 R1 J* s' h - (IF (OR (= N70 32) (= N70 33) (= N70 160) (= N70 161))
- p2 S* B; ?1 W. L - (PROGN0 [- H- B* t% L$ q% W+ C
- (SETQ GOCY (ANGLE PT10 PT14))6 {* O3 z7 m0 _& ?6 q) F5 E( ?# h
- (SETQ GOCX (+ GOCY (/ PI 2)))
& m$ T/ R& T; W( x/ B1 I! V+ _$ z - )
- a; @" ?" M, R1 Z2 e" p( o. Q - )$ Q/ t( `* ?9 o+ P" D9 w: J
- (SETVAR "OSMODE" 0)
% g9 v( f0 V3 n/ M - (SETQ PTI (POLAR PT GOCX 2))
2 D, t- U" z0 A9 f/ ]4 H - (SETQ PT10I (POLAR PT10 GOCY 2))7 }* }* T# `5 E! _
- (SETQ PT10N (INTERS PT PTI PT10 PT10I NIL))
: b( @$ g2 t/ B - (SETQ KC (DISTANCE PT10 PT10N))
( |. S: e' A; ]2 x - (SETQ O10 (ASSOC 10 DS))
3 e4 N* s& |8 b: J) g% X - (SETQ N10 (CONS 10 PT10N))
S6 K+ t: f$ I$ j - (SETQ DS (SUBST N10 O10 DS))! O2 k/ |2 O) J/ s4 O2 s
- (SETQ PT11N (POLAR PT11 (ANGLE PT10 PT10N) KC))) i( x+ ~0 j& D5 }5 g4 `% P3 a) e% B9 ?3 Y
- (SETQ O11 (ASSOC 11 DS))
7 o; Y4 w7 Y8 X9 d) {5 m, A - (SETQ N11 (CONS 11 PT11N))
$ P# r3 \& b+ E% i! V - (SETQ DS (SUBST N11 O11 DS))# ?& ]9 {# b: H, A
- (ENTMOD DS)- e% R0 r' K4 A, A9 _8 [
- )
/ l* G1 D! S% J - ), w" E+ h+ \4 J, \' r! _( y1 O% X
- (SETQ DEM (+ DEM 1))- c: x0 E1 I" G$ p, G; r
- )
( V- V% c+ {5 q, C4 N1 `3 S - )
% E; R- K( R% b" F1 Q - (COMMAND "UCS" "P"): R2 _ x. m; l3 Z' O6 z- g9 M
- (SETVAR "CMDECHO" CMD)) q; j' L* w+ v* n; g( E
- (SETVAR "OSMODE" OSM)
! N- }- ^- H1 N4 v - (setq *error* OLDERR)
j' l: S& }# E8 D% h; u! g - (PRINC)
; h9 i# r! P" B3 a - )
7 `: x- y* S& i7 C% _' ^" ~ - * R' z" T# c1 Y; ~$ B1 q9 @$ G
- ;;; ================ BAT - TAT CHE DO GACH CHAN TEXT (TU) =================
5 F, I: Z/ u3 L" e
' h, q3 p% b3 ?" R& p- (defun c:tu () (setvar "cmdecho" 0)(prompt "\nHay chon dong TEXT can gach chan "): ^( V( ?. Q1 D7 b2 r7 o: K# C6 @
- (prompt "\nSelect objects: ")(command "select" "au" pause)(setq sstxt (ssget "p") O0 R1 S2 T6 i/ J9 y) p( M2 g: ]
- sslen (sslength sstxt) ctr 0)(command ".undo" "mark")(while (< ctr sslen)(setq listxt( l0 b" o' n/ i( s) a* i
- (entget (ssname sstxt ctr))txttxt (cdr (assoc 1 listxt))enttxt (cdr (assoc 0 listxt)))* i5 g1 z$ `0 F
- (if (= enttxt "TEXT")(progn(setq testxt (substr txttxt 1 3))(if (or (= testxt "%%u")" q' b' \7 N2 u2 t
- (= testxt "%%U"))(setq newtxt (substr txttxt 4))(setq newtxt (strcat "%%u" txttxt))), v7 ]6 @- H* s( Q) e
- (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))(entmod listxt)))- g3 {3 v1 }" d; H( n% P; Q
- (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))2 ^0 @% }! }/ a3 H5 f
7 v8 a/ u i* w- ;;; ================ CHEN COT (TUU) =================
' d2 P. ?0 E1 B) R* L - # U) A1 \& K9 ~
- (defun c:tuu () (setvar "cmdecho" 0)(prompt "\nHay chon dong TEXT can chen cot ")5 S9 w* x" V3 ?* N1 G; w: L5 F
- (prompt "\nSelect objects: ")(command "select" "au" pause)(setq sstxt (ssget "p")
& |0 N6 X- e( W( B - sslen (sslength sstxt) ctr 0)(command ".undo" "mark")(while (< ctr sslen)(setq listxt5 ^5 [7 b( e1 _1 m4 g
- (entget (ssname sstxt ctr))txttxt (cdr (assoc 1 listxt))enttxt (cdr (assoc 0 listxt))), k+ V ?4 A' H9 A# C8 I( l
- (if (= enttxt "TEXT")(progn(setq testxt (substr txttxt 1 3))(if (or (= testxt "%%p 0,000")
* s* _9 x ~" J - (= testxt "%%P 0,000"))(setq newtxt (substr txttxt 4))(setq newtxt (strcat "%%P 0,000" txttxt))) @: b) j" F) w$ \; ~
- (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))(entmod listxt)))
& b7 k6 c" ^5 T# _ s - (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))
7 ~$ s" v2 o% {" C) y - " s& a/ ~- J$ V" ?! _3 _! B
- ;;; ================ CHEN KY HIEU THEP (TP) =================4 a5 o5 V; ~5 }
7 Q K! A$ `( |; ^$ c9 r- (defun c:tp () (setvar "cmdecho" 0)(prompt "\nHay chon dong TEXT can chen ky hieu thep ")
0 Z \0 e4 l4 r/ Q4 m* @( Z - (prompt "\nSelect objects: ")(command "select" "au" pause)(setq sstxt (ssget "p")
, V8 U, u+ u: o- v0 O - sslen (sslength sstxt) ctr 0)(command ".undo" "mark")(while (< ctr sslen)(setq listxt! ]- \& X! c& M. h
- (entget (ssname sstxt ctr))txttxt (cdr (assoc 1 listxt))enttxt (cdr (assoc 0 listxt)))
- Q3 n9 c) [. J$ M: q5 A' e \ - (if (= enttxt "TEXT")(progn(setq testxt (substr txttxt 1 3))(if (or (= testxt "%%c"). P5 [* h) L8 I* E9 t/ C) W+ g" w
- (= testxt "%%C"))(setq newtxt (substr txttxt 4))(setq newtxt (strcat "%%c" txttxt)))6 m! _) X5 {3 S# m8 q
- (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))(entmod listxt)))5 x% g l \) _% I5 d$ Z# I5 y
- (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))
" {, |1 K5 v* K - , ~) P! F( F) C
- ;=========================== TAM TUONG (TAM) =================================- M3 [# j& n8 L
D( h/ Q' o) I! M) `- (defun c:tam(/ data_m)+ B; {' z2 n0 n) P$ A$ [
- (defun import_data(/ i)(setq data_m (ssget))(if (= nil distan_m) (setq distan_m 110.0))# A" S: e0 K1 m9 R3 s
- (princ "Distance (")(princ distan_m)(princ "):")(setq i (getreal ))(if (not (= nil i))
. o3 e5 w$ V1 h3 x* b/ N ]+ N - (setq distan_m i)))(defun process(/ ent check)(defun p_check()(setq check 0)
9 u! ~) @' V, B8 ? Y - (if (= "LINE" (cdr (assoc 0 ent))) (setq check 1))(princ))(defun p_d_offset
) |7 n. l8 \. R+ W7 F; d3 t+ Y - (/ p1 p2 p3 p4)(defun makeline(/ e2 e5)(setq la (list (cons 0 "LINE")(cons 5 (cdr* b1 n' p5 Q7 J
- (assoc 5 ent)))(cons 8 (cdr (assoc 8 ent)))(cons 10 p3)(cons 11 p4)))(entmake la)(princ)9 `$ L* d. l) b# O/ o
- )(setq p1 (cdr (assoc 10 ent)) p2 (cdr (assoc 11 ent)))(if (not (= p1 p2)) (progn (if
. {+ Z* G t- } m0 h - (< (abs (- (nth 0 p1) (nth 0 p2))) 0.000001) (progn (setq p3 (list (+ (nth 0 p1): I6 t% D& w* r) q; l8 U4 c) d
- distan_m) (nth 1 p1) (nth 2 p1)))(setq p4 (list (+ (nth 0 p2) distan_m)(nth 1 p2)* s/ \* T& _, Q) S
- (nth 2 p2))) (makeline) (setq p3 (list (- (nth 0 p1) distan_m) (nth 1 p1) (nth 2 p1)))
9 R! Y. v' }: l5 r - (setq p4 (list (- (nth 0 p2) distan_m) (nth 1 p2) (nth 2 p2))) (makeline)))(if (<
* J0 z' x9 _2 ` ^2 E! j - (abs (- (nth 1 p1) (nth 1 p2))) 0.000001) (progn (setq p3 (list (nth 0 p1) (+ (nth 1 p1)7 T/ M7 k, a; H, ^, I" e4 f/ c2 g
- distan_m) (nth 2 p1)))(setq p4 (list (nth 0 p2) (+ (nth 1 p2) distan_m) (nth 2 p2)))
1 z5 N! K4 K1 W' q! T - (makeline) (setq p3 (list (nth 0 p1) (- (nth 1 p1) distan_m) (nth 2 p1))) (setq p4
! @+ ` S+ p4 @" ~5 y: j - (list (nth 0 p2) (- (nth 1 p2) distan_m) (nth 2 p2)))(makeline)))))(princ))(if (not: q' F! B' o2 s8 t& ~+ A
- (= nil data_m)) (progn (setq i 0)(while (< i (sslength data_m)) (progn(setq ent (entget7 J" V+ h A) p( w% _$ N
- (ssname data_m i)))(p_check)(if (= 1 check) (p_d_offset))(setq i (+ i 1))))))(princ))
7 f5 W: H/ v u* Z+ Y- W# Z - (import_data)(ai_undo_push)(process)(ai_undo_pop)(princ))0 n; e+ A# |) M; V4 w; @
- ) E6 k9 Z, d9 u! j4 U; n
- ;============ GHI CHU PHI (T1) ================
, |) Z( S9 T3 O7 c. ^# U4 f
, N0 O8 s2 Z: ]! g/ ?. [; N! @- (defun c:DuongDan ()(setq D1 (getpoint " Diem thu nhat: "))(setq D2 (getpoint "Diem thu hai: " D1))
2 c1 N& H9 O: \% l - (if (> (car D2) (car D1)) (setq D3 (polar D2 0 16)))(if (< (car D2) (car D1)) (setq D3
5 _1 T/ |0 X1 ` - (polar D2 PI 16)))(if (= (car D2) (car D1)) (setq D3 (polar D2 0 16)))(if (> (car D2); u1 B- l$ h* Q9 p4 S$ i
- (car D1)) (setq D4 (polar D3 0 3.2)))(if (< (car D2)(car D1))(setq D4 (polar D3 PI 3.2)
6 |! U( |, P; w0 d8 \! y - ))(if (= (car D2) (car D1)) (setq D4 (polar D3 0 3.2)))(if (> (car D2) (car D1))0 U% o. f, L" y) N: w
- (setq D5 (polar D2 (/ PI 9) 3)))(if (< (car D2) (car D1)) (setq D5 (polar D3 (/ PI 9)1 k9 N! q' U [- `/ A, A! f: a
- 3)))(if (= (car D2) (car D1)) (setq D5 (polar D2 (/ PI 9) 3)))(command "color" 1); c) R+ f+ I2 j+ d* e& Q
- (command "line" D1 D2 D3 "")(command "circle" D4 "3.5")(command "color" 7 )
: W7 V. k% w- a1 I* @ - (command "text" "m" D4 2.5 0 "1")(command "text" D5 2.5 0 "%%c6a150")
# x1 p) i' u4 r: c3 z - (command "ddedit" pause))
2 |+ J- I4 {: r+ O, T% e - $ ]4 x# {& z$ q ^% j
- ;;; ========================== Join (J) =================
' L7 o6 n, r, ]( ?, ~5 x - / F' `/ Y/ ?: e+ h' _* B7 c5 u% e
- (defun C:J () (Setvar "cmdecho" 0)(setq m:err *error* *error* *merrmsg*)(setq sset (ssget))
. q6 H2 n; E: |; u+ h9 n9 q - (if (null sset) (exit))(setq kt (getstring "\nJoin all (Y/N) <Y> ? "))4 M, D: a% Q. K7 P$ E+ V8 g
- (setq ssl (sslength sset))(setq temp (entget (ssname sset 0))etype (cdr (assoc 0 temp)
7 D$ G0 h8 s' g8 D9 @; ?- I - ))(cond((or (= kt "Y") (= kt "y") (= kt ""))(progn (cond((= etype "POLYLINE")
9 e4 ^) q! u% R - (COMMAND "PEDIT" sset "J" "all" "" ""))(if (or (= etype "LINE") (= etype "ARC"))% w( T/ O. U# i' O
- (COMMAND "PEDIT" sset "" "J" "all" "" "")))))((or (/= kt "Y") (/= kt "y") (/= kt ""))
|; M9 D! L7 f# Y9 J, {, ^! q: Z - (progn (cond((= etype "POLYLINE")(COMMAND "PEDIT" sset "J" sset "" ""))
4 a# A2 k* D9 A/ I+ L - (if (or (= etype "LINE") (= etype "ARC"))(COMMAND "PEDIT" sset "" "J" sset "" ""))))))
( r) X$ B1 q/ K4 @# j+ {0 i - (setq *error* m:err m:err nil)(princ))
% Z5 x7 g" w, J6 z5 g u - 6 M, p. [' T. y' V+ n% M! k W9 H
- ;=====================================================================
% P$ G( I' w5 z) w& u5 C2 | - ;;; DOOR.LSP 1.0, Copyright (C) 1998 by CAD Department, HUCE.
) v5 F' x5 s; F& b - ;=====================================================================
7 R; I* N T, I2 f& q - $ X. r w2 r2 W) q9 I, }4 M
- (defun C:D1 (/ p1 p2 p3 p4 side dis wid ang angsile old)1 w0 G6 K2 V9 e5 X+ B8 G3 {& D; N
- (setq old (getvar "OSMODE"))
3 e$ U, Y% ]7 L9 c: T! u& b5 m$ M# \. I - 2 K! t, b N9 f0 P; v% C$ b% ^; Y" P
- (setq p1 (getpoint "\nStart point:"))
. e8 s+ A7 m- E - (setq p2 (getpoint p1 "\nEnd point:"))
W5 z7 c4 y+ R5 y# x) i( H - (setq side (getpoint p2 "\nOpen side"))
) \. e! ~( N* s) X N! x) @2 D
k, J6 i4 l6 f" f( w- F- (setq dis (distance p1 p2))
! _/ G; p/ C; e. L8 Q - (setq ang (angle p1 p2))
/ S% e( s& c5 D& Y" n3 L - (if (< ang (angle p1 side))$ E+ o6 l: X4 G, C) F S
- (setq angside (/ pi 2) )3 b* g; G/ v0 X0 y3 _
- (setq angside (- (/ pi 2)))! }9 H q7 J; D9 `5 D
- )
; o2 y. s# G9 C* |3 `) U - (if (>= (- (angle p1 side) ang) pi); I. v/ Q0 Z/ g5 o+ Z1 I& }+ K, l
- (setq angside (- (/ pi 2)))9 `. o, C) l8 g; m. h8 K9 Z9 [/ Q
- )
5 _1 L" {! G* d0 C! g - (if (>= (- ANG (angle p1 side) ) pi): n% V4 W7 k0 i% r
- (setq angside (/ pi 2))2 O8 N ]9 B+ W1 k7 R) t; |
- )
$ \' D4 l& R2 a: J
# r o. e+ `- j& i8 |' O3 ]. Q+ h- (setq p3 (polar p2 (+ ang angside) dis) )3 {" ~6 ?9 a# ~$ i" Y
- (setq p4 (polar p1 (+ ang angside) dis) )
) n% M, o: U2 A- c4 U - (setq wid (/ dis 15))
$ r# a1 P7 v3 `$ {- y1 D( G9 I
K d" Z- d- K1 X! R5 D+ ]# f- (setvar "OSMODE" 0)
+ @0 U6 f5 e" d8 h
Y. {6 g9 r' x- (command "PLINE" p1 "A" "D" p4 p3 "L" p2 $ h, S- I" n" E' Y) Q
- (polar p2 (+ ang pi) wid)
6 O- i) C( b2 V% g5 F8 w$ g/ j; o - (polar p3 (+ ang pi) wid)
" G% E b' P. j: \6 K [0 _ - "")! M& s+ f7 x+ h- m& M
; U- u: W6 B, @3 X- (setvar "OSMODE" old)
a- f+ A2 R a3 { Z# I - (princ)2 X& C; v. \! X7 J2 B# y
- )5 ~5 D% l. Q! t+ _
- & E/ e# ?' t. Y6 L& b3 Q# u
- ;=====================================================================
; h5 y3 E1 Y5 j s6 _, M, Q( {$ P/ R
6 h2 E# Y/ p$ E5 F- r+ ^- (defun C:D2 (/ p1 p2 p3 p4 side dis wid ang angsile old)
: a0 z0 c2 J0 ^5 w$ Z: J3 O - (defun cua1 (pt1 pt2)2 M5 e" g, ], Z! s' A5 L. ^" v
- (setq p1 pt1# m1 C; F8 x3 ~
- p2 pt2)
# t+ w }' M+ R+ U f
9 K& H% d3 e$ E" M4 D. o# n9 Q0 L- x- (setq ang (angle p1 p2)), O/ h6 y1 G5 ?& @' _$ m6 U' {
- (if (< ang (angle p1 side))) W' G$ I. o8 l D
- (setq angside (/ pi 2) )
% D% v, Y+ g7 n) v/ M* p* m5 ]# U - (setq angside (- (/ pi 2)))8 g C5 H9 z: e& {& m0 [
- ). J" D9 H& ?1 ^; r0 e& D2 N
- (if (>= (- (angle p1 side) ang) pi)( B# U( U5 K6 V' U4 r. n3 A9 m
- (setq angside (- (/ pi 2)))4 r- o3 ^+ q. J/ w: ^$ w2 O( _
- )+ U- @# ?2 `, B% t4 I0 K8 j
- (if (>= (- ANG (angle p1 side) ) pi)
7 _) \+ T% M. S2 L - (setq angside (/ pi 2))
3 N" d4 U0 E. B& B* r - )
& P U% ]+ U3 e. ] o v6 d2 K6 K - - l2 h* Q; z# O W
- (setq p3 (polar p2 (+ ang angside) dis) )
; c0 j/ _# b. j5 H8 u4 \+ q - (setq p4 (polar p1 (+ ang angside) dis) )
% |3 m8 m% i, M - (setq wid (/ dis 15))$ t2 s1 J" g! A: @$ v' g3 Y1 I
, C; m- Q7 D! n4 |1 j- (command "PLINE" p1 "A" "D" p4 p3 "L" p2 1 D+ S3 ^8 Q; p" U. I1 b, D
- (polar p2 (+ ang pi) wid) 0 ]( H2 k0 I7 J) S. \3 \5 ?+ R
- (polar p3 (+ ang pi) wid)
: A5 r$ y5 Z( l5 s ^% d - ""); m. d7 c7 c- Q1 z0 Y: q: V! S
- )- d4 g/ g7 E# Z" K! F* L b( l
- ;=====================================================================
6 k- U3 D$ n0 v7 k& h - (setq old (getvar "OSMODE")) 1 {* o. _( S7 w: m
$ o, I2 r7 u% e8 }" m6 N0 T8 G- (setq p1 (getpoint "\nStart point:"))3 O3 I r4 { G7 q
- (setq p2 (getpoint p1 "\nEnd point:"))
5 M) v3 E: ~1 H0 m! z - (setq side (getpoint p2 "\nOpen side"))
( G4 {) H: ]* q+ H+ b/ C - 4 }% f0 y: | R: `9 h/ w- }
- (setq dis (distance p1 p2))
/ J! {, S* R; x# z) L, y - (setq dis (/ dis 2))
/ g- w3 k8 K8 v: k8 H! A0 j4 U/ ~
; V5 A n. Z) F- (setvar "OSMODE" 0)$ B* M$ J( E0 w# A6 g
9 G- x! E+ I3 g: {- (setq p1 (polar p1 (angle p1 p2) dis))
y9 V2 B) c7 k; o+ t5 x - (cua1 p1 p2)
. T6 ^; [9 M) ~ {; n3 g U
# H7 X0 z* I( Y7 k- (setq ang (+ ang pi))3 }; c1 v" R2 o* J2 E# Q
- (setq p2 (polar p1 ang dis))% h6 W! j3 L# ]% D6 t: c8 N
- ; (setq side (polar p1 () dis))
& s2 s3 Q z% I6 W - (cua1 p1 p2)
; A3 x, g8 h* w0 h4 e- T0 m
2 y( X' i+ r P# E5 `! ]- (setvar "OSMODE" old)9 U8 l! ?" m+ v1 Q0 P# v
- (princ)* `; Q" ]/ i$ w6 W
- )
% B: B( T: l1 @- U: l- Y - / P V" W. L. F4 {% k
- ;=====================================================================, b1 S3 e- u4 f7 A6 I
- ;"Glue" text strings. All adopt first's properties.) A: G+ l/ W$ F- D) E( L ]2 y
- ; Author:( |! i- {# b2 ^/ F/ l% S' _/ z' H
- ; Henry C. Francis
* B5 c8 L8 f# f, x- c( S, l - ; 425 N. Ashe St.
2 \# F0 W% p% e6 r - ; Southern Pines, NC 28387
1 l E" z/ x" E; H - ; http://www.pinehurst.net/~pfrancis) f# X6 d: A3 j7 z, T$ S/ @$ D
- ; e-mail hfrancis@pinehurst.net
8 o: x6 v3 F4 B( ~- j/ o. | - ; All rights reserved.1 B2 j3 i1 K4 J4 }5 Q$ ~1 `# H
- (defun c:gst ( / ename ent1 ent2 old1 oldsl old10 old11 old40 old50 newstr newsl new1 new10 new11)
3 o/ r; `2 {* g5 q7 l$ z4 Q8 ?1 A0 \ - (while; y2 e6 U9 \( J
- (not
( x7 G6 Y. ?4 r$ @5 Y1 T% L; ]1 D - (and
- W8 e' J2 N$ ~: o/ C - (setq ename1 (car(entsel "\nSelect first text string to join: ")))3 W9 k8 |% S0 H' `
- (setq ent1 (entget ename1))
( K% E5 D0 `) _! ~* K1 L" M# x) W - (eq(cdr(assoc 0 ent1))"TEXT")
/ h7 A% U5 W1 T1 s0 C/ X5 d& Y- B - );and
@1 s, q% O' _- G - );not
/ d& [) N- h7 W7 Z* @" }* c - );while M R, }- \' O' ?6 C
- (setq old1 (cdr(assoc 1 ent1)))
# T% Y2 O5 ]0 V# k. p5 m8 L - (while2 b6 _3 E% D6 D1 E- _' C
- (not
/ h# i+ _4 G5 {1 u8 N5 w( G - (and
3 q$ g8 l) c: }$ ^ - (setq ename2 (car(entsel "\nSelect second text string to join: ")))1 U+ R8 G" I5 N
- (setq ent2 (entget ename2))5 x. a, A" ]2 x4 r' q, o
- (eq(cdr(assoc 0 ent2))"TEXT")# ?/ @4 j$ h0 d6 I
- (not(eq ename1 ename2))7 m4 |8 ~1 [$ @! g4 _
- );and
5 s- m+ C7 O+ f6 Z - );not+ ~' E' K! m, C( S
- );while* S( p9 L+ Z, c* @) [
- (setq old2 (cdr(assoc 1 ent2)))
6 W$ e" C' |6 t3 x - (setq new1 (strcat old1 " " old2)
. T' R' N* E2 ]# F, j: h! B - ent18 A4 K3 M+ {3 x4 c7 Q" Y( G
- (subst (cons 1 new1)& H) s& Y, g( m, Q5 J4 T
- (assoc 1 ent1)% k0 n! m, K6 i6 j! i( l% F
- ent1)1 e9 |; n2 `! N" h" y
- );setq
- M/ k& w# p4 v) Y2 H. w1 U - (entmod ent1): q: x- {- b+ e/ N( P* ]2 }2 e
- (entdel ename2)0 t9 i8 |3 P( p8 O8 Z5 s
- (princ)3 ?6 _8 r X( H. B
- );defun
( q+ m7 o; z0 f, {( C9 d( Y
3 H5 K& g1 B2 Z0 f3 I, h2 O5 G! ?- ;=====================================================================8 b( x$ C4 e1 }: T7 P
2 N4 W5 ?7 a9 l) z0 z, o' Y- (defun c:nt (/ g1 g2 ss1 olderr nterr l i temp e1 e2 new old dd dc)" L* Q$ }: [# c8 W; X( R9 m' j
- ; a+ F, Y4 s- t6 ?8 y
- (defun nterr (s)' }4 J# a8 j v. P$ n0 a/ h6 `
- (command "_.UCS" "" "_.UNDO" "E")* ^: ]% P5 T$ r; {: D9 M6 s, x0 K
- (setvar "cmdecho" 1)4 x" r/ G ~; y3 S- l- H
- (setvar "blipmode" 0)6 ]; z5 o& h j, A: ?. e' j
- (setq *error* olderr)
. x& p& I# }( ]: ~0 T - (setq g1 nil g2 nil ss1 nil e1 nil e2 nil olderr nil - Q. }" o( j! y1 H
- nterr nil temp nil i nil l nil new nil old nil dd nil dc nil)2 N8 A, g) {# f7 x7 r9 V& z
- (princ)
S }) _) \) [# ^5 q - )' n* G+ P6 q) G% r5 b% k$ F, I) M' G1 p
- 0 Q6 A/ G2 q" c
- (defun tim_in (dt / p01 p02 ktra)
7 ~) c% |) T$ G7 {; T# H - (setq p01 (cdr (assoc 10 (entget dt))))/ _0 D/ g* T1 o8 W+ w& o3 v; @
- (setq p02 (cdr (assoc 11 (entget dt))))
7 y& }9 Y8 [7 M7 N6 X - (setq ktra T)
5 c7 x/ B Q6 c& l6 c - (if (and (> (car p01) (car g1)) (< (car p01) (car g2)) ( c% i$ x8 r% R; d
- (> (cadr p01) (cadr g1)) (< (cadr p01) (cadr g2)))# h1 g5 p3 F" C& }/ h
- (setq ktra nil)% X p+ I$ d: m" O1 }" o8 s L' k+ \
- )5 ~. [+ t+ e3 Z& J
- (if (and (> (car p02) (car g1)) (< (car p02) (car g2))
# w. B6 c0 T5 b. F" v0 w, I - (> (cadr p02) (cadr g1)) (< (cadr p02) (cadr g2)))
; J3 ?0 Z, D [9 S1 e+ l - (setq ktra nil)0 ]8 I; Y0 A6 T4 ~
- )
$ j' V9 j* X7 `' Q1 F4 f - ktra `+ z2 s8 w5 V5 L+ g, s$ c% L
- )% }+ R3 R) b9 Z% b' Z8 H2 n# j& ]
- % T& X4 U; b ^ ?) U$ H
- (defun timdt (dt1 dt2 / p01 p02)
" h/ E# U- B! p7 ~) v+ h+ T - (setq p01 (cdr (assoc 10 (entget dt2))))
. @# ~# q: t; p' W! `4 T6 ^4 Q" D - (setq p02 (cdr (assoc 11 (entget dt2))))) l+ h' c/ F w# x) ^) b
- (setvar "ucsicon" 0)4 X n( s7 F" R2 @# o9 m/ O# g
- (command "_.UCS" "E" dt1)- A0 G+ ^: w# ~* C" \1 a9 l
- (setq p01 (trans p01 0 1))! L+ ~- A' x: v
- (setq p02 (trans p02 0 1))7 G" o8 Z% P9 A- B( d
- (command "_.UCS" "")( @) _6 c4 _! B0 P
- (setvar "ucsicon" 1)
* |6 Z& P3 j# M% |8 s - (if (and (equal (cadr p01) 0 0.001) (equal (cadr p02) 0 0.001))
: q0 T2 \1 S6 R& {1 h ?' B - T
6 `( \) q- v- s7 w" W - nil
! a- k' p6 _% u; i! u, E - )
% O$ t7 I. m8 X2 b9 B* |5 @ - )8 b, o1 W% { }6 D7 o2 ]3 v
+ R( I* S% f/ V/ `$ w% ], O+ K- (defun tim_out (dt / p01 p02 kt)" w+ ?5 I# V4 E) Z' O( q
- (setq p01 (cdr (assoc 10 (entget dt))))
. i1 B0 q* X% `. ^ - (setq p02 (cdr (assoc 11 (entget dt))))/ F. m5 g+ N2 E/ j9 d
- (if (and (> (car p01) (car g1)) (< (car p01) (car g2)) 3 y, Q5 D1 W5 V- \$ B* s
- (> (cadr p01) (cadr g1)) (< (cadr p01) (cadr g2)))
, d2 u: E% M9 {% m - (setq kt p02)3 h1 g: u3 ^7 q! ]
- )6 S% Q! _- n- N4 ?
- (if (and (> (car p02) (car g1)) (< (car p02) (car g2)) & y! X1 A, E, D: J$ g
- (> (cadr p02) (cadr g1)) (< (cadr p02) (cadr g2))). p) }* E, X6 k5 q' f" t/ }
- (setq kt p01)
) [: U& |0 T& @5 }5 T1 l. Z - ): {9 p1 m+ s/ i% J9 P
- kt e4 m( B _1 `- K
- )
' B% x' a! L8 D1 E( ] B
' }6 m& A9 c" P/ B9 w) B- (setvar "cmdecho" 0)
& N. Y7 Q1 V& n" A$ t0 A - (setq olderr *error* *error* nterr)& b7 w: J+ D7 x. F( v3 Z
- (command "_.UNDO" "G" "_.UCS" "")( Z! H: a8 M* C/ ~
- (while (null ss1)
- o9 I* P9 l1 S' ]$ S/ { - (princ "\nChon tuong muon noi...")
5 q; k9 t8 t5 T2 N - (initget 1)* R3 ], b& E- Z
- (setq g1 (getpoint "\n>Goc thu nhat:"))2 d/ w# O! q9 v! O% F* [! Z. y7 S4 c
- (initget (+ 1 32))
% `$ V5 V. Z" s, z - (setq g2 (getcorner g1 "\n>Goc thu hai:"))% |2 D+ U" P# g4 J
- (setq ss1 (ssget "c" g1 g2 '((0 . "LINE"))))' h+ I. f: @' M! n. \- J! h- t
- (if (null ss1) (princ "\nKhong tim thay doi tuong!"))( z8 V6 ]( J- o; I0 l( p1 j( z
- )
1 I4 h1 A8 i5 e2 f - g4 H2 s, P( |9 F
- (setq temp (list (min (car g1) (car g2)) (min (cadr g1) (cadr g2)))# K' Q% n! |6 Q2 Q; x; ?7 y
- g2 (list (max (car g1) (car g2)) (max (cadr g1) (cadr g2)))
, b+ p& W0 T/ f% {! l& v - g1 temp)
# Y F/ s) c2 R( Q: L# t - (setq ss1 (ssget "w" g1 g2))
1 n5 T* p4 X4 |8 w - (if ss1 (command "_.ERASE" ss1 ""))
. l5 K( z; e9 r; b8 m1 ]4 n - (setq ss1 (ssget "c" g1 g2 '((0 . "LINE"))))
+ Y) f& o. R1 Y8 N' y7 P -
! F, C4 y/ b" ` g - (setvar "blipmode" 0). U9 [$ ~0 J3 j) B
- (setq i 0 l (sslength ss1))
1 ~ S2 |- @+ _" ]% q - (while (< i l)
# `1 p8 c! {* D6 s4 V7 p7 m - (if (tim_in (ssname ss1 i))
& _& o' N9 k& g: n0 n8 K! C - (progn
9 Q+ s8 w8 j" J/ ^ - (ssdel (ssname ss1 i) ss1)$ a0 O' x9 T# F7 ^# u6 f9 r3 r
- (setq i 0 l (1- l))8 f# Y; j2 F* f. Z6 [
- ) 0 L; c- p- V5 d( t* U
- (setq i (1+ i))
9 L# k- M& }- V# O+ a4 X - )( I/ N; F' o% e" N7 S' x
- )5 x5 i7 ~: X# ]# J, P# x& v( B2 W
- (setq l (sslength ss1))' K1 d- w" p1 G# T
- (while (>= l 2)# f0 Q4 j( l, h$ ~# O% ~0 T/ W
- (setq e1 (ssname ss1 0)). }4 x, V3 L/ [2 X
- (ssdel e1 ss1): h5 A2 S' [; S: D* F+ T
- (setq e2 nil i 0 l (sslength ss1))$ y. O1 p8 ~2 X' o1 Y
- (while (< i l) & I. Q( `' ]3 D: S! P0 E' D$ q
- (if (timdt e1 (ssname ss1 i))& ]' m" q- o, E/ r; r) W- N
- (progn
+ g9 R' T4 n; r1 `# O* [5 r - (setq e2 (ssname ss1 i))- _9 N) F7 w: A9 w; c
- (setq dd (tim_out e1)); c: R* A9 H) h% q
- (setq dc (tim_out e2))& h9 D/ L* d% a1 f9 Y7 {, `! K4 p
- )
1 ~5 B" [4 H: c" b7 O+ M - )
$ l) _1 o6 S0 y9 F - (setq i (1+ i))1 `7 {- f0 {7 o" o# N. c
- )$ S6 I. q* f7 i8 p4 y
- (if e2 (progn1 |) N7 o; E. U5 J8 H* |) j ?
- (ssdel e2 ss1) $ T* U- A, s6 a+ y; h$ H
- (command "_.ERASE" e2 "")
6 e2 X+ a# X p8 ^8 t8 ^ - (setq temp (entget e1))
7 }: O4 d4 s! m8 _& J% r - (setq old (assoc 10 temp))
& J6 P* f, @+ E0 M& R - (setq new (cons 10 dd))
% u( D( {- e# h; V% L - (setq temp (subst new old temp))
& f0 g6 T/ _+ S7 {0 e R+ h- ^9 Q - (entmod temp)1 W6 O0 N) @9 n/ V; B; k* ?& |" [. D
- (setq temp (entget e1))
% ^- y4 n. }, I5 q% a - (setq old (assoc 11 temp))/ A- w& X0 V# N. R' j6 a+ i, X
- (setq new (cons 11 dc))
- O) Z$ }1 e" N) X - (setq temp (subst new old temp))
+ G- q/ S/ ^" h& l3 R - (entmod temp)8 f- a' t) }: p0 G! f
- (redraw e1), D) f1 m% D$ P% J4 q' t
- (setq l (sslength ss1))0 I" ]" \! W& U0 A
- )
% U/ @5 S) J; H2 g5 C - )
! H& }1 [% | Y2 R \) ` - )
! w2 C4 l* G4 C - + V. n) N' y) D3 \# R( I
- (command "_.UCS" "" "_.UNDO" "E")
) n! @5 o) O& A, t. j - (setvar "cmdecho" 1)
0 r( }$ O+ {( g5 K3 a - (setvar "blipmode" 0)4 P( e/ g- B% R% Q W
- (setq *error* olderr)
( L* n: [" R2 Q t8 {; U; d6 J, B - (princ)- p3 u+ T# C4 D, q
- )
8 J6 ~7 n9 T& N; t- y - ;*********************************************************************- w& C/ A6 u1 ^$ v; v
- (defun ketthuc ()$ i# y z. C8 F- z' W" I' M' Q" Q
- (setvar "cmdecho" luuecho)
- }- ^! r$ q7 j& L- H' W/ E7 K( P5 X7 K - (setq *error* luu' b' Q8 D3 g% {. B
- luu nil ) B0 L' i& o9 g6 e, y
- luuecho nil
# D7 d8 u- {. ^ q, G5 L6 `" ? - );setq( C, Y' k1 y1 K0 f4 o
- (princ)
& u# a) k. b& S7 @' i, i2 r8 Z5 b# |7 b - )
* [$ I) }" Q# E: L& s2 | - ;*********************************************************************
) W2 ^2 l4 t- o5 A h, C - (defun modau ()
0 I8 V4 S; e. l/ P+ v - (setq luu *error" V9 I5 s5 D/ c
- luuecho (getvar "cmdecho")! v/ N/ K6 h( l' f+ Y3 |
- *error (ketthuc)* R3 p0 K! Q: M9 Y- B: X8 V
- )
& O4 J. m. X2 z9 {1 u j- \ - )( _# L q! h) Q6 x- l" m9 S
- ;*********************************************************************
5 }0 J% I( l- s8 p2 ^. E - (defun xulytext (text / kytu ma sokt luusokt lui ); l0 w2 e" |) t* ?
- (setq kytu (substr text (strlen text))# R% m( z N4 g4 z( C$ c7 d" @1 P
- ma (ascii kytu)
8 h l, u Q# O4 `# z3 \ - sokt (read kytu)
3 H% R3 q7 k5 p. _4 s8 e4 E+ f( ^/ w - lui 16 @, E* ~3 `/ \
- )3 h2 u" ^' y- K+ p( ^7 h6 C
- (if (numberp sokt)) I* I7 H; ~+ S" \, @ a, `& v
- (progn
3 ` v1 Z$ u4 }' B' o - (setq luusokt (1+ sokt))
! O! C. C! E, ~! C - (if (and (numberp sokt)
7 \% e/ P5 p8 O; H, V - (> (strlen text) 1)% I3 L$ c1 k" k+ _. _. Z8 G' y
- )
9 g! t7 ?; G0 B- {& _$ j - (progn7 y) r# t V" ~. o4 s6 x* _
- (setq kytu (substr text (1- (strlen text)))
L. _" k! V- g X7 W5 X; a - sokt (read kytu)
2 l( V% s T0 ?. y' G - )
& o7 w$ f% W. Q9 S7 [0 a" H# C7 o - (if (numberp sokt) 4 B4 f( A- q4 x" H) h0 K
- (setq luusokt (1+ sokt)' d, z- s0 I( v# c- ?6 B
- lui 2
, M/ r! }- w4 u- \# f5 q4 A/ | - / r1 @6 E$ Z& F7 ^# ^
- )
! I, v( d5 ~/ t! t/ y: m - )* `3 M$ {: f0 \. Z4 U' I4 y* J
- );progn 1 D1 }% J1 @) v6 Z; n% R& E
- )
, r3 U, A3 S" D7 A - (if (= luusokt 100) (setq luusokt 0))
% ^" R: o; `6 y+ M7 [8 s% l# [" m - (setq kytu (rtos luusokt 2 0)
7 M9 c/ g6 L4 o' O3 V# t -
( U8 z5 Y0 X i8 G; ^ - text (strcat (substr text 1 (- (strlen text) lui)) kytu)7 z( U/ q" }4 d
- )
# t! c7 I, g6 h3 M! y/ [: t8 H - );progn
7 T7 v0 V6 ^* ^! S$ u0 X - (if (or (= kytu "z")
9 `- K$ {7 p& ?' U U; N - (= kytu "Z")
6 Z- a0 r7 s% J8 I - )- D& l7 F! q; H0 p' A- x* Q
- (setq text (strcat text "0")
4 I6 d" X% |0 P, O0 _ - textxl "0"
4 o8 z5 H1 D2 i, {8 ^" r - )2 I' U2 I- [3 C# g
- (setq ma (1+ ma)
, }0 @) R' y }- e7 u6 N e - text (strcat (substr text 1 (1- (strlen text))) (chr ma))" p9 i( A* I2 C! O- \' Z/ _) {
- )
" x: {1 M0 t5 {9 ~2 r - );if
" S( n! T& i j& s& }5 b. N3 E - );if
/ ~: ^3 n: n' ]7 I' P - ), P$ V6 m! G2 @9 k
- ;*********************************************************************
% R- I$ Y6 f# c0 b+ W - (defun doitext(tendoituong / chuoi doituong thoat tam dsach kieu text vitri10 vitri11 dem canle): {4 s5 s- f1 d: T0 [
- ;Neu doi tuong la text thi tiep tuc- ^ `# L- X4 w
- (setq doituong (entget tendoituong)! A8 n% d7 v5 E6 g* b) g6 R! I0 ^
- kieu (cdr (assoc 0 doituong))
) Q, L9 I1 @ L5 v$ ~7 [1 s) Z; P7 U - canle (cdr (assoc 72 doituong))! A' h% V6 X' @7 u# D( ]
- ) 0 C8 M: `8 X- d D) Z$ ?
- (if (or (= kieu "TEXT")
6 Y3 {5 D% P( n: h; y - (= kieu "MTEXT") ' J& N! u3 L8 O5 L6 m$ K5 G# R4 |: S- i
- ) 2 B' u" _4 O- g' {2 E3 K
- (progn
: I9 E! r8 u! e) M) r - (setq textxl (xulytext textxl)8 q9 d& J' a; {- E& \
- text (cons 1 textxl)! a) m/ B* ^0 V9 j
- vitri10 (cdr (assoc 10 doituong))
6 l7 }- y$ L5 u7 {7 w/ G - vitri10 (list (+ (car vitri10) (car vitrilech)) (+ (nth 1 vitri10) (nth 1 vitrilech)))) C, X/ f7 O4 C
- vitri10 (cons 10 vitri10)
: C' @$ [8 z% _/ b# P - vitri11 (cdr (assoc 11 doituong))6 O$ ^# ^! C2 r- q# P; J( T# m
- vitri11 (list (+ (car vitri11) (car vitrilech)) (+ (nth 1 vitri11) (nth 1 vitrilech)))
' G( _/ I1 N( ]: }% v( }) t3 c- [ - vitri11 (cons 11 vitri11)
7 } ^2 ~" \3 u' [# ~ - dem 0
# s' E( R5 Z J+ ^( x- d3 N; p - dsach nil( [1 o& V4 Z H5 G4 g: g9 e& d0 ~
- )/ p0 l5 i! I K3 h
- (foreach tam doituong$ o0 K' @7 z! k$ s: T0 m, f
- (cond+ M. r0 q. R7 X
- ((= (car tam) 1) (setq dsach (append dsach (list text))))
) |% P. L- E) d, a+ W8 C) {0 A - ((= (car tam) 10) (setq dsach (append dsach (list vitri10)))) O; N R/ T: y7 |. ^
- ((= (car tam) 11) (setq dsach (append dsach (list vitri11))))
5 ~ o; y7 j0 d2 M" n - ((setq dsach (append dsach (list tam))))5 r. c8 t1 K- H# U3 M9 W2 i
- )
+ C# z* ?7 A+ T1 u, ] - )
: ?* U; V: ]% A$ B' s - (entmake dsach)5 F2 b7 z; q! M1 I3 }* S5 ~
- );progn8 j( Q! M! h$ w2 m
- );if
7 y% Y$ m w! @3 h - );
$ G: J6 E& }- m. y' d$ _ E - ;*********************************************************************& i6 k$ L. S, U! x
- ;sao doi tuong cu sang vi tri moi1 Y' O3 H/ P, C b& l
- . U4 O+ ]3 @; P1 J) M+ e
- (defun copy_dt (tendoituong )
- f7 o# {! D+ A5 E5 I! }8 V - (command "copy" tendoituong "" goc toi )) ?; X; s" X$ |8 A
- );defun
9 `2 Q# Q3 p- W" n- [' T, c' f
& q, u# |/ k V( l- ;*********************************************************************
% r {& h# Q+ z/ {
8 k' c7 B8 Z; r s6 m2 L. Q4 e- (defun c:ct ( / cumdt dodai thoat dem ten doituong textxl dem goc toi)
]) G2 ]) f. z f - ; Khoi dau cua chuong trinh
+ }: ^0 Y7 ^1 a- P1 P5 Y - (princ "\nCopy Inteligent...\n")
7 d1 q7 M. Q5 c! [9 c! x" _0 f - (setq luuecho (getvar "cmdecho")5 M, l& F8 O* }
- luu *error*
5 s" K- x( Y$ \) z6 |' E - *error* ketthuc
/ b! j4 j$ ?7 x8 Y1 Z$ G- B, G8 D - cumdt (ssget)
d% z2 c+ x, q' d - dodai (sslength cumdt)9 |/ D4 ?5 t* I7 C' ?0 m+ _
- goc (getpoint "\nSelect base point:")
2 c/ _' r" J0 c6 R; [; W0 Z - thoat nil* r$ q* J$ y$ @" n
- dem 0
/ h" B! S U& L1 t m" p - textxl nil
1 ]" \9 p- N: p8 V. X - );6 }) j. S+ z* v
- (setvar "cmdecho" 0)
2 `$ ?9 y) {) c5 O2 P - ; Loc ra duoc ong text de xu ly
6 N6 h) n6 ?% p: S" j6 K - (while (and (= thoat nil)
' z5 q" c0 L& o3 U4 q4 k" ^- ? - (< dem dodai)" \, ~* i8 F8 v. Q$ A# f
- )
" D0 M6 V% r0 {# \) [ - (setq ten (ssname cumdt dem)
; C% T" @& c* w2 ]4 @" Z - dem (1+ dem)4 o+ f+ f% T9 ]# ^. I- c
- doituong (entget ten)! S) C5 T- p/ I6 ^; H4 v! j( W
- kieu (cdr (assoc 0 doituong))
# i$ z5 i1 A3 {- p7 \ - )2 h# K- w! S- [2 Q$ D7 O( f
-
; p- D5 l0 B$ d4 L1 D. W - (if (or (= kieu "TEXT")) G$ { `- V* A7 X% ~4 N
- (= kieu "MTEXT") ( I; F, t& a/ _/ [
- )! @ V8 [1 M6 ~, M
- (setq thoat T3 Z8 E& J' L$ V2 E
- textxl (cdr (assoc 1 doituong)) " }1 x# l+ N. E+ T0 L# }6 C
- )
6 W- K y8 e* ]; U - )& j8 m2 z5 W, }6 M* Q" y# k5 b
- );
; g# B7 S# j6 U- o9 h - (while T
( X9 r" C$ K. Z6 x - (setq toi (getpoint "\nSelect next point: " goc)/ r# P$ ~# ^5 Z/ ]% r$ S% S8 b
- vitrilech (list (- (car toi) (car goc)) (- (nth 1 toi) (nth 1 goc)))
; s5 F6 }/ \0 L - dem 0
* m( d9 l& o' Z3 X0 P& ]- D - )
. R% t5 p" z, w# G6 }$ q, q - (while (< dem dodai)
) i: e6 S9 n& L$ |, e' q - (setq ten (ssname cumdt dem)" |+ E4 R5 S& c1 D& w
- dem (1+ dem)! a( t2 \- M: H' g) K1 j
- doituong (entget ten)
" L' q( N( j o8 [7 S/ i' I# x - kieu (cdr (assoc 0 doituong))
i1 ]! ]) r K S/ l v - )
0 r8 ~. S: O1 h4 n+ T
8 ]: V g H7 e" G8 `9 ~( C# s- (if (or (= kieu "TEXT")
" \9 A$ Z( h4 L. V9 x4 [ - (= kieu "MTEXT") + O3 i* N6 u5 S5 u9 q! `+ |
- )
' h4 K9 @1 C5 r - (doitext ten); m2 `9 t- S5 U" j
- (copy_dt ten)
; e4 N) N I/ O$ U1 {
4 A( Q2 y' E7 `1 u4 ?( p4 N- );if
- E, v& f, N0 \8 D - )
. Z- T& X6 N+ v" x( k3 x - );while' i7 {* H& X/ o( W- F
- (ketthuc)
+ J& n/ e2 V' U! \5 d3 g' i" U - );defun
' s4 b( H( i( g; v - (princ "Type \"DG\" to start")
7 {1 u E$ M5 D - ;Note: bien toan cuc: textxl vitrilech
. Y6 I' k3 s9 J. a
+ V- \1 n8 L% ^& h" x- ;=====================================================================
- y8 o- A, A R {/ [ - ;;; PLJOINFUZZ.LSP4 v S0 i5 T& z3 }( y
- ;;; Joins lines, arcs and polylines using a fuzz distance. W. @* W4 f% }' K
- ;;; If only one object is selected it tries to join to all objects that are possible* E; S: ~& {% p
- ;;; By Jimmy Bergmark
' ], ?: i) I1 ` q" W* I - ;;; Copyright (C) 2003-2004 JTB World, All Rights Reserved
' {5 k) g, \& i4 z' \/ X) H% v2 D7 f - ;;; Website: www.jtbworld.com
: Y) L; A- L/ _$ C7 G6 H" V - ;;; E-mail: info@jtbworld.com; F, A' K* O. y x3 ?
- ;;; Tested on AutoCAD 2002,2004 and 2005# I8 g# V8 X! m7 \! I) n1 Q. V
- ;;; Latest revision made 2004-11-11; ^# U0 @5 u+ ^* m
- ;;; Minor code cosmetic change made 2004-11-137 J9 i: O' l1 _& v* i
- ;;; Bug corrected 2004-12-23
+ [# `% j. Q" V+ f
; `2 @6 w. g& k) w( _5 Z' e- (defun c:jf () (c:pljoinfuzz)) ; this line can be commented out if there is an existing command called jf, O/ B5 {# O# |# h& r
- (defun c:pljoinfuzz (/ ss1 entLine objType oldcmdecho oldpeditaccept fuzz okObjects)
5 M- D A0 \ ~7 f9 E l - (setq oldcmdecho (getvar "cmdecho"))
* i+ R$ e @% o n" m7 h% k& g - (setq oldpeditaccept (getvar "PEDITACCEPT"))
1 s7 p0 G" Y8 _3 a8 M! _+ X, c- b - (setvar "cmdecho" 0)/ M4 _2 s: n% O, x' W! ]9 f4 o* X
- (setq A2k4 (>= (substr (getvar "ACADVER") 1 2) "16"))
4 C$ L; Q/ m0 ? - (if A2k4 (setvar "PEDITACCEPT" 0))
! D# @" z5 R w, J$ X" e - (setq okObjects '((0 . "LINE,ARC,POLYLINE,LWPOLYLINE")))
: o+ ~4 p. D1 [ ~8 S - (princ "\nSelect object to join: ")+ l, j! }+ u% ~- p9 f# z
- (setq ss1 (ssget okObjects))
3 {8 t2 Q6 D! J; H - (setq fuzz (getdist "\nFuzz distance <0>: "))
! U2 {( J7 {$ @% O' N' M5 } - (if (= fuzz nil) (setq fuzz 0))4 o8 c: ]" S( ^. D7 @" P
- (if (/= ss1 nil)3 R' n W" Q6 N8 R
- (progn. I5 H: h: U/ K" j: B
- (setq objType (cdr (assoc 0 (entget (setq entLine (ssname ss1 0))))))
- a; F# [. T0 h, U' h |. a - (if (= (sslength ss1) 1) (setq ss1 (ssget "X" okObjects)))% |, } n3 J" h, H2 [. v
- (if (member objType '("LINE" "ARC"))! E2 t5 s/ T, C, m1 `, k0 I# O- _
- (command "_.pedit" "_M" ss1 "" "_Y" "_J" "_J" "_B" fuzz "")
9 D& l s+ W' E- F8 G9 G. V - (command "_.pedit" "_M" ss1 "" "_J" "_J" "_B" fuzz "")4 f3 [( D! p8 f2 `, }! }& D( f
- )! ^! k& V6 Y+ a O
- )8 K, p4 p9 ?+ M6 t( A& x
- )
3 j$ [8 v/ m" M6 x: x }' C - (setvar "cmdecho" oldcmdecho)1 d, O* i% |3 [" g7 c
- (if A2k4 (setvar "PEDITACCEPT" oldpeditaccept))
9 Z7 J1 o2 s8 z8 v! c3 n, Z - (princ)7 G. j; R! x& U3 t
- )
* ?( X: I" J* q; F) i - 7 f$ Y+ b8 s3 n0 |; b" \
- ;===========================VE CAO TRINH===========================1 p" ~7 L' V4 x6 u! |* ]& |
5 g J+ j% ~4 y* B- (DEFUN C:Cotcao (/ CMD PT1 PT2 PT3 PT4 PT5 PT6 PT7 PT8 NPI TX DX DY TL OSM OLL
% S+ L0 \4 ]# Q# I/ O - CRST RSIZE TSIZE STR PRMT FCH NBC OLDERR)8 l, G0 F* {: M. I7 }
- (SETQ OLDERR *error*
; l7 D. B. ^, U& A4 w0 y3 Q9 M - *error* loisb)
3 _ R% _0 b3 L* O/ I# U - (command "layer" "m" "dim" "c" "" """")
: B1 V, G4 Z3 V2 Y - (SETQ CMD (GETVAR "CMDECHO")) B5 F" W, o# R5 }4 G: R
- (SETQ NBC (GETVAR "CLAYER"))1 z$ b: `! N% ?( T
- (SETQ OSM (GETVAR "OSMODE"))
! D e2 ]3 S4 `( d - (SETVAR "CMDECHO" 0)$ i/ U- n2 m# a" F! |" `& [- s" c3 [
- (SETQ PT1 (GETPOINT "\nDiem cao trinh:"))3 E2 T% Y% ^. n
- (SETQ TX (GETSTRING "\nCao trinh:"))
. y) N3 x: S7 D' K- X - (SETQ FCH (SUBSTR TX 1 1))3 ]- E7 `0 a& B5 V$ H! t
- (IF (= FCH "@") (SETQ TX (STRCAT "%%P" (SUBSTR TX 2 (- (STRLEN TX) 1)))))
5 {8 l0 v, @7 n- }2 P - (SETQ CRST (GETVAR "TEXTSTYLE"))
" s9 v& ?: l& Z2 ~! f ] - (SETQ RSIZE (CDR (ASSOC 40 (TBLSEARCH "STYLE" CRST))))4 J! _- |( l! I* b
- (SETQ TSIZE (GETVAR "TEXTSIZE")). C1 ?9 [& I& i( Z- j: s. [# w% E
- (SETQ STR (RTOS TSIZE 2))* B0 ^( I. S9 a: @
- (SETQ PRMT (STRCAT "\nText height <" STR ">:")). K* j" ]. D: {3 w: O' W+ O
- (IF (= RSIZE 0)$ g5 t7 {, P1 ~: ?& i
- (PROGN
: r5 t! o1 j, O/ H5 i* P( w/ G5 |! i - (INITGET 4)) |! R$ a6 w9 P1 Q" B. {, X/ e
- (SETQ TSIZE (GETREAL PRMT))
3 @+ b3 N/ y& \9 Q) a1 E. s: A5 ~- f: Z - (IF (= TSIZE NIL) (SETQ TSIZE (GETVAR "TEXTSIZE"))* D3 v( |( _; j6 x# u
- (SETVAR "TEXTSIZE" TSIZE))
?4 c+ d0 M9 J& ~4 J) V7 j - )" l! B/ m. ?# t8 N7 h: W0 m8 O. f
- )5 x7 W7 n* a6 G5 I
- (PRINC)) T( O" L' m" ?1 x* i% f# s& y
- (SETQ TL (/ (GETVAR "TEXTSIZE") 2))
$ z2 L/ f! s9 [; h2 l ]/ [. F# _ - (SETVAR "OSMODE" 0)
* [; u' |7 E# f6 H/ c7 a X - (SETQ DX (CAAR (CDR (TEXTBOX (LIST (CONS 1 TX))))))! Q/ V$ [% ?& {- y
- (SETQ NPI (/ PI 2))
$ w- L' M$ _; b. @# {1 Y7 L) x; M - (SETQ PT4 (POLAR PT1 NPI (* 1 TL)))
; @' A7 D' j& i- @8 W - (SETQ PT2 (POLAR PT4 PI (* 2 TL)))3 Q4 _) i3 l( d8 L$ L
- (SETQ PT3 (POLAR PT4 0 (* 2 TL))), @: [# O4 R: {1 E( C7 b2 N
- (SETQ PT5 (POLAR PT4 NPI (* 5 TL)))
n N2 l+ c. s0 W$ y J - (SETQ PT6 (POLAR PT2 NPI TL))
7 P- P! d5 b: D2 m# L8 B0 g - (SETQ PT7 (POLAR PT6 0 (+ (* 3.7 TL) DX)))# [9 m- i7 x+ O6 O7 l/ Q. G9 A
- (SETQ PT8 (POLAR PT6 NPI (* 1 TL)))
; `# |( l6 z+ ]+ ~7 k1 ^) G - (SETQ PT8 (POLAR PT8 0 (* 2.5 TL)))5 Z& P6 V: L' b5 S
- (SETQ PT9 (POLAR PT1 pi (* 2 TL)))
; f% z, n( ~2 q - (SETQ PT10 (POLAR PT1 0 (* 2 TL)))
* }" ~# c4 f2 H - (COMMAND "COLOR" "7" "")
0 J+ x; Q& y6 R5 j5 Z, h. x - (COMMAND "STYLE" "COTES" "Verdana" "" "" "" "" "")
l2 Y2 Q# U, h; C+ F/ e$ k - (IF (= RSIZE 0)(COMMAND "TEXT" PT8 TSIZE 0 tX) (COMMAND "TEXT" PT8 0 TX))
6 Z l- U! c, b - (COMMAND "COLOR" "BYLAYER" "")$ t3 e) `- `% O
- (COMMAND "SOLID" PT1 PT2 PT4 "" "" "pLINE" PT1 pt3 pt2 ""), i. z7 l7 h# a. S/ e* K
- (COMMAND "COLOR" "BYLAYER" "")2 l& B, R" W9 S5 w, B3 c
- (COMMAND "pLINE" PT1 PT5 "" "pLINE" PT6 PT7 "" "pLINE" pt9 pt10"")
9 b% M; R F( v: L6 I8 w - (SETVAR "CLAYER" "0")
2 y" }; T; |6 M- \/ a - (command "ddedit" pause)
# N/ f) Z$ G" @; \* J) e' j) e - (COMMAND "COLOR" "BYLAYER" "")
) i$ n% X/ ~: I$ ?* Y7 E' ` - (SETVAR "CMDECHO" CMD)2 u/ O f' z" T) ?
- (SETVAR "CLAYER" NBC)
8 e6 H# b3 `2 @$ w5 h - (SETVAR "OSMODE" OSM)
z4 K6 J( f, b- a5 @6 ~2 s1 f - (PRINC)/ S! V1 v; D* K
- )
- K2 f1 t3 B$ T) j' c r" U3 }
% }1 ^7 _- i* y7 k) g; o- ;;; =========================== VE NET CAT CHEO (GC) =============================1 z! D4 h+ H! g5 y
- 4 T$ A( j9 j2 D$ r
- (Defun c:G1(/ p1 p2 p3 p4 p5 p6 p11 p12 l ang)6 @7 @3 C- k$ K! w) S- {: }
- (setq x (getvar "osmode"))4 ]' ~' m0 m. N* }( c
- (setq p1 (getpoint "First point : ")% [2 R1 n i |4 q# h5 b
- p2 (getpoint p1 "Second point : "))- n- W. s# M" s, a& @8 }. A. I
- (setq l (distance p1 p2))
+ C t1 D/ k T2 @: \1 ~ - (setq p11 (polar p1 (angle p2 p1) (/ l 5)), g. I* t$ m5 H( S! @. \" X
- p12 (polar p2 (angle p1 p2) (/ l 5)))
/ d1 L: c, y- C8 f, ? - (setq ang (angle p1 p2))
/ a6 k1 F8 h1 F9 W8 f - (setq p3 (polar p1 ang (/ l 2.5))
2 j6 ~- J7 ~+ c% Z1 } - p4 (polar p3 (+ (/ pi 2) ang) (/ l 5))0 ~$ x# x; K) ?7 R
- p5 (polar p3 ang (/ l 5))8 b: R9 ^6 C O M$ q5 s
- p6 (polar p5 (- ang (/ pi 2)) (/ l 5)))- ~8 ?4 S! U( d( n0 ^/ U" R: n$ {7 X
- (setvar "osmode" 0). M0 q* @7 t# k/ ] x3 S# a
- (command "pline" p11 p3 p4 p6 p5 p12 "")
! F* s& c7 T9 L2 u/ i - (setvar "osmode" x)
3 ?$ {2 r, _9 k2 t - )
9 U( m9 `7 ]' [, r8 x - ;----------------------------------------------------------------------------------
3 f5 d* A2 ~: }$ {; B - (Defun C:G2 (/ ps1 ps2 pf1 pf2 pf3 pf4 pf5 pf6' h. i1 e v: _3 M
- pf7 pf8 sb sh se ang old_osmode); (setq old_osmode (getvar "OSMODE"))
, n6 d+ R7 E8 }/ r5 ?6 a. G/ d/ a - (setq ps1 (getpoint "\Chon diem thu nhat: "))
: j7 Z1 q! Z* m - (setq ps2 (getpoint ps1 "\nChon diem tiep theo: "))2 z& n0 H1 U& ]" ?
- (setq sb 50.0 sh 200.0 se 20.0)
2 x; A2 M' N* N) @ - (setq ang (angle ps1 ps2))' j6 N& p( D& [% Z2 m
- (setq pf1 (polar ps1 ang (- 0.0 se)))
/ P" B" s8 ~+ h [# h" e - (setq pf2 (polar ps1 ang (/ (- (distance ps1 ps2) sb) 2.0) )): S0 H% @' f8 H0 x2 V! R
- (setq pf3 (polar pf2 (+ ang (/ pi 2)) (/ sh 2.0)))
+ z7 _2 g$ M8 Z$ \1 m" ^) t - (setq pf5 (polar pf2 ang sb))
% h# P$ ^- l0 [5 I* Y) Q - (setq pf4 (polar pf5 (- ang (/ pi 2)) (/ sh 2.0)))
3 ^9 f; J$ j$ K; i - (setq pf6 (polar ps2 ang se))
1 y( |" }/ b# e - (setvar "OSMODE" 0)/ ?/ b7 h, Q1 ^+ @, V- {: z+ B
- (setvar "BLIPMODE" 0)4 u' d# A' s& Q7 w$ e2 K0 \# A2 C
- (command "PLINE" pf1 pf2 pf3 pf4 pf5 pf6 "")
, ^ ?$ G( s* r - (setvar "OSMODE" 703)0 M1 }* a( |5 [- Y1 |7 A& \( F
- (princ) )
5 h! H# H5 k9 b- b( M# |- {/ ? - ;----------------------------------------------------------------------------------
2 \9 E& y8 }6 p+ P4 } - (Defun C:G3 (/ ps1 ps2 pf1 pf2 pf3 pf4 pf5 pf6
7 s1 N# e! y; a! ?3 _ - pf7 pf8 sb sh se ang old_osmode); (setq old_osmode (getvar "OSMODE"))
; q0 N. C' Z0 j( ?. s! G( R - (setq ps1 (getpoint "\Chon diem thu nhat: "))
7 q) P. G/ n4 X T' E - (setq ps2 (getpoint ps1 "\nChon diem tiep theo: "))
2 M, {9 }: _: B- G% x) l - (setq sb 100.0 sh 150.0 se 20.0)
: o& F X4 Z k5 s- ?2 p: y* f% ]( h - (setq ang (angle ps1 ps2))8 a3 c K, S2 ^6 @# o% @6 w& X
- (setq pf1 (polar ps1 ang (- 0.0 se)))
" ]9 j/ H1 Y4 B0 _1 p - (setq pf2 (polar ps1 ang (/ (- (distance ps1 ps2) sb) 2.0) ))" W0 b& b" V7 _
- (setq pf3 (polar pf2 (+ ang (/ pi 2)) (/ sh 2.0)))
/ e* {7 M% s# m& V7 x/ z! E: a" ]3 { - (setq pf5 (polar pf2 ang sb))7 ~ E( r. u0 s1 C' c
- (setq pf4 (polar pf5 (- ang (/ pi 2)) (/ sh 2.0)))- W0 f# Y( d9 i( ?2 p( A
- (setq pf6 (polar ps2 ang se))- o9 G+ |* @: e6 } m+ r; a2 X
- (setvar "OSMODE" 0)
|1 c5 u6 c4 y1 z0 m8 U2 N: I# o) y - (setvar "BLIPMODE" 0)
; v+ Z) ^: u& Y - (command "PLINE" pf1 pf2 pf3 pf4 pf5 pf6 "")( `% c0 `+ l& ?! x! A3 Q
- (setvar "OSMODE" 703)8 o. ?6 R+ R2 I; M) w `/ @
- (princ) )
8 T9 |: o4 R+ R& }. h - ;----------------------------------------------------------------------------------( V+ m7 E0 q) ]- E
- (Defun C:G4 (/ ps1 ps2 pf1 pf2 pf3 pf4 pf5 pf6/ m% |- r3 H' ?3 R
- pf7 pf8 sb sh se ang old_osmode); (setq old_osmode (getvar "OSMODE"))
, g7 { j4 n* v0 I f% e - (setq ps1 (getpoint "\Chon diem thu nhat: "))
G2 w. y: z6 P, g - (setq ps2 (getpoint ps1 "\nChon diem tiep theo: "))
7 d& u* T# M, W! ^0 D" Y; m8 S - (setq sb 100.0 sh 250.0 se 20.0)8 ^# |! `+ K& t E+ J, B( a
- (setq ang (angle ps1 ps2))
) s3 c: `3 E4 B I o4 d! z/ m - (setq pf1 (polar ps1 ang (- 0.0 se)))
9 R7 M& q+ g- S# X5 h# @ - (setq pf2 (polar ps1 ang (/ (- (distance ps1 ps2) sb) 2.0) ))9 r, t. ?/ k1 K4 n Y# n6 [+ ?0 c
- (setq pf3 (polar pf2 (+ ang (/ pi 2)) (/ sh 2.0)))8 S/ w8 }4 M- A2 Y0 a1 d
- (setq pf5 (polar pf2 ang sb))0 Z; h) q; \+ M U7 x2 |# l
- (setq pf4 (polar pf5 (- ang (/ pi 2)) (/ sh 2.0)))
9 c1 x& t3 @9 Q* j9 L% L. g/ w* }. u - (setq pf6 (polar ps2 ang se))
9 g8 @- s6 d. F/ t2 a& ^ - (setvar "OSMODE" 0)! M- J" K& ~: E; _) f. d K- j! x
- (setvar "BLIPMODE" 0) f4 f1 j0 c; {5 t% V
- (command "PLINE" pf1 pf2 pf3 pf4 pf5 pf6 "")
! [3 E& i5 y8 y0 ?7 K8 [ - (setvar "OSMODE" 703)1 H6 O4 x# C5 S' C" A
- (princ) )1 u3 b- `) J2 N) F) x* V
- 8 r c0 Y4 w$ D3 g; p/ F
- ;==================================================================================" {) T$ J! P/ n3 a- V3 B) G( j
- (defun c:ang (/ ent pt1 pt2 ang)
* o" {' B: E" R6 j0 S - (setq cmd (getvar "cmdecho"))
3 O! x$ s: u% ` Y - (setvar "cmdecho" 1). I( m% t, y1 _: d& m2 `
- (prompt (strcat"\nThay doi truc toa do theo duong thang chon truoc"))
$ o: S. D# \. d5 E. X- \5 s - (setq ent (entsel "\nChon duong thang:"))4 y/ f( {' r0 _- a! @: K0 f8 \* ^5 R
- (if ent & n- v6 g$ V! e7 S
- (progn, }; q9 U! p/ e" C% ~
- (setq ent (entget (car ent)))6 C' q5 n6 `5 ~- S" v+ F
- (setq pt1 (cdr (assoc 10 ent)))
9 ^) \' [/ I1 ?1 R - (setq pt2 (cdr (assoc 11 ent)))
" @9 J5 X8 j# w/ S! @1 H6 {- ] - (setq ang (angle pt1 pt2)): P- x) B$ l u8 {) i$ _: j
- (setq ang (/ (* ang 180.0) pi))/ B6 P p% A2 j2 \5 L
- (setvar "cmdecho" 0)& a1 k4 v& t6 {. B; f: ]4 T
- (command "setvar" "snapang" ang)6 Z5 h5 F% h; A$ a4 j
- (princ "\nGoc cua truc toa do moi : ")
0 \$ q6 X7 [& e - (princ ang)
, \; R" m: E/ k: ^" Y% |" m - )
' ?6 d9 s7 A" y" K - )
/ y) x. S F; ?. \2 d - (setvar "cmdecho" cmd)
+ k5 f0 E. E4 y* o4 } - (princ)
% i1 z7 C e. N, M8 Q7 D - )
. A+ ?2 ~& x H - ;==================================================================================- X3 o: |! V/ i( [* a
- ;============================== KY HIEU DOI XUNG ==============================+ X' v- q# S4 z$ v3 P# P
- ;==================================================================================
8 R& v: v" ~# S! V* V$ ]
( A) d. O7 x, k! _! m! M- (DEFUN C:DX (/ CMD OSM OLDERR PT1 PT2 PT3 PT4 PT5 PT6 PT7 PT8 PT91 y8 P' s1 a5 R' ]
- SZ G45 G135 G90 G180 SS loi)! N& R' P1 t$ Y, U& P
- (defun loi (s)) \5 e9 f5 a$ ? [. v3 E
- (if (= s "Function cancelled")
/ V! X! _* r+ y5 B- }. G - (princ)
9 E7 l# C+ s7 R' {$ h( K5 l - (princ (strcat "Error:" s))
8 G& C$ L. r1 L, r( S4 D& s - )( P) `4 Q0 g9 \8 v) T
- (SETVAR "CMDECHO" CMD)
, Q" A- F$ l7 Z) C7 B. M - (SETVAR "OSMODE" OSM)# _0 I$ V9 e( p* n- P3 S( @
- (SETQ *error* OLDERR) i# \8 ^5 g- L- ^: Z
- (PRINC)
% H# V& O' E* B - ), {2 q1 Y" M( m: U
- (SETQ CMD (GETVAR "CMDECHO"))9 m, b" }) {4 O! T' E" b
- (SETQ OSM (GETVAR "OSMODE"))
% t5 ?3 N; w; y1 i% s' S - (SETVAR "CMDECHO" 0)
0 T. S6 W8 i% K9 i/ i - (SETQ OLDERR *error*% ]$ \6 N# Z, i& c
- *error* loi)$ P$ I2 j' @; B$ C1 b' d6 E$ X" F
- (SETQ SZ (GETREAL "Size <1>:"))5 ?1 H' x9 o2 `7 H: `9 p m
- (IF (= SZ nil) (SETQ SZ 100))5 d7 ]9 n# D4 Q" q. u. r
- (SETQ G45 (/ PI 4))
4 G0 p+ g* \3 E: Z - (SETQ G135 (* 3 (/ PI 4)))
5 F5 q* `5 b7 K" I - (SETQ G90 (- G45 (/ PI 2)))
5 S5 N, h o: s - (SETQ G180 (+ G135 (/ PI 2)))
% u' }6 R( [) z/ W% g4 F - (SETQ PT1 (GETPOINT "\nDiem doi xung:"))
y+ s( l: f, e/ D6 s( _ - (SETVAR "OSMODE" 0)
/ ^) _! k! n1 f9 A L$ n! t - (SETQ PT2 (POLAR PT1 G45 (* 2 SZ)))$ \: s$ a) w! U2 e
- (SETQ PT3 (POLAR PT2 G90 (* 2 SZ)))
$ ?4 }/ A, g2 T! @' i - (SETQ PT4 (POLAR PT1 G45 (* 1 SZ)))' [" F6 W. j8 B) [& L
- (SETQ PT5 (POLAR PT1 G135 (* 2 SZ)))
( K# E2 p3 z/ i4 U L: o) X - (SETQ PT6 (POLAR PT5 G180 (* 2 SZ))); d+ j) B y" H3 b
- (SETQ PT7 (POLAR PT1 G135 (* 1 SZ))); h9 L' w, ^7 `9 v. O: F3 Q
- (SETQ PT8 (POLAR PT1 G45 (* -0.7 SZ)))1 z( W1 {6 x8 I# K, x. R
- (SETQ PT9 (POLAR PT1 G135 (* -0.7 SZ)))
$ k$ Q8 D7 ?' Y1 f6 @* _ - (PRINC "\nGoc quay:")
7 _9 L: l1 K' w! }5 Z: s8 ^9 j - (SETQ SS (SSADD))
1 m/ ^2 d9 I- J( Q6 } - (command "layer" "m" "Dim" "c" "" """")) ~* ?% v! m& L; e: Z9 j6 B
- (COMMAND "COLOR" "1" "")
5 v S+ b" j* g- ?! s - (COMMAND "LINE" PT8 PT2 "")
, p# L6 f7 I* R+ q: I - (SETQ SS (SSADD (ENTLAST) SS)); J1 x& ]1 x: o, u# T8 b+ b0 g( s
- (COMMAND "LINE" PT9 PT5 "")& p9 t6 l( V, q& Q1 c# i
- (SETQ SS (SSADD (ENTLAST) SS))
( C$ _ v; s8 A# }! C - (COMMAND "COLOR" "1" ""); \3 F& J7 }+ k. W% y9 [
- (COMMAND "SOLID" PT2 PT3 PT4 "" "")& I; K" x3 H% z7 I! i% \ K9 z
- (SETQ SS (SSADD (ENTLAST) SS))
4 f) E$ N. C; Q% I* L1 p* B - (COMMAND "SOLID" PT5 PT6 PT7 "" "")
6 a8 o% {% R7 q! a9 Q1 d - (SETQ SS (SSADD (ENTLAST) SS))4 i! J" q% b ^! n' R4 a
- (COMMAND "ROTATE" SS "" PT1 PAUSE)
4 H5 @7 z8 ` l; N% E - (COMMAND "COLOR" "BYLAYER" "")
0 ?" W4 Q9 x w# h! a& R2 P - (SETVAR "CMDECHO" CMD)
8 g- T4 J: K% ` - (SETVAR "OSMODE" OSM)2 T T. k4 y8 s8 G/ \3 Q
- (SETQ *error* OLDERR)! j x' O. e! I7 X* M# i
- (PRINC)
( ^- G. y" X0 j0 l, d2 ^" g% n' d - ) U8 [1 x6 a% Q
- # S) ^; V# `0 z$ j. E/ ?. e0 T+ ?
- ;==================================================================================; ~ T% u( k$ {5 a) _- Y0 p
- ;================================= KY HIEU TRUC ===============================# ]! R) J A1 U! O1 f
- ;==================================================================================
' x: F8 [# G5 b2 M4 J) P6 |
' J" f+ ]0 l4 t' f' ^0 ^$ I# P+ b- (defun C:vetruc ()
7 }0 ^0 }6 T$ ~' d0 | i$ j - (setq bk (getvar "USERR3"))0 W9 {& z, q& C, c& N+ T3 T
- (if (= bk 0)
0 c$ O# N- G* j& I0 `* q - (progn
/ z+ e$ B. w* S. z: P2 a - (setq cont "1")* J* L$ G* H# D( B' A
- (setvar "USERR3" 1)+ l( D& u, h: Z$ K& J2 d
- )4 I# B8 y% ?* B' D4 d& O( B
- (setq cont (rtos bk)). f f& T5 S2 P: i+ l& ]
- )/ H* W c' Y2 {$ ~8 D- G- f
- (setq pt1 (getpoint "\n Nhap diem dat:"))" j$ z+ r" r9 \$ D; y% ^ r
- (command "layer" "m" "Dim" "c" "" """")- h% _( s, J3 b; ~
- (command "osnap" "")& O8 T$ U! g0 p1 f; j' F! [( y
- (COMMAND "COLOR" "7" "")5 ~" W* @% ?. q6 U8 B: ?& `
- (command "circle" pt1 150 "")- V( M& ]: I; C3 ?% _
- (setq pt2 (polar pt1 0 150))
/ @5 |5 ?: o/ k" l - (setq pt3 (polar pt1 (/ pi 1) 150))
" u' Y5 u) D4 f9 F - (setq pt4 (polar pt1 0 300))
# A3 K* b I$ F3 z/ E" t$ Z - (setq pt5 (polar pt1 (/ pi 1) 300))
( C0 W+ S+ ]% A: P; b+ s0 q& N - (setq pt6 (polar pt1 (- 0 (/ pi 2)) 150))
$ J6 D. w, ^" ^' g% ]% o; I - (setq pt7 (polar pt1 (- 0 (/ pi 2)) 300))
5 ]4 c( H8 t0 Z" P9 c4 m - (setq pt8 (polar pt1 (/ pi 2) 150))
5 w1 Z9 z! t% D7 e - (setq pt9 (polar pt1 (/ pi 2) 300)), `$ `+ u a3 \) K( }
- (setq pt10 (polar pt1 0 150))
# q* E$ i2 n! _7 ~/ b/ u* v - (setq pt11 (polar pt1 (/ pi 4) 150))8 P/ f) u+ @7 K0 a0 [
- (COMMAND "COLOR" "BYLAYER" ""), N! D; p5 F# |
- (command "line" pt2 pt4 ""), |+ a1 P: w( u+ I
- (command "line" pt6 pt7 "")
3 X' k* V5 m: e U% e - (command "line" pt3 pt5 "")
& t. N) L' i# z, ^) d3 [* K/ j, ~ - (command "line" pt8 pt9 "")
0 A0 U! p( M3 M% ?; S/ @3 R' ^ - (setq dk (strcat "\n Size:<"cont">")): P; m9 n: j% v( T X7 j7 z- V
- (setq bk (getreal dk))5 A" P- \9 [& t+ {/ o0 A- F) y
- (if (= bk nil)
7 K' j$ {! A* E Y Z9 R - (progn0 Z# _" p' Q- Y) y |! u* T9 Q! }
- (setq bk (getvar "USERR3"))
9 E- s9 x, Y3 X( m( m - )
# O$ e4 v ^; w, q2 V. v - (setvar "USERR3" bk)
$ a! I1 p: D# l3 v - )% M6 V4 Z9 u/ S- V
- (command "scale" pt4 pt5 pt7 pt9 pt11"" pt1 bk""). ?! Y9 P6 s! {4 X, @9 K
- (COMMAND "COLOR" "7" "")
# d; i0 o3 U8 r& i, P$ m" Q' w - (COMMAND "STYLE" "Truc" "impact" "" "" "" "" "")" L) L4 B3 v1 h/ V7 ?" w+ E( I
- (command "text" "j" "mc" pt1 (* 150 bk) pt10 "A" "")
1 h) Q5 M, f+ b8 v9 r8 H) e - (COMMAND "COLOR" "BYLAYER" "")8 L3 |5 j# j0 [ Z9 `- M. m
- )
4 h3 i9 m8 g/ X% h3 V - / z: d5 J' F* V5 ?0 J$ Z
- ;=====================================================================6 a' o/ _4 X( o6 o. ] x
- ;CA - Reverses the case of text. (Upper to Lower and Lower to Upper.)
|) E: ~* T# r/ | - ;0 U0 \. t9 R( \2 [$ ^5 D/ I \
- ;Jeffery P Sanders
" m% w, H$ T {; e - ;6 K$ P8 y8 M/ P" ^5 B" s9 n- y* Y
- (defun C:CA(/ en enlist tx newtx cnt tp asc note)
2 A! E2 k9 Q& t% J9 y- l0 F5 r - (setvar "cmdecho" 0)
2 J9 q: t1 t0 e; J4 e& e& r' l. S - (if(setq en(entsel))
! k T# ~/ J+ d- N - (progn6 x2 y* e5 w; T8 o
- (setq enlist(entget(car en)))/ V, K6 h$ B& h) _
- (if(= "TEXT"(cdr(assoc 0 enlist)))! X. {. Y, a$ X5 u. H- B
- (progn& `& Q/ ]5 p3 T2 G. P0 Y3 K9 k
- (setq tx(cdr(assoc 1 enlist))
5 E" V" Q, N9 V9 Z, `4 R) Q - newtx "" cnt(strlen tx)2 z; z0 V) h2 J% _. c( ^
- note "\n...CASE Reversed. \n "
0 d- Y; X9 \0 F& K5 b3 q - )
1 {1 d# j) }% I# f! g5 l - (while (> cnt 0)
% n" @5 r: R o1 O( T - (setq tp(substr tx cnt 1))
( |# O- R/ Q& P) O6 g, y* F - (setq asc(ascii tp))
2 v$ t6 J6 S! O! V9 P8 t - (if (> asc 96)' H4 d+ x. q& N3 q
- (setq tp(strcase tp))4 z9 S% \; o8 Z6 F. V8 x: W7 R
- (setq tp(strcase tp T))8 y% B, P' o" Y3 w
- )
) _, `: u. L8 k& E/ n7 K$ e - (setq newtx(strcat tp newtx))
. r0 b0 M M2 G: a1 J) ]( s - (setq cnt(- cnt 1))
1 ?; `% J. e0 P - )! Q' `7 t) z7 \7 L* j) _3 ]
- (setq enlist(subst(cons 1 newtx)(assoc 1 enlist)enlist))' u, \) h+ r+ Q% r6 @+ r! U% G
- (entmod enlist)2 Y1 G7 ]$ S. [8 m: \) g
- )$ x2 e6 F: {' `1 B" l* U O" S- e
- (setq note "\n....Text Only Please. \n ")- S( L* P ]; s1 ^/ w9 x3 |
- ) r8 V) L. m' x9 u
- )
* Q6 F4 ^: G5 A" L3 M0 Q$ _; c - (setq note "\n....Nothing Selected. \n "): f) w/ K' A) w8 W
- )6 g7 d6 Z7 G; ^4 |
- (setvar "cmdecho" 1); m# z# _0 `7 s4 m% k1 G( J
- (princ note)+ k: g7 p0 O0 S" `, X
- (princ)! L. v4 t [3 o9 P: ~6 E
- )0 N% C( [! B' p# [" a* ^; ~, I
- 0 d% ~7 x& V$ ]0 \. i H A
- ;=====================================================================& ?& S# c0 X6 K; C& `. q
- ;==================== NEW TEXT STYLE UPDATE ==========================
# T+ t; [+ t) h6 g - ;=====================================================================8 e2 N9 Z# J) ^6 Q
- 0 P/ _+ R3 l( C! M" H/ D" G7 `9 f
- (defun c:nS (/ tdt ssdt sodt index)
$ j* s. R1 f6 I/ B3 z - (defun ObjName (ssdt /)
, z5 R) k% {- r. a - (cdr (assoc '0 (entget ssdt)))
& R- k, j( q6 M1 G - )
# c" J7 E: h# l' J( ?1 W - (defun MoPL (ssdt /)
6 ^. \3 j9 o; U5 @1 k. d - (= (cdr (assoc '70 (entget ssdt))) 0)) a/ {: m' k0 |
- ); @ s2 V# c4 |6 u( B
- (defun NoiPL (ssdt /)0 q( h( H) d0 l5 ~7 O
- (if (MoPL ssdt)! Z% q/ p, _6 V
- (command ".PEDIT" ssdt "J" "All" "" "X")
. z/ J, H7 n/ p2 P% x# C1 J - )
- m* i; k# q9 e* ~6 ]8 D* t - )
) ~% ?6 F0 m* G7 T+ `, Y j - (defun NoiLC (ssdt /)
; \% l5 x# _' H" m0 o7 X" \ - (command ".PEDIT" ssdt "Y" "J" "All" "" "X")3 a. O( L! p( |8 }
- )$ w# M, x3 k$ g- w" H
- (setq0 n5 z6 P& h0 S$ `% _6 x
- tdt (ssget)+ O8 Q2 |! I! S3 h( w
- sodt (sslength tdt)
9 B) {8 C5 n2 V - index 0
5 I1 t+ Y& h! V2 `, M - )
: Q4 K: X& R* c8 W6 w# j - (repeat sodt: I3 O! q4 W& I4 L% s2 i7 c
- (setq3 t, D3 g' [! V! F- S5 R
- ssdt (ssname tdt index)
% z9 f' p9 j; u3 t! u4 M6 _ - index (1+ index)) J' i4 M: H0 s- v2 f/ ]4 G
- )$ f8 T8 }' o9 {0 o
- (if (or (= (Objname ssdt) "LWPOLYLINE")
3 K6 n6 f5 K1 M7 j% z6 ~ - (= (Objname ssdt) "POLYLINE")
8 u! S0 {* t/ ]5 R4 e) G9 e - )
* h# B7 X6 Q2 }" s V - (NoiPL ssdt)( z x* r( K$ Z; O
- )- N! A+ U$ j( G b, f
- (if (or (= (Objname ssdt) "LINE") (= (Objname ssdt) "ARC"))+ w2 c6 V6 \; \
- (NoiLC ssdt)
6 { J* W! @% a- A \ - )
0 \+ i$ n+ F) H! O7 R - )2 b- |. R4 S: W0 {1 y! {7 P
- (princ)% I7 g$ g# p7 E: X. [4 r. R
- )
5 N F9 g; Q% D( N( F. X L" J
# M4 z2 D2 J$ T/ Y- ;=====================================================================/ F. l1 O. R+ M! |
- ;;; AREAM.LSP$ ?5 c7 E6 Y9 w. j
- ;;; Function: Calculates the total area of selected objects2 M# m% _7 d, k" q; \% A
- ;;; By Jimmy Bergmark
& q6 V4 R ]& N6 e! [0 t: p9 [9 L - ;;; Copyright (C) 1997-2006 JTB World, All Rights Reserved- G \8 u- i$ u
- ;;; Tested on AutoCAD 20005 `9 r V- R5 w3 H" n
- 0 s8 Z" Z9 U. D0 B H
- (defun c:ea (/ olderr oldcmdecho errexit undox restore ss1 nr en tot_area)
: q: _% P4 n4 S! V - (defun errexit (s)0 _1 t4 [' W# J3 ]
- (restore)
: ~* C, r* m- K. c- J! P5 M1 F - )
- r9 e" ?" {4 A9 a2 ` - * }/ p" ~- z S, g
- (defun undox ()+ @/ G4 O- D9 H
- (command "._undo" "_E")
8 W2 y u* G! ]! c9 L# O - (setvar "cmdecho" oldcmdecho)
# E2 m5 J/ L* x - (setq *error* olderr)9 O/ z$ p$ [" `/ o: r
- (princ)
7 I! A7 \6 y* M5 |, d: U - )% U6 U8 ~% ~- K3 a
) S2 r! d3 ^, m! }; x- (setq olderr *error*1 u8 g' ^ ~$ [; ]! n
- restore undox3 c. ?6 }/ K/ v3 x
- *error* errexit6 h2 ^' R9 s. U0 ]4 [! G# A$ K0 v
- )0 G/ M# @' s; g6 a3 R5 X; [. P
- (setq oldcmdecho (getvar "cmdecho"))% W i `3 G$ b3 K
- (setvar "cmdecho" 0)
2 Z- S! ?1 H* e+ M$ w1 \: L: _( ?: P - (command "._UNDO" "_BE"): c4 _/ i8 x) U) M) }& U) z7 S# m
- (if (setq ss1 (ssget '((-4 . "<OR")3 w, \; z3 o; c
- (0 . "POLYLINE")/ I6 x; K& M, t0 L; X3 }8 i+ X# T
- (0 . "LWPOLYLINE")
$ P9 @( q; n/ u8 f - (0 . "CIRCLE")4 n4 D! ^! W1 K7 H, o
- (0 . "ELLIPSE")
( X9 n4 b( K8 r0 j% R2 [4 E - (0 . "SPLINE")
( G/ Z4 U$ a5 S0 P+ U. J8 O3 x - (0 . "REGION")% Z: ^1 P4 T) [0 l# t7 Z
- (-4 . "OR>")
, @$ D+ \! g* ?5 @ - )
/ @7 ^& }9 f* V5 p( ?2 ^; t - )! _2 K# E+ F' Z# D" u* b$ L
- )( H7 z; S' F$ P/ q
- (progn# K1 j! z, F) N8 {* Q
- (setq nr 0)$ l. Y( b, }4 b* ^ h) o
- (setq tot_area 0.0)9 _' U& \8 s. ^' N. @* t* O6 c; I
- (setq en (ssname ss1 nr))5 [) i& W, j+ Z" d3 U
- (while en0 C# J# g) A" t0 B$ L2 Y( ?+ k
- (command "._area" "_O" en)) W# L0 F3 w0 U! |' \5 K6 _
- (setq tot_area (+ tot_area (getvar "area")))# r% v+ A0 N3 Q8 w) x$ I7 a l
- (setq nr (1+ nr))
! F% u" m# {- P# U - (setq en (ssname ss1 nr))
5 u% N5 [8 K* B5 P! c - )! B' z' o8 l" U+ h9 Q4 K/ u
- (princ "\nTotal Area = ")
8 W. P2 g6 B$ b* j - (princ tot_area)" P% E+ i. C! m: t5 q3 y) I
- )) @: _+ a; _$ s& q' T2 Q- }
- )
3 a. H& m7 h5 b3 C0 L: D" w - (restore)
5 a8 }+ v1 B$ U. w! P7 U - )
: `* g' Q3 q, O% G - 6 V+ a N5 R$ j. O6 `
- ;=====================================================================) P5 H! A# I& [% ?: ~6 c
- ;;; By Jimmy Bergmark" Q5 o! i! J- @9 q' D, w
- ;;; Copyright (C) 2008 JTB World, All Rights Reserved
& N0 L2 o. J9 n- d% P& A' g - ;;;
; J9 v% I, Y" f2 B - ;;; Created: 2008-03-31
4 n& |5 [' O/ m. ~4 \9 _ - ;;;; b/ b" S1 R T% {" B
- ;;; Convert Attribute definitions to mtext
8 L. l0 X' G( m( ~; u' x4 g - ;;;" H* a' n# i4 X
) w! P2 ?' e6 n2 R! X" f- (defun c:ATB (/ eset1 blkcnt en enlist tag1 ht pnt vl space)
' O5 i7 }$ Z. |5 L8 w - (setq eset1 (ssget (list (cons 0 "ATTDEF")))# \1 w) y3 s$ Y: u0 Y: n
- blkcnt 04 y [ S" v5 l3 i
- )
4 n6 a% j- T" \4 _0 f2 y
+ Z# J( Q+ Z2 W6 Z4 O. Q8 ~- (if eset1, H7 d& R3 Q, t' a+ d9 a) b
- (while (<= blkcnt (- (sslength eset1) 1))
, D& _4 q5 T0 O" R5 U6 j - (setq en (ssname eset1 blkcnt)
5 @; k' ?; G. c6 M - enlist (entget en)2 Y6 @( d( a% _$ b9 P' h
- ht (cdr (assoc 40 enlist))5 t& F8 `0 P& G
- pnt (assoc 10 enlist)
) f) {* k: U* J( Z+ n6 s# J - pnt (subst (+ ht (caddr pnt)) (caddr pnt) pnt)
1 S9 x5 N) x8 g' ^ - space (cdr (assoc 67 enlist))' J( `# q/ C9 e/ z1 v m0 K
- )
5 j3 n$ \4 M- q# x% a5 j. Z - (setq vl (list j. K$ Z7 o1 P9 _ N( u' P
- (cons 0 "MTEXT")! V3 ]' v" P/ W9 g+ S
- (cons 100 "AcDbEntity")# h; |7 ]' H. d0 s/ Z B$ h
- (cons 100 "AcDbMText")5 A. z% P$ ?$ H) k) N
- (assoc 7 enlist)) n) m; L6 I8 Y/ n1 ~, ~
- (assoc 8 enlist)/ y, Z& m- ^; I& A0 ?
- pnt5 Z& O1 o- O5 ?# \1 Y
- (assoc 40 enlist)& a( P. F( l+ ]+ a6 e8 ?5 Z
- (cond ((assoc 62 enlist))
, p& x6 u. Q: c( e" R2 t - ((cons 62 256))
1 q" i+ B7 k/ @# e( O - ); [! L( z. J; Q
- (cons 1 (cdr (assoc 2 enlist)))
+ X& A! J: z# K* H0 {% g! U - (if (= space nil)$ H1 _" m6 Y y& Z* A/ g8 \
- (cons 67 0)
- P5 J& `( ^# m* U( a/ ^) p - (cons 67 space)7 O+ c) V" \8 P) n
- )
0 d4 r3 G# I& {# y( K - )
4 j# U; f! X q6 W( Y, R9 W - )
, |# x- ~6 @* G9 M a! V% { - (entdel en)8 f$ g. D' S5 C4 o. q t# s
- (entmake vl)
6 b9 i- q' R3 b0 s E. ]2 f% v - (setq blkcnt (1+ blkcnt))
1 y: s: b; Q( F3 `) L2 ~ - )4 Y4 V' I+ C' i( d& q3 M
- )# ~6 s7 m8 D; k' R. e7 B
- )+ M! C9 y- L& N* H0 P4 p' P
- O) X! G" ?' F: d
- ;=====================================================================9 c+ J6 M0 G* U" f1 h' I$ v' s
' p0 ?8 g* ^* R/ Q1 z! l* M- (defun c:xxx ( / cumdt dodai thoat dem ten doituong textxl dem goc toi)# U/ d0 N* h( `
- ; Khoi dau cua chuong trinh
' R V5 r# t4 I - (princ "\nCopy Inteligent...\n")
$ b, {+ @# k% Y1 K% _; } - (setq luuecho (getvar "cmdecho"). a/ [! B' D: E; S: Q Q6 K; X
- luu *error*
. ^3 Z% Y3 P0 d* T/ ^0 p b - *error* ketthuc
C- v5 Q% k' k& d; @7 R - cumdt (ssget)
6 D& T4 {& R$ m, W& |6 @ - dodai (sslength cumdt)
! E3 z" r8 I8 x% R+ L: h - goc (getpoint "\nSelect base point:")
% L2 h. k5 H' a - thoat nil. Q2 P* |' k- n7 ]4 u2 Y& B5 o" [
- dem 0& k7 u" b3 }) j4 ^* w% k. u0 r
- textxl nil) k6 a Y' Y7 \' ^! y% A/ D
- );- M4 B+ {4 i% k5 ~1 q
- (setvar "cmdecho" 0)% F! _8 {2 x, W
- ; Loc ra duoc ong text de xu ly# u" \7 r+ x/ E0 @" U; k
- (while (and (= thoat nil)0 p$ L& C) B& Q [, ]6 y
- (< dem dodai)& S# H% I1 ^5 ] s- i
- )
' ]0 ?9 Q2 z: ? ~* V# _ - (setq ten (ssname cumdt dem)
* R# ^$ ]/ I1 |6 c$ l - dem (1+ dem)
7 K/ X3 F+ P% {0 U$ N - doituong (entget ten)* `% X9 q' y6 c: ~) o; p* U
- kieu (cdr (assoc 0 doituong)) 5 |/ A- |+ B2 R1 O
- )9 W* n- m! a9 Q$ s: C* F
- 4 y6 G2 g" ]! \4 S+ Q2 p" _
- (if (or (= kieu "TEXT")* b4 H% q }# r6 ^
- (= kieu "MTEXT") 6 o7 K6 Q, P& y# h
- )4 E0 z9 \) P5 H7 l) A3 q
- (setq thoat T
% N* {, d+ ]$ _7 q+ k - textxl (cdr (assoc 1 doituong))
+ }4 J: K) }" j: a8 M# ~ - )
+ ^7 H% ?9 l, P) G! a9 S& ` - )
) ? i# W" k8 W, w- V4 C& q- m - );. N3 M. b2 Y: v7 R$ f$ i4 @# {4 B
- (while T
! Q) W. D/ l* k) @$ _( m - (setq toi (getpoint "\nSelect next point: " goc)
4 J% i( U8 u/ [8 _ - vitrilech (list (- (car toi) (car goc)) (- (nth 1 toi) (nth 1 goc)))
4 d% F' U) m+ S' j - dem 0
) W, h" L9 [+ \( G+ }) L - )
! e2 w* v0 Q# V/ v - (while (< dem dodai)( k1 u6 y/ g4 P9 ^$ N% s
- (setq ten (ssname cumdt dem)
N; J/ ] \, t' q4 |) i9 I - dem (1+ dem)( U$ ^& Z& ]9 g6 S
- doituong (entget ten)
8 H5 w7 G$ H! m, p/ j6 e/ ^; s! R - kieu (cdr (assoc 0 doituong)) % P( b1 W3 M x4 R8 v& \& K
- )
7 v3 a+ `7 [$ g+ y - . [5 z4 G! W2 ^# z6 f
- (if (or (= kieu "TEXT")$ o! _$ u: ?# }3 B; p% W. o
- (= kieu "MTEXT") % n( ? x3 F6 c* \# p6 o
- )+ C7 B9 P1 i8 f+ L7 j; c( ^; D
- (doitext ten)
) w; X' V% G" J: i x y - (copy_dt ten)' d5 k) S. U6 t
- ) L6 H( j- ~) @. s- B: E7 b! \
- );if$ a3 U, i/ I* w5 S8 q
- )% o: t5 `& a! A( ?
- );while5 B' t; W2 T5 R. |8 j0 x4 y2 g3 ~
- (ketthuc)5 J( g6 [: r0 P: D% F
- );defun
2 U! _* ^6 `* ]; e: U+ D9 L, T - (princ)" U' g1 z( y+ x4 \3 b. Y+ v
* G; q% `/ K6 J# o6 R5 U- ;=====================================================================
% S- b/ y3 y; P( U - ;;; By Jimmy Bergmark
, W5 V- l1 H0 d7 x8 L7 e - ;;; Copyright (C) 2008 JTB World, All Rights Reserved
( f5 W0 t/ Q# K - ;;;0 T3 Z4 W7 _4 a8 T
- ;;; Created: 2008-03-317 ?6 ~2 I0 L# v7 R- x
- ;;;
! f4 z0 r0 i7 F* _4 I - ;;; Convert Attribute definitions to text$ }2 C) z0 L8 V( ^; u
- ;;;
' I: Z5 s7 [: P; ?+ h" E - p' R! ?! e% s& v8 E* Q
- (defun c:ATT (/ eset1 blkcnt en enlist vl space)
$ Z* Y1 m. L- o. r& g) ?7 B - (setq eset1 (ssget (list (cons 0 "ATTDEF")))6 v+ B: i2 S' [, e! O5 ]. U
- blkcnt 0
$ @) t" o h+ x* M( _ - )
/ `. E2 _ ~4 v( l) C5 L
I$ ?7 _$ h; v3 F- (if eset1! p- S; |9 `5 v( O& Y# r6 X! V
- (while (<= blkcnt (- (sslength eset1) 1))
$ f0 u" Q+ a: X% ~ - (setq en (ssname eset1 blkcnt). [1 `$ B1 Z& g# T/ r
- enlist (entget en)
+ Q' E1 {, }% P - space (cdr (assoc 67 enlist))
- J9 Q) E" P/ z$ B6 i9 a - )
0 q" ?! A0 s6 U. _ - (setq vl (list
6 Z6 o) x# Y: X5 |) b7 I! C5 t$ P: k - (cons 0 "TEXT")( \( g' X5 a. p5 C5 a; p* d
- (cons 100 "AcDbEntity"); f; k7 L0 Q% B& m4 y# m( }
- (cons 100 "AcDbText")4 X- n |& ?. u- N# O6 J
- (assoc 7 enlist)' Y( f9 H3 ] E& j! S
- (assoc 8 enlist)
! u7 |- t! F6 n J - (assoc 10 enlist)
6 b* a& q; H& K" D" e - (assoc 40 enlist)+ D. R; C6 P' L) e: X: v" a6 z
- (cond ((assoc 62 enlist))
8 F' y. @0 P. y) z - ((cons 62 256))
; [; F/ Y; _$ X# }: O* q - )
- ~8 u% z; m) Z0 _0 N - (cons 1 (cdr (assoc 2 enlist)))/ \8 c5 Z) S3 i& f! O# S
- (if (= space nil)
: d/ ?& n5 h- q4 h: A% [ - (cons 67 0)
9 {8 @* x) V1 | - (cons 67 space)
# t( C8 @4 L1 j - )# P, e/ D3 J+ {) B) ^3 |+ y7 K
- )6 r1 W% e0 Z8 X2 j% S4 }
- )1 K7 d8 p: W2 R5 d% u9 }9 O
- (entdel en)! N* }. Y+ P; Q( N
- (entmake vl)
9 ?' `. s; z6 Z7 r# Q5 w! ` - (setq blkcnt (1+ blkcnt)), Q% \" w. }: B0 @0 l( ?- t) X
- )8 Y9 p' m5 {( M. C& j0 e* U
- )9 X6 g6 L( a S2 }9 v
- )' Y3 A& j) {3 I
- ;=====================================================================1 ?$ i2 m' _2 [
- ;============================ Doi Truc ===============================. e: m; l: R1 r& |$ Z
- ;=====================================================================
1 V! t- O5 L' z# S7 a
3 w+ q2 v' M7 C7 o$ E; Y0 _1 B* L- ;=====================================================================% U' |" c: ^; D& F
- ;=============== FUNCTIONS GA 1+3+5+7+9+11+13+15+17+19 ===============9 }" p: d5 k+ W/ j# ?0 u
- ;=====================================================================
+ l& B$ o: a+ v. j" ] - (defun c:ga1 ()
# n6 V: J/ N4 |5 ^' F, v - (setq a (getpoint "\nChon diem: "))% T U! y: X5 v
- (setq b (getpoint a"\nChon diem: "))4 Q J: h ^) `4 {7 R2 A. ]
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))- y1 I) l, h8 E0 V5 @9 ~ f, d
- (command ".circle" c a)
% U: z# H9 R* @7 v0 n1 { - (command ".line" a c "")9 \0 y% L ]) V) q8 \3 T! Z- l$ h. {
- (command ".array" "last" "" "p" c "1" "" "")% f5 Z/ y! F: x" K
- (princ)), Y/ ?3 w& }. w( R
- / Y) n" y' A: r4 n8 n
- (defun c:ga3 () S( G% t4 `% g* G8 Q" V6 z
- (setq a (getpoint "\nChon diem: "))# O( a/ N3 l6 ~( t/ Z. D+ u
- (setq b (getpoint a"\nChon diem: "))
0 w/ a6 S0 A* K2 V4 q" a" g1 e2 n: l - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))/ d U3 H3 {) }2 j" Y
- (command ".circle" c a)1 [' ^4 s# |* X0 a2 c
- (command ".line" a c "")4 T# L* _9 N$ T! V9 `* ^5 a+ d5 Y+ {
- (command ".array" "last" "" "p" c "3" "" "")
Q' P. {4 R- M8 A - (princ))
; @1 f4 h% n$ R2 D* d. k, L
& H7 c$ b* \( \9 y2 i1 @- (defun c:ga5 ()
4 }2 |2 a& z/ V* s' U; m - (setq a (getpoint "\nChon diem: "))% v, I7 f4 G: t* f1 m, a2 j) ?5 L
- (setq b (getpoint a"\nChon diem: "))1 x; B6 U' G/ Q& S8 \/ \: Q, D
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
( f9 C4 h( s- \: t. a0 ` - (command ".circle" c a)
6 \. F; E8 Q: G3 s- ]1 X - (command ".line" a c "")# O4 W9 }/ \$ |
- (command ".array" "last" "" "p" c "5" "" "")6 m- p2 Y4 z! d, @
- (princ))/ A3 s" C6 Q0 Z
- ! ]+ O3 N5 ]' |" d7 i# f# S
- (defun c:ga7 ()
& ^3 Z, N8 X: l8 I) ]" h; k - (setq a (getpoint "\nChon diem: "))
! `" a$ h4 l2 i2 k6 I3 p: P* s - (setq b (getpoint a"\nChon diem: "))
: L3 k) [' g7 C7 ~6 z7 D - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))0 P( {7 Q1 x& G% H" n, I
- (command ".circle" c a)
' g/ G! G4 U' [3 q4 W+ C, S - (command ".line" a c "")2 ]* {+ }& K( j& @
- (command ".array" "last" "" "p" c "7" "" "")
6 U0 ]4 [0 s8 I, C! q - (princ))
% \0 @2 i% h9 Q - ) g' [% @: a. |& }/ b# K) O" v
- (defun c:ga9 ()
: B& C( B( n' E/ _) m - (setq a (getpoint "\nChon diem: "))
! L* N& k7 B* J! `. l3 \) r - (setq b (getpoint a"\nChon diem: "))
) w+ S; C' B$ W$ n5 _. f - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))! m2 y7 d# V: ?
- (command ".circle" c a)
, t. Y; s8 G! ~5 D3 p; Z; F - (command ".line" a c "")
7 `+ ~4 ?/ @' F5 h4 I0 ` - (command ".array" "last" "" "p" c "9" "" "")# @6 _# J/ L" }4 ]! N
- (princ))
V! y& y' D9 ~- ]+ |5 g' }
1 ?, ~! q$ I/ C6 O+ U# l- (defun c:ga11 ()8 J8 _! i+ ?9 ^% b/ l
- (setq a (getpoint "\nChon diem: "))
8 m4 j2 `" r" O& N0 r - (setq b (getpoint a"\nChon diem: "))
8 c+ q2 u0 C2 p: R0 m8 ? - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))). z7 ?0 g5 n5 t
- (command ".circle" c a)
5 Q; p3 U1 ?3 ]5 a! l3 c% y0 N L - (command ".line" a c "")
$ [* J- S k) F- [' B9 k- G( @7 j - (command ".array" "last" "" "p" c "11" "" "")+ H0 q7 a* u. ~& b. D
- (princ))% Q0 z+ D1 U" k1 J6 Z4 j
- $ W+ b+ e& O! e t+ A8 S
- (defun c:ga13 ()
]2 P- V0 d, a4 ] D - (setq a (getpoint "\nChon diem: "))) Y+ { h: o$ B1 A
- (setq b (getpoint a"\nChon diem: "))/ K9 v0 Q3 t1 ^( l$ m8 `, T
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))- T% x. ]8 \' ] \0 `" z
- (command ".circle" c a); i+ A" q4 | L+ d; F) \
- (command ".line" a c "")3 ]. o& d4 e9 `1 x" {/ \' j
- (command ".array" "last" "" "p" c "13" "" "")
% h J3 j' O h: S7 { - (princ)). _9 i% s9 R* m6 n$ u
- 4 h, y; f3 X+ J; c0 b5 d
- (defun c:ga15 ()
! I9 N, W R: o5 F" Q7 }+ @+ Y - (setq a (getpoint "\nChon diem: "))! j! U) G+ t* o! y% ^
- (setq b (getpoint a"\nChon diem: "))
0 }9 `: \' E; \; d1 C+ y+ |$ V5 U2 O - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))). B3 A$ D n9 w9 J) ?
- (command ".circle" c a)! I$ e4 m/ w, {
- (command ".line" a c "")8 a7 f' Q4 J* [2 d; e: B
- (command ".array" "last" "" "p" c "15" "" "")
1 u" U- L9 b2 f2 b( i9 @4 C4 U - (princ))$ R1 J- ^+ j! Z: l+ p
; W2 B( h5 K% R: X7 M8 Z1 O- (defun c:ga17 ()- O' v4 ?8 u: z1 H9 I; c/ }
- (setq a (getpoint "\nChon diem: "))2 L- h+ S* B0 N0 F# m
- (setq b (getpoint a"\nChon diem: "))4 K6 M) Q4 t; Q, Z/ I
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))( ]7 h/ U- T0 u/ \6 |" z' @ ` n
- (command ".circle" c a)
8 i: I$ u6 o* d - (command ".line" a c "")1 X. s; N) d7 S% ^: g9 t, V5 ^
- (command ".array" "last" "" "p" c "17" "" "")$ d1 S, Z& Y$ }8 T* T$ B2 A' s2 L: I
- (princ)) s5 D% G$ Y' S% c
- 6 N5 T' ^, a. E* X& A& M' ^- |
- (defun c:ga19 ()
% K2 a! l3 o/ @, ]4 T2 s3 { - (setq a (getpoint "\nChon diem: "))
( m' a. X: d6 X) U& C; p; H5 O - (setq b (getpoint a"\nChon diem: "))* W7 j: q3 t; [5 G9 ?
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))) v" Q; T, @ t4 x5 g: N
- (command ".circle" c a)8 w+ Z8 y1 h) T1 z
- (command ".line" a c "")7 M) m# J% n4 ^. ^. n' U' P
- (command ".array" "last" "" "p" c "19" "" "")# k$ P( M+ G a, t+ C# H6 @! N! h
- (princ))4 _) s8 |3 f8 T/ }- ~6 N
- 3 Z( U9 M$ \$ g2 }7 s
- ;=====================================================================, @6 ~2 E8 S8 T* n+ m7 n( U" f n
- ;============== FUNCTIONS GA 2+4+6+8+10+12+14+16+18+20 ===============3 ?; a/ O/ B5 w9 [; ]
- ;=====================================================================4 b# @) ^. o$ W
- (defun c:ga2 ()
" Y' R+ Q( Z9 E$ V - (setq a (getpoint "\nChon diem: "))
( n3 H8 u1 }9 b; H, P$ E# p8 H! F - (setq b (getpoint a"\nChon diem: "))
3 {& c+ F; L+ M! a$ T( z- X( v - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
) I7 b2 w8 W: E* R0 p0 [$ c5 e - (command ".line" a c "")5 n* H8 G# e4 V" v0 M7 J( d9 |
- (command ".array" "last" "" "p" c "2" "" "")0 O8 V9 ]; u2 G; q% V
- (command ".circle" c a)
5 F- m7 h2 C" I* G( ] - (princ))
" |; b# R' m8 ^* ?7 f5 T, J' p
5 o" G* p& r8 Q& Y9 u( K8 C- (defun c:ga4 (): I p/ y8 j! E" `
- (setq a (getpoint "\nChon diem: "))2 I) g8 V* m$ o1 z, q# `1 `
- (setq b (getpoint a"\nChon diem: "))6 u3 x5 V* h. r5 J
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
v4 K( ?7 i/ R, Z - (command ".line" a c "")$ Y* L/ P' \+ c4 v& b0 u# t5 R
- (command ".array" "last" "" "p" c "4" "" "")) h" @# T& B) r& i! X
- (command ".circle" c a)
) P6 e/ [" |9 _! ~/ L - (princ))/ i4 U, q1 O7 ^2 p9 q
: i+ F; @0 p( Y- v( ^- (defun c:ga6 ()/ K# I- S/ b' D2 G
- (setq a (getpoint "\nChon diem: "))6 H1 l8 @# ^5 {4 [: L7 G$ W4 R
- (setq b (getpoint a"\nChon diem: "))
7 n) a ^" X& y* n* h H2 |# m - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
! E- k: Y2 F5 ]" H4 n - (command ".line" a c "")
; w5 ?& Z- T/ A/ F, \* ^ - (command ".array" "last" "" "p" c "6" "" "")/ o3 y2 U) I( e
- (command ".circle" c a)
1 L* v- @7 B! H - (princ))
4 @1 ^+ R1 Y% P! f6 { - + v' p% o( ?2 g, {: s
- (defun c:ga8 ()" P! {" T! E% k' `
- (setq a (getpoint "\nChon diem: "))
# E4 Q3 y( B- Q- V. A: a8 \ - (setq b (getpoint a"\nChon diem: "))
' p( ?3 B8 ?. K - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))) e/ h6 [+ c' h" E/ ]+ g3 d. { t
- (command ".line" a c ""), |) f7 l- _9 S( x6 V7 o9 U2 V: l4 a ?
- (command ".array" "last" "" "p" c "8" "" "")
) P( d3 y" x" u' Y# e - (command ".circle" c a)4 }! d* N: p' S4 c' r* r
- (princ))
- W* ~% x! n) a# }# p! f
7 X* F9 _2 I6 M) y% x* c$ c- (defun c:ga10 ()4 Y# [" x2 W7 X8 ?* s
- (setq a (getpoint "\nChon diem: "))& y9 B# ^' {2 S! v& ^$ `7 g
- (setq b (getpoint a"\nChon diem: "))
# T4 z3 u' |9 S - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))% N7 t3 V4 c2 w: l9 Q
- (command ".line" a c ""); n+ w, d9 a+ E4 ]/ ~0 E4 x, q
- (command ".array" "last" "" "p" c "10" "" "")
9 e' E! K. m+ b* l$ F$ ^* F! O - (command ".circle" c a)
5 ]: Z2 ~0 R0 x: [ - (princ))( N/ u8 i1 e# k0 d- O8 v( I
) k. b: u) j2 ~+ K( j- (defun c:ga12 ()' t! A B7 B! C/ }. c
- (setq a (getpoint "\nChon diem: "))/ J, m, h8 e) }# `1 ?3 ?7 n3 m
- (setq b (getpoint a"\nChon diem: "))& |8 l5 p7 j6 |4 |4 ]+ s0 v
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
: M# Z& Q# X+ w0 Q: l# L - (command ".line" a c "")
( B1 U' x+ o. I" z0 o - (command ".array" "last" "" "p" c "12" "" "")
6 G; @/ f7 m" {2 m5 K% ? - (command ".circle" c a)
& I: Q& U) `8 e - (princ))
$ E' h5 ~# k% l n5 ]5 N% l
% K; W( q2 p$ y: k- (defun c:ga14 ()& e/ z X# w/ O- d3 P" l1 N
- (setq a (getpoint "\nChon diem: "))
& J3 H0 s' A& V+ B7 a - (setq b (getpoint a"\nChon diem: "))+ m& }1 V x$ i* I6 v P
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))8 t8 S M) \0 S' Y0 k6 r2 C
- (command ".line" a c "")
4 c2 l" i7 \. @ - (command ".array" "last" "" "p" c "14" "" "")
( W& `$ M1 `$ d; ^* } - (command ".circle" c a)* b. p4 I+ o$ b
- (princ))8 P4 o2 e, V2 J+ e9 g% B
- . k X8 g. k. P) d& A$ E
- (defun c:ga16 ()% T1 g5 j* G, `: R
- (setq a (getpoint "\nChon diem: "))
! a( A) h9 K+ O. y1 f( {+ u+ _ - (setq b (getpoint a"\nChon diem: "))' d5 e3 U& d8 S/ b
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))1 U. C. W$ ` N2 \9 F. J. g" y& R
- (command ".line" a c "")% M$ q8 W9 v- u: [( ?
- (command ".array" "last" "" "p" c "16" "" "")
, L( l9 W2 N9 ^' [# [( G; Q" o - (command ".circle" c a)
0 n% J" t2 r) K/ O - (princ))/ B6 `) P$ G& X6 w& f- j& g( r. R
- & v5 [, o* J& K5 P1 P
- (defun c:ga18 ()
( j H! k# E3 B7 b% j; I - (setq a (getpoint "\nChon diem: "))
( c) S, P# f& W( Z X - (setq b (getpoint a"\nChon diem: "))
3 a+ P$ K' ^3 C: z. L - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))) _0 @0 z9 G! S _
- (command ".line" a c "")9 \- _4 u, d n2 q" n3 u/ `+ m+ Y0 j
- (command ".array" "last" "" "p" c "18" "" "")& y1 u+ T* A. s. F3 L; J
- (command ".circle" c a)" `( ]7 w$ u, R9 W* {" q( h
- (princ))
0 O1 R$ T1 H* n# `" l - ! d- J/ k" K; j; p
- (defun c:ga20 ()
* n% T. `) t( n: C) W2 I) V - (setq a (getpoint "\nChon diem: "))
7 D, v) k2 @- b - (setq b (getpoint a"\nChon diem: "))9 W* w4 M( d9 a$ T2 z4 n5 K
- (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
1 ~3 s3 ~4 M m. ^. u' z6 G - (command ".line" a c "")# T1 r D9 z! K# {$ j1 j/ d( X7 p. o4 S
- (command ".array" "last" "" "p" c "20" "" "")
T, A+ P" R' I) r" J; H+ `3 a4 M* c - (command ".circle" c a)$ J: ~+ m: |/ v7 M3 @! Z
- (princ))3 G# D) Q( H9 f6 t
- / W( Q) S: E j8 J% p" k/ U
- ;=====================================================================
8 B: e, n$ q2 _0 f5 a+ m% j - ;============== FUNCTIONS GA TUY THICH : EVERYTHING IF ===============6 {" l6 p s, f0 b% a
- ;========================== 06-11-2016 ~ 18h00 =======================3 n7 m N b( n. t/ k
- ;=====================================================================* }. n) | Y5 G) o1 _
- (defun c:ga ()- n+ Q/ Q5 L" X0 U1 }3 Y5 U
- (setq a (getpoint "\nChon diem: "))
# }! V1 }& A( K! a. s8 s6 j J - (setq b (getpoint a"\nChon diem: "))
$ m* L% f. u1 ` - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))" f2 A1 t; }: J8 l
- (command ".circle" c a)
, d4 M" \4 \( ]9 m - (command ".line" a c "")
. j. d t# H, Y+ H5 l" y - (command ".array" "last" "" "p" c "NUM" "" "")
# |; T8 d5 ~1 p9 q/ G6 S- G! ] - (princ))
, j5 @' o! a ?/ [) Y5 g, d
8 O; w5 k+ E+ ^+ o3 w" ^- ;=====================================================================+ t% r5 y9 t: x/ s" l4 D3 Z) m
- ;=========== FUNCTIONS HOA THI TUY THICH : EVERYTHING IF =============$ ` \, X9 J8 g: c) o
- ;========================== 06-11-2016 ~ 18h40 =======================! @. ]" M8 Z8 ?, K
- ;=====================================================================
6 p. o! M: D6 Q2 j8 l9 F6 A6 r
3 n y3 P' Q' Z; w; p: w- (defun c:hoathi ()
7 }1 a8 l! B! V! ^4 l- e - (setq a (getpoint "\nChon diem: "))
4 D0 X8 J l, x7 f$ T+ f; ? - (setq b (getpoint a"\nChon diem: "))
; @9 U0 } q* h - (setq c (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
( S3 I1 E, |( w2 J - (command ".line" a c "")
6 a: J; s* `) {! y4 K# e" l/ r - (command ".array" "last" "" "p" c "NUM" "" "")) A' [1 ^. k& s* u" N. M, f0 Q
- (princ))
6 ]% l0 Y) e+ T' g+ a( d
; t4 c( x$ n- t1 C. m0 {4 v- ;=====================================================================5 i+ r) X" _+ J- `. n
- ;============= FUNCTIONS CUNG TUY THICH : EVERYTHING IF ==============
& e6 ^- U. u1 M6 Y' F. |, J' N - ;========================== 03-11-2024 ~ 19h33 =======================
/ ~# H' I6 v* Y- M& ` - ;=====================================================================
/ N/ F: h1 t% n( s3 ?; ~ i
# S- h/ N. n" k( c: T& O" {- (defun c:cung ()$ m, b T5 g Q P
- (setq a (getpoint "\nChon diem: "))' a" k, u$ l0 A0 d* E; @ z& t/ r/ C
- (setq b (getpoint a"\nChon diem: "))6 L& D% ^: r" C$ \: o1 b
- (setq c (getpoint a"\nChon diem: "))
L P2 S. I1 _, P# I% |$ z - (setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
$ Q! A. X0 \5 ~# I9 L& k - (command ".arc" a b c "")
& _$ u8 M* W' j1 G- e* r - (command ".array" "last" "" "p" c "NUM" "" "")
& M1 Y6 x3 ]5 D: ` - (princ))
0 X4 H& V% Y* }# l+ T& B - 6 N/ W* g3 P" k7 d
- ;=====================================================================: W; Z# Z( y6 ]( F& I# k
- ;============ FUNCTIONS HECLOIC TUY THICH : EVERYTHING IF ============
7 `, O$ y4 n( f0 e - ;========================== 03-11-2024 ~ 20h02 =======================; M# d7 z' x$ a) o2 t9 N# Q
- ;=====================================================================
- P) R* v2 y( v n7 G, N
; K/ t5 z G7 X- (defun c:hecloic ()" h( K; `) i; f5 @0 L5 [- p4 ^; v- F
- (setq a (getpoint "\nChon diem: "))# p1 |. M2 B" Y* w4 z$ G
- (setq b (getpoint a"\nChon diem: multi ")). ^& m" o; ?* o+ O' \; L% G9 z
- (setq c (getpoint a"\nChon diem: "))(princ)
' g8 w6 g- @/ ^! ^ - (setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
& f8 t B: t6 ^1 _6 U - (command ".arc" a b c ""). r" D# W2 |3 ? z8 }( v, K. ]
- (command ".array" "last" "" "p" c "NUM" "" "")
2 |& ?5 a% y7 ?0 \ - (princ))
, }( U }$ u: B* E
- d* F& C6 J+ W1 B/ M- ;=====================================================================2 n5 [; n O. C3 A: @0 T
- ;============== FUNCTIONS GAY TUY THICH : EVERYTHING IF ==============
o5 E1 x0 L& M2 h# J; W/ f - ;========================== 03-11-2024 ~ 19h38 =======================* t" f: c% b( N6 a7 v, A
- ;=====================================================================
* M! K1 K: b1 T1 s& z- p - 5 r% p4 `3 g- O- l7 M6 q& M/ @# {
- (defun c:gay ()
+ I" D5 p! h5 _; j; A% O - (setq a (getpoint "\nChon diem: ")): U; A' ]3 y* Q: g' [
- (setq b (getpoint a"\nChon diem: "))
& O9 A6 I; p. j - (setq c (getpoint a"\nChon diem: "))(princ)4 Q$ ^. {6 A9 A* ~# m' {% v3 x
- (setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2)))
% C9 g" S& \- }1 E5 l2 c2 ?+ K* O - (command ".pline" a b c "")3 F4 M( r$ {" x( s, |
- (command ".array" "last" "" "p" c "NUM" "" "")
' ]# o& M* x( M% w. u2 e/ X6 s - (princ))
; z3 W' R( n# h# A7 Z - ; J% M! G% z7 S* C+ m6 `0 J
- ;=====================================================================# ~) v% l; e* }9 g7 w1 g
- ;============ FUNCTIONS HECLOIT TUY THICH : EVERYTHING IF ============3 {9 K ?* ], }
- ;========================== 03-11-2024 ~ 20h02 =======================6 g- A8 [: F; h! R$ b/ z% c
- ;=====================================================================
; [& i! ?( w* {6 d" ]2 i
# H* w" ~& _3 t/ D- (defun c:hecloit (): W- @5 R2 \" L
- (setq a (getpoint "\nChon diem: ")). l5 X- Z4 X5 x q8 x% e
- (setq b (getpoint a"\nChon diem: multi "))
, ], Q; a6 `3 h6 E' k$ U+ V& ^ - (setq c (getpoint a"\nChon diem: "))(princ)
! E+ K3 j0 w$ I! [1 B) E$ f4 Z( [ - (setq d (list (/ (+ (car a) (car b)) 2) (/ (+ (cadr a) (cadr b)) 2))), {9 e9 n2 B3 u1 t
- (command ".pline" a b c "")8 S2 K: S$ W0 x5 w
- (command ".array" "last" "" "p" c "NUM" "" "")4 U8 t9 h9 [5 b1 N
- (princ))
8 m- O7 P7 O$ L6 {: r* Z* x
, t& ~0 u d) [! e- - o8 W" ^' x& m+ a( u6 U
- ;;; ============================ Merge Hatch =============================; v0 k5 K P' h& E7 S/ `! P4 E" ~. n7 |
1 O) f1 B7 v/ o- \- (defun c:mh (/ ss entht sl i dt dtht)0 M( ~3 B8 q* _" `
+ M' k( e8 a3 T* f- Y. h- (princ "\nMerge Hatch - free lisp from CADViet.com")
: j2 j4 @, V3 i N3 C" U - ; r" B- H* U8 k0 a
- (setq3 z% V( y% ~9 K* T" \
- ss (ssget '((0 . "HATCH")))
( L/ b. c1 b. w% h. B* T6 B$ B - sl (if ss
$ L, \! ^, C+ \. G - (sslength ss)
$ c" N( P2 D) J - 0) W$ p( a; N& F
- ). n, Y" V; r4 G9 K+ {2 f, ~
- i 0, f" r& U+ _7 A" ], v8 `
- l 0
3 U' d) B2 f4 O- w8 u% L - )1 v. h" A" ` p y0 N% r
- ( l/ `# z% G6 W% J0 r- i6 U0 y
- (repeat sl
# m+ _9 C0 D; _, E - (setq, }2 P& W* [. e
- entht (ssname ss i)+ h& d9 J) b: Z: Z# S/ r) h
- dtht (getbdata entht)% R' V8 r# B' C2 P7 X+ y2 n
- dt (append dt dtht)
# Y% m+ Q! a( ]# P; y - l (+ l (cdr (assoc 91 (entget entht))))3 K; l0 p8 i, Q& A! h9 p$ a/ s0 k6 @
- i (1+ i)
6 I0 q# w7 @. p: r( q9 V* S - )
: S. n1 y8 C$ f - )
+ ^. \, J: B0 }6 M
' V; V$ r" D5 j: E3 {- (setq ent (ssname ss 0)
[9 ?+ @; C- b% [# |; } - ss (ssdel ent ss)( q6 ~ X3 U5 w9 c( ~1 x
- tt (entget ent). p( D. b( w: t4 k" @) w
- duoi (member (assoc 75 tt) tt)1 m6 s# Z9 N- Y e8 x4 W0 S; u
- dau (reverse (member (assoc 91 tt) (reverse tt)))5 Q. C0 }6 m. J. O/ B% J) H
- tt (append dau dt duoi)
/ F# a2 G7 \( c6 C - tt (subst (cons 91 l) (assoc 91 tt) tt)& Y' l0 M; G* x" `6 I& \
- )
0 b3 l1 N' J# w/ j& U0 [ - (entmod tt)+ E/ l" }( z2 C$ X; z ~
- 7 _6 |! T" Q* |7 _
- (command ".erase" ss "") |% q p1 Y9 u/ g% u S) K! p
- (princ)5 o( I; t% N7 Y5 H% [/ ^) c
- )
" o+ l5 U" g" }$ ^1 u. \ - ( U, {! a( y) d9 I$ _8 ]' [3 i' m8 i
- (defun getbdata (ent)% f: C2 K' E. Z
- (setq tt (entget ent)
, q" _8 B8 g3 I# e' f" w - tt (cdr (member (assoc 75 tt) (reverse tt)))
+ P- E) T& n: v$ o - tt (cdr (member (assoc 91 tt) (reverse tt)))
5 \. |; v* h, ^3 o/ ]4 \ - )
9 K7 V8 O) D# O9 Z' X - )+ `' m" o2 z& i# v8 j
; l! y9 Z# f1 T; ^' B8 S" C: m" ~
: s2 A5 y$ P7 G- (princ)2 ^2 r( B6 Z- w& P
- 0 ^3 c( W. T8 v/ ?7 J
- ;;; =========================== CAC LENH LAYER ==============================. C2 }2 x& ^4 Y8 v) T
- ;;; =========================== Layer hien hanh =============================
7 \& Y+ j7 K" p$ a, I0 ?( Z: B
6 R2 K8 h: K& T( A- (defun layset (/ LAY) (setvar "cmdecho" 0)
4 R/ c' u% \2 S4 W) v - (setq LAY (entsel "\nPick vao doi tuong muon Layer hien hanh la Layer cua doi tuong do : "))
& E/ _' b2 [3 a$ }( J8 _2 t/ t% @ - (if LAY (progn
1 H0 ^; n* U! V3 N# |; r5 | - (setq LAY (cdr (assoc 8 (entget (car LAY)))))# X1 \' x5 W H/ O/ O5 A
- (command "_.layer" "set" LAY "") (princ (strcat "\nLayer : " LAY " da la hien hanh.")) )
9 v( W) B9 f7 f- u7 v$ w0 W( a - (progn
2 w: y4 t/ k* w2 A0 s - (if (not ddlop) (load "ddlop")) (if (setq LAY (ddlop)) ! G4 H# V9 d U
- (progn
6 O! p6 K3 k2 |) I - (command "_.LAYER" "ON" LAY "THAW" LAY "SET" LAY "") (princ (strcat "\nLayer : " LAY " da la hien hanh.")) ) ) ) )(princ) )
5 s* f7 u" Z, T2 p( z- h! ]& H - (defun c:LLL () (layset))(defun c:LAYSET () (layset))
1 u+ R+ b& p' g- \" i - $ `3 v/ \7 p( s- C
- ;;; ================== Cap nhat doi tuong vao layer hien hanh ==================
: B7 g1 L! B! H" m v4 B
' e5 ?$ B" K3 A. T- (Defun LAYCUR (/ SS CNT LAY) (setvar "cmdecho" 0)
7 Y( h3 T- f% {1 s - (if (not (setq SS (ssget "i")))) f) ~7 {! i) p( m) U$ P
- (progn (prompt "\nChon doi tuong cap nhat vao layer hien hanh: ")
7 j9 O, u q& X: c - (setq SS (ssget)) ) )
2 L b; V! h0 s, `; W( W# I" V& | - (if SS (progn
/ |+ \0 N2 R; ?/ c4 v& F, L) I - (setq CNT (sslength SS)) (princ (strcat "\n" (itoa CNT) " doi tuong tim thay.")) (command "_.move" SS "") % y7 @" m4 o$ @- l l
- (if (> (getvar "cmdactive") 0) & Z( w4 S2 C# g: |
- (progn. e# u7 p/ Z3 `0 @6 E; @! e; z& K1 t
- (command "0,0" "0,0") (setq SS (ssget "p") CNT (- CNT (sslength SS)) ) )
2 U8 {. o G8 T3 `. H; t" N. j - (setq SS nil) ) (if (> CNT 0) / G1 P/ N2 U) {' W6 H+ t
- (princ (strcat "\n" (itoa CNT) " doi tuong tren layer LOCK.")) ) ) )
2 _/ Y$ P. T' i1 p - (if SS (progn' g& \1 B! p- G$ f. {
- (setq LAY (getvar "CLAYER")) (command "_.chprop" SS "" "_la" LAY "")+ t: E: K! D5 X* A! j+ A
- (if (= (sslength SS) 1): c: g7 C, \3 a) t* J! s9 [3 ~
- (prompt (strcat "\n1 doi tuong da cap nhat vao layer : " LAY " (layer hien hanh)."))
$ ^4 _+ [: `5 [- A* r - (prompt (strcat "\n" (itoa (sslength SS)) " doi tuong da cap nhat vao layer : " LAY " (layer hien hanh).")) ) )) (princ) );end0 w& ?7 A2 L7 R& j
- (defun c:LAYCUR () (laycur)) (defun c:LHH () (laycur))
. h# [+ E0 e- u2 e ~- W
5 x5 q* ^- \+ K- ;;; =========================== Layer Iso ===================================% W- I q% L5 a% o$ G* {
- 0 Z8 B& ~4 k/ T5 Z- B
- (Defun LAYISO (/ SS CNT LAY LAYLST VAL) (setvar "cmdecho" 0)
% O" i' D) l1 x: H$ Y - (if (not (setq SS (ssget "i"))) (progn
! T; }0 ~$ l$ J - (prompt "\nChon doi tuong tren layer(s) muon lam viec doc lap: ")) ^( K. g$ b4 p" Q+ k: \; e/ A+ q
- (setq SS (ssget)) ) )
, u. i0 @8 U+ d1 R" @1 c - (if SS (progn (setq CNT 0)4 C- G* |! _. j) j* X6 X
- (while (setq LAY (ssname SS CNT))
. c$ c$ X c+ U9 Y- d( K9 z B - (setq LAY (cdr (assoc 8 (entget LAY)))), o0 Y5 T5 ?: s F3 } |/ Z
- (if (not (member LAY LAYLST))- t# H4 M. d. I1 R- l/ X3 F/ t3 ?6 V
- (setq LAYLST (cons LAY LAYLST)) )
: D6 L, M. U# ]7 N* n9 C - (setq CNT (1+ CNT)) )5 \3 O; l* k( t; T
- (if (member (getvar "CLAYER") LAYLST)) K K( O/ Q! n$ m7 ^
- (setq LAY (getvar "CLAYER"))
% T: ^- V8 m% J: U" L" |8 b - (setvar "CLAYER" (setq LAY (last LAYLST))) )
0 t) ^) T( C, A; t - (command "_.LAYER" "_OFF" "*" "_Y")
# x! n/ j% J0 p' Y+ U - (foreach VAL LAYLST (command "_ON" VAL))
x- R) ?! }3 `" j2 Y - (command "") (if (= (length LAYLST) 1)7 t% }2 U+ r- f
- (prompt (strcat "\nLayer " (car LAYLST) " da tach ra."))
6 w. F' P' g: `" h! v0 b - (prompt (strcat "\n" (itoa (length LAYLST)) " layers da tach ra. "1 p! Z9 }# s& k {
- "Layer " LAY " la hien hanh." ) ) ) ) ) (princ) )1 K; Y, Z! f& [* z0 D) B; S
- (defun c:LAYISO () (layiso)) (defun c:LI () (layiso))
- W8 K$ c/ ^- |2 I5 }! ^
/ |, R4 i+ Q' L0 M- ;;; ========================= Layer Match ==================================
, H2 w. G0 Q- L
5 g2 |/ h$ Z1 l/ W/ E G- (Defun LAYMCH (/ SS CNT LOOP LAY ANS)* T1 D4 { j8 @% s2 y2 A5 f0 d
- (setvar "cmdecho" 0)
9 x- u* S# n) |9 h( I; W' h2 j2 } - (if (not (setq SS (ssget "i"))) (progn, B0 w& U9 Q+ s9 ], c
- (prompt "\nChon doi tuong muon thay doi Layer : ")' C' F6 n7 F6 K
- (setq SS (ssget)) ) )% e+ M6 N$ ]$ H4 |4 d& l' X* E% F
- (if SS (progn
" y( H3 N( W& H1 Z5 }$ |5 b, ^, m - (setq CNT (sslength SS))' j; _7 a9 |, v- s! B2 y1 O+ e
- (princ (strcat "\n" (itoa CNT) " found.")) (command "_.move" SS "")
; y+ U" g& C, |) S1 W) J - (if (> (getvar "cmdactive") 0) (progn
5 g5 G" W+ B& T/ S. x) K" A - (command "0,0" "0,0") (setq SS (ssget "p")
* W* s8 e; w# v! u1 z) T - CNT (- CNT (sslength SS)) ) )
' |) o. T; t- c b - (setq SS nil) ) (if (> CNT 0)
; _! U- \) u2 G - (princ (strcat "\n" (itoa CNT) " tren layer LOCK.")) ) ) )
R$ U9 f9 r& F4 Q' }" B2 v' J3 G - (if SS (progn# ^( a8 s' r8 N! L! y
- (initget "Ten") (setq LAY (entsel "\nTen layer/<Pick doi tuong>: ") LOOP T )
! }- s3 a6 {* t% K k& f4 n8 p - (while LOOP (cond
G( y0 ]4 |+ {+ N. r- r7 M0 N - ((not LAY)
+ A6 V1 l4 e; E; e - (prompt "\nKhong chon doi tuong.")
5 }* M# V6 o& F, o/ i - (prompt "\nSu dung layer hien hanh? <Y> ")
. y( j" q9 t i) W# e/ I - (setq ANS (strcase (getstring)))1 |8 c- T- E+ w3 @* z
- (if (or (= ANS "") (= ANS "Y") (= ANS "YES"))
% K- O0 J- B# E - (setq LAY (getvar "clayer") LOOP nil ) ) )
4 e; X9 ]: X. M4 m - ((listp LAY) (setq LOOP nil) )- G; ^: S( L* H" b! _
- ((= LAY "Ten") U2 ^& ~& s. M
- (setq LAY (getstring "\n>Nhap ten layer: "))
( Z0 l" e) ?6 j: T+ R$ N - (cond
2 {) [4 v- o2 g5 ~5 z8 {2 ~ - ((tblsearch "LAYER" LAY) (setq LOOP nil) )
& ]# n- _0 ~# ?0 D R4 ? - ((/= LAY "")
$ T5 F$ N4 N" u& l* M( c# c - (prompt "\nLayer chua co trong ban ve. Tao layer moi? <Y>: ")1 ^4 P# s) A: t [5 O
- (setq ANS (strcase (getstring)))
5 ~, |! K& u. c6 ~, f+ U W( v - (if (or (= ANS "") (= ANS "Y") (= ANS "YES"))( g8 X5 J+ s& G) m! B
- (progn
6 v- e2 b0 [0 U! }: \2 K& F& e - (command "_.LAYER" "NEW" LAY "")
. N# f% ]8 X1 ^+ @4 q: I - (setq LOOP nil) )& h L/ y# y: G. J
- (prompt "\nLoi ten layer.") ) ) ) ) )
0 b* Y, L/ q( K( i$ o# w8 J9 @, F* t - (if LOOP (progn (initget "Ten")
& Z5 g2 ^3 B H, B# c4 A2 R - (setq LAY (entsel "\nTen layer/<Pick doi tuong>: ")) ) ) ); while LOOP0 L" [# }" Q4 O; Y
- (if (listp LAY)6 }7 ^! F) a- B7 ^1 j0 h
- (setq LAY (cdr (assoc 8 (entget (car LAY))))) )0 v: M# w1 ]2 B' t+ {! Y
- (command "_.chprop" SS "" "_la" LAY "")
2 G3 I6 }3 o( F% C N - (if SS (prompt (strcat "\n" (itoa (sslength SS)) " doi tuong thay doi toi layer " LAY )) )
- i! K- l4 O2 w @1 [: d - (if (= LAY (getvar "clayer"))
) q6 R0 k* P6 o - (prompt " (layer hien hanh).") (prompt ".") ) ) ) (princ) )$ a# V3 Q) Q/ s+ B$ @9 ?- y
- (defun c:LAYMCH () (laymch)) (defun c:CLL () (laymch))
- T9 S0 ?- k1 d; Y
7 j9 Z4 y& l3 P$ ^- ;;; ============================ Layer OFF =================================
8 v4 T) V5 J2 \0 t3 F - : J |9 C! |% f* H4 ]
- (DEFUN C:LJ (/ SSET SSL ENT LAY I MODE)% `! ~+ t1 J$ R$ q3 \7 D
- (SETQ SSET (SSGET))
5 q5 p' O T6 G C- t - (IF (/= NIL SSET) ) g' r$ r+ V, D1 r3 `" K( b4 H% N
- (PROGN
& u# y" Z3 a! _# D( U4 B - (SETQ SSL (SSLENGTH SSET))
% ?2 a& y/ }+ X' {5 _ - (SETQ LAY "")3 r" N' \5 W$ y( m; \& Q
- (SETQ I 0)
- N- L$ H3 u( v5 l - (SETQ MODE 0) - c4 Q& r6 J& q1 ]
- (WHILE (< I SSL)6 Q9 |' {, _8 g; T1 b* A2 m' W9 c1 d
- (SETQ ENT (ENTGET (SSNAME SSET I)))
" J$ x% b" m+ D+ c. Z8 H# V - (IF (= (CDR (ASSOC '8 ENT)) (GETVAR "CLAYER")) (SETQ MODE 1) )
" f: Y0 [1 [! e. C - (SETQ LAY (STRCAT LAY "," (CDR (ASSOC '8 ENT)) ))
) T$ V9 f0 S4 {: @/ L3 |2 F9 z8 ? - (SETQ I (+ I 1))4 V- @$ u4 Q! c1 [
- )) m# j( F8 T* U
- (COMMAND "LAYER" "OFF" LAY "")
# R6 r9 `" q2 n9 ]+ g - (IF (= MODE 1) (COMMAND "") )" o1 k3 O2 Z$ t4 j4 Q# ?$ F
- )
6 N4 c! [$ p( l2 V# ^4 }) l - )
& P s3 X% b, K* B - (PRINC)9 t* p: B5 H% a4 S3 T6 R
- )5 I' n! j( r" q3 w: K9 e
% k. Z' F/ H) ^9 u- ;;; ================================ Layer ON ==============================- { _0 u2 l) J3 q; t. b
- : I5 L: A) K X5 z4 E
- (Defun LAYON () (setvar "cmdecho" 0)7 F: `3 r% `& s- { N1 t' a- i
- (setq Lay loff1) (setq Loff1 Loff2) (setq Loff2 Loff3) (setq Loff3 Loff4) (setq Loff4 Loff5) (setq Loff5 Loff6) (setq Loff6 "0")/ G" U- `! l6 r5 _. `6 E% Y! v
- (Command "LAYER" "ON" Lay "") (princ (strcat "\n Layer : " LAY " da ON.")) (princ)). d& i, j* [" l& G. {
- (defun c:LAYON () (layon)) (defun c:LOO () (layon))
! B! d/ O/ Z8 D' _3 J3 p: V/ Y; J - (Defun C:LO () (setvar "cmdecho" 0) (Command "_.LAYER" "_ON" "*" "") (princ "\nDa ON toan bo cac Layer !") (princ))- Z( ?5 f1 R j
' `' G0 M' J4 p# t" R- ;;; ============================== Layer Freeze ===========================# i4 Q' d3 D/ x6 t) \& z
7 {- e- i5 r4 F4 c- (Defun LAYFRZ (/ LAY TEMP)(setvar "cmdecho" 0)
7 V* X' N1 `9 S - (prompt "\nChon doi tuong tren layer(s) muon FREEZE: ") (SETQ SSET (SSGET))6 b3 a# t. \1 |$ O4 t( L( o' O
- (IF (/= NIL SSET) (PROGN
. S. D8 F- ^( k6 q9 K7 }" e - (SETQ SSL (SSLENGTH SSET)) (SETQ LAY "") (SETQ I 0) (SETQ MODE 0)
. F$ ?. d1 K" C0 g - (WHILE (< I SSL)( X7 a& W( X4 @! }% `
- (SETQ ENT (ENTGET (SSNAME SSET I))); w6 ~4 a. C5 u: N- c
- (IF (= (CDR (ASSOC '8 ENT)) (GETVAR "CLAYER")) (SETQ MODE 1) )
+ L/ ~: @' y, m1 X; _5 L+ Q1 x0 A - (SETQ LAY (STRCAT LAY "," (CDR (ASSOC '8 ENT)) )) (SETQ I (+ I 1)))
/ w$ a# j5 g" u/ }: U; h - (COMMAND "LAYER" "FREEZE" LAY "")
7 E2 |9 i5 p* X; X4 }( \/ l - (IF (= MODE 1) (COMMAND ""))))
- f7 R# P6 S' b - (setq Lff6 Lff5) (setq Lff5 Lff4) (setq Lff4 Lff3) (setq Lff3 Lff2) (setq Lff2 Lff1) (setq Lff1 LAY)' J: x& Q0 Y) \; J
- (princ (strcat "\n Layer " LAY " da FREEZE."))(setvar "cmdecho" 1) (princ) )
# ?( T8 B" Y- z" {3 Y. @3 g0 J - (defun c:LAYFRZ () (layfrz)) (defun c:LF () (layfrz))4 \+ Q3 r& m6 h2 ^
- 3 r" o' f- D3 f4 G$ `, h: h J8 J7 ~7 O
- ;;; ============================== Layer Thaw ===============================
( B6 O; @/ R+ ]# B" M
% ]# l* U+ x# }' m- r- (Defun LAYTHW ()' U7 N/ h. I3 ?$ V: Y! e
- (setvar "cmdecho" 0)5 s/ Z$ z# g+ }9 r0 x
- (setq Lay lff1) (setq Lff1 Lff2) (setq Lff2 Lff3) (setq Lff3 Lff4) (setq Lff4 Lff5) (setq Lff5 Lff6) (setq Lff6 "0")
; g, D* c# H' q" O - (Command "_.LAYER" "_THAW" LAY "")
- E( H. X" H! k, s9 O$ R. A' O. S - (princ (strcat "\n Layer : " LAY " da THAW."))- u/ \) z0 X$ ~6 [: T6 Q/ b
- (princ) )/ g' @- o! C4 v! k e; T3 \
- (defun c:LAYTHW () (laythw)) (defun c:LW () (laythw)). L2 F. G, P$ K) W. l5 L
" u4 L) c- J1 f2 q- ;;; ============================== Layer Lock ==============================
L+ P9 P1 A6 g* U& N
' {" V9 R) M% ]/ v* J* W- (Defun LAYLCK (/ LAY)( ?% x8 z' g* A0 T& x
- (setvar "cmdecho" 0)
" t* \; Z U7 X+ r# ~8 y" ?, E1 r - (setq LAY (entsel "\n>Pick doi tuong tren layer muon LOCK: "))8 T7 \- {+ _, k; R
- (if LAY6 r _' j% X! o, C$ a( Q0 m9 E; x, }
- (progn0 R/ {0 u; m' P: l
- (setq LAY (cdr (assoc 8 (entget (car LAY))))); c3 a# f) M$ @* [
- (Command "_.LAYER" "_LOCK" LAY "")
5 a8 d7 i- @9 M- K+ | } - (princ (strcat "\nLayer " LAY " da LOCK.")) ) ) (princ) )6 a: K9 N! m1 o7 h' j* g1 ]
- (defun c:LAYLCK () (laylck)) (defun c:LK () (laylck))4 k( T7 [& ^$ G4 `, R; C2 P
- * L( `( v9 u0 @( Z
- ;;; ============================== Layer UnLock ==============================
7 }7 t1 r9 [, u' E2 Y' v& t - M( L6 B4 [4 O4 x* M6 v
- (Defun LAYULK (/ LAY)7 E% y& t) p" A9 N& L$ \
- (setvar "cmdecho" 0)
% F0 O9 I. X7 z - (setq LAY (entsel "\n>Pick doi tuong tren layer muon UNLOCK: "))
, T9 h! h% h3 n: F - (if LAY
. Q5 N8 e% r3 w) B/ x - (progn
& V) w+ g) D, n _7 E5 N1 K9 N0 }5 d3 u - (setq LAY (cdr (assoc 8 (entget (car LAY)))))( x6 [! A; l; s; C j- {3 C
- (Command "_.LAYER" "_UNLOCK" LAY "")1 o: o6 k/ I7 m5 K1 g! k6 o
- (princ (strcat "\nLayer " LAY " da UNLOCK.")) ) ) (princ) ). b: M% | G& m
- (defun c:LAYULK () (layulk)) (defun c:LU () (layulk))7 ~/ C1 P* h1 X0 J0 o
( m+ ~! W3 a) Y$ H- l! W g' M- ;;;===================== Delete all objects of Layer ========================, V1 J, V% n" _% p7 K ^1 ?1 @
3 J8 k6 d3 w& Z* a$ P1 m- (defun DELAYER (/ ocmd L S)
5 N8 S: U1 t' ~. t0 n T - (setq ocmd (getvar "CMDECHO"))# T9 e H9 U# r; f. X
- (setvar "CMDECHO" 0)
. G1 _( Y: D( B" b8 F - (setq L (strcase (getstring "\nLayer(s) to delete: ")))
4 Y- A, G9 d$ P/ N* L - (setq S (ssget "X" (list (cons 8 L))))
2 b5 A5 h+ J7 K- J7 T4 l& [* T8 F - (if S , o2 N! o/ Z/ X2 t$ M6 a6 A
- (command "ERASE" S "")
6 Q" e4 X. {. @- f2 D) I - (princ "Layer empty or not a valid layer name.") ) 7 E/ W; w* `+ `# ^" U
- (setq S nil) 6 V1 @3 r' F: p9 R6 T
- (setvar "CMDECHO" ocmd) ' _& z' c* B8 Z% W- o. k
- (princ) )
. \( m9 t8 G( f- A - (defun c:DELAYER () (delayer)) (defun c:DELLAYER () (delayer)) (defun c:DEL () (delayer))
5 _0 |2 H' c5 ]. _$ O$ C' L. G - / L1 X2 J' _. V
- ;;; ========================= HET CAC LENH LAYER ===========================# M: Z5 i B' I! L% ^9 ]! M2 O
- & ^* x6 ~7 u' z3 d( T, d7 M2 i
- ;;;====================== EXTEND NHIEU DOI TUONG ===========================) y" ?' ]' C5 k3 A
" A% l2 D: c# }, I- (Defun C:EET ()$ m0 I, v% F, s) o A. g
- (Setq CVAR (Getvar "CMDECHO")) (Setvar "CMDECHO" 0)
q( H8 N3 e, n, |* \% E) m7 W1 q - (Prompt "Chon doi tuong dich cua EXTEND :") (Setq CUTEDG (Ssget))
$ x( F9 e0 B- e7 [ ? - (Prompt "Chon doi tuong de Extend :") (Setq SS (SSget)) (Setq LEN (SSlength SS))% W# y* h; J" I; Y/ o9 S. P
- (Setq I -1)
/ e% U8 O& ^7 X5 }4 o; z: P) R5 W - (Setq SIDE (getpoint"Chon phia de EXTEND")) (Command "EXTEND" CUTEDG "")
2 q0 E+ ]( x- x - (Repeat LEN5 f4 w2 V5 v3 h; _) \% P6 ^
- (Setq I (1+ I))
y5 x3 L0 }5 r. D1 d i/ R - (Command (List(SSname SS I) SIDE)) ) (Command "")9 \8 U+ {# {, m! x5 O
- (Setvar "CMDECHO" CVAR) (Princ "Da Extend xong moi ban lam tiep") (Princ) )0 b& [3 |" @) r6 ^7 Z6 w( z
1 J$ B/ V% S6 q! B" y. P- ;;; =============== EXTEND 1 DOI TUONG THEO KHOANG CACH ===============
) y' z+ b: h$ Y' c
$ ?* N* G, i1 w0 J4 W- (defun c:ETT () (setq os (getvar "osmode")) (setvar "osmode" 512)
3 r# x4 K* p3 I I - (setq pt1 (getpoint "\nKich vao 1 dau doan thang can EXTEND "))
; D4 E3 f$ l3 Z" B+ y7 ?3 X - (setvar "osmode" os)
$ C" |/ r: K5 V1 ?& t, v0 u0 K - (setq dis (getdist pt1 "\nKhoang cach can EXTEND :"))
4 Q! g7 b2 h# W& C2 `# p; H - (command "circle" "endpoint" pt1 dis) (command "extend" "last" "" pt1 "") (command "erase" "last" "") (princ))! G& ]7 G* B' \2 F
- ( f1 k5 s! q$ |; q, d
- ;; ================ Change width of polylines =========================
4 T. a' P! l5 l3 n( z4 m; ~ - . @/ n1 M4 ^5 {
- (DEFUN wp (/ a b sophantu sodem list1 ha:wid)8 y+ J+ q2 Y5 w# Z8 X/ E1 C3 F. w# N
- (PRINC "\n Chon doi tuong can thay doi do day (Width) !")
! N3 Q; ^( m1 B) V1 f4 W2 M; b/ j& o - (setq b (ssget)) % b7 c- _ T1 ?7 u2 ^
- (setq sophantu (sslength b))
( R o5 C: W. K) G/ w! w: d/ q* Q - (if (null ha:wid) (setq ha:wid (getvar "tracewid")))
& z* V6 E' r; J/ H) W - (princ "\nDo rong polyline <")1 l& N. L9 N8 j0 i7 l; E E7 z
- (princ ha:wid)' h3 s3 ]6 A/ [2 h* A% d
- (princ ">: ")
8 i: H7 L$ e) g - (initget 4)4 d2 C+ v0 M3 ^" I/ F- {8 E4 a
- (setq ha:wid (getdist)) t' X* e- b% K% K4 K! a# l& O
- (if (null ha:wid) (setq ha:wid (getvar "tracewid")))
- u; x7 k; v4 {; F; U - (setvar "tracewid" ha:wid)7 n4 z: d2 W" ]! t6 x4 _/ [. ~
- (setvar "cmdecho" 0)3 ]; B$ x5 {3 ~0 v) j6 t! @
- (setq sodem 0)
2 i1 S; `& q$ d4 n6 L: \7 \ - (repeat sophantu3 r% N8 @$ @- I# y
- (setq a (ssname b sodem))
6 d- H6 O, U4 [" q2 T. } - (setq list1 (assoc 0 (entget a)))- |. q. w) z1 f+ o
- (cond
& n+ h$ N* K. R( O( W - ((= (cdr list1) "POLYLINE") (command "_Pedit" a "w" ha:wid ""))
, y/ d" T/ s. p/ |) S% h - (PROGN (command "_Pedit" a "" "w" ha:wid "")) ) . C6 t x9 g L+ F
- (setq sodem (1+ sodem)) )(SETVAR "cmdecho" 1)(princ))' h- C) B1 M/ \
- (defun c:wp () (wp)) (defun c:pw () (wp))9 l$ m1 y8 |8 m5 j: B0 N# }
- % U. f X+ r+ d; j1 {
- ;; ================ Change radius of circles ==========================) q9 ^5 _# c! A' d. e; c4 o$ T
- H3 i3 P# }- V/ I( q- (DEFUN C:CHR (/ SSET SSL M RD I) (PRINC "\nSelect Circles :") (SETQ SSET (SSGET))2 L2 }6 u; h, F. N! {; r
- (IF (/= NIL SSET) (PROGN (SETQ SSL (SSLENGTH SSET)) (INITGET 4 "") (SETQ RD (GETDIST "\nNew radius : "))! c( } l7 \, q. Y# L3 l' |* T6 T
- (IF (/= RD NIL) (PROGN (SETQ I 0)- X# ^- }# I2 x7 M; V
- (WHILE (< I SSL) (SETQ M (ENTGET (SSNAME SSET I) ) )8 o' Q4 S' \0 s
- (IF (= (CDR (ASSOC '0 M)) "CIRCLE") (PROGN; b' ^+ p1 E3 L6 c
- (SETQ M (SUBST (CONS 40 RD) (ASSOC 40 M) M)) (ENTMOD M) ) ) (SETQ I (+ I 1)) ) ) ))) (PRINC) )" K& m9 o' P Z. Y/ V, F
- 4 ^& m# Q# X9 W4 U% A
- ;;; ============================== TEXT Hight ===============================8 @( f8 I4 N" a9 w- {! c
7 _) M6 \2 @4 ]$ R0 F4 C! P- J. |- (defun texthght (/ ent hght): \, ?$ H: t- n; ]3 i0 E2 G
- (setvar "cmdecho" 1)# `0 @. V4 z0 j# \ C, C
- (prompt (strcat"\nSelect text entity with required text height"))6 k! ?, L1 `& v& f+ [6 n
- (prompt (strcat"\n."))* l0 V& I0 q8 L- A7 b
- (setq ent (entget (car (entsel))))% X3 U7 f! F) l* F
- (setq hght (cdr (assoc 40 ent)))" a! N$ t0 n9 s9 B
- (prompt (strcat"\nText height now set at "))(prin1 hght)" F) y3 q K' U0 c4 m
- (prompt (strcat"\n.")) * ?2 L- b8 a+ X5 G/ B$ J% }
- (setvar "cmdecho" 1)# v$ n6 A0 H) m
- (command "DTEXT" PAUSE hght "") )
7 z% G& {6 [2 p" w - (defun c:teh () (texthght)) (defun c:texthght () (texthght))
0 x4 q/ M9 H6 [% @, O
& F) G8 h, p5 b8 }6 {, U- ;;; ================ BAT -TAT CHE DO GACH CHAN TEXT =================, Z5 J% x9 G$ u B# N1 R% i, D
- / K% W o$ w& X: |2 a9 e, x3 v
- (defun c:tuu () (setvar "cmdecho" 0)
, P! Q2 ~9 `1 [1 ?8 F v - (prompt "\nHay chon dong TEXT can gach chan ")4 B0 s% j4 }' i' e0 {* j! A/ O# ?
- (prompt "\nSelect objects: ") {) E: W- l- R/ Q: z8 c
- (command "select" "au" pause)- N/ p: E8 m) l7 |/ H: ~0 G
- (setq sstxt (ssget "p")7 L! K; K/ y7 w' w2 b
- sslen (sslength sstxt). B1 O% e% y( U% S+ ?3 e$ _4 Z
- ctr 0 )" y% O2 o: e# p# h
- (command ".undo" "mark")
1 }1 H- Q# g, `6 D5 T1 W0 t E - (while (< ctr sslen)
6 I9 R2 P: U! b+ o& H - (setq listxt (entget (ssname sstxt ctr))
* [( b4 ]: r* ^7 Z& F0 U - txttxt (cdr (assoc 1 listxt))
' P" U7 B; K4 g - enttxt (cdr (assoc 0 listxt)) )
: J1 V4 m ?: ?+ g' Y3 y - (if (= enttxt "TEXT")2 u% B, Z% Z+ |( w6 B! C0 V4 u
- (progn
* j5 u$ p) W. H1 E4 N - (setq testxt (substr txttxt 1 3))
, V8 l; Q7 f, l1 Y5 Z+ l; I - (if (or (= testxt "%%u") (= testxt "%%U"))
- e$ x& A9 m$ A7 M) r: [ - (setq newtxt (substr txttxt 4))7 o7 P$ k7 f% j0 a: L6 u( D n
- (setq newtxt (strcat "%%u" txttxt)) )
% l% M' p- [/ z$ ^; S* p - (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))- B; W! X" I: c9 J0 i& y" L. y
- (entmod listxt) ) )6 a8 U2 u+ } W# K8 \" \- G5 n
- (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))
2 Q, C. Q3 Y) |2 i- B! W! |* ] - 7 e3 P7 y* x" |# t6 S0 O5 V s
- ;;; ================ BAT -TAT CHE DO GACH CHAN TEXT =================6 M$ h. Q' B% L" ?4 a+ e5 K. O
- $ A5 E& a3 |% T' d z6 I' o- y
- (defun c:tob () (setvar "cmdecho" 0)
. R0 o- k+ X( j5 s$ r - (prompt "\nHay chon dong TEXT can gach tren dau ")
+ I2 t/ k& ]$ k2 G - (prompt "\nSelect objects: ")3 E6 N) ~, ]5 d% f* `8 n. X& I
- (command "select" "au" pause)/ m! T" h! J8 ?. ]6 {: P) `0 o
- (setq sstxt (ssget "p"); {& _' Z, b. y5 a) T/ x
- sslen (sslength sstxt)1 b8 i5 w G+ J$ K. L
- ctr 0 )
- ?/ A6 w7 X6 h. A) v1 y& e - (command ".undo" "mark")
0 A3 z V* D* _( X - (while (< ctr sslen)$ i( B# s) n6 j9 l+ H0 R, A* E* o4 }
- (setq listxt (entget (ssname sstxt ctr)): R8 u$ N3 T" Y( r
- txttxt (cdr (assoc 1 listxt))
0 q B* E( a2 @: m: O1 j* K; Z - enttxt (cdr (assoc 0 listxt)) )) _. | r' N* {# V& T
- (if (= enttxt "TEXT")) r$ ]- t% }5 w ?" [: ^
- (progn
[" U% o1 f! x4 m2 G" N# i - (setq testxt (substr txttxt 1 3))! D' g6 P0 P1 f& x
- (if (or (= testxt "%%o") (= testxt "%%o"))
6 p& E/ Y" _5 p" E - (setq newtxt (substr txttxt 4))
3 j$ A# P7 l3 g+ W+ @' U - (setq newtxt (strcat "%%o" txttxt)) )
+ x, W! l, Y$ ~' q) Z8 V - (setq listxt (subst (cons 1 newtxt) (assoc 1 listxt) listxt))0 Z* h; J) Q" r" E. |5 }7 s H
- (entmod listxt) ) )
& h: } M; H# h - (setq ctr (1+ ctr)) ) (setvar "cmdecho" 1) (princ))7 _" o; @# r1 _3 J
4 Q( z$ E' a2 F, o4 y: R6 y- ;;; ========================== Tim & thay the TEXT ==========================
$ l4 Z, b5 i2 I8 [( z
# `! B: b3 q8 r. ^6 r- ^- (defun frstring (str search replace / str1 str2 index find)
) {& p! U* i+ O# \ H; y' `% w2 z - (setq index 0) (while (<= index (- (strlen str) (strlen search))) (setq index (1+ index))' u7 C Z- T- V$ [- B0 s
- (setq find (substr str index (strlen search))) (if (= find search) (progn (setq str1 (substr str 1 (1- index)))
* j9 O0 t$ |1 v1 o& g - (setq str2 (substr str (+ index (strlen search)))) (setq str (strcat str1 replace str2)) ) ) ) (setq str str))
8 F* _0 r% b* D2 a5 ] - (defun hai (/ dial)
6 d# ?0 j, D. {) i( o, I - (setq dial (load_dialog "hai.dcl")) ;;goi dialog
8 P( s* @/ L: l0 }) N6 F! x. H - (if (not (new_dialog "find" Dial)) (exit)) ;;* f C( u P/ z/ v
- (mode_tile "find" 2); Tao dau nhac tai hop thoai
) j; m/ }5 X: G( ^, z - (action_tile "find" "(hai1)")
4 k( z0 K: {2 c! K - (action_tile "replace" "(hai2)")
. K9 X4 ]0 M! Z$ y0 @) n+ {8 _ - (action_tile "cancel" "(done_dialog) (exit)")
8 ~$ C# j1 |& @: b! T - (start_dialog) : q( ^: S1 L* a" k% A3 q n
- (unload_dialog dial))
! q' w8 B; v- j; c" P9 x - (defun hai1 () (SETQ str1 (get_tile "find")))0 N$ }8 _8 `- D6 R0 \
- (defun hai2 () (SETQ str2 (get_tile "replace")))$ p" `0 i% h1 } Y0 ?) \6 \
4 J: Q2 J' w+ l- (defun c:TTT (/ a str str1 str2 newstr taphop sodem)
8 J8 Y- P+ | J. N w3 F1 i - (hai)4 e3 a9 v/ l) U2 ^3 I
- (if (or (null str1) (null str2)) (princ "\nDu lieu khong hop le"). s6 G" R& h5 x6 l% \5 o
- (progn3 H/ d# q1 W( b# {$ ~
- (setq taphop (ssget '((0 . "TEXT"))))
; Y9 {/ z8 i3 e+ K$ W1 c - (setq sodem 0)7 t$ g4 ^- \, m! m
- (if taphop2 ` D% ^, O$ T. m# Q7 I6 ~
- (progn, x! k, _" Z9 J3 o. t3 B$ g# l
- (Repeat (sslength taphop)
' p( m7 L3 X1 Z ^: p3 {- f - (setq a (entget (ssname taphop sodem)))
( P1 l0 j/ R, r - (setq str (cdr (assoc 1 a)))
8 r& Q' D: R. m - (setq newstr (frstring str str1 str2))7 I4 {0 }6 d3 k: X( N! x
- (setq a (subst (cons 1 newstr) (assoc 1 a) a))8 l% {0 I/ [0 A5 t. w! I9 g
- (entmod a)& k: n2 |* ^( h# Y4 i6 u
- (setq sodem (1+ sodem)) ) )
! A4 w6 G" W" T4 V2 O! V. r" } - (princ "\nNone "TEXT" selected") ) ) ) (setq *error* olderr) (princ))0 Y5 \, A9 B9 c( B) `; F8 _
}! G3 k. F, A2 j: ]* u4 _- ;;;============================= CHTEXSTY.LSP =============================6 y; K7 m% V) x
- ) ^% T% B1 L5 B
- (Defun C:TXS () (Setvar "Cmdecho" 0) (Initget 1 "SE ST ") B4 p" ^) h' U/ q
- (Setq G (Strcase (Substr (Getkword "STyle/<SElection>:")1 2)))
% W, h P5 d, Q# ~2 v: O" x. D - (Cond ((= G "SE") (Setq A (Ssget)) (Setq B (Sslength A))
! t1 t. T% o8 u9 S" p# c& G - (Initget 1) (Setq C (Getstring "\nEnter new text style: "))
: c& U) k9 ~+ e - (Extang C) (While (> B 0) (Setq B (1- B)) (Setq D (Ssname A B))- E: g/ ~2 f1 i, l6 b J2 v% d
- (Setq D (Entget D)) (Setq E (Assoc 7 D)) (Setq F (Cons 7 C)): }* r" }. n6 s9 u. b/ T
- (Setq D (Subst F E D)) (Setq H (Assoc 51 D)) (Setq I (Cons 51 J))9 Z6 O% q/ C/ ]0 e5 u
- (Entmod (Subst I H D))) (Setq A nil)) ((Or (= G "ST") (= G ""))0 K7 H* |# p/ ]$ c2 U
- (Initget 1) (Setq A (Strcase (Getstring, Z6 Y2 ?8 h9 O" A# M; P
- "\nEnter text style to change: "))) (Initget 1)
# i! l! K% R( P - (Setq C (Getstring "\nEnter new text style: "))(Setq D (Entnext))
- k- y# P9 `. a+ f) j) ?4 r; {& N - (Extang C) (While D (Princ ".") (Setq E (Entget D)) (If# e2 _: w, U! t( f! P* M3 F+ ^
- (And (= "TEXT" (Cdr (Assoc 0 E))) (= A (Cdr (Assoc 7 E))))6 }6 ~8 U& A4 [
- (Progn (Setq F (Assoc 7 E)) (Setq G (Cons 7 C))
3 f9 `8 d- ]8 s* O- D - (Setq E (Subst G F E)) (Setq H (Assoc 51 E)) (Setq I (Cons 51 J))
! X6 v- O5 B; O3 O, _" X - (Entmod (Subst I H E)))) (Setq D (Entnext D))))) (Princ))
' a7 |' q3 R0 v0 _% Y$ V - ' Y7 @! X `- O: C+ G
- (Defun Extang (A) (Setq A (Tblsearch "STYLE" A))5 d% k9 O- v* I: B7 w3 D! X* O
- (Setq J (Cdr (Assoc 50 A))))
: a; M" s4 X8 }5 M
; k5 m- K# e1 N/ z. J* t' z7 b- ;;; ============================ DRAW CLOUD =============================
/ L+ ~. x u% e. R' z4 q
& g% D- u1 Y- o& e- (defun CLOUD (/ pt1 pt2 arc1 cnt ss la) (setvar "cmdecho" 0)
( i- J! l' G* S - (prompt "\nVe cloud (may) khong khep kin - Tu khep kin ve diem dau!")9 x) q; t$ f, d2 H+ |* |) n5 T6 D
- (setq la (getvar "clayer"))' Z- |) B) O+ w; b! t: l
- (command "layer" "m" "cloud" "c" "5" "" "")- v5 Q8 J: A* W9 d) n8 ~1 z7 X; A
- (setq pt1 (getpoint "\nEnter first point of Cloud: "))) r" K3 e* h' V w/ f, M6 j8 c
- (if pt1 (prompt "\nProceed in a COUNTER-CLOCKWISE direction..."))
' K8 M9 C1 i; @# p6 v: X - (setq cnt 1 ss (ssadd))/ u& `& U8 @$ G, h5 R9 Z
- (while pt1 (setq pt2 (getpoint "\nEnter next point - and close: "))+ k# V4 Z6 a# l( G( X) H
- (if pt2 (progn (command "arc" pt1 "e" pt2 "r" (/ (distance pt1 pt2) 1.75))3 _# o. Y7 {; r) B6 i d- L
- (if (= cnt 1) (setq arc1 (entlast) cnt 2) (ssadd (entlast) ss)) ))
! D0 f7 A1 |$ Q ?! C9 w - (setq pt1 pt2) ) (setvar "highlight" 0) (if (> (sslength ss) 0)
4 k: m5 q% x7 q7 z* I3 f* F - (command "pedit" arc1 "y" "j" ss "" "x")8 ]+ @8 a7 s, X
- (if arc1 (command "pedit" arc1 "y" "x")) ) (setvar "highlight" 1)' M( I. X( T& D# {1 M4 ]* Q
- (command "layer" "s" la "") (setvar "cmdecho" 1) (princ)) # K1 w2 L5 o% h. v( E5 E' [
- (DEFUN C:CLOUD () (CLOUD)) (DEFUN C:CLO () (CLOUD))/ ?% q+ ]3 {: _0 M! L7 _4 r/ \
3 h3 F G' e3 ?- ;;; ================================ Funtion-Dulieu ========================6 q9 w( w3 w; J0 {, f
- ;;; ================================ Funtion-Dulieu ========================
" ?3 h$ a% H) p8 G# q: |! C/ ~" c7 a - ;;; ================================ Funtion-Dulieu ========================7 P3 V) j8 d" E5 L
- y1 B7 q2 @ x* e+ I6 H2 ~
- (defun ha:nhap (kytu thamso) (princ kytu) (princ thamso) (princ ">: ") (setq key (getint)) (if key (setq thamso key)) (princ thamso) ); w5 \& X% v1 a, T7 I8 y
- (defun ha:thoat () (reinit) (setq Temp "Da thoat khoi chuong trinh"))
6 w* c8 o' G5 D2 P" C - (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))
1 c1 U" O# u: M( P( k) U6 c - (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) )
2 M( T4 x- }1 Y" s - (defun hauon (hauon1 hauon2) (command "fillet" hauon1 hauon2))
5 a; N5 i$ d9 q4 `7 V$ r/ H - (defun init () (setvar "blipmode" 0) (setvar "cmdecho" 0) (setvar "angbase" 0))7 l: z9 b% g4 U* `9 y) c
- (defun reinit () (setvar "cmdecho" 1) (setvar "osmode" 0))% ?6 E9 R P3 o
- (defun tichvecto (vecto1 vecto2) (apply '+ (mapcar '* vecto1 vecto2)))
+ Y" ~# {8 b$ V5 N, {1 c8 P) }# E - (defun vectophap (v01 v02 / vectochiphuong) (setq vectochiphuong (mapcar '- v01 v02)) (list (cadr vectochiphuong) (* -1 (car vectochiphuong))))
" J3 R9 J! B# ` - (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))): a5 \% T @" i* g* |
- (defun dtr (dtr) (* pi (/ dtr 180.0)))
, r% x( J8 I+ d% ?) q - (defun rtd (rtd) (* 180.0 (/ rtd pi)))
n( v9 o9 p' W
6 `3 |# c" a& u1 o9 f% `- ;;;==============================PROGRAME===============================
4 m% r- O' U h3 m- \9 z% q - ;;;=====================EditDiM Hien Hop Thoai Dep======================: f4 C! _) ?% U5 q' L
- ;;;==============================PROGRAME===============================
@& B r, v% m. G5 U - ( P+ M; X7 O/ k# K" R. V
- ;;Dth Edit Text, Dimtex & Attributes(Chu Co Thuoc Tinh)
) I! M4 H8 B. R9 ` - ;;Chay Cung Du Lieu.Lsp & Hai.Dcl1 Z f# W8 k: s. H8 s! F* V
- (Defun Hai_Edim (Chon / Dial State Str Oldlis Dimdefault Pt10 Pt13 Pt14 St Ang Dis Pt Hc)
( O) a* C: D: v2 n8 p - (Setq Oldlis (Entget (Car Chon))
7 k* p/ e b' l( Q! ~, S2 v - Pt10 (Cdr (Assoc 10 Oldlis))6 N- X+ f. r/ u5 e
- Pt13 (Cdr (Assoc 13 Oldlis))2 e& n+ F! |5 f7 w1 |5 P I
- Pt14 (Cdr (Assoc 14 Oldlis))
D. A* L2 s) J( |7 m - St (Cdr (Assoc 70 Oldlis))
5 u# J2 h2 _2 B6 I! X - Dimdefault (Cdr (Assoc 1 Oldlis))
/ P! Y4 ^3 ]' i/ }3 g- v - )
( q8 k2 ]" _! l" V% w' |0 Y - (Cond
% F5 y/ F) w* i7 {* I! } - ((Or (= 32 St)(= 0 St)(= 160 St))
- t) T' d$ A! w9 B6 r, _3 { - (Progn
. X" S# M: c9 ~( E: @ - (Setq Ang (Cdr (Assoc 50 Oldlis))" Z/ W: i' \6 E! y9 m
- Pt (Polar Pt13 Ang 500)1 P/ k) A4 R7 ?' s
- Hc (Lay_Hinh_Chieu Pt10 Pt13 Pt)# R) I6 l( ?& D A! E
- Dis (Rtos (Distance Pt13 Hc))
/ f/ H; ]# l, J; x3 t) _ - )0 L. `! ^& m. F* P% H
- )
7 ~4 ^9 Y) u& ?9 I# \2 W - )' S8 ]. d- ?; Z+ H' b; n
- ((Or (= 33 St)(= 1 St))
1 y) ^! c+ ?: y: k" V2 r - (Progn(Setq Dis (Rtos (Distance Pt13 Pt14)))))1 P- I* S) Q* A9 B
- );;End Cond7 m2 t' `4 i5 G! I* T M
- (If (= Dimdefault "") (Setq Dimdefault "<>"))* ~9 ]5 C8 V$ |% V+ [
- (Setq Dial (Load_Dialog "Hai.Dcl"))
. c" a8 @! {# z2 w# [8 B - (If (Not (New_Dialog "eddim" Dial)) (Exit))" P* p# ?4 }8 U Y" | n2 d
- (If (Or (= 32 St)(= 0 St)(= 160 St)(= 33 St)(= 1 St))
' L1 a/ I% x. D& N - (Set_Tile "text" Dis))' |5 B0 Z2 _, b* c" K0 z) _8 y+ L
- (Set_Tile "ha:edim" Dimdefault)* o% `4 n9 o, F) M* {& P! e' u, s
- (Mode_Tile "ha:edim" 2); Tao Dau Nhac Tai Hop Thoai$ m# a" R* \- Q+ h
- (Action_Tile "ha:edim" "(Setq Str (Get_Tile \"ha:edim\"))(Done_Dialog 3)")
: r: b4 ^- ^+ D( @6 C7 U3 d - (Setq State (Start_Dialog))(Unload_Dialog Dial)
% ]3 b3 ~, [' }- w& H - (If (And Str (= 3 State))0 W4 l3 N' c( U, i3 Q/ |# d
- (Progn( Q) e2 a% P* c; E. j. @4 X
- (Setq Oldlis (Subst (Cons 1 Str) (Assoc 1 Oldlis) Oldlis))(Entmod Oldlis)))& j0 x: U5 n3 d: S2 z, ?# m J+ G
- )7 g8 Q7 O' V9 s
- (Defun C:EH (/ Chon Name )
2 j5 X7 q! _$ b. c4 g$ \& M |6 a - (Defun *Error* (Msg)
2 [3 G! V' {- `$ T s, e( y" n - (Princ "\nerror: ")(Princ Msg)(Princ " ")
, K( {* z0 L4 @ - (Start_Dialog)(Unload_Dialog Dial)
3 k8 R3 n+ W2 S3 S) p: A7 D4 ~ - (Setq *Error* Olderr)(Princ)
& {! S; |( p+ c6 H z9 K& e3 G - )
' T+ |+ h. F7 A - (Setq Olderr *Error*)
9 E" J* M' Z, Z+ @. u - (Setq Chon T)7 d4 c `, U% z' v
- (While Chon6 {# k) X& d! V/ i: D# ?0 ?
- (Setq Chon (Entsel "\n\n\nSelect Text, Dimtext Or Attributes To Edit..."))
& |: C# n. K7 [8 j - (If Chon
7 Q& L0 e/ d& g+ Z. S) Y2 y - (Progn6 h# a0 H! Q/ i" I# j3 q \! e4 S0 z
- (Setq Name (Cdr (Assoc 0 (Entget (Car Chon)))))
9 c3 B0 i, v! h - (Cond
1 v- c4 x4 f/ E/ t' g - ((= Name "INSERT")(Command "Ddatte" Chon))
6 b% F% y; D$ n5 V, a, @, k - ((Or (= Name "TEXT") (= Name "ATTDEF") (= Name "TOLERANCE") (= Name "MTEXT"))(Command "Ddedit" Chon ""))% s- w# k y1 B4 N
- ((= Name "DIMENSION") (Hai_Edim Chon))
, [5 ~1 S5 o% Z' h' k2 t - )/ |3 t" U8 d$ z5 o, V" C
- );End Cond
% ?, a+ \/ @! B9 Q% a" z5 Z - );End Progn- s- G3 Y1 w- y, \: A( z! M- K
- );End While
6 J+ Y7 c- ~$ }9 n6 _' x4 r# ~ - (Setq Olderr *Error*)(Princ)
2 |1 x- b7 x: }3 Y/ r - );End Program7 t9 k3 H: e! h/ y4 y
9 k3 ]% i3 C* V" X- ;;;====================DDeditDim=====================! ]) i- @% X5 I
- ;;;=====================Hai.DCL======================' s9 \$ F0 x. p+ w) D1 A' e
- ;;;====================DDeditDim=====================% D5 V% U) E5 b$ ?
- ( D! F+ J U8 [% W* `% S
- ;;Dth Edit Text, Dimtex & Attributes(Chu Co Thuoc Tinh)" T! p' R1 m' a
- ;;Chay Cung Du Lieu.Lsp & Hai.Dcl
6 M% b' |3 }5 s' _) a - (Defun Hai_Edim (Chon / Dial State Str Oldlis Dimdefault Pt10 Pt13 Pt14 St Ang Dis Pt Hc)+ @/ M6 u( @5 B5 \, K6 {+ R3 a/ C
- (Setq Oldlis (Entget (Car Chon))
8 X c7 p! W8 Z( n( V - Pt10 (Cdr (Assoc 10 Oldlis))
" a, h5 l7 Q D! s' i - Pt13 (Cdr (Assoc 13 Oldlis))
' m# G* Y2 _. d - Pt14 (Cdr (Assoc 14 Oldlis))
0 b- `$ [+ i* g$ ] T$ u - St (Cdr (Assoc 70 Oldlis))* i5 C! W6 i8 I5 N$ ]
- Dimdefault (Cdr (Assoc 1 Oldlis))4 Q2 V1 N, e/ @- ~. v B
- )
+ y1 G, ^; F8 V: T - (Cond2 ?/ _" ~: r& x" B! P
- ((Or (= 32 St)(= 0 St)(= 160 St))
) S9 @$ a6 V/ w. H% c) ~ - (Progn
5 E4 s: @6 n: P% }6 @ N - (Setq Ang (Cdr (Assoc 50 Oldlis))
2 ?5 y5 L9 S# _" ~, L- R5 ? - Pt (Polar Pt13 Ang 500)/ J9 i' f3 r1 Y$ h& X5 w) U$ @
- Hc (Lay_Hinh_Chieu Pt10 Pt13 Pt)
+ g. y e1 r% f4 A - Dis (Rtos (Distance Pt13 Hc))5 O, j7 w! l0 d' D8 z2 x
- )
+ e6 ^) E1 H1 S4 n, ~ - )" T6 ^* p" O" c+ o$ P
- )% p& n; H* z% a' ?# I8 d
- ((Or (= 33 St)(= 1 St))9 q6 U' d/ {9 i$ M4 J1 v) W4 f
- (Progn(Setq Dis (Rtos (Distance Pt13 Pt14)))))
5 o, B- k4 E5 W. k4 C2 D - );;End Cond
: j+ c' h7 g* b9 U% ^7 ^/ u - (If (= Dimdefault "") (Setq Dimdefault "<>"))5 S4 Z' y7 O2 l7 W r. o" k2 A, {
- (Setq Dial (Load_Dialog "Hai.Dcl"))
. t+ @+ V, l. P7 f0 T - (If (Not (New_Dialog "eddim" Dial)) (Exit))
3 }* ~! U9 R# X( o( C. W - (If (Or (= 32 St)(= 0 St)(= 160 St)(= 33 St)(= 1 St))
( ]4 v. l* ^% r, P0 {' D - (Set_Tile "text" Dis))
5 n. O5 M7 x. i2 o- Y! y - (Set_Tile "ha:edim" Dimdefault); i8 W- @- x8 C: p) M9 Q2 k$ N
- (Mode_Tile "ha:edim" 2); Tao Dau Nhac Tai Hop Thoai- P! M- }/ v2 |" d) d
- (Action_Tile "ha:edim" "(Setq Str (Get_Tile \"ha:edim\"))(Done_Dialog 3)")
9 C; Y, j V% b1 Z# d1 `1 h - (Setq State (Start_Dialog))(Unload_Dialog Dial)
4 N8 I! `9 S- f, c j2 ] o/ u - (If (And Str (= 3 State))
" M) p9 O) T: L+ R; a - (Progn
" J6 G8 P% c; I - (Setq Oldlis (Subst (Cons 1 Str) (Assoc 1 Oldlis) Oldlis))(Entmod Oldlis)))
% ~/ F' C$ g% k h - )
( x7 @, E' |: i8 p# D! f; i- L - (Defun C:EH (/ Chon Name )
$ A+ M# @. z8 j& k) p9 d9 G
. s3 J6 T0 C% P# c6 ]6 L- ;;;********************Du Lieu********************4 o& z2 ]5 w' W0 m+ `1 k
- + p6 z4 V! V8 x& o. p' h/ O9 w: A
- (Defun Ha:Thoat () (Reinit) (Setq Temp "Da Thoat Khoi Chuong Trinh"))4 |2 q! f. y- d+ B5 N
- (Defun Hacat (Hacat1 Hacat2 / Hacat3 Chon)
( z- [; [4 W0 W! d+ g" v - (If (And (/= Hacat1 Nil) (/= Hacat2 Nil))% ], l+ N! q# E+ z: g" L& H" e: _
- (Progn/ J1 |+ @7 c5 W; s. T
- (Setq Hacat3 (Polar Hacat1 (Angle Hacat1 Hacat2) (/ (Distance Hacat1 Hacat2) 2)))# u% ^' c3 Z% O! c3 {
- (Setq Chon (Ssget Hacat3))2 l8 ?7 H$ |" I) ^
- (Command "Break" Chon Hacat1 Hacat2)
( r8 L: O! O% `4 u! \, z" a - )9 l' l) }5 y6 p9 S+ C4 M1 g0 O
- )/ P1 h4 V- R0 p" Q3 K. }
- (Princ)( t8 K* Q: ]6 n
- )
p0 @ N1 O* h( k - ;;
, S" x& C, w4 B6 p - (Defun Hauon (Hauon1 Hauon2)(Command "Fillet" Hauon1 Hauon2))
3 k _8 P% G; @+ X9 x0 h3 E* G T1 w - ;;
8 X7 \0 B3 T+ U+ u0 w a - (Defun Taolop (Mau Lop / A)(Setq A(Tblsearch "Layer" Lop))(If (Null A)(Command "Layer" "_N" Lop "_C" Mau Lop "")) (Setvar "Clayer" Lop))) u5 E1 g% l1 F8 o4 B
- ;;+ l# w5 j. [. }0 m/ o
- (Defun Init ()(Setvar "Blipmode" 0)(Setvar "Cmdecho" 0)(Setvar "Angbase" 0)), d7 W9 ^, j" h4 g b- x' O9 C
- ;;
5 p* }1 g: D; x B+ I - (Defun Reinit ()(Setvar "Cmdecho" 1))9 @: w5 E* W% U
- ;;
1 x( }( C+ U* D8 h5 l5 t6 m: y - (Defun Tichvecto (Vecto1 Vecto2)(Apply '+ (Mapcar '* Vecto1 Vecto2))); w4 t$ o, v# b
- ;;
" K9 ]' @6 T( o9 o9 w - ;;Cho 2 Diem Tinh Ra Vec To Phap" M3 {) v' `1 Y4 }* w1 T5 s
- (Defun Vectophap (V01 V02 / Vectochiphuong)(Setq Vectochiphuong(Mapcar '- V01 V02)) (List (Cadr Vectochiphuong) (* -1 (Car Vectochiphuong))))! _2 l# |# Z% I4 c$ x
- ;;Xac Dinh Vi Tri Hinh Chieu 1 Diem Len 1 Duong Thang
5 V. Q6 L7 B1 ~* P1 N1 S - ;;Da Biet 2 Diem Thuoc Duong Thang
* e; M7 P, H) s/ E - (Defun Lay_Hinh_Chieu (Dc1 P1 P2 / Hc Dc2)
6 ?3 R! a+ `9 S: T - (Setq Dc2 (Polar Dc1 (+ (/ Pi 2) (Angle P1 P2)) 100)) k( B2 d9 o$ d+ x3 _# Q
- Hc (Inters P1 P2 Dc1 Dc2 Nil)))
. S% {' e) w* ^( y - ;;Xac Dinh Khoang Cach Tu 1 Diem Len 1 Duong Thang$ P- B$ t' R3 p& q
- ;;Da Biet 2 Diem Thuoc Duong Thang
7 a2 E) x9 g1 y! O& M2 ` - (Defun Khoangcach (Dc1 P1 P2 / Dc2 Hc)
% w* R. P, b) U) u - (Setq Dc2 (Polar Dc1 (+ (/ Pi 2) (Angle P1 P2)) 100)
. [8 {2 l( j1 U' z" b - Hc (Inters P1 P2 Dc1 Dc2 Nil))
9 ?7 O& O7 k2 Q) \ - (Distance Dc1 Hc)
, b! U- K- ~; |' [ - )
, m" h5 z6 }* V0 ]; z# Y' n9 |- o - (load "nhapcua.lsp")2 T+ `; d4 k( D7 v. a
- (Defun *Error* (Msg)
$ X* E3 j# l0 k( v$ c8 |* s! d - (Princ "\nerror: ")(Princ Msg)(Princ " ")
1 G0 B& h* r& v$ p6 T: I: |1 T - (Start_Dialog)(Unload_Dialog Dial)
/ H, X1 k. f5 i/ s - (Setq *Error* Olderr)(Princ)
* W/ l; ~* T, K3 A - )1 v! R7 j2 N5 I" N, A8 ] _
- (Setq Olderr *Error*) O) C' h" U+ n! y/ j0 m
- (Setq Chon T)4 j: t3 A% J! u0 S6 Z* I, Z3 Z' P1 q
- (While Chon
2 I1 {" |* ^$ G0 M, \# v* u - (Setq Chon (Entsel "\n\n\nSelect Text, Dimtext Or Attributes To Edit..."))
5 r. X' a% }1 J {3 |+ w; ` - (If Chon2 `% k8 z5 [8 c" w; s. O6 @+ h
- (Progn- { g6 b8 l8 V+ J7 Y# z
- (Setq Name (Cdr (Assoc 0 (Entget (Car Chon)))))
$ `) u( B+ x1 z! d" c& s - (Cond2 e) k, e' V! j w; p
- ((= Name "INSERT")(Command "Ddatte" Chon))! o- t) T/ K6 r5 { w7 t
- ((Or (= Name "TEXT") (= Name "ATTDEF") (= Name "TOLERANCE") (= Name "MTEXT"))(Command "Ddedit" Chon ""))0 ~/ A2 e* \$ D0 o9 b& n& \
- ((= Name "DIMENSION") (Hai_Edim Chon))' b7 y" |" B9 M% `
- ): r: s7 I, B: P6 ~* }) G4 h a
- );End Cond
4 _6 n# c2 t" c1 \' z - );End Progn% j* s) m! j* M
- );End While
+ @ L( }9 U' T - (Setq Olderr *Error*)(Princ)
" u8 L& M g5 l o - );End Program: }. i4 j, R( A' a& A+ W
) X( X5 u8 W6 z+ t* M9 v' G- ;===================HAI DCL Nhapcua.LSP De chay Hop Thoai EditDiM===================: V3 j1 t* J8 V D& p
- ;====================================Nhapcua.LSP====================================
9 X) ~6 w. d: _2 @, c - ;===================HAI DCL Nhapcua.LSP De chay Hop Thoai EditDiM===================
) P. ]7 m4 h0 b; f - # }8 g( L, v; B3 B0 p+ i- ^4 X
9 U4 V, W5 w/ U# ]) E
8 W, A9 T; U, N; e" q- ;*******************;*******************;*******************;*******************) K& v) }2 k+ \$ W* y
- ;****K E T C A U****;****K E T C A U****;****K E T C A U****;****K E T C A U****
; O8 x3 r) ?3 W5 {% n - ;*******************;*******************;*******************;*******************! N$ o, r8 k; {
- 8 G$ H; y7 ^0 G1 x0 |
- ;VE HINH BINH HANH
1 @' Z$ E' a" m* s$ m' m8 ^- }; X - 2 o5 q }! I" w! u" h$ d# f
- (defun c:binhhanh (/ p1 p2 p3)0 C/ j1 x) m/ T
- (setq p1 (getpoint "\n Nhap diem thu nhat:"))
5 W6 B- G# S7 Q, P% X - (setq p2 (getpoint p1 "\n Nhap diem thu hai:"))3 }7 W4 x0 S* Y: }$ N/ S$ L
- (setq om (getvar "osmode"))
" B7 K" S" A+ r/ L( y - (setvar "osmode" 0) e& f5 e* e* y3 B" S3 f6 e
- (command "line" p1 p2 "")
$ b- J/ c1 _4 F$ q& p) |% @ - (setvar "osmode" om)
+ z. f, W* g2 x- t3 F - (setq p3 (getpoint p2 "\n Nhap diem thu ba:"))
; \( Z( @8 X0 m( G o/ D% S5 F$ e- M6 J - (setq a (angle p2 p1))6 }( z4 b% a3 l7 f
- (setq d (distance p1 p2))* c/ S& M: Q* I/ C k
- (setq p4 (polar p3 a d))2 V+ n& U9 x0 ?' T- n
- (command "OSNAP" "none")9 N1 a8 h5 m6 X4 b. P! s
- (command "erase" "l" ""). ?4 g% R) m J/ E& z9 K
- (command "pline" p1 p2 p3 p4 p1 "")
& P7 d, q$ z+ j1 F* I% |: O& v - (setvar "osmode" om)+ [8 f. q% i2 Y
- )0 H& `7 j1 H9 g: u
- , F c; X9 s. g, T) t* U0 T5 l
- ;VE LUOI COT
2 T1 J4 |7 Y! h. K - & P7 J g1 Q% Z/ M
- (defun c:LuoiCot ()
5 Z) [+ v. {. a1 ? - (setq om (getvar "osmode"))4 X; L4 K& u4 A
- (setvar "osmode" 0)* x# G: U$ Y# p( C* _. x
- (setq tile (getreal "\nCho biet Ti Le ve 1/x, x="))! _6 R* T1 J; l! a4 Z
- (setq p0 (getpoint "\n Chon Basic Point:"))
5 C; y5 |% f0 \! L/ k4 ? - (setq nc (getreal "\n Nhap chieu ngang cua cot : "))
/ @& ~" c& B, d0 \& q - (setq dc (getreal "\n Nhap chieu doc cua cot : "))
' s- T9 ]: d4 J+ r( U, c9 ` - (setq p1 (polar (polar p0 pi (/ (* nc hstl) 2 tile) ) (* pi 1.5) (/ (* dc hstl) 2 tile) ) )
; \2 x( D1 M. z R! a) ]' h - (setq p2 (polar (polar p0 0 (/ (* nc hstl) 2 tile) ) (* pi 0.5) (/ (* dc hstl) 2 tile) ) )
. d0 @7 Y' v$ {6 A. d - (command "rectang" p1 p2)
4 }9 l+ X+ O. c6 r - (command "hatch" "solid" "l" ""). f# v$ R3 K. |! y$ K' \
- (setq bcn (getreal "\n Buoc cot theo phuong ngang : "))" |8 w3 m- _: \8 S
- (setq nn (getint "\n So buoc cot phuong ngang : ")), K( V1 u2 Q) D
- (setq w1 (polar (polar p1 pi (/ (* nc hstl) 2 tile) ) (* pi 1.5) (/ (* dc hstl) 2 tile) ) )
. {7 |- T9 v; \) o - (setq w2 (polar (polar p2 0 (/ (* nc hstl) 2 tile) ) (* pi 0.5) (/ (* dc hstl) 2 tile) ) )
$ r# S+ T% r7 m5 g) w; a - (command "select" "w" w1 w2 "")
8 K1 [6 h& V, X% ^9 g - (command "array" "p" "" "r" "1" (+ nn 1) (/ (* bcn hstl) tile) )6 w8 P- e3 ^- y
- (command "line" (polar p0 pi (/ (* 1000 hstl) tile)) (polar p0 0 (/ (* (+ (* bcn nn) 1000) hstl) tile) ) "")
( }1 [! B+ ?& {/ Y, M* p% I+ `/ i - (setq w1 (polar (polar p0 pi (/ (* hstl 2000) tile)) (* pi 1.5) (/ (* hstl 2000) tile) )); N4 O/ B# u6 K2 y* a9 }! J
- (setq w2 (polar (polar p0 0 (/ (* (+ (* bcn nn) 2000) hstl) tile) ) (* pi 0.5) (/ (* hstl 2000) tile) ))
4 U/ I! \0 k1 R# \0 Q" u2 R, z Q - (command "zoom" "w" w1 w2)) j8 Y. ]% o+ }6 E
- (command "select" "w" w1 w2 "")
1 y, D% P+ X, S. z$ V1 T$ Z - (setq bcd (getreal "\n Buoc cot theo phuong doc : "))7 [% d4 a, U" r5 Z" \
- (setq nd (getint "\n So buoc cot phuong doc : "))6 ^$ X" p/ m3 U9 S: W
- (command "array" "p" "" "r" (+ nd 1) "1" (/ (* hstl bcd) tile) )
# l/ b4 r/ `, }) }6 @: t% C - (command "line" (polar p0 (* pi 1.5) (/ (* hstl 1000) tile)) (polar p0 (* pi 0.5) (/ (* (+ (* bcd nd) 1000) hstl) tile)) "")- X) @/ f3 _' t" D
- (command "array" "l" "" "r" "1" (+ nn 1) (/ (* hstl bcn) tile) )
0 `6 A1 r4 {6 B% }6 E+ { - (setq w2 (polar w2 (* pi 0.5) (/ (* (+ (* bcd nd) 2000) hstl) tile)) )
% ]$ y9 f/ l' V1 a- y - (command "zoom" "w" w1 w2)0 o3 g/ H5 X% ^2 W# f
- (setvar "osmode" om)
1 O& U) R" ^$ W x; b! X - )& e7 w5 J2 G8 M; Y
- ; h' [0 G2 A" q5 e) |8 C' ^
- ;VE CUA DI0 B ~2 N7 t. d. {9 l7 o
- ( Q8 K2 v( A& j" V# \" q$ i
- (defun c:cuadi ()
4 q3 P' ?4 k' R& T - (setq om (getvar "osmode"))
( y" c Y) Q! I9 a5 D - (setvar "osmode" 0)) H, \/ K! S' `
9 B! G7 c( e5 j/ ]7 `- (setq tile (getreal "\nCho biet Ti Le ve 1/x, x="))
2 U6 O5 f. o( \- P0 r - (setq b (getreal "\n Nhap be rong cua : "))+ t, b: T5 Q- H) K' W" w* A
- (setvar "osmode" om)1 P; ^! m3 Q6 O
- (while (< 0 1)
, X3 M3 F2 F+ T" z; l - (progn
8 y) q; a1 n4 p4 Y& X N - (setq p0 (getpoint "\n Chon Basic Point:"))
( F% y8 p# p3 f- \6 | - (setq p1 (getpoint p0 "\n Chon diem de xac dinh huong cua cua:"))
, y( s x/ c1 u( _" c( V - (command "osnap" "none")$ U6 x% W! e5 L6 B" W) \: z
- (setq p2 (getpoint p0 "\n Chon diem de xac dinh huong mo cua:"))
1 ~" e9 @1 l. p) h" S. L7 Q+ @3 d0 Q - (setq a1 (angle p0 p1))9 h' H8 U) b7 T$ A
- (setq p1 (polar p0 a1 (/ (* hstl b) tile)))5 G) U0 X( V ~9 w' R( b
- (setq a2 (angle p0 p2))
& K9 G" t5 d0 o2 m6 Y8 V - (if (< (- a2 a1) pi) (setq a3 (+ (/ pi 2) a1)) (setq a3 (- a1 (/ pi 2))) )
# I% w# C7 l3 k8 I, F9 s, I' v - (command "pline" p0 "w" "0" "0" p1 (polar p1 a3 (/ (* hstl 40) tile)) (polar p0 a3 (/ (* hstl 40) tile)) p0 "")- h/ c' F3 U; b
- (command "rotate" "l" "" p0 (/ (* (- a3 a1) 180) pi))
( a% y# t9 D8 ?) D - (command "arc" "ce" p0 p1 "a" (/ (* (- a3 a1) 180) pi)) * y9 G I, a: w- k
- (setvar "osmode" om)
2 P& F" u4 [: h% l$ n2 g4 c - ))( w5 O4 Y' N6 b6 M$ v
- )
A/ q% @' J6 V2 F: E8 g - 2 g2 P9 t6 N# ~ ^# L
- ;VE CUA SO
Y# ~5 W* i: e+ ?8 M8 y# Z
% {& H3 O) P/ }* y- q8 E& y- (defun c:cuaso ()
8 m8 Y% E5 W; x3 f/ a# j) w) u e+ I - (setq om (getvar "osmode"))2 o" e7 a1 \4 S& E- c5 e
- (setvar "osmode" 0)" ^( ^; G' O2 u
- l8 Z9 `; E/ C: K$ t- (setq tile (getreal "\nCho biet Ti Le ve 1/x, x="))
9 E+ h, i6 f( a* T7 I+ R* ? q" k - (setvar "osmode" om)
0 F0 ~' f4 @8 e; f# s$ W/ \ - (while (< 0 1)
. L9 k! ` t# o7 x6 H$ A8 a& A5 p" ? - (progn
/ o* Z# a# x- `0 n$ a9 d - (setq p0 (getpoint "\n Chon Basic Point:"))
) \( [/ M$ }- F - (setq p1 (getpoint p0 "\n Chon diem de xac dinh be rong cua:"))8 p$ b# `1 V; h1 g' G
- (command "osnap" "none")
% @6 _) a; u) U' W7 v - (setq p2 (getpoint p1 "\n Chon 1 diem o trong nha de xac dinh huong cua so:"))* U. w& t* |# Z' C- S
- (setq b (distance p0 p1))
* z7 s/ m, ?, @& y6 V - (if (< b (/ (* hstl 600) tile)) (setq du 50))
8 w0 \' U: a }: @ - (if (> b (/ (* hstl 600) tile)) (setq du 150))0 t5 W. M. U$ N+ O% j8 [1 Z
- (if (> b (/ (* hstl 1800) tile)) (setq du 200))0 [5 o, W" N% b- b& }& }) }- g
- (setq a1 (angle p0 p1))+ \1 Y0 h7 T+ M' O& N& i% M3 s
- (setq a2 (angle p0 p2))
i1 o8 [! V# \3 l8 A - (if (> a2 pi) (setq a2 (- a2 (* pi 2)) ) )4 u- i5 H4 i- Z5 W
- (if (> (- a2 a1) 0) (setq a3 (+ (/ pi 2) a1)) )
, K2 t6 q0 E6 f" _! T - (if (> (- a1 a2) 0) (setq a3 (- a1 (/ pi 2))) )2 \8 B* G+ Y/ z+ f& o2 ^8 K# L
- (command "pline" p0 "w" "0" "0" p1 "")$ S* _1 a% p$ v5 V
- (command "pline" (polar p0 a3 (/ (* hstl 50) tile)) (polar p1 a3 (/ (* hstl 50) tile)) "")
6 F* J, A3 H% d1 D - (command "pline" (polar p0 a3 (/ (* hstl 100) tile)) (polar p1 a3 (/ (* hstl 100) tile)) "")
6 t( y5 T* @3 |2 ^ Y( O; \ - (command "pline" (polar p0 a1 (* (- du) (/ hstl tile))) (polar (polar p0 a1 (* (- du) (/ hstl tile))) a3 (* -100 (/ hstl tile))) 3 p6 c: l; Q$ v$ K8 ]% c, n4 p1 H
- (polar (polar p1 a1 (* du (/ hstl tile))) a3 (* -100 (/ hstl tile))) (polar p1 a1 (* du (/ hstl tile))) "")
) h' i5 H7 n ?2 V L* ]8 m - (setvar "osmode" om)- }& W; ]8 E% Q/ f5 g
- ))
3 s, W# b1 c; `0 z6 f" M - )' p& s' e, Z6 i
: J2 ~6 P& x, _1 [$ K9 G7 w g- ;;;=== General Utility Functions ===8 w' e7 n/ \' p! T& o
- , S% B# y% N4 M9 Y. y' ^, {
- ; R12 compatibility - In R12 (acad_helpdlg) was an externally-defined
A. d( ]* A& E6 ^4 g - ; ADS function. Now it's a simple AutoLISP function that calls the - }$ ?" p7 w+ v" X$ g+ A- q
- ; built-in function (help). It's only purpose is R12 compatibility.
" m# x, o5 ]- c* f8 G6 b0 u# W - ; If you are calling it for anything else, you should almost certainly ( L4 C6 l3 v% f
- ; be calling (help) instead. " M) Y) e, f& \+ k# W9 _* N6 n" V
- 5 \3 K S3 c; P6 I* b& X/ Y
- (defun acad_helpdlg (helpfile topic)
" t" e1 k* i% \0 _7 } - (help helpfile topic)
! N+ b! `6 o( Q8 y; W* o - )! c N* U/ L- T- w
- - c, o: I; \3 w- R5 r- c+ [
9 l7 |, X& O1 Q9 X+ Y3 ` B! w- (defun *merr* (msg)
) H: m& |# q; P, M; ]3 \ - (setq *error* m:err m:err nil)/ Y' w/ @, M* `$ Z4 q+ Z
- (princ)1 H; q" T/ n7 D
- )1 x- F2 }' u' t0 m2 S. b
f1 w' L7 M$ e0 h5 z- (defun *merrmsg* (msg)
/ c4 \0 O0 E. E, {$ |. _ - (princ msg)
- P( ~) L G; {- B - (setq *error* m:err m:err nil). I% K( m' w# U3 I& l0 ] d
- (princ)" `4 I9 j! J6 d. s: I3 a* ^
- ) `9 j* m' F6 {/ V$ a
, y+ ^: Z" o9 M7 U/ b# B1 m- ;; Loads the indicated ARX app if it isn't already loaded
9 |1 K4 U3 q o7 ]! v$ S, C0 e - ;; returns nil if no load was necessary, else returns the% Y/ E* M3 p. i' m4 _$ Y* {
- ;; app name if a load occurred.
# d9 ]; X3 n ]4 u: e - (defun verify_arxapp_loaded (app) " }7 s% }/ k0 e' L5 ]
- (if (not (loadedp app (arx)))8 L; ~. E$ d! }* }
- (arxload app f)
; j- M) }1 ~1 x9 F- p6 t r8 h- l - )% D' |* Z! p9 G
- )+ U3 x: U* p/ y5 l; S
- ! X- `# z. O0 h: s Z
- ;; determines if a given application is loaded...
$ R+ v0 l6 F+ g) }0 o/ M& J - ;; general purpose: can ostensibly be used for appsets (arx) or (ads) or....
1 q* j3 A3 i! K9 |+ |: k, V6 V - ;;; j7 U4 V, e. X( b- w
- ;; app is the filename of the application to check (extension is required)
0 h8 n! I% Y$ u7 U9 i - ;; appset is a list of applications, (such as (arx) or (ads)
) o4 R) i7 Y6 @7 W7 Y y' I - ;; . Y/ s& T* K: \
- ;; returns T or nil, depending on whether app is present in the appset* v+ |. M$ d" B) Y, s+ e! P
- ;; indicated. Case is ignored in comparison, so "foo.arx" matches "FOO.ARX"
; o4 d$ O; p$ ]6 _' H+ B - ;; Also, if appset contains members that contain paths, app will right-match
: @/ ]) F9 L" N) m - ;; against these members, so "bar.arx" matches "c:\\path\\bar.arx"; note that% j; d& K/ ]: i/ I' f' g2 ~. \5 E( p
- ;; "bar.arx" will *not* match "c:\\path\\foobar.arx."
1 T" O1 W) Z! j) b. Y8 T - (defun loadedp (app appset)- D! s% P; p) Y6 p
- (cond (appset (or ( V6 I" W" E5 M" i2 _1 D d( {6 E
- ;; exactly equal? (ignoring case)
8 p( R5 H' M0 j* l, \* f - (= (strcase (car appset))( a4 A' _ s! `6 X8 j) \
- (strcase app))0 `* |$ F3 f0 M+ {7 k3 d
- ;; right-matching? (ignoring case, but assuming that
; ^! r) a3 M' A& ~# t2 T - ;; it's a complete filename (with a backslash before it). r7 p, n V, L. K# F; G8 x
- (and
z( N8 F$ | \; n) p - (> (strlen (car appset)) (strlen app))
9 ]! q! ]# ^! e0 M. A! l2 ]! c - (= (strcase (substr (car appset)
5 j% Z2 M4 m2 h0 V - (- (strlen (car appset))
5 i* L$ E* w3 d( C3 C6 h k - (strlen app)
8 v4 S$ F+ E7 r$ I3 V - )
9 w" V) K, `, y4 k8 d5 K5 d% m( W: Y7 C4 } - )3 M8 S- \8 ~3 P! y+ T2 w1 K: K/ F2 C
- )
5 D+ A4 {5 R1 Y - (strcase (strcat "\\" app))) H, Z1 q4 ~- n0 k H
- )0 x( ^ E4 V% n/ P6 Q4 |& h+ b
- )
! d) Q1 p( k9 R+ ~1 W - ;; no match for this entry in appset, try next one....3 y; {7 U) @& u0 A0 t# j+ N* x
- (loadedp app (cdr appset)) )))1 w) \' d/ r. j) o6 d
- )# I, F7 f8 r4 n( o1 f
- 8 P$ Z4 r5 T& l% E! C" w' v* m
- 1 O" K% O" ?& e1 E1 [0 z
- ;;; ===== Single-line MText editor =====
. a" b/ ]! B) e: E% ^ - (defun LispEd (contents / fname dcl state)
2 V1 M9 K- o0 b' i5 _ - (if (not (setq fname (getvar "program")))2 L1 _, e6 G% n; e8 ?$ B
- (setq fname "acad")
1 U2 K+ E. w2 _2 E - )
/ M: l( A# h3 { A* G - (strcat fname ".dcl")" `. I- O3 I0 @3 g
- (setq dcl (load_dialog fname))+ F$ j O2 Z9 q: l$ u; E! G0 |
- (if (not (new_dialog "LispEd" dcl)) (exit)): \0 {7 X. ]5 g) {
- (set_tile "contents" contents)
# L9 f4 Z. G4 z0 d9 f - (mode_tile "contents" 2)5 D" x r4 O& }, B5 y
- (action_tile "contents" "(setq contents $value)")
$ ]/ D( _7 D2 b - (action_tile "accept" "(done_dialog 1)")1 ~/ Y' x7 z" x/ x% E$ v/ I# h
- (action_tile "mtexted" "(done_dialog 2)" ). Y1 M ^" T& v) l" `" j
- (setq state (start_dialog))# y1 E4 h$ t* O0 ~/ o& ^% A; @
- (unload_dialog dcl)- M$ I8 O! O* d" ^
- (cond
* b2 x- N7 c) x! X - ((= state 1) contents). M! _, |7 n" L; k7 D5 V
- ((= state 2) -1)) \( }( S* H8 v3 T M
- (t 0); [( H" x |3 M/ \, s- T# u! W
- )
+ L' g* s( K7 D! q - )8 l9 ]% O2 L6 w' c2 r
- ' V) M _/ N0 U& G B* V5 _ H
- ;;; ===== Discontinued commands =====: _% X: e1 {7 v1 G
- (defun c:ddselect(/ cmdecho-save)
9 H5 p- }6 W6 T" y# m* Y - (setq cmdecho-save (getvar "CMDECHO")) b7 ?2 L6 r: H
- (setvar "CMDECHO" 0)8 q( L. f5 ]" L3 |5 y
- (command "._+options" 7)' }' q7 r5 N3 W3 Y& G! m) o& k, o
- (setvar "CMDECHO" cmdecho-save)
2 }0 A. O8 M# Y/ ^9 d+ ?- f$ V - (princ)% @) g3 X5 W) T( j2 `0 U, z X
- )' h- ]' x1 F( ]8 g s
- # c0 S" Z9 q; e+ `5 O T! L9 d
- (defun c:ddgrips(/ cmdecho-save)
L! L4 n' ?* w; U+ V - (setq cmdecho-save (getvar "CMDECHO"))
* p7 m0 j: Y6 e0 N* S/ I - (setvar "CMDECHO" 0): B9 _! y- m4 l5 x- H) u
- (command "._+options" 7)1 `, [' J; `% Z2 u9 w0 k4 X8 I/ F
- (setvar "CMDECHO" cmdecho-save)' L# l6 h* s! x) ^* ^
- (princ)' H! A6 g# z: q4 J- A$ s
- )! Y7 S/ O! A4 I1 F i) i
- ( n. J# Z# e9 B( U% J6 t6 F
- (defun c:gifin ()2 C S% E( X2 N/ O
- (alert "\nThe GIFIN command is no longer supported.\nUse the IMAGE command to attach raster image files.\n")4 C7 V. h$ K7 W7 ]
- (princ): g" X2 F a/ Y
- )
7 S( |$ S9 u5 t
1 `( ?4 c: f; @$ r) K1 Q- (defun c:pcxin ()
/ M* X' E/ O- Z, _# c - (alert "\nThe PCXIN command is no longer supported.\nUse the IMAGE command to attach raster image files.\n")
( T# V' m9 e& v) ^: C- V6 `6 t0 i - (princ)- J* o" h* A4 q% T4 d: o
- )
4 T! ~9 C7 k( y$ ^ N" a
3 Y) ?1 A6 V4 {: b: y2 r# ]# h- (defun c:tiffin ()
/ W4 h- y2 {, H! H* [( D# Y - (alert "\nThe TIFFIN command is no longer supported.\nUse the IMAGE command to attach raster image files.\n")+ H# v: @0 E T/ G2 C$ K' _; s+ g
- (princ)" u$ H5 |/ n0 z+ B$ b! i% K# o* X/ R
- )
) r8 O) h. s) U' G$ h! K6 g4 A3 ] - * f& s9 S `+ N2 i) }4 C! E
- (defun c:ddemodes()# Y+ h& ^1 p- ^
- (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.")- a |% J8 a2 R; h8 H. S Y+ q8 c
- (princ)
) C' e; Q6 v8 B1 X - )
7 O+ j* u- {( k, U, s/ D
+ \0 |' D7 c' a$ @1 N1 W6 Q9 E- (defun c:ddrmodes(/ cmdecho-save)/ x$ J2 `0 Y5 H2 V, A/ T& c
- (setq cmdecho-save (getvar "CMDECHO"))
% X+ c# }0 a: Z; x3 n& O - (setvar "CMDECHO" 0)6 t X" Z6 |- m+ \
- (command "._+dsettings" 0)6 y( u, k1 q2 D
- (setvar "CMDECHO" cmdecho-save)4 A8 [$ E4 v8 ^5 x# e) a
- (princ)3 k4 ^- C. c, U+ g* G
- )9 i0 |1 n- s& o% v6 j5 f' {
- : W, F' t1 ~) f
- ;; HPCONFIG
# l0 e1 k0 P: ]4 z9 d - (defun c:hpconfig (/ hlppath)7 R$ u4 M7 f4 l; R: g
- (if (not (setq hlppath (findfile "acad.hlp")))% |* Q' I: ]2 b* d9 N
- (setq hlppath ""))- M+ a! l2 k5 O% P% k) z
- (help hlppath "hpconfig")
' G5 S1 n5 R/ u- Q7 S - (princ)
$ Z6 _! n2 ]- v+ L3 ?$ g - )
/ B+ G" [3 A9 k - 7 j( r9 e1 @4 N6 Z# R r( m. i& n ^
- ;; OCECONFIG( D( n$ \! ~/ A/ q4 Z# C8 s1 e
- (defun c:oceconfig (/ hlppath)! Z; b4 c1 @/ j$ E
- (if (not (setq hlppath (findfile "acad.hlp"))); i- @6 {6 U. o1 O, L( `/ M
- (setq hlppath ""))
) x3 U! q, U) q4 S8 B* {7 Q( Q - (help hlppath "oceconfig")
) t6 y. P3 B7 o. H9 } - (princ)
3 k0 l1 {9 S# u& m# c' P - )
; ?+ d+ R% z4 d9 q# M# A, {. y
) s0 b' l* E1 \+ c- n5 i- ;; CCONFIG& c4 _7 Z* ]; [& ^& ]
- (defun c:cconfig (/ hlppath)
, ^, ~' I* D q) e6 a, K0 p - (if (not (setq hlppath (findfile "acad.hlp")))7 K3 U) \8 g. t0 D
- (setq hlppath "")) Q" Q8 _$ L. K! s
- (help hlppath "cconfig")/ h' l* ]# N3 Z3 n6 x' V1 ?. I
- (princ)/ Y- M1 l9 n* t) g6 ]. R, }# n7 F
- )
4 k% _9 b6 h1 W( ]1 Q
3 W2 A- V, s$ g, ?- ;;; ===== AutoLoad =====
* E" q; ^; Z4 d3 Q- t* t d, { - 7 r0 C1 e7 V# Z' ^
- ;;; Check list of loaded <apptype> applications ("ads" or "arx")) |7 x0 X1 U& L: a5 r% [' \) \
- ;;; for the name of a certain appplication <appname>.2 D! X4 s# E# k
- ;;; Returns T if <appname> is loaded.
, j) o* n/ B9 z+ T# `0 ?' ~, Q
$ {9 _6 p9 p2 g- (defun ai_AppLoaded (appname apptype)* P" J9 @/ ^$ L N9 B. D5 h
- (apply 'or
6 Z" l* K& c2 h; d; L# ] n - (mapcar ! e$ ?5 w, J- t% e: W
- '(lambda (j)% c& L: { q x. V4 e8 k/ @9 j
- (wcmatch
! t. P+ }. `" j5 M/ y - (strcase j T)- r0 T; H! U3 p* Z7 g h
- (strcase (strcat "*" appname "*") T)
& x+ X9 Y% O; h: f' B - )
' b' k: } U5 W& f: A - ): W5 f6 t8 v' s2 `
- (eval (list (read apptype)))# W% n3 Y9 S. H, ]
- )
, p8 n! F/ ]6 b. k6 f( W- h. Z - )- v$ }) ~8 R( ? `4 b; d) d
- )
2 k3 L! p- B8 R* {3 I - % ]2 X) Z/ M/ C9 g
- ;; ; A6 t/ W1 |9 v- P
- ;; Native Rx commands cannot be called with the "C:" syntax. They must
$ g+ U1 _. y# R! n - ;; be called via (command). Therefore they require their own autoload
2 o4 a% G4 m: C3 z - ;; command.3 B4 X2 X6 l7 G& i& \7 M
( l. `6 P8 O! c1 A- |- (defun autonativeload (app cmdliste / qapp)
% H, J+ U9 `! C' ]6 B" b' h - (setq qapp (strcat "\"" app "\""))
. D5 j% H; y4 x. n" N - (setq initstring "\nInitializing...")
/ I& W( ?7 \2 ? - (mapcar8 N8 K; G# r! ~; }0 ]
- '(lambda (cmd / nom_cmd native_cmd)
9 D9 w) @9 w: Q$ A/ M4 c - (progn/ w2 b- h* @. E9 P
- (setq nom_cmd (strcat "C:" cmd))
5 A; Q& l, O$ o1 N' Z( P( Z3 x - (setq native_cmd (strcat "\"_" cmd "\""))& n. @ c$ a; W" u9 ?
- (if (not (eval (read nom_cmd)))
' O; O: W: ]7 _9 q r3 G S: i - (eval
0 A+ }' F' O5 V+ G - (read (strcat: \( @1 L5 G+ H% B+ x% j
- "(defun " nom_cmd "()"& [6 g6 M* ]6 X$ _
- "(setq m:err *error* *error* *merrmsg*)"
& o! _- c/ B2 c' p. m# ~ - "(if (ai_ffile " qapp ")"
2 I: [! Z! r# ]9 M/ R. i - "(progn (princ initstring)"3 b2 g0 x$ o8 B# D+ ?' X
- "(_autoarxload " qapp ") (command " native_cmd "))"
2 E" ?+ }2 w! C8 z4 ] H8 e - "(ai_nofile " qapp "))"2 c. U( X5 N; \9 u' d) D7 ^ `
- "(setq *error* m:err m:err nil))"- S. {/ J* ?1 E, `/ O) R. C
- ))))))
6 V* e U0 Y7 L$ q$ V - cmdliste)7 E' [- f( G; G) g+ R% }) g
- nil) @# I; g3 V/ i: b3 D* L
- )
; u; H+ J& }5 r4 G - $ t( C9 V" N: N% o! `% X
- (defun _autoqload (quoi app cmdliste / qapp symnam)
% u. O7 \" J3 c- i' a2 W$ @ - (setq qapp (strcat "\"" app "\""))
) j: ]" B2 G1 Z5 o3 V4 h - (setq initstring "\nInitializing...")
% n; R' Q7 p Q! ?9 e2 N' l - (mapcar4 b' D% o* [+ o& P( g7 V( s0 W8 D
- '(lambda (cmd / nom_cmd)- @9 Y+ u6 m4 t( H4 W" R
- (progn, \6 B8 o' ]) i, Y' V$ C
- (setq nom_cmd (strcat "C:" cmd))
: E' v& ^( k; ~0 V - (if (not (eval (read nom_cmd)))
9 u0 c& K' v* d- ^% Y. ~ - (eval+ k; f0 I5 d8 ?: n: T
- (read (strcat* L; D, ~6 j8 p5 j" j
- "(defun " nom_cmd "( / rtn)"
) }1 v; M* V3 j/ E8 ~4 u+ c1 s% ~ - "(setq m:err *error* *error* *merrmsg*)"
0 j( I7 g2 M, A& o& y! o) w2 e - "(if (ai_ffile " qapp ")"3 Z7 g; P7 k( P3 a9 E. H
- "(progn (princ initstring)"
7 H+ M; L" k" X* T; P6 D0 i' ~ - "(_auto" quoi "load " qapp ") (setq rtn (" nom_cmd ")))"
% e! G7 G, j) ]4 a; }/ o - "(ai_nofile " qapp "))"
% d8 Z) L/ Y1 Y1 _( \4 P - "(setq *error* m:err m:err nil)"
, z- f% m+ s& }1 a - "rtn)"
; {7 d2 l" [( \# l% `: p - )))))) z1 \" |: g5 _- k
- cmdliste)+ Z2 c" g% }& N1 p6 g1 G- A+ B
- nil
) A) F( H) `) d, a8 W - )
4 y+ {# M7 J! @- L
/ F( A+ C7 T, v- n" a- (defun autoload (app cmdliste)
* A+ @! M) S) s0 `! ]- O - (_autoqload "" app cmdliste)
! e9 f5 N) o0 m$ C - )
% J0 F. S& ], i7 Q0 \- S/ O9 I
) u; ]" Y' v5 C" k/ b" y( G- (defun autoarxload (app cmdliste)
, ]& e# X5 s0 i - (_autoqload "arx" app cmdliste)2 }8 l; I% O- \ H7 d2 H
- )( c8 m; R4 j2 i1 s
6 v# e3 q( ?* l; u) w. d1 f- (defun autoarxacedload (app cmdliste / qapp symnam)
+ k3 t x* A" ^; K6 j: E6 W - (setq qapp (strcat "\"" app "\""))& f/ p4 p7 H3 `$ @
- (setq initstring "\nInitializing...")- V% O, C. _* ]) F3 b
- (mapcar
; B! N% |/ R1 {- L$ Z - '(lambda (cmd / nom_cmd)- A5 F& U I: G
- (progn( O& s6 X, ], T9 ~4 \; @( ?+ i
- (setq nom_cmd (strcat "C:" cmd))
" M. t8 x7 F( {4 ^+ c - (if (not (eval (read nom_cmd)))* n% ~' Q8 b4 Z! u9 i6 F
- (eval4 o: a) ], _: m6 n8 f& [
- (read (strcat
; \' B; p: Q5 c+ L - "(defun " nom_cmd "( / oldcmdecho)"( d/ B0 {1 c; G2 @6 w( v3 X
- "(setq m:err *error* *error* *merrmsg*)"1 y. b3 @& g3 a. k
- "(if (ai_ffile " qapp ")"
% h! y' I, ?5 y8 Q% |6 c% X - "(progn (princ initstring)"
/ M( A3 f9 V/ L/ Q8 b - "(_autoarxload " qapp ")"
8 c9 o6 d& U6 w, y: t$ u9 }% s - "(setq oldcmdecho (getvar \"CMDECHO\"))"
5 T! r, c5 h! v+ w2 H - "(setvar \"CMDECHO\" 0)"! t7 S/ I; F3 l; U) ^) C4 v
- "(command " "\"_" cmd "\"" ")"8 C4 e1 o+ O' n& {8 c4 m; o
- "(setvar \"CMDECHO\" oldcmdecho))"7 m2 ^4 z3 x! N o
- "(ai_nofile " qapp "))"; l6 k" a# f, W* \; M6 o
- "(setq *error* m:err m:err nil)"& ~4 Q3 g8 q; L
- "(princ))"2 j# R! I. N. |+ ]/ e, u- Y
- ))))))! Q! C* G1 U+ X0 ~
- cmdliste)8 q$ k; q- l8 T$ U
- nil- Q$ C6 m9 A% C7 |5 V* t: r2 ]
- )
7 k, X' B+ P3 f7 ]3 n W& o
4 [8 n4 U* P: W2 M- (defun _autoload (app)
/ d: Z9 |; n) _: X - ; (princ "Auto:(load ") (princ app) (princ ")") (terpri)7 T) [. w! z7 V+ E( Q
- (load app)
7 C4 |5 m" Q u: W# I- I1 @' N+ \ - )
3 \4 Y$ Y9 ^2 H& W$ y3 L
+ H% }0 @6 S; r* w1 c) c- (defun _autoarxload (app)
! N* `; S2 `& j# | - ; (princ "Auto:(arxload ") (princ app) (princ ")") (terpri)
& o4 v u& z9 [: T$ j - (arxload app)
4 M+ a) F v0 h' G7 u* \. |) Q9 c - )- M; _( S+ a, B0 c5 `
% [3 R, y @& M( P& c5 f5 L$ a; m$ K0 {- (defun ai_ffile (app)
# K3 Q9 n/ i: x0 W" ?9 \$ ] - (or (findfile (strcat app ".lsp"))
" Y% p; K" t0 _: V - (findfile (strcat app ".exp"))
( H' @! V" U# ]/ v! L - (findfile (strcat app ".exe"))
$ t1 ~4 r0 `' Z) Z: n# X$ V - (findfile (strcat app ".arx"))
" s# A% x. F G - (findfile app)
8 _% Q, B% }8 M- G% ]4 n# w - )
" ], D7 \! t: l: a. ]: R6 p - )0 B5 T8 u2 g- T: W D% T1 X0 ^
6 m0 r4 C8 b9 [; y1 q" E. k- (defun ai_nofile (filename)/ v3 a5 ~' [; y) N' V3 d( T
- (princ
6 ]7 f' P- o6 ^3 U, D2 G$ j- ]# k - (strcat "\nThe file "# Z4 F6 J& y* e
- filename
" `% f4 U/ { Y( K0 R. c5 W6 f5 P" t - "(.lsp/.exe/.arx) was not found in your search path folders."
: s8 e3 u2 k: x5 | - )
; \1 n& v) l1 \) \+ N; b \ U - )
+ p5 b: ]( [! |- M# a/ j - (princ "\nCheck the installation of the support files and try again.")6 j# G5 ?( m) B8 D5 C; D+ [$ ]( ]
- (princ)
+ ^3 e8 w; G- b+ ]5 `8 ^) r - )
* i3 o n: [# j/ k - % n9 y( G, Z% c. V9 |0 h5 D) D9 w2 l
- 9 X: B$ m, C1 F7 Y6 `
- ;;;===== AutoLoad LISP Applications =====
5 U7 v/ m$ F0 E/ d# Q5 y8 @* C. z g - ; Set help for those apps with a command line interface- f- ?; a- ^, Q% X( n! J
- 5 u$ V3 ?3 F# m8 n5 {: }) u# c2 ^
- (autoload "edge" '("edge"))
5 `% p( L3 u1 Z) U0 b0 O9 ~& z - (setfunhelp "C:edge" "" "edge")
# y; `3 |5 o. @ T
9 _* d% R# Z. s% V; b5 x! B* e- (autoload "filter" '("filter " "filter"))
. Y" K: X4 V( b) Y$ S b8 N% Z - 2 i3 b% N: r1 ~4 N$ J1 ? H
- (autoload "3d" '("3d" "3d" "ai_box" "ai_pyramid" "ai_wedge" "ai_dome"
* |* s; r; J# }7 l" o+ K - "ai_mesh" "ai_sphere" "ai_cone" "ai_torus" "ai_dish")7 x ~* }; Q/ ^7 B/ H
- )
% O3 a5 a2 K7 Q - (setfunhelp "C:3d" "" "3d")
$ P K/ v% a5 f. Y6 ]) t4 p/ F; ] - (setfunhelp "C:ai_box" "" "3d_box")
& E! {# p" G Z - (setfunhelp "C:ai_pyramid" "" "3d_pyramid")
, ?$ m6 a3 L) K* ? - (setfunhelp "C:ai__wedge" "" "3d_wedge")6 o1 d0 ^) p7 L3 P2 f: C Y
- (setfunhelp "C:ai_dome" "" "3d_dome") q2 g! S. g* j7 C
- (setfunhelp "C:ai_mesh" "" "3d_mesh")
9 T: M9 R+ K0 v+ Z$ W% x; D - (setfunhelp "C:ai_sphere" "" "3d_sphere")
( L6 a8 y2 [: n* h, ^ - (setfunhelp "C:ai_cone" "" "3d_cone")
/ m0 a+ F _/ m* D' D6 L# K - (setfunhelp "C:ai_torus" "" "3d_torus")* O- @4 B/ ^: [& T9 p) o( z9 c
- (setfunhelp "C:ai_dish" "" "3d_dish")
; a3 { P+ K) T# S
. R/ d- x( H+ ^$ ?# t, \0 C- (autoload "3darray" '("3darray"))
" l6 b- @# A% T! U) o, \ - (setfunhelp "C:3darray" "" "3darray")8 q4 S# u5 {# j) h" w I) s
' K3 U+ z$ w n8 ?. R0 t; r- (autoload "ddvpoint" '("ddvpoint"))
4 y5 V- [: F. d) n8 C9 U t
3 ?7 N" z( I6 V9 w8 s6 ~0 \) S& \% i- (autoload "mvsetup" '("mvsetup"))
0 f* P# N: r8 U" W9 i E1 N - (setfunhelp "C:mvsetup" "" "mvsetup")$ U1 m" D3 M: i( n8 o1 J( f/ W5 X
- 2 m" x5 ]- c4 s+ M" z Q
- (autoload "ddptype" '("ddptype"))9 B, o* \8 }+ B# w, y0 V! S' e; t
- & J+ j P1 y4 N; y# R1 L
- (autoload "attredef" '("attredef"))
9 T! T! g+ R- B" I/ ]0 @ - (setfunhelp "C:attredef" "" "attredef"); x5 \5 s( J/ v/ e
7 G5 y; H I1 w1 Y- (autoload "xplode" '("xp" "xplode"))
, @7 c8 Q* p" k3 h) t1 _5 A) c - (setfunhelp "C:xplode" "" "xplode")
' b# |" b; m! H - 2 k1 I) @0 h) t
- (autoload "tutorial" '("tutdemo" "tutclear"6 C9 v; k- V4 Q
- "tutdemo" * @* [+ N" I8 C
- "tutclear"))/ C2 `; G: Q( ?; C" }
9 \0 ^9 E* [9 s) h( ?5 k' s- h- ;;;===== AutoArxLoad Arx Applications =====
+ A6 t) X$ { t7 P& {$ ~
# H# {" g: k* l+ T- (autoarxload "geomcal" '("cal" "cal"))
; T. R3 ~2 |/ v9 n5 ]
, G1 L" K; J2 g8 w; e( `4 r- (autoarxload "geom3d" '("mirror3d" "rotate3d" "align"8 B) h& ?8 H& W8 o
- "mirror3d" "rotate3d"
, d- Y$ O) b" O: h5 w7 n! R3 @ - "align"))
, U$ o7 s6 X ^- ^* n: ^
6 D9 T* s" v A+ H- % {( r" Q2 P7 e
- ;;; ===== Double byte character handling functions =====
$ Q& ?7 t" f" b% b+ y) F8 L, f - , y- j c! {' C! o9 m9 [& s
- (defun is_lead_byte(code)
! a# m, R# k1 p! y* s- ~ - (setq asia_cd (getvar "dwgcodepage"))
4 E: i4 p. P Z - (cond/ O. _2 _1 s3 K2 R
- ( (or (= asia_cd "dos932")
% ?" v" K7 b- a - (= asia_cd "ANSI_932")
9 F" ]2 c& p) U1 h7 R: f - )
/ _$ G# A& u8 Q5 o% O9 j - (or (and (<= 129 code) (<= code 159))
! \/ ?' E! [7 j: e) U - (and (<= 224 code) (<= code 252))
' a7 I# ^% U, J; T - )+ \6 ]8 w' c! u& |: c/ T/ ^( f
- )) v* b7 Z5 ?# S; R' M5 E
- ( (or (= asia_cd "big5")
. u, m) e4 u% Y/ { - (= asia_cd "ANSI_950")' q4 N7 `/ p! O8 P
- )
& M5 X: j w, {# [8 G - (and (<= 129 code) (<= code 254))) k4 w& x. ?0 n, q8 E9 Y
- ). S% o& k; Z. i" ~% L8 h
- ( (or (= asia_cd "gb2312")* K" y: ?; q3 }% h* h- M0 \
- (= asia_cd "ANSI_936")
1 l8 m( x4 v1 M4 W8 `2 j - )2 H% l) i9 w) ~6 l& ~
- (and (<= 161 code) (<= code 254))
2 H4 w7 x' c& F& Q( A$ q8 [/ ^ - ): @4 b8 C+ [3 q5 d$ B; S% o7 i
- ( (or (= asia_cd "johab")
- f6 P: s f0 L( y. Z' Y/ e/ q - (= asia_cd "ANSI_1361")
i: j3 m: v" {5 B; `/ a& T - )# y2 s0 f5 p$ \0 I# y/ N2 j3 `
- (and (<= 132 code) (<= code 211))1 P7 c4 y6 P/ W9 r, M# x1 U3 O
- )) X& w( d' x% I, Z
- ( (or (= asia_cd "ksc5601") e& Z$ m G( L F. e' b c) H/ @
- (= asia_cd "ANSI_949")
0 R: O* E" L1 K - ): C' ~ f# s& H5 [8 m
- (and (<= 129 code) (<= code 254))0 l0 W$ C0 B! K3 Z( p! M* x5 K: g4 [; Z
- )
" M" z; T t; y$ A - )0 |0 @6 N, w% [5 f; n
- )
# v Q3 N+ P4 y- I! n! u - ; a& s3 d3 Z# m9 ~+ Y
- ;;; ====================================================
$ G/ Q: d, h Q+ @ - 1 v. p. M- r0 W! l) H1 j
- , l( K4 _8 y6 b8 q0 ~
- ;;;) s: r, e# y6 F( V' G" u" r
- ;;; FITSTR2LEN
$ i q+ N2 F% H8 R9 V - ;;;
5 R$ C+ A9 j; b1 D) \ - ;;; Truncates the given string to the given length.
' ?" |4 ]# K% L. ~! w2 ^ - ;;; This function should be used to fit symbol table names, that7 O& }3 b5 ~( w7 O w" V# B
- ;;; may turn into \U+ sequences into a given size to be displayed
3 h$ X. Z& q9 F0 L$ { ^3 o1 n4 V0 U - ;;; inside a dialog box.
8 L4 y5 M/ k- V2 X9 r& e - ;;;" w4 Q/ H' g& H" R" ~
- ;;; Ex: the following string: : I* C* @7 }- A1 V6 v& @
- ;;;
3 H( {4 o& Z0 R8 N2 N7 u( ?. U - ;;; "This is a long string that will not fit into a 32 character static text box."
5 |$ f' Q9 o+ J! Y. e. I - ;;;
/ i) S/ b% Q/ j8 a( f - ;;; would display as a 32 character long string as follows:; v- r! \! z& E+ e* B& k+ I
- ;;;) K$ e* }1 V6 E" F6 ^
- ;;; "This is a long...tatic text box."
" z! o1 F& u0 c7 N' t* W. A% M - ;;;
5 a% ~& I5 G$ F - 6 K- L9 Y3 a; {/ y* y, h
- (defun fitstr2len (str1 maxlen), ~8 z5 J3 H! J- r9 ^3 W) ]+ V
. _ D3 O' x* T% s# Q- ;;; initialize internals1 U w: s; `3 D! M+ K
- (setq tmpstr str1)
" U& [; S" @. h& C! J+ ]+ _ - (setq len (strlen tmpstr))% G/ S& }' H& Z, n
- # p* r3 q; o, Y+ g9 c+ E
- (if (> len maxlen)
6 x; p1 |* \8 V! L - (progn ~9 O" @( K3 `8 B
- (setq maxlen2 (/ maxlen 2))8 `( u1 i A2 _/ f& f
- (if (> maxlen (* maxlen2 2))
R0 W0 j4 E* c8 S2 g5 x - (setq maxlen2 (- maxlen2 1))* {% O1 w( @5 ]
- )+ Y9 e8 t; W& U/ f" W% s
- (if (is_lead_byte (substr tmpstr (- maxlen2 2) 1))
, v; D$ ` O G- [: h7 @. p - (setq tmpstr1 (substr tmpstr 1 (- maxlen2 3)))9 T0 W& Z. b6 x( Y$ C% u
- (setq tmpstr1 (substr tmpstr 1 (- maxlen2 2)))
1 M' ?" x; X9 O4 \, l8 _ - )
, r( J, e+ C4 e; ? - (if (is_lead_byte (substr tmpstr (- len (- maxlen2 1)) 1))3 m! _: Y" Q3 ]& C) m6 U+ W- ?5 ]
- (setq tmpstr2 (substr tmpstr (- len (- maxlen2 3))))
" g# h9 U( }1 ]( w2 n. C# I8 U - (setq tmpstr2 (substr tmpstr (- len (- maxlen2 2))))
' {8 E( _) l5 U& I - )) S. b# [( v0 Y( o+ v$ r6 x
- (setq str2 (strcat tmpstr1 "..." tmpstr2))' u8 S- g* c7 x: y$ \' M& |7 H
- ) ;;; progn+ t6 S! L7 Z8 `4 e4 _& F( R+ u- C
- (setq str2 (strcat tmpstr))
7 q, |/ o2 D1 E) `, a - ) ;;; if
9 Z, x3 w( Q. Y) s! E - ) ;;; defun
% y( h3 f* c. v- T - # \6 k4 k( p7 M' R- M' `; ~/ |( t
$ d0 V( A6 k: s9 K1 K% N o' X6 s- ;;;
) y2 [) D* L' n2 X& g - ;;; If the first object in a selection set has an attached URL `! c3 a) R5 N8 t; n- |6 u. Y3 T
- ;;; Then launch browser and point to the URL.
" a1 |) e0 _/ a" H* _! R$ V: E - ;;; Called by the Grips Cursor Menu8 {# ^! L% h8 y f- ^# ^
- ;;;
% x- i$ J4 J: S' U. y9 d - . p/ P% X, c3 N5 z9 L n& V. ]
- (defun C:gotourl ( / ssurl url i)
& P6 Y% B$ _& w2 W ^. q! u2 q - (setq m:err *error* *error* *merrmsg* i 0)
" Y. ^+ B* n: D/ g& w5 o! ^4 ?5 {
2 y! k6 g6 o. H% `3 i# i- ; if some objects are not already pickfirst selected,
# i5 G! {1 O& f - ; then allow objects to be selected
; ^: L7 c% e1 l1 B: g" j1 q, s5 Y - & Q7 b, y. R+ [" F( o R
- (if (not (setq ssurl (ssget "_I")))8 x; `2 D5 w! o1 i
- (setq ssurl (ssget)), L- W0 h+ V* V! ?! _ J
- )7 I1 j" \% L% C2 `, z$ |
0 `* v) ~! C: y3 Y; X/ d; K- ; if geturl LISP command not found then load arx application
3 `! h& q# T/ l/ \# |
/ H+ W/ L3 A1 k6 g" l4 }2 V9 A- (if (/= (type geturl) 'EXRXSUBR)9 {' C& h' F3 U: \" ]8 b
- (arxload "dwfout")0 s% ~- _ |* u1 w5 T( a P1 k: @
- )
" J, a, i* |. i" h+ i! ?9 L& @ - 3 p3 Q2 r @8 ?+ r3 P
- ; Search list for first object with an URL* F- ~/ s c2 \. n% C
- (while (and (= url nil) (< i (sslength ssurl)))
* Z( f) U; f: N( K - (setq url (geturl (ssname ssurl i))4 ]) ~8 h b9 C! ]% @
- i (1+ i))
& ~) m7 [, [6 D' g - )9 n4 @* v( r. n
- - B5 I/ T i5 G8 I$ C/ o1 Z: D
- ; If an URL has be found, open browser and point to URL
% y* z. t$ }, b: | - (if (= url nil)' b% r( t3 ?, ^9 t
- (alert "No Universal Resource Locator associated with the object.")
& w2 A9 k. }5 z; r - (command "_.browser" url)
! c- m" {8 K- p0 o - )
" J; U' U' b/ `' C0 Z' b
% j$ ]3 w2 A/ k3 j& o o* W- (setq *error* m:err m:err nil)
, Z. L" t, b9 u( g) t - (princ)
' k0 S% L3 X; [) O9 g - 0 T; l, Z9 k1 F: U K8 y+ F
- )
3 ] C, k& ^, o( I- z# m! a
2 ]' S; g5 K8 @7 L! k5 _- ;; Used by the import dialog to silently load a 3ds file. v8 m+ |: d* J J W
- (defun import3ds (filename / filedia_old render)
7 z. z- l. p( Z( w - ;; Load Render if not loaded
7 q0 @/ d# D3 N+ o% D - (setq render (findfile "acRender.arx"))6 a; J9 }$ n; _; P; I' b# z
- (if render
2 W1 b0 v* E8 O/ `2 O9 c - (verify_arxapp_loaded render)
4 `7 T% c: f% A, V9 z9 ?0 X c( ` - (quit)4 `/ S2 z. H" L9 \% w+ }0 ~
- )7 e% D7 W; l/ m/ j$ N8 s7 y+ [+ r
- ( y( r; e3 _2 z- V8 r8 S2 c
- ;; Save current filedia & cmdecho setting.
9 e# U2 d) P! p& p g) k - (setq filedia-save (getvar "FILEDIA")), W: q1 H6 c1 O
- (setq cmdecho-save (getvar "CMDECHO")) d0 ?0 Q5 v2 s% e4 ~
- (setvar "FILEDIA" 0)
; b3 x+ Y1 F6 d( K - (setvar "CMDECHO" 0)
: o$ {$ _* o5 k$ l, v6 `2 F# n
' l6 s$ \6 ]6 q7 u( B- ;; Call 3DSIN and pass in filename.9 f/ }4 ]- K# z! r
- (c:3dsin 1 filename)7 L9 x% v7 z9 i' l( h
* V" J: A& \* g4 l7 h- ;; Reset filedia & cmdecho! R9 E# T. n/ S: D
- (setvar "FILEDIA" filedia-save)
. D2 b# j/ ^/ Q- C - (setvar "CMDECHO" cmdecho-save)
o6 B8 ^! [6 G - (princ)
( U5 g7 N; N4 a4 o" Z- M# u" S - )9 d- I- U) J g: S9 z: w
. _/ u' R8 o6 x- : J$ S# F4 B# @9 R& e
- ;;;=== Menu Functions ======================================& P9 T- A+ G- Z, c0 I: @; J, Q/ v
- - m( Q2 z8 B0 `9 \7 H8 w3 r7 z" W
- (defun ai_rootmenus (): t% k+ c* g& Y; b; F/ F! h
- (setq T_MENU 0)
, U5 h# s; _, v1 c( G - (menucmd "S=S")
) E" y: I$ ]1 h% L7 ]) j - (menucmd "S=ACAD.S")
% a6 \+ X9 W I- ] - (princ)9 K7 @% F. a6 X0 w
- )
+ t3 i# Z; i' O: t& I
2 Q5 t8 K; s! j% S- o$ r- (defun c:ai_fms ( / fmsa fmsb)7 a( G; X" ]% E1 ^- V
- (setq m:err *error* *error* *merr*)+ n8 p2 n; m' I B, M' X
- (ai_undo_push)+ i$ u* _( {: b& y9 t* G8 J
- (if (getvar "TILEMODE") (setvar "TILEMODE" 0))
$ y0 h! B+ ^$ G, `! C - (setq fmsa (vports) fmsb (nth 0 fmsa))
" X0 ^0 _" O- T! H2 M! x - (if (member 1 fmsb)+ {7 N0 n, ^3 R8 @
- (if (> (length fmsa) 1)
5 G9 N' Z2 K3 [ - (command "_.mspace")
- N# T& B+ x0 H% Q0 O - (progn
3 U% H3 J! p* T5 i! T) n4 {: d - (ai_sysvar '("cmdecho" . 1))
0 L2 S+ N/ d2 c' ], u/ o, x - (command "_.mview")
+ E4 p7 j/ S( f. t - (while (eq 1 (logand 1 (getvar "CMDACTIVE"))), ~- b* M6 U. N. r, x; l, G7 S# i
- (command pause); D- f: y7 |0 K3 T( t
- )
) V2 |1 a) y3 l" M1 T - (ai_sysvar NIL); O1 d: q- O, E N: r. ^
- (command "_.mspace")
j( w& s5 j# n* A - )
0 R4 Y2 t+ y9 ~3 a - )
; _4 M) n7 y5 W- [' v& s+ p - )
1 j0 s- ], s* p5 z1 J - (ai_undo_pop)
1 w6 p7 o% Y3 {' \- y! I - (setq *error* m:err m:err nil)
* K6 R6 q3 ?" ?- S1 K - (princ)+ ?+ G* _) Y- z X' N' Z; z
- )8 Q" X& V* X# n, z" A. H' L9 c2 T5 Z
- / w8 h6 ?# D3 e- C! y$ P
- (defun ai_onoff (var)3 N- `" W8 H( h: y5 u2 U
- (setvar var (abs (1- (getvar var))))
; T- ?, D, E- q5 q - (princ)3 J5 G$ Q2 E' l; d4 `) q4 i8 l
- )# e+ [0 B+ ] J6 N' I
: p; { c% m5 r& }* {* z1 G O0 X- ;;; go to paper space
2 s' |9 \3 r! D, e- |( I+ x - (defun c:ai_pspace ()
n% W. o6 Y# H9 Q% o& B - (ai_undo_push)
# Y9 \- @! W* [, B - (if (/= 0 (getvar "tilemode")). a$ G1 @* W8 g; d
- (command "_.tilemode" 0)
' r8 g- o1 ?* P5 j - )+ A: x. Q. T0 P- |
- (if (/= 1 (getvar "cvport"))
; M( o5 F& x# P# j1 D - (command "_.pspace")
8 U0 m; |' P0 w' H. x6 S, ] - )0 D5 R( [+ k; R/ S0 U6 P6 }2 R
- (ai_undo_pop)
# e7 N0 W$ O. g/ \ - (princ), F! q7 r' A& o$ a2 G
- )* w7 W- t m! z# o: K
- ! d' P$ u& N, ^3 S
- ;;; go to tilemode 17 z) w( K) w! X/ R6 {, g9 H
- (defun c:ai_tilemode1 ()
, y) J$ k X: c: F" S& J/ L7 T9 L - (ai_undo_push)8 t+ {1 M" }$ B& ?
- (if (/= 1 (getvar "tilemode"))
) a; n, e& C: @2 G5 X - (command "_.tilemode" 1)* g3 e1 Z$ q) o7 b! A
- )0 C" B Z( S: f- I. T8 K! E
- (ai_undo_pop)
2 Y9 d) L( e+ I4 Q8 j3 m; @5 P+ K - (princ)7 K3 g* J0 t# m" O' Z6 n
- )$ r" u" m7 t! G, d% m6 z& V5 ]$ W
- . w0 W s) ?5 k: |' d& B" K/ N
- ;;; Pop menu Draw/ Dim/ Align Text/ Centered. T5 |; @( V6 P0 m+ ^
- ;;; Toolbar Dimensions/ Align Text/ Centered7 B7 R$ t/ x; o6 h1 N
$ D+ c1 m( z9 Z- (defun ai_dim_cen (/ ai_sysvar ai_dim_ss)
/ F4 r) J# F: |9 h, x- Q0 P! r - (setq ai_sysvar (getvar "cmdecho"))
4 u5 C) x6 ?8 c5 [3 F - (setvar "cmdecho" 0)( u* G7 V% R5 H% o
- (cond/ E# i N( d9 f. {4 D% G7 T; y
- ((setq ai_dim_ss (ssget "_P" '((0 . "DIMENSION"))))
' |2 F1 q! L4 T; s$ I* c9 ]1 N - (command "_.dimoverride" "_dimjust" 0 "" ai_dim_ss ""
% N0 _! i7 f, {% E: K5 ~6 _" y) C - "_.dimtedit" ai_dim_ss "_h")
`0 t! }+ u9 y$ Y5 g, [ - )
1 f( P& G+ W0 [9 f - (T nil)1 E4 p9 [" X# g8 x
- )
- m! N3 o8 M/ {) X - (setvar "cmdecho" ai_sysvar)
7 R" |9 u4 M1 l9 R" t& D5 e - (princ)
& x; @1 O4 X! p! X - )% C/ S) t" a# x+ l' p8 h9 u
- 6 @5 g6 c; w; H# c u1 n1 l4 H
- ;;; Shortcut menu for Dimension Text Above 6 O# J" A" `8 D4 i/ ?+ T# ^
% N( W* T0 d8 e! o1 v- (defun c:ai_dim_textabove (/ ss)5 |9 \0 U7 }5 ^3 I- e6 |( e) t' ]
- (ai_sysvar '("cmdecho" . 0))
% w% Q/ Q1 \1 q: F# w3 k' k1 a$ v - (if (setq ss (ssget "_I"))
/ G6 c2 l7 h2 P5 A" z - (command "_.dimoverride" "_dimtad" 3 "" ss "")1 n# `/ M: n6 r8 v+ `7 Z
- (if (setq ss (ssget))
0 c" O P# n: i& \ - (command "_.dimoverride" "_dimtad" 3 "" ss "")
% d9 X( l7 x8 T, ^' F, ]" h/ K - ) `9 q9 r j+ J2 B$ Z
- )
/ m- K' C0 u. E* a2 O- t6 L - (ai_sysvar NIL)' R! ~' _1 ^7 z5 }$ E! r
- (princ)
+ C* d! K+ B" s- C# T, e7 l - )
3 n/ B0 A, \5 Y) B9 @/ m& r" p
% _& C0 S, v( v* K5 v% Z5 U, l- ;;; Shortcut menu for Dimension Text Center
: i' h( J+ U* W% f: d T - ' n8 M* f& l* c+ {
- (defun c:ai_dim_textcenter (/ ss)& O- ]+ N9 L- T4 \& `
- (ai_sysvar '("cmdecho" . 0))* ~* v' j# |) m4 O! K4 k4 y7 P
- (if (setq ss (ssget "_I"))2 |: K7 Q4 f$ x2 W" m2 }
- (command "_.dimoverride" "_dimtad" 0 "" ss "")1 e' {5 S+ A: g9 Z
- (if (setq ss (ssget))
9 i: A" ]9 N0 u6 M - (command "_.dimoverride" "_dimtad" 0 "" ss "") ' O! ]) c6 k( N# s( }2 l) A
- )* V1 x' x7 K' s& {" |
- )
0 ?( s% m3 k6 l+ R. L I - (ai_sysvar NIL). C. @, C3 Y# ]+ P
- (princ)
5 o% p' [9 L8 F( p0 {( T - )
* w8 b, n# s0 V3 P1 {0 X. D
- Q) N0 Y* i) L/ ^' F- ;;; Shortcut menu for Dimension Text Home : s. T6 @$ R( h) X; N1 e! l
- # D) p, N8 ]3 U X) y4 A
- (defun c:ai_dim_texthome (/ ss)( R2 v; z6 u8 Q- V/ c1 l. O
- (ai_sysvar '("cmdecho" . 0))% P8 U6 T- x( v- v/ w+ N2 o1 b& j' O
- (if (setq ss (ssget "_I"))
3 V+ |* k. D9 m' U5 B& E - (command "_.dimedit" "_h")) \" T. L) K6 V3 U
- (if (setq ss (ssget))
' ~: d0 R+ w4 f - (command "_.dimedit" "_h" ss)
$ z2 Q; |0 c7 v2 R: z/ R) H - )
$ I1 R( x k; D+ p - )
$ s0 b5 D- V6 D - (ai_sysvar NIL)
2 A. a- d( H1 t# W) v - (princ)
. \/ h5 f: Z$ E9 g9 |7 \ - )
: C9 f- }7 V( {! w0 v$ d% T
" H2 |3 _, @3 A& F, X- % |5 S. [* R# A
- ;;; Screen menu item for CIRCLE TaTaTan option.
: c J( s$ T5 E' n* m - ;;; first, get points on entities
* w. }+ B3 ?& U, N1 Z; D - (defun ai_circtanstart()
6 |( k5 i4 Y U, D2 C( G - (setq m:err *error* *error* *merr*)$ }8 y2 @" E8 r) A
- (ai_sysvar
+ m$ C1 P! C4 l - (list '("cmdecho" . 0)
8 ^2 \0 s6 f+ P8 M4 _ - ;; make sure _tan pick for CIRCLE gets same entity9 c0 ?' u: a* z* a( x( ^- `
- (cons "aperture" (getvar "pickbox")); r8 K3 Q! ?- B/ {- L9 v
- )
# w+ `3 h" u* N3 f( Q. M. W - )
! S" b9 L2 t. {8 K* f1 X8 y9 Z - ;; prompts are the same as CIRCLE/TTR command option% `4 [8 _8 U# _3 b8 t: D A/ ]
- (setq pt1 (ai_entsnap "\nEnter Tangent spec: " nil))
) J% y9 Y8 _$ L$ m6 J) S3 c - (setq pt2 (ai_entsnap "\nEnter second Tangent spec: " nil))
9 S7 |8 _6 K* ?! e - (setq pt3 (ai_entsnap "\nEnter third Tangent spec: " nil))' c. T3 n6 u& }! r$ V' r
- )
6 [$ h+ U3 n' a5 g - ;;; Command-line version
1 U9 J# P( [3 b, ~; [ - (defun c:ai_circtan (/ pt1 pt2 pt3)& z+ ?* k) M2 t7 e. e
- (ai_circtanstart)
! p( b$ K" L5 w6 H( u1 ]- h" X
' d8 n7 @: u% I( [2 K- (ai_sysvar '("osmode" . 256))
( L3 [! ^7 I; p" p - (command "_.circle" "_3p" "_tan" pt1 "_tan" pt2 "_tan" pt3)3 N9 P& |6 U1 B7 c( k( @
-
3 n5 C, T. D, W7 Z1 y, e: G. Y - (ai_sysvar nil)! v( j. F1 ~( K: L3 S9 B
- (setq *error* m:err m:err nil)" Q) @: n) o2 B2 g' X9 Y
- (princ)
/ z: d0 }1 ~( u* i9 k! ^) |( E8 ~ - )$ j Y1 C( \! I( t: _1 V: W
- ;;; Use this if CMDNAMES == CIRCLE
% g+ w3 y0 ~+ a8 [ - (defun ai_circtan (/ pt1 pt2 pt3); v, \- r! i8 `3 q- G |& P
- (ai_circtanstart)9 g' i' `1 ?3 V4 a6 c
- n1 b/ Q) N5 s, Z+ N. T$ I- (ai_sysvar '("osmode" . 256))
9 Q. b* w" `: D: d' J* e! ~ - (command "_3p" pt1 pt2 pt3)5 u9 v0 p- A* J6 R
-
+ \+ v2 n; T7 Z. s5 I. z, P- I - (ai_sysvar nil)( n1 K8 B: U6 S) \2 p/ k( n( f* j
- (setq *error* m:err m:err nil)
- ?9 U( }: A4 V* ?2 j3 d# O - (princ)( r3 a0 R3 ?8 q [
- )4 `3 Y! y6 _5 [+ [
9 D( D# }' A2 h5 \
6 L. D9 J4 W$ H+ `) Y) J* d. H* ?
5 E' @. L6 Q% u. @- ;;; Shortcut menu Deselect All item.
; L! N; g! a7 L, j# o" j
; k0 i3 g) f: a# w. ~- P- (defun ai_deselect ()
% _2 U$ d7 }- k( Q - (if (= (getvar "cmdecho") 0) ;start if
6 |6 g5 A; w' O6 I+ I - (command "_.select" "_r" "_all" "")0 q/ |, k. {4 Z/ o
- (progn ;start progn for cmdecho 1
# q) _2 I1 |3 \+ Z; E7 f - (setvar "cmdecho" 0)& c% n, s0 {' Q9 H# Z5 g
- (command "_.select" "_r" "_all" "")( d' \6 ]0 k I$ F+ l# u
- (setvar "cmdecho" 1)3 w7 \5 k. A" W7 D5 Z, M# F
- ) ;end progn for cmdecho 1
+ N$ S8 I- O }5 H+ A - ) ;end if
$ W. |4 ~- U$ I8 |4 F1 p" T S' Y - (terpri)
, u; q8 U" v" q6 y0 @- U U - (prompt "Everything has been deselected")
: J. q4 N/ U+ [ - (princ)
0 n7 E- ^5 T6 d+ q, Q0 j) X - )
" g7 Z- W5 i' R& l+ V& F( ]
- L' m" [' R: w4 D1 Y- ;;; Command version of ai_deselect to be called from the CUI
& I+ F b! b1 \2 Y - ;;; so it gets properly recorded by the Action Recorder( W7 q$ ]+ k$ w; p8 U
- ;;;
T. @) i" E, [ p: | - (defun c:ai_deselect ()/ ?0 P& d. c: D/ }
- (ai_deselect)
( e+ a! `, S0 d) y6 t - (princ)
1 h" K+ h% v8 z5 M4 } - )2 Y9 C6 _2 W' \/ W
- ( T- x/ A0 ?: N' ~3 D0 ^7 y
- ;;;
) x8 H/ a" s, q, N - ;;; Enable Draworder to be called from a menu
4 b$ S" m" A2 d/ A, R% X - ;;; Checks for Pickfirst selected objects
' j! J3 I- C3 G% Y; ]& y1 h - ;;;) ]: x6 c) S+ {5 F
- ) U" E: y) u: d! ?( p
- (defun ai_draworder (option / ss )% d, x7 ]- V* c8 V4 t6 [
" x( t: r( K4 \6 X# ?( }' k2 Q+ V/ L8 b- (setq m:err *error* *error* *merr*)4 s) M! h) w2 R+ m) X, j8 R
- (ai_sysvar '("cmdecho" . 0))' X/ O! t) S/ d. w2 V q1 v+ {/ ~2 u
: g, f; x* i. L. ^- (if (setq ss (ssget "_I"))
. j% b; @* {) ?/ a. u - (command "_.draworder" option)* |% {: B [3 \3 K( i# M* {
- (if (setq ss (ssget))# D8 X, [% R0 j1 K" X4 H: t! L# F
- (command "_.draworder" ss "" option)
5 Y* }6 P. V& Z h - )/ J! L! \, u0 \" z1 j0 g( u* V3 @
- )3 U @/ Q4 ^! s. k/ j, v
- (ai_sysvar NIL)
1 u5 O, C% H }8 v' U5 L8 Z - (setq *error* m:err m:err nil) R+ b& s1 K9 Q' g) O4 V! l0 z
- # E1 h; Z; ~. h0 M- f/ t( L
- (princ)
8 y$ X4 c6 Z1 N& [: N& E - )
, B( _* c+ z1 G; a8 G) O* H - % @; k' ~; g1 g5 P' g
- ;;; Command version of ai_draworder to be called from the CUI, @) T. a5 Q/ ]% @+ k
- ;;; so it gets properly recorded by the Action Recorder
# U5 j" b7 L4 j& Y" F - ;;;
9 F5 ] q0 s! o l( l - (defun c:ai_draworder (); ] N1 n# ^' O9 F& H' x5 o6 e
- (initget "Above Under Front Back")
* M0 D9 D$ W+ R Z - (ai_draworder (strcat "_" (getkword)))
) N& L' L$ l7 T* G& r& g9 X - (princ)6 r' ?' b- m8 S7 @
- )3 E. z; t; D! I# r6 ~5 Q
$ b& K7 s* ~) b) a1 h( I( ?- (defun c:vlisp ()( ?- d/ u5 @, W5 v
- (if (/= nil c:vlide) (c:vlide))% ~1 }3 _: z: A
- )
/ w$ ^* \( G% v - ! p# B9 e' R9 f! J7 ~
- (princ "loaded.")
( y( [8 y& }+ ], u
3 F3 Y' K& R8 b, w/ A- ;; Silent load., M( t5 a7 i; S+ T3 B, I
- (princ)7 ^' q x7 Z! y* u( X
- % z7 d! R4 c6 `2 M, h# C- w* V( |
- ;;;----------------------------------------------------------------------------+ \: }) L$ Y' D3 v8 v
- ;;;$ L& G9 j/ d0 r4 v
- ;;; DDCHPROP.LSP Version 0.5
% e- c* F2 n" Z - ;;;% w* I2 M, K9 i: k% @
- ;;; Copyright (C) 1991-1993 by Autodesk, Inc.
4 Q6 T2 P2 ^3 `% ~+ K - ;;;" @( D! |- B% B* d6 z( _8 K, b
- ;;; Permission to use, copy, modify, and distribute this software
/ R$ s4 ^0 ?* D' V! @ - ;;; for any purpose and without fee is hereby granted, provided
; f* {% C. E6 M* Z# y* u - ;;; that the above copyright notice appears in all copies and that1 k" ?0 S' @+ w; ~, r: P
- ;;; both that copyright notice and this permission notice appear in( j0 ~% h9 ?& }4 s# ^: l
- ;;; all supporting documentation.
' ] L9 E0 p) `# V: F$ D! j: ? - ;;;
]6 H- }: k) \/ l2 E- z - ;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED
# J8 [3 |5 A3 i# }. k0 F9 z - ;;; WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR
/ g W6 g! B5 {7 b* g' L* ? - ;;; PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.6 ]9 }# t# W: j" y$ t( F/ N8 i
- ;;;
; W, m- T; T- z& m, U - ;;; 2 February 1992# O1 H, h9 \7 E4 u b1 R. L
- ;;; . z' U+ c( P* F4 t r; t' A
- ;;;----------------------------------------------------------------------------" Q& w$ l( s8 {
- ;;; DESCRIPTION
7 V" i) l* R$ O) q9 y6 ^! t - ;;;----------------------------------------------------------------------------( _9 S" q% J1 @$ b% a' E
- ;;; C:DDCHPROP is a dialogue interface for the CHPROP command.( P( Y2 `9 B+ D" c
- ;;;
( {8 c& {) N! `; X' n - ;;; The command looks similar to DDEMODES. The main dialogue has an image $ O5 i& q) J N9 c# N
- ;;; tile, 3 buttons (layer, color, linetype), and an editbox (thickness).
2 N6 |* r% H8 J - ;;; The 3 buttons each launch a sub-dialogue containing a list and edit box. : w1 d5 |1 x# @: r) p4 H9 A
- ;;; The dialogues are all defined in the DDCHPROP.DCL file.5 s$ c' r7 m! p$ `
- ;;;; b/ c! o$ M4 L, Y
- ;;;' S3 B9 ~: [: [: k( U
- ;;;----------------------------------------------------------------------------7 X0 \8 r$ [& h1 p1 Z# T6 \
- ;;;----------------------------------------------------------------------------6 W; V9 p1 c4 N
- ;;; Prefixes in command and keyword strings:
/ I: [ x6 B2 G/ {' ^; N - ;;; "." specifies the built-in AutoCAD command in case it has been
5 ?- u, v8 X8 I( q - ;;; redefined.
9 w9 O8 S; G5 \ n4 D5 j - ;;; "_" denotes an AutoCAD command or keyword in the native language5 [) z7 [* p) j E! b* ^
- ;;; version, English.3 \8 a) b) ]4 N Y$ t) e/ P) q: h7 ^
- ;;;---------------------------------------------------------------------------- c& ?1 ?; c4 [' p! e& ~# Z: ~
- ;;;4 O2 k! S5 p# Z" s0 l5 r
- ;;;
& V8 x( j* \9 I3 }( [2 m/ D+ D* O - ;;; ===========================================================================, k, d( n. q7 @5 d8 J N- i
- ;;; ===================== load-time error checking ============================
+ W! C1 |/ M0 m - ;;;8 v X) ]( p- E+ V4 C
- : }: P" |' k8 o2 X4 V
- (defun ai_abort (app msg)& v; w. A5 e! B; K
- (defun *error* (s)
2 P. ?: i* d2 S8 A* J. h/ z - (if old_error (setq *error* old_error)), ^1 S7 l4 v, h0 O
- (princ)4 L& l7 }1 E2 X; ~+ J
- )3 T" m3 [; o9 a& V4 ?
- (if msg
/ N5 `; ~: b5 `4 I - (alert (strcat " Application error: " a* M8 p& f( a. [! ^
- app
3 S C+ `% U9 A6 P$ h7 T - " \n\n "
9 l n7 _, x$ r; b2 x \ - msg
- L. m4 o' p6 B: Y$ n! E - " \n"
5 p1 L1 {# w# b$ _+ z - )6 l4 Z0 u* M9 f4 }+ p2 b+ z
- )6 T! \% v8 J/ k) V( j
- )' f- }. U* h4 Z) p, ^4 p# N2 l! O
- (exit)% v M4 E+ [ C8 `* {% D
- )
3 b7 P. m8 Z* I2 I. L- l4 V" k; ~ - 5 X i* s1 D2 Y( x$ V
- ;;; Check to see if AI_UTILS is loaded, If not, try to find it,
9 j% T. a+ N/ Y7 y7 { - ;;; and then try to load it.- z5 \- [0 \' j% n1 U/ E1 A& J
- ;;;
0 K: w0 ^; X1 X# u! I - ;;; If it can't be found or it can't be loaded, then abort the) c) \8 S/ t0 t) @
- ;;; loading of this file immediately, preserving the (autoload)
n; O4 k. Z# }: m3 S& V - ;;; stub function.
) v9 l1 D" c, i. h. N - # t! ?+ K6 N0 w O# J0 F
- (cond0 q) H0 s; T" w9 d# Q- A+ @! `
- ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.
2 d* C2 P4 l9 d! d! P" {/ X - 7 n, I0 S8 m q1 K' t7 d
- ( (not (findfile "ai_utils.lsp")) ; find it
+ j/ ?8 y, ~# Z; E$ `+ ^ - (ai_abort "DDCHPROP", w) H5 o- M r$ k" ?
- (strcat "Can't locate file AI_UTILS.LSP.": W' _; J, z% a( e
- "\n Check support directory.")))
& J6 }, b& Y7 N - / `% {/ l2 X. |6 ]
- ( (eq "failed" (load "ai_utils" "failed")) ; load it' {7 v1 g S6 m) g/ y7 Y9 g, w( N
- (ai_abort "DDCHPROP" "Can't load file AI_UTILS.LSP"))4 [ S* G; x! X" J. C/ e
- )
- R. T0 S1 ^3 K& z! c
$ T+ X; e; ^" L6 [1 |- (if (not (ai_acadapp)) ; defined in AI_UTILS.LSP) ] F! I g# n
- (ai_abort "DDCHPROP" nil) ; a Nil <msg> supresses
/ f& n* ^1 l8 J* ~" s. c6 y - ) ; ai_abort's alert box dialog.
# A! k0 C. M3 ]' Q$ t( P - 2 c( x# |# A& [2 P" A) k5 V: K
- ;;; ==================== end load-time operations ===========================% e; {2 |7 } K
- 6 F* G- ~4 n/ R2 }
- ;;; Initialize program subroutines and variables.
& h8 ~, h2 o8 b
! O3 x$ J1 @0 o" g- (defun ddchprop_init ()- E, G2 h: w* X" N7 ?* T/ j. B+ g0 N
) }/ {" X% q( c' h# X- ;;6 D4 L% i' r& @; t& i
- ;; Define buttons and set values in CHPROP dialogue box
7 E7 N# I! h* Z8 h& k! s - ;;
" k. O( I: S1 O u+ c9 B0 z! {2 ? - (defun call_chp ()
- h% J2 U2 |0 \: @5 b - (if (not (new_dialog "ch_prop" dcl_id)) (exit))
6 p0 p$ M6 ^9 T4 M- L- y - (set_tile "error" "")
7 ?/ E0 W; n+ k) ^+ x! m - ;; Set initial dialogue tile values
! Q7 J5 y: `" `; }/ ~& { - (set_col_tile)8 z( l7 {! `" {2 m) V8 C; r+ Q7 M
- (if (= lay-idx nil)# Z, r4 U ^) v) @# m) ~7 l
- (set_tile "t_layer" "Varies")- t0 R9 u6 L( c7 F4 x# j
- (set_tile "t_layer" (nth lay-idx laynmlst))7 k8 n0 O/ ~9 j! `) B, x5 P& ?
- )5 S! |; q8 {- F) V( V
- (cond ) K% r4 S. _- K
- ((= lt-idx nil)8 v2 a- w- e( l y
- (set_tile "t_ltype" "Varies")0 k8 F/ Q- i% t
- )$ Y* Q- f% N$ M, j$ i) M. A' F
- ((= lt-idx 0) ; set tile "By layer & layer linetype"9 m: z# t+ W9 }3 t; E" T, m
- (set_tile "t_ltype" (bylayer_lt))* G2 H2 R2 u2 |7 T2 ?* x
- )
5 W$ r* J8 B$ a, [4 M - (T ) H$ F( A' N8 A) H2 K( Q6 `. l# G
- (set_tile "t_ltype" (nth lt-idx ltnmlst))$ ?, a" K$ ?; v3 |; _" R5 f! f
- )
0 e' Q* W% Y1 ]0 i9 V1 k - )
, g. U% ~4 z0 P$ f; p - (if (or (= ethickness nil) (= ethickness "Varies"))6 C! `1 q0 Z0 a
- (set_tile "eb_thickness" "Varies")2 G4 x. L, m$ X$ A* N% E0 ^
- (set_tile "eb_thickness" (rtos ethickness))
' N g( T: O. {; X- ?0 R. |( o - )9 D, |: {0 H4 |4 \
- ;; Define action for tiles
1 [* U8 V8 b: g6 j. ?" _2 e6 }! q6 R - (action_tile "b_color" "(setq ecolor (getcolor))")9 ]6 Y) l6 t0 A
- (action_tile "show_image" "(setq ecolor (getcolor))")
: b4 d0 h% u" l, R: P - (action_tile "b_name" "(setq elayer (getlayer))")( U# J7 }8 A; A1 @+ U0 v
- (action_tile "b_line" "(setq eltype (getltype))")
: y5 }8 i3 ~( }8 i - (action_tile "eb_thickness" "(getthickness $value)")3 E h0 n' b M, ?, ?. g }
- (action_tile "help" "(acad_helpdlg \"acad.hlp\" \"ddchprop\")")
) C! B- o U# ]4 K. U - (action_tile "accept" "(test-ok)")
1 ~0 `" Q2 f& Q0 ^ - (if (= (start_dialog) 1)+ U+ n J' d5 ~' f9 |
- (progn/ {3 C; J! Q3 l: Y7 `# ]
- (command "_.chprop" ss "")
. H% r8 p& F) U3 C8 n9 o - (if ecolor; y1 E/ \( W% v1 i
- (progn( u& y3 G* e8 w% m
- (if (= 0 ecolor ) (setq ecolor "BYBLOCK"))7 [; ^1 K. l1 `) m7 W3 v/ v
- (if (= 256 ecolor ) (setq ecolor "BYLAYER"))
2 l; w, |, B* [. e - (command "_c" ecolor)
m0 b$ t& d9 c - ): h. c1 J" ^! w( \3 O- R3 v
- ); @; k& l) k9 `9 z4 J
- (if (and (/= eltype "Varies") lt-idx)
4 _9 P; o$ N0 y3 _ - (command "_lt" eltype)% O; W6 X" Q L3 x0 j7 Q
- )
: t# I( o# Z [$ U+ @ - (if (and (/= elayer "Varies") lay-idx)/ v) c+ z0 f& {, L# j
- (command "_la" elayer)
6 A2 C9 D/ C4 p - )
s! w7 K* n" ^. u4 K) A# i - (if (and (/= ethickness "Varies") ethickness)' i+ f3 ?' Z; A0 R/ b$ v" S5 _6 H
- (command "_t" ethickness)( Y4 X8 D- c( Y h, A6 G! u
- )0 F) P5 \/ w6 ~8 r2 d' {
- (command "")0 F& c' t, y3 J, V
- )
! w$ q0 J1 x* J5 } - (princ "\nProperties unchanged")* I: I2 j/ O* l3 e2 w; l* D
- )
# t8 \* e* Z' \- [' ~ - (princ)
* N. u- [3 o5 [- ` - )
1 w# |% O9 A* E) J; T4 }$ D1 \ - ;;
7 t; G; l5 s- r - ;; Function to set the Color text tile and swab to the current color value.( D% _& S% R. d4 v
- ;;
1 J- A3 m! k6 w8 M7 e$ N* a* V - (defun set_col_tile()
; J$ k7 ?3 L0 C5 Z0 S9 a4 r& m3 r - (cond
! q" ?8 T5 h" a5 l/ O$ z/ }& J - ((= ecolor nil)
+ l) }6 V& M+ h! l6 ] - (set_tile "t_color" "Varies")
$ N* S% j. C& U. ~7 q$ U- e$ ]9 L h - (col_tile "show_image" 0 nil)9 E j4 E9 ^ f, B% f' m+ l7 }
- )
) w' m2 M, t; ?1 t# l - ((= ecolor 0). P: ^2 ^3 l1 m9 I# @7 b( g
- (set_tile "t_color" "BYBLOCK")
# [7 x+ j6 {& `% t/ B9 U - (col_tile "show_image" 0 nil) c* g$ n" y- [" G: f
- )
+ a( h( A5 {7 `$ y; Y6 q; X( c - ((= ecolor 1)/ `3 v' `" F- s( C" ?
- (set_tile "t_color" "1 red")2 S; P& v' T6 J% `. [/ I
- (col_tile "show_image" 1 nil)
- b" b7 A8 V2 _' W - )- b% m' |$ G7 ~! C) O0 q
- ((= ecolor 2)
5 C0 _$ a& V, j1 U0 v. W4 L - (set_tile "t_color" "2 yellow")
* X1 @7 a, M8 X$ D% X6 ?/ I - (col_tile "show_image" 2 nil)$ Y# f, H% a- ~( @0 v8 f
- )
9 b: X" n Y! W J6 m - ((= ecolor 3)& S1 W# n6 R* S1 r6 p3 k/ Z
- (set_tile "t_color" "3 green")+ G5 A$ G/ v- J, x( G/ J( A! t$ V4 u4 I
- (col_tile "show_image" 3 nil)
9 i6 l, H7 D. e' ? - )
6 r8 S* P" x( Z9 r - ((= ecolor 4)" K) x9 I0 b$ U# v6 J ~2 G
- (set_tile "t_color" "4 cyan")2 { B6 Y9 B) g
- (col_tile "show_image" 4 nil)- G! f P b9 |9 y( E
- )4 y: i1 T2 y. ]; \( w) g
- ((= ecolor 5) H1 s# [) g* d& g9 v9 W
- (set_tile "t_color" "5 blue"): C# Y5 N, u3 ] ^
- (col_tile "show_image" 5 nil)7 \2 t' G' F8 r" w' j
- )2 y/ s6 k0 _; ~' l; A
- ((= ecolor 6)
) [2 f: `7 h- P - (set_tile "t_color" "6 magenta")
. C( c: H9 b' c - (col_tile "show_image" 6 nil)/ K& y. C" A8 X) w% J) }& K% Q
- )
' ]2 T% Z7 X# ]/ ] p - ((= ecolor 7)! S) T& W; ]* W3 r3 a" F7 O- D
- (set_tile "t_color" "7 white")+ M$ H+ f- r* v; S# T0 s
- (col_tile "show_image" 7 nil)
) f# ?7 @; n4 | - )3 N8 b( {4 k! C) f, M
- ;; If the color is "BYLAYER", then set the tile to+ x( K* f% x6 n0 Q
- ;; show it's set By layer, but also indicate the
" c+ a8 U4 a/ r1 y/ Q+ F - ;; color of the layer - i.e. By layer (red)$ y% _# t& `) C- ?7 C7 B4 L) f
- ((= ecolor 256)/ @# m- W) ^# q6 |5 y
- (set_tile "t_color" (bylayer_col))) }5 t* B4 Y( Y, y; { S( ]5 K6 v
- (col_tile "show_image" cn nil)
* k/ t! L0 h$ e/ m - )
( u( F/ K1 W( d5 ]% t4 Z; X - (T
$ K1 V( Q/ b6 Q* H* k - (set_tile "t_color" (itoa ecolor))
6 \0 w& t# p- E2 V" ]! i6 Z6 F2 W! S$ b - (col_tile "show_image" ecolor nil)9 q2 {# p# R! p& X' T3 {
- ). }8 P5 p# m% ^
- )
) D; ~" J7 m. P4 P8 e& u( F) ` - )
8 ]8 n7 Y6 y: n z - ;;9 K# A% I9 }/ P* e: W
- ;; Function to put up the standard color dialogue.
6 z* h2 b1 G% B7 k - ;;
5 o2 H% S& H" ]9 F3 B7 [' ?# E - (defun getcolor(/ col_def lay_clr temp_color)
# b8 e0 ~' ^: u1 c% A - ;; col_def is the default color used when rq_color is called. If ecolor $ i: \+ A3 ]6 k6 b6 }. S0 \
- ;; is nil (varies) then set it to 1, else use the value of ecolor.
% I1 _! u: O9 Q) E7 k- y8 m/ N% z - (if ecolor
4 u1 K$ U! k j, v - (setq col_def ecolor)
* `+ Q. Q1 _5 e0 { v) k4 ^0 Z - (setq col_def 1)# t+ L' W% L# X) a5 F6 _
- )
. W! L# C5 ^( A# Q7 u M, |! x -
; j ?& w, [* _+ {! {/ v - ;; If we're working with a single layer, get its color
0 ^9 h0 j& h/ X5 Q$ q) n - ;; for use in the color swatch if the user selects color BYLAYER.; |1 g- [7 I5 f2 q
- (if (/= elayer "Varies")4 |7 \3 t- Z4 m' o3 |
- (setq lay_clr (cdr (assoc 62 (tblsearch "layer" elayer))))5 t% U2 Y# c0 L; F
- (setq lay_clr 0)
1 q3 {$ C0 j) G8 r/ h- T - )
' I6 P+ h/ K5 A* u - (if (numberp (setq temp_color (acad_colordlg col_def T lay_clr)))
% M. g# c- C! F- M - (progn
' R5 g( x9 ?5 s1 L# t0 b - (setq ecolor temp_color)
2 v6 H1 V0 v# e4 {1 C2 U - (set_col_tile)/ p: O5 W! i( M( l0 }4 L
- ecolor
$ ]1 _9 d, [& A4 _ - )
! E6 e# j& i: B0 A4 X" i$ p% O( } - ecolor
! b; v' X" x1 ?) B3 B1 f - )
& i. U! B! n2 W8 @$ m1 b/ u - )
9 I, f/ m- P8 ?" ]$ J2 R - ;;
4 H/ {) ]5 @, k4 m5 H( ^! Z+ ^ - ;; This function pops a dialogue box consisting of a list box, image tile, / R: W1 r8 f0 s8 F) G/ d
- ;; and edit box to allow the user to select or type a linetype. It returns " h7 x/ n! I" _! p% X! R
- ;; the linetype selected.
% O' e2 F3 @3 d2 H$ h - ;;
+ I3 T/ [$ Y T; z5 \# y! V - (defun getltype (/ old-idx ltname)/ X% Y* W4 @9 q. D* a
- ;; Initialize a dialogue from dialogue file
5 Y2 N+ ^- X3 e! u- l - (if (not (new_dialog "setltype" dcl_id)) (exit))
% ^# D, N, X+ D) t9 |+ D - (start_list "list_lt")
1 Z4 ]$ d6 p8 I) C# m$ u - (mapcar 'add_list ltnmlst) ; initialize list box$ G; z) p) }9 I- V F5 P
- (end_list)2 G/ N& D- K: {3 |" c' ?# I/ W
- (setq old-idx lt-idx)
( c: s5 O H+ B+ l O - ;; Show initial ltype in image tile, list box, and edit box9 S6 A4 V3 \/ ]
- (if (/= lt-idx nil)& K" ^; |9 _. n9 y+ O
- (ltlist_act (itoa lt-idx))( ^6 k8 o, }. y1 v; u/ b% n
- (progn3 y' l0 _+ x$ b# O2 |5 I! D
- (set_tile "edit_lt" "Varies")
, n. z# ^4 F3 [0 S( o - (col_tile "show_image" 0 nil)
2 k; h, d( l* v9 _ c/ i - )
2 ~4 U3 n. x8 O7 } - )4 d; m d2 X9 b y6 [; W5 n
- (action_tile "list_lt" "(ltlist_act $value)"): |4 r+ k9 V% U
- (action_tile "edit_lt" "(ltedit_act $value)")
2 I/ V/ q% B0 N+ u - (action_tile "accept" "(test-ok)")- a9 C0 O2 b% n3 {
- (action_tile "cancel" "(reset-lt)")
6 \ Q. B2 J; j- g: P' x; z. { - (if (= (start_dialog) 1) ; User pressed OK
7 t% @+ \# [$ \ - (cond
) K7 i# _ K+ S u; `+ m5 E - ((= lt-idx nil)& B' }8 W" Q/ e2 g) u
- (set_tile "t_ltype" "Varies")1 }* ?: H. o, I2 r4 h
- "Varies"* N9 z, \+ y2 H: L
- )5 `7 c4 E# L( T* \
- ((= lt-idx 0)9 R$ {+ u# H( D" N; O6 Y. B0 v
- (set_tile "t_ltype" (bylayer_lt))" V+ {1 T8 V4 I u' B
- "BYLAYER", u& d% }& J7 r4 d+ Y* G
- )
, S# Q5 J4 s) V, {. m$ q - ((= lt-idx 1)0 C2 K/ a. Y. R
- (set_tile "t_ltype" "BYBLOCK")9 p! m& y: m5 q' T: u7 R
- "BYBLOCK"
5 q. I; j! g. \, N7 o; z - )
( l6 e& H: D; D8 s5 v - (T % y; `( y% c* l9 I8 M6 ]
- (set_tile "t_ltype" ltname) , G6 q& }, m/ m. I- A
- ltname
+ C3 F r0 x& A' e# V \ - )# Y' R$ O& Q0 A: J& T
- )
9 i! O7 U" T" j |4 i - eltype
6 Z! ]0 \6 Z7 E3 S" ] } - )
, k) O/ t0 f. s; W, T/ j - )
1 k+ ^/ R& t% |9 K8 m1 X9 W - ;;4 t) h3 F! Z6 e1 R; C" A
- ;; Edit box entries end up here; S" g! H0 P: k3 G9 m4 e5 X
- ;;/ X- q( l2 `4 \2 U% F: M/ x7 K
- (defun ltedit_act (ltvalue)& G0 A; V5 f6 k. ]0 f- s$ c
- ;; If linetype name,is valid, then clear error string,
Y4 b1 t( Q7 ]$ i* ^6 b$ H' W - ;; call ltlist_act function, and change focus to list box.$ m: {/ [& j7 Y' B* {5 `4 `2 t
- ;; Else print error message.- _0 I% H/ J! I" m- }+ H0 t
- (setq ltvalue (strcase ltvalue))7 e$ @- [* p8 U9 V
- (if (or (= ltvalue "BYLAYER") (= ltvalue "BY LAYER"))
$ I" m/ \: Z6 b8 M: A. m' i - (setq ltvalue "BYLAYER")
8 k: `3 c6 R0 |3 }3 d& W - )
$ a3 A9 X0 L' ]( \/ ?$ n - (if (or (= ltvalue "BYBLOCK") (= ltvalue "BY BLOCK"))# _! P; U: r2 _% @, N3 \: R
- (setq ltvalue "BYBLOCK")
- w% R Y0 y7 y - ), [/ Z u# Z+ M' B4 H; W6 D* M) [
- (if (setq lt-idx (getindex ltvalue ltnmlst))! [4 w5 t- n( h; J ~
- (progn
% Q( P: b9 \4 w - (set_tile "error" "")
8 a# c7 l3 u" n0 Q1 { - (ltlist_act (itoa lt-idx))
/ l S) O C" H6 s# p - (mode_tile "list_lt" 2)' h- w3 \& v$ D- S, `
- )* c+ w9 T! F8 {, L( ~$ A
- (progn
+ c4 K* a, M$ K - (if (/= ltvalue "VARIES")
8 k- X; x! e+ r/ l0 H& a - (set_tile "error" "Invalid linetype.")
( |2 @, X/ y7 |" F1 T1 q- d - )
4 R& f2 M2 L% l3 Q# O2 C C - (setq lt-idx old-idx)# W0 b% X9 t8 C+ h5 \: x) S
- )
A; W5 v5 T: Q( U# @- o, N - )! c- r: }5 c4 a q, |2 m x
- )
" h; U/ J+ F. ?0 ^ - ;;( G4 N+ f- d; W% P3 M- b7 P
- ;; List selections end up here
. ~" P' q/ {) @( ~, E3 X" \4 Z- v - ;;
' f# f& W- x# w/ Z/ q6 p1 I - (defun ltlist_act (index / dashdata)2 U ^$ I+ L4 ~4 b" ~2 f
- ;; Update the list box, edit box, and color tile" z. F# F+ O% V9 _
- (set_tile "error" "")) h* X j* {/ \' @
- (setq lt-idx (atoi index))7 n% \8 _0 x3 }" X; o7 W6 S
- (setq ltname (nth lt-idx ltnmlst))
& b0 _0 f% r6 | A n - (setq dashdata (nth lt-idx mdashlist))! y# q1 @; |' {+ z% g2 n! ?
- (col_tile "show_image" 0 dashdata)
, }" G! `; h0 b3 D - (set_tile "list_lt" (itoa lt-idx))
$ y- B) ^$ d/ z* M, h; K- K$ N - (set_tile "edit_lt" ltname)
: j% I- U- |8 C8 `% d - )- t& s( B& i1 q8 [2 S) [# W/ `# p
- ;;/ g& [1 P8 C. h v2 r
- ;; Reset to original linetype when cancel it selected* D9 i) I0 g/ K0 W( c( {- c# I
- ;;
1 p: z9 F9 ]: B4 |7 K/ |8 ] - (defun reset-lt ()- M2 u7 t% F( }, ~2 R; |9 R
- (setq lt-idx old-idx)% c e! u( {& a2 V! N
- (done_dialog 0)
1 A! w7 E+ e* E3 C - )0 m- @3 a7 Q1 N: i* c& c
- ;;4 n' |7 ~ L: E) l
- ;; This function pops a dialogue box consisting of a list box and edit box to
3 C2 |7 W) j6 i0 N |6 I8 t - ;; allow the user to select or type a layer name. It returns the layer name & D6 [, z" U+ k
- ;; selected. It also the status (On, Off, Frozen, etc.) of all layer in the
+ u$ b$ A9 ~) w" s0 w! ] - ;; drawing.3 D, n, [; {% {0 T( M
- ;;5 b; h7 W3 t4 H3 U. n1 C7 Q
- (defun getlayer (/ old-idx layname on off frozth linetype colname)
9 |4 |5 [, g; s! W W( v - ;; Load a dialogue from dialogue file, I0 t) `: w4 a9 I" v
- (if (not (new_dialog "setlayer" dcl_id)) (exit))
5 K; k2 y" @# S2 f - (start_list "list_lay")
( J5 W0 G5 n' [: P - (mapcar 'add_list longlist) ; initialize list box
/ ~' D/ D: J9 z - (end_list)
8 }6 }8 j, s, J* p; d - ;; Display current layer, show initial layer name in edit " o2 }# h: r' w f
- ;; box, and highlight list box.9 r6 i5 W( _9 _/ ?
- (setq old-idx lay-idx)
7 f+ j0 b: Q! b2 n Y) I' r - (if (/= lay-idx nil) (laylist_act (itoa lay-idx)))
9 j; i7 i# I T6 x7 O3 `1 v. n - (set_tile "cur_layer" (getvar "clayer")); y' N) u9 U' v. v" V
- (action_tile "list_lay" "(laylist_act $value)")
! r9 {/ b/ T. v/ ^( q - (action_tile "edit_lay" "(layedit_act $value)")
2 A! ~- H% P; C* M0 Q3 [ - (action_tile "accept" "(test-ok)")
, z1 n( F2 d* u/ K. a, a - (action_tile "cancel" "(reset-lay)")2 J: ?) L& x. E3 Z
- (if (= (start_dialog) 1) ; User pressed OK
- J& f- y1 ?! I# y5 b" W) P- O - (progn, `% t/ U, H4 u: d3 `! m9 D
- (if (= lay-idx nil) (setq layname "Varies"))
2 {& s& X' V; ~ ?" t - (set_tile "t_layer" layname)
6 p6 S4 G P+ Z6 ? - ; If layer or ltype equals bylayer reset their tiles
$ j& Y) W' C( Z; Z" z9 c) s) e - (if (= lt-idx 0)
1 @% E# P. |- X - (set_tile "t_ltype" (bylayer_lt))5 N! i; v! Y' W& l
- )* ?7 e5 q8 M9 w
- (if (= ecolor 256)
% _7 U2 s" u& s" A - (progn3 H. f+ ]4 S. K& \* K D
- (set_tile "t_color" (bylayer_col))
- W4 K T1 v/ x7 t% \6 X - (col_tile "show_image" cn nil)' W6 D9 S( E$ W$ z9 n
- )
% v" l r* \8 J* f& ]: Z - )6 h/ ]9 j p+ T7 G8 j$ `0 ~
- layname
& b) ~+ |" R7 g' Q: b - )* V; E. J' f& Z2 W6 |, m$ z
- elayer+ I$ ]/ }' E, n9 n% k
- )+ T& k$ n7 U, f6 R
- )
$ N/ _9 h( U! O: V% z: j- G! b - ;;
6 o6 O7 R6 `4 M: m _. G1 {2 m - ;; Edit box selections end up here I. L9 R: Q; Y2 r: j' l
- ;;
' [0 X1 x5 [3 b/ ` - (defun layedit_act (layvalue)
. |) r8 E7 I0 F {+ Z - ;; Convert layer entry to upper case. If layer name is
7 r7 T) A; o8 \! e5 P - ;; valid, clear error string, call (laylist_act) function,: Z- I0 p) a& q" o- j3 g7 X
- ;; and change focus to list box. Else print error message.- M, ~# O! F( A
- (setq layvalue (strcase layvalue))6 o$ R$ O- f `: V7 ^
- (if (setq lay-idx (getindex layvalue laynmlst))
9 w2 r! c3 b+ }- } - (progn- ^: O+ n5 e+ k* b# Q' D
- (set_tile "error" "")2 z: U* c2 Z6 ]- O
- (laylist_act (itoa lay-idx))
. t" }" s# j5 n) \1 s0 a1 ] - )0 y0 J h8 B5 A! G9 u
- (progn
2 {4 v, S. b/ D7 q3 B8 ~ - (set_tile "error" "Invalid layer name."). h! P: V9 a1 v# Y" g& x
- (setq lay-idx old-idx)0 p2 m* N% I4 x4 b V
- )
( \# d* q; j0 k" m6 F - )
: V. O2 a [. M( V& r# i - )1 h# Y9 m4 b. @. k7 `1 Z) E+ q
- ;;! S* @- s! f" O9 ?3 j& z+ o; x
- ;; List entry selections end up here
3 w2 P1 L# v8 `4 [ - ;;
3 k1 ?! Y( J- @9 u7 k - (defun laylist_act (index / layinfo color dashdata)$ W0 m+ m6 ?/ V8 ^
- ;; Update the list box, edit box, and color tile
/ ~2 z# G7 Z0 n* o& f$ b - (set_tile "error" "")
+ V* n! o" P6 Z8 {, J/ m a - (setq lay-idx (atoi index))
( N1 ~! e, K4 | g9 ^ - (setq layname (nth lay-idx laynmlst))
. W- B5 E1 B6 A# Y - (setq layinfo (tblsearch "layer" layname))1 M \/ w! l- s7 K
- (if (= (logand (cdr (assoc 70 layinfo)) 4) 4)" L& F O! o3 m
- (set_tile "error" "Cannot change entity to locked layer.")
& B% X* v5 @* {: f$ P# Z - (progn
O p8 O3 u: ^# I5 E! y - (setq color (cdr (assoc 62 layinfo))), ~& L( _5 O* o7 M" Y5 F
- (setq color (abs color))5 d# M" F! f% l( L1 Z y
- (setq colname (colorname color))
9 l, B5 d! d$ j9 T- v9 h - (set_tile "list_lay" (itoa lay-idx))
% b( Q; ?) b7 n7 p, s( L5 p - (set_tile "edit_lay" layname)8 a" t! _7 C# z) a2 V
- (mode_tile "list_lay" 2)
( s4 h3 @# q" d* e6 C - )* z \) k& b8 a+ [0 f# j
- )% n' O% k$ v. }; d, W( Y
- )
! O1 D1 ]/ ]; K8 e7 i( V3 n5 n% r+ G - ;;
' V. ?; h c. ~7 J) y% ?7 H/ O1 E - ;; Reset to original layer when cancel is selected# D6 Y3 f- q' Y# u
- ;;
5 U" P; r) I, u5 v0 v8 C - (defun reset-lay ()% q. j1 C# c$ ]$ G! K+ r' o/ O
- (setq lay-idx old-idx)' C6 @: k" E7 U0 } i$ j
- (done_dialog 0)8 v+ a- d' J( g
- )
( S1 C7 J2 f! P. A6 U. D - ;;
, g, c! Z4 s9 R& N' M - ;; Checks validity of thickness from edit box. Since (atof) returns 0 when a " U. {* a _6 Y' s
- ;; string can't be converted to a real, this routine checks if the first
. l: M0 o, T$ N: z - ;; character is "0". It also checks to see if the value equals "Varies".
; b! b6 H2 T0 @$ I' X' f) |8 A - ;;
3 |) N8 r5 Y* x: ~ - (defun getthickness (value)
" \6 {+ z4 C) P - (setq value (strcase value))' x+ |( \" p4 m% s- w* h, _8 y
- (if (or (= value "VARIES")
2 V- x. K0 l9 y: ?5 z4 d - (distof value)
, }/ j7 W2 \8 E - )& E: _7 f e/ m! x
- (progn) h, j% b. l7 Y# o+ m! I; Z [
- (set_tile "error" ""), O! N( H& P9 y, q
- (if (= value "VARIES")
. L( g6 |& q: I0 J2 j& a - (progn
. w& L7 Z$ @5 ]0 B7 u" s6 R3 A6 ?3 E - (set_tile "eb_thickness" "Varies")
( |6 B8 Y" B8 A: ^+ d0 }; ?, u - (setq ethickness nil)
; t( r7 k1 d5 F8 n2 |) O - ). @/ {( |; [1 A& \# k6 |9 I P
- (progn
) k' b9 G% b5 k. z" h2 J$ W) W - (setq ethickness (distof value))
0 Q8 c! a" c9 P) F - (set_tile "eb_thickness" (rtos ethickness))+ w3 c: l- O+ h& z# @
- ethickness
: b' s8 Y( M6 S% H% {( R# Y" p$ V - )% y* E1 q' d/ z& [8 M
- ), w2 S2 V) r( v; A# a
- )7 D% C# \9 E( ]: w- Q
- (progn* p4 i; T. I9 d5 v! A
- (set_tile "error" "Invalid thickness.")
! C9 q8 ~# z( z3 [: o% b - nil
* d9 V+ T" ^- \% P - )3 K" ?' S9 C" f" |& ^$ E
- )
$ J3 ]) {2 U( | - )
5 }5 ~) v: b( O) ]" \ o - ;;
9 |$ U7 L, c7 G0 E8 v1 S - ;; This function make a list called laynmlst which consists of all the layer
/ C" D* y: Q c# f - ;; names in the drawing. It also creates a list called longlist which
7 v7 C7 u) q! \* j5 b5 W! S& x - ;; consists of strings which contain the layer name, color, linetype, etc. 3 n: V4 r/ Z+ B, v4 ~. f. ^. W
- ;; Longlist is later mapped into the layer listbox. Both are ordered the
# W, e3 N9 f2 z1 b: ] - ;; same.: }" l9 E( E# C( v7 ?
- ;;
& W1 _2 C$ L4 [' I6 N7 N - (defun makelaylists (/ layname onoff frozth color linetype vpf vpn ss cvpname
1 d! h3 G8 X1 @2 U; q6 X - xdlist vpldata sortlist name templist bit-70
! p$ i; B, e- r! s/ g1 O$ d- S - ). M& w7 k1 C3 l8 \2 i% R# D r
- (if (= (setq tilemode (getvar "tilemode")) 0)
& W1 {* m/ T' a F6 s- P - (progn
* N6 b; M; i% V6 w; J5 F' m# a, {; C - (setq ss (ssget "x" (list (cons 0 "VIEWPORT")5 {) U# ~* L3 m% I: n. Y
- (cons 69 (getvar "CVPORT"))& d; x8 o ?0 r2 A R
- )
! s) o& _$ y' ]3 ?/ f - )2 b$ Y. q1 ~, Q1 D( M5 S) Y
- )
6 d8 W7 z0 `% A5 q$ k3 y - (setq cvpname (ssname ss 0))
$ r2 w+ R' ^# F - (setq xdlist (assoc -3 (entget cvpname '("acad"))))
2 B1 n" R& q ~; y, f1 B: P2 U - (setq vpldata (cdadr xdlist))! a9 j7 J& H% M
- )
: @& P5 _' u* C. l - )
( U- d; l& Y) C5 f8 A - (setq sortlist nil)
; y2 G4 b2 K1 x$ e O - (setq templist (tblnext "LAYER" T)); k D7 Y# r3 t
- (while templist9 _/ u% }& c+ E$ ^& |
- (setq name (cdr (assoc 2 templist)))6 u8 \* u7 |" ^3 O3 ?
- (setq sortlist (cons name sortlist))/ c2 |/ ^: r2 A% l
- (setq templist (tblnext "LAYER"))
' R: V0 n' f6 e( Y- I& p& l - ) * A. { i! T/ z6 t
- (if (>= (getvar "maxsort") (length sortlist))% n+ w' t& l! t, F) u/ d
- (setq sortlist (acad_strlsort sortlist))
; Y, N+ }" z4 d, {1 ~+ @ k - (setq sortlist (reverse sortlist))
& j3 q- y+ n: U$ Z, l- C) H - )
, d: h' m* O% V ~$ _ - (setq laynmlst sortlist)- C( a2 }+ | u# g5 _
- (setq longlist nil)% m& F2 [6 Z# r* W
- (setq layname (car sortlist))# G$ ]$ ~; R! i# z! ^
- (while layname7 b k* v3 [* w2 C6 x
- (setq laylist (tblsearch "LAYER" layname))
4 w U- l' R' B" K4 e! c- H - (setq color (cdr (assoc 62 laylist)))5 y8 {: S! ~+ [8 C
- (if (minusp color)
, P1 `0 d8 p2 q, y$ a; o - (setq onoff ".")0 S4 a& R1 _2 n% K
- (setq onoff "On")
$ ^+ t) Q5 J; S- R3 x - )0 g+ M7 g4 J7 e. c1 ~+ h: Z
- (setq color (abs color))) b2 W. w9 B( M7 S6 D
- (setq colname (colorname color))+ _+ A% D& l: J- ~. P( H
- (setq bit-70 (cdr (assoc 70 laylist)))6 r: O- T0 q8 ?
- (if (= (logand bit-70 1) 1)
% F8 q, d3 a$ Z0 p, ~ R, E2 \ - (setq frozth "F" fchk laylist)
8 N5 W! ]8 @; ]6 C0 U+ g - (setq frozth ".")
, O! L' p, ~5 `8 t2 } - )
' \- o$ O, ?% _ - (if (= (logand bit-70 2) 2)/ w5 l j% d+ L2 e* t$ Y
- (setq vpn "N")6 _! X7 h! V& ~
- (setq vpn ".")
9 M7 o8 O' H6 d - )& ^' y w, {& }
- (if (= (logand bit-70 4) 4) o; s' A+ Q- A2 V
- (setq lock "L")
6 W; {- m) M: R- y) _3 W2 R& {$ w+ c; \ - (setq lock ".")
( C2 c6 m' a6 X, }! ~ - )1 Q2 R0 g' D/ Y; P" o# r, b0 }
- (setq linetype (cdr (assoc 6 laylist)))
- e" F9 _& J. D2 x2 ^+ l" j# e - (setq layname (substr layname 1 31))
+ b; K4 q" ?; i6 q2 { - (if (= tilemode 0)
2 T* p# a0 `2 J: y1 O. @2 k - (progn
8 H. K! Q" ?- u7 r. O4 X - (if (member (cons 1003 layname) vpldata)3 C1 v" A9 o Y/ ?' o4 K
- (setq vpf "C"); ?5 ^/ A9 N. c
- (setq vpf ".")6 T8 T2 L' \! H Q9 w
- )
2 O9 W3 W- {" h8 M& ^% ? - )
& B9 _! C& T! [% p - (setq vpf ".")% i" T3 S* z! b) ]# f* Y3 J7 w( z
- )/ B! R* C7 C9 S) y( x7 o
- (setq ltabstr (strcat layname "\t"& T. r. b" c) |6 @
- onoff "\t"" X5 E$ W3 E U2 p, S
- frozth "\t". ^) z7 t1 o- V3 Y5 p9 w- S9 e
- lock "\t"
# u- I8 m7 c' m+ f q - vpf "\t"
$ |9 u o+ \- d) ? - vpn "\t"
. D8 N7 w7 b# f - colname "\t"- h7 ]* ^3 D5 E1 d! C
- linetype' T0 r' [# `' x2 f; v. d5 ?/ u4 i# A; c
- )
# N& i4 s _7 @7 o7 @ - )
: A: j) }5 `& p# R - (setq longlist (append longlist (list ltabstr)))! S6 r* g$ G, K7 y( Z- O
- (setq sortlist (cdr sortlist))
( X8 F4 ]- t( a1 Q3 L- C - (setq layname (car sortlist))9 F8 t. |$ c" {: M* r
- )& f, [) v+ r V. ~
- )2 O- v' }. `6 A, P2 I* Y
- ;;5 H9 [6 n+ X: P# I! e/ w
- ;; This function makes 2 lists - ltnmlst & mdashlist. Ltnmlst is a list of
0 w6 M" i: h& ?3 T0 z8 z - ;; linetype names read from the symbol table. Mdashlist is list consisting / r/ u( b- t% n2 _! L# o4 ~
- ;; of lists which define the linetype pattern - numbers that indicate dots, $ o5 P& G' I( ?* c8 Q
- ;; dashes, and spaces taken from group code 49. The list corresponds to the 4 V* W1 G2 b8 w% T
- ;; order of names in ltnmlst.2 g: }& @! C, O% E d* L( Y
- ;; j8 E8 H* C: Y% P! @( M0 |
- (defun makeltlists (/ ltlist ltname)1 X. V' F/ K! a' ?3 l
- (setq mdashlist nil)
2 S P, j& e% i) y# V! O* z2 w$ c) j/ p - (setq ltlist (tblnext "LTYPE" T))
# X& T) R# V( p. j# ] - (setq ltname (cdr (assoc 2 ltlist)))
. x' C; ?0 a9 u, x9 P' Q - (setq ltnmlst (list ltname))2 |: C- q; [5 r
- 4 [( L) C; H. S2 g$ m9 k+ j
- (if (= ltname "CONTINUOUS")+ z1 w+ e- ]6 ?( w
- (setq mdashlist (list "CONT"))0 {4 C2 g( J5 J8 f$ p0 b; d; |
- (setq mdashlist 7 ^% b. v4 ]6 c9 E r z+ q
- (append mdashlist (list (add-mdash ltlist)))
9 ~; i& }$ f4 [9 g. a - )
' B; V8 d- y* _2 X4 i& p6 f" C6 O) } - )6 H: O$ r; S2 Z
- (while (setq ltlist (tblnext "LTYPE"))
" x# W1 D( q. }: X" m) X2 S$ d - (setq ltname (cdr (assoc 2 ltlist)))
( v* D# {" }& y+ b0 I1 I! V$ B' _ - (setq ltnmlst (append ltnmlst (list ltname)))
, |7 Y& G p" } - (setq mdashlist
9 X8 Q) A& N3 @ - (append mdashlist (list (add-mdash ltlist)))( f/ a7 W+ o" S: ?" _) G
- )9 x) U: _" s; }* k1 z/ G& ?3 O
- )
# V7 C( x, d$ A: J8 l' K3 h - (setq ltnmlst (cons "BYBLOCK" ltnmlst))
8 j, k3 |+ |: Q; C& ` - (setq mdashlist (cons nil mdashlist))
2 Q6 X0 s! x8 m; G; b - (setq ltnmlst (cons "BYLAYER" ltnmlst))
2 l2 i* z$ t- x, l, e4 a9 C - (setq mdashlist (cons nil mdashlist))
) e: z! h# j( _& D8 g - )& s6 d5 u6 \1 n2 z/ w9 ]
- ;;
" ^# ]- } \/ f8 @; W; \. v1 H - ;; Get all the group code 49 values for a linetype and put them in a list # x4 p, E/ k- z5 g6 Q- L
- ;; (pen-up, pen-down info)4 v, Y" [: N7 i% u6 e
- ;;( ]9 V2 {) H, i* ^& g* ^; P+ I! ]
- (defun add-mdash (ltlist1 / dashlist assoclist dashsize)
4 U& C8 f* s% j3 O. [" [" c - (setq dashlist nil)! R M+ v$ c2 l2 x$ }& | K" q
- (while (setq assoclist (car ltlist1))
9 d- m1 B+ r8 Z - (if (= (car assoclist) 49)
3 h8 X& k6 u6 i - (progn
& J. l" l+ l8 B$ l9 K1 t4 A - (setq dashsize (cdr assoclist))
/ ^5 m4 A- j% h6 ?6 P* { - (setq dashlist (cons dashsize dashlist))( d, b f. V$ \# @/ m9 E
- )
0 i0 R+ h) g3 ]& ?- v - )2 a; e" h) E$ R" J% r% H, l# b# j
- (setq ltlist1 (cdr ltlist1))
7 M( E1 ~. s% Z1 A" K5 M& U' c' s - )' H4 n0 g5 E, O' S% [" a
- (setq dashlist (reverse dashlist)). u+ ^- S& {. V
- )
1 M0 M, K, J; Q# j9 m2 t - ;;
9 p5 B7 ]7 z) p - ;; Color a tile, draw linetype, and draw a border around it% h! `% S# b; G6 _
- ;;5 f& X7 v$ G& M$ A! n! M, s
- (defun col_tile (tile color patlist / x y)
% f+ i! g }# ?6 j# s1 ?4 h - (setq x (dimx_tile tile))
% s8 A3 x3 r, R3 I - (setq y (dimy_tile tile))
3 K& G0 C6 w% E+ [ - (start_image tile)$ M% h/ G! Z: o7 b7 G
- (fill_image 0 0 x y color)! r H2 D* M( s, e0 }5 g7 u0 x
- (if (= color 7)
& e# `: J. Q* ]* B$ B8 q - (progn# f V# A4 G) i2 l" z
- (if patlist (drawpattern x (/ y 2) patlist 0))
4 t+ e. {5 f3 ^) g! r - (tile_rect 0 0 x y 0)
5 \ k, p j/ V7 N - )
# |7 n* t5 V) j$ O - (progn
: z# q6 G5 d3 Q0 X# Y; M3 O - (if patlist (drawpattern x (/ y 2) patlist 7))' N( V& `# B" T# C1 q+ O
- (tile_rect 0 0 x y 7)
5 d. E' U9 ^9 Q7 z- | - )9 w+ u, \0 r$ I, I ~2 f9 z
- )9 r" _9 p) d8 d7 M ?- I* ~- |; s
- (end_image)
D5 ^3 }! \; n! C6 v - )
0 S6 m# @5 S! w% o% D1 \9 I8 F - ;;; [) {/ f h/ }- f) a
- ;; Draw a border around a tile
; d2 {7 j- Y/ k - ;;
2 G4 T3 f. L9 X- J" m - (defun tile_rect (x1 y1 x2 y2 color)+ M5 A9 m$ ?. t/ ]
- (setq x2 (- x2 1))
0 Z* }+ _- s+ x - (setq y2 (- y2 1))' e5 o9 D7 {) Q! ]
- (vector_image x1 y1 x2 y1 color)+ S" a, c0 Z5 l/ D
- (vector_image x2 y1 x2 y2 color)
- ^, q/ N+ [9 E+ {7 M7 s - (vector_image x2 y2 x1 y2 color)+ J: O$ `- t7 g; S( l% D
- (vector_image x1 y2 x1 y1 color)6 u1 }" n4 C0 M5 l" \! ?# u( ]
- )
. m S, z2 X3 i - ;;
q, A, t+ r! H* d7 D - ;; Draw the linetype pattern in a tile. Boxlength is the length of the image : X. n, E/ m7 B( \+ U
- ;; tile, y2 is the midpoint of the height of the image tile, pattern is a
) F% |( I2 Y6 c3 Z: u - ;; list of numbers that define the linetype, and color is the color of the
9 h$ g: f/ U& K% b9 w D3 }* ?# g- Q - ;; tile.
8 B( y1 u$ [' X7 `0 m6 q - ;;8 n& l& e# U" c; o; R& T: x" |4 _
- (defun drawpattern (boxlength y2 pattern color / x1 x2$ Q& m+ a n$ W& u4 q
- patlist dash)
" ^- B+ L2 W6 d - (setq x1 0 x2 0)
( a5 y. Q8 _: ?8 B: [0 C - (setq patlist pattern)/ [6 L! K+ h' u5 ?
- (if (= patlist "CONT")
w" J+ C) ~' p# K# A! t$ ?8 m - (progn
! E/ h( b2 A P" w' }/ O8 g# Q: ] - (setq dash boxlength)
N0 J3 x6 Y& X: t' C - (vi)
. O# v8 X4 J1 G; _) F3 f4 Y. w - (setq x1 boxlength)
2 \' ^; D+ J4 Q0 V$ N, {. q - )$ K) v1 i# O* ^! H: d8 G: L
- )- w7 ]- Y9 z3 w5 C
- (while (< x1 boxlength)
9 E [- M! B9 E5 Q" o4 I5 o7 X - (if (setq dash (car patlist)): a' [* \4 a4 U- ` M9 Y. ~7 s% L
- (progn! I4 k2 ~# e) \# g% {9 m" }2 K
- (setq dash (fix (* 30 dash))) k1 l! x P) C0 S7 I
- (cond
* r- e2 e: m' o0 p - ((= dash 0) 1 f8 o" |1 Y1 {. D: M) K p
- (setq dash 1)
# o% z% X! z( r% M1 ? - (vi)( i# B9 P/ W, r, Q: P5 k" X \
- ). }" H, Z4 C$ M$ H0 g4 R: n& D
- ((> dash 0) ! S6 ~+ J x% {2 r4 p: o. C
- (vi)
2 q+ P6 a- q9 b% v ^0 t - )( v k9 ]; d/ C4 s
- (T
5 X$ L+ D: }. B& A, ?% f - (if (< (abs dash) 2) (setq dash 2))
, |& |9 t! L1 y - (setq x2 (+ x2 (abs dash)))1 P9 ?$ V3 Y& {6 Z- P3 V- J- a
- )* Q) ?* ?/ a% p+ K" P7 z
- )
, J a. W/ g0 G; e5 _ - (setq patlist (cdr patlist))
$ F: U! m8 e$ U% ?5 l1 J - (setq x1 x2)
- P7 U! p' t% [7 S7 Z - )
6 V9 O% _0 A7 ~4 b - (setq patlist pattern)
) L* @" u! B* e% ?* g+ [ - ). o0 V2 R" Q" l7 n, ^$ {. I
- )
m7 ^3 {% B' d - )" t( E: d* e5 F* |5 e! K* r
- ;;- m3 [; r& J8 m. G( `
- ;; Draw a dash or dot in image tile/ y) u; N( n/ R& o. l& |
- ;;
" [) {1 q, w! A - (defun vi ()
) y# S8 u! S; }# Y" r% h - (setq x2 (+ x2 dash))# X2 X$ k( |# t* B& Z
- (vector_image x1 y2 x2 y2 color)
' L- B7 I/ n: ~. ~6 u - )/ q5 [ m7 n: Z7 K- M
- ;;
& N. D1 f8 n9 o5 `- I) |/ d - ;; This function takes a selection and returns a list of the color, linetype,
$ R2 ~7 L7 M9 y `9 x+ h+ h' F: J - ;; layer, and thickness properties that are common to every entities in the
) ~+ s" u% n3 N- E; f - ;; selection set - (color linetype layer thickness). If all entities do not
3 G9 ~& N$ e4 [) {( u' j - ;; share the same property value it returns "Varies" in place of the
; N: d s8 m J/ q - ;; property value. i.e. ("BYLAYER" "DASHED" "Varies" 0)
" I. n7 i" e% h- ] F% g* F# G6 l - ;;
: @) w8 A* v% w( K0 q - (defun getprops (selset / sslen elist color ltype layer f5 ?+ ~ ~ y8 |; I9 u) Y4 c
- thickness go chk-col chk-lt chk-lay chk-th ctr): M" {/ \8 @' l
- (setq sslen (sslength selset))6 M: O. k% [& ]4 X
- (setq elist (entget (ssname selset 0)))
1 |; E: Z* t' x; t - (setq color (cdr (assoc 62 elist)))
/ b8 F# D* m) j/ {- T - (if (not color) (setq color 256))) L7 u3 X1 y, Y4 i' ~( E* o! I
- (setq ltype (cdr (assoc 6 elist)))
( [: f( \3 G5 Q9 u7 P - (if (not ltype) (setq ltype "BYLAYER"))& U) o+ o- r$ ^8 Z* r" [" f
- (setq layer (cdr (assoc 8 elist)))
% a0 l! g! x* f% A" y% i - (setq thickness (cdr (assoc 39 elist)))
+ I) U, s7 \' T5 f8 N# H* B% J6 Z - (if (not thickness) (setq thickness 0))
% K: d$ L& ^/ y# V - (setq go T chk-col T chk-lt T chk-lay T chk-th T ctr 1)
5 l! G [2 u @! `; g) ~# r - & L% m& f( P$ C
- ;; Page through the selection set. When a property' V0 R, w" K5 h
- ;; does not match, stop checking for that property.4 K. r) _+ Y+ r4 i% M9 Q
- ;; If all properties vary, stop paging.- S0 A( [" ~$ c! R8 h+ A
# X3 M0 B+ l* }- (while (and (> sslen ctr) go)
- F$ ]9 Q: T6 h. ?, `" M1 J/ @3 Z9 r - (setq elist (entget (setq en (ssname selset ctr))))
1 k; M2 b! G/ v% c - (if chk-col (match-col))% C6 Q( y$ G7 \* U B5 P
- (if chk-lt (match-lt))8 ^" N) }" J) Q2 ^2 U+ i( Y( J
- (if chk-lay (match-lay))
6 g4 j* `# O3 U2 O - (if chk-th (match-th)); }* i7 ~% p0 `
- (setq ctr (1+ ctr))
& q; _# U0 y( A+ y5 d - (if (and (not chk-col) (not chk-lt) (not chk-lay) (not chk-th))* F+ b7 e/ u8 F5 ^0 a
- (setq go nil)
4 Z$ l5 W6 f1 `5 G - )) v. G4 ~2 [) Q
- )4 s4 O' ]+ [% p+ B @
- (list color ltype layer thickness)
4 j( R/ P6 R, ] - )4 a' C6 S( K$ k# G' a) b+ t
5 ]' n$ P! |5 {, E" o. a+ W- (defun match-col (/ ncolor)
9 a* C6 m M4 q+ D# x& |; u - (setq ncolor (cdr (assoc 62 elist)))$ `( f. Y5 P% J; v" I
- (if (not ncolor) (setq ncolor 256))
1 G* E0 W, S/ x/ e - (if (/= color ncolor)+ N" G4 I$ |. [* }5 a# w# w& F
- (progn
% {0 F1 H" ]+ V' w; X7 X - (setq chk-col nil)
) I) R* C% r) U6 T - (setq color nil)/ i$ K( ]% u' s+ i+ U2 E: [7 F
- )3 Z" d: S+ o- ?' k0 T5 T0 w$ `
- )
( e* W8 I" X% O! u3 l - )5 E* P y4 f5 t8 C
/ H- z9 i, h# A% L& ~- (defun match-lt (/ nltype). Y" A; _3 `+ U( Q/ G; A
- (setq nltype (cdr (assoc 6 elist)))
- D5 U. A# `; m* b6 m; `' N - (if (not nltype) (setq nltype "BYLAYER"))
y& j0 v" v3 ]6 B% d+ w - (if (/= ltype nltype)
2 r8 T+ {# X. w# l2 B: T - (progn
# t) z, F' w: v" T2 ~+ R/ v- g9 x - (setq chk-lt nil)
' N. W. u5 W( g" F+ N - (setq ltype "Varies")
9 x& h7 o; w2 ^+ a w* l - )+ Q, R; C% Q2 j+ n" o( Z4 X
- )
6 F! c6 o$ p. s3 R4 ? - )4 m" M1 k- K8 U
3 `9 F4 A% ?: g9 a" L1 @- (defun match-lay (/ nlayer)
6 W3 ~% H$ b' i- i+ i* z6 h8 w0 T - (setq nlayer (cdr (assoc 8 elist)))
y7 C" e+ n1 r - (if (/= layer nlayer)& g/ i8 ~+ ?1 e8 O3 C5 H
- (progn& @6 Y7 Z r+ X4 n0 U# a* U) m
- (setq chk-lay nil)2 G' Q0 z( Q% E, w8 ~. R7 j
- (setq layer "Varies")
4 `/ X5 L! }! X6 Z; p( ]4 c1 _( F - )5 P ^0 j! K$ U/ A7 I
- )
' p- @ X0 U" O9 f0 c, a - )) |8 y0 t3 P9 H7 Y
- $ l1 Z' u: m, d9 k. @. r. Y$ }
- (defun match-th (/ nthickness)
' p# i" b9 u2 V, {9 I+ E6 S2 c4 |. ^ - (setq nthickness (cdr (assoc 39 elist)))
' s5 w ] u2 l$ d$ a; U- a - (if (not nthickness) (setq nthickness 0))
/ g5 i3 B$ t; P - (if (/= thickness nthickness)
3 a/ q5 Z$ B2 S% c X: b$ F - (progn
! F. m( @ P# N8 M2 d - (setq chk-th nil) d* Q: O3 ~7 }6 M; k1 l
- (setq thickness "Varies")' W8 `6 q' w8 `! b5 g
- )% O' r. O6 K! V. a7 W1 E9 ~
- )
" p1 p g0 t. H* K9 _) M - )% R0 @* i, Q' [ P/ m
! K- ^; X# ~ X+ @3 _4 o3 Z- ;;
% E( [- g2 d1 d {, u+ D - ;; If an item is a member of the list, then return its index number, else
) }4 d$ u5 H! ] - ;; return nil.; r, F% V/ V L
- ;;
- ]) z) O( v+ @9 g4 { G9 @0 _ - (defun getindex (item itemlist / m n); w/ ]' [) l. Q+ L; S4 c
- (setq n (length itemlist))
% P3 \' J3 O/ q; r i - (if (> (setq m (length (member item itemlist))) 0)
3 l7 E" @# f- b2 p# G - (- n m)
+ b/ w7 J& S; c0 y: G5 _ - nil
, f9 C, d' V3 G. Q+ H/ Z - ) F, F5 c/ v3 u2 k$ m8 H
- )- [+ g$ `7 c1 G! ^' x( K
- ;;2 n4 m' x+ V4 `9 s- E
- ;; This function is called if the linetype is set "BYLAYER". It finds the " B" _# Q. b1 l# b& M5 x
- ;; ltype of the layer so it can be displayed beside the linetype button.2 S- w, q; |- y! l5 G
- ;;7 S0 V2 @# {- k9 ^8 H8 u, Z
- (defun bylayer_lt (/ layname layinfo ltype)' R$ D' c; W% v X$ e
- (if lay-idx
4 R" [1 W& |' B* S, w8 F - (progn
G& n$ q. B' V# C6 \- B - (setq layname (nth lay-idx laynmlst))# y0 ^6 ~" |1 q7 B# Y
- (setq layinfo (tblsearch "layer" layname))0 n4 p: u) t" e3 p C" ^1 T q
- (setq ltype (cdr (assoc 6 layinfo)))- B" D8 D8 |& f2 D4 ?
- (strcat "BYLAYER (" ltype ")")2 v4 V7 ~) c6 ~3 \$ d& G
- )
" s1 |2 r& W9 M$ V0 M# p - "BYLAYER". B$ A9 M! t0 ^" D4 P# M
- )
+ W$ K9 L3 J _: B - )
4 D* S7 o. D; }" P$ |5 k- d( Y - ;;
+ w% _/ x8 T+ D+ S. z+ [ - ;; This function is called if the color is set "BYLAYER". It finds the
* W3 \ X/ E) n5 R9 P- H - ;; color of the layer so it can be displayed beside the color button.
6 R6 ?& [1 |% a3 u - ;;& ]9 N% ?" l3 Q, r
- (defun bylayer_col (/ layname layinfo color)
& Y/ M- T) w) x/ f& L( d - (if lay-idx
4 R& B3 R7 Z3 `, ` - (progn
T; L5 ~) H: b4 N- W+ D$ n# U3 X - (setq layname (nth lay-idx laynmlst))8 m6 l8 h/ ^9 ]+ k7 T, R- i
- (setq layinfo (tblsearch "layer" layname)); |/ j4 T9 ?' i9 g$ B ~1 t P
- (setq color (abs (cdr (assoc 62 layinfo))))' V1 T. H# A/ Z4 i0 K0 a
- (setq cn color)
3 _- ~8 R; Q8 u! B" Z - (strcat "BYLAYER (" (colorname color) ")")2 G; i8 x. L' `+ l$ X) p2 s3 P# l
- )
\$ t8 P0 Z- p - (progn" u( U u: u& E5 ~- f) l0 H
- (setq cn 0)
O0 E3 b& o, i - "BYLAYER"
: P0 Y# B; p' a1 N: ?1 G0 `! Q - ) V+ H& _1 B# b; P$ U" f, W7 g: x
- )
X5 P4 ?+ c+ }4 v5 c6 f - )' l* n5 }: I k) n$ o
- ;;
- j+ u6 H) q7 k' D" X, E - ;; If there is no error message, then close the dialogue
! T1 t2 a0 ?: @9 | - ;;
7 ~7 H& \3 @/ U- j7 n - ;; If there is an error message, then set focus to the tile
( d7 S5 w0 w+ _+ k - ;; that's associated with the error message.( q3 U+ T# X. H# C8 n! S* f5 o. v
- ;;
2 @ |6 _3 w" K! _ - (defun test-ok ( / errtile)2 E c' D2 e# h) v+ D5 }! R( _
- (setq errtile (get_tile "error"))9 n9 E& o# c! X3 D0 f9 J! ^3 n
- (cond
2 O, c1 V2 v" d - ( (= errtile "")
; V2 p- A, K9 ^# k/ }* a/ y: L - (done_dialog 1))
, w @0 y* W. t" x* H - ( (= errtile "Invalid thickness.")$ U. m* Y. `+ o2 W6 _' S# Z( I
- (mode_tile "eb_thickness" 2))3 l4 @/ I8 _# Y3 I, V0 O' a
- )5 J( z% {& ?5 a$ _
- )
* p" I) F9 b+ v6 v - ;;
c. O9 b. h: R - ;; A color function used by getlayer.6 e9 ?4 Z/ G1 Y* a* b- B* j
- ;;( ~7 ?$ `+ p+ ]' D
- (defun colorname (colnum)
0 G- i, G E1 l% M, \- Q+ f - (setq cn (abs colnum))
" i% n6 N# W' x* K& t0 J - (cond ((= cn 1) "red")$ t2 `% p, k: g, q7 k
- ((= cn 2) "yellow")/ O% f6 \) W4 y' x3 ^5 H
- ((= cn 3) "green")
9 k* H" A, C: P/ K S - ((= cn 4) "cyan")2 U5 n8 r4 ~- y6 ]) B: C
- ((= cn 5) "blue")
8 C' g3 ?3 G) P' H - ((= cn 6) "magenta")
) z- f. n( E1 |/ N q - ((= cn 7) "white")
7 r6 o- o. h: E% l9 \; F/ ^ - (T (itoa cn))* X" U' U5 K" D( @9 ]; a" X& X8 l
- )7 ? J1 V1 F3 ^% ]( }) S
- ) O' z+ W, V" a( T2 ^" c7 p! w
* ^" O9 R& ]. n) D/ a8 Z- ;;; Construct layer and ltype lists and initialize all
% v4 T( S6 D: i - ;;; program variables: \3 h4 H/ A8 f, y3 X
( R# N1 @' k$ E) i* f: S- (makelaylists) ; layer list - laynmlst7 m5 G8 q2 n4 R# v1 l4 W$ N
- (makeltlists) ; linetype lists - ltnmlst, mdashlist+ u/ ~- p. `0 i3 G
- ;; Find the property values of the selection set.9 l5 w) K' D. o# K# p, J1 g
- ;; (getprops ss) returns a list of properties from d4 V7 K( c r! f4 W
- ;; a selection set - (color ltype layer thickness).& n1 E r4 e# D$ C1 ~
- (setq proplist (getprops ss))
4 B/ O0 {2 u9 _. E; {8 h7 k - (setq ecolor (car proplist))3 \* \. P3 M# {" K: J5 o- h, _
- (setq eltype (cadr proplist))
8 p; s6 B; G3 s+ g: _" }/ l; J+ ^* t - (setq elayer (caddr proplist))
$ ]5 n! K& J9 g4 d. k5 N& @, B0 X1 Z - (setq ethickness (cadddr proplist))$ M: J# R* W0 r. Y P9 A# k. ?6 T
- ;; Find index of linetype, and layer lists
/ o# c! G3 {8 b1 U: ? - (cond
" L' f1 a% g/ |0 K# g3 a- x% R - ((= eltype "Varies") (setq lt-idx nil))
- y; a& F' c7 V. ` - ; ((= eltype "BYLAYER") (setq lt-idx (getindex "BYLAYER" ltnmlst)))' s/ o+ ^0 ~4 e/ L6 {: t! Y
- ; ((= eltype "BYBLOCK") (setq lt-idx (getindex "BYBLOCK" ltnmlst)))
! I9 J$ j, o+ H$ h& j1 t+ m - (T (setq lt-idx (getindex eltype ltnmlst)))' @1 T) w7 V; n
- )
9 \# ^. i9 G: x6 P" l/ g0 p& ` - (if (= elayer "Varies")3 m* s* ^% `8 s- o# Z
- (setq lay-idx nil)
: G( b; A3 C; a" ? - (setq lay-idx (getindex elayer laynmlst))
1 g7 L3 ~9 u( Y. g% J - )* [ e+ W4 S1 w7 W$ f
- (if (= ethickness "Varies")
' g# d, L' {$ h7 d- e - (setq ethickness nil)
, r: R- Q9 G2 N6 }9 _ - ): ?9 c$ f( o, O- t
2 F3 {* s( t3 ?: r6 t x3 [- ) ; end (ddchprop_init)
, o, A% E- n7 W5 v$ l
7 j& Z/ H! z( b9 m- ;;; (ddchprop_select)
! Z$ s, k! d6 l# k5 ] - ;;;
5 K7 w4 a9 H( P; Q0 j3 l. p - ;;; Aquires selection set for DDCHPROP, in one of three ways:
4 Q: f5 R; z% m7 i - ;;;" j* c5 Q" d' I& c8 T' \3 e
- ;;; 1 - Autoselected.
5 k. I; J1 ^7 L8 [( ]5 } - ;;; 2 - Prompted for.
; g8 ]7 R ] j* P - ;;; 3 - Passed as an argument in a call to (ddchprop <ss> )5 k; L4 S1 _) A
- ;;;
1 s5 a. q8 g) C% U0 L - ;;; The (ddchprop_select) function also sets the value of the
' f3 y: F. g; N. i - ;;; global symbol AI_SELTYPE to one of the above three values to, y* j5 c: g# [6 t5 p% g) R
- ;;; indicate the method thru which the entity was aquired.& H6 `! d* y5 @, |8 a: d. B
- ^$ }& I0 t% ]! R: b3 ^2 W
8 N P5 U$ M+ a2 S( F' ?- (defun ddchprop_select ()# ?5 H2 |' I# T9 _8 {
- (cond( D( j+ ^. D- v$ Y5 X
- ( (and ss (eq (type ss) 'pickset)) ; selection set passed to( z* y. C% r" r% o3 s; E2 e
- (cond ; (ddchprop) as argument0 y- X. T; g3 l+ Y1 x# ^
- ( (not (zerop (sslength ss))) ; If not empty, then
: Y0 Y. X- f' u% E' {5 X - (setq ai_seltype 3) ; then return pickset., z3 i9 B. f) S
- (ai_return ss))))
' p2 q) J: _7 a! c - 5 N6 {; a" c3 Y/ p9 P' d
- ( (ai_aselect)) ; Use current selection
: e5 M* J* I* R& K: X - ; set or prompt for objects8 ?% F4 Q1 c) i+ f( n5 C! `5 ^
- " E9 X3 _8 ]3 L
- (t (princ "\nNothing selected.")# v! d# o; f( ]$ v( S$ U) Y$ n# z. q
- (ai_return nil))9 T# W& s- f/ ], k: W
- )
0 r; P4 ^& L/ r6 ^; s% f( d - )
{; m( h( P: @) q! J
9 Q' D7 \+ _2 e7 C. W( @; r- ;;; Define command function.9 F4 i0 j H6 n2 k
- 4 L# I, i7 n# \$ h! z: L9 l
- (defun C:CH ()8 Q' D O6 g: \/ ^* f
- (ddchprop nil)( [/ f, [2 h9 K' a% F
- (princ)
9 A: {: D5 C3 O- _( F2 H+ t4 | - )
! w; H( u" a9 \2 t0 P, P1 i
# B3 u* R! |; |9 ^- * |) @% E5 p X
- ;;; Main program function - callable as a subroutine.
( k# L' ]& w% }' \* J' w - ;;;
/ g( J& |; G4 `- M0 x: i) y - ;;; (ddchprop <pickset> )
2 t; N5 J% G7 d" c- d4 q, P - ;;;
. P- H4 c% ~2 M. j - ;;; <pickset> is the selection set of objects to be changed.
3 N2 K8 F0 {' U5 D( D8 J9 S - ;;;
3 G& z+ {; \ ]$ a A" L1 J# |, ~3 n - ;;; If <pickset> is nil, then the current selection set is u) S* a' v" d t: c% [% m
- ;;; aquired, if one exists. Otherwise, the user is prompted
! b6 \3 p5 O) a' |6 c$ O - ;;; to select the objects to be changed.
9 T8 a2 i; g, G& P - ;;;
- J4 P C, z$ g+ X; e. n5 D - ;;; Before (ddchprop) can be called as a subroutine, it must& W# d/ n) z |9 _
- ;;; be loaded first. It is up to the calling application to
$ R8 @! _ M( d4 w$ _ - ;;; first determine this, and load it if necessary.3 ` Z# ~& u/ L8 J, L' U, R
- , C7 @/ F! f6 R6 O5 S) U
- (defun ddchprop (ss /" m4 A% g9 J1 c
- T" a- w- i9 z. R% p4 p4 Z! Z- add-mdash ecolor ltedit_act s
3 X: {- Z7 [5 `* `* K9 [1 K$ ? - assoclist elayer ltidx selset9 i' ?6 O1 \ g A3 D5 b
- bit-70 elist ltlist set_col_tile* c& }1 H/ }( f
- boxlength eltype ltlist1
" F# N! \* o. h3 z - bylayer-lt en ltlist_act sortlist
" I7 Q1 s9 Q9 } - bylayer_col ethickness ltname
& ?7 g+ [" H; S4 R. B - bylayer_lt fchk ltnmlst sslen4 F- `; W7 c& J! `' P
- call_chp frozth ltvalue templist! x* L" G3 k$ X- K9 ^( V0 Z
- chk-col getcolor ltype temp_color
k! E6 \1 N* q+ v4 }' U - chk-lay getindex m test-ok/ [, ]: f6 u* r, I& p2 ] ~5 Z y
- chk-lt getlayer makelaylists testidx
, o B' f0 V: ~5 d - chk-th getltype makeltlists testlay
$ s3 E, v, Z8 e$ u/ _* J5 Z$ ] - cmd getprops match-col th-value
# u# O: r- L# V H' U2 y* l/ m - cmdecho getthickness match-in thickness
1 Z# H3 ?7 e$ n: W2 F# x- t$ { - cn globals match-lay tile
2 E K6 z6 W) M. O - cnum go match-lt tilemode0 ~3 W- X# a" u! `$ \+ M$ D- z
- col-idx index match-th tile_rect o" V$ t0 S( T1 v# B( S$ o
- colname item match_col vi
& }! U' T: i4 _0 @* s, L6 m - colnum item1 mdashlist vpf8 f# a; @3 X6 b: R7 S7 h* D% [+ G
- color item2 n vpldata# Q/ e% M r1 G- |8 X+ J
- colorname itemlist name vpn2 Z( Q0 W1 ~- i
- col_def lay-idx ncolor x
- ?4 [; o1 q8 b! x" [5 g6 _ - col_tile layedit_act nlayer x1
+ e7 n% x _$ o - ctr layer nltype x2: R/ n& M& ^. v& X8 U8 I
- cvpname layinfo nthickness xdlist
& K& l& J- s" n2 |: X - dash laylist off y
2 k9 j6 S* `* M' H - dashdata laylist_act old-idx y1
; t: Q5 H- _9 G. [. h8 \ - dashlist layname olderr y2
8 P" }) L, D# G* B: w - dashsize laynmlst on undo_init) J; l: M: |* J- B0 Z. r) a! L
- dcl_id layvalue onoff
I7 c0 _( E- R- G* Z - linetype patlist1 P, T0 }* v$ z9 Y- J3 Q
- ddchprop-err list1 pattern$ A. k: P! U: r( G2 O0 m
- longlist proplist
0 \% M1 l B2 A/ K - lt-idx reset-lay2 N, w2 K1 D! |5 c
- drawpattern ltabstr reset-lt
, z2 Z- b6 W) A% n9 f4 R! N - )
$ I2 R6 B9 [% R& o! {- @4 N - 8 C s* `# \" G8 `, c! g- S$ v1 ~
- (setq old_cmd (getvar "cmdecho") ; save current setting of cmdecho
8 I" t H4 g- L7 k. T - old_error *error* ; save current error function
) [4 a, S4 U5 d3 Q - *error* ai_error ; new error function& `3 a& ^* c8 e- o, Q" H- D: H9 |
- )
) r m4 n J6 w: X# o6 S
; {% E7 i1 H1 j# G" S# W, G- (setvar "cmdecho" 0)
% I- _5 Y; O: z- w8 }
0 l5 I% c% z- f( ]- (cond
' X6 T K: _3 d% G0 U% R - ( (not (ai_notrans))) ; Not transparent?
( ?+ k; L C& m0 T, Z8 m - ( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
* p; H$ `$ h- l. `. P6 k" p - ( (not (setq dcl_id (ai_dcl "ddchprop")))) ; is .DCL file loaded?
+ g& U; v0 G& }% m- `4 V3 ? - ( (not (setq ss (ddchprop_select)))) ; objects to modify?
* ~; B8 u$ |( S5 l9 T8 i4 [/ ~; D
8 Q5 x5 O. [. X' \8 I! s& {- (t (ai_undo_push)
0 P: {0 ?% s; s, ~9 H" X7 h; K& f - (ddchprop_init) ; Everything's cool,
2 R& Q: |. s; \* K: j - (call_chp) ; so proceed!0 f9 X6 q! y. f/ H; m
- (ai_undo_pop)8 e8 d$ w# W/ L
- )
& @8 d5 y* N6 P6 c4 A - )- I' S5 K' S. |! \3 t+ p
- % W9 l; q+ G0 k+ {9 f' N
- (setq *error* old_error) ! M' S# ~: T" l: @0 B
- (setvar "cmdecho" old_cmd)
( X, J+ G6 h& N6 u2 X q - (princ)
; k6 ~$ J9 ~6 J& V - ) t# \) k9 i* i( j# o$ N
/ c- N, Z" X x4 }) }- ;;;----------------------------------------------------------------------------- g8 O5 q7 e* q& Q# L0 V4 D7 O
7 h0 D" | a# r, k9 H- (princ " DDCHPROP loaded.")& Y# K0 N, o; v* v1 t
- (princ)
5 V' B& y' ?/ f. h; y% z9 h4 y) v
( {7 W* x# M" H3 w! B4 o$ D- ;;;----------------------------------------------------------------------------2 U; L5 ?2 \8 j1 M7 f
) L& ?& n: j4 a- ;--------------------------------ddmodify.lsp----------------------------------8 j- w# G; Z3 {2 z% b( z9 }
- ; Next available MSG number is 111
1 E7 w% W8 h, | - ; MODULE_ID DDMODIFY_LSP_
, n6 E. N& I5 L. ^$ p) V - ;;;----------------------------------------------------------------------------
$ U; L+ Y0 T/ i9 G - ;;; DDMODIFY.LSP
+ v) j5 h2 ^( f9 X: u( D. V - ;;;3 K, ]' J9 L# U7 }! d* C) h7 a- R
- ;;; Copyright 1997 by Autodesk, Inc.
8 k1 S/ h; P% ]4 H - ;;;
; ?6 G/ g) E) e0 C6 ~% t - ;;; Permission to use, copy, modify, and distribute this software
1 R' t9 U- n% X* n! p, _ - ;;; for any purpose and without fee is hereby granted, provided' C- c: U% ?9 V) l
- ;;; that the above copyright notice appears in all copies and' T. N& I; W& d
- ;;; that both that copyright notice and the limited warranty and
, {5 a% f. Y$ [# C8 y - ;;; restricted rights notice below appear in all supporting( v# i6 Y( ~7 y( T# P
- ;;; documentation.0 L T/ y4 ?7 u8 J3 P) R
- ;;;" ], c6 ?5 b7 C, I( g
- ;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
& I- c9 b5 h4 q1 v0 ]5 J - ;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF# z9 Z# `& S/ _, ]3 {+ b' W: l
- ;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.) z9 k/ {2 Y2 F. A7 B
- ;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE- E! `/ y8 [9 N( r5 V. G$ z
- ;;; UNINTERRUPTED OR ERROR FREE.
1 L; Z6 n: i9 q1 z0 c6 e - ;;;
2 F. G& ^) g" r( X3 s% ?7 K - ;;; Use, duplication, or disclosure by the U.S. Government is subject to6 r5 t9 T( h( D; r
- ;;; restrictions set forth in FAR 52.227-19 (Commercial Computer
3 U$ l! b; [, f9 m7 Z - ;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)6 Q) C! a' _- L) l5 X
- ;;; (Rights in Technical Data and Computer Software), as applicable.+ w, e, M. e# J, x2 ]# M1 F
- ;;;; H3 o7 H$ n5 {6 d
- ;;;.5 Y( c! `9 x3 f: n* ^4 f
- ;;;) Q4 m: p) f# L; ~' Y" c" S4 b2 L
- ;;;----------------------------------------------------------------------------4 i" c2 z3 A( C C3 L
- ;;; DESCRIPTION! X. h h8 m1 u n/ c6 N7 s
- ;;;1 v: ~3 S) z( g2 x `4 P# u' }
- ;;; This function allows the user to get a listing comparable to the LIST! x0 J& \! l; x6 `! k6 e& H
- ;;; command for most objects. In addition, most object fields in the
1 S# n3 K0 Y" s+ A, k - ;;; dialogue box are editable. Points can be specified dynamically by
2 h T- n& h H; ]4 X4 x - ;;; temporarily dismissing the dialogue box. Each object has a unique2 H: l1 o1 @" A5 J" n
- ;;; dialogue.
* y& M5 ^7 E4 e. c# I - ;;;
( V' e8 c3 ]% c% `7 f0 ? - ;;; Naming conventions* U6 f( Z4 c4 ]* M/ X- c& i
- ;;; Long function and widget names may use an underscore "_"
1 H4 o; b) b+ K9 J - ;;; in their names to make them easier to read, long variable
4 `, \5 W# y2 L$ y$ B- _# M( L - ;;; names use a dash "-".3 u0 Q, C2 a' y
- ;;;----------------------------------------------------------------------------
* ~* |' B. k) D1 z- a9 D1 N! E* e - ;;;----------------------------------------------------------------------------
) U8 H: Y. y( c6 U/ [& D - ;;; Prefixes in command and keyword strings:
$ S! k h4 l0 y B) f& H7 o - ;;; "." specifies the built-in AutoCAD command in case it has been
# l5 t" d+ R; G" p: h, n - ;;; redefined.: e/ y, {* t& g; B) C: Z% T
- ;;; "_" denotes an AutoCAD command or keyword in the native language% c: R- o }- r2 {6 }: p- F
- ;;; version, English.+ E7 |! d- X: a- i, T
- ;;;----------------------------------------------------------------------------- m( {' @/ ^5 s
- ;;;
( ]9 s2 d. {! r& q - ;;; Avoid (gc)s on load to improve load time.
$ }0 x" ^) `) l - ;;;
2 O# c7 r$ p( W* S/ V5 h O: C+ n+ y - (defun do_alloc (/ old_allod new_alloc)+ c; q" |1 s, o& W: Q5 I0 d
- (setq old_alloc (alloc 2000) new_alloc (alloc 2000)): I3 l5 N$ O, A7 D% \* f) v
- (expand (1+ (/ 17000 new_alloc)))
- r2 z) C3 g/ N( z8 s7 F) q - (alloc old_alloc)
) ~( F* d2 ?4 T! m - )3 h! @% c, H( q* x6 [4 x9 E% Z
- (do_alloc)
' r* Z- U' ?# {% J6 a2 r - (setq do_alloc nil)
# J1 M! W( x" J7 L Q) A - k. C( y% J$ z6 \
- ;;;& H: K2 w" k# s
- ;;;
' H0 O/ e% k( F8 c* o# _+ U - ;;; ===========================================================================% L1 [0 h% _; o9 n5 f W! M
- ;;; ===================== load-time error checking ============================
5 S5 g" r' j4 m" r. R8 \ - - n% r2 J: B5 f* ~5 D y
- (defun ai_abort (app msg), x" d+ h+ A7 F0 h8 y
- (defun *error* (s)
5 V% A, i: r; Q" z# R - (if old_error (setq *error* old_error))1 o! l6 E& ]' s- ^0 \
- (princ); s5 m& n# v+ a, |. o
- )
. N1 X: t, i+ m# @ - (if msg
6 t" [! P3 U/ l, _' J, e - (alert (strcat " Application error: ". {9 ?* j) b$ @' F) e9 `$ I
- app
9 j& }8 A6 _0 E# @1 ^ - " \n\n "
z0 X3 A: e+ _ - msg: n" x5 m( D e# [1 W
- " \n"
. }( o) `3 L' Y4 z, H: e2 ^0 m - )+ m! U5 K [6 e+ Z
- )4 g1 S* e2 L) T4 I2 W
- )
5 n& D& N2 Y( o& \" ?( A: ~, G - (exit)0 k3 u; n' i" ^# Q2 @, T
- )7 d; |- u* Q: [: `# A" f
: o( X% y Z$ g4 @- ;;; Check to see if AI_UTILS is loaded, If not, try to find it,2 N& J0 ?) N$ o/ U" M
- ;;; and then try to load it. If it can't be found or can't be9 o8 Q, e/ J: R) ]/ T9 T
- ;;; loaded, then abort the loading of this file immediately.
; R, i. I0 b! Y$ U- L* r
) S, w/ N+ O) f* o5 d5 M8 G- (cond9 h2 ^, ~1 j; Y9 ]* r3 N
- ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.* T1 B3 @# {2 u
5 J: v9 F5 D/ K) k0 E5 W- ( (not (findfile "ai_utils.lsp")) ; find it
1 b) R5 U( y& U1 a0 n - (ai_abort "DDMODIFY"; f! Y* ]+ E- J+ H+ Z Y* | k
- (strcat "Can't locate file AI_UTILS.LSP."4 p3 n$ T4 X) j" m/ X. ^$ A
- "\n Check support directory.")))
) _$ ?+ v$ B2 j; z) e: M4 x# G6 ~; g- X+ {
8 D& [! D) C3 I' d; d+ E. H. H- ( (eq "failed" (load "ai_utils" "failed")) ; load it
9 g: x' f2 O4 U' N - (ai_abort "DDMODIFY" "Can't load file AI_UTILS.LSP")). r" {7 k' x2 O# o! X$ G
- )
t1 d' J, S9 J - 1 s2 l" o$ T1 [( n! y
- ;;; If we get this far, then AI_UTILS.LSP is loaded and it can
. I1 |$ p5 [4 w, o. a - ;;; be assumed that all functions defined therein are available.
& x+ K3 I/ ?7 o - ! T7 D& g$ c: s9 W o! y
- ;;; Next, check to see if ACADAPP.EXP has been xloaded, and abort( L/ y2 k" I5 F' V* r2 v( R, u5 q
- ;;; if the file can't be found or xloaded. Note that AI_ACADAPP
' B8 Q; V6 y& O! B - ;;; does not abort the running application itself (so that it can
7 Y& o0 g' E6 k: u. K% j - ;;; also be called from within the command without also stopping7 [, ^1 `# A- b$ s$ p ?; V2 h
- ;;; an AutoCAD command currently in progress).; g x" R* z, n1 m
/ _) U6 K6 O( {: c7 J- (if (not (ai_acadapp)) ; defined in AI_UTILS.LSP
% g$ q9 }6 U* E5 E+ A# n) u$ [+ z - (ai_abort "DDMODIFY" nil) ; a Nil <msg> supresses
$ j3 Z( S1 G: Y, W - ) ; ai_abort's alert box dialog.
* J* V) @9 d& R2 V* {
. A5 R) u% N% R- ;;; ==================== end load-time operations ===========================
( |. o( W' C) V6 ?/ P - ( k- i" B; b3 ]! T
- ;;; global variables
% u# z# b$ V' k" p; Z, |' s
) M, V( c" X0 i7 x0 S6 L7 \- (setq hatch-elist nil)
% T2 t. j3 b% B9 K: _6 D - $ X A- o* E: B
- ;;; If we get this far, both ai_utils.lsp and acadapp.exp are2 E5 q# M* P4 N
- ;;; assumed to be available.
5 l6 j' W7 U4 E v - u# R0 U. _2 O3 x3 ?/ B
- ;;; Define and encapsulate all subroutines that are declared
W# V" J6 h% D - ;;; locals of the (ddmodify) function.
, I; A& @& S7 G; P) I: R* E, h% Y - & _1 M* [0 i" T; [- z- v) J
- (defun ddmodify_init ()- T3 |* E6 ?7 G, t* A; ]
- ;;$ c; D4 p4 P9 m% u4 f
- ;; These three functions modify the enitity list for common properties. Since* h: a& _, Y) T
- ;; color, ltype, and thickness are absent from the object list when they are5 M, o0 `# [ Y8 w+ D9 i: e
- ;; set to their defaults (i.e. color = bylayer), a simple substitution using$ a4 F9 r$ G6 B( N9 F o. S9 m; a
- ;; SUBST is not possible.
2 \* t6 Y# h/ b2 v" _ - ;;! O o0 I! k) }6 B6 v7 T
- (defun modify_properties ()
4 v3 \4 k% T, A, c - (emod ecolor 62)
; U: j2 g+ R1 @4 [6 K( f2 T& ~0 T* n - (emod eltype 6)
" w3 {/ E8 M; q6 M3 K- m. T+ W - (emod ethickness 39)
% o' l# d6 I( O3 F: e$ F - (emod eltscale 48)' }+ f. k: f+ e1 H1 N
- (tempmod elayer 8 nil) n1 [$ m) N0 [# g
- )# @! J, o. }# H' o6 q( g O
- ;;
9 G3 j" K5 S# C; x - ;; This function is used for modifying common properties of the ACIS0 B$ a" n# @$ i3 [' K* Z
- ;; based geometry objects. Thickness is not valid for these objects
& G' a6 r6 F. F0 D- M) X - ;; so it is left out.; y1 S7 j4 A( B7 p6 J& ~1 U: f3 p- }
- ;; F6 u) c: h: }' G# L0 \% j
- (defun modify_prop_geom ()
+ W; t+ c8 a. m - (emod ecolor 62)
: }! S! `: F" h) { - (emod eltype 6)) r; a: I/ H# Z" I/ a
- (emod eltscale 48)
3 O5 g4 s* {4 M" T& ^ - (tempmod elayer 8 nil)
! k1 f. w, P5 L - )" j4 o9 g4 P7 ? o' V6 C" B
- 3 S; _4 [, `# A T
- (defun emod (value bit). j) E2 R* }7 M' m9 k2 J4 Z8 J
- (if (= bit 62)
' G# O! v9 X5 c3 h1 V7 h+ o - (progn; |' I9 Z4 ]# H- S
- (if (or (= value "BYLAYER") ?9 D5 R W' p5 }# P( ]
- (= value "BYLAYER")) (setq value 256))
- g; m% l' }# I& B$ G6 e; @- m - (if (or (= value "BYBLOCK")" Y7 y6 j. X! ]! T
- (= value "BYBLOCK")) (setq value 0))
~. a W) v8 }0 C6 F- F1 K - )
6 r# Q, C, k: R- W - )! g% B6 n* V6 v5 S
- (if (setq oldlist (cdr (assoc bit elist)))
4 Z2 G" N& L. Q+ w$ T& `2 W - (tempmod value bit nil)* q9 ?- u: o9 X/ J% a
- (setq elist (append elist (list (cons bit value))))# [/ ?- [8 ^% {" _1 Q$ q/ [
- )
$ h( N$ b; X8 X4 X8 m - )0 J0 K6 e# P: D/ ]3 h
- ;;: ?- b8 \" Y5 D4 [' ^5 T- @
- ;; Resets object list to original values. Called when the dialogue or( h9 l; B6 k- J2 v! i0 A
- ;; function is cancelled.
; L$ x6 U& ]- d7 s1 p; C+ v - ;;
+ o$ q' _ W$ z8 { - (defun reset ()
3 b' j( I5 N- J. @8 t - (setq elist old-elist
+ g5 Y7 e8 H/ {7 N# l - ecolor (cdr (assoc 62 old-elist))
' v0 c1 u8 n$ ]3 h3 ]6 T7 E b - ethickness (cdr (assoc 39 old-elist))
! g9 }, u$ f, i' g* E. G! c1 l - eltype (cdr (assoc 6 old-elist))% a# `# b2 X9 m& X
- elayer (cdr (assoc 8 old-elist))0 b+ u4 Z. F0 E0 l5 O$ k
- eltscale (cdr (assoc 48 old-elist))7 V: q0 x) c' e1 _0 \, _
- )
$ E3 ^7 S4 L# l& S - (if (not ecolor) (setq ecolor "BYLAYER"))
3 u, T) v+ B4 B* t0 e X9 k! c - (if (not eltype) (setq eltype "BYLAYER"))! z3 {! y( m, U4 r" n2 J- d
- (if (not ethickness) (setq ethickness 0))( l2 x0 d- w* x+ v5 K( e2 ` R O
- (if (not eltscale) (setq eltscale 1)) ?3 M9 n; U1 d, Z. Z8 b
- (modify_properties), ?) J0 V) B6 W
- (setq reset_flag t)
+ B& U' }, O6 H - (entmod elist)4 U" @5 x# n* N) u
- )" E" C$ f ?6 D/ ^
- ;;/ V9 i* K9 ~7 `* s: |2 f
- ;; Modify object when dialogue is temporarily dismissed to reflect latest- m% Z1 t; R8 b
- ;; settings of dialogue. It converts the point from current UCS coordinates to& l9 j& k/ ]! q) }& B" I
- ;; the proper object coordinates (world or object).
" f2 Z4 G$ Y" N' W - ;;
, Y" F* D; E L, o" h7 @: U - ;; Arguments: value - in current UCS coordinates$ ^5 n9 m- {, M2 d% N4 |% F
- ;; bit - object code (i.e. 10 for start point)+ ]- [" M7 P% `% l2 V# f) B
- ;; ptype - point type 0=world 1=planar3 l5 Q5 t& M% f# w! u: F9 \
- ;;
7 A, |3 F% A' N! g4 X9 M - (defun tempmod (value bit ptype / newpoint)
6 q2 k9 z& ]! S& s3 \; U% G8 E - (cond/ c7 P. f9 s; R+ M/ g! D: p/ ~
- ((= ptype 1) (setq value (trans value 1 ename)))
" B) T: O }" `, J' [# r7 f. ?8 h - ((= ptype 0) (setq value (trans value 1 0)))* N: Z! l6 h# `
- )% F3 J5 z# e6 s5 }
- (setq elist (subst (cons bit value)5 J2 n; `3 w$ l* C6 T
- (assoc bit elist)/ T1 `% n! o( z/ g9 c
- elist% @- M) t) Y8 M' R$ r: m
- )" o7 T$ P" m2 I5 X7 P! ~! V6 I
- )( i( n- N. w* u% r$ t
- )! r0 N( u, C( m
- ;;9 c$ S+ ^: B1 c6 M# D7 Q
- ;; The following functions are called after a dialogue has been temporarily
' j- W% o7 l8 e( z* b# Q2 v9 F - ;; dismissed and the user is selecting a point. If a point is selected the
8 u8 s6 y. o4 @5 s; c% k* R a - ;; object list is modified and new X,Y,Z values set. If no point is selected6 C2 [! y. r# G9 k9 W/ e
- ;; (null response), then the point is reset back to its previous values.- T! W. L( d1 Q3 Q
- ;;
8 a4 r% C& f5 T- W - (defun ver_pt1 (ptype)% W% E* s3 y5 L0 R2 m
- (if pt16 M. |! _1 d. b( A
- (progn
, z3 s6 V6 O O! I# S - (tempmod pt1 10 ptype)4 l- W# E R/ u8 J0 W, {, R) v* W0 E1 V
- (entmod elist)$ P1 Y8 ~3 j$ G1 W0 _) h- D
- )
8 ?2 w# F3 F5 J) g' R# H3 D - (setq pt1 (list x1 y1 z1))
) a/ \: O- i" L- t' y) q) v- W - )
8 {3 H. B: k0 ] w' G - )
; k. r6 q6 d7 n* p& G
) ?+ b5 {$ N! H; k- ; (move_pt1 <ptype> )
) a6 k! a ]# o1 a - ;. n( E+ J! J n$ d2 X" k! e
- ; Called in liew of (ver_pt1) to translate block insertions which
+ _. Y5 V6 p- q6 `) m - ; might have variable attributes attached to them. If the distance5 [& L# A( u$ r8 [/ j7 ]/ A
- ; the block is to be moved is < 1e-6, the move is deferred.
- U T3 V4 ]% c
8 P# ~% R6 x) y. R- (defun move_pt1 (ptype / basept hi)
& G9 a: M. W S7 T3 {- x2 q8 a - (setq basept (trans (cdr (assoc 10 (entget ename))) ename 1))
, ?8 d" w/ z7 w - (cond
& T+ d5 T2 }7 [$ Z: N - ( (not pt1) T4 s( W" Y" g& {. ~
- (setq pt1 (list x1 y1 z1)))
; y1 P. u2 i" m4 S! Z
, t3 E* p& P* r4 G9 Q- ( (> 1e-6 (distance pt1 basept)))/ S1 j% k4 y' j& C, q
6 ^9 u; t2 X" f( K8 V5 B2 f- (t (tempmod pt1 10 ptype)
5 ^' v) |" t% P, X6 {! y - (setq hi (getvar "highlight"))3 Y, c* C% `" k/ g0 F
- (setvar "highlight" 0)5 i' Q5 x" |' N# }9 j" K- w5 U
- (command "._move" ename "" basept pt1)/ C* ?: y" s. w0 z
- (setvar "highlight" hi))2 D3 b7 c/ D2 g
- )
Y( l1 s' y9 k8 b+ h - )
$ o, s( A1 [- x S3 Y9 b; l - 2 Y, O1 p& T4 a3 ^: j
- (defun ver_pt2 (ptype)
3 l8 f' f) x. t" M* j; `! m# M - (if pt2
* b: |0 o# y2 a: A% k, }6 d - (progn
7 r# B$ S1 A) U3 ~* q - (tempmod pt2 11 ptype)
: Y7 h" P) f* k9 G - (entmod elist)
# r! J: o" i) \; N! k. [5 N - )( }" |: d9 w1 g6 v, v9 P) N2 f
- (setq pt2 (list x2 y2 z2))
, U& G- D& c" ?8 F8 U+ [ - )
+ x9 x: e/ l* f* ` - )5 ?2 @0 X3 T$ I4 m c, r8 J- Y8 d
# t9 _; t. e0 P, D1 y! r- (defun ver_pt3 (ptype). A2 z- I( x- T' L y
- (if pt3
# W: j( }* n) [7 X - (progn5 A) S5 p+ k2 f9 T2 n' r
- (tempmod pt3 12 ptype)6 ?, u) [5 b0 B* r
- (entmod elist)" j! L: C$ M1 z4 N) T0 I: R6 P
- )
- j( ?2 {9 K; y - (setq pt3 (list x3 y3 z3))
4 F; J7 d1 T9 U+ W; i# J - )' X, e6 P1 K! B% }+ S
- )) i7 W& B, h# p6 H6 p. X
- # U( }8 c4 Z/ [% M3 }
- (defun ver_pt4 (ptype)0 u8 R5 i, @. _) W; I
- (if pt4
5 f) F; h; @- _) U7 o; a% S& _0 O - (progn' E3 T/ s: U% |0 x
- (tempmod pt4 13 ptype)1 R" U4 o: P4 I- U7 v. G: p
- (entmod elist)1 Z8 `( c& p2 }6 r# G; O9 Y+ O
- )
; \2 h: a2 A; s; `+ u0 P4 C - (setq pt4 (list x4 y4 z4))
$ c3 h4 L6 P C' | - )/ i7 D3 ^1 u0 {$ [7 _) {8 ?3 ^* `
- )
% Z V/ D6 u" P; `. o - ;; Xline/Ray( Z% Z B" ^1 r* F8 y
- (defun ver_xline_pt1()
# n) t) {1 x0 D# ] - (if xline_pt14 m! L6 X% y, K
- (progn; q0 B$ R) _! h& \3 f, j2 D1 R; ?3 z
- ;; convert to WCS.
; R* p2 t) O9 q7 a. K7 ~9 x. u. D1 ^ - (setq value (trans xline_pt1 1 0))5 h: {( A |4 H7 D) \. W
- (setq elist (subst (cons 10 value)/ @) \8 p: }! b; H- X
- (assoc 10 elist)
, I4 ^" n- U8 i$ h# ^9 }# ^. Y - elist
! |, u" T4 i3 m8 N" ?1 z# O; ^0 b - )6 e, s, b" r8 r8 w* b! a. h/ `$ j
- )
2 z. ^) H7 E1 ^1 O0 P( Z! B! T - )$ h R& Q, t$ T. @* P
- (setq xline_pt1 (list xline_x1 xline_y1 xline_z1)); j' t \7 D" J2 L
- )/ M; F' |3 T2 b% E* c+ F
- )1 Q8 O) l& ?' k% y$ w2 K
- ; l7 z x( e3 l; s$ T2 H( i' ^
- (defun ver_xline_pt2(), R e0 B/ ^8 T# k$ a# z. C7 P" L; H
- (if xline_pt2) E9 X9 H3 E4 a6 A
- (progn5 O' A6 |. Y7 Y) ]0 l; \% Z4 z
- ;;
1 U% C; p Z3 t4 h: w! u+ K - ;; Calculate new Direction Vector WCS2 f# ?/ D e0 [, C
- ;; x / (sqrt ( (x**2) + (y**2) + (z**2) ))! O2 p& |- `3 g: T0 S
- (setq temp_dir (trans xline_pt2 1 0))+ U2 j+ q( o$ y# B- p* c) D$ z1 H7 i
- (setq temp_dir_x (car temp_dir))
5 ^$ u: x+ V1 |! B0 y - (setq temp_dir_y (cadr temp_dir))$ n# q$ e$ i3 z& [: O/ B3 v
- (setq temp_dir_z (caddr temp_dir))
( ?! y b+ w9 }% d. [7 A - % q) V/ c* b2 A% b
- (setq temp_xline_pt1 (trans xline_pt1 1 0))$ b8 k& [; k- y( l' v' `
- (setq temp_xline_x1 (car temp_xline_pt1))
& I! I5 }" T. R" D7 e - (setq temp_xline_y1 (cadr temp_xline_pt1))' w2 Q! W6 g/ b" Y
- (setq temp_xline_z1 (caddr temp_xline_pt1))
_. {* t9 c. f: O. w
% g+ Q3 W& g3 q7 }- (setq denom (sqrt (+ (expt (- temp_dir_x temp_xline_x1) 2)
5 T9 p8 [9 g! E: R+ a1 ^ - (expt (- temp_dir_y temp_xline_y1) 2): x- ^+ h& B1 {7 l
- (expt (- temp_dir_z temp_xline_z1) 2)
" y* F2 [9 T8 j% {" z/ f% U - )))
% u) \* s0 Z) F - (setq temp_dir_x (/ (- temp_dir_x temp_xline_x1) denom))
1 o# z. I3 \1 `5 \8 | - (setq temp_dir_y (/ (- temp_dir_y temp_xline_y1) denom))
9 p0 i7 J0 Q% I, | \% F - (setq temp_dir_z (/ (- temp_dir_z temp_xline_z1) denom))$ s7 B$ G d- _. e' j
- (setq elist (subst (cons 11 (list temp_dir_x temp_dir_y temp_dir_z))
, n/ ]* N. i9 l; N- g - (assoc 11 elist)# o8 S. u6 U1 l5 i) L$ T, Q) U# [
- elist+ J$ \1 e& W5 e% N, c
- )
- g# ~3 M( O1 Q- k- q9 [4 r; ^' Y - )$ h& v- z( j) r; P( q( O
- (entmod elist)
% X* a7 }+ i1 ]7 h, l0 o# s - (setq xline_x2 (car xline_pt2))- U- X+ c" G5 B& F3 J
- (setq xline_y2 (cadr xline_pt2))
, p+ B( ]* Z; X8 V* j - (setq xline_z2 (caddr xline_pt2)); \: g$ Z& F# x2 S
% @0 K6 c' n: a \1 {) w* Z( `( ^
# T; r# C8 D5 [, Q" b P6 c- )
8 F w! {4 m! R0 J - (setq xline_pt2 (list xline_x2 xline_y2 xline_z2))
4 K5 e ^8 P& c - ). Z+ N: f# D. M/ d
- )! `1 h$ } {- ~# M' ^. Q7 V- |
- - _* _* X. ^: H6 G
- ;;3 j* k) H. k2 Q' C
- ;; Common properties for all objects
4 \3 w8 u3 v1 [1 b; v - ;;
' p* i% d+ a- [" A" [ - (defun set_tile_props ()
( J D* |" q0 D8 o+ T) t - (set_tile "error" "")
( J' y9 i2 w8 L" `% o+ i - (setcolor)2 ]2 `" ]1 |- W% s. s/ @/ \
- (cond3 N& B* a0 v# [" y* `, E
- ((= eltype "BYLAYER")
: c% ~ \; e! _ - (set_tile "t_ltype" (bylayer_lt)))% b3 f4 x/ p/ w
- ((= eltype "BYBLOCK")
+ P1 G7 }/ U, v/ s2 M w - (set_tile "t_ltype" "BYBLOCK"))
3 l! o- [! u% t' e! e1 |, I - (T (set_tile "t_ltype" eltype))' \2 L5 P! @ q8 C5 f
- )) I, Y% r, {* f! h5 u
- (set_tile "t_layer" elayer)
3 x9 o l5 ]; `# I+ `* @; {( U! v - (set_tile "eb_thickness" (ai_rtos ethickness))
% A9 q" d( U4 \5 e+ U& w - (set_tile "eb_ltscale" (ai_rtos eltscale))
0 f. w9 }' f2 M% P4 A - (setq which_tiles (ai_common_state etype))/ |- g. R% y( D( r# ~2 G
- ;; Disable tiles if need be...
$ ?/ I* W( @1 X2 @
7 s5 G4 q3 y9 e. ~- ;; Layer Button and Text Field
) a# J1 h' _ v( p; y# ^ - (if (/= 1 (logand 1 which_tiles))
! G- W( i$ u( J# B6 F1 B% }7 w! E - (progn( |2 g% u+ b ^9 U$ C
- (mode_tile "t_layer" 1)
# O( Q* _& m4 M1 \" p2 U - (mode_tile "b_name" 1)# T! A6 ^' G8 `& t
- )
6 t/ D+ l# b, ]/ W - )
+ \3 `% [! U% \$ M0 g4 U; W - ;; Color Button and Text Field
6 [. r+ I" t* E! U) H" X - (if (/= 2 (logand 2 which_tiles))
. d8 i4 N$ @: i6 D1 d - (progn; I! o% Y9 I: w$ ] p# T) j
- (mode_tile "t_color" 1)6 X! A$ t @& }# B% U* ]; t
- (mode_tile "b_color" 1)1 U# ?# i$ U8 c# ]1 o, u* k& B5 t3 S
- (mode_tile "show_image" 1)
: {) b: C. e/ B. Z& v/ v3 T- N6 J - )' R# h4 v% {- h+ G, W, w& ^
- )# E/ g/ }% f) m( o( ?: [
- ;; Linetype Button and Text Field
L7 _% N7 ?, B- K9 ^ - (if (/= 4 (logand 4 which_tiles))% z7 L5 c) Y% j) m
- (progn
! `0 }! L# E. S" D0 T7 _ y a - (mode_tile "t_ltype" 1)
1 X1 o! B+ j& U" V& T: Q2 h - (mode_tile "b_line" 1)9 x4 X+ ?9 ^4 L" s) B
- )
( Z" g7 ~. G1 V$ ^ - )
1 g: o G9 j( H) O% a& j - ;; Linetype Scale Edit Field/ ` L* }% S( ~- U: S5 W7 S
- (if (/= 8 (logand 8 which_tiles))
, m3 T& @5 D3 c9 I - (progn( r; y8 c T6 X, _7 g' m) C
- (mode_tile "eb_ltscale" 1)& m8 K- E( b$ V' I' \
- ): M8 Q0 @) l$ x
- )8 d) U: e! a" V
- ;; Thickness Edit Field.
/ x. {. K. |- X( n - (if (/= 16 (logand 16 which_tiles))8 u4 c3 i c5 _& q& k6 L
- (progn
' B7 C! Q' `; l8 u0 x0 B - (mode_tile "eb_thickness" 1)# v4 x, O! p) v: B8 W g& H
- )
3 c3 b) a. y% T% y3 J - )
& b6 N7 M. x. u# @3 \ - )' m/ }' G; e9 y- f- T$ t
- ;;6 Z7 X# I9 J* f1 N
- ;; XYZ Point values for all enitites
' p* m' k1 z* H2 {9 y: `- G - ;;
" C4 F' i4 e- A% i - (defun set_tile_pt1 (ptype)9 J: C1 n2 }+ x, O
- (if (= ptype 0)
4 N$ Q8 Q9 U$ [0 c% Y( ? - (setq pt1 (trans (cdr (assoc 10 elist)) 0 1))
( H1 z& X' m& S) o4 h8 Q - (setq pt1 (trans (cdr (assoc 10 elist)) ename 1)). X: _3 a7 O5 ^, }) L
- )- A' b. N# @6 C0 N
- (set_tile "x1_pt" (ai_rtos (setq x1 (car pt1))))
; S6 S4 S' v5 b. v( J& c/ @ - (set_tile "y1_pt" (ai_rtos (setq y1 (cadr pt1))))" y* G' s0 O/ h4 o! N: D. B
- (set_tile "z1_pt" (ai_rtos (setq z1 (caddr pt1))))
0 S& B+ H) u' D: n x) K- t. F2 o - )
, R4 K2 T+ P3 S$ q- B - (defun set_tile_pt2 (ptype)
+ G; ~, X3 n; v6 @4 P. X+ h! b - (if (= ptype 0)
" x3 D' J' z: |0 y6 S - (setq pt2 (trans (cdr (assoc 11 elist)) 0 1))
1 g: q0 [. t0 o; S. k9 K - (setq pt2 (trans (cdr (assoc 11 elist)) ename 1))
6 e8 r4 w' P5 ?9 a) g7 K+ i - )
5 f, u# B+ S" S% l6 N - (set_tile "x2_pt" (ai_rtos (setq x2 (car pt2)))); a0 L7 y6 ]% u' d3 I7 h: M1 ] _
- (set_tile "y2_pt" (ai_rtos (setq y2 (cadr pt2)))): @# m( d4 G& t9 ?7 W
- (set_tile "z2_pt" (ai_rtos (setq z2 (caddr pt2))))
) `* Z: u6 @8 }! }& D1 L1 }" ? - )! }% s2 X# a5 r& Z4 j$ ?
- (defun set_tile_pt3 (ptype)
, M5 t) t3 ~6 R* R' s - (if (= ptype 0)
; |4 U' ~1 |* ^" q8 b1 _ - (setq pt3 (trans (cdr (assoc 12 elist)) 0 1)): j1 C2 B. N/ {9 Q ^" p
- (setq pt3 (trans (cdr (assoc 12 elist)) ename 1))
; T8 W8 T' v" d: q - )
! _- O& U1 n% I7 u: u2 R- n O - (set_tile "x3_pt" (ai_rtos (setq x3 (car pt3))))8 l' G0 K7 y! l0 t4 `& r& Z
- (set_tile "y3_pt" (ai_rtos (setq y3 (cadr pt3))))
5 X, S& k' C+ n% W$ I& q - (set_tile "z3_pt" (ai_rtos (setq z3 (caddr pt3)))): U! H' m7 b; y; i: |
- )
- p: E; G9 Z( Q4 w! Q: P9 Y - (defun set_tile_pt4 (ptype)8 B9 L" k$ o" f
- (if (= ptype 0)
& s6 Q* f+ D* _% `3 N* D - (setq pt4 (trans (cdr (assoc 13 elist)) 0 1))! h2 {1 C$ {5 T$ f- Q5 `* u
- (setq pt4 (trans (cdr (assoc 13 elist)) ename 1))- M& ?! j+ {4 I6 g
- )( d# {9 b1 D/ ^ V& [# Z& T; p
- (set_tile "x4_pt" (ai_rtos (setq x4 (car pt4))))
" s: i# [- H8 N% I% A - (set_tile "y4_pt" (ai_rtos (setq y4 (cadr pt4))))
# e" _8 `' N; p0 m - (set_tile "z4_pt" (ai_rtos (setq z4 (caddr pt4))))# A1 t' v E, T' {
- )
5 |5 F' y/ f J4 u z - ;;
8 O9 Y/ |9 e2 I) n, x$ P6 M - ;; Xline/Ray. P+ }) [; |: n( M4 B) i0 }6 _
- ;;5 J' F% Q2 b+ d6 Y
- (defun set_tile_xline_pt1 ()
& ~. K( [0 Y0 @- h+ }
/ o1 `$ u1 E; i* Q: |- (setq xline_pt1 (trans (cdr (assoc 10 elist)) 0 1))
# a! M+ \7 D8 H9 q+ r- L
9 \4 R/ {9 N" S3 V- P; Q& t! C- (set_tile "xline_x1" (ai_rtos (setq xline_x1 (car xline_pt1))))% d4 S, O0 w% b6 r3 D
- (set_tile "xline_y1" (ai_rtos (setq xline_y1 (cadr xline_pt1))))
- Q! j- B' G; \) K7 g1 [ Z/ l - (set_tile "xline_z1" (ai_rtos (setq xline_z1 (caddr xline_pt1))))5 O" z, u. o0 Y" M" R
- )
4 d, R0 N* u; r3 w$ C - (defun set_tile_dirv ()# G( c+ m8 y6 R' B
- ;; Convert 11 group to local UCS (displacement)3 B) d% d0 G5 \7 r' `4 O4 T
- (setq dir_pt (trans (cdr (assoc 11 elist)) 0 1 1))% W* C% z# U& f0 u
: K& N0 x$ Z9 ^$ [- (set_tile "dir_x" (rtos (setq dir_ptx (car dir_pt))))
1 x2 u% o$ H3 k: r - (set_tile "dir_y" (rtos (setq dir_pty (cadr dir_pt))))8 e b1 c: q3 b Z
- (set_tile "dir_z" (rtos (setq dir_ptz (caddr dir_pt))))6 q9 s: L# k- F- s% ^6 H
- )
& O2 J8 k- V8 { \# ~ - (defun set_tile_xline_pt2 ()
6 ?3 P- h& _' A - (if (not xline_pt2) k6 V9 ?! C+ S: H3 d$ y" t% T7 X
- ;; Initial second point is Root Point + Direction Vector& M2 I2 M+ h9 K( A
- (setq xline_pt2 (mapcar '+ xline_pt1 dir_pt))3 \1 D8 e: z% d. J8 x) ]% W: w
- )' f! n% F! }1 A$ z
- (set_tile "xline_x2" (ai_rtos (setq xline_x2 (car xline_pt2))))6 E- { j% H( M+ Q) k& R7 k
- (set_tile "xline_y2" (ai_rtos (setq xline_y2 (cadr xline_pt2))))* G) P! c7 ^2 s' t+ d
- (set_tile "xline_z2" (ai_rtos (setq xline_z2 (caddr xline_pt2))))( l2 x/ m$ r0 I8 q6 g7 m
- )
( A/ z& V) n# I
* x8 Y- v: s0 b& B* ~* z) \ ^- ;;% k2 O* L3 O; s3 q" B! J
- ;; Handle for all objects# F4 _0 H* k! \2 \& _
- ;;" K( K9 C0 c% U7 W( m
- (defun set_tile_handle ()
4 U* c4 v( p4 |/ g - (if (setq hand (cdr (assoc 5 elist)))
: Y# K- V! o1 {5 ^4 q2 s - (set_tile "Handle" hand)( V1 k! k& b( H; q
- (set_tile "Handle" "None")
8 h* j0 l" r0 k - )
- S# K" U `. P( q q: u) T - )
. F' P& A9 g5 E+ i0 @) x - ;;) E) v e& V5 I
- ;; Radius for ARC and CIRCLE2 e; m3 Y# C; g/ u( m# ?2 |
- ;;
; b1 q! N I- f: `6 a' v - (defun set_tile_rad ()6 B! j9 Y+ m- J: T: X _0 F
- (setq radius (cdr (assoc 40 elist)))
$ y/ J8 W2 j0 h, O+ O1 v F" I - (set_tile "radius" (ai_rtos radius))' n+ @, ^. S1 `3 N9 z( B0 F O
- )9 }$ u( w# C8 l- A' ]
- ;;
, [# ^! b$ C& D% i; q+ G' k - ;; Start angle for ARC
6 o5 ]: f7 M. G1 ?9 r" P# X- J2 t - ;;0 y/ p4 v5 |' G+ L
- (defun set_tile_stang ()
! M/ C6 w( n( Y4 C2 }& p8 d/ d - (setq st_ang (cdr (assoc 50 elist)))0 T' w& g' y( U }) Z, h) t
- (set_tile "st_ang" (ai_angtos st_ang))
; d5 S6 O1 [: \5 N - )* d3 p. f+ A9 Y# i, G( L0 U7 n
- ;;" f5 c# f% U' i# e9 @- d
- ;; End angle for ARC6 e+ P! Q9 X) u" [9 d) r% [- E
- ;;7 M' G# Z1 @. r9 V1 C) J, n
- (defun set_tile_endang ()! l6 g/ Q8 g& k& R
- (setq end_ang (cdr (assoc 51 elist)))
* s, f' E, j# |+ y+ @ - (set_tile "end_ang" (ai_angtos end_ang)); _, \8 q' \4 t' `8 |7 W. L2 q0 S0 j
- )
, V* w" `; H( q - ;;
+ C# P9 Z6 O, s5 p! N' n* L - ;; Rotation Angle - Text, Attributes, Block insertions and Shapes+ l& d' ~6 A/ \5 O& E
- ;;5 }8 T; I+ Y- ~. _3 ]
- (defun set_tile_rot ()) f$ R7 @( T2 U
- (setq rot (cdr (assoc 50 elist)))
3 k! w2 s3 ~. I) H8 S - (set_tile "rot" (ai_angtos rot)); Z0 v. ]3 }( \' y
- )
* A3 y# D1 [8 v5 |' l) n# @1 |( K- b$ C - ;;
+ u+ { [& _' X; L4 D/ f% T" } - ;; Height - Text, Attributes and Shapes# |& I9 B9 J# T& _
- ;;, ~* u" ]( V$ `( u$ ~
- (defun set_tile_hght (), {( k" |% L( c) {, u( f F
- (setq hght (cdr (assoc 40 elist)))
! |7 k2 C. x3 e - (set_tile "hght" (ai_rtos hght))4 r. ~! v* q) d# c( f5 j5 _
- )0 i6 y/ v$ K/ k7 {- ^5 P0 S
- ;;3 O! z. l0 L* v/ E1 Q$ p
- ;; Width Factor - Text, Attributes and Shapes
% I" N$ R8 v: F G - ;;- M [- _8 p; I3 Y* r7 M4 J
- (defun set_tile_wid ()
7 R- { {* e1 V% w/ o5 ` - (setq wid (cdr (assoc 41 elist)))
7 J) |' y2 a# ]9 P6 [. |7 W; ] u9 u7 e- \ - (set_tile "wid" (ai_rtos wid))" f- L' R0 {8 s* y. x/ M4 b4 o
- )
9 E$ i [% b9 m i" U5 F - ;;
. `! a, u1 h4 e/ u |/ _* i( y - ;; Obliquing Angle - Text, Attributes and Shapes
5 f/ B- L# L7 g: }/ k - ;;
& {; X, y+ v6 ] - (defun set_tile_obl ()3 M4 r* J) O& A$ v( z
- (setq obl (cdr (assoc 51 elist)))
7 x& @. y/ {- Z3 y! B5 V - (set_tile "obl" (ai_angtos obl))
+ S% x$ V0 P( ~$ } - )
8 u. l3 s4 ]( a - ;;( `8 o/ Y' C! _3 \. I
- ;; Text string) M1 y" R F. ~
- ;;
3 @$ f3 A ?* I - (defun set_tile_text ()
" x8 o: M2 ? Z+ l, ? - (setq text (cdr (assoc 1 elist)))
: t5 c# z4 d" @) u - (set_tile "t_string" text)2 ~7 q) k3 \1 x! {" H2 r* f
- ), s4 `$ H& O" q) \% c/ j, G
- ;;
" T4 \3 J4 t$ X1 h+ X+ Z4 B; p - ;; Attribute Tag
( {! z1 t* n7 u3 Q. B3 v/ ~" Z - ;;
6 t2 n; \0 i: [% W5 a) l/ B$ y - (defun set_tile_tag ()
' {0 Z$ H5 {0 R0 D& B: O! R+ w5 ? - (if (= etype "ATTDEF"), N! e6 f- `& n* [
- (progn# A6 M* r0 P* A
- (setq attag (cdr (assoc 2 elist)))
3 _4 }- f ^( u" m+ O. H* u. e$ H1 M - (set_tile "tag" attag)
7 \ ^! @" N5 v# Y$ B. ^6 c1 T - )2 h- D- b1 P$ d* u8 b. Q
- )& i3 W0 O7 Q( g( L
- )( H. N" H( S+ R/ p* T0 Y4 I
- ;;
7 E* J% g, S% X8 r% G, n0 Q - ;; Attribute Definition/ b. u! i4 m1 o! ]# R& Y; w
- ;;
' l. v0 M% p w/ ]0 V3 H. i - (defun set_tile_prompt ()
9 H* x& w7 C3 j$ g& |+ o - (if (= etype "ATTDEF")
) `4 O2 O# v9 q) m& A# I& \/ q - (progn
$ H5 w W3 ?8 T& e - (setq atprompt (cdr (assoc 3 elist)))
$ e( d/ R( }/ s4 H; ~4 ?+ _ - (set_tile "prompt" atprompt)
9 x( W7 d" N0 C% V7 v - )
% v8 @) ^1 E, g5 d - )
8 `4 V$ p U% `. p( z/ `: J - )" `" s/ l; {& J5 p' [
- ;;
7 v' g: T% g3 ?8 q" v - ;; Justification setting for Attributes and Text. Initializes
0 [! c% x. x8 W - ;; popup list box
4 @) J! s6 T# K - ;;
8 G" o$ a: _% k% K - (defun set_tile_just ()
( p8 {7 m. N! m8 G - (setq ha (cdr (assoc 72 elist))) ; horizontal alignment
% p" ~. t5 R/ p - (setq va (cdr (assoc 73 elist))) ; vertical alignment
9 W8 i$ A5 A) F7 [+ s+ j7 x0 L$ y - (setq ha-prev ha)
+ |+ {2 @, \/ ^8 W- b - (if (= etype "ATTDEF"), k) e+ Z* n+ z# N" i$ X9 k F
- (setq va (cdr (assoc 74 elist))) ; vertical alignment
+ O! j _2 |3 b" ? - )
3 ^1 K: { P5 e - (setq jlist
2 t' j2 M/ K( w - (list "Left" "Center" "Right"" R8 e' X) B O
- "Aligned" "Middle" "Fit"( W! ~! Q3 f' A! g* `$ t+ w! f
- "Top left" "Top center" "Top right"% ^& G2 l3 K% Z( J* N
- "Middle left" "Middle center" "Middle right"
! O1 Y3 z0 S& A - "Bottom left" "Bottom center" "Bottom right"
3 q( c# A' E7 ~/ q" m& S - )
$ L0 h7 I8 }, X* h4 D5 X3 [ - )
w$ e s* k& ` - (start_list "popup_just")
5 u) C5 @' u. c - (mapcar 'add_list jlist)( @8 Q" t& o0 v0 K2 R
- (end_list)% \ y" {/ w& G9 P1 V3 g$ F
- (set_just_idx)
1 I; W X* w9 ]* k" H8 J- ^% D - (set_tile "popup_just" (jlist_act just-idx))
% o! y3 a( r! A7 E- ~! r - )4 T6 U5 q7 d: |# E, v
- ;;
2 ?' G9 A$ e% M! H - ;; Style setting for Attributes and Text. Reads symbol table for popup list
& Q# @6 {2 o$ ]9 h - ;; box.& A/ ~5 j3 l8 ~ h; _4 G7 k- {
- ;;
8 F/ A: s \9 @& \! E" Y6 B) {3 n1 | - (defun set_tile_style (/ sname style-idx tlist)8 D. b" c- x h$ Z M2 B/ j
- (setq tlist (tblnext "STYLE" T): y- M0 ]+ w+ |; F
- slist nil)# [ q# W. i" k! R, d& J
- (while tlist" x/ j- q% m! j7 N6 N7 @2 U* [0 A
- (setq sname (cdr (assoc 2 tlist)))& F! p+ ?' x C8 h7 U8 d3 |# q
- (if (and (/= sname "")
- l9 y7 r8 x$ _& e. f# w - (/= (logand 16 (cdr (assoc 70 tlist))) 16))0 p6 u7 u. C6 H, }$ l
- (setq slist (cons sname slist)))9 N, W J, F/ i C
- (setq tlist (tblnext "STYLE")))
& ?" N3 A# d' c, P6 {4 ? - (if (>= (getvar "maxsort") (length slist))2 S. _- v7 p- q$ q
- (setq slist (acad_strlsort slist)) ; alphabetize style list3 E+ v. M' C2 `: m4 `# F
- (setq slist (reverse slist))) ; or reverse it to put it in DB order
2 M$ ]: c/ v; i1 k$ o) A
3 d/ ^! r6 P/ Y" U6 K M2 _- (start_list "style")
; I" f$ e+ {+ T# }5 o$ @ - (mapcar 'add_list slist)% d3 x$ c* C! n% v- W+ d
- (end_list)0 k9 a5 D! p1 h1 q) W
- (setq tstyle (cdr (assoc 7 elist)))) S& ?8 `( d7 O0 X2 h4 s/ W
- (setq style-idx (getindex tstyle slist))
! a. Z% g6 x" k9 g; U3 K0 r - (set_tile "style" (itoa style-idx)): i x* [) n* y. \; ^! T
- )
2 a% [3 I8 y4 h: m1 `) i! b e# ^ - ;;
6 Y) M" g; y) u$ a - ;; Text and Attribute setting - upside-down, backwards
' t8 l6 G, V4 ?. l L, ? - ;;
" ^: H( w8 T3 N5 n+ F+ Z$ U, Q - (defun set_tile_bk-up ()' m# r0 o2 Q ]" Q% E4 p3 `
- (setq bk-up (cdr (assoc 71 elist)))
9 S. B" g& O3 Z! Y7 Z- [, }6 _; G - (if (= (logand bk-up 2) 2)
6 M9 V: O3 I! p, s( ` - (set_tile "bkwd" (itoa (setq bkwd 1))): T7 s/ l1 H: h! b0 D5 }( }
- (set_tile "bkwd" (itoa (setq bkwd 0)))
8 F6 E( M9 l5 E9 w) ~+ Q( z' N - )4 |( J) N% J8 \! \1 E+ z
- (if (= (logand bk-up 4) 4)0 b! ]. A, |; I
- (set_tile "upsd" (itoa (setq upsd 1)))( H- f; p9 W% \( `9 z
- (set_tile "upsd" (itoa (setq upsd 0)))2 B6 U& v& f% G3 ~& x) s" j$ a+ c2 g
- )
) s4 V) ~ B5 J - ) p v: C+ c, c; \
- ;;$ }2 e% T. e5 x4 I
- ;; Attribute setting - invisible, constant, verify, preset
$ d1 u1 ^3 k. ~/ B9 ]: l+ T' [9 R' @ - ;;' E: |) T7 s5 h/ b" e1 l; g
- (defun set_tile_icvp ()3 `) \7 g2 ]/ f; S9 Q- z4 J: D
- (if (not (setq icvp (cdr (assoc 70 elist))))
: j: _. C' e1 O6 @" r+ Q0 ]. g3 e - (setq icvp 0)
, K% _- |& t- {6 V+ w' w0 e4 H" c& ~ - )! ~: \5 y+ T' u
- (if (= (logand icvp 1) 1)
! D- b7 x9 g( f# ?" `9 S. Q) ^ - (set_tile "inv" (itoa (setq inv 1)))
2 l. [# d; Z3 k - (set_tile "inv" (itoa (setq inv 0)))% |/ D9 g) r& A* o8 ?- ^+ i, u
- )! I* E6 z( k3 W# J
- (if (= (logand icvp 2) 2)' q: o% J% F" S$ T) H" ~2 m
- (set_tile "con" (itoa (setq con 1)))
. Q O2 m: r a K: K - (set_tile "con" (itoa (setq con 0)))7 ~# {9 H# X8 C7 m% Y, o
- ): a: _& q% G+ W4 W3 ^- n8 u
- (if (= (logand icvp 4) 4)
" ], d( r6 a. |- q1 a - (set_tile "ver" (itoa (setq vfy 1)))6 Q3 X# B9 ~, [+ B
- (set_tile "ver" (itoa (setq vfy 0)))
" S. |& i t" o- ?! U - )6 f5 P6 Q* R4 }) X
- (if (= (logand icvp 8) 8)$ p, C' Q4 l; p, P5 y5 I5 E
- (set_tile "pre" (itoa (setq pre 1)))
- C9 h% I' r' I, V! m: U - (set_tile "pre" (itoa (setq pre 0)))# c- W" Q: y. i3 H/ i' M9 f
- )' C6 @+ `1 L# a( c
- )
3 [/ z: e; a/ T/ Y2 s6 L - ;;4 \7 W( `1 B7 s% a _/ V$ f
- ;; Scale factors for block insertions5 m/ y7 F5 H* w3 V
- ;;% G6 [1 }5 k" s1 l
- (defun set_tile_scale (/ temp)0 z& M q4 ~0 [1 c8 s2 H) ?
- (setq temp (getvar "LUNITS")); O a6 B1 [1 L8 r3 q
- (setvar "LUNITS" 2)
# x7 O {5 i0 e9 p - (setq xscale (cdr (assoc 41 elist)))
& B' M# |5 V" v2 h% J( P - (set_tile "xscale" (ai_rtos xscale))
+ j: I4 m. [4 X1 C6 n# {& m6 k - (setq yscale (cdr (assoc 42 elist)))9 z' r2 M. M. Y8 f
- (set_tile "yscale" (ai_rtos yscale))
j/ F2 B8 }: b% G; P3 j% E7 v - (setq zscale (cdr (assoc 43 elist)))$ d2 e. s' C5 w4 a
- (set_tile "zscale" (ai_rtos zscale))0 T- [; B/ ?* O6 x$ z/ A8 s+ r0 O
- (setvar "LUNITS" temp)0 Y; ? O+ d% i
- )
9 J3 B% F8 n& f5 ^ - ;;! R) }7 U* H( {" J) z( @3 j. t
- ;; Rows and columns for block insertions5 E- I" ~3 K" x4 M: _7 B
- ;;
& D3 p' I+ Y" ?& B2 _ - (defun set_tile_rc ()& |2 [& H2 j# o* o. w' f8 D9 `
- (setq columns (cdr (assoc 70 elist)))
8 z a! @( q- o" ]6 F0 E - (set_tile "columns" (itoa columns ))) T/ s6 B8 q$ y0 Q b5 x/ D
- (setq rows (cdr (assoc 71 elist)))5 A9 h( E. B+ C, X# n
- (set_tile "rows" (itoa rows))" ^1 v9 i! {0 t; E
- (setq col-sp (cdr (assoc 44 elist)))4 x+ G! ]9 r! ]5 n8 ]
- (set_tile "col_sp" (ai_rtos col-sp))! F# x' C0 O; X( X+ s& [: M
- (setq row-sp (cdr (assoc 45 elist)))
0 Q& ^" g' T6 g: | n6 y - (set_tile "row_sp" (ai_rtos row-sp))# a- m' N) D) F; @; c5 t
- (if (/= hasclip T)9 n, @' u: x; g5 C- G
- (mode_tile "xcliponoff" 1)
: t/ T% {( s( ~4 l# | - (set_tile "xcliponoff" (itoa xcliponoff))
m; F; J- C& J - )7 Y# n0 Z( J0 Y, D. H% \/ t9 {
- )
' I0 x* h3 S2 u" _+ x! Q- y - ;;0 L1 Y4 r" Y: \; c+ s ^
- ;; Invisible edges for 3DFACE
, _, P3 L0 g( s) y& h$ D/ k - ;;
! b# t9 S$ E. e% S" A - (defun set_tile_edges ()
$ T4 |* f* {" \8 I - (setq f-vis (cdr (assoc 70 elist)))5 y2 A. t' Q" c) u
- (if (= (logand f-vis 1) 1)& I2 D4 i. E* H: k, K
- (set_tile "edge_1" (setq edge1 "0"))8 K. B8 J9 `% z! {
- (set_tile "edge_1" (setq edge1 "1"))& |9 |9 u* m% F
- )
- C' l$ u& Z6 M) O: }9 J0 a - (if (= (logand f-vis 2) 2)
$ G4 M& Q3 ]3 j% n0 t8 \ - (set_tile "edge_2" (setq edge2 "0"))# o r/ i0 ]$ K$ Y% \2 n4 q
- (set_tile "edge_2" (setq edge2 "1"))2 E6 n4 z4 A6 z: o$ r0 `8 X+ s& o
- )5 M! s, {+ ]7 ]6 }# s# k+ v. G
- (if (= (logand f-vis 4) 4)* y7 m; [, a h& s$ y4 E
- (set_tile "edge_3" (setq edge3 "0"))3 J! b" v7 F7 D8 l* q0 p
- (set_tile "edge_3" (setq edge3 "1")). o4 S U7 S# l" n
- )
) |! V8 k/ |: U% \* ^8 i; D - (if (= (logand f-vis 8) 8)) T! ^: c$ d ]/ q, |' ]+ S9 c( P9 f
- (set_tile "edge_4" (setq edge4 "0"))
2 x/ ]# }! {$ I9 v y3 X$ A: X2 p" ? - (set_tile "edge_4" (setq edge4 "1"))
J" J4 B) _# l( t2 k9 H+ A" r7 C n - )
0 {9 L, d5 r+ w+ y& k' W8 U - )' {( g2 [ k4 U5 J' Q X
- ;;
5 o/ ~' k* e) [9 E$ o4 O - ;; XYZ Point values for polyline vertex
( h! x1 K# l8 m7 P, a - ;;
7 D7 {& @2 y* B$ A8 P3 K - (defun set_tile_vpt (ptype)4 |+ [9 E/ B0 v
- (if (= (cdr (assoc 0 vlist)) "LWPOLYLINE"). i$ P1 `+ b$ v- o7 r# Y
- (progn
' Z' b3 r; l& P3 M; p - ;; ctr is 1 based, vertices are zero based.
& z7 o, V4 C) V! f - (setq vpt (cdr (getLwVert (- ctr 1)))); V( C- O: L b2 O. {
- (set_tile "xtext" (rtos (setq x1 (car vpt))))
/ a5 T, ^/ k# c$ ^ - (set_tile "ytext" (rtos (setq y1 (cadr vpt))))
% X4 F+ v" \. n- P9 h+ c5 [ - (set_tile "ztext" (rtos (setq z1 (caddr vpt))))
* Z3 u3 Q1 D6 c- R9 b- C, h - )
$ [% u% T2 A. q# \ - (progn0 t: P+ f' u+ X8 E
- (if (= ptype 0)3 t( k& ^0 w" ]
- (setq vpt (trans (cdr (assoc 10 vlist)) 0 1)), S- {( _& k D% [
- (setq vpt (trans (cdr (assoc 10 vlist)) ename 1)). i: d2 e; x& k" z) U( D2 P J
- )1 S2 l8 ~& m: ~( ~) L4 M0 N- j: u
/ u2 C9 H0 ~7 ^& c- (set_tile "xtext" (rtos (setq x1 (car vpt))))
+ k5 q. b: s! M! W - (set_tile "ytext" (rtos (setq y1 (cadr vpt))))7 P9 z% _! \( B
- (set_tile "ztext" (rtos (setq z1 (caddr vpt))))
/ r; z' b! w* y* e4 W/ B4 D. D - )
9 M' W' t- N4 Y1 T( z" ^. A - )4 v# `/ Y# V# Z' n6 S% ~5 T5 ?0 A; ]
" X: c# F7 x# c) q" h- v- )
7 o8 a2 `9 K) s, p" ?# }9 e - ;; This is the equivalent to doing an entnext on the heavy weight$ N- D8 ?9 [, P7 e
- ;; polylines. The hard coded '4' below allow stepping over the3 U/ W, m) Z/ l5 d% t
- ;; 40 41 and 42 group code information. The while loop finds the
6 b/ h% i. o2 L3 s - ;; first vertex which will be used as the starting assoc in the. D/ F+ ^+ a0 ?1 I4 {+ }3 W* f
- ;; call to nth.
( M* P- m3 L+ c; K' x+ C" l- O! v. c - ;;8 a6 Y2 T! m8 L% o
- (defun getLwVert (tmpctr / count tmp)
1 B! @( ]2 d; i$ M0 ~- N- ~2 ~ - (setq count 0)
0 H/ g# o* E8 d7 j7 j; @ s - (while (/= (car (nth count vlist)) 10)% L& G; x- N- \
- (setq count (+ count 1))
- S$ M' E. B# w0 f - )
# l4 M5 E4 c7 r* m - ;; If the counter reaches the number of vertices,6 X" j5 `0 W" O! L3 U/ V' V5 f' e. Y
- ;; reset ctr and tmpctr to zero again.% V3 D4 \# Y1 W; N9 e7 s
- (if (= tmpctr (cdr (assoc 90 vlist)))
8 W$ q$ b, N P# Q - (progn. P! X/ {6 i0 [* @ n) g
- (setq ctr 0)+ t& y/ z* Y4 A q& F, L P7 \
- (setq tmpctr 0)
T! F& O: c; N$ }: y! b - )
8 ?# x) R1 `$ |' ]+ s - )0 c4 S3 j7 x4 y/ L! w* {
- (setq tmp (nth (+ count (* tmpctr 4)) vlist))
- a* p6 O1 o1 q2 o: U4 }5 ?. U - (setq tmp (append tmp (list(cdr (assoc 38 vlist)))))
+ J+ n+ y( d1 ?1 ?% S - (setq pt1 (trans (cdr tmp) (cdr (assoc -1 vlist)) 1))6 m: |5 Y% d3 a6 h$ E) T6 S& ?
- (setq tmp (cons 10 pt1)), r5 ^! i$ C3 L6 ?
- (setq tmp tmp)
3 \* a( S! A+ ?/ {6 e' I - ): q9 C( p0 o5 x4 D: a3 |
- ;;
: P+ n- X! }9 k E# s3 ^2 g: F - ;; Set tiles for Spline properties. If the spline is rational then we
2 S3 h5 M5 W+ |9 T - ;; need to display the weight values of the control points, so set
0 i4 Q# t4 g6 j$ ]& b - ;; flag to 1.4 p: _, d9 \1 G5 S' U' q8 I" V
- ;; 1 = rational spline
; C! T8 |+ [* j! d7 l7 [& y# t - ;; 0 = non-rational spline3 Z/ @1 M. ?, s {/ Z3 Y
- ;;
+ M" t. ^" }7 F# P* g - (defun set_tile_spline_props ()9 N; z' o. A- a5 v* m
- (setq rational_spl_flag 0) ;; initialize rational spline flag6 H: k0 f0 G: |) C
- (set_tile "Degree" (itoa (cdr (assoc 71 elist)))). c7 { `/ p/ [. m" E- V4 R6 c
- (setq bit70 (cdr (assoc 70 elist)))
. z3 t9 v' B* a5 h# W$ A0 A - (if (= (logand bit70 1) 1)
, T X `% C2 J - (set_tile "SpProp4" "Closed")
% J; x5 c! a$ C - (set_tile "SpProp4" " ")
' X8 d" I C) n" I - )
8 t' _! V, Q9 m. @( u6 N9 ]* B2 L - (if (= (logand bit70 2) 2)
1 }6 Q- a9 N' ~1 O8 Y* i - (set_tile "SpProp3" "Periodic")
6 P) ~" ~! O( m$ L- `- E( W6 O/ u Y5 J - (set_tile "SpProp3" "Non-Periodic")( {% ]! l# x y- o* X" E
- ): T9 E l: K: s$ |
- (if (= (logand bit70 4) 4). t- m- A9 m: V, M7 |
- (progn) h9 w2 A- B+ H. f. o, S3 P" D
- (set_tile "SpProp2" "Rational")3 ^3 k$ a- `6 p/ R! q
- (setq rational_spl_flag 1) ;; this is a rational spline* B* i. M+ K, Y9 X0 J) x
- )
' c! B' d3 {' v" k+ o - (set_tile "SpProp2" "Non-Rational")
1 u1 l! i" Z# x8 I0 Q: E - )
2 U# h$ P3 a( i% {: b; ^ - (if (= (logand bit70 8) 8): A3 H4 _4 X1 z
- (set_tile "SpProp1" "Planar")4 p- Q) @1 u- u' d) m1 ]* {7 j: Y
- (set_tile "SpProp1" "Non-Planar")5 H! h" T+ B7 E' t* [
- )
$ i$ V& L% f e. E) g$ s9 i - (if (= (logand bit70 16) 16)
5 ]* j: z6 a0 L& o' `+ q1 D - (set_tile "SpProp5" "Linear")# @/ p3 n+ k6 T# h0 l8 O7 `
- (set_tile "SpProp5" " "); e% P3 |0 y: ~2 p* ?; G% l2 `
- )
* W$ A7 ^" s+ V, ] - )5 k5 }3 T/ g, u( I8 i: V
- ;;0 ]; L) z4 B1 S9 m
- ;; XYZ Point values for spline points% u1 g; Q( j' Y; D
- ;; Need to account for WCS/UCS: f+ J9 r c& I/ O' \4 F. ?" l0 q
- ;;# R/ q9 T6 V- }1 v! r( g
- (defun set_tile_cntl_pt ()# K0 |9 u5 e* f& S$ Y3 d+ x7 k7 A
- (setq cntl-pt (cdr (assoc 10 elist)))
% R9 o5 T6 B% g& ?: p: W( i - (set_tile "xtext" (rtos (setq x1 (car cntl-pt))))
( P) j9 G4 s3 ?4 a( i- C - (set_tile "ytext" (rtos (setq y1 (cadr cntl-pt))))
# s8 z# N: o4 E+ O$ ~8 D5 l& u) I - (set_tile "ztext" (rtos (setq z1 (caddr cntl-pt))))4 m* _3 ^. _5 V
- (if (= rational_spl_flag 1) ;; if rational spline0 z! J- O+ R( k( g
- (progn ;; show weight
3 ?/ r( A. b, _7 e( q# p9 ]$ m8 | - (setq weight (cdr (assoc 41 elist)))/ Q2 f2 l0 m% s# G, G3 x
- (set_tile "weight" (rtos weight))
3 B& h( ]0 ?9 Q6 j% d - ) ;; else
, \* U% b- t5 I5 i0 `! X) [ - (mode_tile "weight_text" 1) ;; disable weight field
! ?. f, u: V( s! C4 ~# I" S0 h. A - )
4 \) S& g% e% s; G% c - )
: M5 f3 V9 N4 \ |' k - ;;
. U2 V: M+ N& Y9 }7 `% @ - ;; XYZ Point values for spline points
. j; T6 ]6 s, J6 V1 s- A( S7 D+ w - ;; Need to account for WCS/UCS4 _+ j' F2 k) i- l0 w
- ;;
9 O7 r, N+ }2 k, b$ f* ?. ]3 i( j8 c: n - (defun set_tile_data_pt ()
2 I$ Y1 N% H2 D9 e- ^ - (if (not (assoc 11 elist))
6 ~ J4 P# m r) H - (mode_tile "data_pts" 1)
! n% O: n, Q+ o. K9 p0 B* P, Q - (progn
0 d9 Z5 t2 g2 p+ M9 F: c U4 x- { - (setq data-pt (cdr (assoc 11 elist)))- Z, D% N0 Y8 ?
- ;; display points with current precision.
2 n. h/ l5 J! k+ ~5 G - (set_tile "dxtext" (rtos (setq x1 (car data-pt))))! d. p* Y9 T5 J+ {! b
- (set_tile "dytext" (rtos (setq y1 (cadr data-pt))))
. s$ f3 H9 g0 T! m5 X( i2 u0 \ - (set_tile "dztext" (rtos (setq z1 (caddr data-pt))))
) _8 M/ E8 K. [ - )6 m5 N$ @ i* M6 S
- )0 }8 S0 |9 C- V' j0 `$ h
- )2 z* K2 d* J( V4 M3 W
- ;;
& _# H$ x6 P0 P( e# g3 L) Y - ;; Fit curve, fit spline, or smooth spline surface setting8 V$ y+ z; ]9 T/ S2 z' E
- ;;
4 d% J9 K8 }3 Y# ] _) C - (defun set_tile_fitsmooth ()' I" c* N" j. X" x
- (cond: t9 r2 c5 \- `7 j7 `
- ((= (cdr (assoc 0 elist)) "LWPOLYLINE")
! f: S+ { ~1 u$ E/ S1 w - (set_tile "none" "1")
8 S; @0 C! i6 B. p - )! Y2 x: O0 y6 ], u" l4 x
- ((= (logand bit70 4) 4)0 M- D9 f; D1 _/ S2 G' S+ ^8 x
- (cond
& Q" f+ s* G5 t8 X1 C - ((= bit75 0)
g6 d9 `9 n+ s: r - (set_tile "none" "1")
' L* a D; u: K5 C1 z7 S$ U8 T, o - (setq spltype 0)$ @7 n' h2 E8 _; K
- )
. {# ]) x6 T* L x! H - ((= bit75 5)
7 a0 l+ H1 C0 |$ \& V - (set_tile "quad" "1")
# D0 h1 l/ n) ~# Z! Y. T' O2 t" o - (setq spltype 5). y; Y/ B4 A1 z# m% }# B
- )+ w# Y: \. M# [7 V. h7 M
- ((= bit75 6)
6 k b8 p: f# K& \; F# k" G - (set_tile "cubic" "1"). f- q: R( R. V3 N1 O3 }1 G
- (setq spltype 6)
& k' `& n. Y* T, z9 f& c/ B6 i8 { - )
7 W; r$ h4 O6 c - ((= bit75 8)4 W8 @, R& l d( o+ |
- (set_tile "bezier" "1")
: e# x+ N. O: ?5 U8 `$ \ - (setq spltype 8)3 S" a- G" d& o8 h9 S
- )% c) y! @8 g* d3 O+ _& |9 R/ b D
- )3 U; q: v0 Y* l, f+ }. R$ W8 e0 E
- )& j9 y# v# L/ C5 p1 x% d, r& Z2 i: k
- ((= (logand bit70 2) 2)
* H- _, ~- t0 m3 {4 H - (set_tile "fit" "1")/ x5 z+ d$ ^' u! J& n" Q
- (setq spltype 1). l; E) y) O3 V
- )
( w# }5 i2 W6 L - (T (set_tile "none" "1"))
9 q6 \1 V; z P9 m - )
- U! w0 F$ i7 n: h3 n( U" r' _9 T - )
M9 x X* }- {, Q0 [ - ;;" h- I2 s- B/ T# }
- ;; Closed or Open mesh and polyline setting
' p6 q' N% g1 z+ N! x - ;;0 s D2 P0 v$ c2 K; ^; `. n& M$ k" G4 D
- (defun set_tile_closed ()
% W9 D4 n% _* I/ @ B - (if (= pltype "3D mesh")( r3 d5 b$ f5 ^- i
- (progn
! D$ k e6 A( E* P. F2 P - (if (= (logand bit70 32) 32)7 E/ F. l f% f" [( \' ^) S
- (set_tile "closedn" (setq closedn "1"))
# n$ k' J$ Q; e6 _ - (set_tile "closedn" (setq closedn "0"))! S6 W2 {$ T" N4 C( _0 n
- )
: E, S/ l0 k- I D - (if (= (logand bit70 1) 1)
, S1 i$ {0 ?0 p9 y1 }$ z" Q7 l: Z - (set_tile "closedm" (setq closed "1"))1 U1 x4 R9 u) X& \+ p X; l
- (set_tile "closedm" (setq closed "0"))
; N1 W0 O8 j- Z, ~ - )( D# ]+ }8 ~; t& q. f0 ]
- (setq old-closedm closedm old-closedn closedn)
# e8 E* s2 b! k' I - )4 b2 \4 r% J Y8 A0 \; E
- )/ f5 y0 A3 }* x! A" w9 D
- (if (or (= pltype "2D polyline")* A- D3 c/ P9 H1 d# w4 [9 s* ]; t
- (= pltype "3D polyline")
( _$ q6 g4 o* H' O( ?+ u: } [ - )
' L A3 j7 y/ t" m8 e" l - (progn
# S2 f- A, u+ \8 I8 X - (if (= (logand bit70 1) 1)
: q2 ~, g3 a. l% a/ d6 O - (set_tile "closed" (setq closed "1")) ~8 N! P5 [0 n; C- x1 Y! r
- (set_tile "closed" (setq closed "0"))5 F! u6 E( u1 g2 F0 Y& L5 b
- )
/ u8 c, s9 y* y# T7 F. g - (setq old-closed closed)
8 H# |! a8 N2 L) ^6 w - )
3 y+ H1 g" t, `% {* m - )5 t+ g) n1 n- k: s
- )
: L$ w8 g [9 J7 \/ H9 `& N6 ~' H - ;; Set common action tiles# A! E6 @! `( K6 t, W8 X; H) \
- ;;
3 N! a( T+ W+ t! m( N. p - ;; Defines action to be taken when pressing various widgets. It is called1 S2 T7 p- C4 L, {* O
- ;; for every object dialogue. Not all widgets exist for each object dialogue,
7 C. a& Q+ N; d+ e2 o- @ r - ;; but defining an action for a non-existent widget does no harm." k& N. e3 \! k4 T. D
- (defun set_action_tiles ()+ p8 |8 }% ~9 W0 D$ z! B" f! D
- (action_tile "cancel" "(dismiss_dialog 0)")
* n3 y8 f( r8 t: `1 p+ Z' T. h7 E: Z+ r - (action_tile "accept" "(dismiss_dialog 1)")# l: d3 n& ~+ A+ j j1 N
- (action_tile "help" "(help \"\" help_entry)") x1 x, w( `4 r# x* E
- (action_tile "b_color" "(getcolor)")4 E- J" K$ G; _7 g% a/ ~
- (action_tile "show_image" "(getcolor)")" Q( V7 D1 J' Z
- (action_tile "b_name" "(setq elayer (getlayer))")
$ A! U: q) n* p7 C+ C7 D# M; U - (action_tile "b_line" "(setq eltype (getltype))")
8 R7 R+ {# @4 \) z/ ] - (action_tile "eb_thickness" "(getthickness $value)")/ e1 a( V. T. B! y% i
- (action_tile "eb_ltscale" "(getltscale $value)"); ~: `& ~% A* @
- 5 w6 d8 E& i5 W
- (action_tile "pick_1" "(dismiss_dialog 3)")
: K( V) ~+ P0 p/ G$ K/ ?8 M - (action_tile "pick_2" "(dismiss_dialog 4)")4 l# @, |6 B" l$ r
- (action_tile "pick_3" "(dismiss_dialog 5)")
) |( {: x* h \8 F* q - (action_tile "pick_4" "(dismiss_dialog 6)")0 [6 x7 ]" e, Q1 S% `- H1 H% F+ j8 q
- (action_tile "x1_pt" "(ver_x1 $value)")
$ F7 W) d# a2 a! W: W. ? - (action_tile "y1_pt" "(ver_y1 $value)")& q& b* V/ z3 q- I- Y
- (action_tile "z1_pt" "(ver_z1 $value)")/ [/ ?& w) x3 f( b8 g! |
- (action_tile "x2_pt" "(ver_x2 $value)")0 n% R2 M8 X( ]3 y, a9 I' U) i
- (action_tile "y2_pt" "(ver_y2 $value)"); x" e9 P! E5 S" i( R, g9 I% _
- (action_tile "z2_pt" "(ver_z2 $value)")
6 ?6 C6 N8 c/ c" s - (action_tile "x3_pt" "(ver_x3 $value)")) g9 O+ P! P6 E$ Y$ K$ @
- (action_tile "y3_pt" "(ver_y3 $value)"), d4 Y( o! o+ T5 `" P& x8 a
- (action_tile "z3_pt" "(ver_z3 $value)")2 n/ _" _8 ~7 w4 M/ e+ V5 [& M N0 E
- (action_tile "x4_pt" "(ver_x4 $value)")
4 a4 i, n$ F% _' R8 i8 U1 Q" H - (action_tile "y4_pt" "(ver_y4 $value)"): Q% q& ^# m* h$ O$ H5 B
- (action_tile "z4_pt" "(ver_4 $value)")
9 e6 x. h/ ]2 P- c2 H" o, @, j - # M' v9 D4 B0 h) [" O2 A
- ;; Action tiles for Xline & Ray, ~4 ?: u) o; o/ E" j+ I- k! s
- (action_tile "xline_x1" "(ver_xline_x1 $value)")
+ h/ b' W" y6 |8 @( U4 v - (action_tile "xline_y1" "(ver_xline_y1 $value)")
P! f# {9 Y0 D$ f" v3 g - (action_tile "xline_z1" "(ver_xline_z1 $value)")
9 z. A" d+ y; \# y8 Q* A - (action_tile "xline_x2" "(ver_xline_x2 $value)")# ~2 d/ z7 h% z& C, j/ c# W0 |1 y
- (action_tile "xline_y2" "(ver_xline_y2 $value)")
; a3 A0 ~4 x* j8 _/ }. b - (action_tile "xline_z2" "(ver_xline_z2 $value)"): \ H9 Y, e3 H j$ O. t; d+ [
% M# C5 Y- S3 @2 \' P: v' E) `- (action_tile "edge_1" "(setq edge1 $value)")$ @4 T- ]. C( X5 _
- (action_tile "edge_2" "(setq edge2 $value)")
, C J3 e& G* V1 R: D! d - (action_tile "edge_3" "(setq edge3 $value)")
1 |& N( Z& P: u, ?' x5 v! o - (action_tile "edge_4" "(setq edge4 $value)")
# V1 I6 T) H6 [/ u5 |* O
+ E' _* U& c+ L1 _- (action_tile "radius" "(ver_rad $value)"). @* U( [3 _: q7 ~* ?. j
- (action_tile "st_ang" "(ver_ang1 $value)")
3 ?2 ?( O/ M0 k% S5 d# Q; N: c - (action_tile "end_ang" "(ver_ang2 $value)")$ t/ k9 o. `. m$ U m6 M3 k
- (action_tile "end_eang" "(ver_eang $value)"). m! a" d# y/ a6 |5 i/ j' x$ F
- (action_tile "minrad" "(ver_minrad $value)"). J2 f& W* m6 j- E" F8 ]
- (action_tile "majrad" "(ver_majrad $value)")# F# Z' v5 k) \, x; ~4 U, ]
T: ~! p s- L' h8 \* G- (action_tile "xscale" "(ver_xscl $value)")
8 L) H" F: x4 u ]5 z2 m6 T f - (action_tile "yscale" "(ver_yscl $value)")6 J: c5 ]6 [! I2 g. `) R( @1 o
- (action_tile "zscale" "(ver_zscl $value)")& m% v, r) u' _
- (action_tile "rot" "(ver_rot $value)")% _& g$ q. T: p$ w0 p7 G: l Y5 Y5 V" j
- (action_tile "columns" "(ver_col $value)")6 |6 Q! z& K9 F5 d* H
- (action_tile "rows" "(ver_row $value)") u% m7 A8 H3 b. J8 a
- (action_tile "col_sp" "(ver_colsp $value)")
# H+ M6 w8 }8 N& i' ^ - (action_tile "row_sp" "(ver_rowsp $value)")
/ H* x! M9 t/ f1 v/ Q
. ^% [% _4 Z7 p; N7 Z" c. g. \3 m- (action_tile "hght" "(ver_hght $value)")
* b; f& N" L- @9 J' {/ Q8 ? - (action_tile "wid" "(ver_wid $value)")
/ q3 `, r3 J! ?- E4 t - (action_tile "obl" "(ver_obl $value)")+ Z% L' ~. k7 o2 @2 H1 C. {, m% a
- (action_tile "style" "(style_act $value)")
Z4 U" p0 q I, r: i' @, \
& m& B% g7 L& Z b- (action_tile "t_string" "(ddgettext)")4 O v- O8 [& l% j- T
- (action_tile "tag" "(ver_tag)")
" B+ a1 W- A$ ?8 @! \ - (action_tile "prompt" "(ddgetprompt)")2 L4 A. h& H" W( _ m( a
- (action_tile "bkwd" "(setq bkwd (atoi $value))")- C \5 k! ]2 a" {/ E
- (action_tile "upsd" "(setq upsd (atoi $value))")
% [, ]) H( i# c% y$ Y - (action_tile "inv" "(setq inv (atoi $value))")5 z+ @( l+ Z( ]4 l( G
- (action_tile "con" "(setq con (atoi $value))")
" s: d" W# r1 \; p& q- h - (action_tile "ver" "(setq vfy (atoi $value))")( y {" H/ {' k' i& ^2 g- o
- (action_tile "pre" "(setq pre (atoi $value))")
4 B/ e$ v* M0 \$ k - (action_tile "popup_just" "(jlist_act $value)")' a9 i8 W2 y1 R
- ! p+ M+ _# G, i; O& n
- (action_tile "closed" "(setq closed $value)")
2 k& I- F; t/ Z8 s - (action_tile "ltgen" "(setq ltgen $value)")
4 l- ]8 b/ ~, a1 Z; j - (action_tile "closedm" "(setq closedm $value)")* u2 L4 ?9 R" h/ r' o4 ^& B9 Q
- (action_tile "closedn" "(setq closedn $value)")( _- `( }6 A0 R& y% e ~+ d
- (action_tile "next_v" "(next_vertex)")
]( \+ Z3 l" y/ u - (action_tile "xcliponoff" "(setq xcliponoff $value)")# F* p" S# T. T& ^& o; Q" q
: V0 `, W. ~( P" Q; F- (action_tile "next_cntlpt" "(next_cntl_pt)")
* [+ h: c2 J; n. \: p7 o1 i - (action_tile "next_datapt" "(next_data_pt)")
8 M3 T }" \1 c4 v" D( j, g - - N$ {' X& E' Z" C0 a7 s
- (action_tile "none" "(if (radio_gaga \"none\")(set_uv 0))")" t6 U& ~' z4 P
- (action_tile "fit" "(if (radio_gaga \"fit\")(set_uv 1))")& B9 j# `! ~" ?
- (action_tile "quad" "(if (radio_gaga \"quad\")(set_uv 5))")& ~' a; m8 q* ~! h3 \/ f! @
- (action_tile "cubic" "(if (radio_gaga \"cubic\")(set_uv 6))")3 ~; e( _. j& E, H& P
- (action_tile "bezier" "(if (radio_gaga \"bezier\")(set_uv 8))")' V9 S9 q4 b" d! u
* L6 J% t% `7 ^) Q7 b( Y2 s- Q- (action_tile "u" "(ver_u $value)")
8 A$ _" P+ u. z, } - (action_tile "v" "(ver_v $value)")+ z, w, J6 c+ h$ h+ E P
- )
$ U9 S) V6 h0 E/ ~' D A% q2 a, k
! E# j3 C: H$ m% o+ y- (defun ddgettext()
5 ~% M: `7 E& f! f6 W7 S - (setq text (get_tile "t_string"))
A) G2 U) q; Z7 j; M - )* Y: d# \) t" @- |
- 5 H% ?" ]4 }4 k
- (defun ddgetprompt(). H9 d2 p! ^% W8 T. y7 r2 x( h
- (setq atprompt (get_tile "prompt")): ^. f' O( }" q6 r4 j9 p# B. O! ^
- )
2 Z0 j7 P9 v1 c' z" b c
6 F! c9 p) o }# e; d+ t/ f- ;; As OW doesn't support disabling of individual radio buttons within
7 Y; m. }3 b' l3 \2 Z& p - ;; clusters, a check must be performed as to the legitimacy of the
% M2 q, {2 b q7 Y! G - ;; button pushed and reset if necessary.
$ @! _+ ^2 M0 u9 ?$ B3 n1 q0 @ - (defun radio_gaga (pushed)
5 W" n( F9 v, ?) z+ F% Q - (cond
. ?/ z& ~+ `1 L. d" I+ `! Q - ((and (= pltype "3D polyline")
+ s F9 e% x& ?, Y - (or (= pushed "fit")' B$ g. K- e( \6 m( D
- (= pushed "bezier")5 J9 a) l) v4 T
- )( k3 ]: c1 x4 m0 s0 K
- )
5 }/ k$ C/ K7 G2 l; J& H# t - (set_tile "none" "1")
2 f& Z9 s7 X, g% [/ H. p7 U1 q) `; Q - nil
* W4 |/ }1 ` X$ k - )6 y* l4 c. s8 W$ S0 T: x
- ((and (= pltype "3D mesh")1 s3 }* E7 _. \
- (= "fit" pushed): Q- B' g! R( Z$ e' o, o0 `- S, L
- )7 b( @: K- n! v( A6 e' {
- (set_tile "none" "1")3 K1 r( K) c- F6 U# k" c
- nil6 }+ r6 v# a8 W
- )+ y9 x9 U: n/ s p% t: S b
- ((= pltype "Polyface mesh")
! Q/ z: w: Y. Y1 b - (set_tile "none" "1")
( T3 o: {: u0 N$ N9 @( |' H - nil. @: L, x3 K9 z2 v
- )) `! x6 u+ @. _5 n! w
- ((and (= pltype "2D polyline")
6 P: @$ F$ S/ Y1 V W - (= "bezier" pushed), W2 G, c2 s& x! I: D/ F* q6 n
- )- p1 H6 {' x9 i) I+ Y3 J, r, n( c, J
- (set_tile "none" "1")
) y1 O. T( N* c3 P k+ C - nil: x- o( A, Z! Q+ {' I' {7 v$ y
- )1 M t- ^3 p6 b$ R% M; ~" ^' l6 @
- (T)
F# D& g0 h3 D1 J$ O' | - )% D7 X3 b3 T% c1 P% ?
- )5 u- j1 s4 G( a& |' `) j' K
- ;;
6 g! z8 W+ ^: v2 u9 @2 v% e) F; f - (defun set_uv (type_n)
; S+ p* T! r& t4 F, \- o - (setq spltype type_n)
+ ^1 {# u0 v. s! M3 S0 C - (if (= pltype "3D mesh")$ K' h9 ]+ i0 @3 C: ?% S
- (if (= spltype 0)
6 Y2 ?5 s, I3 L: m& B - (progn5 X7 p: ]2 \' |5 A
- (set_tile "u" (itoa (setq u 0))); C* ~$ @$ H, j+ g0 U
- (set_tile "v" (itoa (setq v 0)))
' p; {& }4 X0 D" L I% h - )1 o, X& d: p r& c0 _
- (progn7 W+ L2 d! r3 f& V# N0 S# q* N1 `6 s
- (if (= u 0)1 K) Z2 y* \& [1 D
- (set_tile "u" (itoa (setq u (getvar "surfu"))))& S+ X, \8 u& @( ?& q
- )$ s$ {; k$ d$ C) E
- (if (= v 0)
/ R: S1 K1 O0 r2 t3 K4 S- g - (set_tile "v" (itoa (setq v (getvar "surfv"))))- I- W* e2 L; F2 O4 C
- ); P! g: ]# r) g& `/ v7 H* s
- )/ J( d* \, I( V5 i9 V L
- )
; L, ~4 P/ ?- F) v2 J - )8 W X3 H0 i# l" r
- )
A3 F$ J7 D3 C5 q" `) g9 k( F# H - : [& ~: d/ K% I! D' q2 s* d# O
8 J5 g- n1 W( n+ [# O- ^$ N* M- ;;' s4 ^8 R3 ?0 G/ G/ S
- ;; Verification functions
% [9 O8 d5 y) o, ^* D. Z' S - ;;
$ L( C6 B# ~" s: } | - ;; Verify distance function. This takes a new X, Y, or Z coordinate or
4 q! F8 n% S/ ^. f4 G - ;; distance value, the tile name, and the previous value as arguments.2 f9 X9 H( E$ V! I! \
- ;; If the distance is valid, it returns the distance and resets the tile.3 A% b0 Y. ^( V) f' e+ V8 Z
- ;; Otherwise, it returns the previous value, sets the error tile and keeps8 `; C3 d9 a3 J8 }. i/ v
- ;; focus on the tile. Shifting focus to the tile with invalid value can
" m/ H5 y: h4 J: O8 v - ;; trigger a callback from another tile whose value is valid. In order
, {2 o- r& }( ? - ;; to keep the error message from being cleared by this secondary callback,
: g/ S- q; X3 ] - ;; the variable errchk is set and checked. The last-tile variable is set
0 {8 [) c7 b, s! {2 ] - ;; and checked to ensure the error message is properly cleared when the
% h, S( q+ h3 _: i: s8 v# A - ;; user corrects the value and hits return.* P6 f2 ?2 ~$ b) |1 L0 m4 z5 U; f! E
- ;;/ O- {) A e1 u4 d* J- g6 }
- (defun verify_d (tile value old-value / coord valid errmsg)0 l. h& j i, o4 T0 a* x
- (setq valid nil errmsg "Invalid input value.")
% f" I' L- ?3 x" A _ - (if (setq coord (distof value))% T5 g7 R+ j& l
- (progn
) T2 i- q% q$ P# J8 F+ I4 Y - (cond
1 d/ g- A W0 X1 n - ((or (= tile "radius")
2 T# B6 u, s' A5 V, C$ q - (= tile "hght")
$ `9 l2 w+ H5 P" R - (= tile "wid")
0 b; t0 T' k q6 ~/ E9 U0 D - (= tile "majrad")5 B9 [ q# k1 N1 E8 {5 D* D$ ^5 {
- (= tile "minrad")5 r: J1 S5 A& F! f$ c( C
- (= tile "eb_ltscale"); O; V! w$ n! Z% B, n+ F8 P- B. a
- )% A# @! w6 Z# b( u: x6 i$ |& B. r
- (if (> coord 0)9 K0 l5 l& i0 g' Q
- (setq valid T)
/ D; T X$ Z% g - (setq errmsg "Value must be positive and nonzero.")6 S" U% `" t2 j0 T% \! k
- )" F* ]6 T& [+ ], [1 a
- )
7 p0 ~3 {6 O! C" d& @ - ((or (= tile "xscale")* Q$ i; {9 m4 s: z7 T+ ]
- (= tile "yscale")
- \% Y# h+ U8 z! g1 x - (= tile "zscale")
4 W8 I3 d- j" ] - )
2 F, ^* x7 `. f* X1 [: K) r - (if (/= coord 0)9 B0 ^9 k+ X9 a( w2 @8 H4 }. j7 {
- (setq valid T)
. y9 Z5 q% n7 N7 ] - (setq errmsg "Value must be nonzero.")
* f* D: i) ]% y6 z - )
; B4 s+ ?, I) A - )5 o1 n0 e% L( f9 Y% {" C& r+ W
- (T (setq valid T))! z2 ~( ?% z0 a' ]- V: W% b
- )" u" r: S' [7 _. ]$ e! {& k
- )
: V) j% \2 t( f$ B4 g A+ L5 L - (setq valid nil)
7 a: R/ ?3 E9 {1 O' T; x - )9 Z8 y# O; I% n
- (if valid
! @8 i! L! M% d ]- S! S0 l - (progn8 s% G7 l! _2 I. t, P9 @- k
- (if (or (= errchk 0) (= tile last-tile))! ^$ M3 w! m0 e/ e$ l8 ~6 B
- (set_tile "error" "")9 O* K! b; u J2 B. M9 g2 ?% n% T' w; J
- )0 y, _! [0 v4 _( A
- (set_tile tile (ai_rtos coord))+ m* A( t8 {! R$ O7 J
- (setq errchk 0)) E8 f1 U& c4 ]' \
- (setq last-tile tile) M V7 A8 S# ?' x* N
- coord* }* j1 L4 f4 ?% y( Y
- )/ y- G* @+ K) P0 ~1 M/ c
- (progn" _' ], \& s2 ~3 t; b
- (mode_tile tile 2) ; Move focus to offending field. T, P, R0 f. f) X$ M
- (mode_tile tile 3) ; Select offending text
6 s: D. `# M" e( M- w - (set_tile "error" errmsg)
* t& z+ @3 ~7 N% v+ h# I( X* m$ ] - (setq errchk 1)
! T- I" S% L4 K! D2 o/ X - (setq last-tile tile)
' i/ y+ y2 ?5 k( w s4 b - old-value) Q% K9 z' ?7 f# q* t
- )
+ R. }; m% A0 j - )
# ]% Y1 n1 F+ W& l - )- K) O& J& G( K* X" ]- c& [0 D1 F
- ;; Function for Xline coord edit box checking.% I; Z) ^4 p% E, Y; h K) u2 T) L
- (defun verify_xline (tile value old-value / coord valid errmsg)7 q1 Q, ?7 X, p9 `. f4 l- C3 `1 G
- (setq valid nil errmsg "Invalid input value.")& [! m* h- f8 a( c) [2 z0 x
- (if (setq coord (distof value))
: [2 k$ |' @/ h! E" y2 @2 `4 d - (setq valid T)
/ M5 |) p! U9 n$ S/ | - (setq valid nil)& g; q* } Z" u% l& R
- )
* |$ s! c% e! |+ u9 p% R - (if (and coord1 V( n- Y% D5 w3 C$ e7 P
- (and (= (atof (get_tile "xline_x1")) (atof (get_tile "xline_x2")) )
" I" h3 J( ~: X2 B1 o% R) \* m2 r' ?/ Z - (= (atof (get_tile "xline_y1")) (atof (get_tile "xline_y2")) )" l H8 O) Q! C/ o# n
- (= (atof (get_tile "xline_z1")) (atof (get_tile "xline_z2")) )
. M) @( u: v5 p8 i& T - )+ \ ^6 [1 M- }; r$ N$ J5 u
- )
& H/ I$ q+ u' t2 C - (progn+ E* s5 Y& j' V) \$ E8 p! Y
- (setq errmsg
8 ^2 n' z5 [" d6 I9 c1 P' ?$ O% Q1 r - "The Root point and the Second point cannot be equal.")
6 c1 ^( _" \6 r$ q - (setq valid nil)3 {0 S: ^ h) Z9 P3 O$ x) Y
- )
8 a. X1 [7 Z) Z8 p - )
( ~ [. C. [: d8 {, v s - (if valid
2 g2 a) z* Z7 ` - (progn Q' M$ b$ s v! h
- (if (or (= errchk 0) (= tile last-tile)), c Q: S( g" Y) ?# o2 J
- (set_tile "error" ""); f* i5 J; e# f2 l5 H* w3 t
- )
3 }; l$ p8 F6 {; ] t - (set_tile tile (ai_rtos coord))$ z9 t" s- K/ Z4 Z. P( l7 u g
- (setq errchk 0)% D) U( b( @* R& F
- (setq last-tile tile)
" ^! S- F! K: f- S - coord
/ _" d1 l& x: I, y; p- P4 l - )' \9 O6 n6 h8 ^3 @
- (progn
# m0 b: l, d! a2 ^ - (mode_tile tile 2) ; Move focus to offending field( n* B+ `, g% m: G3 D5 Q4 }
- (mode_tile tile 3) ; Select offending text
% P7 j: ]. ~9 R r9 ] - (set_tile "error" errmsg)) w8 u7 q7 P" E2 m6 c5 Y
- (setq errchk 1)
, G$ ^! U; G5 g2 t5 ]& b9 x - (setq last-tile tile)+ `: `9 y9 T8 P
- old-value4 ?# G' t4 o6 Z9 X. U+ I* V; q# J h
- )+ x& d f8 s% b) ~6 J* b5 c4 w
- )
; D) ^* p0 x/ S1 ~ - )* j% w9 I3 s0 t& h; k* l# L a
; `' M. V+ \( C' Y9 K- ;;
3 m2 c0 t+ i+ V* C2 [ - ;; Verify angle function. This takes an angle and a tile name as arguments.
9 J) m+ O! _8 d7 g - ;; If the angle is valid, it returns the angle and resets the tile.0 b7 |5 |5 I+ ^
- ;; Otherwise, it sets the error tile and keeps focus on the tile.% p) k% E* I0 k( S% z% P( d
- ;;
7 a6 j# r# q( n - (defun verify_a (tile value old-value / ang valid errmsg oblqmax)
4 W9 J# g5 c' K! d - (setq valid nil
/ m% X. a% ~' X7 f) Q5 N - errmsg "Illegal input value."
/ @2 n" D J" S* A) n4 M; G - )# i* U9 S, B) n4 C& C
- (if (setq ang (angtof value))
/ ?6 ]' o! [: O4 N% _ - (cond
7 y4 X; t1 h. e - ((= tile "obl") ; Restrict obliquing angle
& W# X( X# V, v. V# Y7 m) a - (setq oblqmax (+ (* (/ PI 2.0) (/ 85.0 90.0)) 0.000001)): ]' Y8 E% o+ e
- (if (or (<= ang oblqmax)
: d; u8 x% l& y9 v - (>= ang (- (* 2.0 PI) oblqmax))
1 K3 p+ a2 Y5 C% v, x - )
" p" I" c1 X" W" r* Z( Y% Z - (setq valid T), a3 [/ t0 E: L/ w5 l
- (setq errmsg
, Y( N8 Z$ E5 p. ?* S8 N6 z2 c - "Value must be between -85 and +85 degrees.")7 A2 \2 V* x9 `
- )7 P& l% f0 U) u1 h' l: C
- )- Z# @3 x2 _4 [
- (T (setq valid T)) ; Other angles not restricted# o. ~' G3 k* T# Z; K8 {
- )
# d4 g1 h0 O1 Z4 g1 X) I - (setq valid nil) ; Invalid angle input' {. z( T/ u4 v; r
- )
0 u0 B5 r) u+ t& L# j - (if valid
4 I; x1 Q! U2 Z ? - (progn
) d c9 @4 e$ f; C6 s) w - (if (or (= errchk 0) (= tile last-tile))$ k7 v8 x. P; D! _9 {
- (set_tile "error" "")( `/ _2 A V' q$ B
- ): ~3 o& y, G& P6 g2 H8 H$ o, S! M
- (set_tile tile (ai_angtos ang))
. l! q3 g$ y/ W: @ - (setq errchk 0)# ^) R: u* l; W( _
- (setq last-tile tile)
V+ z; [, F9 A* n - ang
% ^2 @- v& g7 k0 d3 j. A' R( n - )
- T$ _1 ? ?; A; W ?0 \ - (progn8 b, \. t; P+ @
- (mode_tile tile 2) ; Move focus to offending field) n! p7 _% m& Q2 g5 k% C5 c
- (mode_tile tile 3) ; Select offending text' e$ M( c+ d& z/ t( S( z- e
- (setq last-tile tile)3 r3 j: X) z6 f9 k
- (setq errchk 1)
6 _* F; p w% y) B - (set_tile "error" errmsg)
5 Z! O$ o4 e3 }* \ - old-value
8 m9 J# g1 |8 b2 i - )* t8 J4 t( J; `9 j3 _ F
- )
, w5 l' E, q9 a, i - )( ]9 R9 S* R" l) h C. R
- ;;: D7 ]$ p! @. X* v. b1 w
- ;; Verify angle function. This takes an angle and a tile name as arguments.8 u+ P- p8 A; c( t" P- c
- ;; If the angle is valid, it returns the angle and resets the tile.
6 ?$ Z! D* {& \% B, {) T) r - ;; Otherwise, it sets the error tile and keeps focus on the tile.
' a; u& y( p- \; m g - ;; This function is specifically for the end angle of the ellipse object. If
% z: t% A& y. y7 v, _2 i' r - ;; the end angle resolves to zero then we want to display it as 360./ M" l% O3 v# G. z% x3 S0 Q9 P
- ;;+ \* }" R2 V: I5 V- J- i) O
- (defun verify_ae (tile value old-value / ang tempend)
1 o4 X4 i3 o2 y5 D$ r [: W0 q4 }, s, K - (if (setq ang (angtof value))! y' P6 L6 t% r4 O. X d) W
- (progn
; H. ~$ T8 h& O# a - (if (or (= errchk 0) (= tile last-tile))5 V$ C5 }2 _, Y) w+ E) Y
- (set_tile "error" "")& A5 v& S% t3 B
- )
& w- a+ I+ c8 I/ h; T& ~/ M - (setq tempend (ai_angtos ang))
8 v# S6 {: E$ @ ^% s - (if (= tempend "0")
1 i* q; v* t, ^3 p; c - (set_tile tile "360")# ?$ L* g4 t1 |# Y; b: [
- (set_tile tile tempend)
. g) ]: D; O! g% h - )
7 p! L2 R7 N* H - (setq errchk 0)5 \; h7 [: E3 L s. b( b
- (setq last-tile tile)
3 F4 m. K$ M; n6 Q1 E- x7 v& { - ang
' ]: i" [8 g1 r# C! s U3 H; t* } - )
' d; @4 ?+ x G# Y7 U - (progn9 F: ]- V8 f( R
- (mode_tile tile 2) ; Move focus to offending field
9 ]6 n' n) j2 s8 B- o# | - (mode_tile tile 3) ; Select offending text
! f p8 P* }4 W3 O* s: q - (setq last-tile tile)
# `- |8 X( `* w2 G/ l8 A/ p( v8 g7 g - (setq errchk 1)
0 v! o% s! d8 s" B - (set_tile "error" "Illegal input value.")
& {3 i& R" y4 G - old-value
& i3 ~/ [+ p2 I4 A1 w - )
4 ~" b( ^9 p( {, _" T - )
- O# M, ^3 y/ B/ M- @! w8 W - )' A8 q3 |- j" N( S( k; m: m: R
- ;;
2 h) B& S5 i. U. ?( X: K - ;; Verify integer function. This takes an integer and a tile name as
4 [! C2 n* n& y* z' B) h6 R+ Q - ;; arguments. If the integer is valid, it returns the integer and resets the
, x* b8 o! w, _3 A2 i. G2 M - ;; tile. Otherwise, it sets the error tile and keeps focus on the tile.7 N( h+ \- t+ L$ ^7 Y4 e
- ;;
. n( s, g4 s0 t8 B6 z1 Z5 R - (defun verify_i (tile value old-value / int valid errmsg)0 _: U1 ?8 v* R$ s5 T6 f
- (setq valid nil)9 L8 f" L4 ^$ X
- (setq errmsg "Value must be an integer.")3 y" r; w* H) a$ v) H
- (setq int (atoi value))* o! Z) P: R5 A3 N3 h- B7 C
- (if (setq intchk (distof value))8 Y) Q9 l) x$ |" _0 \ ?, j
- (cond B8 _! f, A0 Q6 h8 |
- ((or (= tile "columns") (= tile "rows"))
# ? e( L" \7 J - (if (and (= int intchk)' N; b! ?' y* A' X7 V% f1 O
- (>= int 0)3 \" X# S: s" Q! { V
- (<= int 32767)
/ _7 Z* k4 f! w5 {& |& J% E. O - )$ Z" C2 K+ b* Z. z, o* o* P
- (setq valid T)' K+ s% t" I! @/ ?- }
- (setq errmsg "Value must be an integer between 0 and 32767.")
6 r1 d( Q) ~) B( J2 g - )
4 A f0 S8 K! `' ? - )& i9 @" v# K" S9 m* t3 I" y
- ((and (or (= tile "u") (= tile "v")))2 \3 V( U8 r8 g8 O
- (if (and (= int intchk)1 f0 i1 j: C [# E
- (>= int 0)( U9 E+ I$ q$ m2 h7 l
- (< int 201)
+ c: K% Y1 D8 n: m3 w/ V - )
; q- U/ h, h# J* V! b: t4 Z - (setq valid T)4 G+ A/ m; c' Y* z9 ]! G2 ]
- (setq errmsg "Value must be an integer between 0 and 200.")
, q, n" w9 B0 D$ A: Y9 E - )
) k4 j2 W* ?/ X; f1 ~ - )
6 k. Z4 K0 y8 n G3 v# L: E - ) k" f$ U- }5 T, \& z
- )
& s- A6 X8 P# R" n s4 } - (if valid: l9 `0 r. k! J6 {
- (progn
6 F% x3 m$ p0 p - (if (or (= errchk 0) (= tile last-tile))2 {) b4 H7 s; L3 z: z
- (set_tile "error" "")& K( @# ?) h: V- [2 c$ h# R
- )
- j! |6 ]5 u! f" d - (set_tile tile (itoa int)). M% r8 ]/ o1 M* J. Y4 b0 b* U
- (setq errchk 0)
, R$ h1 t& x8 r - (setq last-tile tile)* i: ^/ [8 S# Q- O" u
- int/ \+ u" n5 l# g' T! R* q" k
- )
$ J# }( \5 Q7 g% c( H; p; [ - (progn
]$ g/ T/ }0 w# v: V | - (mode_tile tile 2) ; Move focus to offending field
0 \8 h5 N* N' A$ @ - (mode_tile tile 3) ; Select offending text0 D4 d( m) `& _" ^. j7 G
- (set_tile "error" errmsg)
3 f% s' }5 t6 R6 y: N - (setq errchk 1)
8 G' |8 q: B1 U - (setq last-tile tile)
% Z! H7 ~& d+ s% V - old-value9 @. G1 r9 k) n/ l7 H/ J; P
- ) b1 X( g# g: ^, T z* V0 U2 t
- )' v8 j" S& w' L1 e4 ^
- )0 a1 S9 c& }6 b
- ;;# v& u! @! {3 g! o& G; s
- ;; Functions that verify tile values for integers% o: R" z3 {, h' a2 P6 I) O/ k/ L9 q
- ;;& c$ A1 c) W0 J) b
- (defun ver_col (value)6 B, |& v/ m- b3 ]( O; q: [* Z
- (setq columns (verify_i "columns" value columns))" G. W6 e# @; p" j! U
- )
- V3 e2 C8 _4 h - (defun ver_row (value)9 Z: O4 B9 o$ }2 w" J
- (setq rows (verify_i "rows" value rows))5 w1 u2 e- ]/ S
- )1 R9 A; U- v8 b3 G* c6 y
- (defun ver_u (value)
4 F" G! X6 ]# u4 [ - (setq u (verify_i "u" value u))
; D) u' o4 c7 `$ g, \6 ~. Q - )5 r' U* ]! l. R7 ^
- (defun ver_v (value)
" i9 M% T! i9 y# P& O - (setq v (verify_i "v" value v))
7 w# {7 _8 J! ^0 C3 L - )
! i! C; w' j3 T: \/ I% J - ;;
! ~; J& I' t" A% I: I1 N' ~, d - ;; Functions that verify tile values for reals
6 o# ]9 p4 C( T& T - ;;% I; r% @3 H9 Y. J+ Q$ G4 q1 H
- (defun ver_x1 (value)! h1 P- o4 _7 }* ^2 B: K
- (if (setq x1 (verify_d "x1_pt" value x1)) (calc)) d E! l, J3 S' j- `
- )
) X, i, T! F4 y; q$ [: c$ w - (defun ver_y1 (value)
7 v2 b7 Z" n! h( Y, P - (if (setq y1 (verify_d "y1_pt" value y1)) (calc))* l I" y3 H2 m8 D1 T
- )! [: X" U' h+ M' v) g _7 p* a
- (defun ver_z1 (value)
9 d# Z! I5 _% @3 y7 z8 \- W - (if (setq z1 (verify_d "z1_pt" value z1)) (calc))* c# ~$ R0 K, M+ h
- )
, t# x3 O9 R8 R$ r9 g1 u6 z% ? - (defun ver_x2 (value)
b9 y; t. R" W, p - (if (setq x2 (verify_d "x2_pt" value x2)) (calc))
d( V$ _/ [2 U4 `( Y. ~( p4 V - ): e3 [9 Y: u; L Q0 P0 t( ~
- (defun ver_y2 (value)) U- M6 h4 }/ W% c+ b
- (if (setq y2 (verify_d "y2_pt" value y2)) (calc))) }9 q* e7 e8 l' S; q& e" D) c; V
- )
+ D! o: Y1 w' z3 p9 | - (defun ver_z2 (value)
" `) e% C! }! C! E0 E - (if (setq z2 (verify_d "z2_pt" value z2)) (calc))4 ^. s, x" t# S7 N7 @4 F" Q- ]6 z
- )& o, M' C$ z" A& Q; ~& l6 f4 X! i' v
- (defun ver_x3 (value)
9 I6 r2 e$ G& p6 C& A - (setq x3 (verify_d "x3_pt" value x3))# W q. V7 l4 N" [/ i4 v
- )! Y. N' i _) A4 {6 Y
- (defun ver_y3 (value)! z0 b7 D0 ]# m/ h8 q7 O
- (setq y3 (verify_d "y3_pt" value y3))& m1 X* U5 j, s6 c( f
- )
- I* b& j8 `& I, I7 q( n. N - (defun ver_z3 (value)& g o5 v/ P% A
- (setq z3 (verify_d "z3_pt" value z3))
2 n3 [, q5 B4 g# ^1 d - )' ^: ?. E7 O" {1 G
- (defun ver_x4 (value)1 ~/ c& B* G' K# X8 z
- (setq x4 (verify_d "x4_pt" value x4))) \, D: P# Y( ~9 e* j- K
- )
% A9 D: N) {6 u/ d7 ~6 r. A - (defun ver_y4 (value)8 E, B2 _ w* s, j" A
- (setq y4 (verify_d "y4_pt" value y4))
& u6 |7 m# S6 ~- ` - )" c# O U" |1 r( ?) s7 p4 Q
- (defun ver_4 (value)
, ?/ B9 R) i" N# s, j8 @' A - (setq z4 (verify_d "z4_pt" value z4))
5 ?/ Y9 u# r j/ E6 N% {" @ - )
( t; f, Y# u# o - (defun ver_xscl (value) f. |$ c) d. k* d7 ^
- (setq xscale (verify_d "xscale" value xscale))
1 L4 `* N+ q4 @* ] - )
1 ]9 M4 I1 H2 x/ h0 w, B - (defun ver_yscl (value)- R {- R4 Q* f
- (setq yscale (verify_d "yscale" value yscale))% r/ G8 _, U2 G- h) m
- )
! e* G; A/ l; [ - (defun ver_zscl (value)* R" B; J a2 C7 `! ?
- (setq zscale (verify_d "zscale" value zscale))4 H: Q( F/ {& \5 |' F6 }
- )
& r- ? m# o6 j1 P; P7 H* O+ @ - (defun ver_colsp (value)
3 y% x ^9 W: \9 E2 f - (setq col-sp (verify_d "col_sp" value col-sp))
* A, V# I$ d; ^, { Y* \. c - )/ \. ~6 P# h+ @- Y
- (defun ver_rowsp (value)
6 ?* z; o. I( }5 T - (setq row-sp (verify_d "row_sp" value row-sp))
. r, R. S' k# P7 F - )
* a& k1 g& C: E8 Y2 e# m - (defun xclip ()
6 d" c- _1 d3 w* O - (setq xclipmode t)
/ J5 L& Q7 [7 t$ `1 x6 K' k& J - (if (= xcliponoff "1")6 j; u, ~/ `) [6 _3 F+ k
- (command "_.xclip" (cdr(assoc -1 elist)) "" "_on")
( u7 T$ k. G* f5 W0 D/ p - (command "_.xclip" (cdr(assoc -1 elist)) "" "_off")
" D% Q( q: `& }: j, ]* b9 _+ U - )8 v3 ]9 Y. G5 O
- )! {" B- A6 j/ M/ a1 J4 j# u2 r& I1 Q
- (defun ver_rad (value)
) j9 P: j, ~; P3 P5 d3 {" E( A - (if (setq radius (verify_d "radius" value radius))( h( y& V) u- k
- (calc)
6 t5 ~: m: N" U2 q# n8 W - )
0 g4 U: V! A7 D, k - )- Q5 K, A+ S% }7 T4 l Y
- (defun ver_majrad (value)9 z5 `. F: F- f; h
- (if (setq majrad (verify_d "majrad" value majrad))% j# M8 Y1 c1 A- b
- (ell_calc_newval "majrad")
2 q: P$ Z0 U5 ], a4 F3 ~5 v( ] - ). D8 V$ E9 e. C' w1 k; j$ c4 L9 S
- )* Z: E$ t" {! v8 E6 l W3 @0 g
- (defun ver_minrad (value)
0 C1 H1 U4 S2 k; B/ L3 d - (if (setq minrad (verify_d "minrad" value minrad))
8 \2 `( B' I! q! m. J( s2 [ - (ell_calc_newval "minrad")
% \4 c" n& J! `' Y: o; s - )
- Z: `: @1 y! J - )" T L3 D% c( Z7 H* M0 |
- (defun ver_hght (value)
! c( N; K9 S0 A+ I' Z6 M3 ?" | - (setq hght (verify_d "hght" value hght))% x9 ^" o9 ~) ~6 _/ p6 g
- )
3 m4 f3 {, g2 N8 Q4 q& y - (defun ver_wid (value)2 ^+ \" i" l2 T7 W/ f1 G2 j l
- (setq wid (verify_d "wid" value wid))) u. M# ^+ X9 }$ n2 o+ y5 v
- )
' C9 X. ^/ B. J J4 B - (defun ver_xline_x1 (value / temp)7 B' U3 P0 M) a& K# q
- (setq temp xline_x1)
5 [; G T4 e- @* M) u% @ - (setq xline_x1 (verify_xline "xline_x1" value xline_x1))- u2 j: o- x# R/ W: ?" w
- (if (/= temp xline_x1)
2 R, }- d( J; x% u0 k# @; g - (progn (modify_xline 0) (set_tile_dirv) )/ c2 n, r# S' y( {7 D
- )
+ |) X% M$ B7 U+ t& i0 H# K - )( w0 t6 l) G( @4 N/ A a# x- f6 J/ y
- (defun ver_xline_y1 (value / temp)
/ F: C9 v& u: i - (setq temp xline_y1)
! A5 a' @2 Z: W5 P/ r) g - (setq xline_y1 (verify_xline "xline_y1" value xline_y1))0 u' H1 ?6 _1 U- k
- (if (/= temp xline_y1)
/ J# `4 |0 R" l+ P! \ - (progn (modify_xline 0) (set_tile_dirv) )
, d& s, f' P" h4 s - )0 X, i9 o N! D9 c4 M
- )8 c0 R8 C6 I6 W5 F* v9 Z
- (defun ver_xline_z1 (value / temp)- f& b8 Z' s6 ?
- (setq temp xline_z1)# n& g; P! r9 D/ `8 w1 I- |, `
- (setq xline_z1 (verify_xline "xline_z1" value xline_z1))& q, m {% d" x0 m
- (if (/= temp xline_z1)
) k) D7 B8 B5 J! m: `0 U - (progn (modify_xline 0) (set_tile_dirv) )
, e! B+ H3 S( E" e+ D9 L - ); ?9 t( h& B- z- X0 p6 O. @8 i
- )
3 i! m- J+ e! c @ - (defun ver_xline_x2 (value / temp)
& O4 }3 a! b" ^/ Z" M/ H - (setq temp xline_x2)6 f$ c% M4 B1 ?/ j, E
- (setq xline_x2 (verify_xline "xline_x2" value xline_x2))) I8 R( O9 W ?$ x
- (if (/= temp xline_x2)3 k0 g# E6 k. ]2 R
- (progn (modify_xline 0) (set_tile_dirv))' a# F- z- O" I1 q5 p+ N, ]3 r3 s; R6 }* I
- )
3 [8 w5 `1 {1 Y( V% F9 B) S2 ? - )8 v, F( ^) o7 o h0 W6 G3 J
- (defun ver_xline_y2 (value / temp)
' E7 N/ {& o0 i" z - (setq temp xline_y2)
& W1 m; Z! q# l$ M/ I9 Q5 D; P - (setq xline_y2 (verify_xline "xline_y2" value xline_y2))
3 @) e7 D, L* J; j, _8 n% @$ I - (if (/= temp xline_y2)+ T" e& m4 ~0 ]6 z
- (progn (modify_xline 0) (set_tile_dirv) )
1 c N. F A Y0 h( N/ Z - )/ ^; `/ f7 P2 f' w/ }* X6 d
- )8 r4 W. I' h; U$ E' I4 ?! E
- (defun ver_xline_z2 (value / temp)
8 a: q2 v4 v. Q+ K5 N. {! p - (setq temp xline_z2)
0 z5 }2 V$ e. j# d T) b0 o4 a& M: ` - (setq xline_z2 (verify_xline "xline_z2" value xline_z2))# L1 i4 e4 I' g; V3 }8 i+ D# H
- (if (/= temp xline_z2)
" v8 `! K* A+ C$ Q) I - (progn (modify_xline 0) (set_tile_dirv) )
- T4 Z5 H4 u; Z; ^ - )
* }6 u9 e n; Z2 B5 K: U: l% o8 Y - )
0 k; E+ r5 K/ U0 z: u - ;;
1 X E( z' ^. O+ r - ;; Functions that verify tile values for angles- F; g" h+ u0 ?. t( l& Q+ q, J
- ;;" b' s; |) M/ b+ O6 L; P
- (defun ver_ang1 (value): t1 F2 j. A, P
- (if (setq st_ang (verify_a "st_ang" value st_ang))
, S% [+ b1 O9 h* |$ Z - (calc)
. ?9 K& [5 r6 k0 w+ j* e7 Y6 o& } - )
0 Q; }3 B- B' | C6 h5 |. X - )4 j Y5 g' v# G( @
- (defun ver_ang2 (value)
4 G# [' O% I% L* h - (if (setq end_ang (verify_a "end_ang" value end_ang))
! q# _4 C- x( W - (calc)
. G* j7 G4 W. P1 K5 O - )7 G7 k2 V$ Z, s1 l9 ]( @# Q0 r
- )
9 i: R, I9 \( j- q - ;;; ?( Z- I0 y3 _) d5 a6 a
- ;; Verify tile value for ellipse end angle. Handled slightly
8 L/ q% G* U c! L* c - ;; differently than the other angles.
0 W: j; T% l6 w2 M5 e - ;;% q, B8 Z" k C* B! w9 g
- (defun ver_eang (value)+ y4 P3 Q9 F' v% t
- (setq end_eang (verify_ae "end_eang" value end_eang))
* d" G; e; [' S. y) R; E' S3 e1 f3 F - )
" m; z0 J* P" Y2 g ^ - (defun ver_rot (value)
! N. C/ W( ^$ I3 {# H - (setq rot (verify_a "rot" value rot))4 u) c7 F' n' J1 z* G2 [
- )
' N* V6 ~0 E6 s" X8 F - (defun ver_obl (value)
5 i, y$ L1 X& @' Z* p4 W6 S - (setq obl (verify_a "obl" value obl))2 x9 I# d* }* X1 [4 R
- )
* _& T* `, e" [ - ;;* ]% e. f$ L6 n3 H2 `" N
- ;; Function that verifies attribute tag field for null string,
1 a2 `" v. T# T. @( o# v& `- U - ;; or a string that contains one or more spaces. Tile value- y3 J6 N8 N% x1 k3 a
- ;; is also converted to upper-case as well.
& e7 j$ n* s' {/ B: b - ;;" Y) ? {' F3 |
- ;;* A6 n3 N, p8 r- k9 ?4 E8 L+ v
- (defun ver_tag ( / tval)) U8 T N e# p2 O1 e1 T6 f
- (setq tagval (get_tile "tag")). Q: a9 I f) T7 t" J, p2 P
- (set_tile "error" "")( ?- g! D) B/ R* @
- (cond
/ E8 B6 t" s/ ^: W$ w" |9 C - ( (or (eq "" (setq tval (strcase (ai_strtrim tagval)))); ?/ |) w3 D2 K6 x
- (wcmatch tval "* *")); H9 u7 z& R) R" m5 \
- (set_tile "error" "Invalid attribute tag."). B/ G& r: ?% b0 q
- (mode_tile "tag" 2)
- @3 D- v' i% J7 b } ? - (mode_tile "tag" 3)): P- k8 E% u' ?; O3 U! N
- (t (set_tile "error" "")& y9 j; E0 S& ]. Q7 d/ v6 A
- (set_tile "tag" tval)$ Y# k2 S' R% r& r5 ^
- (setq attag tval)))
7 |9 z7 V6 I8 c l3 U - )/ P: r% ~- Q5 B7 P c
- ;;
$ W2 @4 J1 f$ v7 K - ;; Calculation functions
& A* M; B/ [4 \ P+ P; R- J - ;;2 f4 `& U }2 X! H7 S% P4 _9 Q; P( N
- (defun calc ()+ y# X% q8 D+ ^/ {
- (if (= etype "LINE") (line_calc))6 v! Z& m8 T2 a& i
- (if (= etype "ARC") (arc_calc))
1 K6 a( }; {, Q3 u. Z* P - (if (= etype "CIRCLE") (cir_calc))- _ N! B9 E# [: Q
- )+ R3 n, u/ `( [1 u# Y% _
- ;;: Y9 s( \; o; b' F, m. d; O: W9 N( w
- ;; Calculation functions for lines, arcs, and circles8 f6 f- X C" c0 Z8 Y6 N7 O$ P# Z3 ^
- ;; k/ e: P0 H' u! F
- (defun line_calc ()* O T/ ~% r$ a- G e9 Y
- (setq stpt (list x1 y1 z1))
6 t$ ~" ~$ ~* B% ]' L0 B - (setq endpt (list x2 y2 z2))" U' C4 ^; V6 O- p/ m8 Z8 H
- (set_tile "delta_x" (rtos (- x2 x1)))
% }+ O' G9 y7 i' c6 [* k% ~, Q - (set_tile "delta_y" (rtos (- y2 y1)))
- G$ e) k# {, I" a6 `, \! H - (set_tile "delta_z" (rtos (- z2 z1)))( N$ ]4 \0 F, c: v3 S! W
- (set_tile "l_length" (rtos (distance stpt endpt)))
9 t+ Y `7 u, c' ] - (set_tile "l_angle" (angtos (angle stpt endpt)))' K6 {9 d. @1 i
- ): y3 i! ?6 I7 l: u; j$ s1 c
) v/ E. r" Z" @; D* P T- (defun cir_calc ( / area units)
6 I; f3 |, V$ h2 Q1 ^+ S7 S0 \' v - (setq radtest radius)
$ A2 _1 \/ T1 x7 `, _! t0 G, ` - (set_tile "Dia" (rtos (* 2 radius)))$ u/ l8 H, e1 p. A
- (set_tile "Circum" (rtos (* 2 pi radius)))
( A7 M9 z- B5 Q6 r - (setq area (* pi (* radius radius)))
1 I5 T( N, k6 @! m1 Y" ? - (setq units (getvar "LUNITS")) K" F; c$ Q, I4 s' p
- (if (or (= units 3) (= units 4))
9 x8 B; R% E+ p) y) ~, i' j - (progn
( C7 N3 u9 u* N( L$ d$ K - (setq area (/ area 144.0))
4 q) q" Q+ L7 X, R) L, W! T - (set_tile "Area" (strcat (rtos area 2) " square ft"))- L) |9 v1 E& K& b ?
- )9 H) K+ g t9 \. d
- (set_tile "Area" (rtos area))
$ w& Q, r, m3 ?* g w! [& b - )
/ _4 n2 X% Y. N+ ^0 ^ - )
% P) i) p4 H A3 _6 f1 z' B2 A; b' e
/ R" l) V+ l9 u: `- (defun arc_calc ()
4 j" a0 d- |" V" V( \* @( ? - (setq totang (- end_ang st_ang))
$ ?* P r# g5 r! C* U$ v - (while (< totang 0)8 U5 v" i+ o1 d0 ~
- (setq totang (+ totang (* 2 pi)))
1 C& v4 E) X# M5 P$ e1 S. K8 B - )' B; P+ a2 \8 I v/ i* }
- (while (> totang (* 2 pi))
' j) ~- A$ W* K' u5 u, g8 }; k - (setq totang (- totang (* 2 pi)))
9 s- B: G$ p! I! V& @7 A - )
/ e( t \5 ~' }: x& M - (set_tile "tot_angle" (angtos totang))
# f+ J' G" ~! g* k* s, t! z - (setq arclen (* (* 2 pi radius) (/ totang (* 2 pi))))
7 N' g0 y0 E( |9 X9 ] - (set_tile "arclen" (rtos arclen))
" `( Y% ^$ g& P, q/ ^+ u4 D; {$ t - )' m( h* b2 B% n: b
- ;;
4 U2 j9 h, B; N$ u. e6 S/ B - ;; Calculate the major radius, minor radius, major axis direction.
( c. n9 a/ E) q U6 _ - ;; Get radius ratio. Convert Start, end parameters to start and end
+ Q& i \) i/ W0 w9 ^& o3 p; K! ] - ;; angles. Save Major Radius value in "old_majrad" in case the user
P# m8 Z9 j3 E - ;; chooses to input a new Major Radius value later. It's needed to
& Z' v- I4 U% |! L4 }5 x - ;; calculate a new Major Axis Vector value.8 _7 [+ c( {! ?0 W+ W, L j6 J# j" k" x& S
- ;;5 K% T& x% L& h1 R6 k0 X: x5 k
- (defun ell_calc ()% V$ L g E- |! n9 Y" V3 |: }$ H
- ;; Get major radius from the major axis vector.) A x$ p) f! `- B: E
- (setq majaxis (cdr (assoc 11 elist)))
- K6 g3 \' G* D9 d+ U( }9 ] - (setq xx (car majaxis)): S, R+ S( W% ?; K
- (setq yy (cadr majaxis)) ?( T9 l" I; w( {
- (setq zz (caddr majaxis))# _5 L* O1 R p1 T
- (setq majrad (sqrt (+ (* xx xx) (* yy yy) (* zz zz) )))! I5 t4 \6 i- M
- (set_tile "majrad" (ai_rtos majrad)): [- P7 z& |' v5 A3 T/ b7 w. P
- (setq old_majrad majrad)( H# o8 N' e, Z) S) I
- ;; Get radius ratio* m3 k( n: V+ j- P
- (setq rrat (cdr (assoc 40 elist))); m x& s2 I4 Q0 S8 G: u2 x
- (set_tile "rratio" (rtos rrat))& B1 {- ^' z+ \+ i1 \4 H1 [! }
- ;; Calculate minor radius
6 L. J& [) J3 N3 ]7 ]$ S - (setq minrad (* majrad rrat))& X" d% B; y3 l8 o$ r5 n9 \& ~# Z
- (set_tile "minrad" (ai_rtos minrad))
9 j- x3 N O" {, D# N8 e! R$ l - ;; display major axis vector1 g% {- D! H# D6 R( W7 ]& Z
- (set_tile "Majraddirx" (rtos xx)), M w1 A3 r) K3 y' U& z" X# z$ H
- (set_tile "Majraddiry" (rtos yy))1 S* v1 @" {6 v" C* m3 p, @
- (set_tile "Majraddirz" (rtos zz))1 W; b7 ?* J) l
- % @+ C( k: i6 E/ e
- ;; Convert start parm to start angle
- h) k$ j/ z1 o: p, H6 @ - (setq stparm (cdr (assoc 41 elist)))' M; |8 }8 X) k9 {6 J4 b) @
- (setq vecx (cos stparm))
4 w$ f* ^3 O6 j8 D; {" I - (setq vecy (sin stparm))# }, u% v( `9 q; J+ o) w
- (setq st_ang (atan (* rrat vecy) vecx))
3 j7 I, G% k6 Y2 N- h, @" g- y - (setq tempst_ang (ai_angtos st_ang))
' q$ w( P0 F$ I* W1 C - (set_tile "st_ang" tempst_ang)
3 @* |- _5 K! p - ;; Convert end parm to end angle. If end angle evaluates to 0
* D, C1 t6 i7 }. A d& [; Y - ;; degrees then display it as 360 degrees.- U6 |4 H: }0 N) [ k* t
- (setq endparm (cdr (assoc 42 elist)))! D. @! E+ U) _; J4 n% P
- (setq evecx (cos endparm))
& q) F% f' V V% t - (setq evecy (sin endparm))
9 g. z6 F& F; J) l# {' ~ - (setq end_eang (atan (* rrat evecy) evecx))8 Y( _# f/ s* X: c$ E, r) D2 L7 f
- (setq tempend_eang (ai_angtos end_eang))" E+ d3 m& k/ t/ a
- (if (= tempend_eang "0")5 {# d3 f' w0 O2 R m6 j
- (set_tile "end_eang" "360")
) f6 }) Y' E) [2 r( P - (set_tile "end_eang" tempend_eang)2 b7 p3 B* H4 F( \+ s
- )% q0 u6 O2 l! m% X
- ;; Get area of the ellipse.+ P" x' ~( t' a" @$ _- U
- (ell_calc_area)
! Y4 W1 j" k" L - )
2 o/ R7 R1 K2 ]+ \- E: c - ;; Calculate area of ellipse. If it is an arc then* F# n4 u# X0 Q2 r" Q! U! ~" m
- ;; grey out area display.
/ M, k L1 j7 c1 x - ;;2 d% k' y* T( L8 |+ e
- (defun ell_calc_area ( / area units)2 }% |* y* a5 J7 y; U1 s% O
- (if (and (= tempst_ang "0") (= tempend_eang "0"))
" R! k0 |( M; T% ?0 ~% I - (progn
) V% z/ i0 ^( r8 Z- }8 u, D. t4 e - (setq area (* pi majrad minrad))5 t. F' \( |; A; H( x' G! O# u
- (setq units (getvar "LUNITS"))
; s8 J7 q3 W1 p* H8 i4 a2 X5 S+ S3 G - (if (or (= units 3) (= units 4))
) a' ^" S7 ~/ A8 r1 W& f - (progn* b2 ^7 n( E9 l( [
- (setq area (/ area 144.0))
5 A/ f# c# r* ~ D/ y - (set_tile "Area" (strcat (rtos area 2)" square ft"))
! h; Q6 e" E- d" A6 Z - ): m5 j; M% G& ?
- (set_tile "Area" (rtos area))% ]" ?% ^ C" V+ ^% o: i" ]
- )1 d2 M: v. Y4 k2 Q0 K% z
- )2 o1 Z1 D. ]; b' g$ o8 s' |8 N5 n
- (mode_tile "Area_text" 1)4 h9 @' j) h0 j
- )$ R: H! E) s0 V* Q: T
- )
& E9 @7 [+ _ u& n h! i - ;;% a6 }! {& o+ r+ C) M, a# v
- ;; Calculate new values for ELLIPSE
/ l" E. b) y& E. S$ r - ;; Minor Radius, Area8 {( C* ^7 T$ b" |1 D
- ;;
- i* \# `3 U# p! P) a - (defun ell_calc_newval (ell_tile): i5 ~$ Y$ F4 [
- (if (= ell_tile "majrad")
' g: B& C# D0 C) y - (progn
* @# B- W/ z: w - (setq rrat (/ minrad majrad))3 n4 e2 @8 r( Q N
- (set_tile "rratio" (rtos rrat))
: h- D* J4 V- `; h" D; [ - (ell_calc_area)
, k) f; ^/ `5 S0 ` s - )/ T# d/ Y0 N; B# ]0 E! T: o4 m
- )( j/ {0 z& P! L
- (if (= ell_tile "minrad")
) k( O7 N- z% A - (progn4 m+ }: ?. v; D0 w
- (setq rrat (/ minrad majrad)): b: ]5 v# ^7 |" J4 A& W
- (set_tile "rratio" (rtos rrat))
+ d2 g+ T1 a. F - (ell_calc_area)3 ~6 z+ U8 M" \- v! I- f1 R
- )
0 I2 i, l1 k: C7 Q# {& V: ? - )
) I$ Y* \4 S/ o* v9 C8 y" B7 P% F- I - )
4 L9 r4 x+ _$ [/ i! f
; O2 N. u8 \+ `9 S9 t; u- (defun set_dimen_props (/ loop a stl txstyname)
- N i- ~9 { M3 \5 @3 c/ \& |
* m- j. G* a" o; P0 n- R- M% ]# @- (setq stname (cdr (assoc 3 elist)) ; get style name
/ v& E: @0 l1 ~/ I - stl (tblnext "DIMSTYLE" T)2 h6 o7 T7 O. V
- stlist nil)( V+ U" v& S* e
- ;; Get all style names and list them in alphabetical order
G4 t, V% T: l4 R9 p - (while stl+ V/ {6 o' e. y/ [2 ?* y
- (setq sname (cdr (assoc 2 stl)))
# Y' W" r3 c9 P5 D1 Q5 l9 b - (if (/= (logand 16 (cdr (assoc 70 stl))) 16)
1 [. G. ]8 e" \% s& ^0 k, C - (setq stlist (cons sname stlist)))$ i& v/ I8 d9 r8 ^) E Y
- (setq stl (tblnext "DIMSTYLE")))
6 U: }8 c3 Y% |4 b8 Z; H - . ]/ C8 c }: K( m8 w6 b5 V9 F
- (setq len (length stlist)
! Q5 T5 L) J8 L% T1 A; p - loop 0
* e4 J+ ^' }) s* v2 U! i - dimsty stname1 Y4 Y4 U! D3 J) X) W8 U6 p. P1 M) ]
- ). _8 ~1 M- h k+ O
* s2 {) B: O* j2 D) n7 i/ k7 q- ;; alphabetize style list, depending on maxsort
- v& D& ]* a9 y$ o( P9 j - (if (>= (getvar "maxsort") len)
5 Q& s( L; u- q: ~, a - (setq stlist (acad_strlsort stlist))
, O: M2 G. F: ~! O( H1 q% ?; A - (setq stlist (reverse stlist)))$ c- l o, H# `/ _1 H
% D% Q3 x- s% x f& i- ; *UNNAMED style (dimsty = nil at this point) is replaced with
. X4 o3 T* x; D. K - ; the current style. After R13, we require dimensiosn to have a8 {6 f7 A( d4 |2 ^
- ; dimstyle, so we plug any holes where we find them.
, p5 y" C) m; E0 f - (if (null dimsty)
# L: t& Z" V4 l& t3 d9 O8 Z" c - (setq dimsty (getvar "dimstyle"))
2 e- f& P6 @) ?9 T - )8 G/ s* O; q' a6 E4 B5 @& S5 f
- ; Show the styles in combo box7 `; ]+ S3 a; I! D" t! f
- (start_list "mod_style" 2)+ Y' R" t. |: U6 `
- (while (< loop len)( l2 o3 Y# X. i7 S+ P* r
- (add_list (nth loop stlist))
& k' i ~& i# [! ~7 I1 L - (setq loop (1+ loop))- T9 q/ j ^3 a+ [# t/ t! l
- )
1 d4 e, a5 }* }, i5 a0 ]
3 b( `7 a; x: o! P @0 }- (end_list)
9 a- |) f- M K D/ q$ I - f% k* N Q5 v! S
- ; Hilight the style name of the selected entity
( H; _. m, Z8 `$ R ~! S+ W - (while (and (< 0 loop) (/= dimsty (nth loop stlist)))
* g( n ?9 I7 @+ y - (setq loop (1- loop))
- t4 o; S# }3 w' ^ - )
0 H1 X" Q8 n& ]' D+ T& a8 r: Y - (set_tile "mod_style" (itoa loop))
' K7 J" c$ J/ {* e' Y - " N y* R# A, c8 X2 m5 B6 P
- ; The following is the list dimvars. It must be sorted in the same
! }, B' O O) G* F, x5 x - ; order as the resfub returned from DDIM (ADS module).
( m- T6 [4 w3 r, ?( w0 J - : s F! { M7 D( k5 y
- (setq dimtbl (list "DIMSTYLE" "Style name" "Standard flag values"# t; x; t6 U' h- }/ U) e
- "dimpost" "dimapost" "dimblk" "dimblk1" "dimblk2", G5 v* F4 }* S5 o0 R
- "dimscale" "dimasz" "dimexo" "dimdli" "dimexe"5 L5 R+ a2 A* h- G/ J" o
- "dimrnd" "dimdle" "dimtp" "dimtm" "dimtxt"' ?% @2 C0 i1 o0 H0 e. F& s
- "dimcen" "dimtsz" "dimaltf" "dimlfac" "dimtvp"% e; n. J) c* E& G. o% ?8 [
- "dimtfac" "dimgap" "dimtol" "dimlim" "dimtih"
" V' h1 l3 {4 ?3 B- D4 T - "dimtoh" "dimse1" "dimse2" "dimtad" "dimzin"1 j0 y& T: B3 z3 o: Q; |
- "dimalt" "dimaltd" "dimtofl" "dimsah" "dimtix"
2 o, m: T7 m& z3 [# ~+ i - "dimsoxd" "dimclrd" "dimclre" "dimclrt" "dimunit"
7 g9 O# Z6 p. k/ P/ n7 K- n! M8 j - "dimdec" "dimtdec" "dimaltu" "dimalttd"
6 ]1 x$ k7 {5 e" _3 ^9 I3 o! {6 n! p - "dimaunit" "dimjust" "dimsd1" "dimsd2" "dimtolj"
, N, M; X. A7 X/ C, n: h2 N v$ L; e - "dimtzin" "dimaltz" "dimalttz" "dimfit" "dimupt"& G9 w$ L# O- ?" G i# i5 y
- "dimtxsty"
( f' h$ L4 V; C* v9 k0 g7 x: @ - ))4 B% y7 l, C K' K9 G& Y: m6 g
- (progn
( r! a2 x7 ?4 `; W - (setq sv_dvlist (ddimen_getostate dimsty)5 S2 k* t/ Y. ^, J" j
- txstyname (assoc 340 sv_dvlist)
6 s7 ]3 u, Z' Z( x Z7 b8 k - sv_dvlist (subst (cons 340 (tblobjname "STYLE" (cdr txstyname))), s) k, Z4 W0 [8 m" b# y' y& C! C
- txstyname sv_dvlist)
! B3 k1 y' p5 b+ p0 c - dimlist sv_dvlist
. k# w7 n" [7 @' S* k8 L" H - )
' B" ?0 g+ F) |, L9 ?: P - ); e2 S* J( L! k! v1 Z' B7 p: R4 e
- (if (= dimtype "DDLEADER")
/ C3 A2 m: s4 O5 g1 d - (mode_tile "mod_format" 1)
7 w& J, ^& c4 J) F$ F6 X - )3 I$ j8 y! Y3 D$ t( Z
- (action_tile "mod_style" "(setq dimsty (ddimen_style))")0 |: K4 j6 \6 _3 | T0 }) F
- (action_tile "mod_text" "(done_dialog 4)")
6 q% t, Q$ n% G# v5 ]( i" T - (action_tile "mod_geom" "(setq dimlist (ddimen_dlg dimtype 11 dimsty dimlist))")
" F8 [7 L2 ~( e9 y - (action_tile "mod_format" "(setq dimlist (ddimen_dlg dimtype 12 dimsty dimlist))")
3 n, w- v" y! M, U- H* I( _# a - (action_tile "mod_annot" "(setq dimlist (ddimen_dlg dimtype 13 dimsty dimlist))")
- B d+ Y, m3 M+ n) m K - (action_tile "accept" "(done_dialog 1)")
+ o' {0 v& u: ]# g8 D/ R( Y2 g - )
' d! r* T0 a7 G$ y) D4 Q' X& J2 f6 \ - ;;
: V0 E, S+ r3 s9 `8 @: o+ v - ;; Get dimvars that have been restored.5 n" ?1 U p: ~# V/ q
- ;;% V! x Q1 B/ d9 @$ Q. \/ R6 B
- (defun ddimen_getvars (/ elm dvlist dv i): U {* {% T; I- x2 m' P' ?; Y
- (setq i 3 N4 ^8 K! c' M6 J5 [( n. L
- dvlist (list (cons 0 "DIMSTYLE")$ @- l: k6 M4 c$ `& e3 M$ m, p* O8 B
- (cons 2 (getvar "dimstyle")) (cons 70 0)). f9 G- B) A2 c: o9 z5 U' ?. ?
- )
r9 }0 \$ L8 P# g# T1 \ - (while (setq dv (nth i dimtbl))
& O- M4 l3 ~0 } - (setq elm (getvar dv)
& w4 K: e$ o: f' z - dvlist (append dvlist (list (cons dv elm)))/ L( @* f7 y9 I3 l2 D8 Y
- i (1+ i)& S+ j* y/ v6 x- s0 `- C. I0 S0 i4 A# ^
- )
7 o- X* Q: l. A" |5 } - )# b! _( J7 ^' l, w1 U
- dvlist8 g" [; B. ]/ ^' S
- )
9 c+ Q! E7 B# t2 W - ' K0 r2 k0 m0 x4 I+ Q% ?
- ;;
( h4 g2 l: |5 h$ K, v$ Q0 n% U2 n4 { - ;; Get the original states of dimvars. This is for DIMENSION entities.
0 ~/ a! k" b& e t - ;;9 U! t2 O, p' b- _1 i
- (defun ddimen_getostate (dimsty / dvlist elm i dvvars)
6 L3 _/ k: o) P3 b1 B4 j - (setq dvlist (tblnext "dimstyle" T) ; Get a skelton list/ r( ^2 Q" C0 F# f3 V
- dvvars (ddimen_getvars) ; Get dimvars for that entity2 V( _* S$ V+ W3 X( _% c L
- i 15 h! N$ I- ~( j! t. L
- )
5 }2 n6 X2 m6 n; @2 |, r ]7 w/ U+ `# H - : S8 A. C* p9 |/ v$ @1 U0 [1 ]6 B, ^2 `
- ; Create a list that contains values of the selected entity.
- b( P" }$ t! f
5 H7 j% k& q7 v( i& K- (while (setq elm (nth i dvlist))
4 J0 m: _: s8 f# {8 s7 R - (setq dvlist (subst (cons (car elm) (cdr (nth i dvvars))) elm dvlist)
! R9 |& p" ~2 k" a1 w; L! g2 G - i (1+ i)& l) ~; n* c1 }5 a1 q+ |2 C
- )
; r; k; }- u+ T7 r - )
' [! O5 T; q/ @4 l, U8 M - dvlist
9 F: O' m& y" b - )9 z. k& L$ |1 z. y9 v Z7 d
- ( b9 N! \4 i$ I# s, P2 [
- ;;
% M6 J# ~. t D5 r3 W) Z - ;; Restores dimvars of the selected enity.
6 \! u5 ^: r5 t# u5 W - ;;% I% D9 E: n$ O- R0 z
- (defun ddimen_dimsty_restore(/ dimtbl dimsvcurset en)9 f- O- f' D6 j4 c U4 g
- (setq dimtbl (list "DIMSTYLE" "Style name" "Standard flag values"
4 r: b/ `- t _; `# y1 {0 ^ - "dimpost" "dimapost" "dimblk" "dimblk1" "dimblk2"
- z2 Z* [* s# m S$ R- U - "dimscale" "dimasz" "dimexo" "dimdli" "dimexe"
4 I9 s( Z1 r" V/ P9 @ - "dimrnd" "dimdle" "dimtp" "dimtm" "dimtxt"" e/ ~; |% X8 J
- "dimcen" "dimtsz" "dimaltf" "dimlfac" "dimtvp"
( f* J7 T& j$ r8 O! G - "dimtfac" "dimgap" "dimtol" "dimlim" "dimtih"
( A+ G/ ^7 j/ Y# H$ C0 A( V* u - "dimtoh" "dimse1" "dimse2" "dimtad" "dimzin"6 R+ D; M' T/ O* G% n
- "dimalt" "dimaltd" "dimtofl" "dimsah" "dimtix"
# p4 _3 t% c8 a! l1 o- v z - "dimsoxd" "dimclrd" "dimclre" "dimclrt" "dimunit"
# r1 I" K) _ s8 n6 `& ~ - "dimdec" "dimtdec" "dimaltu" "dimalttd"
+ w3 O: O6 L. Z7 L3 q! w - "dimaunit" "dimjust" "dimsd1" "dimsd2" "dimtolj"- X, E* n& R( }0 Z
- "dimtzin" "dimaltz" "dimalttz" "dimfit" "dimupt". z1 g9 @6 J' N( ?6 E% q8 G. D
- "dimtxsty"
! [$ g: i A" a# R# Q7 E" {/ j+ G8 _ - ))3 g$ U1 K$ l- `6 Q
- (setq dimsvcurset (ddimen_getvars)) ; Save current variable settings0 J% ~- x; [, k. g. `* n {' T
- (progn
2 b) M+ ?! B7 i1 E( h4 X - (setq en (cdr (assoc -1 elist)))
, o" ?$ @* J" X% |: X( P - (command "_.dimstyle" "" "" en)
! E+ L0 l& t0 U- @ E - )/ J9 i* \* |; x: c& p9 o" g0 |. F
- dimsvcurset2 q d' \ z& ?3 O3 v
- )
! {) H$ |: x v3 j - ;;
9 r2 _0 I1 v9 {5 W7 ~- D - ;; Modify Leader7 h4 f4 }& V% Y9 [/ Y
- ;;
9 U- x: @+ x* H c" A- o - (defun ddleader (/ dtypebit blkname bename sublist a stname n dimtbl
3 h( N5 I) X. C q h, @$ @ - dimsty dimlist dimtext svtext dimovr sv_dvlist stlist- M% c! n7 _1 [( H# c6 F0 y& d
- dimtype dimsvcurset)1 x2 ?$ }8 H5 O' o, @& T
- (setq dimtype "DDLEADER"( i7 X: W F" g. `+ G% c: }
- dimsvcurset (ddimen_dimsty_restore)
8 Q' f2 _* I" \/ T - )
7 F3 ~/ Y/ U! u1 @2 L4 e - (if (not (new_dialog "ddleader" dcl_id)) (exit))
3 w8 v* y _/ c A- u$ S - ;; Set initial tile values; i" ^0 f; R6 N, l4 G
- (set_tile_props)' d, W9 Q5 o9 H+ ]& h
- (set_dimen_props), K( A* `! I: o
- (set_tile_handle)
]0 ?! o* z1 D$ A% O2 n - ;; Define action for tiles1 C9 [9 |6 a N) n- x# l( b
- (set_action_tiles)* C8 W6 p. f+ C9 k" K
- (mode_tile "mod_text" 1)9 K. _7 ~/ d; g( o
- 2 ] f. g0 Y! z% U- {
- (action_tile "mod_style" "(setq dimsty (ddimen_style))")$ c. J% p4 b7 m# T9 ?
- (action_tile "accept" "(setq leadtype (get_tile \"s-s\"))(setq arrow (get_tile \"arrow\"))(done_dialog 1)")+ i+ F2 t* I$ Y4 ~+ b
- ;; Get ARROW and TYPE.0 w8 e- B: S5 e4 Z- l4 z' v
- (if (= 1 (logand (cdr (assoc '71 elist)))) (set_tile "arrow" "1"))
3 l4 x. M+ t7 D. g - (if (= 1 (logand (cdr (assoc '72 elist))))0 ~& r4 J! E7 p5 c. i- \6 y4 D& {6 _
- (set_tile "s-s" "spline")
$ x% z" X. |% e, f6 q - (set_tile "s-s" "straight")
# N3 X7 w/ I/ ^- H9 W, d1 t2 |( F - )) i3 J+ F$ a# p% Q
- ;; Start the dialogue./ q5 h6 y9 z6 k- y! ?" G
- (setq dialog-state (start_dialog))+ q# x6 V# I8 ]; t) T2 D b
- (if (= dialog-state 1)
$ q8 y* v% h+ I$ h7 T - (progn
H% n) K" v# A2 h0 H' P - ;; update the style
7 Y& D: J3 O) J! @ - (if (/= dimsty stname)* {9 y( b! G! l1 i
- (progn
0 H' k5 Z# f+ M1 [) U/ E5 a- `( n - ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case r: C4 S; Q5 J3 V; e( l
- ; doesn't have it.
* s/ T w. r4 n" l2 c1 Y - (if (null (assoc 3 elist))
. D3 R9 r6 |' H5 | - (setq elist (append elist (list (cons 3 dimsty))))
2 ]( D/ }) I$ ~! C. w - ; else just replace it.
. [9 U8 U: D+ d. n3 u - (setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))% {4 R" {7 h) H2 V: |" {8 ~3 z
- )
1 m. Z2 H9 V9 z) s! H - ; refresh sv_dvlist with new dimstyle.
" |0 [+ h; E3 Q+ X - (setq sv_dvlist (tblsearch "dimstyle" dimsty))
8 W7 T4 \2 o0 H2 Y% w - )
8 E) c$ c' l' ]; _ u) L G* I - )5 ^, C% f" Y# G7 w+ ^: N* t3 B
- (if (not (null dimlist)) ; attempted to change dimvars1 M% D: j! f* l) c: l k* R# x$ l/ W
- (ddimen_complist sv_dvlist dimlist dimtbl)
: ?+ ~9 Q! x% E% } - )
, W! D/ O0 [' L" a" m - ;; update for ARROW.
+ z( o1 m( S2 L! ^- w- t1 j( d; ^ - (if (= "1" arrow)
. T+ U4 ~9 g% b, Z8 N9 W8 s3 |; I - (setq elist (subst (cons 71 (logior 1 (cdr (assoc 71 elist)))) (assoc 71 elist) elist))5 X+ g/ k1 E" E' c2 [
- (setq elist (subst (cons 71 (logand (~ 1) (cdr (assoc 71 elist)))) (assoc 71 elist) elist))+ J% ]0 e9 P8 J& p. A- H
- )
, L% X9 z/ Z3 z' F) y! w - ;; update the TYPE.* B9 i7 D9 k! a+ i, Y$ ]5 C
- (if (= "spline" leadtype)
, y! f2 C r- K- @8 j - (setq elist (subst (cons 72 (logior 1 (cdr (assoc 72 elist)))) (assoc 72 elist) elist))
4 ?" b4 l% x# B8 x - (setq elist (subst (cons 72 (logand (~ 1) (cdr (assoc 72 elist)))) (assoc 72 elist) elist))
/ Q5 q. l5 {, N$ R - )3 f% p4 c5 | i8 Z2 O! e: V* Y
- (modify_prop_geom)9 t; O' K- r+ v9 ?* G- D+ c
- ;; update the Color! h) o7 ]1 \4 u5 h
- (setq elist (subst (cons 77 ecolor) (assoc 77 elist) elist)), m' |6 Q+ I) h' G% Z8 ~
- (entmod elist)/ d7 I; X5 ^6 n7 H' {
- )
: e0 A8 T g4 |4 }6 U5 j - )
+ Z8 Q) Q G* F) h9 P* W - (ddimen_setvars dimsvcurset) ; Prepare to exit z- i# e; e, b9 T7 @( V2 m
- )
: J& a1 b9 f0 r1 o8 v
4 ?" { h3 k# C1 s6 Q- ;;0 M( v1 ~: n. {2 x, V
- ;; Get dimvars of a dimstyle with overrides.
; \1 G+ T. d5 w# D7 {' o - ;;1 r. s+ S+ j$ z
) }2 m4 A; N1 B3 o- (defun ddimen_getdimvars (dimsty / dimovr dvlist elm i)
% N6 f3 f6 \: T" |
/ P) q( n7 o' [0 j7 O- ;; Get override information for the specified entity.
6 N( \0 @# ?0 u1 M - ;; Leader/Tolerance cannot be restored by DIMSTYLE command, so we
+ l( Q4 p. x+ g! J - ;; must obtain override information through this tedious operation.5 a4 p% J# k( ^# N; @# w
- (setq dimovr (car (cdr (assoc -3 (entget (cdr (assoc -1 elist)) (list "*")))))
9 ^+ t( @7 W% Q - dvlist (tblsearch "dimstyle" dimsty)
( T: \! _! Z( \' S - i 2
' C- f% F, d$ V# e8 L - )
* t, N8 B, X) u- ~: f+ d o v, U: W# f
3 u1 z+ r! U W$ A6 f- ; Update the list with overrides if overrides exist.! a" S2 l2 z) [; ~
, N2 O% r8 X1 Y3 @) l5 a- (if (and dimovr (= "DSTYLE" (cdr (nth 1 dimovr))))4 N' b' Y2 D/ d* r+ I& G
- (progn
+ h- A& _ f& S# h- \9 } - (while (setq elm (cdr (nth i dimovr)))
1 T; E$ s6 F4 ~5 i( K - (progn4 [) ]7 v2 ^( g# g/ U }. E
- (if (or (= elm "{") (= elm "}"))0 m# M+ {' Y/ i7 h- _; j
- (setq i (1+ i))/ E% b8 ]4 s. [
- (progn
" A E; S5 M2 i - (if (or (and (< 180 elm) G5 g0 b, G F- E5 o
- (< elm 190)
6 X/ i4 W$ h6 Y! F. c% F) w - )0 _8 \! Y/ |5 d2 C
- (and (< 80 elm)& k) X( M5 y2 q) y' Q2 H
- (< elm 90)9 E: G0 R! c% s3 a: S
- )
2 n. G2 y2 v8 W* o& v6 ?* ] - )9 X ~/ O% j' k+ f: `( ]
- (setq elm (- elm 10))4 s3 U+ F6 [4 C2 a9 i, G- a. c$ ]
- )
/ W! l9 [ U5 o$ s6 o - (setq i (1+ i)+ e3 C: W s* v5 \$ s5 l1 M
- elm (cons elm (cdr (nth i dimovr)))( u! E- Z2 Y, c4 y2 M3 o
- dvlist (subst elm (assoc (car elm) dvlist) dvlist)$ X. } E8 G$ H
- i (1+ i)* X$ }/ y2 D& l/ x" H: n( T0 E
- )
2 V6 e& b" Y9 [2 @4 j+ _4 f - )- d* Q9 [# y% @$ C1 ?
- )
4 i3 e8 M" w8 @) _5 f3 v - )
# ^0 L/ _' y3 ~" p0 O8 q4 K7 x - )' o" q$ R+ a( p
- )
, [8 T" T) V# ~7 A) h$ S8 l5 z. W% A - )
/ k0 Q: v: _) O9 p' D6 n! l7 k - dvlist
x9 l5 e) k+ X( q - )
; D" P4 c! G! M, W: z
& c7 V; f9 X2 s+ k/ L, t. B" Q- ;;- ^& d1 e4 C, K7 {# f( H: n( A
- ;; Modify POINT* ?0 g" q. K; g9 P9 P ~6 \! _
- ;;& l& W! S5 n% t+ r: B: D6 N4 Z3 R+ ?
- (defun modify_point ()
4 k6 ? y* C. T6 N' F$ e# ^% L( r - (modify_properties)7 J+ T& x, ]$ x; [2 q, {4 s
- (setq pt1 (list x1 y1 z1))) l& Q* H7 g- D3 Z5 b0 A3 j& P- E
- (tempmod pt1 10 0)
# r; s: p1 `& V - (entmod elist)
' {2 h/ K+ ?/ ~ - )
+ H: |: ~6 V: U P7 p3 }& b
; b$ K9 k, o* f/ M- (defun ddpoint ()
8 k* D% r+ `/ g4 N - (if (not (new_dialog "ddpoint" dcl_id)) (exit))
5 A. y6 e, U/ p - ;; Set initial tile values! m9 |& W+ R9 p2 {- c7 z( F4 B
- (set_tile_props)- k2 w- z0 y, k
- (set_tile_handle)
4 T% F3 p6 _5 t- I J3 V - (set_tile_pt1 0)9 L* O/ a1 R8 r* _- _
- ;; Define action for tiles3 G1 I( U& u+ a; \, O
- (set_action_tiles)7 l3 j7 c: m5 ~
- (setq dialog-state (start_dialog)), z7 v( s3 v ~* H& w) Q
- (if (= dialog-state 0)
) Q @/ o9 I. [9 I - (reset)
0 H5 H# B' v) D: } - )
. X w" w) L4 ~8 X# r+ D - (if (= dialog-state 3)
9 {/ B+ W" J4 D - (progn
9 t2 c' f& |- R- O& R - (modify_point)
- I) o$ C- f# r1 U g: [2 A$ P - (setq pt1 (getpoint (list x1 y1 z1) "\nPoint: "))
# P) _6 d" g$ B& z+ ] - (ver_pt1 0)! _- |% V( @' Q
- (ddpoint)! a9 H+ f( d3 C" P( C
- )
; v! \. X! |9 f* ?3 `, K$ P" V; D" W - )
0 r2 P4 y; V8 g, T - (if (= dialog-state 1)
+ K8 H3 F$ d8 q- B+ e6 E - (modify_point)& m3 m7 p' }9 z5 n- c
- )/ L, v1 T* S0 V$ M% g0 x
- )
- W* E# z5 C; v0 t - ;;
* D" S! P ~8 Y) B- L4 k5 F - ;; Modify LINE, |/ W# {. a' h/ {- h# z/ q
- ;;& h2 F# f3 Y( y, m* J- }) W' t
- (defun modify_line ()
% k% J" |/ l! ~% i0 P: ^/ c1 e - (modify_properties)
3 U! g3 m& n/ b2 p0 j) y - (setq pt1 (list x1 y1 z1))
# C6 A6 d$ _$ V& V - (setq pt2 (list x2 y2 z2))
5 J D2 B/ L& D8 { - (tempmod pt1 10 0)" L1 A: P; j% k/ v( U
- (tempmod pt2 11 0)/ y2 M; Z! G- z0 A. r
- (entmod elist)
0 F) M5 B# z9 {& ]0 ^ S - )
$ o! U% D8 P2 g% Z; ]0 u - (defun ddline (): ` R, ?0 W1 G5 d; z2 Q; P# l, L
- (if (not (new_dialog "ddline" dcl_id)) (exit))
! S% ~" b! O; v. k1 j' W. C* s - ;; Set initial tile values
& b/ b) F2 F9 @ - (set_tile_props)' v" U. @3 U$ V- D# O+ e4 i
- (set_tile_handle)( n, c. g5 ^2 R$ U6 G0 o" \( s
- (set_tile_pt1 0)0 e/ B* f3 P: H$ z: g' Z
- (set_tile_pt2 0)9 ~" \! S1 q' z- _. |4 U
- (line_calc). |( z6 `$ x6 w) |8 r
- ;; Define action for tiles
3 b% E* U/ Z# n7 {4 d r; p# ? - (set_action_tiles)
D) x* z& l; _ - (setq dialog-state (start_dialog))
- y$ O- s: w8 v - (if (= dialog-state 0)1 J# x) \ w" i- B. V
- (reset)( K. @( p: I/ r1 X+ T
- )+ n! e9 E8 F# R3 S8 b( P
- (if (= dialog-state 3)' S" B5 c! P) W; w5 F4 o
- (progn
! d. m3 e6 F6 q7 f& N' x - (modify_line)
7 |1 P m' ~) T \( M g7 a - (setq pt1 (getpoint (list x2 y2 z2) "\nFrom point: "))' R4 J9 {/ V' u0 C% k
- (ver_pt1 0)+ @1 z! E* L3 {# @
- (ddline)
3 ~7 T( V [% V - )
" R `! M# V( U! Y: F# `/ K - )
" K. x6 `: V& M. r: ^ - (if (= dialog-state 4)9 u" g- s0 k: q, x- D! R
- (progn
: o9 I+ G5 L1 A8 i6 e& A5 S# Z* U7 A - (modify_line)4 J5 b6 b! x1 |( y0 V+ \, A
- (setq pt2 (getpoint (list x1 y1 z1) "\nTo point: "))$ x; j) a: W3 J8 b% E3 k
- (ver_pt2 0); e: r c' R/ B2 f( h8 F2 W
- (ddline)
9 Q8 w3 f# Z9 i Q8 ^ - ), ~ U: {, G9 r* E' ?" }
- )- L" A. I( K# W9 R8 v
- (if (= dialog-state 1)5 e) k: e* @* r
- (modify_line)& X" l+ Z0 V' O6 I! U
- )
, A! H" U& p8 m* I - ). u! n9 z; E: H& N+ z5 Q" w
- ;;
, k! v" m+ I# o% ^1 ^ - ;; Modify MLine
$ Q; Z) J/ j! B# Y2 _2 C - ;;1 m7 o( ?- L7 W
- (defun modify_mline ()
4 w, y7 R1 X0 W' n0 B - (modify_properties)$ l( z. V; F1 F1 @" J
- (entmod elist). e( s5 |5 u3 K
- )
; \- y: U% T% p! B - (defun ddmline ()9 u/ r0 A1 c: u/ f% H+ d
- (if (not (new_dialog "ddmline" dcl_id)) (exit)); q( p$ _ v7 D& d+ c7 K
- ;; Set initial tile values0 z* U4 a6 {/ Z0 t+ e k0 x
- (set_tile_props); J! w( ]9 K; ~1 F
- (set_tile_handle)
' G3 G2 T# _; u X - ;; Set mline style text field.! Z- _6 y( J& r4 h; n
- (set_tile "ml_style" (cdr (assoc '2 elist)))7 v/ y# @. O: ~- W
- 1 Y; G+ m |3 p8 |+ O, O0 h" z* A
- ;; Define action for tiles k+ j0 Y! t, X P) I
- (set_action_tiles)
. e0 F5 a* p# v% h( T; l4 b U - (action_tile "ml_edit" "(done_dialog 3)")
- e; X0 Q4 @% A' ^& Y - (setq dialog-state (start_dialog))- [( w& k6 ?, p4 l& @/ r' @* t" K
- ;; Dialog cancelled, reset to original values.
! W$ U8 ?2 ^7 ~ - (if (= dialog-state 0)
( p8 ~8 M+ F' d+ w/ L; e* X - (reset)( F# e$ w' P* D9 R6 T3 K
- )6 r6 t+ @4 B5 _! r" q
- ;; Dialog OKed, update the mline./ ^- p6 r9 m: p
- (if (= dialog-state 1)# x( u: T8 ^3 V% t: B I W! V% \: {
- (modify_mline)
" E. P* {5 A- f$ ]2 a# t. n - )1 P/ P, a- E/ Y: v2 j
- ;; Edit Mline, call MLEDIT.7 A4 I6 m/ I9 K
- (if (= dialog-state 3) C/ j) o9 B/ l( x. ?$ G7 V0 c+ s
- (progn
6 G" F$ v# p2 x - (modify_mline)
5 |$ z: G3 i/ F7 L Y+ }- B - (command "_mledit")
3 s) P$ y& ~: r7 A% l - (ddmline)/ P) F1 k- m" l+ b( Z8 n! _8 P0 y8 |
- )
5 n3 S+ E! ?0 N2 m/ o- G+ a - ) [% T: a3 u/ }4 T5 X9 C# a
- )
. d: G" U+ L, w - ;;% L: C' b' v* C
- ;; Modify Xline
/ N$ u0 Z% ]& X. T: N& K6 R/ f5 D - ;;$ ~) h& E* k6 o# @4 B: C1 d2 w
- (defun modify_xline (flag)
% c: N6 }* \! e8 `+ O( D% r" S" n2 r3 F - (modify_prop_geom)
$ x2 P" r' a8 f* h- z - (setq xline_pt1 (list xline_x1 xline_y1 xline_z1))
' Z; L/ M v/ T5 G; R - (setq xline_pt2 (list xline_x2 xline_y2 xline_z2))
/ [* }6 K& G( y, z% P7 _3 a$ u# V - ;; Update the Root point.. z. q( g2 x; U9 H
- (setq elist (subst (cons 10 (trans xline_pt1 1 0))
0 B |+ o, r8 v' K+ {9 o - (assoc 10 elist)2 N) h% d2 U! z& r) I3 _
- elist, k0 D+ r6 j% |( E) z1 y# H" U( ?
- )7 z) x( |! ^. Q- Z: u6 X: q
- ); d- T# J( Y0 q- J
- ;;
6 L+ O" c B% {5 f: ~& b! h5 t - ;; Calculate new Direction Vector WCS- A1 W$ C& K; y+ s W
- ;; x / (sqrt ( (x**2) + (y**2) + (z**2) ))
$ _% g# F: r; S5 B" t# `1 V- E - 1 q& v! y" `- x8 S( v7 b$ b5 ~
- (setq temp_dir (trans xline_pt2 1 0))7 ] M$ @, y# }' a
- (setq temp_dir_x (car temp_dir))
( d; c4 t: R# H9 O* g& I - (setq temp_dir_y (cadr temp_dir))
4 w# ]' S# u3 r6 Y( V. @ - (setq temp_dir_z (caddr temp_dir))
6 |5 z5 T& V: V& U8 E! K" b% } - * A6 I: r- D" O5 M2 O6 U
- (setq temp_xline_pt1 (trans xline_pt1 1 0))" {! K' L% V7 {5 j5 O7 s+ a1 T
- (setq temp_xline_x1 (car temp_xline_pt1))8 b1 g% Y6 l! a- g7 q
- (setq temp_xline_y1 (cadr temp_xline_pt1))% g; i: p& m0 r' x
- (setq temp_xline_z1 (caddr temp_xline_pt1))
+ l6 O$ |7 p( i* g$ G/ } - |- v2 q1 w- D( P
- (setq denom (sqrt (+ (expt (- temp_dir_x temp_xline_x1) 2)
3 s* B; h: ?. s& h& B% N, g/ K4 W - (expt (- temp_dir_y temp_xline_y1) 2)' D# Y) K0 B4 O' e, j
- (expt (- temp_dir_z temp_xline_z1) 2)
- ^0 V2 z& @, X& }2 W) T( o - )))
5 [' f v0 H# u; k. N2 v3 ] - (setq temp_dir_x (/ (- temp_dir_x temp_xline_x1) denom))+ y+ a$ R$ L! N+ Z3 u3 `
- (setq temp_dir_y (/ (- temp_dir_y temp_xline_y1) denom))
8 M3 H( i6 I6 n4 i4 `6 a9 x - (setq temp_dir_z (/ (- temp_dir_z temp_xline_z1) denom))& W" h( w5 Q/ T7 h/ ^7 m
- (setq elist (subst (cons 11 (list temp_dir_x temp_dir_y temp_dir_z)) J" J, f$ W2 z' v& ?- l
- (assoc 11 elist)
) P5 x6 r# O- d# L+ n - elist
4 _3 H: m2 F& W/ x1 W- d9 I- O - )
; C* B k5 } ^" X* X - )
1 {' x! }* p) k% F9 B0 Q+ s - (if (= 1 flag)
! T. P- ~' r ]6 p$ @, S% n- @ - (entmod elist)" P9 M. I& _, x! N% P Y* k: ]
- )
* ^- o3 \1 R2 _' k8 S) c# ~8 C - )! P$ v' P- c9 \8 p( a5 z4 o4 o, d( J
- , P# W" N e" @" p% U% K
- (defun ddxline ()4 N. E9 v4 A2 \& ?
- (if (= etype "XLINE")
6 \9 t# a- ]% g d; T8 m* q) Q6 ~ - (if (not (new_dialog "ddxline" dcl_id)) (exit))
$ ?) k- Z- G) U% B6 w - (if (not (new_dialog "ddray" dcl_id)) (exit))
a8 T7 f, s4 R4 P - )
" _% g# u7 q& f3 @/ v - ;; Set initial tile values
, T( X, @- g6 k- C3 s - (set_tile_props)7 }0 {" E; T9 a2 Q" Q6 a; o/ P
- (set_tile_handle)
) i! Z" P: i3 }8 S4 M - (set_tile_xline_pt1)' ` c3 d) a5 A9 Y5 w; V$ M
- ;; Convert to UCS and post Direction vector.
$ F- D' @0 p( t; [3 @ - (set_tile_dirv)
5 I+ ]1 }/ f2 V; N" }9 s - ;; Calculate second point by adding Root Point + Direction Vector.
# \ {0 \7 J: A. p" t - (set_tile_xline_pt2)
2 k# I$ }9 h; s. s5 c' k - ;; Define action for tiles
6 ^! p, S! M+ M Z1 ~) r+ ^) N - (set_action_tiles)) o+ m Y4 |. Z3 }. W" W7 B
- (setq dialog-state (start_dialog))
1 ?$ }2 I! l% R% J! @ - (if (= dialog-state 0)
' S# {; h9 u) T! r7 s - (reset)
* S7 m& L- `9 Y" x6 o: \2 z% N$ P - )
7 Z# d1 Q& D5 \, k9 @. p0 E6 l p3 U - (if (= dialog-state 3)
/ A2 j) K. @% K& m8 Z- v - (progn
/ v9 f' D! @( A P - (modify_xline 1)
1 ^+ U7 V8 P( b" q6 o - (while (equal xline_pt2
W7 p' ^( B5 z' g - (setq xline_pt1 (getpoint xline_pt2 "\nRoot point: ")) 0.000001)
& L' }1 ?5 B' D/ _' g U- d - (princ "The Root point cannot equal the Second point.")
( Q7 i# _& _$ C1 b; q - )/ | h/ j, s( A q
- (ver_xline_pt1)
' Y: P- d" d5 ] - (ver_xline_pt2)
9 H/ F: a% @2 N - (princ)
1 @. u ]: J# p3 P" G - (ddxline)) ~ w7 T8 L3 W3 S
- )
& H: ?+ H- N, F; f+ e8 I6 l+ ?8 c - )
/ k3 Y- V5 h% `( V - (if (= dialog-state 4)# o2 ^$ o7 I6 U, s5 t6 K
- (progn
' b4 f0 \, ]5 D4 U# [9 L - (modify_xline 1)
+ y, H- r) r7 c, o' c: k: ^. B - (while (equal xline_pt1: _9 P- m! z. Z* S& E( W
- (setq xline_pt2 (getpoint xline_pt1 "\nSecond point: ")) 0.000001)
: U* o3 \4 V( r0 V$ ^6 k8 B - (princ "The Second point cannot equal the Root point.")# `# \8 ^9 Y# @7 m. F- r! S
- )$ \# Z$ O2 v6 t# p" T: v8 m0 X
- (ver_xline_pt2). u. s8 { `* M3 U- A. j) N
- (princ)
2 @- ]2 P5 @; a: ?# g$ i. g- X - (ddxline)2 ^4 f3 v k" e4 m
- ): c' S i$ Z6 y3 @9 T& Q6 m
- )$ n# }# o( ^. \, e8 U
- (if (= dialog-state 1)& K; D' k7 W- T
- (modify_xline 1)7 D. j4 a2 |% P) L# d' j( O
- )# m+ H# I. s; }& q: H: Q. d
- )
0 c8 d" `8 K# d, E/ X& b - ;;
9 R/ C9 R$ i* x# ]# _ - ;; Modify ELLIPSE3 Y" w; o* Y9 {% X2 G( V, q
- ;;# m, X! O, u" g/ I
- (defun modify_ellipse ()% Z7 E* l7 ~2 h* u5 Q
- (modify_prop_geom)
3 {' X/ ]! F# r. L( V8 z - ;; Update Ellipse Center Point value.: c0 }$ q0 \" x. O/ b2 ^
- (setq pt1 (list x1 y1 z1))
8 |2 n0 @" k. t3 l. w' Q' c - (tempmod pt1 10 1)1 t9 V4 |' X D5 Q
- ;; Update Start Parameter value.& w) ?4 i) S$ i( G; |3 z9 G# c
- (setq y_val (sin st_ang))7 M: |3 K2 \4 m/ T
- (setq x_val (* rrat (cos st_ang)))
- N2 R5 P* l) i4 r0 d - (setq stparm (atan y_val x_val))
2 t2 T, U7 c9 W) \" E( H) A" @ - (setq elist (subst (cons 41 stparm) (assoc 41 elist) elist ))
' J# \- k0 g* \ - ;; Update End Parameter value. Normalize it, if it's less than9 o+ f d+ N7 B8 L2 p' I
- ;; the start parameter.
7 k' L% }6 U) O( |0 q1 r3 Y - (setq y_eval (sin end_eang))
% P" I7 v5 n; \7 \" X( R) F - (setq x_eval (* rrat (cos end_eang)))" g3 t/ q7 J6 b9 B) d
- (setq endparm (atan y_eval x_eval))
3 {7 S% q3 a5 r" z0 R* m" ? - (setq diffparm (- endparm stparm))
/ ?9 M; _$ X0 y$ U: x9 `6 ~ - ;; Epsilon of 1.0e-6 radians for checking a zero length arc.
' m1 k7 f( C: r) }- S& Y% R0 o7 i - ;; Since zero length arcs are not allowed - construct the full% L( t+ `" r& n2 T1 B( Q
- ;; ellipse in this case.
, S3 @/ I H; N - (if (<= (* diffparm diffparm) 1.0e-12)
+ _8 @) c5 z4 ?; g* W8 W - (setq endparm (+ stparm (* 2 pi)))
' r3 y+ B7 z9 I5 D/ t - )& m7 A* A: N8 P0 k' }9 @0 z) E
- (if (<= endparm stparm)& e, F/ ^3 {" @3 \5 r
- (setq endparm (+ endparm (* 2 pi)))
* `6 j H! ]- Z8 o( c - )
7 n4 k* K2 }) q/ b, r3 T - (setq elist (subst (cons 42 endparm) (assoc 42 elist) elist )), }5 s+ B, }( H! d- H R+ h4 E6 d# g
- ;; Calculate the Major Axis Vector by first calculating
* j+ i# ]' c7 R& t - ;; a unit vector using the old Major Radius value. Then
2 P& U0 L+ Q# ] C8 E - ;; Multiplying that by the (possibly) new Major Radius
+ c f% E+ C6 M2 j4 ]/ y! J - ;; value to get the new Major Axis Vector value.6 E7 @! |: @( u7 J/ z' {
- (setq unitxx (/ xx old_majrad))9 P% `- w7 Y; c
- (setq unityy (/ yy old_majrad))
! q3 j6 [; ?. {1 A" e% z+ M! d - (setq unitzz (/ zz old_majrad))
" n7 O# p2 ?4 H6 Q$ Y0 ~ - (setq newvecxx (* unitxx majrad))' `" L% O& O+ F- v
- (setq newvecyy (* unityy majrad))( B- \- q$ \5 Z l; z1 J- U
- (setq newveczz (* unitzz majrad)), ^* p4 V* f! V( N# O7 L5 I: c
- (setq newmajaxis (list newvecxx newvecyy newveczz))
1 d5 s5 [7 u. O( p! K9 g - ;; Update Major Axis Vector value1 s/ e% C5 W" P5 L. u) T
- (setq elist (subst (cons 11 newmajaxis) (assoc 11 elist) elist ))) H- p8 C: l& v( t b6 M
- ;; Update Radius Ratio value$ o& h9 k+ G' Q
- (setq elist (subst (cons 40 rrat) (assoc 40 elist) elist ))
6 G& j) ?; Q4 _& u J8 N - (entmod elist)& }& h" |( `$ u& y" G
- )* C, L2 y( H" h. {# C0 D3 U& ~+ @
( K# P% L5 {" {( W1 {( c/ f3 T7 y- (defun ddellipse ()6 n( |4 [' c; n7 G; @* l
- (if (not (new_dialog "ddellipse" dcl_id)) (exit))
H$ ^- j' s/ P$ D8 z5 g - ;; Set initial tile values) O0 y2 g K/ H' }: k. ]0 L& z
- (set_tile_props)4 k; a! P0 o. R4 r' _
- (set_tile_handle)
( V8 g! l( ?% n$ A3 b: S! @# { x - (set_tile_pt1 1)( C, ?0 H; } |; ~% d
- (ell_calc)6 G" _+ }) f" t
- ;; Define action for tiles
, k z6 v& M+ X - (set_action_tiles)
: d+ ]* z6 z* y$ M - (setq dialog-state (start_dialog))/ ^8 @' D; x% A' G! s
- (if (= dialog-state 0)( F! ~; R6 V3 M4 l3 `
- (reset)
% R6 y# k6 _. m8 z8 `4 M2 H7 \( Y - )" P$ i* z* T' i! I
- (if (= dialog-state 1)8 @% a3 h8 H4 _; ^9 g
- (modify_ellipse)" w0 A8 v' M) J) B1 i
- )
2 _, H6 ~& L( N, J7 ` - (if (= dialog-state 3): B. u) f; |# E
- (progn
" ], w: C8 a- n8 O y8 M+ `+ V" ^2 l - (modify_ellipse)
0 ~ t: h% W. {! h# a2 A - (setq pt1 (getpoint (list x1 y1 z1) "\nCenter point: "))' T: C: J9 E4 W9 z
- (ver_pt1 1)9 f. B1 Z+ N p9 J& f5 M# F
- (ddellipse)1 Z' b/ s5 \( J# V6 t( u
- )3 u& s& D v' V) Z( j
- )
$ |0 ]' H, d1 X( @ - )
. b f' J% g3 c0 f: W: n& w6 y# U - ;;3 Q4 c; _5 H) V( f- S6 ^4 e; e
- ;; Modify REGION, F2 s6 ?7 _3 U; I: E- d) ?& Q1 T
- ;;7 H$ \6 Q$ n8 S8 H) m/ K
- (defun modify_region () ?6 y0 u/ w8 {" G0 Y0 y F* F
- (modify_prop_geom)- o- p5 c. |! ~- @- E
- (entmod elist)3 T! B4 N' a* w
- )
8 O& y8 q& K5 u9 ^; o1 g - 8 f/ u+ v |5 w: c' r
- (defun ddregion ()3 I7 e% E2 E! }/ N' W1 K* _
- (if (not (new_dialog "ddregion" dcl_id)) (exit))
7 X+ Z8 D+ t5 V" f9 N f - ;; Set initial tile values& T1 g' T; m! V2 a) |; U; J
- (set_tile_props)4 S2 j' f( {) z# g( N- k& Z. c2 l
- (set_tile_handle)
% \+ p) e! d+ Y" v# H' u - ;; Define action for tiles T: w! [! A- W7 I1 j9 J
- (set_action_tiles)
N0 {# N& m" z, v K - (setq dialog-state (start_dialog))% w+ R+ ?3 o% H( {4 j3 h, j
- (if (= dialog-state 0)+ h) A- {* V: ^+ U5 ]
- (reset)
' R7 q; L: z% T - )
2 Z- [9 U/ S+ G5 m - (if (= dialog-state 1)! I7 y* Y% Y' s2 w# z0 v& ~
- (modify_region)$ ^( f% D- _, X7 y& l- x, Z
- )
( w- u) e$ z: Q - )* l. Y# J' D0 e* `6 M! C+ o3 o
- ;;7 Q z0 U4 Z8 @0 ]; c( C3 F7 r2 i( J
- ;; Modify 3DSOLID
. r; D) g' B) X/ S/ E! I# `+ I0 v - ;;! i& ]2 l& r+ P: g5 i
- (defun modify_3dsolid ()
2 }* H. \: x& p - (modify_prop_geom)
4 h- i5 S, m- x) w" q- ? - (entmod elist)$ O v! @9 ]7 q4 @( j# K4 F5 \6 R
- )
% P+ |0 S. ?! v: T% b; _2 ?
+ N7 g! K& K3 j- ~2 p- (defun dd3dsolid ()
" Q; `! q- t# a2 {- I3 e% u6 ^3 l - (if (not (new_dialog "dd3dsolid" dcl_id)) (exit))* M5 ^$ ~& }; H. W5 z) d! V2 I4 O
- ;; Set initial tile values/ [5 w; w; ~8 L/ d
- (set_tile_props)
% a! [, N, D3 ]1 l - (set_tile_handle)
8 Y& M$ S" y2 V. C - ;; Define action for tiles
7 H( r7 J; X4 Z) f9 ^, ^/ W - (set_action_tiles)5 f. {3 a( b* y, U0 ?( k. {& B
- (setq dialog-state (start_dialog))6 A7 n$ D) A, X
- (if (= dialog-state 0)4 E+ Q/ _0 f8 H, K
- (reset)7 M7 _. P% [' |4 o o& T9 ~; W6 ]
- )
0 F% V' p$ y0 [ Q- P - (if (= dialog-state 1)1 Z4 G U1 X: D& P) E
- (modify_3dsolid)6 g, P+ P7 @5 v" T
- )1 b, B4 f. d, T& |, _7 X. K% o7 S
- ) c. Y' `6 L: y" @
- ;;
$ H1 H- H; @! j6 ^ - ;; Modify AcDbHatch
+ l9 r% a1 ~8 n - ;;
( j8 H2 l& `: G& v8 `9 O, e - (defun modify_hatch ()# D7 W. l! ?% T0 n1 {/ @% r+ }
- (modify_prop_geom)
) q2 Z6 b# d9 c8 n @ - (entmod elist)+ F3 f' C: K& {( X) }! O0 p
- )
# y* z# M# @. X0 @# Y5 O
/ K. C# e: i! c- (defun ddnewhatch ()
9 F, j) L; N$ z( j/ ^ - (if (equal hatch-elist nil)
( N* c6 V# H2 q" d8 L) Z - (setq hatch-elist old-elist), c/ ?' Q! Y% G5 y6 h$ R# b9 g+ ]
- )
0 p) H8 X4 y1 h3 }' ?
_* Z9 `4 ^" j3 K8 p& U2 K' n" S0 V- (if (not (new_dialog "ddnewhatch" dcl_id)) (exit))
0 E- j- E6 P5 M
$ p. ]2 _ f- X2 U( _) \) u4 d) q- ;; disable the thickness tile+ D! T) W) W% N6 `7 Q
- (mode_tile "eb_thickness" 1)+ R E4 C3 \$ `
- (mode_tile "e_thickness" 1)
, w3 X9 }9 }" w: v( P
J3 n6 I7 ~# K N* H( W- (setq help_entry "modify_associative_hatch_dialog")7 ] O. N! k8 l+ P3 {! v T$ S$ b
- (set_tile_props)
. v( [$ z; ?$ p+ h' i - (set_tile_handle)$ k7 R* S0 ]. w; b0 m
! j( Z) x3 X% c) ^- ;; Define action for tiles: L# \6 u# A1 `3 i' K4 s
- (set_action_tiles)
+ B4 x4 l" F0 |, ?4 k6 y - (action_tile "b_hatch" "(done_dialog 2)")8 [0 Y; `# d- v. Q7 z
- (setq dialog-state (start_dialog))) p( U7 P. }, T! r$ \
- (cond
0 p% r- F1 E* p" j1 g - ( (eq dialog-state 0)
2 u+ ?( D0 i; C - (setq old-elist hatch-elist)
$ t+ V+ D7 v3 T# D6 ^! G1 n* g8 f* D - (setq hatch-elist nil)
# ]# x9 M3 {. u; C" ~ - (if (= (checkforlockedlayer ename) nil)
/ d8 l8 ?" e# s4 D - (reset)
) v6 a5 p4 N# B9 ]+ L9 B - (progn ;;; special handling for locked layer reset
3 V- B$ s# m9 O- T% t+ s - ;; unlock the layer
! Y* C5 f* |2 Y* g - (setq layername (cdr (assoc 8 (cdr (entget ename)))))
) u4 V7 b# J9 ]2 ] - (command "_.-LAYER" "_Unlock" layername "")& A" k! u( ^ p& I/ L F) J' h5 U
- ;; reset modifiction' B- E6 a8 P, E( U+ f; {; Y& [
- (reset)9 l4 P4 g* {0 c* x2 x
- ;; lock the layer again$ A* [2 o) _9 a- _! n2 @( O8 ]
- (command "_.-LAYER" "_Lock" layername "")( z8 v$ ?7 ?) W6 @" Z6 k
- ); V$ i1 |# C/ }; v) U9 H9 g
- ); I& S0 o: @. X! O
- nil ;;; makes (ddnewhatch) return nil for Cancel
& K1 P8 }/ t4 V: e5 w - )
8 Z( {! k2 f, {( l) t( ]7 y1 v - ( (eq dialog-state 1)3 z2 s' }& o9 m8 `
- (setq hatch-elist nil), `( j' W' a! M4 l: T3 q
- (modify_hatch)
5 o0 A3 ~) F9 [: Z0 U5 U. ? - T ;;; makes (ddnewhatch) return T for Ok
& b' b* w$ Z$ \3 T! A8 C - )
/ G; c% `, p: Y( x/ r8 d& Q5 O* m2 v( s - ( (eq dialog-state 2)
* n8 {$ H) Z, q& a) } - $ M5 |' E9 V" ~) A4 @* r
- (if (= (cdr (assoc 70 (tblsearch "LAYER" elayer)))
% b8 P+ _+ |! H6 z8 V - 4
. C3 d# p) F5 v8 S9 q' f - )
0 G. u# B5 o+ K# z9 x; l - ;;; new selected layer is on a locked layer* Q$ {( w# W8 R* J3 {2 e9 M$ t
- ;;; we can simply modify the hatch properties( x# I$ `" s5 d& p6 |) X
- (modify_hatch)0 j- p: z! l U: t( T% C
- (progn' H- d* g. _! g! V! S; V
- (if (= (cdr (assoc 70 (tblsearch "LAYER" (cdr (assoc 8 (cdr elist))))))- y( _. N# [3 ~+ b4 s! ~
- 4- U1 Y- Z* u8 t6 A/ \
- )
+ B, ^) }) [5 J$ c! c, u$ y - ;;; We changed the layer previously and now the hatch lies on a locked layer.
& b# ?- ^2 D8 g7 B Q$ [ - ;;; We have to unlock the layer forethat we can update the hatch properties.
, x* i+ x! {: t4 A. o1 ` - ;;; If we don't do that (entmod) fails to update to the new layer.
: Y( m. t, z# G* p l5 @$ w - (progn
% a% H2 `. `; K T, x' C8 {0 N - (setq layername (cdr (assoc 8 (cdr elist)))): [9 m' [" t3 ^/ Z3 i
- (command "_.-LAYER" "_Unlock" layername "") ;;; unlock the layer
% L8 ~! l/ x9 f; |, V- B; ? - (modify_hatch) ;;; update the properties' _7 d# S2 L% x1 X
- (command "_.-LAYER" "_Lock" layername "") ;;; lock the layer again
) `# v; L# r" m/ ]; f - )* j- Z6 @+ d+ P7 M8 o9 l
- ;;; All other cases we simply update the properties3 H6 \# x+ E9 A
- (modify_hatch) K( }# C4 S0 S) ^# F
- )" P. R) b o2 F$ k
- )/ L0 T7 }" B9 B& Z* [% d& p6 k2 W9 n
- )
. i/ I) }- @6 l2 x) T - (if (= (checkforlockedlayer ename) nil)- p- W& @$ M& x& z
- (command "_hatchedit" ename)
* G. A0 {- f3 K* L - (alert ;|MSG111|;"The hatch object is on a locked layer.")
1 `2 l2 m; C& [* s - )* [9 Z2 Y9 m$ K' l
- (ddmodify ename)# @6 w3 a% t, \, ~
- )1 ]! `# l" I/ L
- )
* O& ]3 t8 Y) ~9 ?& z4 @7 t - ) S4 p) q( u- J0 {/ P
- ;;: K9 t$ c( O% |+ p
- ;; Modify BODY
8 D/ w+ I7 d, F9 [$ e& }2 o; c. S" b - ;;
" T6 f7 H7 ]) P6 Z+ X2 a' ?2 x - (defun modify_body ()3 ~5 f9 U0 e" j
- (modify_prop_geom)4 O, I( P" f, q" g v. S! M# p* p2 u
- (entmod elist)
% A' \" R. v7 {; T( \ - )
3 e5 Y7 @& a% P9 c, ^ - " v) q1 i; M. k. X" L& J; G
- (defun ddbody ()2 V7 K {3 I1 W' S3 [$ p w
- (if (not (new_dialog "ddbody" dcl_id)) (exit))( s0 w: W9 s8 }3 u1 J7 ^9 @
- ;; Set initial tile values
5 u/ w7 c2 o6 \2 h0 ? - (set_tile_props)
5 L: G6 p8 q; g5 k% T - (set_tile_handle)
& T( R- L: F; @' y( `+ T1 z/ h/ ?. G - ;; Define action for tiles1 }% D9 d( i( ?6 c; j
- (set_action_tiles)
1 ]7 `& a: ]) d% o" K - (setq dialog-state (start_dialog))
- v+ ~, K% y- ^! Y1 Z2 |" a - (if (= dialog-state 0)
1 S8 ]4 T$ v3 `& P3 ^7 M5 { - (reset)9 R5 u, f. c& C
- )
& O5 m R) a7 W0 D; z$ P1 y8 i }9 G - (if (= dialog-state 1)
. M" Q* N- d* {& ^3 C0 f, ~0 d6 R - (modify_body)
! e* g$ Y O1 h+ l# {: G) j( O - ), \" c1 a" d% Z1 N3 }
- )# w6 |9 R. h2 m1 _" i k
- ;;
6 k r& x8 {$ d( r1 [8 H) u - ;; Modify CIRCLE
8 w9 l1 S, K! S& A( f$ U - ;;
3 y$ J4 O5 v& y - (defun modify_circle ()
}8 \3 j9 o, _1 [ - (modify_properties)% q3 w) U4 x* g5 z6 I
- (setq pt1 (list x1 y1 z1))
1 ^( n, [" @4 T5 t* o' h2 S - (tempmod pt1 10 1)) q$ X( r+ y. p/ v& D" [ I4 o1 P
- (tempmod radius 40 nil)
# ~! X& _4 W+ G* Y+ ]# p7 o - (entmod elist)/ \8 r ^9 h. D
- )
2 K: j) H* Z) h! Q, L: s9 c
9 l6 _% s/ `0 Y+ C9 ?) }- (defun ddcircle ()- }7 g4 ?) B+ H& i4 B5 T
- (if (not (new_dialog "ddcircle" dcl_id)) (exit))
* j. _' z' |- j' p: F5 ]/ F" K - ;; Set initial tile values4 a8 T8 U7 b* B5 ~$ s0 V* v
- (set_tile_props)
; I5 n9 O: M- `) D; b6 \7 s2 H - (set_tile_handle)
7 w' H6 _0 n# i) K& y! l - (set_tile_pt1 1)
1 `. g4 s: t+ g% A# ?, m - (set_tile_rad)6 M# O; d) s! [* |, Y
- (cir_calc)
! @& G {! `& [. x8 ~5 p - ;; Define action for tiles: B! N3 `6 m# V/ O! K# j' p" t
- (set_action_tiles)' x$ C" ^4 X3 Q+ @
- (set_tile_pt1 1)
8 M. P. f) S! I! d1 e - (setq dialog-state (start_dialog))
' i' k( W7 D& e* i. d) x2 K$ O7 t - (if (= dialog-state 0)& a; ^, V( B7 O% t0 }0 C) G! N
- (reset)
& f2 d9 c& ^' o& G - )' ^9 L# b8 n, {( z: m. r' v# P
- (if (= dialog-state 1)
& n! a% W* P$ I; J3 {2 \ - (modify_circle)
: j* F" k6 f7 D0 d) u: m - )5 j/ J" K3 n& y; V2 W" G; g
- (if (= dialog-state 3) L% G0 d* Y# V8 u: z9 C
- (progn
5 W' `, q) `) o+ { - (modify_circle)& s- Q4 N) F# }
- (setq pt1 (getpoint (list x1 y1 z1) "\nCenter point: "))9 r2 C/ e: N$ s7 L$ T9 P! P
- (ver_pt1 1)
) F0 o2 m5 z1 U7 n( D - (ddcircle)( w, N: _: u3 X
- )9 U' s; a ]0 ]% A( A
- )
8 s- h' y3 F4 F; ] - )
. }8 W4 e. x, D - ;;# N" K0 u6 U+ Z" @1 d9 W) R
- ;; Modify ARC' f$ n2 Q2 R0 c* ~! C
- ;;
0 k7 K- I: ]+ c2 [2 @ - (defun modify_arc ()
* U7 T9 x. |& @3 b$ i7 c5 ^ - (modify_properties)
* G* m% r2 n1 t d - (setq pt1 (list x1 y1 z1))
1 z, Q8 R- O6 k+ p$ V9 h - (tempmod pt1 10 1)
2 r/ r( ~+ E8 k2 J9 L - (tempmod radius 40 nil)+ A. K) ^2 L" Y4 Z& O
- (tempmod st_ang 50 nil)/ P4 t' k5 Z' z# e6 a
- (tempmod end_ang 51 nil)+ X6 h) o* d0 {, z2 G2 i$ n3 f& L
- (entmod elist)' G' Q7 s0 g* b8 I8 n; n9 ?
- )& N. B& N4 b; R( V8 Y
- (defun ddarc ()
3 K. {0 L8 y0 b - (if (not (new_dialog "ddarc" dcl_id)) (exit)): N8 f# N ]! [$ u) i
- ;; Set initial tile values4 |& w8 c& D: N* _) }# U+ r
- (set_tile_props)$ y1 g% N, |, d4 E7 A6 Q0 L
- (set_tile_handle)
, M' x1 @9 G1 N2 I: ~ - (set_tile_pt1 1)! M5 ^" R' W& h. J2 }
- (set_tile_rad)8 S( B9 S" r: q ^% v2 v# W6 }
- (set_tile_stang)3 f% x& O. ~! Q. _. i
- (set_tile_endang)
: f7 \9 G4 s2 E; p0 c - (arc_calc)
1 M) h a4 C! o9 I% x - ;; Define action for tiles
6 B) I1 t$ ^% {" c. a0 G - (set_action_tiles)
0 H1 `" t+ q1 z. F5 K& h - (setq dialog-state (start_dialog))
$ E9 e6 y, V3 R7 A0 ]0 h7 q- f - (if (= dialog-state 0)9 T' T ~& f" D
- (reset)* t6 Y9 i3 a( z/ _' r) n
- )" }! @, l. C" |5 L v- F: W# A
- (if (= dialog-state 1)% w8 h7 f/ k# \! n2 |& ^
- (modify_arc)
' _5 s' [' O0 P - )
/ I5 H; i5 A6 \# q* C - (if (= dialog-state 3)# B# B, b8 o, H( k! Y
- (progn4 s; [; f7 |; `. u
- (modify_arc)- ~7 m( a2 ?6 K2 Q! F
- (setq pt1 (getpoint (list x1 y1 z1) "\nCenter point: "))
8 N4 q; O3 G' i, V# c8 O1 V5 P# V/ i - (ver_pt1 1)
% w: c y6 @1 @5 N% H. Y - (ddarc)" N2 [& G; Y0 B; R
- )
& }/ c9 U8 J) C: v - )
, h% B- y) `, e" g4 E8 ^% _ - )
% ~" f& L. {4 Y W& F1 ^ - ;;' ^6 L6 b+ C: Y6 ?! B# k8 V8 d
- ;; Modify SOLID or TRACE
# j- Q8 @! Q! o+ }. d - ;; Note the Z value of the object is determined by the Z value of the fourth5 J4 y% |# C: }* Y* Y
- ;; point - code 13. Changing the point values of a solid or trace from a UCS' e- o* M* H% G8 ~5 z
- ;; that is nonplanar to the UCS the object was created may confuse the user.! n* Q9 @: r$ ^* Z3 X" @
- (defun modify_solid ()/ o0 k$ b' g" a, f X
- (modify_properties), W$ n( O# Y# @3 {6 ^8 {# W
- (setq pt1 (list x1 y1 z4))
" z' D6 ~( |, U* A7 _$ V - (setq pt2 (list x2 y2 z4))
8 G4 Z& K1 f+ s, S0 p2 U* @ - (setq pt3 (list x3 y3 z4))
+ i8 k* [$ x9 t; l$ D n/ r - (setq pt4 (list x4 y4 z4))
* c9 j5 b* ]" S; n$ T3 n - (tempmod pt1 10 1)* q7 q0 n- O- ? i' W+ `
- (tempmod pt2 11 1)
: ^, f0 Z) u2 o h, j- k4 Q - (tempmod pt3 12 1)# C7 O7 M7 k( U
- (tempmod pt4 13 1)
+ I, m* h* e2 I6 Z - (entmod elist)0 ~% q0 Q1 W+ o# Z) m- L
- )! l7 }8 g% @6 p) F3 l3 g* r
- , ~: \ V, P# c9 v
- (defun ddsolid ()
1 _3 ~0 _- B/ B0 w - (if (= etype "SOLID")
, n' Q4 S y4 _) A$ I - (if (not (new_dialog "ddsolid" dcl_id)) (exit))
4 H7 q6 _' o6 h, k - (if (not (new_dialog "ddtrace" dcl_id)) (exit))
) F! I# c! a7 f - )( V8 G6 X$ C q5 K
- ;; Set initial tile values$ [* @" c+ Z* @7 o- T
- (set_tile_props)
/ H0 m9 |- T1 k# N8 K5 y1 F0 X - (set_tile_handle)
1 H7 E- T7 C" @8 Z g+ @. ^+ l1 N7 T - (set_tile_pt1 1). @$ w- i6 v: |8 ~
- (set_tile_pt2 1)
4 n2 P3 t3 `" h$ {' ]% \" r - (set_tile_pt3 1)7 v8 n# s, p) m' I# f$ k e, ]/ o& U
- (set_tile_pt4 1)
. N. U9 O! c1 | ` c/ x. G; o - ;; Define action for tiles
0 {6 P9 ?* N# X0 }3 v - (set_action_tiles)% b* z& S, f/ J: R+ C- m
- (setq dialog-state (start_dialog))' Y1 O- A$ ?# f# D5 m/ r, P( u
- (if (= dialog-state 0)( t& D9 l j' G. r
- (reset)" V1 i* c/ h2 V9 J
- )! D2 m, ^, m. w- P( |. C. _
- (if (= dialog-state 1)
& @* R; s# v7 M. U$ f - (modify_solid)5 S. y& q1 W& f, g
- ), m3 P1 ^" G& q! z, i
- (if (= dialog-state 3)7 a! }& t; i2 S
- (progn; @. [) }# b) [* h
- (modify_solid)
2 m8 i$ b9 Z% E2 G- {. S - (setq pt1 (getpoint (list x1 y1 z1) "\nFirst point: "))
/ d1 B/ h- o( ] D# S - (ver_pt1 1)
% S# I* R/ z" ~ - (ddsolid)
1 @0 W/ `) `" D; e8 s3 c9 q - )
/ u9 R2 H T. q* M* \# \( w. l - )
% |! x2 l4 \- E0 e - (if (= dialog-state 4)5 _, P7 N v# v, U9 [; r
- (progn/ J1 J4 i# t$ y* k; h# [
- (modify_solid)
1 f7 h" [# \; {' i - (entmod elist)
. ]8 `3 P& M( f9 B3 C - (setq pt2 (getpoint (list x2 y2 z2) "\nSecond point: "))
' s- [4 i# q7 r+ G3 e - (ver_pt2 1)
; X! j7 H, P% o5 j: ~ - (ddsolid)
$ t( R* f7 E' A9 u& U6 G - )
A0 o- M; a# Q - )
, n# e# q8 l! V, S/ k0 f/ ^" ]4 W5 B - (if (= dialog-state 5)
% h- V- m0 C3 ~) v( N$ f1 S$ E - (progn
7 S. r, h: h/ e' x - (modify_solid)
4 w( J4 {6 p& q; @1 n% p) ^ - (setq pt3 (getpoint (list x3 y3 z3) "\nThird point: "))
+ T8 V+ X: W% Q - (ver_pt3 1)3 `/ `$ t) a2 A9 Q# g
- (ddsolid)% A8 J5 Q/ L* s# \ _" ]
- ) a' R' C8 v7 u' I+ |: }
- ): ?" ^8 N2 T, i+ L, S ~7 P
- (if (= dialog-state 6)6 o3 u. `9 c# b2 q6 P+ u" @
- (progn
7 }3 Z6 I$ ]* u+ }8 E - (modify_solid)7 E& m$ w5 J8 H% m
- (setq pt4 (getpoint (list x4 y4 z4) "\nFourth point: "))
' B. z8 {1 z7 u3 G8 P5 J - (ver_pt4 1)2 f3 o( h' R `' q( G) N7 r! {
- (ddsolid): U( l! q" d8 r4 G, ?- [. x7 U4 [+ w
- )8 R, E/ r; q% h4 H; b
- )
- G2 {& U! Q# I2 S* ?3 x - )
n0 P0 @& z3 Y/ X; V3 e% d - ;;
- j, R( u# `+ j2 O- ^6 _ - ;; Modify 3DFACE
# Y$ }5 h+ L# y2 |8 ^; _& `7 \9 C - ;;
7 _/ r" d/ F5 I9 T6 t6 j; K - ;; Check visibility of edges
1 ^% o! Z, c2 w1 o - ;;
5 n8 _# ], R" t - (defun edgetest (/ bit1 bit2 bit3 bit4)& a7 u/ ]0 w! b' Q* V. D, i
- (if (= edge1 "1") (setq bit1 0) (setq bit1 1))
$ I* v5 I8 w3 t - (if (= edge2 "1") (setq bit2 0) (setq bit2 2))
0 K9 T9 P6 L0 A3 @3 f+ X - (if (= edge3 "1") (setq bit3 0) (setq bit3 4))' H# { ^! @ W5 s w
- (if (= edge4 "1") (setq bit4 0) (setq bit4 8))' u# P1 Z- R R; B5 W$ K* l
- (+ bit1 bit2 bit3 bit4), ^6 X) W/ Q9 W0 I6 |5 a2 u
- )7 }, X, `! G0 {- [ x
+ o& d. E2 }- I+ M; C a/ f: A- (defun modify_3dface ()
+ o6 f# |$ g* h: h s# \5 W% K - (modify_properties)* |3 t, ]1 `5 U% x
- (setq pt1 (list x1 y1 z1))2 x0 D% I2 b9 v' Y2 R$ H
- (setq pt2 (list x2 y2 z2))1 O: L9 \" q8 W6 h8 |; r
- (setq pt3 (list x3 y3 z3))
; S4 c6 l, w/ ]# g+ J - (setq pt4 (list x4 y4 z4))
2 H$ k4 `$ n+ C/ n+ z - (tempmod pt1 10 0)
' t; H6 @* A' K6 G' w - (tempmod pt2 11 0)
. v- M- \2 Y- p* l2 W) }: o0 I - (tempmod pt3 12 0)
6 O7 j {6 Y6 G: e# e& P/ k - (tempmod pt4 13 0)
5 F0 u: O2 }7 a: k, [- j - (tempmod (edgetest) 70 nil): H4 T+ B* w- E# e8 U% ^" t8 S
- (entmod elist)8 Q5 j8 L: i h" i/ [7 o
- )6 U. _4 f9 w' S. s' n4 E _
- 1 y4 ]- R: ?/ |
- (defun dd3dface ()
! N: \: y- P9 D" y: l - (if (not (new_dialog "dd3dface" dcl_id)) (exit))
1 V+ Q, s) J% Y: M8 N1 Q - (set_tile_props)
( z( N! w' Q# B" f9 B - (set_tile_handle)
& e/ _# O( }( k - (set_tile_pt1 0)
0 a l. e+ }* Z0 l. t9 Z5 B - (set_tile_pt2 0)9 N8 g1 Z0 j( _2 v* J
- (set_tile_pt3 0)
' L* P3 O; s n+ ~' q$ [$ ? - (set_tile_pt4 0)0 r9 X _& N5 M( E
- (set_tile_edges)
w1 e! ~5 {5 K4 L/ w - ;; Define action for tiles
* P/ |3 v& Y; l3 g8 m; r - (set_action_tiles)0 p; a5 e2 J/ c; m
- (setq dialog-state (start_dialog)): P+ s# U8 e" f" G% l9 _( j/ P+ H+ v
- (if (= dialog-state 0)
: K& N/ D- j8 s' z0 s I1 s - (reset)- H) D4 S5 m& b" p$ q ?) H
- )" C" m1 I9 {6 ~% k y
- (if (= dialog-state 1)& m H7 j4 U; B8 P/ h7 N4 U
- (modify_3dface)
- P( `+ o/ W8 g - )3 i) V4 Z: f3 S' {( Z% i1 |
- (if (= dialog-state 3)6 p. B+ \5 ?7 b \( Z
- (progn2 w2 A) k$ |* g
- (modify_3dface)0 Q1 t3 |- R. m# w1 e
- (setq pt1 (getpoint (list x1 y1 z1) "\nFirst pt: "))8 _1 J, }! p+ v- F( }
- (ver_pt1 0)3 z+ q$ o5 I4 B0 q2 Y7 f3 ^
- (dd3dface)
8 s) t) A3 A' [' Y& q+ d ^0 A - )
6 R! P$ o; U1 A" W' O% d( @ - )3 _9 @8 D9 {7 m7 Q2 e' U
- (if (= dialog-state 4) y& [4 ]& l5 j+ p; S& b8 v! Z
- (progn
% g. G# u3 U Y, m- {0 L j - (modify_3dface)/ p' P( F3 A) g! t `0 E% w1 j4 ~
- (setq pt2 (getpoint (list x2 y2 z2) "\nSecond point: ")). R( W" }+ [9 R7 W3 y. F* z# m
- (ver_pt2 0)
4 O7 T* a2 H- o& r8 X+ o- Z - (dd3dface)
* @! ?5 n' g( x - )+ x2 t' y9 k: D2 Y' w; G
- )
! {4 X6 C+ u; j6 J - (if (= dialog-state 5)
$ B w! s# i) \- N; U - (progn
7 n: a0 o# F7 m: w - (modify_3dface): ~9 v; q0 ^6 M8 Z: x8 l
- (setq pt3 (getpoint (list x3 y3 z3) "\nThird point: "))
9 G/ [6 t* B6 `8 q+ X7 w& X - (ver_pt3 0)
R$ P$ K/ }4 Z% A: R# i - (dd3dface)
9 i- G( _& T" R, a - )
: Q4 |: P% j+ Q5 u7 ]. \ - )
+ F# W, w: ?. D% ]) _ - (if (= dialog-state 6)
* p! }9 ^. \+ a - (progn# [5 @% q, O T
- (modify_3dface)
4 e7 v7 N9 Z$ _ - (setq pt4 (getpoint (list x4 y4 z4) "\nFourth point: "))
/ ^! @6 K& t. o( ]8 i D - (ver_pt4 0)9 d Z* p( A5 F
- (dd3dface)
& C, Q* h2 P* O! y - )7 \/ \5 U9 Q; w
- ) E" W" J, R L) O8 X) L- g
- )
: g3 F* T- F& o& G! A9 [7 l - , O8 m' y2 O# g* @$ {
- ;;" E5 h2 c2 L1 W6 U2 e1 e* L- ^
- ;; Image functions. {7 J7 z+ e; \) }- ]( J" g
- ;;
1 O, J, O4 }; E2 r1 p8 R - (defun image_scale (/ upixel en n userscale temp)' j" x# Y/ a) R* K5 y3 P6 v
- ;; Calculate the size of an image pixel in AutoCAD units5 L- E# D. |0 Z! ]
- (setq upixel (distance '(0 0 0) (cdr (assoc 11 elist))))
1 |* L. F+ ?5 E. P. L
7 c/ k8 H4 }; d3 m3 @- ;; Retrieve the user scale
6 f: h% }3 R1 J, F3 \ - (setq en (dictsearch (namedobjdict) "ACAD_IMAGE_VARS"))
6 Z" v; e5 {" \+ L! P - : ?+ q9 `% l/ A. @
- ;; Next, extract the image units and pixel resolution2 G" t1 @/ s' t# ]
- (if (or (= 0 (cdr (assoc 281 image:olist))) (= 0 (cdr (assoc 72 en))))
- B& f! R6 Q; o! B1 L) ~$ M' ~2 P& i' Z/ i - (setq image:scale (* (cadr (assoc 13 elist)) upixel))+ ~0 G) @2 `6 a, J7 A" g" }
- (progn
6 X3 T; ]8 [0 x5 a+ D( O. E5 ~; I - ;; Convert the user scale to the proper word
. |8 n4 x6 T2 v! D - (setq n (cdr (assoc 72 en)))" o5 v g& V2 u, P1 [5 B
- (setq temp (getvar "LUNITS"))
$ a% D! k9 M3 Z% P! x: M' A - (if (and (/= n 0) (or (= temp 3) (= temp 4))) (setq n 5))3 o8 b* _( c* U$ t) E$ U
- (if (= n 1) (setq userscale "Millimeter"))& J. R: c+ H/ N4 y+ k7 F
- (if (= n 2) (setq userscale "Centimeter"))
S3 o4 N4 a1 [8 e - (if (= n 3) (setq userscale "Meter"))
3 Q) Z6 k) f% ] - (if (= n 4) (setq userscale "Kilometer"))& c5 I5 ^! h5 W0 H3 l
- (if (= n 5) (setq userscale "Inch"))$ p5 w" X$ m0 d1 k4 ~$ ~9 W) e
- (if (= n 6) (setq userscale "Foot"))
+ u6 Y! ]/ K' m" b9 } - (if (= n 7) (setq userscale "Yard"))+ V) c7 D0 \$ a/ t+ M1 V" h7 u
- (if (= n 8) (setq userscale "Mile"))- f7 F- H; ~" P8 E
- (setq image:scale (/ upixel (cvunit 1 "Millimeter" userscale) (cadr (assoc 11 image:olist))))
8 l5 O& c' P( c% e! a - )
. \+ E k# ]! Q" N - )
" S4 M0 o6 |1 @' N - )
' N: r% h* }- c2 P/ w, Q - , t) M3 N+ p* c Z
- ;;
) _+ u% J% n1 Q( B) J - ;; Scale factors for block insertions
9 O+ l h8 {2 F* A8 m; U4 w - ;;
9 X+ d+ t7 @# J - (defun image_set_tile_scale (/ temp)
& }+ I! M+ _4 o9 @7 p - (setq temp (getvar "LUNITS")): E2 W4 X W- Y* j: B1 R$ p0 p3 v
- (setvar "LUNITS" 2)9 _$ l) D2 w8 T+ {, G! j
- (set_tile "xscale" (ai_rtos (* image:scale image:mult)))
0 k) `7 u2 Y- }3 g8 U" ~ - (set_tile "wid" (ai_rtos (* image:width image:mult)))
) {- V) r. \0 o u7 e% L# i# d - (set_tile "hght" (ai_rtos (* image:height image:mult)))
( E8 M: u' [5 n% N - (setvar "LUNITS" temp)" w, P$ @4 F6 r: @- A+ ]
- )- ?8 a8 N6 s- `
# U( F$ T3 i, k6 z6 n( @- ;;
: _7 j- ?" I* ^" y - ;; Set the scale, width and height values appropriately.. I3 u" [6 U4 B+ d
- ;;
- K, K& k$ }3 |' L - (defun image_update (field value / orig_value new_value mult)% ^$ u X4 d6 ?7 y Y! q
- (if (= field "xscale")
* U5 Y- J- l: A M+ x, s - (setq orig_value image:scale)8 v$ y. G2 U/ t1 \# ~
- )! f" S9 j0 j U; i
- (if (= field "wid")$ {; b+ K+ Y* N
- (setq orig_value image:width)
x; l% p% i5 |- s" J* ^ - ) L7 Y0 T Y7 L/ F8 W
- (if (= field "hght")
, c1 F1 [ d/ i1 M2 [ - (setq orig_value image:height)
; F, e$ X9 j2 k- @$ J - )7 [, s; L- H3 `5 T
- (setq new_value (verify_d field value (* image:mult orig_value))), P. P3 U. D, [* L- u: G
- (if (/= new_value old_value)) L, `' ^& H$ v8 p1 i/ j8 J
- ;; Make sure the user has entered a sufficiently large value6 G; z. h: P7 N7 A- y& ?, D* v
- (if new_value
0 D1 e. f) m X2 L - (progn; R5 b8 E9 n& m# b% T/ `$ i/ |
- (if (< new_value 1e-8); Z3 q# J# j8 ^
- (setq mult image:mult)- E4 F/ a1 B% ^% W- `
- (setq mult (/ new_value orig_value)): X- a. X4 w# e1 P) O g
- )9 G3 [+ N* Y# x, ^% n) o3 y
- (setq image:mult mult)
- a) U& H) k* W - (image_set_tile_scale)
9 s6 j9 R/ P9 j5 v1 u) z - )/ B2 W/ d. S& O
- )* y, L5 J. V4 ~# M! V9 S0 e4 V( d
- )& s. U ]" ~$ t) P
- )7 ]/ g* T0 i9 B
4 k, c# e6 x, d( d& L- (defun image_disp_opt (bit)# \& ]; A4 ~2 U3 U
- (setq image:options (Boole 6 image:options bit))
! ~- y$ j& k( ` - )# P, a* C$ j. \- P4 q7 t
9 O9 [5 E* z9 ^( @; U# p# I4 N6 l8 r- (defun image_modify ()/ c, q: [/ x" ~) `1 k; L I, O
- (modify_properties)
+ ?% ]- ?5 W" k/ Y2 V - (setq pt1 (list x1 y1 z1))
- m8 f) Q; x6 u2 ^1 {6 f2 j N - (tempmod pt1 10 0)2 t# d$ e- x1 ^. C
- (entmod elist)
: E4 ?' f# P( v% U - )
2 o2 m4 `1 t5 d% \( H3 f+ Z
" }0 C% {* l: n7 a( z% G9 L! R- (defun image_clean_variables ()
' c! {. j: {% o w- L H$ h3 g7 d - ;; Clean up global variables used here1 A Y1 z3 I* N, W: Z4 t
- (setq image:scale nil)
* O _/ P2 _6 F* y1 b) ^% r. O - (setq image:angle nil)9 k# S' G: M& d9 p2 f6 i _
- (setq image:width nil)
" r7 \ D5 e, G7 Q1 |# ~ - (setq image:height nil) x2 E. l5 x% M6 a
- (setq image:options nil)) e2 q* L+ x; A4 {6 K
- (setq image:oname nil)
1 o9 l& U" ] `6 j! M2 B6 m - (setq image:olist nil): s) F0 \7 O# \% f; O( h
- (setq image:mult nil)
4 v$ }$ G" S+ t) ?9 a - (setq st_ang nil)' ?, m, T6 T$ a* L
- )
% J3 X' l& I+ i' f$ D0 E5 V - H0 R* m7 g7 o& L5 \$ G: D
- (defun image_scale_vector (v1 value)8 X2 w, d4 A7 D6 e0 z, I. c0 r/ M
- (list (* (car v1) value) (* (cadr v1) value) (* (last v1) value))- R1 ]8 y4 X; s+ O9 {
- )
# A c {- Q& z3 L% t6 Q
; v) V9 d' S' p; a( U- ]- (defun image_cross_product (v1 v2 / vx vy vz)
+ S m9 ?3 f+ r! { - (setq vx (- (* (cadr v1) (last v2)) (* (cadr v2) (last v1))))
j" u* t" Z ^8 r - (setq vy (- (* (car v2) (last v1)) (* (car v1) (last v2))))
5 d" b) F0 B/ A& O - (setq vz (- (* (car v1) (cadr v2)) (* (car v2) (cadr v1))))( }, F( V9 i$ K; M( r+ R
- (list vx vy vz)$ w3 q- W! }% ^/ c- [( t
- )$ O$ F/ {6 f2 H% ]9 V
- 6 j; F8 A7 x% G- B1 Q
- (defun image_dot_product (v1 v2); q) i" m# K# u+ z
- (+ (* (car v1) (car v2)) (* (cadr v1) (cadr v2)) (* (last v1) (last v2)))
, R5 K( O# H$ J% `8 e& C5 P$ n - ) Z i/ v4 v# }% [' y# z
4 D( v2 T: U1 K- (defun image_add_vector (v1 v2)
( o4 ~0 J& y- [0 } - (list (+ (car v1) (car v2)) (+ (cadr v1) (cadr v2)) (+ (last v1) (last v2)))
, }! c6 j5 m1 X) R0 E4 D( W* B8 x8 W - )
* I1 ]" K+ k/ ~" ^. _5 Z" z
, o: C% i) ^" H; H& D. Q( D% A- (defun image_subtract_vector (v1 v2)
$ b5 T4 X: L/ ?# Q4 U+ S& H - (list (- (car v1) (car v2)) (- (cadr v1) (cadr v2)) (- (last v1) (last v2)))
0 G) G! O' l5 p - )% _- k/ U# I$ _8 r' Y' Q8 \
2 l3 Y3 }, D! A& j2 G( q0 Y6 u- (defun image_normalize_vector (v1)6 ?* w$ H+ W' V# t0 t# F
- (image_scale_vector v1 (/ 1. (sqrt (image_dot_product v1 v1))))
, g: ~* b8 b! e$ D' [# S% P- k6 b - )
3 l& L# I9 r# E2 W7 @3 O
+ \7 H- U. e, w- (defun image_rotate_vector (vector angle axis / along_axis axis_x_in_rot_plane axis_y_in_rot_plane in_rot_plane)
! P4 N* E; j+ Z; l% u4 L' ?; u - ;; Normalize the axis2 L3 }) f4 F* q9 e
- (setq axis (image_normalize_vector axis))
/ @$ ^0 `$ `6 j( h - (setq along_axis (image_scale_vector axis (image_dot_product vector axis))). }9 k: K, J/ l; D
- (setq axis_x_in_rot_plane (image_subtract_vector vector along_axis))
6 n9 W' r( W$ Y8 ? - (setq axis_y_in_rot_plane (image_cross_product axis axis_x_in_rot_plane))
3 C k' @. P8 y( W" Y w - (setq in_rot_plane: ]1 s6 ^3 c; `) e c
- (image_add_vector: P0 k1 a$ [8 O; n' ]% q
- (image_scale_vector axis_x_in_rot_plane (cos angle))
1 p% A& N( `+ O9 E. f0 w - (image_scale_vector axis_y_in_rot_plane (sin angle))
% Z8 J4 F: j r7 [* y - )
- U. D$ U* G& Z3 c - )6 j. b2 n2 x1 O/ H, q* T3 g4 m
- (image_add_vector along_axis in_rot_plane)
$ s1 T: m! v0 K - )% V; ~. m' s. D. P$ K( s
- , L3 e3 z* w1 x/ r
- ;;, ]4 o' G1 O$ M$ g0 N5 N/ V6 {
- ;; Calculate current rotation angle if appropriate.
* w9 ]5 z0 S) K+ ], t( n - ;; If not, grey out the rotation field.# r }% i* K' m% N3 M! `
- ;;0 i" r5 n3 ?* q' u" J
- (defun image_rotation (/ normal rlength zlength sqrt_tolerance)" H3 b" c6 _/ c9 g3 ~
- ;; Determine if image normal is codirectional with
4 u. h. f) J& T7 i0 X* @ - ;; the current UCS Z-vector.7 _" ^2 L. |9 q( Z6 i
- ;;3 [2 ]1 O- r r% F4 c7 F
- (setq normal (trans (image_normalize_vector (image_cross_product (cdr (assoc 11 elist)) (cdr (assoc 12 elist)))) 0 1 1))- O" l0 a& P! M
- (setq rlength (+ (* (car normal) (car normal)) (* (cadr normal) (cadr normal))))
/ l( {2 [3 w( h - (setq zlength (* (last normal) (last normal)))
+ r+ i o* s8 H' `4 v9 o$ b. O - ;; Note that the value .0001 in the radians is approximately 0.0057 degrees.
/ Y: v) P7 E$ v5 l1 I' ^6 p& q - ;;% o4 Z& D; n2 {& B+ f
- ;; cos(.0001)^2
' c, r+ _% q6 k4 `4 O2 }8 ~* p - ;; Tolerance = --------------$ Q# e3 k5 H+ L, t$ a& u
- ;; sin(.0001)^26 G0 y7 p( p/ B! R( P
- ;;
_: ?) I# _' e% x4 H2 U4 e) W - (setq sqrt_tolerance (/ (cos 0.0001) (sin 0.0001)))8 Q* O7 ]/ x- J2 Q. m2 r
- (if (and (< (* rlength sqrt_tolerance sqrt_tolerance) zlength) (> (last normal) 0))
6 K% {7 @6 r) V8 h, a2 b7 u - (setq image:angle (angle '(0 0 0) (trans (cdr (assoc 11 elist)) 0 1 1)))
2 W3 y- b4 V+ e0 r2 G - (progn
3 S9 J! [/ N( `! a$ ]) @$ v$ C - (mode_tile "st_ang" 1)
) e1 L! A1 w9 I0 R. k! \4 x - (setq image:angle 0)
k( ^) \" B& m9 ` - )
5 F' H, S; f( g" q. f0 ]' | - )
2 W3 Q2 _. F4 l( ^ - )
0 q$ a, h$ x- Z" [0 r6 j- F4 L - " Q8 S& d- I$ d t* x
- ;;
; ?. x* F* | o; X( t! E* K$ d - ;; Modify Image' r& y, f! z( [% ^9 Q+ f
- ;;
! |- H5 K) Q; _2 F - (defun modify_image (/ u_vector v_vector z_vector)
5 h2 s) ~# q, v, p5 B* X - (modify_properties)6 A- ~- L$ m5 D2 G6 `
- (setq pt1 (list x1 y1 z1))
& {3 o$ X7 Y; T% z( E [! y - (tempmod pt1 10 0); c+ Y* g" A5 s) ]0 U6 H: c* `, f
- ;; Make display option changes to image
: m6 C8 y6 X$ N6 t# ^- h" L - (emod image:options 70)
- I3 X1 y5 H4 d ] - ;; Get the u and v vectors N2 l" L4 w' Z: e# |: H
- (setq u_vector (cdr (assoc 11 elist))): c8 V& w+ D; r4 c$ v' K: k1 V
- (setq v_vector (cdr (assoc 12 elist)))
$ p* p/ V8 E& e( a* r1 i
2 F w! S, I* b5 t( ^- ;; Make scale changes to the vectors {. A! r1 c0 r$ ?1 i7 x1 {$ T
- (if (/= image:mult 1)' R+ r7 F2 Y8 j
- (progn
& E" k$ @8 z# y7 @. o7 Y- R( h - (setq u_vector (image_scale_vector u_vector image:mult))
& }3 s) p- ?6 H S0 O - (setq v_vector (image_scale_vector v_vector image:mult))
* U5 s, l7 q) p1 U8 J @ - )# Z. I9 c+ N M4 C/ ^, u5 x* c
- )
5 ?5 I0 J; C/ T4 H2 g* G - ;; Rotate the vectors
. E" ^6 s/ D9 {' d4 B- T* z. U" m: J - (setq st_ang (- st_ang image:angle))' u- f. E' w& A& G9 E% E
- (if (/= st_ang 0)1 f* |* y" g+ J+ _# q
- (progn
: d% n( m5 C. c9 K - (setq z_vector
" \7 b( M+ }+ c8 J - (image_cross_product
5 D* w% i4 t: | K: p! _ - (image_normalize_vector u_vector)8 P( B! Z5 N- `: Z! l9 V9 r7 c
- (image_normalize_vector v_vector)
! e1 Z/ y: @# i4 Y - )8 A, L p1 j4 S% r7 {8 R& L+ y
- )
$ N6 m6 V5 @9 i" r - (setq u_vector (image_rotate_vector u_vector st_ang z_vector))
" K* U/ k4 Y- ~, j, a% w - (setq v_vector (image_rotate_vector v_vector st_ang z_vector))
, |) ^+ `- v1 k! W9 M2 W - )) ?' o4 [6 V; E# _5 x5 z: U
- )
4 ^% ~# ~9 J2 G: G. R# Y - (emod u_vector 11)* @7 x6 L" Q- }2 k( B( Q) r* _
- (emod v_vector 12)8 b* v+ J% `+ Z
- (entmod elist)0 l% }/ a' R T( o) Z& Y: B
- )3 s5 r* v q6 a4 M( y k
; o0 m% R' P' c2 n \% ?. r- ;;
u: d4 w& U8 j1 ?5 w) ^ I' p4 O - ;; Run imageadjust on given entity, working around possible
' g; q+ A7 L) N! [5 o) E6 F - ;; re-entrancy problems7 }% T$ A8 {1 l3 w# ]: \/ K
- ;;' M0 i" ^. m( f( o" w. j3 p8 z
- (defun image_adjust (ename)1 d$ C4 A. e& r3 n+ N0 e
- (verify_arxapp_loaded "ism.arx") ;; make sure it's loaded...* A: p' j% u5 L
- (imageadjust ename)
( F/ \8 O( v% q2 v! ]1 `, i1 y$ { - )5 K7 c5 {* p `
- - E3 v* u- J% f' Y& [
- (defun ddimage ()
% V% G8 W7 }. X% ] - (if (not (new_dialog "ddimage" dcl_id)) (exit))
" F' U W$ S% ^: G
* W8 k+ }- A, e& J: p- ;; Grey out the thickness field.
" t4 ]9 l, r e9 x - (mode_tile "b_thickness" 1)
- s$ F8 `' ^4 e7 e1 ` - (mode_tile "eb_thickness" 1)
3 f6 g+ p. {+ x( R$ x2 @% g: f: s
. C$ l6 x3 k% V/ I* p/ x- ;; Get the associated def object.
6 o' s) h9 `8 o L! t5 ]& B! Z - (setq image:oname (cdr (assoc 340 elist)))( L2 m# s5 s! y6 S3 E5 O# l
- (setq image:olist (entget image:oname))
3 h/ O0 G* L5 U* M1 [* M% g9 I; j - + m, u9 {4 H3 S7 `
- ;; Set initial tile values
! W9 S3 \$ ?( E5 }' k) u - (set_tile_props)
0 f; U1 I7 W* Y7 n: H+ s2 T- Y( P - (set_tile_handle)
# O5 L" J2 h& m, U - (set_tile_pt1 0)$ E/ } p; V7 s3 J
- (setq image:scale (image_scale)), r/ `7 g/ B# u& e# i* _5 w# R
- (setq st_ang (image_rotation))8 M* T5 s1 U, l; Y
- (setq image:width (* (distance '(0 0 0) (cdr (assoc 11 elist))) (cadr (assoc 13 elist))))
( ^# t6 T( X- _. Y+ \2 j" B - (setq image:height (* (distance '(0 0 0) (cdr (assoc 12 elist))) (caddr (assoc 13 elist))))
8 p4 G1 H# X! @ - (setq image:options (cdr (assoc 70 elist)))- g0 ?, G/ h; Z6 m* y x$ `$ I
- ( n, U! A. |3 y
- ;; Record the last multiplier for use in image_update function
2 R7 }0 ?8 E/ S/ F. e! Y - (setq image:mult 1). Y/ b( }2 R$ ]6 @) ~& e
* R8 b. _- D- {- ;; Retrieve the image name7 z; W9 S8 n1 P+ [
- (setq fn (reverse (dictsearch (namedobjdict) "ACAD_IMAGE_DICT")))+ K5 f: J5 \9 z) y' {
- (setq flag 0)
) W ~1 P+ a, K. ^+ w - (foreach n fn
1 \, z* ^2 H: U: l% Y+ s - (if (= flag 1)
: f2 a4 |0 }9 ~" d - (progn
4 w5 F* e& D# M+ X! v* j/ E - ;; Display the image name! `3 n% h7 v8 }2 g
- (set_tile "image_name" (cdr n))- J7 |& u/ g& T& g, h* l
- (setq flag 2)2 P3 G, p) _) m g8 t+ l
- )
: _, B x' H8 G3 s+ F - )3 m% v, _- o5 L) L; J
- (if (= flag 0)
; o5 H; m. }* \+ S0 s; e - (if (equal (cdr n) image:oname) (setq flag 1)): l5 H2 q: Q* `! Q: ^7 x; ~
- )
5 D+ [, e& K. P - )* a" G: C7 _, d
! x9 F8 h8 B" W6 M; B- (set_tile "image_path" (cdr (assoc 1 image:olist)))1 q0 \$ |: p$ ]% {3 f
- (set_tile "st_ang" (ai_angtos image:angle))
7 P5 J6 ?$ F: i4 ] - (image_set_tile_scale)5 y6 R: G2 b/ p3 D/ x
) @( J5 M/ p6 V, o) T" a, S- ;; Check the appropriate boxes0 {8 o5 m0 E- a. W8 a6 `, J5 q( z
- (if (/= (Boole 1 image:options 1) 0) (set_tile "image_show" "1"))
0 s4 a$ C2 d e1 h8 V8 f - (if (/= (Boole 1 image:options 2) 0) (set_tile "image_non_ortho" "1"))
& f& I2 V5 t G$ l( v( r5 @/ F - (if (/= (Boole 1 image:options 4) 0) (set_tile "image_clipped" "1"))
$ c& V, A0 h+ y! {5 h - (if (/= (Boole 1 image:options 8) 0) (set_tile "image_transparency" "1"))
1 M8 ^" w& ?9 P7 r v - 5 b# V9 g: W5 D+ E5 d7 z6 a
- ;; Define action for tiles
% d6 E% Z4 x* ~& X [ - (set_action_tiles)" n! _8 P& }+ w- ^7 B
- (action_tile "xscale" "(image_update \"xscale\" $value)")# T" m9 A+ }( m9 g K' J
- (action_tile "st_ang" "(ver_ang1 $value)")8 j, b; y# g6 H2 W
- (action_tile "wid" "(image_update \"wid\" $value)")
" ~0 [3 O: d& s3 P - (action_tile "hght" "(image_update \"hght\" $value)")$ n& m+ ]6 A) a. w
- (action_tile "image_show" "(image_disp_opt 1)")
+ L8 C. r y Q0 r0 b - (action_tile "image_non_ortho" "(image_disp_opt 2)")9 [3 K" W7 F0 l6 Q8 p9 d
- (action_tile "image_clipped" "(image_disp_opt 4)")
n' V5 l, S4 ~ - (action_tile "image_transparency" "(image_disp_opt 8)")1 U, X# M' f# V2 L
- (action_tile "image_adjust" "(done_dialog 4)")
' A9 W1 o. Q' P3 ~$ l* n+ e" c0 [ - ' y7 ^7 h, r# t* K& v3 @9 H; A# D7 J
- (setq dialog-state (start_dialog))
: T+ X& e) _, Q2 u2 [ - (if (= dialog-state 0)
1 ?5 |5 d* n ?4 V1 P+ Z0 c% G - (progn' x4 H1 u- L& W' h+ ~" o
- (reset)! U7 H' K- C* Y' ?
- (image_clean_variables)
4 m2 \ A# ^% u2 e - )
3 p7 N: `+ \% \- u - )
; r' H2 x! s6 H6 ]8 b) | - (if (= dialog-state 1)
/ b% j: E0 p" K3 a$ X2 N6 C# d* l - (progn9 i) f: L. g) t% f, r0 P
- (modify_image)
" E, ?1 t2 ~7 I! e9 h: o - (image_clean_variables)
# [3 U/ A4 R! w+ o* G - )4 j7 ?" H, ?* v2 l
- )7 j5 S9 k! X w/ q! W
- (if (= dialog-state 3)/ v6 O0 G( h' X
- (progn% d( C" a4 C* D5 L4 q8 {
- (modify_image)
3 l9 r5 }+ j, B) f% S R - (image_clean_variables)
& F2 e4 p% @; E9 D6 U4 e( @0 q$ r - (setq pt1 (getpoint (list x1 y1 z1) "\nNew Insertion Point: "))
; t7 S+ j; ]$ ^9 G5 a4 H; H - (ver_pt1 0)
9 r& l# w+ k# U: Q- A! F0 w2 d3 t* T# D - (ddimage)$ F/ X* W# v3 ?2 E# l
- )' c; ?. S) ^8 V9 @$ `
- )
9 R; H6 {3 L0 a! r' ?+ @* J2 b - (if (= dialog-state 4)
7 }) j5 q& g7 w+ R2 ` - (progn
5 J8 h, s. K! `& c - (modify_image)
( M) U; C2 L- K1 }* d5 x - (image_adjust ename)
- ^- {2 {2 O$ K( D5 C( R g3 x - (setq elist (entget ename))# ~: H/ B- q2 V! q8 F
- (ddimage)
$ G. l# W, _7 d H }6 d0 {( e o2 Y; w - )3 H. e& G( ]) h
- )9 T8 }# s! x6 U3 r" ~7 a3 R
- )
$ ]* k0 m3 {0 Y) C3 e/ J9 T - 6 i/ d8 j- v6 Q) r t
- ;;
$ v, h. ?# D" |5 ? - ;; Modify BLOCK (and its Attributes, if any)2 W0 I3 Z& M5 t( U. B
- ;;
5 p7 c. G% B6 `4 k5 B1 ]# K - (defun modify_block ( / el en2 p1 p2 oldp1 oldp2 new_hgt old_hgt attr0 m. r: s5 w$ |# U
- new_wid old_wid old_rot scaling old_scale
9 \; C; c6 C) H* Y. Q! ^' _% G2 w - xdelta ydelta zdelta xbase ybase zbase ipos)9 D; p8 X8 X3 a& `2 h
- (modify_properties)
9 e% A- x4 V. ]7 E3 @
. p) R( O* a" n. B. }# p/ z7 o6 c- ;; First, translate and scale the Attributes, if there are any.! |( {& r* f/ W
- (setq old_rot (cdr (assoc 50 elist))- N$ ^0 }- w8 Z( d0 ]6 O( W
- old_scale (list (cdr (assoc 41 elist))
* g3 [" g6 L; m, w5 r% j1 _ - (cdr (assoc 42 elist))" R. i8 \; [8 A
- (cdr (assoc 43 elist))0 l& O- E$ b8 ~3 W- ~6 {
- )
1 W+ q) j1 M, p3 ] - scaling (or (/= xscale (car old_scale))+ {% q6 A! C7 {
- (/= yscale (cadr old_scale))
& |6 _5 @$ h/ G5 F - (/= zscale (caddr old_scale)): Y8 M( W h5 _ r+ H
- )+ ]9 l" x, d- h7 |6 c
- attr nil ; No Attributes modified yet- _' `2 o0 L' t
- )) M! B, a7 o4 u. c( k2 K
- (if scaling# j' w' A+ i9 s4 t
- (progn/ R% I' v7 J# g: M8 a( l
- (setq xdelta (/ xscale (car old_scale))& U5 ~* ~7 ~; X. J! V2 C: J
- ydelta (/ yscale (cadr old_scale))
% J! a7 m7 l, z3 e- h9 q6 D/ ?+ s$ g - zdelta (/ zscale (caddr old_scale))# }* R6 [' @+ B1 H
- ipos (cdr (assoc 10 elist))
$ v8 e, U& F+ F6 S$ R - xbase (car ipos)' [" {. T; j, K7 g
- ybase (cadr ipos)9 G1 @5 C3 s2 t9 p# ~, x+ m
- zbase (caddr ipos)
6 D) E% z; P2 ?& S9 ? ] - en2 (entnext ename) ; First Attribute
; q3 i$ D. h! W8 b$ a# d% f% N2 b& ~ - )
* i) F: C5 l0 X! { - 6 p4 k7 H/ c: G7 j( r( K0 m- e0 Q
- ; If the Block is rotated, temporarily un-rotate it, along
3 C9 V* f5 i( ?/ {! `5 J - ; with all its Attributes, so the scaling/translation of the
5 U4 c) r, K2 A' h7 {# F: b - ; Attributes won't have to take the Block rotation into account.
7 I0 s& X. G( s$ Y9 g6 S - (if (/= old_rot 0.0)* i( M/ V% s' I/ K- ^5 s
- (progn" t, z3 e! J% n0 M4 D) v# d9 N
- (command "_rotate" ename "" pt1 (ai_angtos (- old_rot))) s' [# i) E) c7 H' }3 ^
- (setq old_rot 0.0
- ?7 F9 x5 f; S# L! o' N& p - elist (subst (cons 50 0.0) (assoc 50 elist) elist)* l, a: ^5 m% w9 h0 h( b4 {
- )
9 `/ |. i) i! t/ t: P - )/ U% X: z! L# N% Y* }6 ?$ Q3 p; w
- )
7 e4 U! c$ T$ ~ - ( [, }3 Z6 M" j6 U
- (while en2
% V' g% q. k. B: t4 l0 P: m7 k - (setq el (entget en2))
4 N& n" K, t; ^, W* l4 {+ a3 S - (if (= (cdr (assoc 0 el)) "ATTRIB")
4 \$ j! ~' b+ H4 x2 P0 E9 W7 z - (progn k7 g0 h* [& A# Y' W5 f5 j$ Q/ f1 u
- (setq old_hgt (cdr (assoc 40 el)) ; Height
* P* u0 m4 C/ ~1 _7 t - old_wid (cdr (assoc 41 el)) ; Width-factor6 G$ n0 D$ E2 a# I- F
- oldp1 (cdr (assoc 10 el)) ; Generation start point
0 }: z- `5 s. q0 i& G$ U3 @2 _ - oldp2 (cdr (assoc 11 el)) ; Optional alignment pt/ ]' K. ^6 r; z1 B, B5 S6 D8 S) X
- ha (cdr (assoc 72 el)) ; Horizontal alignment! a; D7 M& t% S/ H. z* b( a6 v
- va (cdr (assoc 74 el)) ; Vertical alignment# ^$ s' ~. H6 |* E1 \
- ) q1 | m9 [; x% a) C
- ; Translate gen. start point
) b, X: q/ l0 _! ~, v3 R - p1 (list (+ xbase (* xdelta (- (car oldp1) xbase))). U) _( w. [5 [8 q3 r1 U b2 T
- (+ ybase (* ydelta (- (cadr oldp1) ybase)))3 a8 `+ C4 c' [8 S, W$ V/ ?% J
- (+ zbase (* zdelta (- (caddr oldp1) zbase)))5 l V, ^! \; }1 b5 p
- )
0 d: T% K9 A; j7 ?% q - el (subst (cons 10 p1) (assoc 10 el) el)
7 i" z+ D. F0 w - )
- W @. Z3 _1 k+ g5 n
+ |8 V- z, m/ A* Y. Q# ]3 Z; ^- ; Translate alignment pt similarly, if present and applicable2 Q/ n- D* j. v/ y/ N. ~
- (if (and oldp2 (or (/= ha 0)7 s" o; q* A0 K; L6 I5 u
- (/= va 0)
4 g+ ^% D7 e6 q7 y! e1 ? - )# P0 s$ K$ u! U5 l
- )
0 z/ h9 f1 f9 Y$ `' }9 S$ N' o# F - (setq p2 (list (+ xbase (* xdelta (- (car oldp2) xbase)))
% ^& i& d. \8 @& }- \6 V! N8 I( W% s& ^ - (+ ybase (* ydelta (- (cadr oldp2) ybase)))
5 A1 ]6 w h4 [: x8 p% E* @: k - (+ zbase (* zdelta (- (caddr oldp2) zbase)))
( k8 g3 o) V3 _, n/ I - ) M6 L. \+ }7 e6 e8 n; n) n
- el (subst (cons 11 p2) (assoc 11 el) el); F& _# k3 m% n5 E5 |2 x
- )) e0 {4 }# O3 [: ~8 L# ~8 @! @' u+ @+ w
- ). l2 ^: \7 o( A. E" s
' D/ M2 i& f8 z5 ?/ j- ; Each Attribute's height and width-factor were computed
9 Y% \; h2 t0 K8 X' z! f - ; based on the Block's scale factors. Adjust them now,8 [4 J9 P: |; r3 L, g" C8 r5 U- V
- ; by first reducing to values for 1x1 scale..., l& }/ r: \) p P5 A) t
- (setq new_hgt (/ old_hgt (cadr old_scale))
5 m, H* U. G8 q5 g2 \5 u) l - new_wid (/ old_wid (/ (car old_scale) (cadr old_scale)))
; W8 |5 l+ }. X5 m5 m" R - )$ ?. U2 j9 O; t
- ; ...and then rescaling.
9 |; A' r( d# ^8 m9 a1 u/ E& @ - (setq new_hgt (* new_hgt yscale)
: P7 G: c$ j: L& O( z! R8 q - new_wid (* new_wid (/ xscale yscale))
2 {9 s6 {. w1 \- z' o" B; Y - )3 ^0 e4 x2 [8 M/ p
- (if (/= new_hgt old_hgt)
& x0 J! d4 Y; D* _. G( b% c! P - (setq el (subst (cons 40 new_hgt) (assoc 40 el) el))
. g- Q# N3 Q- z2 F2 Y - )
$ z3 ^6 ] c5 C& |" A - (if (/= new_wid old_wid)- i4 h1 m6 y+ _
- (setq el (subst (cons 41 new_wid) (assoc 41 el) el))
9 T7 t4 G( K$ f4 e( Z$ x - )( B3 Z. \3 R- \( Z8 N8 x: a% I
- (entmod el)
6 q: T7 ^5 b8 S - (setq attr T ; At least one Attribute modified
5 n: \, k2 Z' l& b7 d - en2 (entnext en2) ; Next Attribute
7 a& l1 [# r% c$ c4 @* { p+ P8 { - )# P' u$ {. D5 u' C
- )
2 M2 V5 J$ x/ k - (setq en2 nil) ; No more attributes
( z' t/ F( V: y7 u1 j# Y3 l( c - )7 M4 n; z& [" i' [; f
- )
* P% g+ \1 u+ Y& \5 \ - )& m) O( b+ Q: L( w S
- )8 l- _+ u* P; T1 R! ^
, x, A$ z: I1 g, k B- (setq pt1 (list x1 y1 z1))
5 w' }9 X, p ]! X - (tempmod xscale 41 nil)6 _0 u/ w I% R' l
- (tempmod yscale 42 nil)) `7 M. M$ Q( D* d
- (tempmod zscale 43 nil)
$ N* V# S" @- B6 r# F; r - (tempmod col-sp 44 nil)0 O5 ?8 j; ?) T$ J- l; B
- (tempmod row-sp 45 nil)
' k3 G( ]4 Q$ P7 y& F5 ] - (tempmod columns 70 nil)# Y+ Y/ I& V( o* G% C+ B
- (tempmod rows 71 nil)
6 ]# _6 L# j* H/ h6 q$ w. y - (if (= xclipmode nil)
7 S6 p3 A3 \& |. z" B - (entmod elist)+ v" w* p1 q) k. b
- (setq xclipmode nil)
( v2 h4 f! L2 r) ~7 o/ a/ d4 {1 V# b - )* U; o7 f" E% s1 _/ S( s
- (move_pt1 1)
x% ?8 a F; ]2 P2 k
7 l% L$ P+ |% v$ X2 h9 f9 S- ;; Now do the rotation with the ROTATE command.
% w& F) a% g9 Q - (if (/= old_rot rot)! B0 l. f, C j) U. ~4 O
- (command "_rotate" ename "" pt1 (ai_angtos (- rot old_rot)))6 m+ l6 J* n" m; c/ Z
- (if attr ; Else, if attributes were modified,
& \9 q4 X8 A5 d; l: ^ - (entupd ename) ; just regen to force attrib display
( R* ^. v' m$ w, ^# Q N - )
$ U8 P: X J8 ?2 @2 [+ u' ]8 K8 z - )7 y+ z8 H4 R1 C
- (setq elist (entget ename))& s6 _" I9 p6 X% ^
- )
+ v& c U6 L* B - (defun ddblock (/ temp temp_xclip newhatch blkname blklist blktype program xrefpath)
+ t8 P/ T4 b$ Z# _* u$ s4 q( C - (setq newhatch 0)- g4 S% J! W! Q4 O5 {+ s
- (setq blkname (cdr (assoc 2 elist)))
* |0 k' A% e3 ?7 {, D0 S - (setq blklist (tblsearch "block" blkname))! e* m4 ?1 k, Z2 l" E- P, h
- (setq blktype (cdr (assoc 70 blklist)))( i% v. E- R6 w) ^* V' Z
- (setq xcliponoff 0)
. ?% O; i- q/ ~! H: e& c7 M) {# n. S - (if (or (= blktype 0)(= blktype 36))- [4 Z8 }' A' N& W1 q% y% E. t
- (progn
& g9 f, u; j8 r3 [& g ]: ]5 V - (setq xcliponoff (xclipon elist))9 g( ]3 b. u4 F# u0 p1 p
- (setq temp_xclip xcliponoff)
4 f# }- v6 J" m7 ^* O - )
; z. }: t& J) t3 Q; i - ); s: T. A6 O2 G, O* g. t
- (if (= (logand blktype 4) 4)
" N9 v0 [% f: O" L# j& @8 [ - (progn" ?. C. ]! l- _ z+ T" I+ |, |
- (setq xrefpath (cdr (assoc 1 blklist)))
( Q7 b7 } B2 ^& c/ o9 v! \) ` - (setq help_entry "modify_External_Reference_dialog")
# n; L1 i6 J% g6 D% C& X' X6 V2 H7 l - (if (not (new_dialog "ddxref" dcl_id)) (exit))1 w0 h4 [( R8 `# s
- (set_tile "Bl_name" blkname); V; S( V6 ]% U" \0 L
- (set_tile "path" xrefpath), M( x' d3 r6 O
- )1 A4 F1 R& C3 [8 n0 a
- (progn
! s. K# w7 H5 w" I - ;; Get program name for use as Xdata app name9 x q, [2 ~0 ]# {" |1 g1 a
- (if (not (setq program (getvar "program")))
, F2 ?- g4 w% @6 M - (setq program "acad")
# |1 }4 V: K3 s+ P - )$ v' g2 j, W9 H, r
- (if (and (setq temp (assoc -3 (entget ename (list program))))4 C% @* U% H" y0 T, @9 B5 i
- (= (cdr (assoc 1000 (cdadr temp))) "HATCH"): k/ }/ f! c& F* s) }
- (assoc 1005 (cdadr temp))9 [" n) K# H. x
- )7 Y, g& V% S* J
- (progn
2 I( E9 ?2 }5 q: U( m - (setq newhatch 1)8 q7 u6 J" k3 M" m* A6 \. _; O
- (setq help_entry "modify_Hatch_dialog")
: C5 S" h' t# X# q9 m - ;;; convert the object into a new hatch5 x1 B6 I: G' e2 U& Q" G3 g$ F% q3 S
- (ai_undo_on) ;; enable undo
, d5 f' g* k# F4 h2 v0 _# V - (COMMAND "_.UNDO" "_Mark")% f9 s0 S+ \& l( ^/ F9 n+ Y) F) ^
- (COMMAND "_.CONVERT" "_Hatch" "_Select" (cdr (assoc -1 elist)) "")0 Q* J$ ^) x; ?4 j1 d* ^( @1 q" {
- ;;; suppress nasty message from convert command8 ~5 `4 l Y0 W. d
- (princ "\r \r"), Y" a& Q- u6 |2 I- N( I
- (setq elist (entget (setq ename (cdr (assoc -1 elist)))))6 w; f& D7 A$ U
- (setq old-elist elist)
( M7 W/ k) e& C( V% P/ @& S - ;;; If we have cancelled ddmodify
% c+ F0 E V& B4 Z" h9 `! S C - (if (not (ddnewhatch)) ;;; (ddnewhatch) returns nil for Cancel or T for Ok3 k# o0 R( h0 r6 l; w
- (command "_.UNDO" "_Back")8 F+ m1 }* h$ L8 V# s
- )
7 O7 O1 y9 _1 ]3 P. \5 t2 G) z1 D( p+ ~ - (ai_undo_off) ;; restore undo state
5 E5 C6 [. ^" u! S6 u - )
8 m2 p* O( `% @! N" n - (progn3 U! R% O, a$ P
- (if (not (new_dialog "ddblock" dcl_id)) (exit))9 ^2 v3 o7 z. ~: y' i
- (if ( = "*" (substr blkname 1 1))
7 N0 [' \/ [4 \" {' R9 U& ` - (set_tile "Bl_name" (strcat blkname " - Anonymous block"))
, ^( F' a9 w& l f# J5 v* B9 _ - (set_tile "Bl_name" blkname)
% ?' ~& g7 H$ W) \: R! h - ); [# q( @ z, u4 r: N) o% Z+ U
- (setq help_entry "modify_Block_Insertion_dialog")
2 N: N& g8 L; p6 z! g1 r - )# m" `. j0 k- j8 [+ A5 F/ c$ G# I* e
- )3 C# ? t3 {' ` p
- )4 g6 }) g% K( o8 t6 E1 P
- )4 k9 S8 ~ ?. T- w0 y6 P
- (if (= newhatch 0)
! @2 H0 R) K( l8 x$ M+ G - (progn v1 M c+ H/ U9 _, ^' t& O# O
- (set_tile_props)
' ~9 X8 N$ l! k2 f0 w. T - (set_tile_handle)
+ O9 {5 v) X3 T! k _' ~; C - (set_tile_pt1 1)
2 P% k8 j3 K. ?) s - (set_tile_rot): \) g5 U$ G8 y: d' s3 F3 z
- (set_tile_scale)
( \5 I4 r# ?5 v# S - (set_tile_rc)" W v# @) T2 M7 w
- (if (= (logand blktype 1) 1)
- z8 g1 E t ]% ?* J - (progn2 p4 v% v/ G2 h: W3 T0 j/ C; C
- (mode_tile "xscale" 1)4 E5 H" f9 l: B3 O
- (mode_tile "yscale" 1)
4 w6 h: T u% B, M6 V8 n - (mode_tile "zscale" 1). D) p. `* I; S; T& N4 E
- (mode_tile "rot" 1)
4 J8 n0 m5 a; E" b - (mode_tile "columns" 1)
. C( z% ~: o: c' g; z - (mode_tile "rows" 1)
; Z4 S5 f5 ^" U) G& Q3 k; U! W - (mode_tile "col_sp" 1)
7 [' [/ `6 l. _$ i9 i9 @ - (mode_tile "row_sp" 1); u0 Z5 _. B" d; w9 v, o$ }
- )
9 J+ w( i: s' L& D' {! P; R - ): ^, G; m: `$ c' K, {
- ;; Define action for tiles
; J8 d8 ^( N% y8 k$ _ - (set_action_tiles)' {" n# `7 J) D x
- (setq dialog-state (start_dialog))
' `9 P* b" o. o - (cond
& ~+ G7 g4 x5 ?" t - ( (eq dialog-state 0)$ Z3 O3 \/ A! h* W: H
- (setq pt1 (trans (cdr (assoc 10 old-elist)) ename 1))
1 A6 M. S/ t; o8 j9 N! [4 U8 ] - (move_pt1 1): M9 X1 d& f/ b
- (reset))
0 a$ n+ E& U% V6 r( Z7 x - ( (eq dialog-state 1)
7 |; \& d) v' c* t+ V8 S/ [3 L - (if (and (/= temp_xclip xcliponoff) (or (= blktype 0)(= blktype 36))): b/ m) Z" s3 @4 u* f+ O
- (xclip)' Z; Z3 W6 o- f' I1 b) d
- )6 E8 D* M1 |, o' r6 f- |
- (modify_block))
9 ]# [# Q. Q4 k2 y9 | - ( (eq dialog-state 3)/ i# X3 o' D8 f2 A; s' L0 d
- (modify_block)
8 {1 a6 ]' P: ^+ r: v1 s" A2 s - (setq pt1 (getpoint (list x1 y1 z1) "\nInsertion point: "))- j3 D- H, \. u3 `* R
- (move_pt1 1)
: ]/ c$ j) K6 X7 [" s - (ddblock))
( Y* F! ?4 q4 R v( b2 w - ( (eq dialog-state 4), S3 s2 \ \" L, U# J
- (modify_block)$ s6 D2 X' p {& C3 r
- ;; Get current handle.7 O: l6 O, H8 q: r+ t, n( ~
- (setq hand (cdr (assoc 5 elist)))
/ ^: ~5 M: \- I4 A: | - (command "_hatchedit" ename)1 H# ^2 V; a/ |/ [. |( M0 J
- ;; If OK in hatchedit, a *new* entity is created and the old one7 q) i- d! Z0 r; O5 Z; P
- ;; is deleted. So if the old one exists, it must have been a+ [- u+ t* P7 m& H
- ;; so rest the entity." ]. Y* B# H$ {9 b2 F
- (if (entget (handent hand)) (reset))
8 r7 b$ W% t7 [* E$ k5 F$ V - )
( _$ _- S% ]8 }5 D - )9 Q, a; q6 e; Y# S
- )
4 C$ m- A+ x, G; P! q5 Y" [$ k, r - )
( D. U8 f4 R$ r9 j# u - )
, S4 B! a2 t% v) ^% N K8 w - ;;
7 ^* m( N% R4 v - ;; Modify SHAPE z6 s! ^# Y, \, c9 V
- ;;
z9 I. N; Z7 H/ F" a7 k E% `1 p3 E - (defun modify_shape (). z6 Y& i/ R! I0 P; g
- (modify_properties)
6 _& C# Q9 H8 a* U6 { - (setq pt1 (list x1 y1 z1))
7 K8 G- x& q' ] - (tempmod pt1 10 1); O+ L D: n2 Q
- (tempmod hght 40 nil)& w$ Q$ S9 K8 @( P; T* R
- (tempmod wid 41 nil)8 r4 o' W: s" k5 z c4 P8 V1 {' G
- (tempmod rot 50 nil)
$ {8 o( j1 r; _7 ], m2 V4 v - (tempmod obl 51 nil)
# J2 R$ r. g+ G! a; J* n( N - (entmod elist)5 Y0 c5 a6 I/ m" Z
- )
- Y( s" k. ?. c: D1 d* _
1 d0 ]5 G( u. Y; W9 S- (defun ddshape ()
8 Z \( {! E% a2 n g - (if (not (new_dialog "ddshape" dcl_id)) (exit))
" @4 K2 c5 Y0 H# Y - (set_tile_props)
2 P/ K' B& O! O4 V - (set_tile_handle)& o% u$ c# k z; Q" B" ]# g
- (set_tile_pt1 1)
) a/ }9 V' \7 ]( T$ ]9 X* K - (set_tile_rot)
9 ?' [+ P) }' }! R - (set_tile_hght)
6 ^* s5 k' r, H) s - (set_tile_wid)! E9 Y4 q% ~2 a. G& d$ Y. T3 k
- (set_tile_obl)
* f" |3 U! Q' c' V, d& E - (set_tile "sh_name" (cdr (assoc 2 elist)))) z! k5 ]2 A; D+ q1 A
- ;; Define action for tiles
' g9 ~$ G# s2 t- Y6 {6 r( c! M - (set_action_tiles), k3 Z4 p9 `- [8 A
- (setq dialog-state (start_dialog))! d" r+ \* @0 X! T( I2 c( L
- (if (= dialog-state 0)5 E1 `+ K; r0 \
- (reset)% m) [$ M, u/ S4 A+ @& A
- )* ~3 J* S2 e- k8 Q$ _8 {
- (if (= dialog-state 1)3 h! Y: Q& d& n T
- (modify_shape)2 F0 }4 n3 a1 j }6 W% B
- )3 M4 r1 V+ k0 N+ v
- (if (= dialog-state 3)) ]% P8 O$ w# \$ {0 a4 m' n/ W
- (progn, s( w7 v* B: ^3 g# A
- (modify_shape)
; H! M0 _$ S& s8 [! U# C - (setq pt1 (getpoint (list x1 y1 z1) "\nInsertion point: "))1 i7 J+ r2 m, r
- (ver_pt1 1)$ s& r) m( h) O$ g: z
- (ddshape)- W* I( P: Q; [4 \
- )0 w; \0 `$ a s; K6 h8 M
- )
9 i/ Q) Z" `( V6 V0 g - )
$ q2 W6 y/ T$ P - ;;
' N# T, c* f5 f# X) t - ;; Modify TEXT or ATTDEF; d4 j8 c$ {% v
- ;;6 o% X+ G3 z2 x8 N9 t
- ;; Set bit code for upside-down and backwards setting
0 b7 f5 `3 t$ Y9 E - ;;
0 b% @2 i! T, A( j" l% s - (defun code_71 ()
' C2 q8 Q- H9 X0 g - (cond ((and (= bkwd "0") (= upsd "0")) 0)" q5 S4 w3 O1 b5 b: ]9 f
- ((and (= bkwd "1") (= upsd "0")) 2)
6 ]8 u6 E/ ~7 }7 K" ^ - ((and (= bkwd "0") (= upsd "1")) 4): E- i* T" N( Z8 T3 L/ d4 r
- ((and (= bkwd "1") (= upsd "1")) 6): [$ V$ O5 J* l% S5 X% ]2 ^# ]! D
- )
5 H! }/ O$ M$ r, T: p - )
9 C( Q# o: i8 C! f - ;;
( k& i* R ?0 x' M - ;; Style action. Reset widget values to style defaults
) c' M: t8 E I7 I6 a4 @3 j, G - ;;
6 s- A# Y3 D. C# p - (defun style_act (index / style-list)4 g0 F& D( n% Q9 d/ U$ @
- (setq style-idx (atoi index))
/ K5 i: z, T g3 y7 p/ N" v# o - (setq tstyle (nth style-idx slist))
0 q2 @$ b' x4 {, D - (setq style-idx (itoa style-idx))
" R- Y5 J+ d4 \) c9 r* Y - (set_tile "style" style-idx)% Q5 n) ]& s+ T" B: B" a
- (setq style-list (tblsearch "style" tstyle))# V, F2 R: j* u* a
- (setq shght (cdr (assoc 40 style-list)))
5 \0 ?4 y% { t; N8 s; e# f - (if (/= shght 0): d# A8 Z7 C9 A Z
- (progn
) Y1 z3 {: A: B5 F& ~ - (setq hght shght)8 ]/ W5 o/ Q+ t. C2 {
- (set_tile "hght" (ai_rtos hght))
, v! r0 ^9 M0 M* Y2 O - ). [3 ?( P8 F3 S1 g7 f
- )
$ K0 J6 S u: P5 C( D - (setq wid (cdr (assoc 41 style-list))); I, r, w- N. x
- (set_tile "wid" (ai_rtos wid)) p" z; B, Y3 }$ f! r( Z
- (setq obl (cdr (assoc 50 style-list)))
5 X; R d3 Q/ O4 j8 o9 @+ q3 ~, i: b! o. j - (set_tile "obl" (ai_angtos obl))
+ v" E2 j, v! j6 u( }7 Q - (setq bk-up (cdr (assoc 71 style-list)))5 n# W; r: {, W6 a. s
- (if (= (logand bk-up 2) 2)
* A! e" T9 R1 M. C - (set_tile "bkwd" (itoa (setq bkwd 1)))/ |5 ] `$ R1 m9 @3 ]9 u" s
- (set_tile "bkwd" (itoa (setq bkwd 0))) {( b& \: x/ H5 C C- Y
- ). W& o D: [+ Q. [
- (if (= (logand bk-up 4) 4)* |/ r1 R2 L z5 O( [
- (set_tile "upsd" (itoa (setq upsd 1)))* g/ Q/ }5 ~0 Q! ?& F) ]4 L, K
- (set_tile "upsd" (itoa (setq upsd 0)))
2 I& p! C' {3 g, W: Z1 U - )3 Z5 Q: I1 l7 Y9 }& b" d
- )
- i& ~( P9 F( N0 f - ;;
& B8 F% _; b4 t* O }! m - ;; Justification action. Set vertical and horizontal alignment variables,
( y, t- `; l; D% U3 c9 k% x- V. j - ;; grey out rotation and height if alignment = "aligned", grey out rotation
0 Q: Q& {7 K1 u: {$ ]0 g, _: B# [ - ;; if alignment = "fit".
$ h, d6 l% }7 h: a! }! F - ;;/ [, e( v' U( w6 P
- (defun jlist_act (index / templist)
' u3 d7 T7 u( r3 i' P) x - (setq just-idx (atoi index))
% d4 F) T& n: ?( a0 q - (cond, W: V+ W1 w7 ^& k' t* K
- ((= just-idx 0) (setq va 0 ha 0))
9 ~7 r7 G; p1 w/ Z/ Q$ k+ [ - ((= just-idx 1) (setq va 0 ha 1))
( N* P' k( i$ {, s' K# n: |; R3 B - ((= just-idx 2) (setq va 0 ha 2))
2 C3 E7 Y* l8 Q" n* v - ((= just-idx 3) (setq va 0 ha 3))0 ]1 t! k0 q6 M
- ((= just-idx 4) (setq va 0 ha 4))
% Z! g1 C' D9 b- i4 w7 R - ((= just-idx 5) (setq va 0 ha 5))0 ~$ j$ J' u- R
- ((= just-idx 6) (setq va 3 ha 0))
" ]% Y$ B! N3 Z7 j) Q - ((= just-idx 7) (setq va 3 ha 1))
9 a( n% c) l2 C - ((= just-idx 8) (setq va 3 ha 2))
! L* b: b) x: o: v- |: \ y - ((= just-idx 9) (setq va 2 ha 0))6 S3 v1 M0 k) s/ S& ^- u: R% r
- ((= just-idx 10) (setq va 2 ha 1)), s; M$ ^! B4 T. U
- ((= just-idx 11) (setq va 2 ha 2))
! p0 ?; Q& `( f7 u, v - ((= just-idx 12) (setq va 1 ha 0))
# F8 l9 P/ G: Q# ]+ ? - ((= just-idx 13) (setq va 1 ha 1))
0 m, l4 U& w* ?* } - ((= just-idx 14) (setq va 1 ha 2))
; c2 v) ^2 m o+ L - )
- r4 V3 A4 R: n0 J - (if (or (= ha 3) (= ha 5)) ; If Aligned or Fit text) J- X7 c V; K$ ?9 k7 v4 f
- (mode_tile "rot" 1)
8 | n" W2 I: P' E g) ]: W2 W - (mode_tile "rot" 0): e' Q, ? h0 `5 P
- )
; p# C2 W/ | H) k& E - (if (= ha 3) ; If Aligned text
! N0 l3 W. j* ?1 p- q - (mode_tile "hght" 1)
5 Z' c: s% }4 r* b - (mode_tile "hght" 0)
% |7 j; `! m4 q- @& ^5 _) h6 W - )
9 n( u% t7 j/ g* Z4 u - (if (= ha 5) ; If Fit text
i! ~6 P; U b1 ~ - (mode_tile "wid" 1)" c; e9 ]+ [( e! J
- (mode_tile "wid" 0)
0 R' w6 k! n# Q f1 A) x - )( u4 h2 k: U2 f) y
- ;; Reset rotation and height if changing from aligned.
+ z, c4 J/ d1 J - (if (and (= ha-prev 3) (/= ha 3))
: R- D) A, o5 S: { - (progn7 ^/ a, Z3 L1 F t) J
- (set_tile "rot" (ai_angtos (setq rot 0.0)))' M E: v5 e1 M/ h* [/ T4 k
- (set_tile "hght" (ai_rtos (setq hght 1.0)))
: s( ]' O$ Z% Q1 s - )
* K% D% s. K) P - )9 a9 p5 E- B& B) t, U
5 S" `3 x& ~( y- ;; Reset rotation and width if changing from fit.5 f2 x8 u. r0 t+ _ L
- (if (and (= ha-prev 5) (/= ha 5))* Q/ Z( R* I/ [4 L/ g
- (progn
1 o6 S, z. R* |' L. ]( s" b, _' u - (set_tile "rot" (ai_angtos (setq rot 0.0)))1 @# X K4 @% A7 W. Q- Z
- (set_tile "wid" (ai_rtos (setq wid 1.0))): \6 g4 C0 U* M4 a
- )
+ x4 v$ l0 _# o - )) d8 {* |9 z, E; D$ P
- ; M8 V0 |3 V n! M5 y% M
- (setq ha-prev ha) ; update ha-prev for next time
/ @1 \" W1 |! l - (setq just-idx (itoa just-idx))
9 Y" s* @5 f/ i0 s! ` - )6 q6 Z8 Z( B/ o
- ;;4 `2 `: P3 Q3 [* Y
- ;; Set intitial alignment setting based on vertical and horizontal alignment
% r& W2 c! b* I2 z. L! }1 w - ;; bit codes./ O$ x9 @$ {8 E* k$ }2 C7 o6 ~
- ;;: ~# F" y# y( p+ {- k
- (defun set_just_idx ()
, G: B, v f( Z7 p* v5 I! z - (cond3 y. b. n) U* T5 w0 X3 u, F
- ((= ha 0) ; Horiz alignment = Left# k" W0 z& [! j! K
- (cond
5 D, v+ o7 q4 X: L" l# C4 d - ((= va 0) (setq just-idx "0"))
/ w- ?" Z: t4 _5 O3 B: u. q - ((= va 1) (setq just-idx "12"))
/ Q8 W$ w6 |7 S0 \3 u - ((= va 2) (setq just-idx "9"))
9 K. M$ |. Q S2 m' j - ((= va 3) (setq just-idx "6"))8 Y5 {# {- `- p2 Z& v1 M6 J
- )) G) f3 j. v a1 ]$ a. o5 F6 @$ [$ O# O
- )
! ?1 C0 C$ p# h) F+ d - ((= ha 1) ; Horiz alignment = Center. p8 T, v9 g3 J) R+ W
- (cond
4 h( }- q, H& K$ B; m. i - ((= va 0) (setq just-idx "1"))( g5 e/ V: q' g2 D
- ((= va 1) (setq just-idx "13"))
: B, f: G" W9 z# t - ((= va 2) (setq just-idx "10"))& N0 ?( g# R' S. G$ ~
- ((= va 3) (setq just-idx "7"))
5 [& l: h& \9 |9 ?( |1 M: w ] - )
! O) g9 t. x1 y4 Q" `9 @2 ]: G K' g - )
6 I7 m& Z6 j- O H. q7 C# Z - ((= ha 2) ; Horiz alignment = Right
6 h* S* ^! k) e( v0 ~ - (cond0 E' w$ K6 f! }) ?5 d5 y
- ((= va 0) (setq just-idx "2"))
7 `, S! I/ ?1 {2 R/ B$ s$ Y1 _. N/ O - ((= va 1) (setq just-idx "14"))
" @ x1 n! F! R% ^6 n/ c - ((= va 2) (setq just-idx "11"))7 Q5 O* J8 p# I; { T& t
- ((= va 3) (setq just-idx "8"))
{- b6 Q) U: C - )) }- G9 O8 l- x# r- v+ C7 ?
- )/ K* t1 A6 h) d T, x1 ]2 _
- ((= ha 3) (setq just-idx "3")) ; Aligned
* n/ o% k$ C; X* w# e& Y' H5 N - ((= ha 4) (setq just-idx "4")) ; Middle
r' [) x7 F2 O0 v! A/ M6 A _ - ((= ha 5) (setq just-idx "5")) ; Fit
' f# @6 y# W, x, [6 G% }' {* d - (T (setq just-idx "0"))
( x) L( W+ R' E0 e - )
# V1 s$ k: p3 w9 B: s: D - just-idx8 \ o8 o& d6 Q' E- O# Z
- )
9 Z. g& E& c, M" R% g* ~) F4 d
% D3 x' Z0 ]. y1 t1 y7 L- (defun modify_text ()
^+ I& c% E |: T- P6 W - ;; insertion point, i g% j# E6 [& V) ?/ F& Y1 e
- (setq showpt (list x1 y1 z1))
C8 D% @/ n1 d - (setq bit-10 (trans showpt 1 ename))
! \; \" k1 V" h$ }7 f* F - ;; alignment point4 u- G1 @. t/ ?- S1 B2 Q* K
- ;; for 'Aligned' or 'Fit', alignment point must be different0 D) Z- j0 v |; u
- ;; for all others, use insertion point% Q5 g# i. }2 B1 F5 t
- ;; (ACAD will recompute insertion point)
4 p2 [% q* k0 u* ~: z% K% @5 K - (if (or (= ha 3) (= ha 5))
4 l6 a+ \% }0 r3 b& L. H0 o - (progn6 R$ n0 M- ^& @( u9 {- t+ X% w
- ;; if no alignment point, fabricate one
4 E8 ~! q/ {% t/ z, P8 _ - (if (not alipt)/ R) L; l7 j7 }* @! |
- ;; add text width to insertion point9 }9 E; W% x; k( ?1 s2 B( G* H" n
- (setq alipt
: t+ q6 r2 I, Z4 s4 @ - (list (+ (car showpt) (car (cadr (textbox elist))))
: ?9 V* o) \( K8 d P - (cadr showpt)! v" @1 y* \9 l; W$ ^
- (caddr showpt)8 B+ O4 w2 V7 F8 w
- )
' T) v/ y7 Y0 E, b1 f - )2 O* V0 e, Z g- H9 j. v" f6 m
- )
8 I5 N! M1 _ z( w - (setq bit-11 (trans alipt 1 ename))
) i1 @6 a5 B H# R& l! _ - )* @( {. \- B$ g3 I- s; E
- (setq bit-11 bit-10)+ X$ }& R7 e8 y* H' u. A7 b
- )
+ r6 e3 A" S0 j: K) t) P9 { g - (modify_properties)8 _/ c. H. P0 d( c; q. i$ M0 J9 _
- (tempmod tstyle 7 nil)
2 a ~8 ?/ |) d4 T# i - (tempmod bit-10 10 nil)& c- j( R! G) D8 F
- (tempmod bit-11 11 nil)
% O2 M5 K* h. A; W- |, w# z - (tempmod text 1 nil). P( M- E4 o( I/ w
- (tempmod hght 40 nil)& E# T2 Z7 `: z9 U7 S
- (tempmod wid 41 nil)! k3 i% r( ]: j& p9 {' ?
- (tempmod rot 50 nil)% I. E8 G+ g5 H- G& j# A V
- (tempmod obl 51 nil)
: u2 u; T2 F4 T3 d8 ^, j! U2 u8 ] - (setq bk-up (+ (* bkwd 2) (* upsd 4)))
! e' _4 H b# O* c0 R0 W - (tempmod bk-up 71 nil). a# C1 e/ c* E) `9 B& n- N: q
- (tempmod ha 72 nil)
3 Y6 f5 [7 v- z5 ?; P - ;; Attdefs use 74, text 73) Z' T( }& J* z5 a
- (if (= etype "ATTDEF")
7 }; b' n7 M2 Y$ E' c: W6 g - (progn
! n* ]2 o8 f+ C) L* j5 r - (tempmod attag 2 nil)4 [# o' A& o* y0 ~ D% L) C( S' T% Z
- (tempmod atprompt 3 nil)
) S$ G d# u1 ?! a: v" O - (setq icvp (+ inv (* 2 con) (* 4 vfy) (* 8 pre)))
+ e) W' c; ^1 o2 Q - (tempmod icvp 70 nil)3 x7 w( M' S# d; Z+ z) ~
- (tempmod va 74 nil)) R% \+ w# f" r: u
- ), ~2 d4 q5 t; M( {% E
- (tempmod va 73 nil). l0 A* O5 P6 m* g$ R/ x% \
- )
$ y5 s* ^5 }, n6 K - (entmod elist): ~4 b! b4 j# j. R
- )
0 ?7 h/ P3 f s) [' V. l9 l
/ P3 V! k1 i7 S- U- (defun ddtext (/ 2ndpt slist i)
' ^& O0 }; j! Q, P: B5 Y - (if (= etype "TEXT")
4 c8 V4 j* _0 }" O( _; W - (if (not (new_dialog "ddtext" dcl_id)) (exit))8 P) f* ~, z3 z* N3 Q2 A* u
- (if (not (new_dialog "ddattdef" dcl_id)) (exit))
. `8 C0 E/ d7 F) v - )2 r. ^2 J4 e) n9 K1 z% Y
- (set_tile_props)1 e! V2 t& E9 B3 K7 }) v
- (set_tile_handle)
! e$ U: Q# Y& m4 N1 W - (set_tile_text)
' P$ a7 y& X" y+ p- c4 [ - (set_tile_tag)
& M7 Z' a, H/ C3 Z2 Y: V- M - (set_tile_prompt)
3 l3 F' V2 v4 L! a, B w - (set_tile_hght)5 A& U! s* P) [
- (set_tile_wid)
4 Y% ~; s/ y0 l9 r' s* W( Q - (set_tile_rot)) U9 Y& _; J# c
- (set_tile_obl)2 I2 V- p @" I% t
- (set_tile_bk-up)9 d+ R3 d3 G& j4 a% {
- (set_tile_icvp)' j% ^% R6 `, v' q7 N5 Y& V
- (set_tile_style). Z: }) b: _0 P/ r @
- (set_tile_just)
/ ~' _ u8 D/ Z! Q9 H - (setq pt1 (trans (cdr (assoc 10 elist)) ename 1))9 t6 U S$ [5 ?' v! h; Y( o
- (if (not (assoc 11 elist))
: C( C' a5 f, f) J5 h: h - (progn (setq pt2 pt1)
4 P% K i' S, {9 X$ {4 j - (setq elist (cons (cons '11 (cdr (assoc 10 elist))) elist ))3 A+ D3 K# S; n3 y+ o
- )
2 C0 Y+ _, T1 N" n, R - ;;(trans '(0.0 0.0 0.0) ename 1))
N/ b! C3 x% w - (setq pt2 (trans (cdr (assoc 11 elist)) ename 1))
; c& o2 ^+ Q2 O: c. n - )
& a4 Q K9 s6 s - (if (or (and (= ha 0) (= va 0))0 j( E3 ]% g% s4 p, h" b3 a
- (= ha 3): J- S* Y- {& O' I
- (= ha 5)
6 h8 t3 y! m2 j# C, a& h; ] - )
7 b& J+ [; J+ z- ]" x - (setq showpt pt1)' w& K( y/ S; d; ]& |5 l0 k) W
- (setq showpt pt2)
( ] M3 R. V" }9 u- W% t - ): K9 g8 O [, D: D$ g
- (if (or (= ha 3) (= ha 5))
' U5 t5 v* z* D* Q' g' o; D - (setq alipt pt2)
/ Z8 h2 x, |) l" N" n% v7 Z - (setq alipt nil)
# X) u4 E7 {* L8 n - )1 n9 D% |( j( o* d3 K
- ' E6 d* G0 G; r& Z6 \* j; C
- (set_tile "x1_pt" (ai_rtos (setq x1 (car showpt))))( d2 |0 \: o* e2 Q/ B. ^
- (set_tile "y1_pt" (ai_rtos (setq y1 (cadr showpt))))
7 _' l4 I6 F1 I, H B - (set_tile "z1_pt" (ai_rtos (setq z1 (caddr showpt))))
' V0 I+ B1 a/ ^5 M `, Q4 H" D
( E B& q; E& f/ q/ X6 `4 [- ;; Define action for tiles' q4 m) k& m9 _# [( L, Y( w# A
- (set_action_tiles)
2 ?) q) g7 _$ p6 m% g - ;; Set focus initially to the text edit box.1 Q2 k% H0 z$ Y! x. _
- (if (not i) (progn (mode_tile "t_string" 2)(setq i 1)))
+ I, }+ \6 `7 Y - (setq dialog-state (start_dialog))3 \, |" d- v9 H( c H! E
- (if (= dialog-state 0)
+ @; L% d3 T/ [. z - (reset)* ]# e& Y7 K' W5 j) M
- ) o, O: U% P/ l' }8 b( n
- (if (= dialog-state 1)
- ~9 Z9 v* f) T" k - (modify_text)
2 I" w8 n/ m* `1 d - ). r+ o9 T7 H' g; U# x; b
- (if (= dialog-state 3)
/ y1 o( O+ S* l0 r( S - (progn7 ~0 n% K6 b. U7 s
- (modify_text)
x+ r2 Q/ }* l5 [ - (if (or (= ha 3) (= ha 5))
0 F& E( A* }1 g0 w - (progn
& I: O$ Z; W; a$ M - (setq showpt (getpoint (list x1 y1 z1) "\nFirst point: "))$ k- j4 l+ w. _8 |: T
- (if (not showpt)4 L* e- m! ?, a! G6 j
- (setq showpt (list x1 y1 z1))
5 D0 e7 {8 B3 y7 q# O - )6 J6 x; ]1 a" J) a% |
- (setq 2ndpt (getpoint showpt "\nSecond point: "))
+ Z$ m$ ^5 Z8 ^2 `$ T: p/ M - (if 2ndpt) |8 ?, e5 E. C4 f; d0 S" n
- (progn6 Y: z6 u. H- W) u
- (setq alipt 2ndpt); \, N9 X U3 `( f$ S* f
- (tempmod showpt 10 1)
5 l( B& E6 H0 e! ~/ ^4 D4 h - (tempmod alipt 11 1)* K: ~ P) K- [+ t J" a5 e# C/ M
- (entmod elist), t/ Z) j* X. p% X* S
- )
+ J$ Q9 g+ [: A6 F - ). e. h4 R! a' ~$ ^' R5 `
- (setq elist (entget ename))
1 ]- i5 B2 U( h% m* X0 U - )2 R5 Y- c# ~5 ?( @
- (progn$ T/ O2 D3 C: G( p# f7 M3 H0 a/ C/ ^
- (setq showpt (getpoint (list x1 y1 z1) "\nInsertion point: "))
! @$ g* x! U6 h( q+ k - (if showpt: M: @( W. i3 n7 H
- (progn
4 }6 ]- w# O8 G/ t) G/ m4 K/ i - (if (and (= ha 0) (= va 0)). m2 y3 v; J2 O" \6 ~
- (tempmod showpt 10 1)
- }0 e# I5 C/ {! y; G/ U& K - (tempmod showpt 11 1)' |. A( j2 A1 D8 n
- )
% {& A: S# x4 r& T: M - (entmod elist)* @! ^+ W# M" Y0 Y; a" E
- ). y4 n* L3 e* z0 D# r
- (setq showpt (list x1 y1 z1))
' V( A. P6 x. r - )
Z- j/ c" H w! b' _ - )# }& a( \- h0 M6 N
- )
; z( v E6 j. c/ D$ D$ B! \' @ - (ddtext)! Q o- |# Q+ R3 u- }
- )0 T' j. Z0 S; ]& b( h
- ); d$ [5 }7 W2 z/ s( E2 ]) o1 S
- )
5 P7 ^) |" C' @4 F# T
9 r; i7 ^/ F5 I: P. Y1 |) }8 M- ;;. ?: Y7 p. m; b% d9 q# o* T3 `' P+ }
- ;; Modify MTEXT7 d* E0 C9 |; C% @$ L% P8 Q. P
- ;;3 N8 P5 y% T/ b5 q# l2 y
- (defun modify_mtext ()
* T2 G* p6 o1 j. r - (modify_properties)
+ g" N9 u6 V0 z0 h5 U7 ~' A - (setq pt1 (list x1 y1 z1))
7 i& e) R( N- q% v* y% R - (tempmod pt1 10 0)1 ?5 W) k: H$ U+ Z" s
- (tempmod text 1 nil)
. W, m5 J$ B) W$ G8 t8 y: n - (tempmod tstyle 7 nil)2 ]' T, P9 _! j3 @/ J) }1 S3 S
- (tempmod just-idx 71 nil)/ s4 m1 C' k2 {/ S& ~
- (cond. Q4 x7 Q1 Q0 S: y' H0 |
- ((= dir-idx 0) (setq dir-idx 1))! u( l1 l( w5 q. I! |
- ((= dir-idx 1) (setq dir-idx 3))/ P6 v9 o$ i1 y- W" S. z% e1 b
- ((= dir-idx 2) (setq dir-idx 5))( [4 v: k" P4 w3 m) o% ~
- (T (setq dir-idx 1))9 q6 E$ H$ O/ _/ j) a, ?* W0 z6 [
- )% {" C5 D) \0 P; N" y! b
- (tempmod dir-idx 72 nil)
& h- z! Y' ]3 y& X' B, H - (tempmod hght 40 nil) i a9 A; E& q" ?# l
- (tempmod wid 41 nil)
/ h- {' [, W' [9 @. w$ |$ Y - (tempmod rot 50 nil)) L8 ?7 I I2 p4 F0 D) D1 T/ U3 F
- (entmod elist)3 a$ r( a, {8 ~5 u; L6 _
- )
2 B- V& v4 s. c' Q/ M
$ \9 T! x# `% ?0 K7 d* [' t- ;; Set MText text style; L; r$ O# L" F& h: A' d
- (defun MText_style (index / style-list)+ f( S+ e! |9 u- m
- (setq style-idx (atoi index)): E! ~5 z0 o6 }: A, P- ?
- (setq tstyle (nth style-idx slist))' b( h. L. U; J" I! J
- (setq style-idx (itoa style-idx)). L% z# B8 A; R( |+ p; h! d% B+ l# O7 e2 w
- (set_tile "style" style-idx)
" _% s- j- W% G- ~ - (setq style-list (tblsearch "style" tstyle))! }4 e) e! |6 ^ M! F: a/ ~8 F
- (setq shght (cdr (assoc 40 style-list))), b: R5 b h7 S7 \
- (if (/= shght 0)4 a7 a$ K! k! j7 U7 H9 ]# |
- (progn
; T/ s4 k- R: H3 ` - (setq hght shght)
- J9 X, C3 j" v/ x - (set_tile "hght" (ai_rtos hght))
3 `6 A; w7 o3 Y9 F; @ - )/ H8 G! j2 m Y0 [! [ k6 ^9 l( h
- )4 Z! d7 a: [% I3 {6 M, O8 V6 _
- )
$ _* f8 R" |! h6 I+ r4 p! {/ H6 R1 L
9 Z7 d2 K6 j. y6 ?4 x- ;; Run DDEDIT on given entity, working around possible re-entrancy) b% f+ I- G; k2 m: p
- ;; problems with MTEXTED7 r2 ~: y4 `2 d/ u1 I
- (defun safe_ddedit (ename / orgMTextEd work), e/ a% O' a3 X2 r
- (setq orgMTextEd (getvar "MTEXTED"))
$ N5 p) b" }$ v - (setq work orgMTextEd)
) i- O1 b4 I, m% B" L - (if (= ":" (substr work 1 1))
$ b3 F6 ^3 l* ]. e$ O - (progn
2 W G7 l) b- ]* d4 q" z - (while (and (< 0 (strlen work)) (/= "#" (substr work 1 1)))! F g1 I' }4 f
- (setq work (substr work 2))
' Z! W" I* I9 j" k1 I* V - )
5 X) _4 l/ `7 M, X9 `# j* \ - (if (= "#" (substr work 1 1))
1 e* E% |! L. C) {% R! q - (setq work (substr work 2))
) u# o+ e, r" \( l3 T - )
4 j$ w& a* c2 G$ t9 U% |+ {% j - (setvar "MTEXTED" work)) Q0 b7 }# s! G# E
- )1 [( e; i1 k9 d9 _
- )3 O2 m4 w9 P2 I7 R( e' V" X
- (verify_arxapp_loaded "acmted.arx") ;; make sure it's loaded...& e% \- G& |( q9 I; u7 L
- (command "_DDEDIT" ename "")2 s _( w6 i( j- \6 O
- (setvar "MTEXTED" orgMTextEd)
, g4 ~$ Z6 c) J" G - ). P. z( E. \5 m& f L( @
- 4 j8 I+ U! a1 j _! G3 P& f
- ;; Verify MText object width
6 p/ H d/ ^( d/ W - (defun ver_MtextWidth (value)& K& O/ c6 Y/ l0 b
- (setq value (distof value))
$ r ^5 S6 E# b( n, J - (set_tile "MTextWidth" (ai_rtos value))6 T3 ~+ C3 n0 ^) {2 Y
- (set_tile "error" "")
6 a% ?9 E7 {, @% z* Q0 N- E - (if (< value 0.0)7 F( A4 y2 N& |+ T: @
- (set_tile "error" "Value must be zero or positive.")
! l/ c$ `; g" b8 { - (setq wid value)7 a1 u. s0 v! C# a
- )
4 S9 [4 n( l: {9 @ - )
6 K/ A% O1 t% B# C
/ q% g$ X9 G, v- (defun ddmtext ( / gc3)
. f5 P# e# Z8 g2 g' s) ~& L" |0 h3 J - ;; Get dialog
! G0 S2 }3 c( P4 ?9 T - (if (not (new_dialog "ddmtext" dcl_id)) (exit)), U6 }! K3 h8 w5 `, a' p7 l
' ?3 H8 t3 I+ n- ;; Load list boxes
% r& z" h& x$ f1 d# r Z, s3 \ - (start_list "MTextJustify")% M, O$ L8 E _
- (mapcar 'add_list '(! a, r$ d( ~* [( Y
- "Top Left"% e9 d, U' G6 V4 }, ]
- "Top Center"
/ C& R, s, e1 x - "Top Right"" I4 G/ i9 u( i" `2 ]( d5 q4 B5 d
- "Middle Left") k; y5 Y0 L2 `, {4 J
- "Middle Center"7 d* g6 @) O) P3 v4 D% g- r
- "Middle Right"
6 N0 n* ]( ^$ u& C; M b: h - "Bottom Left"
, ?3 J% H0 J j3 m& }$ V - "Bottom Center"
7 X" c/ M9 C! ?0 @/ Y - "Bottom Right"
5 d% J1 G8 Q3 S3 V - )
2 ~% d' L! Z+ e7 c3 t9 N# V" g3 x' ? - )0 p; j9 W. K/ Y1 l D
- (end_list), w9 F* k5 }4 V0 X! c1 T# \3 f, K
/ k4 a1 E/ v* k/ w- (start_list "MTextDirection"). | P' J# ?5 M3 Y, } E% a
- (mapcar 'add_list '(
4 `3 w$ D0 |& U1 R1 D8 s! } - "Horizontal"4 \+ z' r3 L% S; ]% e
- "Vertical"
6 g6 e, {% ]3 V - "By Style"
; T3 B+ j' F6 X3 J - )& r! k7 |) O2 X. D
- )8 X7 X* J6 F' ^
- (end_list); h, c& w e# P S
" O# Z j, G# { V- ;; Set initial tile values
, y5 F! P8 k! \, R - (set_tile_props)
4 ]9 l# x D: u# a5 } - (set_tile_handle) m* Q" D# y1 _1 U3 N. k6 R
- (set_tile_pt1 0)
3 l2 |; Q/ p- L; \1 [ - (set_tile_style)
! U% ~; b. p) `7 y' I - (setq just-idx (cdr (assoc 71 elist)))
/ v; ? l! ?/ Z8 v3 U7 A1 p - (set_tile "MTextJustify" (itoa (1- just-idx)))( W J1 }+ U. A: m
- (setq dir-idx (cdr (assoc 72 elist)))
V( A! }2 X$ g7 j - (cond( m+ h& K' H% e" K; l5 M: P
- ((= dir-idx 1) (setq dir-idx 0))' I; S) @6 F# }( j7 C$ H
- ((= dir-idx 2) (setq dir-idx 0))
% X0 y# Y$ [+ S9 ?+ ^$ Q' T6 K - ((= dir-idx 3) (setq dir-idx 1))
( K2 h. Y8 L. d! e4 M! M% L - ((= dir-idx 4) (setq dir-idx 1))
- e; y2 e6 C: A3 q; L+ W, G* V# W - ((= dir-idx 5) (setq dir-idx 2))
8 \$ C: S0 i+ ]% B& J - (T (setq dir-idx 0))
: M1 |& H$ }1 U+ w. w; Q( z3 m - )
0 n; S2 h$ I7 V# Q Q8 c - (set_tile "MTextDirection" (itoa dir-idx))4 F; t* f: m( P7 b4 a
- (set_tile "MTextWidth" (ai_rtos (setq wid (cdr (assoc 41 elist)))))
8 Z7 C! O/ |" X, t2 X - (set_tile_hght)
8 o f' U S( h0 C# ~2 F; N* P8 J; k - (set_tile_rot)
1 j# p# R9 K" F ]6 C2 [2 r - 0 A% A0 W! @' S) Z; P3 W
- ;; Set edit box, disable if too long
4 Q5 g1 O$ P. w7 C# D, N" b - (setq gc3 (cdr (assoc 3 elist))
' b; g4 R% D3 w. n - text (cdr (assoc 1 elist)))
, ^5 Y2 y- o( K! h! y6 s+ E - (if gc3" Q# l+ \/ w& A1 T6 T; O
- (progn ;; Text is over 250 chars, disable edit tile
6 j6 C$ T7 g; E: A, n - (set_tile "t_string" (strcat (substr gc3 1 25) " ..."))
+ n' E; V( ~1 F6 X0 l - (mode_tile "t_string" 1)
) m6 j. E+ c a/ V( c - )! o3 L9 Y- C! Q) S7 C* j2 n9 G
- (if (> (strlen text) 80): b& _4 |1 u8 r
- (progn ;; Still too big
7 Q6 Z2 v, I! \; w7 W - (set_tile "t_string" (strcat (substr text 1 25) " ..."))
3 B3 {- |! }+ l1 D5 y6 g - (mode_tile "t_string" 1)) W/ {6 N3 C0 q0 J0 y
- )9 `- c, g! s" Q$ A& }4 z! l0 k
- (set_tile "t_string" text)0 Q! R, a E5 I- I7 M# s, H# ]
- )
( w1 f F& o0 U# {5 d - )2 D) q& h) d, e+ i& T
2 P. h G1 j; E0 V5 ^; r: x- ;; Define action for tiles
1 i% P- J; E; G1 n6 i- N+ h - (set_action_tiles)
+ w1 K h7 R- b& r - (action_tile "style" "(MText_style $value)")
4 B) [: X6 v6 E; I: S9 g2 u - (action_tile "MTextWidth" "(ver_MtextWidth $value)")1 i3 w/ O1 S3 b8 ?. w
- (action_tile "MTextEdit" "(done_dialog 4)")( x5 W5 ?. I" d9 o& a( f d0 x
- (action_tile "MTextJustify" "(setq just-idx (1+ (atoi $value)))")
7 u) b& \, Z2 i K& \ - (action_tile "MTextDirection" "(setq dir-idx (atoi $value))")
* [& T: k; L9 e2 N. j- r& p
" l: w G0 r% C- ;; Set initial focus to text edit box.5 A" ^: N$ W2 F N
- (mode_tile "t_string" 2)/ @1 d- v6 _5 k! w8 E: u
- ( R: E- k, I- N9 T& b
- ;; Run the dialog$ d& a) t9 s; G( Y
- (setq dialog-state (start_dialog))
$ z9 P3 a$ A! v* k* ]: B2 \ - (cond
+ M, J8 J' V) Z/ ^$ f$ @1 X - ;; Cancelled - restore saved data6 H5 S( E+ \: J/ g7 Z2 D5 C
- ((= dialog-state 0) (reset))
; V8 N0 @- X& \2 w6 {% J) q - ;; OK - save new data
/ W( K7 ]2 @9 f5 l+ B; b' U - ((= dialog-state 1) (modify_mtext))
* v! }- X4 t5 m7 i - ;; Pick new insertion point
$ M. d1 D2 r B, [; v- u+ } - ((= dialog-state 3)5 ?4 {. J- ^1 Z5 A: t
- (modify_mtext)
( o5 K- Z: F; w0 [6 Q: p# K; L - (setq pt1 (getpoint (list x1 y1 z1) "\nNew Insertion Point: "))
) H$ W' ~# K0 s - (ver_pt1 0)- r. t0 L- H3 b7 x ^, |# f3 H
- (ddmtext)( F' h- `& i$ T) R* w; \
- )5 R3 o6 b, W/ m9 G/ D
- ;; Run full editor( E$ e# k' @' m
- ((= dialog-state 4)
2 ^, v7 u* p* e# o - (modify_mtext) [% l4 L( v2 v* m
- (safe_ddedit ename)
9 c- q% h$ @5 T4 j9 S - (setq elist (entget ename))
! \7 l F( h/ U" ]% I - (ddmtext)
# o" B, D# c5 {- J; V - )
1 @, F& R/ C1 _ - (T nil)
0 O2 G: t. S; r. w- Y9 ], u - )# H# T% @2 p2 ?, v
- )
. [8 q$ s9 f% N5 E - ( l3 d: o4 B" G4 J; j
- ;;
' S7 E1 y* P2 f- g7 G2 J& _1 \ - ;; Modify VIEWPORT3 ]2 b% }# K6 y* V c
- ;;
8 c$ y" z! U) D - - @8 S" [5 I) q1 y
- (defun ddvport ()- {1 Q) c$ F# q/ q* I! {3 Y
- (if (not (new_dialog "ddvport" dcl_id)) (exit))
3 y- c) D' K! ^% f- z! V' H1 q: w - (set_tile_props)4 w, u: Y6 w$ H, ^) K
- (set_tile_handle)
, \4 }$ W0 P1 A% x, C$ y1 o! i% G - (setq vpt (cdr (assoc 10 elist)))
0 T( a4 r+ O! b - (set_tile "xtext" (rtos (setq x1 (car vpt))))7 m: e" }- X p' Y' c7 `9 g
- (set_tile "ytext" (rtos (setq y1 (cadr vpt))))% b8 q- v# {1 n5 I/ X/ q
- (set_tile "ztext" (rtos (setq z1 (caddr vpt))))
8 q( K1 s2 V' O, Q - (setq wid (cdr (assoc 40 elist))); B0 V' ?3 C3 e1 Q K- g
- (set_tile "wid" (rtos wid)) m% q3 |1 H$ a" \
- (setq hght (cdr (assoc 41 elist)))" Y f7 J. r( a4 t
- (set_tile "hght" (rtos hght))+ m K3 y Y+ S
- (setq vpid (cdr (assoc 69 elist))). a) D9 t6 {0 N; I
- (set_tile "vpid" (itoa vpid))! {+ w, r. `1 ]5 J
- (setq on-off (cdr (assoc 68 elist)))& l V/ B% Y1 K9 S+ z7 `
- (cond
' v4 Z* R7 i* E" l4 n. P _9 v - ((= on-off 0) (set_tile "on-off" "OFF"))
4 \0 W( j' W$ J* {$ S - ((> on-off 0) (set_tile "on-off" "ON and Active"))# L2 z, [. @4 P% z$ G! K+ H, K# Q
- (T (set_tile "on-off" "ON and Inactive"))3 G, h8 q/ `2 ^) O
- )+ T6 z5 G: w5 I' ?- F; Y c2 [
- - V% L1 g9 p6 ]7 B9 b' M
- ;; Define action for tiles. U) h! G( z' h
- (set_action_tiles)
" F4 w! f4 f: l2 H/ @, a - - ^* ~7 `% p" f; R# _& _7 ]
- (setq dialog-state (start_dialog))
8 f A0 `+ p" G3 q - (if (= dialog-state 0)6 ~* c5 `3 x5 M$ K% z$ A
- (reset)* _" ?4 K9 @1 A2 b4 j
- )4 a8 b: q/ B/ H, Q5 L" `
- (if (= dialog-state 1)/ C3 y) \) l/ ^; y2 T
- (progn
) n! C1 P. b& T- w2 M - (if (= ecolor 0) (setq ecolor "BYBLOCK"))+ _2 A0 M" T; }" d8 s- Y; C
- (if (= ecolor 256) (setq ecolor "BYLAYER"))' g2 K7 H, u) V! Y; x
- (command "_.chprop" ename ""
& J; r+ ?% R8 V) x7 _ z - "_la" elayer: h& _9 R7 g! C0 }# |
- "_c" ecolor ""
8 {& Q8 q$ `; B( a" { - )
3 {& A9 R1 _4 e8 G; T - )
+ q `( s% o5 `5 V2 o - )
5 \* M2 @ g" c9 h' B - )! D( T! a- z& r" d9 P0 j
- ;;. p+ Y/ u3 |/ s3 s* S8 ~1 R
- ;; Modify POLYLINE3 s* X. f3 e& v* \% J; @& r) ?4 k+ x/ s
- ;;6 \# [; K3 k5 d
- (defun modify_polyline ()1 K) M% S9 C' P- I( Q
- (modify_properties)) k! D2 U+ A% W% I
- (if (= ltgen "1")
' L( H4 c6 n0 t% C& s: ~# [ - (if (/= (logand bit70 128) 128)
( a# e9 r, G' ~) X. c - (setq bit70 (+ bit70 128))0 y' S! M8 b5 ]$ ]6 N h4 Q
- )
2 G; T! I& E4 s" B - )
; \$ \7 j) `6 C' \( c - (if (= ltgen "0"). r, d4 ~6 M- ]( e o y/ v' F
- (if (= (logand bit70 128) 128)
2 U- ~5 e" [9 p# Q, Q& i - (setq bit70 (- bit70 128))
9 `1 n! u9 X+ U7 E2 h - )
. t# G5 r P% s, j; z2 ]+ k% z - ): J& B" t8 A0 F, k8 S4 x- U
- (setq elist (subst (cons 70 bit70) (assoc 70 elist) elist))* J3 q* x- g/ F5 O
- (entmod elist)
% b" n) V/ m' } E) h7 e - ;; Added to take care of updating Vertex information for color6 Q# Y9 ^& b. U* C$ [
- ;; and linetype.
& C3 T& x1 O4 s7 l& `* W - (setq save-ename ename save-elist elist)5 K+ S$ g3 c/ c" B5 z
- (if (= (cdr (assoc 0 elist)) "LWPOLYLINE"), t# J( g, y! Q6 ]! m
- (progn& \* t9 M0 p; l5 \
- (emod ecolor 62)3 }+ r# {3 F+ a: g
- (emod eltype 6)) @' h8 ]! I) ]9 Z
- (emod eltscale 48) o3 ~2 O( |' R( p( `
- (entmod elist)
* N8 O* p# R5 G6 L! t, I3 c/ p6 h - )+ w) N7 W* T4 y! O$ b( u2 }0 G% J
- (progn
. i" U( W* T9 |/ p5 `5 q- n% M - (setq ename (entnext save-ename))5 s- U# N( O0 @4 h/ |. C
- (setq elist (entget ename))0 O( f& ^% @! s! Q# d
- ! b# V7 i, x0 ^& v
- (while (not (= (cdr (assoc 0 elist)) "SEQEND"))! \' i9 u0 F$ ^
- (emod ecolor 62). x/ I" u" `* d7 A0 i# j3 ^# F% U
- (emod eltype 6)
4 F! @) u' I7 T! d2 k7 | - (emod eltscale 48)
7 M7 ?( a3 b% @2 ]1 o. S0 L0 I - (entmod elist)
& ?6 B% e* @7 F3 y# ^: p5 h - (setq ename (entnext ename))
% l% p6 ?! Q' ?6 m - (setq elist (entget ename))
. a( a% R% l" p4 [ - )& r8 l0 D& F+ C& o
- )
* m: ^' Q2 U4 q( B, G! `" x% V - ), d) ?2 J O" O r1 Z
- ;; Update the SEQEND
8 K" p6 m+ J* p8 u/ ^ - (if (= (cdr (assoc 0 elist)) "SEQEND")6 i% ?& ^: K' H
- (progn
9 _; k6 Y4 _5 W - (emod ecolor 62)( E2 ?; _9 f- h" _; [& _
- (emod eltype 6)
( A( ~) y# w( d5 Q+ d - (emod eltscale 48)
$ V6 N7 @8 _6 l' P1 Y - (entmod elist)8 q9 [* X: |7 U% m5 y" U0 T
- )2 r, p. y1 t& ]* D2 D
- )! X* B* V. C0 }' l
- ;; Go back to header.
- p0 r4 ^+ Q8 G/ P - (setq ename save-ename elist save-elist)4 \1 [; V2 ~& I, B
- ' ~9 E4 t/ \; v0 R; Z3 v" |# C
- (entupd ename)! {( g6 _9 A+ K$ o2 [% U
- )
3 s( @2 V$ r7 m- b% Q; z* Q9 V1 y - ! q% P& q$ g+ r) R4 J# u+ w. V
- ;; Increment vertex. Set tile values to next vertex
( A- n0 f3 ^) d0 G0 P- X2 l - ;;
' N# v& W1 w0 N/ T8 D% t9 N - (defun next_vertex ()% L0 t% c9 P* N& l' T2 Y
- (if (= (cdr (assoc 0 vlist)) "LWPOLYLINE")
7 |& l4 l( ?! V) j% U* o `* Z - (progn; C7 o! Z+ q/ X
- ;; If the counter reaches the number of vertices,8 A8 e+ @$ n. q$ G+ g
- ;; roll it over to zero again.
0 }4 h z& }+ F - (if (= ctr (cdr (assoc 90 vlist)))
. O( n' ?2 q5 {* \1 j" @ - (setq ctr 0)
7 K7 k7 o0 f2 j% ~/ K6 u - )
* I% \2 |$ H1 ?& y w5 L - (set_tile "ctr" (itoa (setq ctr (+ 1 ctr))))
5 J% H' Z% g0 l' t% ~" ?" q, g* J - (set_tile_vpt pointype)3 @; ?5 z( v- w! G5 i2 `
- )
& t9 `6 l! N9 n9 p - (progn: r2 O+ m9 P0 z3 s- L2 H& M8 P
- (setq vname (entnext vname))" \8 j; ]1 s" m& ^( I
- (setq vlist (entget vname))* c. k1 A6 M" W5 ?$ Z
- (if (= (cdr (assoc 0 vlist)) "VERTEX")
x; B# t7 e4 f k1 r& z% Y - (progn
5 _3 I: y2 X1 t: X r' J - (set_tile "ctr" (itoa (setq ctr (+ 1 ctr))))5 S5 t# i' i; d
- (set_tile_vpt pointype)
' Q( o0 z3 A5 ] i - ); \: z2 t, w# b* T# {
- (progn3 Z' a. R5 ^& n) O$ s" o* ~5 Q. c0 Y
- (setq vname (entnext ename))
0 H& P4 N+ v" \& s' p7 v( X! T - (setq vlist (entget vname))1 `1 I7 i. ]: g, q {
- (set_tile_vpt pointype)) X6 ]8 _1 y8 z) c& G9 G
- (set_tile "ctr" (itoa (setq ctr 1)))
( b/ K- e- H1 j+ R2 } - )
! q5 ^- }/ b2 G - )" J5 t: {) V" A; n8 L$ L
- )
1 a7 A$ j, p" [7 L - )
3 N3 A! C. ~5 }0 j# m - )5 i& z* c8 w$ c" O
- " }3 ^+ H7 |5 @$ ]+ S
- (defun ddpline (/ oldecho)( U- ~0 R) [- [; M
- (if (not (new_dialog "ddpline" dcl_id)) (exit))/ X4 j- o y- I
- (set_tile_props)
. n% [' b6 C* Z0 o5 O$ C - (set_tile_handle)
! C) x0 z% o, e( Y. V, q - (setq bit70 (cdr (assoc 70 elist)))
@4 b* P1 _5 P - (setq bit75 (cdr (assoc 75 elist)))) T* z# c& P+ r7 @9 z% U
- (cond
$ N9 t# w4 D& A/ l/ S- E - ((= (logand bit70 8) 8) ; 3DPOLY
5 N9 U' k* ~) T! } - (set_tile "ptype" (setq pltype "3D polyline"))
/ R1 v& B; d- ] W - (setq pointype 0) ; WCS or ECS point values
, r# n2 B$ `/ I! y - (mode_tile "fit" 1)
: q7 w- C$ J! R. p' y: U - (mode_tile "mesh" 1)7 b; t& Z1 w z4 i3 @
- (mode_tile "bezier" 1)
" E2 [* r" c d' \. k' b0 M4 x - (mode_tile "ltgen" 1)5 }# @9 Z3 G% u' C# i1 [+ \
- (set_tile "none" "1") W# F: E q" k8 n8 d8 J- U3 b
- (set_tile_closed)
$ y# [' |8 @/ T9 f7 |* R( h( _( G - (set_tile_fitsmooth)
, b% d$ Q9 t" M% r- ?- K - )
( p! M" [' }) G* Y! l3 V' n7 v4 I( b7 m - ((= (logand bit70 16) 16) ; 3DMESH- @2 X) Y: G- p# W3 x
- (set_tile "ptype" (setq pltype "3D mesh"))
1 }5 ?' H/ ]7 B( { - (setq pointype 0)
- c0 R7 F9 X5 b$ \$ r% b+ H+ x: ] - (mode_tile "pline" 1)2 k9 \( L; r' y9 ?
- (mode_tile "fit" 1)5 J5 k3 a7 V$ l, I/ W; _, w
- (mode_tile "ltgen" 1)
! D! b( I( o* P3 F2 ?8 x8 i5 @* b# Z - (setq m (1- (cdr (assoc 71 elist))))
/ z: ]) F5 @5 ~/ b: f# a- X8 _ - (setq n (1-(cdr (assoc 72 elist))))
' o5 O! v W; x4 o( V( L/ N - (setq u (1- (cdr (assoc 73 elist))))
; {$ Z6 j3 W# ] W - (if (< u 0) (setq u 0))
7 S8 D4 Y( F* I7 Y( A - (setq v (1- (cdr (assoc 74 elist))))
. B, { [. K: q+ h; h, p i0 u - (if (< v 0) (setq v 0))
& ?8 X+ u5 A' a# K7 T" y$ O5 O% P - (set_tile "m" (itoa m))
0 Q& s& W* e/ S0 `* K - (set_tile "n" (itoa n))4 `/ V) d- B4 C9 w) m$ h; B
- (set_tile "u" (itoa u))
8 V0 W5 L5 n# J( X: R - (set_tile "v" (itoa v))
5 ?' F# [9 [1 V" X2 g - (set_tile_closed)
H7 M: ~& P$ C9 `! n+ _( m - (set_tile_fitsmooth)1 d$ R* {' Q5 [5 V& L
- )5 o6 Y* h& i, Y! |
- ((= (logand bit70 64) 64) ; POLYFACE MESH
" h I' ^0 `* F - (set_tile "ptype" (setq pltype "Polyface mesh"))
- l- X7 m4 x0 u0 m/ y7 p$ F( e - (setq pointype 0)
7 y( U# E5 }4 c! S: H - (mode_tile "f-s" 1)
: n' Y+ z0 \5 k$ O5 } - (mode_tile "mesh" 1)
/ W! e2 Q6 X- A9 T8 x" ^ - (mode_tile "pline" 1)
0 c" B# k/ ], G - )3 m) L' ^; ]7 C5 V1 w/ P
- (T ; 2D POLYLINE3 q) ]7 U* h4 p1 p3 b3 ^
- (set_tile "ptype" (setq pltype "2D polyline"))
?8 W: c* x9 c - (setq pointype 1)
2 t ~. y$ h8 | - (mode_tile "bezier" 1)5 k D8 Z' T& A0 P" H T1 I
- (mode_tile "mesh" 1)& z% t: y2 Y- _' G4 D0 l
- (if (= (logand bit70 128) 128)
5 m- o2 O S) J A. ] - (set_tile "ltgen" (setq ltgen "1"))# Q! U$ j% @- }; Y" z: U
- )
& W0 b e+ @7 j. a - (set_tile_closed)* M$ c* z% U4 h
- (set_tile_fitsmooth)+ j) g5 ~5 G& E' n$ [
- )) V, d, _5 N; m, Q
- )
2 r/ l! ?! g7 B8 H. t; e - " q: x/ Q1 w5 B: [+ c! t' r
- (if (= (cdr (assoc 0 elist)) "LWPOLYLINE")
1 ]7 t7 n. s% i - (progn% q: n- \! H* V8 ]% Z9 }4 W- Q- S
- (if (not next) (setq vname ename))1 q1 c5 }' f C' g1 u& e; a$ ?1 g) M
- (setq next T)0 r7 o8 |0 }8 }3 g. p5 y `; v; y t
- (set_tile "ctr" (itoa (setq ctr 1)))( l* y) T: g1 s2 D( ~6 `
- (setq vlist (entget ename))
, R5 a. C0 M% b6 x$ p - )
. p' T( k$ e% k; W; Y8 X" C A - (progn- {- ]$ n$ w: l5 A3 @( U6 u
- (if (not next) (setq vname (entnext ename)))3 S2 j9 D0 @6 t: o D' ?( B
- (setq next T)8 G O8 B* {. y& E! T
- (set_tile "ctr" (itoa (setq ctr 1)))$ X; X+ f `; s5 y5 A D
- (setq vlist (entget vname))
, K; `( s3 g; h2 f5 j3 N - )
7 f0 P+ E) j4 V - )$ }0 u% ]& b+ W& A, t0 b; U, W( Y
- (set_tile_vpt pointype)
& \7 a4 z) F/ {: l - ;; Define action for tiles7 h( q0 y, `- e' l; B# Q7 o( D% C
- (set_action_tiles)
+ R: {4 B) n: Z8 D - (setq dialog-state (start_dialog))% f& g, }8 m0 G; v/ _# |
* `$ S2 y' j3 g$ \; s- (if (= dialog-state 0)
+ j0 h( w/ }6 a* B1 A - (reset)0 Q: x6 A! W2 F+ q4 ~) m
- )1 b+ o9 w, z0 z" v1 s2 j
- (if (= dialog-state 1)* ^& N+ h. C6 k+ z
- (progn
3 [3 X9 u4 k% _& ?: H - (modify_polyline)
, x7 d/ z& b& N9 n0 |* i0 |8 Q2 ?. J - (if (or (= pltype "2D polyline") g8 }; U3 r9 X& q2 C
- (= pltype "3D polyline")% I9 R8 K1 a$ [( r! b
- )
; L* }5 o/ s1 h2 t& T8 Q# H$ G - (progn
3 _, W! n. B6 B" W5 j, e8 o7 ~) e4 H; m - (command "_.pedit" ename)# W( p+ B6 Q* a
- (if (= spltype 0) (command "_d"))
- B# S/ m1 P, X _2 [( o0 a - (if (= spltype 1) (command "_f"))
& {( k3 p+ {! d) M - (if (or (= spltype 5)
5 i6 s* s+ k5 v& H/ K" I I - (= spltype 6)
1 m' E& v; s# P/ s - )
+ k; v" q# ?9 x& }& S1 |/ [6 k - (progn
9 r$ P$ `6 H7 {9 ?6 R0 ? - (setvar "splinetype" spltype)
/ @# l k" M3 s; a2 ?+ M - (command "_s")+ H) [* F9 b. {: I& k9 P
- )
# I1 Z& P: o8 z9 L1 \7 k+ \. p - )# N& Q( | e# t4 H' d5 _
- (if (= closed "0")
$ m! d4 w9 A- J& j. y - (command "_o")
& J4 A+ s$ k+ F# u' d# b. i - (command "_c"), E# l1 k3 g) d& n _( o+ |0 }
- )* [+ l: z" Z- G- [) o4 U2 Z8 ^+ [
- (command "")
9 d5 R- n+ O0 ]" H$ d& z L
( o% {0 \* u2 F @6 }: b2 ^- (if (= spltype 0)( U/ H8 V' J9 o* U( z2 \: i; g
- (progn" a f, M" z" v5 i* @
- (setq oldecho (getvar "cmdecho"))
" a: k* j% E! I+ ~8 o: ^' M - (command "_cmdecho" 0)
9 n/ t: Q w o - (command "_convertpoly" "_light" ename "")0 T- a2 C$ ?! k7 [; A
- (command "_cmdecho" oldecho)! T; }+ ^* V7 d- ?+ E; U
- )
! {$ K% q& l P - )
. w9 F7 u& l' Y" L4 o }1 i - )
. A# G3 O& e4 Z) Z4 k - )
- K" @& Y- {! C+ ?# I - (if (= pltype "3D mesh")
; A$ W: J5 h# {0 O4 o% X5 L - (progn
% I J0 ^. v& ^3 a2 y0 F7 L - (command "_.pedit" ename)
* p) N8 i9 e5 A$ W6 ^ - (if (= spltype 0) (command "_d"))
% W; b6 c9 H9 P. q7 C% C X3 m" E3 m% K - (if (or (= spltype 5)! |5 l. P4 p) P5 L
- (= spltype 6)
/ Y, i6 E# A; }) a- T2 F$ y# r - (= spltype 8)
, y" V: e' x' O - )
9 o0 O: D) l" t# R; j8 i$ P. [ - (progn+ ]4 K& R1 W# ~
- (setvar "surftype" spltype)
' z6 R" N9 B2 u) g - (setvar "surfu" u)
. i5 `, }% V# A, d. p/ R - (setvar "surfv" v): A0 B! Y7 s) U. _
- (command "_s")5 f) I, a2 Q9 d- c
- )
* W6 O: i3 b: S7 \2 ~# X - )
8 T, c* G+ n8 U1 ^' L - (if (/= closedm old-closedm)' @ d9 R: H' \6 [
- (command "_m")
6 h- s! K. B% D& Z - ) D* j$ O$ _' E7 [* |$ `
- (if (/= closedn old-closedn)
3 J# c) S( |( K2 F3 a* f8 T - (command "_n")6 k8 }( T/ d' ^% p0 ~) }
- )
) w. A4 K4 m& l; b6 _% i) J - (command "")9 B3 _9 z2 g+ j+ ^
- ), `' T; v1 @0 A4 {( f
- )" J: M* D( F/ B+ s
- )
; [ p7 R# d8 i2 H9 ]" P - )
0 j# ~! r9 y& T, ? D g9 Y - )! Z) u7 R$ s0 W
- ;;, O {4 ^( a; x* y }
- ;; All the spline data is contained in a single elist. We must do some
! F$ v6 n: w$ z - ;; tricky list processing to loop through the elist in order to display' K) v% h# J' n, `3 I! N
- ;; all of the control points.
! P/ o- W, ~2 |$ G4 s/ P+ c1 z - ;;
" {! H3 Q V: x7 ] - ;; The structure of the elist is different for rational and non-rational5 h- r9 n8 O# u `
- ;; splines. Therefore, we check the rational spline flag., P; c J* ~- Q
- ;;
/ K' h3 n4 v( Q: G* s# V - (defun next_cntl_pt (), s: I8 f# t; \/ `2 S
- (setq elem-no 0) ;; elem-no = element counter F0 b1 A5 I# ?* ~ t" o/ p- k
- (if (= first-10-time 1) ;; If first time, find location of first% h7 j, }, V- W4 ^, C: k
- (foreach list_item elist ;; cntl point element in elist
1 N0 a5 S# l$ N$ w$ E7 ?1 G - (progn
7 l- R7 I0 R3 n0 G4 u/ j - (setq elem-no (+ 1 elem-no))8 q, n9 l8 P( }* V |
- (if (= (car list_item) 10)$ q" X2 \0 s0 I% }9 a: J7 P) V2 T
- (progn
' a- m& S0 v' i/ _' w' S% ]6 E - (if (= first-10-time 1)
4 x, c! x9 m2 c, {5 E; O0 Q# W2 v, _8 O; W - (progn
1 d$ `% B& d( J+ i9 |% U - (setq first-10-rec (- elem-no 1))
+ e x( u* K, D7 o% p9 q" z: c8 t - (setq first-10-time 0)
* Y, Q2 l1 o' F1 C! j - (if (= rational_spl_flag 1) ;; if rational- A* t3 ]. O6 T! `- Z# q
- (setq cur-10-rec (+ elem-no 1))) Z; y" u$ E! n- j6 w% H
- (setq cur-10-rec elem-no)
& G& o, |/ s0 x# @2 |- G - )8 S% G: a4 _6 ^6 o$ h% |* J
- )7 y" e( C2 B' h* V: ?
- )% k1 w& V% m$ T! ^% Q3 n
- )
0 H% F* P. R3 T0 Z3 G2 L - )
7 S, Z1 x" \4 Q% d - )
0 j1 Q c H& L' U& F; Q - )9 R4 k* W( u/ D/ {$ [" R& X
- )
5 c% h: z5 o6 f1 U1 q5 Z - ;; Now we know the location of the first "10" record; it's stored
a8 k7 L1 D# b9 Z$ u# s/ J" b - ;; in first-10-rec. The first 10 record was already displayed when
4 u- v2 R: `& w% A - ;; the dialog first came up so let's display the second one when
9 _3 e* j: Y9 V - ;; the user presses the "next" button (the first time through).; H7 S7 m7 e( A& v' P2 c }
- ;;# u. Z" w2 ]6 c# d3 n# w) `
- (setq temprec (nth cur-10-rec elist))
- _1 w/ }; q" W5 Z; y8 }' R - ;;7 A/ e+ z( }# q1 D' C
- (if (= (car temprec) 10) ;; if 10 record4 @( d: Q: A6 @% p: u, w Z6 A
- (progn
$ y( ]* V, D! N) }( }. D7 ^; k7 a B - (if (= rational_spl_flag 1) ;; if rational spline
+ Q* X5 ]" n7 C+ J" c - (progn* x) B: D) k8 G0 `
- (setq tempweight (nth (+ cur-10-rec 1) elist))
9 j4 l' J. \8 b2 n9 z. l- l$ G - (setq cur-10-rec (+ 2 cur-10-rec))
2 j% u" t8 c) ` s6 a7 Q; [$ O4 l - )' u! l6 V) d8 y3 I
- (progn ;; else
3 l/ G1 V( @$ \, G, ^$ S - (setq cur-10-rec (+ 1 cur-10-rec))
$ K# W' F6 H& [. q; v$ i6 E - )
" ~4 h& L9 A' Y* E$ [# g! ^& X - )! @. B! A3 ^# A; ]' {
- ) ;; end if rational spline" ]3 ^6 t6 _/ Z& Q1 s1 v8 l
- (progn ;; else reset counters
% E, }3 F. W, E3 Q$ } - (setq temprec (nth first-10-rec elist)) ;; get 1st 10 rec
6 X4 U& w. w8 n" R* @/ M0 Q - (setq tempweight (nth (+ first-10-rec 1) elist)); x0 X* ], Z2 M% A$ P
- (setq cntl-pt-indicator 0)$ K3 \0 [4 L( Z1 K" B
- (if (= rational_spl_flag 1) ;; if rational
! X! s" S F% I% B; c) X - (setq cur-10-rec (+ first-10-rec 2)) ;; point to 2nd 10 rec
7 M, g, c+ N- c+ r7 |3 j - (setq cur-10-rec (+ first-10-rec 1)) ;; point to 2nd 10 rec: `7 |' n% e5 e2 Y, }; e
- )! k: u) b$ z3 H& Z% b# H; D$ B& F
- ): d, S+ _# |/ h: z9 Q% @# C6 q- e c6 e
- ) ;; end if 10 record
8 ?1 ?* k8 G4 M9 I+ H2 p9 j; a4 g6 a3 _
$ ?0 D1 t3 P. b- ;; Display cntl point, weight and ctr. Increment ctr.
9 [& D/ I( j b. f! Q6 u. d - (setq cntl-pt (cdr temprec))( V+ w* l% e) U9 @5 h
- (set_tile "xtext" (rtos (setq x1 (car cntl-pt))))/ l, R2 m' j( o& b
- (set_tile "ytext" (rtos (setq y1 (cadr cntl-pt))))
6 y. \4 B/ m( `, E - (set_tile "ztext" (rtos (setq z1 (caddr cntl-pt))))& L& t8 R, M- Y2 b+ N! C- S0 t
- (setq cntl-pt-indicator (+ 1 cntl-pt-indicator))/ E" @. I% w7 R! v) h
- (set_tile "cntl_ctr" (itoa cntl-pt-indicator))
K2 g7 B s$ ]# j# H - (if (= rational_spl_flag 1) ;; if rational
+ V- n# l' m4 b: e& S - (set_tile "weight" (rtos (cdr tempweight))) ;; disp wght/ b& Q! U8 K$ W9 a2 G
- (mode_tile "weight_text" 1) ;; disable wght$ g* W) N2 [' _6 J4 B' ^
- )
& l2 A& Z# _# M" C7 O! l - )# n4 P$ n' m( P1 U
- ;;8 ], S& ]) |% ]7 g! O7 q# ?" g
- ;; All the spline info is contained in a single elist. We must do some
' P$ ~4 L+ `1 z. z# | - ;; tricky list processing to loop through the elist in order to display
! @' L4 g" ?" ]9 P& j - ;; all of the user data points.
7 X8 m3 e& C8 B) \ - ;;
. x% B" n6 t' g4 _! W- P. D! d& ^ - (defun next_data_pt ()
& c n: U* d N/ w m' d) z; W - (setq elem-no 0) ;; elem-no = element counter! G6 W% `5 ], h
- (if (= first-11-time 1) ;; If first time, find location of first
D7 W2 L9 z ~8 B0 \ - (foreach list_item elist ;; data point element in elist
) X* M# z8 e- l - (progn
# z" V# h! f' [$ ? - (setq elem-no (+ 1 elem-no)): E i: j9 z5 G9 V7 ]* W( @
- (if (= (car list_item) 11)
) ~, Z1 o% L& P& \" C+ Q, L - (progn# P8 a# S* w; p
- (if (= first-11-time 1)7 |2 V* s" b$ y/ o& p* B+ k
- (progn! d* A1 b: Q0 ^3 T
- (setq first-11-rec (- elem-no 1))
4 I' P0 U5 Q6 X - (setq cur-11-rec elem-no)& h( }) ^1 R3 F% Z/ F& K, t
- (setq first-11-time 0)5 ~) Q6 g6 S$ q2 ^% ]
- )
o2 S8 Q# u* O8 J: ?- p# h - )2 f" r0 h* a% \$ o0 Q" M- q
- )
$ G9 S ?5 Y/ {( `9 r8 p, w - )7 W7 b2 V7 B- G" |" c0 P
- )9 }; k# a2 g; P5 }9 }
- )( b% o" c$ j9 C( E+ m
- )) B8 G- F/ k2 f' [. g9 `+ @( z; f
- (setq temprec (nth cur-11-rec elist)). H% Q" u; v3 d$ A) H2 D5 P7 u! J
- ;; If it's not a DXF "11" element then we've gone past the last
* Y- @) H* U, w, Y: M - ;; "11" element. Go back to first "11" element. Reset counters.: L- O; l: \) J1 X; [3 X2 h
- (if (= (car temprec) 11)
7 i* `5 c; d( U, K( \9 b% N6 W - (setq data-pt (cdr temprec))
* i0 c! j$ m7 I/ M - (progn ;; else
+ U2 t4 E0 _6 R: s - (setq data-pt (cdr (nth first-11-rec elist)))8 @" ?: z7 E+ e/ [$ R$ v* i
- (setq cur-11-rec first-11-rec)
{' A: Z/ d1 l7 t, y( ~/ b - (setq data-pt-indicator 0)
$ N1 T# R' t- m - )9 ]" H/ u* u0 W% Z4 Y
- )
2 D+ s; }: N: @+ U% i- j - ;; Display data point and ctr. Increment counters.
7 \* _& A7 \1 V3 o& g7 M/ c - (set_tile "dxtext" (rtos (setq x1 (car data-pt))))
5 g5 a* H! `3 I& j+ W* R3 O - (set_tile "dytext" (rtos (setq y1 (cadr data-pt)))), m1 N8 @$ {4 ]' f; T' B+ g% M
- (set_tile "dztext" (rtos (setq z1 (caddr data-pt))))
, M d, S1 o0 y - (setq data-pt-indicator (+ 1 data-pt-indicator)); }6 g4 g+ m9 c3 d5 }& }4 F. y
- (set_tile "data_ctr" (itoa data-pt-indicator))
- M" p5 S A; B( x! O% h - (setq cur-11-rec (+ 1 cur-11-rec))
) k5 q% o5 o0 Q0 j - )/ ~* Y- m" i: S4 i
- ;;# R) b: @3 `: [& g6 x; n' \ h
- ;; Modify SPLINE
* x T1 j4 y6 ]3 U/ m, m1 R - ;;0 d+ Z! b, w' Z% N# f
- (defun modify_spline ()
/ M: Y9 m, B- d% d y- g" i - (modify_prop_geom)% P b5 `$ `6 _
- (entmod elist)
& P* @' V; D/ Y9 I. q! d2 C - )
* f2 ?: ^ i; I$ w
9 V' L6 b! Y m' E5 p- (defun ddspline ()
' O0 {1 i2 H2 u; j - (if (not (new_dialog "ddspline" dcl_id)) (exit))
0 \' ^4 D4 `8 Q; F. N& h - (set_tile_props)8 t# f8 p, C, _7 }
- (set_tile_handle)( n9 l" g6 c/ }- P: y
- (set_tile_spline_props)
, X$ t+ v P- @! V7 p% r - ;; Display first control point$ T, |8 M( U& \. F/ j
- (set_tile_cntl_pt)9 u9 d3 L" h/ w0 o
- ;; Display first data point
2 O$ d" h$ E% h2 z% h$ _% K; g - (set_tile_data_pt)
9 S8 J6 D I5 z4 f; N& D3 _
! \1 j+ \. y' }8 G% M6 e- ;; Initialize flags to indicate first time through the dialog.
$ |" h: y- [" h% J6 s - ;; For control points and user data points the "next" buttons
+ I b' ~8 I& o - ;; in the dialog call the appropriate functions.; u, W1 q" c9 S( k. l1 P9 T! q4 L
- (setq first-10-time 1)
- X' y9 M, {" ~ - (setq first-11-time 1)
. a+ u" {" I3 ~! O) G/ k9 Q - ;; initialize control point number counter$ ^7 Z0 Z! K) R* e t1 D9 \
- (setq cntl-pt-indicator 1)& H$ F" ^3 F, a8 A7 g5 E' _
- (setq data-pt-indicator 1)! E2 P, H& y* ~0 |* K
- (set_tile "cntl_ctr" (itoa cntl-pt-indicator))
r3 Q3 }* G, \: x" r" F H - (set_tile "data_ctr" (itoa data-pt-indicator)) h1 @* x: R9 G6 R3 E
- (set_action_tiles)
8 o, S/ g$ V, H/ B8 F/ U - (setq dialog-state (start_dialog))! m6 `( r- ], q7 i
- 4 F. u* q0 U; S" E
- (if (= dialog-state 0)
% _" F8 w# M( x# k" b5 k5 h) h - (reset)
2 S% a/ b5 A% L$ R. W8 b - )
( E; {5 I7 I6 }- u - (if (= dialog-state 1); Z2 A8 z( j7 e& }/ N$ p
- (modify_spline)
2 g6 E2 m& i, ^6 ` - ). Z' x, f& j" }' k; f
- )9 Q1 K% n4 ?9 S1 y/ p8 v+ O
- p+ c' `/ ^5 [' P% e3 r
- ;;
2 q @9 P M* s* x8 N - ;; Modify DIMENSION
5 y! p3 F1 G' B/ C7 U - ;;3 h0 G- u0 K( ]% X3 R$ ^7 L
- (defun ddimen (/ dtypebit blkname bename sublist a stname n dimtbl8 Z/ u, h9 h/ g: M' Z, @. ~
- dimsty dimlist dimtext svtext dimovr sv_dvlist stlist+ d, `) ]6 y5 Q) j% W
- dimtype dimsvcurset)$ H5 W% e& O! y D" k9 i- z
- (setq dimtype "DDIMEN"# f7 f) J& K) ]8 P, j/ {
- dimsvcurset (ddimen_dimsty_restore)
$ J' Z7 i1 ?9 G* [8 o - )
# P( I$ }: a3 v5 F, }' @! k) Q1 b - (if (not (new_dialog "ddimen" dcl_id)) (exit))& `+ s: z7 N' p) X
- (set_tile_props)
6 E; k7 D: S" N/ D' [ - (set_dimen_props)
. ^6 d9 } ^$ o4 i' m% U - (setq dimtext (cdr (assoc 1 elist)))8 X( n G$ y, o, h3 `2 Z& Z
- (set_tile "t_string" (if (= "" dimtext) "<>" dimtext))) f9 f" c9 ~# M5 O& Q' n( ]
- (set_tile_handle) y# v8 J9 [- |1 i6 @
- ;; Define action for tiles4 ]- J' \- D# b' S
- (set_action_tiles)# t& B' B3 Q, L6 Q5 M8 n4 d
- 6 R9 y( `2 j; p" d& `) T" }
- ;; Set initial focus to text edit box.# ^& m- D( \7 y" ~
- (mode_tile "t_string" 2) W! v; E/ ]. q, b
- : b+ R6 I1 J+ S
- (setq dialog-state (start_dialog))4 Q: x5 N5 g! _- p; t
- (if (= dialog-state 0) e6 O6 H% Q8 Z/ K+ e; C
- (if (= ddimmt 1)
( W* G; J+ Q" l9 g V - (reset)
$ g. P' ?( Y, n% ?; [2 C - )
5 @" k r B& v7 Z - )7 F: W5 [- ]2 l2 C4 x* u
- (if (= dialog-state 1)
+ I; R* j; [; |) z - (progn
b9 f4 X) p0 I5 D: ]+ q - (if (/= dimsty stname) n. Y, q7 k+ Y- k* [% P4 I
- (progn
! S( m- a8 U0 Q6 Z% b* e9 g - ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case
8 Q- V& i) K0 z - ; doesn't have it.
' x. `" X5 r# x, X - (if (null (assoc 3 elist))
+ J$ K! e# O0 x; z, K& ?! @7 C - (setq elist (append elist (list (cons 3 dimsty))))$ ~& u2 f) d4 f* J i
- ; else just replace it.
9 p- S5 o0 p8 b - (setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))% O$ ?7 ]* d9 t1 V* A2 A
- )" V# Z! B# R- M6 [3 {
- ; refresh sv_dvlist with new dimstyle.; s! j, ~$ k- c2 m6 s- A z
- (setq sv_dvlist (tblsearch "dimstyle" dimsty))
& y2 x, R0 B5 ~) O* L# K9 {9 { - )
# [& B q8 f7 F - )
8 s0 h8 A8 a0 {3 E& S - (if (not (null dimlist)) ; attempted to change dimvars
- ~" r: j6 _' |' ? W' {7 p3 m - (ddimen_complist sv_dvlist dimlist dimtbl), D( N4 C+ R* E9 T
- )
- A# f, K+ s3 Y0 R+ e7 i - ; Modify dimension text
3 P3 u& t, N; L1 y. J0 ] - (if (/= dimtext text) M* T0 a" [: W" Q7 I/ Q
- (progn; x0 L9 A. y3 z' N# ^5 N
- (setq dimtext (if (= text "<>") "" text))
0 B& D3 k3 q" [4 {% W# Q - (setq elist (subst (cons 1 dimtext) (assoc 1 elist) elist))0 M" l5 B1 n' j. I
- )# R5 M: x1 F- ?' F
- )
1 ^# m" S, q% r: Y4 I: _( T8 Z - (modify_properties)& s+ A; B( E3 l+ d: v0 }3 T1 X
- (entmod elist)- k8 {4 q4 Q( [2 M& m
- ). z' ~% Y; M9 K: v) V4 h9 ~" L! f
- ). E2 l F! w5 k0 d: Q! C/ r
- (if (= dialog-state 4)6 K% S$ P2 P. c0 }4 D9 |
- (progn% }2 a; U1 c$ i( X
- (setq ddimmt 1)) Q6 W- ^% ]- E$ o
- (if (/= dimsty stname) l& p( h9 f: c
- (progn
1 q- D) {! e2 h0 | - ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case
! G" Q, a. H$ G1 v - ; doesn't have it.
' E6 u: ]( g1 n! W4 [( c; ~ - (if (null (assoc 3 elist))% ~" G( D. p$ s3 P: v
- (setq elist (append elist (list (cons 3 dimsty))))" s) l. h: g2 M: ]9 l
- ; else just replace it.
# v& Y' h0 l M9 e+ `* \' }8 j - (setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))
4 `, k- R4 M. Y7 \) S - )
: q6 e& E4 O3 z4 T9 r' g# c - ; refresh sv_dvlist with new dimstyle.# ?5 d: J! Y7 q9 d+ I- ^# a
- (setq sv_dvlist (tblsearch "dimstyle" dimsty))
) g7 a9 ]' t* ?3 C+ Z: f# J. ? - )
9 Z4 C0 [0 h! W0 ^4 o2 m2 c' J' { - )
2 i: o0 n8 H; M7 l - (if (not (null dimlist)) ; attempted to change dimvars
8 ^2 s5 L1 m4 | j - (ddimen_complist sv_dvlist dimlist dimtbl): C, Z* S6 x. l% L+ S6 P5 t( j3 C
- ). L; O3 |7 S* U, t
- ; Modify dimension text& H, {3 h) f5 L, T8 s
- (if (/= dimtext text)
+ @2 X) Q) S8 K& s7 } - (progn% M5 |$ _! }+ ^4 a+ d- }! ~: u3 l, P
- (setq dimtext (if (= text "<>") "" text))
0 m- _! [6 h0 f - (setq elist (subst (cons 1 dimtext) (assoc 1 elist) elist))* D" [+ A: x) n! a
- )" Q8 H" x T8 h
- )
1 }. z" ?" d3 {4 Q. h7 f - (modify_properties)
; Q7 x4 V9 v$ b k" b* X1 m - (entmod elist); L( O( k- o- u; ?9 w
- (safe_ddedit ename)
* ~+ _* C2 z, S4 T+ O3 ~ - (setq elist (entget ename))
' b9 N/ j' Q$ B% m" N8 J - (ddimen)
* O- g: C! ~# K5 E. [: | - )
& U0 Q% B1 I- o6 k' u8 E% b4 Q# r v - )0 J& z3 E# [; |0 |4 K
- (ddimen_setvars dimsvcurset) ; Prepare to exit. q% n1 j5 I' a5 U; V7 X
- )
: W- z; f/ Y" Y: X9 S ]; W
9 ~7 S' K6 I- P. \- ;;
" W% y1 Y3 D; I - ;; Modify TOLERANCE
3 u/ o. P% ~, X) d! t! n' s - ;;1 d1 ]: z# E c+ K7 S4 z1 w& s& z
- (defun ddtolerance (/ a stname n dimtbl8 y& }; ^+ M% N6 z. Q+ Z. s
- dimsty dimlist dimovr sv_dvlist stlist dimtype
: W% `6 m, O) r2 [4 C% R8 n( J+ G - dimsvcurset)4 P6 A, z' j2 t8 U4 @# |$ X. r
- (setq dimtype "DDTOLERANCE"' X; l( g( u3 X( T: D" Q' R
- dimsvcurset (ddimen_dimsty_restore)
/ o+ Q* m/ P7 E$ p - )5 H2 R' l0 Z1 z' ?
- (if (not (new_dialog "ddtolerance" dcl_id)) (exit))" a; F5 R, P' I
- (set_tile_props)
& ~# c/ q& _7 p$ H1 B0 o - (set_dimen_props); D) c8 e9 M" y- _2 w
- (set_tile_handle)" y- p( M( b8 @/ Q) v! q6 x n5 m$ X
- (set_action_tiles)
0 E* |) q& q' o9 k! B! a$ R& _. w, D - (setq dialog-state (start_dialog))
5 ^! ~! Y/ I6 ~& c - (if (= dialog-state 0)$ n* \# T9 F6 n" o1 i/ k; Z1 x1 k
- (if (= ddimmt 1)
" T m0 u5 j7 m - (reset)% J8 ?. G. M, `5 H7 E; N1 }
- )
( }3 ~' d; {4 l( `" _ - )
9 k+ T3 u) ^# V - (if (= dialog-state 1)4 C3 [ m) ~, ^9 e
- (progn' H. O2 D7 t1 E, `: B, U2 l
- (if (/= dimsty stname)
; b( p# u' n' c, [' E - (progn
$ e8 d* L9 Z. l- Z - ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case& u* ~: E5 }) n0 a$ c
- ; doesn't have it.
' R" D0 ]4 _, }, i" R - (if (null (assoc 3 elist))4 o6 d- D) P1 o* `9 g
- (setq elist (append elist (list (cons 3 dimsty))))
2 Q" P# F" G4 b3 c2 h! }9 F - ; else just replace it.) m2 J( c4 D& c0 F$ K0 r6 t
- (setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))
1 S$ k* X* d+ U2 s8 ] - )
- Q+ p! _# A' x) }& E4 \" @ - ; refresh sv_dvlist with new dimstyle.% L X* |! }$ z( E2 S3 Z+ g. Q
- (setq sv_dvlist (tblsearch "dimstyle" dimsty))
2 t) p2 W7 O2 Z& B: I - )
0 w8 S7 V7 G( p$ e4 n* o - )
. E/ _$ g1 y3 u8 [4 t) G - (if (not (null dimlist)) ; attempted to change dimvars. j6 J6 E9 H" T' V
- (ddimen_complist sv_dvlist dimlist dimtbl)" H* y; h4 U: J. {
- )
; ?' J( E$ }. [( S' j+ Q$ F - (modify_prop_geom)
5 {$ b% c9 p; w5 d$ ~ - (entmod elist)
0 u0 ]7 y9 f9 a: T - )
% }4 N5 o( S* S - )0 }5 {4 ?5 Z2 M
- (if (= dialog-state 4)6 k+ d2 s9 ?4 z
- (progn
7 X6 v% ?% @, E p - (setq ddimmt 1)
# c& |' I7 ^; b7 g - (if (/= dimsty stname)
0 H4 Y- h- c [+ y& f& N7 ]4 v# [: [ - (progn
: N# i$ e3 H3 S; A* R2 j0 G. d8 g, L - ; Be sure to add (3 . dimstylename) element. R12 *UNNAMED case; L! d3 `6 e; s3 C
- ; doesn't have it.% y a/ o) I$ f# f; q; E: h- U1 f5 V
- (if (null (assoc 3 elist))* Z4 k; o: u, n8 M5 m1 A
- (setq elist (append elist (list (cons 3 dimsty))))
: G$ \2 h2 E9 U6 q1 L - ; else just replace it.& \/ F8 h0 F8 T. E# S! G, n! r
- (setq elist (subst (cons 3 dimsty) (assoc 3 elist) elist))
. r- n( |1 G9 t+ S; A - )
% N- ^8 _2 ?/ z! |1 @ - ; refresh sv_dvlist with new dimstyle.; R0 ?- ?' T, W& X! d: P% j
- (setq sv_dvlist (tblsearch "dimstyle" dimsty))
' c3 C b! u! T1 K - )( p) ^- P* C: j
- )
3 B3 L! k4 |: }8 ]* \- }/ [- | - (if (not (null dimlist)) ; attempted to change dimvars3 e$ U; z n! l
- (ddimen_complist sv_dvlist dimlist dimtbl)! K7 U7 S% j1 B* J' \
- )+ r1 D" P K* i6 J3 s
- (modify_properties)
S" B( L' h, }) K$ n. {4 x - (entmod elist)
( u3 [& I0 E: k4 M& t( ~* M$ L - (safe_ddedit ename)
; z) G4 g1 ?5 h& X - (setq elist (entget ename))
7 ~- C" |- j# ] Y0 ^/ B8 r - (ddtolerance)2 L6 H- V, Q2 P" \
- )$ {9 O( c+ @% l9 s9 p3 k
- )6 Z3 s0 h2 o6 m, R# G9 q) g/ i
- (ddimen_setvars dimsvcurset) ; Prepare to exit, ]# X" ^" v5 L8 v& P; [) q9 _
- )
; X8 p3 |/ U5 ~& C- @! f
7 R. T f% ]7 O% Z3 `' V! s- ;;
0 [8 h1 q( s" n% y/ z, p; Z0 `2 q - ;; ddimen_dlg - jump to ADS ddim module
( s/ _2 {# @3 \3 N* M- ? - ;;' ?. b' Z: a' d* N _' w- E
, l4 t1 s8 `) t) ~: o I- (defun ddimen_dlg (dimtype tile dimsty dvlist / dimlist)
0 F2 l/ g% S/ ] - 8 g, B) B( _9 l% N
- ; Jump to DDIM with overrides if any.: E2 s7 y* V$ R6 @
- (cond ((= tile 11) (setq dimlist (c:ddim "DDMODIFY" dimtype tile dimsty dvlist))) ; Geometry- f b' `; z6 c3 i( W7 i% N: g
- ((= tile 12) (setq dimlist (c:ddim "DDMODIFY" dimtype tile dimsty dvlist))) ; Format
2 [9 n2 P% t* _$ t6 Q* t: w - ((= tile 13) (setq dimlist (c:ddim "DDMODIFY" dimtype tile dimsty dvlist))) ; Annotation: }) G+ U" c8 j* Z h
- ). }2 m$ k5 j7 p' N. a) ?
- )
. s' n. ?0 A# N j, O/ g7 T - + N/ G( a) ?5 {) z) o: ]. k
- ;;
5 T8 b" j' r+ t( x! g5 p( W - ;; Dimension variables updated are stored as overrides.
" ]- f) b* @- I( L4 h. A7 k - ;;7 R3 U: G6 q5 c$ d
- % L- b6 F0 y8 Y3 v1 w
- (defun ddimen_complist (dimolist dimnlist dimtbl / i odvar ndvar
7 v/ t# P- I: B8 q$ t! a% O* Z& ?: w - dv dime commandIssued)
" A$ A- w8 |' }! C6 l, S# S% }2 h - 1 @# ~6 O1 X* J; N3 q
- ; Here we skip the following first three items:( ]% a) a' K/ r
- ; (0 . "DIMSTYLE") (2 . sylename) (70 . 0) h$ I& _& C9 g' V0 |9 \$ `4 {
- ;& _% Q) m' m. j
- ; The list comparison immediately begins with dimvar.
) V7 b* O9 O/ R# e3 a! H - ;% x0 x* I3 S+ J/ `
- ; dimolist - original states of dimvars" i! k7 @% A1 r# w
- ; dimnlist - new dimvar list which is of the resbuf's
/ b: U: ^& f1 U - ; dime - entity name for the dimension
) i3 Q' l8 Z7 v" J. @0 `; V9 E - ; odvar - value of dimvar for the dimolist% @0 A4 W. u; m+ z- Y( [* u
- ; ndvar - value of dimvar for the dimnlist' f* o, Z, }; G3 y
- 7 G/ _: R5 A! z' D
- (setq i 38 @( ^/ N- @4 j+ P5 A
- dime (cdr (assoc -1 elist))# z3 \5 v f' V% {, G/ w/ @
- )! T* q4 z! S/ K. U: c' h
- (while (setq odvar (cdr (nth i dimolist)))+ B* K3 K( _9 j* ~
- (progn
' x2 Z5 J! g; M7 Y& c - (setq ndvar (cdr (nth i dimnlist)))2 x. w! [ F1 q9 L0 z& O
- (setq dv (nth i dimtbl)). l/ k0 `& Y Y
- (if (eq dv "dimtxsty")
" i5 m- ~* R$ n6 {+ a" y - (setq odvar (cdr (assoc 2 (entget odvar)))5 g# _) d& `8 d( H/ x% O/ ~! C
- ndvar (cdr (assoc 2 (entget ndvar)))/ p+ R& {) B8 p: a# d, Y5 D
- )
' B, w' T) X; B" j - )# d' U: P) M. e @
- 7 @- e) X5 v; `4 }+ U
- ;& G* o) W# }# q8 j1 O
- ; In order for DIMOVERRRIDE to operate correctly with string$ ]" y ~+ S- \
- ; based dimvars, we must pass "." versus NULL strings.9 v. T9 n- w* C9 n
- ; In this case ndvar is the new dimvar value the user wishes% |6 ]% Q- }5 }$ C
- ; to update on selected dimensions.
1 R/ z0 c: `. C3 Z% n' i - ;
$ o' f$ n1 d: ^% d- e9 I( d# X - (if (/= ndvar odvar)
1 C3 Q* {/ Y! Y+ R) m4 T" `6 @ - (if (= 'STR (type ndvar))$ y7 e$ x7 j) d4 I C. W
- (if (= ndvar "")+ C9 _! w8 g4 o5 R/ {$ o
- (setq ndvar "."))))
' l6 A [/ Y( x! M8 l8 S - 2 e: |( E# @! ~. k/ _ o
- (if (/= ndvar odvar)
7 g! y; o/ a0 G( l3 ]- ]/ k - (progn
6 Q5 v2 u$ Y+ A+ _, x - (setq dv (strcat "_" dv))
- K- ^0 q, B9 U3 r/ l) q - ;& l. A5 F4 G6 t3 t" r/ D9 R
- ; Start the dimoverride command
* F6 ` D \5 S \" D% C - ;0 q- W' s- C+ @$ w2 y5 `
- (if (not commandIssued)8 R# e9 _- f/ e
- (progn. F' U$ j4 C; t/ t2 W2 q3 S0 s
- (command "_.dimoverride"), V/ t, t7 b C7 z, Q
- (setq commandIssued "T")
C' }; Y2 _0 ?! o) S - )
% S. ~! a8 k6 _$ h - )
% ?, f1 R# D/ T" Y: t1 \ - ;
* a7 B8 u0 O: J9 s3 _" E% S2 ^9 ], p - ; Issue dim overrides, g% E# x" Q' ?' `/ ~
- ;
0 Y1 \1 {# V+ f+ W! q - (if (and (or (= dv "_dimclrd") (= dv "_dimclrt") (= dv "_dimclre"))
4 y0 g+ Q& C' j U6 l - (or (= ndvar 0) (= ndvar 256))' n8 n! T; O# l8 _5 z3 m
- )
8 o9 m# R8 W. o$ z - (progn
1 x# {4 L; m" J- V1 B2 p - (if (= 0 ndvar) (command dv "BYBLOCK"))4 {3 K; r: K. p7 J2 F: o8 c
- (if (= 256 ndvar) (command dv "BYLAYER")), v) `) p! G5 |4 H. ]7 l5 z, t
- )
5 n7 ?5 k7 C. v - (command dv ndvar)
+ j3 C! `4 `+ y# Z( H - ), d+ i @* ^! l2 h- J
- )
. u" n* Q" |% `, n- T - )" t6 j J* K9 D' a) m
- (setq i (1+ i))
4 l$ c7 k0 y9 h' g7 u; e' D! D - )
+ H3 ]' e) ?# g6 R7 F. Q - )$ I$ {7 C/ `8 n7 N! L8 X4 j
- ;
1 ?$ X- p0 e* x- K7 I - ; Select Entity and terminate command
' ]1 c; d7 R( |- l6 s5 @- S& s - ;5 i C0 |/ D0 L+ {) v4 ~3 W
- (if commandIssued
% `+ j$ w( s( w. L# Q. k5 ` - (command "" dime "")
* e8 a4 z5 A+ J$ v1 { ? - )
* v9 h4 f6 J7 B7 ~* M' r1 q - ): x' r( X4 V1 f0 M6 Y `: u1 @
) i$ s5 `. n/ d- ;;# g4 B/ |$ p3 D6 X& \3 m) y8 r
- ;; Get style name currently selected style name.: t$ w0 d, u# b& `, Q+ W- s
- ;;
$ n0 H/ K1 P% F
3 {% i6 _$ z( W( ^" j- (defun ddimen_style (/ dimsty)
7 }6 z3 ?: w+ i. b# u4 S5 V! r3 X - (setq dimsty (nth (atoi (get_tile "mod_style")) stlist)
) g2 r9 D3 ]4 K5 z& f% h - dimlist (ddimen_getdimvars dimsty)
8 ~+ w( J( M, n0 ~: v) L7 g" N+ d - )
: M1 @0 ]% ^& X0 m8 O! S - dimsty* \; t7 G5 @7 i1 `
- )
, l/ u' x8 ~% R0 T& R - 9 z, j4 z8 w5 E' _
- ;;' I. y- O$ b" l! Q3 j7 C# H
- ;; Set dimvars# ]0 E* q) [+ K5 W
- ;;
% Y) L7 r9 Z" g1 k6 L, I$ {/ u - (defun ddimen_setvars (dimsvcurset / dv i)
* w8 U1 ~8 N1 U7 z - (setq dv (cdr (nth 1 dimsvcurset)))
9 i8 f }9 C+ w. W! F - (command "_.dimstyle" "" dv)
, i9 i3 N: m8 q" X/ n - (setq i 3)! @; i( B% U+ x# J- R0 b! ]( C2 V9 w& }
- (while (setq dv (nth i dimsvcurset))
: Q% v& M0 k6 M/ n2 D; L3 ] - (progn
0 u0 c/ U8 O* }! g) V - (setvar (car dv) (cdr dv)), R: F: r7 N. P& Y" I+ m
- (setq i (1+ i))
6 T4 f( Y* k% A! I: c7 m - )
4 x, s) v, e1 |4 u2 ^% E4 ] - )! ^, X6 i, g( ^6 @8 V: V
- )
" X( F7 U! r( Y+ l% ^# q1 A- f* q& K - ;;# T6 b6 q5 p I y
- ;; End-of-dimension
3 `: c# L; p2 ^* p8 S( l) {% f - ;; ==================
* E8 X, r# v0 Q Z - $ }& T( H0 w2 J* s2 n
- ;;# _' |6 w* p4 E" @. j. o
- ;; Sub-dialogues for properties. Common to all object dialogues. l+ I e1 R# F ?7 R
- ;;, c6 `" s' B" G4 }' i
- ;; This function pops a dialogue box consisting of a list box,image tile, and
4 ~! h4 i4 H' w+ p H' F1 ~* |4 C - ;; edit box to allow the user to select or type a color number. It returns
2 p/ E: Y2 z$ O- O5 c6 M$ D - ;; the color number selected. x" l% o) e7 v$ w! v( C! u2 \
- (defun getcolor (/ old-idx colorno cname lay_clr)
' e9 W2 ?( B, G# m* U - (if (= (get_tile "error") ""); A$ T$ p2 X* G9 Y& `+ X
- (progn
5 u% ?7 o& Q( f: a. f$ N2 O3 Q - ;; Get the color associated with this object's layer, for use
& V, H y6 o- p; D- M7 O0 J - ;; in the color swatch if the user selects color BYLAYER.
6 Q) M( z0 g7 W: ?. B - (setq lay_clr (cdr (assoc 62 (tblsearch "layer" elayer))))
. v& {+ @& v* q ^' q2 H) { - (if (numberp (setq temp_color (acad_colordlg ecolor T lay_clr)))
0 f5 b, }3 `0 b9 l - (progn' N ^8 M' Z9 B {; k
- (setq ecolor temp_color)
9 G; Y ~, }* ]5 X9 n - (setcolor)% G0 D3 l. j; {. Q. [
- )5 g& d5 R5 I R, v4 C! c! B4 w: H
- (setq testcolor temp_color)
C" N3 W2 x" l, f - )
9 {. e$ f- k$ T* }) f - )
8 s) a. h, I( U - )0 W; {' `. S ]# [' T' H7 B
- ecolor
$ w8 ]9 G9 s( N/ N |3 T- S. Y - )
5 Y, t' j+ E" r - ;;. c) J5 S! w9 t+ z( B a
- ;; Function to set the color tiles. }: i( a1 S) u3 ~2 c
- (defun setcolor()
! i; q* Y7 K: r+ o( o" F: i5 X - (cond
# }( e7 |/ X# D( Q' m& b - ((= 0 ecolor)
4 [' j" J) _8 C# O6 [7 E - (set_tile "t_color" "BYBLOCK")
6 p* z9 J) ?3 N8 w - (col_tile "show_image" 7 nil) ; show BYBLOCK as white
9 w6 S6 a, ^" J# q$ C! S7 Z# M - )
1 H7 j7 `3 Z# {8 u* } - ((= 1 ecolor)
1 P$ B4 K0 R8 t1 V2 p - (set_tile "t_color" "1 red")5 M! C; C; |% o( q% K
- (col_tile "show_image" 1 nil)
! l m. Q) O( b8 F( w0 B: O- W - )
+ ]1 y0 n8 z: [, K- u - ((= 2 ecolor)( r3 Q. g$ z. o
- (set_tile "t_color" "2 yellow")
5 o" U; w6 g: _, @- v0 Y4 W2 b: ` - (col_tile "show_image" 2 nil): |9 J. q& F- i9 Z( `
- )
! o+ G3 d6 r- N6 ~$ L - ((= 3 ecolor)
5 c5 C: N- u" D/ H$ a: ^5 c - (set_tile "t_color" "3 green")
: C6 |+ l! j! c" V! t - (col_tile "show_image" 3 nil)! B- l* \; e9 Y5 c: ?
- )$ ~, x5 X# n4 K4 E! _
- ((= 4 ecolor)
& K' T- C* j* @8 d- g# u - (set_tile "t_color" "4 cyan")
1 u$ m! f P. m# K& j/ @ - (col_tile "show_image" 4 nil)& @+ Z `, }6 t) J) q2 f
- )# g' p. o1 |3 o# o3 r
- ((= 5 ecolor)
) F: V3 ^% f6 J) |+ K# F* O - (set_tile "t_color" "5 blue")- W1 D. v) P; l9 l* A( F0 a* {
- (col_tile "show_image" 5 nil)
& o$ W" D# t# L: G; n+ n - )/ d' L3 }( ~/ N* m+ B
- ((= 6 ecolor)( s8 @2 p* ]. ?
- (set_tile "t_color" "6 magenta")
4 P4 |. E3 w9 ^ - (col_tile "show_image" 6 nil)" R' Z: N7 {) e
- )
! }) E& O9 a( K: n4 ?+ G - ((= 7 ecolor)
0 K' z/ X) y9 u - (set_tile "t_color" "7 white")
1 @7 G( D4 A7 p) B* {# D7 m5 M - (col_tile "show_image" 7 nil)+ b3 {. M$ P; @& J
- )4 Z. F3 Q0 z; ?
- ((= 256 ecolor)% u, {' w+ j6 ?1 d3 I
- (set_tile "t_color" "BYLAYER")# a/ g# ^% o) o2 |8 a
- (col_tile "show_image" (bylayer_col) nil)
9 L( z K% \1 Y8 h2 P ? - )3 v( Y3 f4 j0 \! @3 L* E, m4 ~ p
- (T- t' V' k5 @' R/ N* S2 o
- (set_tile "t_color" (itoa ecolor))
% t2 g4 O7 M, q, _( q1 K$ X; j - (col_tile "show_image" ecolor nil)
. i1 N+ N6 w( b) F3 N. d - )8 j9 i1 A# V, a9 i. K
- )2 {. W" e6 O9 D, c$ q
- )
/ o7 R; S, [% u1 B7 s9 } - ;;
/ v: q- U: z. X1 b - ;; This function pops a dialogue box consisting of a list box, image tile, and$ Y. h8 L) ]( O
- ;; edit box to allow the user to select or type a linetype. It returns the' i0 ?' a6 }, H
- ;; linetype selected.8 U0 C. W9 F1 E6 }, [. e
- ;;1 d3 z) Y' F4 i' K; B u1 I
- (defun getltype (/ old-idx ltname)
! M; K6 d% P. o ~4 r - (if (not lt-idx)
- q, I& ^1 f$ l0 z$ I( B" c - (progn
0 b4 F) P: g+ c2 c) S% o3 X - (make_lt_lists) ; linetype lists - ltnmlst, mdashlist
6 r# w& s: b2 v - (cond
* z! [9 P7 l) D* n% r - ((= eltype "BYLAYER")
9 D' s/ o5 n: R- M9 A# A+ p - (setq lt-idx (getindex "BYLAYER" ltnmlst)))9 s+ T( w/ ^# y! U$ r4 S) t
- ((= eltype "BYBLOCK")% k4 D3 M2 O( Q$ s7 u; u
- (setq lt-idx (getindex "BYBLOCK" ltnmlst)))3 i& k' p; y& [9 u) V
- (T (setq lt-idx (getindex eltype ltnmlst)))
2 \2 X& |+ i3 c& S* v: R4 r - ); |# a {0 x8 _, x5 B2 p3 V+ B
- )/ U8 {6 C0 L6 \# ]# P& G- \3 J" Z7 r
- )
6 S6 i* l3 r4 e' @+ a" ^
( V- c/ d( W- Z/ ^1 p- (if (= (get_tile "error") "")/ Z) y* D# j9 o5 N p: j
- (progn& e' ]3 k* P$ l& M0 ]
- (if (not (new_dialog "setltype" dcl_id)) (exit))
" V% N& f# I/ I5 D - (start_list "list_lt")
$ }0 K t8 C' l2 t7 E - (mapcar 'add_list ltnmlst) ; initialize list box& ]$ A) a) Q' X7 |2 X; O$ T& I
- (end_list)
p* e. a; M. ` J - (setq old-idx lt-idx)9 W4 m/ k+ `* B c5 z' ?, J
- (ltlist_act (itoa lt-idx))
. O& m; ?, e+ I& i - ( w& ]3 B+ j8 j9 ^2 O( t! U
- (action_tile "list_lt" "(ltlist_act $value)")
: C; ~. _6 Z" e- l - (action_tile "edit_lt" "(ltedit_act $value)")& v. a" Y8 \ O; @6 ]- t8 @
- (action_tile "accept" "(test_ok)")
" ~: B& a, E0 R! } - (action_tile "cancel" "(reset_lt)")
6 v/ B* X5 p1 ~+ i - ; b' f3 N& V; j1 X5 K8 W ~, f/ W
- (if (= (start_dialog) 1) ; User pressed OK
. L7 t; t9 m1 X - (cond
2 W- T( ~. t7 Y& k6 w - ((= lt-idx 0)
- o5 `; k& x, |4 ^& E1 y - (set_tile "t_ltype" (bylayer_lt))
8 |& V4 O2 Q C$ _, ` - "BYLAYER"' G1 F: E& P$ E& S' a! {! P- e
- )
2 e+ N/ p0 h) v - ((= lt-idx 1)9 k# y* v L" p7 M8 i/ Z
- (set_tile "t_ltype" "BYBLOCK")
4 n% r) b* T' V3 V; F' N - "BYBLOCK"% O, ]) }1 z# U" w8 @
- )5 r1 H9 t4 F6 [# H' }: r% o% B
- (T (set_tile "t_ltype" ltname) ltname)
4 E' b& X+ u: X, @9 O; M, z - )
4 ?# y5 o& G- J* s2 f0 S! j - eltype
; P# g# ^1 I1 W2 }7 O0 N, G - )) x8 ^/ H6 g* w" G2 z& f# R
- )
+ K5 m9 e- [: u% d3 J. { - eltype
; p C, u+ w! W - ); K' Z: i. a1 X7 J; J3 w+ I
- )% C4 s7 b0 j) a
- ;;
, ?" R/ j% t; d - ;; Edit box entries end up here
# Z+ F) k( G1 p/ u( { - (defun ltedit_act (ltvalue)
( N7 j1 G- ?, s - (setq ltvalue (xstrcase ltvalue))- t2 J# Q9 i3 t( I
- (if (or (= ltvalue "BYLAYER")4 F* S; D$ M2 Q
- (= ltvalue "BY LAYER"))4 p& o. m9 ^+ z
- (setq ltvalue "BYLAYER")
8 t1 J, Q0 a/ e' p& \7 S - )
2 [5 b! `2 M; n/ R& _$ K - (if (or (= ltvalue "BYBLOCK")# [* C% I# k, ^- {3 X
- (= ltvalue "BY BLOCK"))
# [# K0 D H6 _# r - (setq ltvalue "BYBLOCK")
) Q6 B+ D/ I* p1 |' X; K( D - )
# `6 n( t& Q5 L - (if (setq lt-idx (getindex ltvalue ltnmlst))3 m, |) d& a5 z/ o
- (progn+ Z& m1 Y7 t& U& P7 C# F
- (set_tile "error" "")
- ?, z {" e) A. n - (ltlist_act (itoa lt-idx))8 z, A3 m0 ?& T% X* I4 B, Q8 h
- )2 q5 X) T5 F+ \) H" u
- (progn$ U8 a' [) I& C" W# ?/ q* X5 R
- (set_tile "error" "Invalid linetype.")
; x, ^) G' X' o X$ J- @1 g3 ] - (setq lt-idx old-idx)
; i' e0 ?$ ^0 X4 ?9 X+ R - ;; (mode_tile "edit_lt" 2)
& t' m5 X/ F2 p6 y - ;; (mode_tile "edit_lt" 3)
% u! ~9 M$ ~- P% @4 o - )
2 {- c5 j9 M4 z! k5 E - )) K* \( I8 R& p7 l
- )" w/ T+ z* e! b/ n k
- ;;& p9 Z/ p0 J) l7 W
- ;; List selections end up here. Update the list box, edit box, and color
" J5 l& a) h4 ?7 l* U% J - ;; tile.* j# a6 ]3 J" y @1 O) i
- ;;
: m; q1 Z7 U3 ^( o: E+ y7 r - (defun ltlist_act (index / dashdata)
: S7 }" S" e- g6 _0 { - (set_tile "error" "")
q% a' F/ x" L7 i0 L- J. V - (setq lt-idx (atoi index))5 S+ P' O- ?7 @: j% [* ^# L$ H
- (setq ltname (nth lt-idx ltnmlst))$ J0 i f( J; \3 n$ e
- (setq dashdata (nth lt-idx mdashlist)); C+ M: { q. Y; e: Q; l
- (col_tile "show_image" 0 dashdata)
) m$ j, P% _+ x" ?2 f/ L - (set_tile "list_lt" (itoa lt-idx))( l4 u+ k2 f# Z5 ~( U& F
- (set_tile "edit_lt" ltname)+ z: k. J& N! l J8 P" r5 ^
- ), e" f+ a' N( l- G
- ;;
! H: D2 Q. l; C. _, h - ;; Reset to original linetype when cancel it selected
{9 P& S' x$ m - ;;
0 X/ g' ]- ?# A% {/ h - (defun reset_lt ()
9 }9 l; E3 h ^$ L: H: A( F - (setq lt-idx old-idx) n, Y! Q$ W7 t; U- ]
- (done_dialog 0)
) r- [( n9 `+ P - )
' Q" [7 o- {# S' C& n" \; ^; h, Q% Q - ;;; s' }: K) v& r: Z! [
- ;; This function pops a dialogue box consisting of a list box,image tile, and
$ ^( a; P5 ^ f7 c2 {. q$ K - ;; edit box to allow the user to select or type a layer name. It returns the. G2 G# J9 z9 K
- ;; layer name selected. It also has a button to find the status (On, Off,& \1 g$ s) t: `+ `& J \% P2 q
- ;; Frozen, etc.) of any layer selected.
F+ n% R; |. D - ;;3 J, d3 S9 W |4 M
- (defun getlayer (/ old-idx layname on off frozth linetype)) m/ f0 T. q9 \! x4 B% F4 p
- ;; Create layer list the first time the layer. X ~3 u# c* _* D) `
- ;; dialogue is called.
: ^8 v" k: w! Z4 k( b1 x! v - (if (not lay-idx)( K1 V: ?. D* I' I& J; {1 ^
- (progn
- B; j3 t8 U+ x. x: |+ G) t+ a - (make_lay_lists)
1 j/ S4 a/ n- B1 ~8 ? - (setq lay-idx (getindex elayer laynmlst))
/ i' {' X2 y5 t2 p" g - )
+ Q( n8 q& S/ V+ _, X - )
6 P( V' A$ k- Y4 N - / z1 Q: V F2 V
- (if (= (get_tile "error") "")
# h' X/ i2 n' `9 u" y& l+ H - (progn
0 c# C& Z" G' R5 w8 _, b7 M- m - (if (not (new_dialog "setlayer" dcl_id)) (exit))
+ A& A* H) t3 ?2 P! b: q - (set_tile "cur_layer" (getvar "clayer"))
2 O% M5 x6 T5 s, S% n5 B1 J - (start_list "list_lay")" i; Q. I0 F! }! U0 o4 i" C5 k: v
- (mapcar 'add_list laynmlst) ; initialize list box
) P+ C& R z8 j* }5 C( s - (end_list)
1 `" C6 q" y. T2 F7 c" f - (setq old-idx lay-idx)$ V& A' m% b+ _1 f" X$ i& ~$ F8 q
- (laylist_act (itoa lay-idx))$ u t9 f& w3 T- {4 C
- (action_tile "list_lay" "(laylist_act $value)")
7 _5 R# G. o2 i' z( [$ ~" z - (action_tile "edit_lay" "(layedit_act $value)")( W* B S& n- ^! W1 S
- (action_tile "accept" "(test_ok)"), A) d; k8 d/ T' r4 t, v" U: x
- (action_tile "cancel" "(reset_lay)")
8 n: h2 T/ s4 r/ H" F' ^3 o) O - (if (= (start_dialog) 1) ; User pressed OK
F+ }" I& q( p& \! t% @ p- e - (progn
$ d& a# L4 ^8 f5 {4 o7 ] - (set_tile "t_layer" layname): P ~6 T& x7 T( @/ A1 i. W
- (setq elayer layname)
6 T' G) G( t9 m6 ~" {( y - ;; If layer equals bylayer reset color tile
7 N/ j6 C/ l& J, Q; u" q& Y$ [5 [ - (if (= ecolor 256) i# h7 x+ F# }$ j. x
- (col_tile "show_image" (bylayer_col) nil): W$ e( r- B0 l }; t; A
- )
7 f7 I0 p; l5 R" Z - layname( ~: M$ g: C0 O0 D8 R! S
- )
0 V8 v0 K/ H' a* T# L4 ^ - elayer4 P$ D, i- B, v
- )
: S: s( r1 {0 B/ k: K" S$ A2 P - )
( h, _' E: ?* O* c( x& i - elayer
( ^/ S4 ?5 Y! D" { - ) u5 \& A! M: g( z+ N* f5 q
- )" @- O6 q& E4 l# b
- ;;% b* T2 _4 L' a5 @
- ;; Edit box selections end up here. Convert layer entry to upper case. If& ]' [9 m4 |8 Z; K1 i
- ;; layer name is valid, clear error string, call (laylist_act) function.
5 R2 x" r* G5 z. F - ;; Else print error message.
% N; i5 l; P4 Z3 q: N6 U' T - ;;' ~. ]! Y8 o4 S u" G7 |8 T# e/ `
- (defun layedit_act (layvalue)7 n- R* p; |9 X# m
- (setq layvalue (xstrcase layvalue))
9 }- h; O* W9 j1 {/ q$ X. B9 Z - (if (setq lay-idx (getindex layvalue laynmlst))
6 I- Q4 z( n$ C - (progn5 H- M* I- I0 R/ A
- (set_tile "error" "")( [3 E0 D) c+ u/ s
- (laylist_act (itoa lay-idx))& |5 t1 Q \! X3 q
- )9 j+ k% Q' s" `/ L% o9 Y% B8 f% v
- (progn5 F, m3 q, U2 C- M+ v+ g1 A: |1 G
- (set_tile "error" "Invalid layer name.")0 U6 G# f$ u% R8 q Y* Y# J
- ;; (mode_tile "edit_lay" 2)6 U( R7 ?0 Z+ A/ i# X- t" V
- ;; (mode_tile "edit_lay" 3)
3 J- H/ B) _# ^6 d - (setq lay-idx old-idx)$ O' O8 H' l) J( r6 `8 ?' \* h/ ?
- )) ]6 b2 V, O4 Q6 `+ ]
- )7 k2 ]: a3 B; o) y+ [2 t
- )9 e. q- E& W3 r( g8 @" E( ?& e
- ;;
8 k* @# y( {/ A) L X4 ? - ;; List entry selections end up here.
: [" S; D+ s2 l3 u - ;;
b+ x; H0 G: R. }. a% R* p - (defun laylist_act (index / layinfo color dashdata)
7 F: ^+ {% Y- ^( ?3 F& N9 ] | - ;; Update the list box, edit box, and color tile.6 U4 Z& y4 q; A" N' n8 s
- (set_tile "error" "")
$ {6 q8 E- v) U& _ - (setq lay-idx (atoi index))
$ d6 _) d. i5 M9 a2 P% @ - (setq layname (nth lay-idx laynmlst))9 ~7 Z7 n1 ~# S8 ?8 Z% B% H
- (setq layinfo (tblsearch "layer" layname))) ~8 M+ m7 w& w. v3 j9 s6 L
- (setq color (cdr (assoc 62 layinfo)))8 ~$ X9 I e9 l8 y3 J3 m0 W+ T
- (setq color (abs color))
1 k) x8 I5 \4 n6 y - (setq colname (colorname color))
: M, `$ j% t9 N1 a9 u- c - (set_tile "list_lay" (itoa lay-idx))
6 x/ h9 S) @. ]1 l$ P6 k2 s - (set_tile "edit_lay" layname)
( p" M2 O1 W# A' s/ N8 \& m- J - )0 {5 A" A1 e/ E2 Q9 B0 O# i: t- j
- ;;
( K/ D( c! C; V8 T! \" p7 T - ;; Reset to original layer when cancel is selected.
. f* _3 S; b& Y2 p Y% V, o - ;;
' P$ U' _6 @3 D1 }5 M - (defun reset_lay ()
+ N& V' @5 X" f2 W - (setq lay-idx old-idx)1 y; V" }5 X% ]) ]( R6 {' l9 X2 J& P
- (done_dialog 0)
' l% A+ {- Y3 a0 k - )( {" |1 C2 u) P+ X! q
- ;;, L: Y# U7 s4 \( h. A
- ;; Checks validity of thickness from edit box.3 |2 V9 a9 ^5 [
- (defun getthickness (value)( s$ F0 v5 |4 j+ _* P
- (setq ethickness (verify_d "eb_thickness" value ethickness))
2 ^: D' f. s; @5 O* a v: u) Y - )
% x6 _8 f3 n4 ]2 \ - ;;0 C5 A- ^5 u' ?7 C9 A
- ;; Copy of (getthickness) for ltscale. If more, make this function
: N6 e# r& W5 G& y; k! t$ O. h2 R - ;; generic.* ~( Z7 a: ^. @8 @9 r
- (defun getltscale (value)
8 Z$ @$ W# _5 P, h% `( t0 G- V - (setq eltscale (verify_d "eb_ltscale" value eltscale))
U* i$ E5 A- X; C: a0 T - )* C% S/ t3 z! H7 E
- ;;
% s4 ?% F. u% a - ;; This function makes a list called laynmlst which consists of all the layer
! f7 _- e c% _! Q - ;; names in the drawing. It also creates a list called longlist which3 J$ m/ M) U; T" N$ x3 y7 M. T0 U
- ;; consists of strings which contain the layer name, color, linetype, etc.& i3 B: L a s& G8 \2 Y5 d
- ;; Longlist is later mapped into the layer listbox. Both are ordered the$ d, P" u( |2 V% j" D7 {' t+ o
- ;; same.4 n' n8 ~, d1 u: W
- ;;
4 b8 H$ P5 O2 r: u: M. Z8 R - (defun make_lay_lists (/ layname sortlist name templist layer_number)( |7 W* q9 c1 S$ \
- (setq sortlist nil)3 J8 K8 Q- w" U: N" t6 R
- (setq templist (tblnext "LAYER" T))+ W5 [( b/ J" s' \
- (setq layer_number 1)5 y1 R! m% T* x+ b+ Z5 g
- (while templist9 y3 b( ^9 Z( ]% \2 B- T6 r( L
- ;; No xref dependent layers, please.& O0 S4 B/ W) J2 C5 T
- (if (/= (logand 16 (cdr (assoc 70 templist))) 16). I- X o: Y7 \* @' N# w
- (progn
. m6 p4 Y" N' V# U7 R - (setq name (cdr (assoc 2 templist)))3 w0 V) J# K* b. _+ u+ T- U
- (setq sortlist (cons name sortlist))
& R! O2 x6 O4 C8 H. X8 Q9 ^ - )
8 E' _' J6 k- a, r2 B! d9 f" ^. w - )2 L! O. f0 h! h7 q+ k5 Z: Q: g$ Y
- ; Get the next layer." p" z8 m4 r5 T' J
- (setq templist (tblnext "LAYER"))1 x# E- E" M* j8 `* c
- ;; Not dead message...
+ G- A$ B8 c, Y& U - (if (= (/ layer_number 50.0) (fix (/ layer_number 50.0)))
" V$ D% A' @( W9 |/ K# W9 X3 b - (set_tile "error" (strcat "Collecting..." (itoa layer_number)))* k, d; x w: ~. f, o! L* e
- )8 U$ `6 C0 M$ ?' T1 ^
- (setq layer_number (1+ layer_number))
. a. \+ W3 c5 j4 ^; K - )
, Y2 X8 _& N6 E4 } u: M1 f - (set_tile "error" "")
X! ]& ?: A, ]. c! c1 @/ P - (if (>= (getvar "maxsort") (length sortlist))
# t4 Y0 g; l/ `& s) {+ N) V* W) Y - (progn- x+ M- U8 x: \/ z6 d! ~+ D
- (if (> layer_number 50)+ y$ `3 T7 U5 A, h' z+ g
- (set_tile "error" "Sorting...")' f) v7 R3 R& h- b7 }, w
- )! b+ M, ?. }7 O1 D5 b
- (setq sortlist (acad_strlsort sortlist))
! L+ V& \$ y1 T7 p1 B$ q$ s2 M - )# ?; a1 N5 S" K& T# J9 M- T
- (setq sortlist (reverse sortlist))- R/ E$ u1 l1 u* ^9 R
- )
6 Q+ j% v; R* K1 ~ - (set_tile "error" "")
( N& C# n. X5 _9 M - (setq laynmlst sortlist)
+ Y. F8 w3 @2 _* C' n+ C& ]1 f - )$ V! E5 y2 }/ Q/ g3 O4 Y" w
- ;;
2 i" t: }* q, g2 O% y8 s! B! x8 v8 a - ;; This function makes 2 list - ltnmlst & mdashlist.; |6 D9 Z! u l/ E7 e x4 `
- ;; Ltnmlst is a list of linetype names read from the symbol table. Mdashlist
: M7 N5 K# n8 ]. o. [9 ^4 N9 Z5 _& N - ;; is list consisting of lists which define the linetype pattern - numbers
5 z1 H# W- w7 O. l7 U, b. i. ` - ;; that indicate dots, dashes, and spaces taken from group code 49. The list
# ?6 R: A( i1 n6 d2 l - ;; corresponds to the order of names in ltnmlst.
# x4 Q, `" \" `( Q1 n) F - ;;
' ?$ ]. \: I0 p8 g9 Z - (defun make_lt_lists (/ ltlist ltname); _. E5 d7 p% a/ F# b' O
- (setq mdashlist nil)" V3 j- M5 m& R7 s' V6 q- [
- (setq sortlist nil)
. Q! [: h: O9 I4 c( V- Y2 s; ]. J6 c - (setq ltype_number 1)
; o8 J$ q- w2 t D3 Y' Y( D - (setq ltlist (tblnext "LTYPE" T))
, ^* w" n1 k) F- h# \ - ;;(setq ltname (cdr (assoc 2 ltlist)))
9 a5 W7 `9 H2 X - ;;(setq ltnmlst (list ltname))
4 p z! E7 j* b - (while ltlist& k2 @# _9 }. O/ q! \
- ;; No xref dependent linetypes, please.
5 a$ D/ l" A2 n G! p7 `8 }9 u - (if (/= (logand 16 (cdr (assoc 70 ltlist))) 16); Y# F1 q, }8 D$ N# J' `2 R( I4 ^9 Y
- (progn- k; A2 {* p0 x/ E6 g. [8 d
- (setq ltname (cdr (assoc 2 ltlist)))2 g6 l" f& ]7 ~# @( |0 V
- (setq sortlist (cons ltname sortlist))
3 j. ^5 J9 I/ B. B - )! z. c }! t* R1 }
- )
, H# X7 `' b8 Q0 ]( T - ;; Get the next linetype.; t% A/ O, u; E ~: Y
- (setq ltlist (tblnext "LTYPE")). ?: k0 I' J5 F6 ~$ H/ Y
) J* }7 `+ J3 m$ X/ u) V- ;; Not dead message...
% K& D- ?/ {% O9 U* V - (if (= (/ ltype_number 50.0) (fix (/ ltype_number 50.0)))4 B) w/ ?3 @- W8 {1 U) g, u
- (set_tile "error" (strcat "Collecting..." (itoa ltype_number)))
0 L6 o% K4 {) q - )
& G$ p4 `6 Y, W/ R5 A& \1 | - (setq ltype_number (1+ ltype_number))2 n. q1 f, M6 u. B4 u/ ^
- 2 w8 Z" z5 h0 e, o4 {) @; S
- )3 N( s# k' M3 B( Z6 k. T
' p( y9 @* w9 v \7 G- T- ;; Remove Collecting message.
( ^" v) `/ i* @1 E; E( t- \. N - (set_tile "error" "")
$ N$ \9 H! }4 K" b
3 M; f! w& r# z8 h1 `4 w- ;; Sort based on maxsort.
# d) X% L- t h/ k - (if (>= (getvar "maxsort") (length sortlist))
/ q! P2 f3 b; \1 F - (progn6 q. f: u/ Q! _6 @, w W6 E
- (if (> ltype_number 50)' l! Z. o ? @6 M' E
- (set_tile "error" "Sorting...")
. G4 i7 q7 c( Q7 B - )/ g- Z1 o% b: `+ u) l6 {; F
- (setq sortlist (acad_strlsort sortlist))
. I4 j- u, }1 @- S2 { - )
; u$ }0 d+ s3 B6 w% u) G4 L7 |6 k8 \ - (setq sortlist (reverse sortlist))2 w/ S# `4 B" a6 b7 [' t# Q
- )0 ~0 f+ s Z, S' F; b! N0 h
- (set_tile "error" ""), c# \( \# M; ~7 |# c
- (setq ltnmlst sortlist)( s4 t$ m6 y+ {6 o! G( A" v& O
+ P. ^# U+ G- n) i- (foreach ltname ltnmlst
0 O ?3 [8 ?# }! c - (setq ltlist (tblsearch "LTYPE" ltname))
( E: e1 p' e: y% K2 d } - (if (= ltname "CONTINUOUS")
4 h0 r! F$ {' f5 d4 @8 Z+ ~8 E - (setq mdashlist (append mdashlist (list "CONT")))
}# d3 K5 \# t5 E+ k q4 f- ~; u - (setq mdashlist8 b2 ?8 {* x3 `5 ]# V2 p ]
- (append mdashlist (list (add_mdash ltlist)))
4 o7 f. b* \! ]( ?) [ - ). y. o) ~- h& _" H" o- r
- )
3 W1 I9 `3 Q- ?4 p6 q2 T7 m; z - )
- \# P! o% U Y - (setq ltnmlst (cons "BYBLOCK" ltnmlst))
4 w! Y7 L4 ^) r4 \5 ^ - (setq mdashlist (cons nil mdashlist))2 O+ h/ v. O8 |' E T
- (setq ltnmlst (cons "BYLAYER" ltnmlst))- k( a& O* [5 f; }
- (setq mdashlist (cons nil mdashlist))2 ~ s8 \0 h% }1 f# D
- )
$ n& W3 N% x9 G: G! p/ C/ H - ;;
9 M" C. ~4 [' E& ~8 p' s4 A, I" [ - ;; Get all the group code 49 values for a linetype and put them in a list8 S: |4 x( J5 ^
- ;; (pen-up, pen-down info).
( J% Z8 h9 t: r: s) r - ;;% M( _% j) Z6 r% V* c9 V
- (defun add_mdash (ltlist1 / dashlist assoclist dashsize)
. ?- S! M$ i: H: _" g) z - (setq dashlist nil)+ |" k3 o. s: w5 V/ N6 f
- (while (setq assoclist (car ltlist1))
2 W/ z$ @3 f2 o* m* D6 [3 V - (if (= (car assoclist) 49)! l( O6 [7 I2 P: a/ F
- (progn/ O' F0 h2 R) O5 D F4 } f
- (setq dashsize (cdr assoclist))1 v6 g2 l- C' q" |6 |4 p' d; m
- (setq dashlist (cons dashsize dashlist))
' V5 U9 b& r+ B6 ^ - )6 E8 \7 r. F" j0 {; H. B9 R f
- )) V0 b4 a# f: k
- (setq ltlist1 (cdr ltlist1))3 t1 R. Z$ j; H, O& S
- )
& Z! L7 A, s3 T2 G/ S - (setq dashlist (reverse dashlist))
" U: ?, h7 |6 D7 m' P& ] - )
7 `+ I' D4 q* R+ T( [. o& c - ;;
8 F+ l& ?% H/ l. L5 S) F* x - ;; Color a tile, draw linetype, and draw a border around it
4 ~* N9 g* |, U7 N1 A6 T - ;;
$ P/ {2 T9 c" @" g P1 D# b - (defun col_tile (tile color patlist / x y)' z- W4 `4 M' E
- (setq x (dimx_tile tile))# q) G, l8 s, _9 g
- (setq y (dimy_tile tile))* ^; k" p/ Q' M% L' K. g8 A r, F6 m
- (start_image tile)4 \' F+ M" v; X3 [/ ` d$ Z
- (fill_image 0 0 x y color)
% m3 d, H& t8 a - (if (= color 7)
5 i+ H0 @" H3 s- n2 |5 L9 i - (progn
; D9 T$ Y3 [9 c' P7 \+ Z - (if patlist (drawpattern x (/ y 2) patlist 0))
/ P& Y- g/ `* A6 M2 U3 H; C2 p+ `0 | - (tile_rect 0 0 x y 0)% V; J5 {* N1 Y
- )' G- r( @' M& S0 `
- (progn% A# C [5 k* G
- (if patlist (drawpattern x (/ y 2) patlist 7))- ~7 A4 Y! v9 U i
- (tile_rect 0 0 x y 7)2 h( t, a5 q; N, r8 D; B( ?
- ); K# Q- `9 L8 r: j* w
- )! Z6 r* X- s/ I; x# q7 R
- (end_image)2 S& c" W3 M2 @! r: t5 D
- )
' _4 Z1 u% ]2 h% e1 T+ p4 z - ;;! R7 x' p1 R3 \
- ;; Draw a border around a tile
; A, I5 {9 }) `( e - ;;$ L' f, W* K0 |, e: M4 S
- (defun tile_rect (x1 y1 x2 y2 color): a- V# S1 T' z, y& z5 w+ Y
- (setq x2 (- x2 1))
- A1 `' K4 {' W3 T( f8 S* y: E - (setq y2 (- y2 1))7 [3 A6 d" P; |% ]/ h6 c" k
- (vector_image x1 y1 x2 y1 color)7 q0 C+ _0 _1 B
- (vector_image x2 y1 x2 y2 color)
7 }* O; z$ L1 ~- q - (vector_image x2 y2 x1 y2 color)
) b) |( ?: l, z+ c- g - (vector_image x1 y2 x1 y1 color)& @7 M F; e; L0 q- ]
- ): T, b- ^( Y% t! x
- ;;
8 X# ^! d6 m# x7 C f4 { - ;; Draw the linetype pattern in a tile. Boxlength is the length of the image ^+ {$ M" F1 H* }2 ^0 G$ a8 ?
- ;; tile, y2 is the midpoint of the height of the image tile, pattern is a8 ?( Q9 d$ O3 z: W- w- k- A3 K
- ;; list of numbers that define the linetype, and color is the color of the. a: \: z4 D3 Z5 i. b* \4 [
- ;; tile.# m' |! o. {9 [% d, g" a7 C
- ;;8 u7 h1 a: ]/ P$ E% J
- (defun drawpattern (boxlength y2 pattern color / x1 x25 ?# w1 l: w) P9 O
- patlist dash)
) I$ D( b( l/ v9 m+ ~ - (setq x1 0 x2 0); R7 [# _5 e9 G& B$ ^/ }2 \
- (setq patlist pattern)
0 h! v6 x/ G2 ~+ r2 M* f& ? - (setq fx 30)/ ?$ z, J1 A& ~ u& X1 b
- (if (= patlist "CONT")2 [$ U# z4 L: Z# c& ]$ S
- (progn (setq dash boxlength)
; \6 \. I7 e/ o, D) b' n - (vi)
# [" H8 e. D$ m/ T8 h/ R: a - (setq x1 boxlength)
7 N( Q# p# h) { D9 t3 h$ u - ): N. h: g6 P! r8 i* d4 F
- (foreach dash patlist0 Q# e7 n6 Q: v" b$ ]. T8 A
- (if (> (abs dash) 2.5), a( @" Z4 S9 `& l" z) ]% Y
- (setq fx 2)$ C3 W% \* R% ^2 u% Z% L( f" S
- )
0 Z" _" {/ z& u/ t. I: x( ~ - )# ~8 i4 m: h; [, F
- )
. k L* o; j" Q! v; o+ E4 \, i1 Z - (while (< x1 boxlength)4 {7 A; W- n3 P/ J7 l& q
- (if (setq dash (car patlist))
1 v( p4 d2 z+ @ - (progn
' N/ {8 L( H& g ~( n - (setq dash (fix (* fx dash)))
. P& \. y6 I5 I! F$ I - (cond
9 @! R/ ~% [$ f6 H% q+ J5 s# g - ((= dash 0) (setq dash 1) (vi))7 ^! x7 w( \7 ~9 r) ?6 _2 m7 l
- ((> dash 0) (vi))4 N$ \1 K+ o9 }7 i' B4 H5 C5 C
- (T4 p& ?' I# N9 d
- (if (< (abs dash) 2)/ F5 [6 r" Z6 I+ c3 p) Z4 Q0 i
- (setq dash 2)
* r N$ [8 X, V2 D; S - )/ H8 q& b( Z0 Q6 [
- (setq x2 (+ x2 (abs dash)))4 s) Z3 z8 |& J" F
- )
, K9 \ {4 p, N" E - )
4 s; U3 A b8 T6 } - (setq patlist (cdr patlist))
4 [. x* v3 f4 m' @6 v% s - (setq x1 x2)
+ D* k$ T1 @& X7 }( L - )
3 H1 {$ @1 M- ~7 L6 J" [6 x( E - (setq patlist pattern)
" p- M+ M3 M( A1 c0 V - )% ?2 y5 h& [; V9 ~& i5 K
- )) I( R- f! C* m! S
- )0 P. M* V8 ~9 @) j
- ;;( H# D& r! }0 m( q) X, n& n s
- ;; Determain state of xclip) @6 x S2 }! T. }1 M
- ;; Returns the group 71 value of the spacial filter dictionary. g$ P ~8 y! D# v
- ;; If the entity doesn't have a spacial filter dictionary, this
* \6 W3 T9 ?! G - ;; returns 0. If it does it will return 0 or 1 depending on the
, |; X v' n: Q C4 w3 d - ;; current setting of the state of the clipping visibility.- [/ ^, v" R0 Y7 Q. |4 m1 ~& ?5 E
- ;;
+ p3 ]) Y8 T9 ? {" {% a; U - (defun xclipon(elist)
: O: Y. v* ]' b5 o - (setq hasclip T)
$ }" {3 U- @1 q0 H - (if (/= (assoc 360 elist) nil)- B% o/ Q3 R! |; T2 K) [
- (progn! k1 [- m" m& o3 \' {8 i9 X/ c
- (setq tmp (entget(cdr(assoc 360 elist))))
9 Q: z. N7 R6 |7 ~; Y - (if (/= nil (assoc 360 tmp))7 @2 b- e( J% Q' R {
- (progn
/ A1 H. U) ]& i2 E8 C - (setq tmp (entget(cdr(assoc 360 tmp)))), v6 q, s( V/ N3 i8 o3 t
- (if (/= nil (assoc 360 tmp))
: b" u n7 _. I4 V: t - (progn
$ a# @7 J& |# M* Z2 Y" e- N - (setq tmp (entget(cdr(assoc 360 tmp))))
# X3 L/ B6 U! U$ h n, X - (if (/= nil (assoc 71 tmp))
) Z$ O3 i T M p6 M( q/ E. W - (cdr(assoc 71 tmp))" s. N' n1 @# V1 q8 h4 ~; f5 O4 l% C
- (progn 8 G9 d+ |3 e$ [6 K8 E) e
- (setq hasclip nil)
0 R4 q b1 T! t, W Y2 G8 g - (eval 0)
1 x7 D, n+ R2 [- i - )
- E7 R* n1 E) j+ \ - )
, I9 w, ~- l9 ~8 [: t - )
/ c1 P. [+ j% s' { - (progn
4 x T; G+ l( d2 g3 q) E5 u* F - (setq hasclip nil)6 n6 O/ |0 {5 _1 Q5 s
- (eval 0)2 l$ c; o) t$ l
- )
. j4 z2 R' k8 D6 A* l. i2 h0 {* J - )* _5 Q Y9 t+ w# @- }$ B
- )+ Z, ]5 X, {8 g4 L6 _% e% C: ~
- (progn
, {$ K9 t8 B; ~ - (setq hasclip nil)$ R& R7 \3 L+ Y/ b8 H+ ~2 \7 b$ S
- (eval 0)
4 C, q# S; X' ?1 K! ?; a: ` - )
6 G I+ T/ C- f- u% h - )
+ b: x9 H" G' H. u% x) L - )7 z' z1 R/ B; B- k( g4 c) S* r
- (progn . h3 | u2 {" U1 e; P3 ?/ v+ \
- (setq hasclip nil)
% f/ H& H4 i" b8 _! n5 D# l - (eval 0)2 U$ j! z, z. x1 Q
- )
+ R3 a7 l8 z( Y% B% Z' _( R: @( j - )
3 }5 i- m! P7 }$ h6 Z - )2 D9 u4 |" |1 y( y0 a& Z
- ;;
. `+ j$ O6 F9 v! p k - ;; Draw a dash or dot in image tile5 v' @) b/ |* j6 G
- ;;9 e% U7 h5 i3 D" H* i
- (defun vi ()& t P' J# W1 C& v, z% A4 M V% Q
- (setq x2 (+ x2 dash))0 G) W4 N. V+ z; {& d U; j7 F
- (vector_image x1 y2 x2 y2 color)4 y2 X- M I5 P3 h, w4 L" |! V" B
- ). i: {8 A* s u/ a6 Y
- ;;
2 z3 T6 }( k5 ?0 J' D. W - ;; If an item is a member of the list, then return its index number, else
! |0 O; k7 `+ d& M4 @7 Y& ` ` - ;; return nil.
4 o% d$ w# N0 u$ }' l - ;;# j5 F- _5 \% u4 [8 E
- (defun getindex (item itemlist / m n)
5 W7 o% M( y3 G2 t ]! y( ~ - (setq n (length itemlist))
) S9 A# r1 M, k3 u. M, |! _9 l% { - (if (> (setq m (length (member item itemlist))) 0)
2 O0 K/ n; ?, }1 e - (- n m)
/ k B" B# e. N5 p* ^4 a - nil
" C0 M6 k/ U _- c3 K7 x8 ]" M - )
6 V! s( c1 b0 U5 Z% L5 V - )4 |4 A' Z1 t" S0 x* m' C
- ;;
* g4 s; l' B, R$ o: T8 X - ;; This function is called if the linetype is set "BYLAYER". It finds the
4 T5 p. q+ @- [0 A - ;; ltype of the layer so it can be displayed beside the linetype button.) p8 B: m5 u( o
- ;;% B; y: T5 B0 b8 ~
- (defun bylayer_lt (/ layname layinfo ltype)
+ u) N) T4 m/ [" G7 Z7 A - (if lay-idx
0 K$ r; V) U2 @1 |; k- X+ R - (progn2 `! A- _. W+ J2 _ m% r" {# p
- (setq layname (nth lay-idx laynmlst))+ e% v M+ ?1 y5 H) P: }/ Z
- (setq layinfo (tblsearch "layer" layname))
: O5 C) s/ w$ b( x' u - (setq ltype (cdr (assoc 6 layinfo)))
2 }4 o. a9 r1 m - "BYLAYER"
" }9 Y8 z, K! s6 G# q - )0 a" u8 I3 D# K: c& I
- "BYLAYER"- n6 U5 b _2 Z
- )" U- Y- Z7 U: ^7 `2 _+ o1 E
- ); a5 v( t4 y* _- i7 l) L( \
- ;;2 N3 o: I: d5 h" I
- ;; This function is called if the color is set "BYLAYER". It finds the color
2 U* C5 [5 C3 h4 c8 G# P U - ;; of the layer so it can be displayed beside the color button." x7 V5 S3 K1 c; ]0 `, B# b8 K
- ;;8 E' e, K& ~5 ^" A* D, m
- (defun bylayer_col (/ layname layinfo color)
# Z9 K1 k* b) T - (setq layinfo (tblsearch "layer" elayer))) ^" q% ]& q |" v
- (setq color (abs (cdr (assoc 62 layinfo)))), C, ~% x; `; J0 m, Y( M3 I
- )
9 S1 \. K7 f+ B% R, |* @ - ;;
( m( ?# C% ~! {6 Z7 y @2 F - ;; Used to set the color name in layer subdialogue.* H) e9 R% n p+ j. a u3 e
- ;;
3 t$ {* t8 w" q4 l, K - (defun colorname (colnum / cn)) ?# `0 @5 n- |" d: V1 H6 S
- (setq cn (abs colnum))
P+ U' w E8 s7 \( c- F/ H. @5 E' H8 g - (cond ((= cn 1) "red")2 U5 U- Z& q9 m) v! U
- ((= cn 2) "yellow")7 P1 N; }, i9 K+ B( U+ ]5 f
- ((= cn 3) "green")
& x* p& o+ m" e4 Y1 h - ((= cn 4) "cyan")
% k! i `. h/ F4 L - ((= cn 5) "blue")
! C- E) ^3 ~0 ~* H( A, l7 L# z - ((= cn 6) "magenta")
8 e! F' e* s/ U5 r& A) F - ((= cn 7) "white")
+ N& K$ \7 v; u1 S) [4 l - (T (itoa cn)); |" c* e6 m) E7 b7 o. Z5 U
- )
! o+ V5 S F! P. c+ r* C8 H - )
7 s* m; U! P+ \ - ;;
! i" F4 P2 x) @/ O" j& L. H/ s0 G - ;; If their is no error message, then close the dialogue.$ G7 d# ^7 c. Z2 D0 x, I: Q2 q
- ;;
" r4 v% X8 u, J( u( G - (defun dismiss_dialog (action)8 u9 q9 \4 K# X: A# M
- (if (= action 0)( J1 M0 O* V, ?) F9 J1 X% L
- (done_dialog 0)
8 r$ I$ n& @$ K( \ - (if (= (get_tile "error") "")
- ?- C, o/ z! H4 f - (done_dialog action), P% g, @* O- l
- )
1 y+ \! p" x6 [& U* R0 ^ - )
' _! K1 G8 x- f- l! c8 W - )
4 L# k: u3 B! b- l* n4 j Q - 2 V- w, e& k# K }0 k3 D, v
- (defun test_ok ()
! j. p6 j# r1 |0 _ - (if (= (get_tile "error") "")
6 G/ g; ^ C# S1 u - (done_dialog 1)
2 d. v" s, ]/ w0 G+ X6 ^7 A v - )5 J7 N f% g: R) H% i) T
- )
, R) R2 T' I2 Q: I/ N7 v" |- @ - 4 u# U4 |+ F8 k
- (defun cancel ()1 X9 p- T$ ]/ ]) |. n7 g7 M
- (done_dialog 0)
I/ u" N" S4 ~) k" z - )
8 P2 |! B* h+ [2 z% W
" f9 f5 F! d6 k7 B7 i- ;;; =======================================================================
0 s6 K9 g, z" L' P D) T - ;;; SETUP layer and linetype lists for application, and initialize all
: M) y4 H( n% q& n: ?5 j& x - ;;; program variables.
3 I; `" @2 r8 Z1 n1 w - 1 p# n. l- x1 a1 g
- (setq elist (entget ename)
' A; V) G$ y+ ~0 p - old-elist elist% B' \# \& v+ u0 _! {5 n
- modlist elist( o' i% @% g- |! R2 g. w$ K
- etype (strcase (cdr (assoc 0 elist))): I4 ^! L0 F! R$ k8 L% y! F
- ecolor (cdr (assoc 62 elist))6 `% l1 O5 L9 S6 h! q5 I8 B
- elayer (cdr (assoc 8 elist))
9 H9 ?2 s9 X6 ` - eltscale (cdr (assoc 48 elist))/ }; J: I* S3 v2 A" ^1 V
- ethickness (cdr (assoc 39 elist))
- U: z! n% c( Q( D - eltype (cdr (assoc 6 elist))& N7 _; B3 O, d) H9 n0 u2 b
- )4 r1 y8 I2 N' H: X7 a( n" C
- (if (= (assoc 210 elist) nil)9 S" g. N& { o9 x" I: X' F
- (setq extru (list 0.0 0.0 1.0))2 |: m$ ]; d# _3 [! ], Y
- (setq extru (cdr (assoc 210 elist))) h6 g. _! m& o
- )
3 {% ?9 k ^" ]/ ]! H6 v
; b7 v$ v6 u9 L- (if (not ecolor) (setq ecolor 256))
6 _, G1 u" L" u/ ~( S% z - (if (not eltype) (setq eltype "BYLAYER"))* }0 N$ K' n5 l9 \, t
- (if (not ethickness) (setq ethickness 0))
4 p* c3 ?# \! S" {: O2 d; C+ N - (if (not eltscale) (setq eltscale 1))
! J# ]1 W% C p, o - ) ; end ddmodify_init
; ]* h, N8 [) s. e5 P - 5 b3 n1 h1 c! S7 [* m# G* M
- ;;; --------------------------------------------------------------------------
E3 ]2 S% D$ M2 N6 c# e) ~ - ;;; Function: DDMODIFY_SELECT! A6 |/ _5 w* F& p" O8 B& p; I- k( Z
- ;;;" H! @& G6 S5 a( F& ]. w7 i
- ;;; Object aquisition function.
2 Y2 @3 z5 }! i; | - ;;;
2 X/ F% H$ C$ I/ `" j1 t - ;;; (ddmodify_select)4 t7 p+ u5 C/ |$ K8 p0 ?# u+ I
- ;;;
1 }% b6 \% O- q( {- k v) @ L- t - ;;; Obtains object to be modified, in one of three ways:$ e, m0 n! ?1 y( X- \
- ;;;
" ^1 @9 x8 A# n" O - ;;; 1 - Autoselected.1 U. H: G4 p6 H$ D( S5 n
- ;;; 2 - Prompted for.. P9 \/ F7 z0 B! l1 V
- ;;; 3 - Passed as an argument in a call to (ddmodify <ename> )) b$ {5 k- j! W7 G
- ;;;
' J+ i0 L, y) u& o; `' l' F! o - ;;; The (ddmodify_select) function also sets the value of the
- L) _; I$ e' w" a+ y& j' D! `5 B - ;;; global symbol AI_SELTYPE to one of the above three values to
: V9 y6 D, H {: g - ;;; indicate the method thru which the object was aquired.6 y/ d9 R; |! s% |- t0 w
- ;;;
' g" c8 p" H# R- y6 g( [ - ;;; This value can be useful to applications that want to RESTORE+ ?0 S: W% Z4 V6 m7 {2 f
- ;;; an object that was autoselected to its previous selected state+ [' {7 Y, I4 y
- ;;; when they terminate, although there doesn't appear to be any% `" L7 l# Y. ]; R7 b6 d
- ;;; way to do this right now.2 s: I& l' s ?1 U9 K
- 8 a' f) N9 E4 G0 R; ]( G/ e
- (defun ddmodify_select ()8 v5 S+ d) W& {, c1 ]: W
- (cond
- D5 R) y/ n5 L% G8 V) _9 P5 r - ( ename ; (ddmodify) was called4 L" E2 c& S0 u4 s8 z8 O# q# b
- (cond ; with an <ename> argument
0 J# I. A1 A5 b' y - ( (entget ename) ; If object is non-deleted
$ i* o" L8 b2 D0 g8 U& @ - (setq ai_seltype 3) ; then return its ename.; q: n7 `) G8 j
- (ai_return ename))))
+ B% N3 W& O# G/ d - / [* r, B9 P$ r- B0 I
- ;; return auto-selected , see ai_utils.lsp7 f+ b& a, S: q
- ( (ai_autossget1 "\nSelect one object to modify: "))
9 c6 ]2 O- W' u H
6 O- ~: ~! u5 x! i5 g* Z- (t (princ "\nNothing selected.")
8 Y1 n6 i( U w' M) G( a8 q - (ai_return nil)). o' ^+ w# ?4 L4 {8 E {$ s6 ~
- )
3 x4 G( a! l9 I6 U7 p- i - )7 a5 o9 X! P( ?
- $ ]4 t3 w" x# n, ?
- ;;; ============= Command line interface function =======================
! y$ E# p! E$ ^. K
" Z2 d% j6 v9 t6 }8 O$ l! R( z- (defun C:MMO (); N$ c% C3 X- \/ V; _# i
- (ddmodify nil): {4 _2 A* h4 J' F4 i9 \1 m$ V
- (princ)
* |- O, h% V, g# L' l' A3 U, T - )
# N4 N5 B* R* |
. e- j* ?( \- ]- ;;; ================== (ddmodify) - Main program ========================
5 ^0 {* \7 f) k3 `; e7 ] - ;;;
- T) t& `6 N- U e2 K3 o0 g - ;;; (ddmodify <ename> )
4 X3 s4 I! F9 V, D& c! M2 g# s - ;;;
7 R; Y3 f4 j$ l% K- n - ;;; Main program function, callable as a subroutine.* j, m m$ [, L/ i- p; t7 y
- ;;;
6 P% a# [* _0 B, \; k, z! j3 c - ;;; <ename> = object name of the object to modify.% Y; Y" x- H5 D* I# n W. u
- ;;;7 Q, J$ D: g2 n: ^9 x
- ;;; If <ename> is nil, then user is prompted to select
: q- N. q8 r( f7 W - ;;; the object interactively.
G0 M% k2 s9 o7 D - ;;;
( R% l# J3 M2 c8 |7 | g - ;;; Before (ddmodify) can be called as a subroutine, it must
9 ^3 r5 O( N* A- }7 H) [0 K% @/ Y - ;;; be loaded first. It is up to the calling application to
3 h1 h+ X- H: a3 c - ;;; first determine this, and load it if necessary.4 j4 c9 h2 i3 A4 Y+ { _
$ D. k# a8 v2 N1 G
5 G, n" V( U+ |- (defun ddmodify (ename /) ?# \1 r3 f1 `' ], ]% t; ]" X
- 2ndpt ell_calc_area move_pt1 templist( f1 _, y! H, D+ r4 N/ w
- add_mdash ell_tile n tempmod1 |, X0 \" Y" P6 B( {0 V R
- alipt eltscale name tempst_ang
G+ [4 _$ o6 ^9 L - ang eltype newpoint test_ok) S G7 m$ Y- S/ }6 O
- arc_calc emod next text
/ q+ s) M M5 G7 \9 D1 b - arclen end_ang next_vertex th-value
+ r/ X% n' h' Y3 J" M* u - assoclist endpt obl tile
- z2 k+ @8 Z4 W8 ? - atprompt errchk off tile_rect
! u7 _- H/ x) _- U - attag ethickness old_majrad tilemode6 R s$ m- L' E+ p
- attprompt etype old-closed totang
* q& o7 Z) d2 G" p - bit extru old-closedm tstyle
- c2 l" G' S" l2 z* v- t& ?; V) T - bit1 fchk old-closedn u
% Q7 ]6 o* y! B! \$ I - bit-10 first-10-rec old-elist undo_init7 O+ V+ t" n2 t% E3 n
- bit-11 first-10-time olderr upsd' `7 C/ Q6 \, x9 N. h7 i3 V3 W
- bit2 first-11-rec old-fit v
$ c6 v1 T! A" {" ]6 I a9 K( q - bit3 first-11-time old-idx va
& S+ w2 e- W" r7 @" | - bit4 fit oldlist value
$ n- f( x. n& _ - bit70 frozth old-spltype ver_4
( _& N! `4 u; x# p% c, F - bit-70 f-vis old-u ver_ang1
5 }" d5 B* y, D0 v - bit75 fx old-v ver_ang2
: k$ d/ s1 D1 g' m0 o1 K) r - bk-up get_color on ver_col0 ^" ~$ U& Y. N: f2 n: q
- bkwd getcolor onoff ver_colsp8 V1 `1 T% r) Y5 j. o% I
- boxlength getindex on-off ver_eangle, [& U$ l8 A W' V, k5 q
- bylayer_col getlayer patlist ver_hght* d$ h& c& h7 ], t
- bylayer_lt getltype pattern ver_majrad
! J! ^0 L, m" L$ X5 E9 h! `/ h - calc getthickness pltype ver_obl
4 G, j( w- n( s& M: V - cancel globals polytype ver_pt17 l) ^: G9 V p
- cir_calc ha pre ver_pt2
, K- z( ?, r0 W1 H - closed ha-prev proplist ver_pt3
; w. _" K3 d0 w" `. H - closedm help_entry pt ver_pt4 |2 l3 ~5 n/ E, X" D
- closedn hght pt1 ver_rad
0 j! e5 p# }! f e9 s1 G/ { - cmd icvp pt1_eq_pt2 ver_rot4 S; b/ `6 S5 k( B$ P8 ~
- cn image_add_vector pt2 ver_row
, p2 K- _$ [& B7 u& b$ ~ - cname image_clean_variables pt3 ver_rowsp: F) ]+ j3 c1 J- o7 W
- cntl-pt-indicator image_cross_product pt4 ver_tag5 u( y3 q+ L, ?3 F7 D$ d/ k
- code_71 image_disp_opt ptype ver_u
& G8 V* ]: U' {, e$ Q - col_tile image_dot_product radius ver_v, k* c y, @- c
- col-idx image_normalize_vector rational_spl_flag ver_wid. V7 L; a% b5 p/ r
- colname image_rotate_vector reset ver_x1
$ R/ h1 X5 y/ P9 \: J - colnmlst image_scale reset_flag ver_x2
( @ t! A% o; k# O, }0 t - colnolst image_scale_vector reset_lay ver_x31 u: c4 k/ N/ c: L5 o
- colnum image_update reset_lt ver_x4
5 w6 p) S5 \) L8 o3 Y - color index reset_uv ver_xline_pt1
9 m8 b- S1 o- w - colorname inv rot ver_xline_pt2- i% I: e2 O! _2 ~* A/ y3 Q1 w
- colorno item rows ver_xline_x1
* X4 U7 w: K$ z* a - col-sp item1 row-sp ver_xline_x2
# x1 z1 z7 w, y, v: T7 \ - columns item2 rrat ver_xline_y1
+ f+ z' ^3 d E5 | - con itemlist s ver_xline_y2: N' w" W& D5 N9 |" }1 {
- coord jlist set_action_tiles ver_xline_z1
; x) @( W( g' X) g2 ], | - ctr jlist_act set_just_idx ver_xline_z24 ]) b+ M# T' `& s6 g8 e" [) ]
- cur-10-rec just-idx set_tile_bk-up ver_xscl
; A8 B% P" I/ j! | - cur-11-rec layedit_act set_tile_cntl_pt ver_y13 V) z, I9 D1 j! u# ~
- cvpname lay-idx set_tile_data_pt ver_y2
* H8 Z' j; r) N0 F - dash layinfo set_tile_dirv ver_y3
6 n1 U, |5 ?- {& c1 L& L4 _0 Z - dashdata laylist set_tile_edges ver_y4
, F3 \* Y4 Z+ B& r - dashlist laylist_act set_tile_endang ver_yscl, G! L% a% z; f7 q" T N5 l
- dashsize layname set_tile_hght ver_z1' Q4 P& A- K4 c$ U8 V. D
- data-pt-indicator laynmlst set_tile_icvp ver_z2
7 s* U& z4 q$ K0 p# ^$ L& ^% t - dcl_id layvalue set_tile_just ver_z35 T4 a1 D: M! S3 R- D7 N
- dd3dface line_calc set_tile_obl ver_zscl4 j( F1 L" ?- i* f5 c
- dd3dsolid linetype set_tile_prompt verify_a- \( Y6 S& k$ Y5 G: @
- ddarc list1 set_tile_props verify_d, d, C: {6 E, d5 Q- J
- ddblock longlist set_tile_pt1 verify_i% R v/ c, Z9 T3 D6 W
- ddbody ltabstr set_tile_pt2 verify_xline6 { }; E8 u: K( t2 k. e0 `+ J) f
- ddcircle ltedit_act set_tile_pt3 vfy5 t! [' J0 R2 |
- ddellipse ltidx set_tile_pt4 vi
# J* m" A( d7 ]) K( W3 s. Y. x - ddgetprompt lt-idx set_tile_rad vlist' W8 J3 j# j" t8 ?& l
- ddgettext ltlist set_tile_rc vname, ~) X p) D! P* O$ W, F
- ddimage ltlist_act set_tile_rot vpf
$ K/ k5 R! k$ x" E, I - ddimen ltlist1 set_tile_scale vpid/ ^. q% n+ E& h1 a5 _0 j! Y! c9 F
- ddleader ltname set_tile_spline_props vpldata
. q$ Y0 K3 q4 _7 T" }1 K9 i - ddline ltnmlst set_tile_stang vpn
" b$ |5 J0 l" r. J6 W+ U - ddlist ltvalue set_tile_style vpt% m- J. J! x' n. Y; ?5 T
- ddmline ltype set_tile_tag which_tiles
$ k4 _" i% o2 v0 D1 } - ddmodify_err m set_tile_text wid7 M \0 y* ]% `4 M9 h, y, w
- ddmtext majrad set_tile_vpt x, J$ O; J4 t3 o
- ddpline make_lay_lists set_tile_wid x1
( }; r9 X7 Q2 }5 V - ddpoint make_lt_lists set_tile_xline_pt1 x2
1 h# _7 [. g# J; q - ddray mdashlist set_tile_xline_pt2 x3% ]) h6 y: D% s }4 G
- ddregion minrad setcolor x4, _* h" \7 R6 t ~
- ddshape modify_3dface shght xdlist
- a; _, @8 x' A) a8 p0 u - ddsolid modify_3dsolid showpt xline_pt1
4 @$ O r0 d. U2 l3 n6 _; n' m - ddspline modify_arc size xline_pt2
: C: C$ ]+ Q$ a w( i3 D, q- ` - ddtext modify_block slist xline_x1
1 G" f6 d: x! Z( l6 | - ddvport modify_body sname xline_x2) f- [4 c+ z% V' d2 w8 l9 _" J
- ddxline modify_circle sortlist xline_y1
3 i" z- o' K; y( S: R9 n5 F - denom modify_ellipse spltype xline_y2- `8 \- I L/ b! {
- dialog-state modify_image ss xline_z1 _4 B. w2 y2 v% f, W" P6 ~
- dir_pt modify_line st_ang xline_z2" L! y* s% _0 Q+ W3 c% m- Q; c
- dir_ptx modify_mline stpt xscale, ?/ ?2 r( R' r4 M, }/ X
- dir_pty modify_mtext style_act xx
0 ^# }% j2 C' D7 e; S+ w5 w- b - dir_ptz modify_point style-idx y
' B/ T0 f7 o. P- y - dismiss_dialog modify_polyline style-list y1
' U$ R D4 K! C$ s! ~( l - drawpattern modify_prop_geom tagval y2
+ a) b# U2 @# Y( Y; d6 p - echo modify_properties temp y3- K! u. T9 z, H$ ` X
- ecolor modify_ray temp_color y48 S3 ?* |; ]8 t* k' L( K+ e
- edge1 modify_region temp_dir_x yscale
4 `5 x$ Z$ U: i- e% L+ ` - edge2 modify_shape temp_dir_y yy
4 I: p$ `: l/ ]+ R$ m - edge3 modify_solid temp_dir_z z1* ]7 S P: z: i# @% t: q& d
- edge4 modify_spline temp_xline_pt1 z2
( q3 F& z6 Q' p6 K' K% t0 k - edgetest modify_text temp_xline_x1 z3
8 |& n: r5 R1 {7 Y* ]2 Y2 G% v - elayer modify_vport temp_xline_y1 z47 z5 P6 s2 O' V3 ?1 D2 R( A8 l9 u
- elist modify_xline temp_xline_z1 zscale
. y u( I2 M' p" y% g9 g# p% } - ell_calc modlist tempend_eang zz6 N; D; i5 O; K7 E
- dir-idx safe_ddedit ver_MtextWidth xcliponoff' O7 c E& n% |% I. n/ L
- MText_style
0 _1 Z7 G2 z* l3 w$ _+ H - )$ j U' R/ g% L& {2 ?: w
6 X7 C; z) q2 x9 ~7 U- (setq old_cmd (getvar "cmdecho") ; save current setting of cmdecho
4 W5 @6 G8 C! ?) o0 h2 j( F) w9 ^, e - old_error *error* ; save current error function
4 Y1 n* m5 R+ U/ O1 ^ ^! a) Q - *error* ai_error ; new error function* c: _. [. I" \5 a; H. y) ]- A
- )
& k4 T, N( M5 a$ { - + V. U. h! Y( b4 w2 s- a; x
- (setq old_pickstyle (getvar "PICKSTYLE")) ; save old pickstyle
$ q9 U8 A6 W" r) `2 ]% B6 f - (setq new_pickstyle (logand old_pickstyle (~ 1))) ; turn off group selection
$ u2 k1 N& t, w* w- V% c - (setvar "pickstyle" new_pickstyle) ; bit and set to new value! T0 u$ e1 I0 l+ D- L; z
- ! s! y1 n0 i: _1 x) L' A7 n% s
- (setvar "cmdecho" (cond ( (or (not *debug*) (zerop *debug*)) 0)
9 U0 m9 e$ t0 H% Z0 _ - (t 1)))+ l. F' l+ ?# y
- (cond
, r; `5 r# S! [# U" A- W6 w - ( (not (ai_notrans))) ; Not transparent?
k" A; N. V3 o, I6 K! E! A - ( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
" k2 C& x- n6 ?# I& B% O - ( (not (setq dcl_id (ai_dcl "ddmodify")))) ; is .DLG file loaded?% r1 g1 K. L) Y& r* P
- ( (not (setq ename (ddmodify_select)))) ; object to modify?
0 L3 f$ r. r9 \% r/ C8 v
7 q4 P3 M- R% @% {4 e& K- (t (ai_undo_push)
O- n. M5 J! Z - (ddmodify_init) ; everything okay, proceed.
: S. u5 s( q4 R+ _5 _ - (cond# M* V- o% h9 G3 H( ^
- ((= etype "LEADER")
! w. n6 m" q: V& k0 Y+ d3 ] - (setq help_entry "modify_Leader_dialog")4 a8 G% j) T# h6 i
- (ddleader)
$ | C9 e8 k: w - )& _1 ~( S3 G2 T5 o/ J- ?
- ((= etype "ARC")1 {* X- p" g3 I- ~5 h% Z
- (setq help_entry "modify_Arc_dialog")
4 [6 r, @) i7 M9 L) l4 G. ^. @. V - (ddarc), M% W( ~; Y$ ]9 H+ T0 I% S5 o
- )) h: Y' }7 ? Z( U
- ((= etype "ATTDEF")# }) @8 y) T- H4 h# n
- (setq help_entry "modify_Attribute_Definition_dialog")) I+ l9 t$ q, `
- (ddtext)
3 L4 Q( K! K6 } - )
! S: Q* a+ N3 n( L - ((= etype "CIRCLE")" @1 t7 ^4 Q. t: N/ P
- (setq help_entry "modify_Circle_dialog")
& n p! ?! {- [" N7 f( @; q - (ddcircle)2 N; W5 t3 [7 l! p
- )
- w( p. T) V& o, U8 b7 h, j k+ r - ((= etype "ELLIPSE")5 |- o9 J3 @2 k6 h5 t
- (setq help_entry "modify_Ellipse_dialog")
9 o5 L4 s Y# w: V" D) g - (ddellipse)9 k, `1 K3 U2 v& m
- )
+ V, S& }' t6 B2 J - ((= etype "3DSOLID")
. m& M# g7 C% K9 \6 w0 N5 ` - (setq help_entry "modify_3d_Solid_dialog"): j6 Y/ \6 i+ x0 j$ _4 ^
- (dd3dsolid)5 K1 d8 @. W2 T. P, w* Q" }. ~
- )
' z& D( O) |* g7 L - ((= etype "BODY")4 w1 c, E1 e5 y
- (setq help_entry "modify_Body_dialog"), r3 g% C. A4 M% D6 x
- (ddbody)
# @# G7 T; B0 a9 J4 u% l9 J3 O8 O0 [. V - )% k& P; o' A: N! Q+ y! g% v
- ((= etype "REGION")
9 U/ C( |, `' R7 h( o - (setq help_entry "modify_Region_dialog")
/ v- S$ ]" E9 w1 o" E: C( m - (ddregion)+ L/ S+ h5 }( Q% Y+ K7 _+ ]9 @
- )* q9 c9 T0 t* j3 t
- ((= etype "HATCH")& C" k7 }" k7 p% @; v. _
- (setq help_entry "modify_Hatch_dialog")( X! Y2 q: C' W5 H
- (ddnewhatch)9 e) }' e, k( Y- t- ~
- )
' G6 E) `$ T! e' E" `+ K - ((= etype "SPLINE")
! w9 K& t. u6 k' x7 R; f - (setq help_entry "modify_Spline_dialog")
4 X) Z$ J# \, v& \. d - (ddspline)' h0 U6 J7 v) a) Z9 _0 Z/ d2 X! O
- )
; W2 e* W& ]& J - ((= etype "INSERT") ; see ddblock for help_entry
* [+ r4 x4 m2 K - (ddblock)/ [; f9 x h( i4 I: C4 Y, K% M v
- )0 f3 ]5 W. r5 ~' O1 [
- ((= etype "LINE"). i: c$ O0 G. u9 @& G+ s* `
- (setq help_entry "modify_Line_dialog")
9 z, x" _% B- D4 Z& X3 ^; M4 k* C - (ddline)
: S# J, i$ b* z+ y; C9 S* ^ - ); B& \; _& j: X _' }
- ((= etype "MLINE")) f3 \- a" f! j5 p+ ~- m2 f
- (setq help_entry "modify_multiLine_dialog")
6 f5 e, Q& x, }6 J5 {9 C" | - (ddmline)
( E$ Q9 G3 ]3 d/ _* m - )
$ X3 A, L% S: ^4 m. I% b6 E- i( t" m - ((= etype "RAY")
" z7 |- W1 K' i, n - (setq help_entry "modify_Ray_dialog")
8 t8 x3 B5 v. t. f. k, D" u - (ddxline)) H5 G& E1 `5 ^8 F, ]
- ), j1 g3 u- o4 h
- ((= etype "XLINE")& c; w# {. s1 ?
- (setq help_entry "modify_Xline_dialog")
& v. W+ n/ u; Y% t - (ddxline), ?- X( z* {* n
- )
& c$ C. f1 o" p - ((= etype "POINT")
* g Z$ u& b7 m3 v$ F5 o. K - (setq help_entry "modify_Point_dialog")
3 Y3 w; \/ e5 Y& u8 k: N - (ddpoint)
7 V. I+ s5 s4 I+ f) V - )
# `7 n b, C. H; W# b4 \ - ((or (= etype "POLYLINE") (= etype "LWPOLYLINE"))
L& r2 D! m) m4 l! a$ v0 \ - (setq help_entry "modify_Polyline_dialog")# c. k' a3 ?2 u+ \) c2 o7 M
- ;; If a 2D pline, check to see if it is planar to the current
+ R) {- m- z! f- W8 P - ;; UCS, reject if not. To see if the pline is parallel,
: |2 t6 y9 S4 i: Y% n, i; D1 u - ;; the 210 group (WCS) is added to the current UCS origin (WCS)
4 x- O0 p7 \2 V6 n5 }& S; k) p/ K - ;; and then converted to the current UCS and checked to see if
4 O+ w6 x: m3 Q# m9 \" d" v+ k - ;; it is equal to (0,0,1)." s' `7 k- N: ?/ p/ S# G" i" A
) g5 {7 A+ p; l, X0 C' d- ;; Incase the 210 is default and not in the dxf list.
% I& F+ J8 w! N, s. L* h4 W2 Z - (if (= (assoc 210 (entget ename)) nil)
" @; Y; ?- \9 `& D - (ddpline): k6 O5 r) ]( x n
- (progn; e6 c6 {) a. K e* @( s: h% {. S
- (if (and (zerop (logand 120 (cdr (assoc 70 (entget ename)))))
1 }% m8 S: S- Z& B( r. [# n6 y - (not (equal '(0.0 0.0 1.0)* R U5 |$ ~. ^1 m) n; I) X6 ]4 k+ m
- (trans (mapcar '+
, v8 @0 @1 c6 h' K4 T/ W - (cdr (assoc 210 (entget ename)))5 c5 P! {/ D( e. L6 S& X* a3 X/ j
- (trans '(0.0 0.0 0.0) 1 0); b5 `" y* W" X" V/ Q. P/ v
- )) y/ `6 n9 j8 J$ ~
- 0 1
9 @+ _' ~, \/ F- [ - )
" B% s4 K) o. ` w& J - 0.0000000001 ; fuzz9 ?4 r% t- w# V4 a7 }3 ^* E
- )1 B& e" N' P- l1 @/ L% `5 C( F
- ) p& G: x) A8 L4 F6 A7 W' T
- )5 B' q* \$ `* D7 ]$ d* K9 R
- (princ "\nThe 2D Polyline is not parallel to the current UCS.")
0 K2 r; h# N; i1 k - (ddpline)3 P2 B N4 y. V" I7 \& {
- )+ W( ?* n) L: P! s9 T4 _
- )' _2 o- j! H3 I1 x9 T
- )% P. e8 h. B6 \
- )
# C" v+ j+ G" [: r+ Q% m @
6 f A" M9 K: K- ((= etype "SHAPE"); |& q& d3 |* m# o/ x
- (setq help_entry "modify_Shape_dialog")
7 q1 h3 O1 }$ l& H7 Y0 {! I - (ddshape)
! Y9 W9 k% K6 M7 f8 \7 \+ T - )
# |1 X Q. M# Z - ((= etype "SOLID")5 J" t. o0 \ ?! W" E4 K, l2 t4 ]: J2 J' J
- (setq help_entry "modify_Solid_dialog")5 s% P4 r+ D y. E1 R
- (ddsolid)
" E' x$ Q4 M2 R* z% w% z8 [7 h - )
1 k: V" h/ D* x1 Y. H* F+ n - ((= etype "TEXT")! o. d% ?, Q4 d" v7 b
- (setq help_entry "modify_Text_dialog"), l3 ^. X$ a0 `6 p
- (ddtext)6 |; ~( P6 {3 [) ] x
- )& o6 i: ?- X4 X9 P7 I
- ((= etype "MTEXT")
2 D. ?& M! y9 N* o - (setq help_entry "modify_MText_dialog")
5 R* C& b7 K1 M) i+ { - (ddmtext)! N3 C8 r! n8 C( `% P8 l1 l
- )! b. z9 N @ K* x
- ((= etype "TRACE")) Q5 M9 O% x* Z( ^4 [
- (setq help_entry "modify_Trace_dialog")
M" H" r, }5 Z - (ddsolid)
4 F; p, R) w; Q7 B3 z$ x+ L - )9 _ u. u8 @; f* O$ ~
- ((= etype "VIEWPORT")
) E# Y1 D$ }/ t/ p; W, W! @0 b: `8 _7 j - (setq help_entry "modify_Viewport_dialog"); y* `' _ F0 F) y( m1 V
- (ddvport)' Q: Q. r* `' a. D
- )
2 M* O) Y" `5 ? - ((= etype "IMAGE")
" t. B( l/ Y3 ?) Z3 d4 R8 Z6 N4 ~: e - (setq help_entry "modify_Image_dialog"); [ A4 q. n+ X- ~; w
- (ddimage)- n$ f/ L" _! k% O$ |
- )8 t0 i# |( V7 u0 `( _
- ((= etype "3DFACE")
( o. C: T2 [( U# K% `7 s - (setq help_entry "modify_3D_Face_dialog")
- o: ~* f2 E% N% _' x9 Q0 u; [. q - (dd3dface)
3 t" a9 E9 B! z+ \( ], d. u& `' X5 t - )
/ F, ]% H9 W* o - ((= etype "DIMENSION")
8 F: [% u7 u/ d - (setq help_entry "modify_Dimension_dialog"). \7 D5 M/ m6 f9 y+ _
- (ddimen)
. }$ X9 m3 }$ A! S/ { k" { - )0 q. E$ q) `" V/ p5 _
- ((= etype "TOLERANCE")% _' e9 A0 |; e* }/ E6 y% G
- (setq help_entry "modify_Tolerance_dialog")
% B0 A6 t! a9 L% Y% U+ O1 V - (ddtolerance)
$ c1 Y% ]) j3 o6 h0 x - )
8 \& Q' q9 |. b - ;; Fall-through condition changed by MCAD for MDT 1.1 release.
" W: f. U6 E! ^' G - ;; This allows DDMODIFY to work on any custom object or any new object type3 X" ^. J' Y8 N2 o2 e; B
- ;; that isn't specifically handled above by calling the more generic DDCHPROP.. I' [; b9 X# e9 |
- (t
+ }1 A U( r% U( [8 ^ a2 i1 E - (if (and (not ddchprop) (not (load "ddchprop" nil)))/ v) I: f+ g) O
- (princ (strcat "No dialog support for object type: " etype ".")))
/ ^+ t9 v. x+ \* t- M% P - (progn7 J x1 s2 h- j3 u0 I
- (setq tempss (ssadd ename))
0 W6 I$ \3 W8 h; {6 l& f6 ?. ~3 S - (ddchprop tempss)
# ~- g& D* d' o* E1 ? D - (setq tempss nil)5 ?2 `, H( C4 f$ R$ Y: c8 I
- )
/ H; @& d4 y/ D& ^3 c" q& A1 A# s - )
, J" U9 Y# C; v1 s) O- G# V - )4 X d X" h: f5 b( [
- ;; Previous fall-through condition.
/ S1 }) W# z4 E$ y" M( ? - ;; (t (princ (strcat "No dialog support for object type: "
3 t9 u% N+ @, V% `; t - ;; etype ".". k6 @, O9 E, v# A9 q' t4 \( U
- ;; )0 r5 u3 R4 G+ Q7 k$ ~' }( |
- ;; )
, ^/ R+ E m& a& B- [4 C - ;; )
, q/ b' H% r( h! R# l0 }0 t2 v$ G - ;; )! W) N3 W( ^+ B# d5 L
- (ai_undo_pop)2 y& v1 i! q3 t9 l1 b. G
- )- ~7 [7 x: I9 t0 C
- )* Z y% f2 o4 p4 P' z6 ^. R m
- ( Y7 C- M/ Q% E+ E/ X
- (if (eq new_pickstyle (getvar "PICKSTYLE")) ; if user didn't change pickstyle. F/ N+ a; X7 {" P/ L
- (setvar "PICKSTYLE" old_pickstyle) ; transparently then set it back
! \1 `1 i3 c# K8 r( G - ) ; to what we started with$ K. X* o2 A3 Z+ v$ @, \# _. u9 x# I
- " v; Q) i! Y0 J* W5 _3 k l
- (setq *error* old_error)* x% J# Y7 T' c% p# J& U" {
- (setvar "cmdecho" old_cmd)& u0 u6 C0 x% T. ?# \ K
- (if (not reset_flag) ; if object was modified, then5 s2 H4 ^' ?2 C( N* L
- (ai_return ename) ; return it's ename to caller
: I0 k% M) c. A4 J* G - )' A$ s1 G6 [) J4 A2 C7 ~+ d& L. K* r7 ?/ ^
- )
" F6 D$ ?' C) R1 J- |8 S2 F - + s2 v0 q9 A3 c5 o
- (defun checkForLockedLayer (ename)
0 r5 Z6 }5 h M( f4 }6 a: M6 Y | - (setq layername (cdr (assoc 8 (cdr (entget ename)))))
7 F+ f9 a1 @. I0 h/ E0 D& q9 A4 O5 q - (setq layerflag (cdr (assoc 70 (tblsearch "LAYER" layername))))
* U2 q+ i! @2 A$ m1 }/ Q) e - (if (= layerflag 4)
* t* j! L; j5 x) h/ z - T( C. P7 b/ E( O
- nil" \5 u( G4 E% k1 K6 x e
- )
8 Y$ V Q# C, D9 ^$ }2 O$ ^ - )
4 e+ E$ |$ p% g" V3 T& n6 F$ t
7 @: V$ K& `. G" K J) [- (princ " DDMODIFY loaded. ")( l. p' u9 c; M. g6 i# ^
- (princ)' ]$ x: h8 V& b" {4 ]/ H5 k$ ^
- ;;;???;;;---------------------------------------------------------------------------------------
/ o% D/ V; J; T* Z4 _- p
! ?6 s* T: r) t$ r6 |: P2 M- ; Next available MSG number is 8
# L( K& U! h" c - ; MODULE_ID DDUCSP_LSP_
; V, a( N' f" t( A+ @# s8 l9 i8 S! P - ;;;6 W& r( N$ M% I3 Q
- ;;; dducsp.lsp
7 }; N- l7 s+ @* H, _ - ;;;5 q; f3 O: g E! g g$ H, E9 Z
- ;;; Copyright 1992, 1994, 1996 by Autodesk, Inc.
1 x5 X; Z. @- K! e0 I0 X - ;;;$ V! r7 b: z- z" x' x
- ;;; Permission to use, copy, modify, and distribute this software# v' f# `3 q6 C; @+ Y2 r. a6 l
- ;;; for any purpose and without fee is hereby granted, provided6 a: ?3 ]6 b7 _
- ;;; that the above copyright notice appears in all copies and6 _ y! a1 F, L' j0 m
- ;;; that both that copyright notice and the limited warranty and
. E( Z' z) w3 I) I5 ~. W" ^ - ;;; restricted rights notice below appear in all supporting; h/ ^ }2 W' V% S& w& i. t9 Q. v
- ;;; documentation.
+ _- B2 a5 T3 D. @2 p - ;;;8 b+ ?! ]+ K" { x4 m
- ;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
( X2 e5 G% H, l. f3 j# z - ;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
7 u2 S# N* ?1 f% U$ E - ;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
7 }5 N M9 f: c& j- D3 g5 G: `4 e! u# ` - ;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
( S+ O$ v; t' b; @( ^ - ;;; UNINTERRUPTED OR ERROR FREE.+ F7 \" h7 w. A2 e; z. ^
- ;;;0 U7 B! X# t: H7 k e& o
- ;;; Use, duplication, or disclosure by the U.S. Government is subject to
( i- N4 ?3 X/ F& Q - ;;; restrictions set forth in FAR 52.227-19 (Commercial Computer/ V& R1 c0 R7 @8 x, y' L) s
- ;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) # J1 p1 ^" B( I% c
- ;;; (Rights in Technical Data and Computer Software), as applicable.
8 t& r8 w1 W, ~2 A - ;;;
/ g( B5 |" w5 v% y# d( q$ Z# V - ;;;.
7 Y/ F; T/ n+ f! J! z9 w) j3 z - ;;; C:DDUCSP - User Coordinate System presets dialogue.
/ X% a5 O* b" I k, D - ;;; . [0 N0 }/ w$ U6 ?1 c# G2 g1 Y% D3 w
- ;;; Uses DDUCSP.DCL for the dialogue definition. The
" h: _, @& ]6 D - ;;; slide images are in ACAD.SLB.
: N% H6 J* W6 P: c9 T8 m: P - ;;;' r' J! w7 h" ^% G! T5 ~
- ;;; ===========================================================================
- v/ A K8 Z1 M9 @( b X2 R( B) c - ;;; ===================== load-time error checking ============================8 |. T# Z, D6 f+ a4 F
- ;;;3 t0 h& O# c9 }6 i( _
- 6 N1 e0 l5 x2 s* }9 A! R+ J( L
- (defun ai_abort (app msg)* G- r* |: q/ A+ M2 r9 Z& s
- (defun *error* (s): d E& s- E1 Z S1 N) l
- (if old_error (setq *error* old_error))
5 c6 W6 z+ G6 U9 j P) O - (princ)3 c" T( f- u" ^& u" X1 g) z
- )
+ A7 I8 { b: X6 V: | - (if msg+ H, B! U8 L4 O& O; i% X
- (alert (strcat " Application error: "
" e# D R5 }1 G8 f2 b; u3 h2 m0 m - app
$ l8 f, b; x* m) n8 Q, y - " \n\n "- ` z' ?+ A. z. I9 n/ h
- msg7 J. G8 p5 e( p$ ^; @1 u
- " \n"7 u6 U8 R. Q+ _- b1 v
- )1 C5 [- p8 [+ U. T
- ): F. m8 p0 Z/ d6 f6 R
- )
2 g& I4 Y! B' A) p, V4 d7 \ - (exit)
' r; F1 l* l- f' n" p - )
2 [* ~6 J" ?. Z6 Y1 r0 F5 ? - , V- K( B3 R, {& ?/ X5 Y3 k5 z
- ;;; Check to see if AI_UTILS is loaded, If not, try to find it,
, |8 b8 z- x, I: {5 H - ;;; and then try to load it.* L/ \4 k; w+ Y0 t
- ;;;- [8 I; c ^. ~
- ;;; If it can't be found or it can't be loaded, then abort the! s. X$ K+ f5 z8 J
- ;;; loading of this file immediately, preserving the (autoload)
' q5 E: r. ?1 v - ;;; stub function.. x+ y& s( Y) O! Y' G5 W
- , J. Z9 o. L7 G4 N( U/ n/ h" S
- (cond) g5 z |# c. ?" A* u( J5 F
- ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.$ E4 k. X7 E s; z: k# @2 D4 k: d
- 2 \( Y8 z" y8 b6 N% B7 [1 J4 a! A
- ( (not (findfile "ai_utils.lsp")) ; find it
# |9 ]' S2 [ B9 a1 j1 D5 k) b - (ai_abort "DDUCSP"' e+ ?$ _$ W7 |, E9 s/ _' v4 q) S
- (strcat "Can't locate file AI_UTILS.LSP."
2 s4 O+ M# h2 v s; g7 `7 H1 W+ V - "\n Check support directory.")))# X& f; p, M/ h+ j0 C; [, W9 v
+ v% P6 t* S/ A; N q- h: y2 M. ?- ( (eq "failed" (load "ai_utils" "failed")) ; load it- m! U* ]3 c8 N& J% B2 Y* X
- (ai_abort "DDUCSP" "Can't load file AI_UTILS.LSP"))7 h1 `( o, G' h( E( o
- )" ~% k. E1 X: t& n
: c/ p0 M& ^: U: U. x- (if (not (ai_acadapp)) ; defined in AI_UTILS.LSP" |1 c* Y: P5 m7 G* w
- (ai_abort "DDUCSP" nil) ; a Nil <msg> supresses+ b1 C3 w$ x Q: ~
- ) ; ai_abort's alert box dialog.
0 X0 @5 c- J; _" |& u# I- [ - # a7 Z0 z$ C$ A; S6 R N
- ;;; ==================== end load-time operations ===========================
& u8 w" `$ A7 T& r0 F) k
: o4 A1 G/ z# `4 |6 v- (defun ai_ucsp_start ( / program)& O: Q, a: h! W0 H% H1 k* f$ T
- ;; Get program name
: R' O& ]4 k7 R. b - (if (not (setq program (getvar "program")))
- L% j f5 i; r3 O+ |4 f - (setq program "acad")
; Y4 T" {! E6 ^2 t - )2 x8 R9 T1 `8 k. t' S. x5 J
- (foreach v0 '("world" "left" "cview" "top" "front" 6 u* B4 \- J0 S8 d! w
- "bottom" "back" "right" "prev"). h9 ?6 L+ m$ f3 s+ Z4 V7 [* M
- (start_image (strcat "ucsp_" v0)): L, d8 l9 @# w. B3 I- s- m
- (slide_image
$ q% A0 P5 E% I* a2 ^ - 0 0! v4 a! E6 q% I# C
- (- (dimx_tile (strcat "ucsp_" v0)) 1) (- (dimy_tile (strcat "ucsp_" v0)) 1)
D$ f6 P- t+ e3 O - (strcat program "(u-" v0 ")")6 t5 w& v; A6 X, J* E
- )
( R* G% `1 D: E6 h$ L7 v: E& @ - (end_image)4 B; J! C& d" t; S1 a1 k- o
- )
0 @7 y% p2 B: v - )0 ]% X: G6 F* e0 H; t4 N; ^
- 0 v7 H' [$ K2 t. T6 ?- A
- (defun ai_ucsp_set ()
$ o s/ o3 C0 V6 T4 ] - (if ai_ucsp_sv* j/ b, d& Z: o: W, T- V
- (command "_.UCS" "_V")
; K U4 C: z# U& O' }8 [# { - (if ai_ucsp_prevs8 w2 p) D( b! P0 I2 U
- (command "_.UCS" "_P")
1 V. U% ~$ t* H" v- z; p8 t" C7 x - (if ai_ucsp_chg L% x8 C, G) {5 q, |
- (progn
3 A! n( l- D2 p. s8 D9 W - (if (/= ai_ucsp_a "*")
8 M% @7 v- A/ @7 M. a9 i$ ~# @$ U: m) m - (setvar "LASTPOINT" (trans (getvar "UCSORG") 0 1))
. Z+ @2 _ H9 |" o6 [/ G - ); V) ^7 B) v5 |
- (if (< ai_ucsp_pick 6)
/ f. ]* M+ B3 ]( ]' m& ] - (setq ai_ucsp_set0 "@")
7 p$ _# O" {. t6 c; f/ E ~ - (setq ai_ucsp_set0 "*0,0,0" ai_ucsp_a "*")) r; L; U& H& Z+ x% k' ~$ r: r
- )
* ]7 N ^1 S6 z& Z" Q" Z - (cond ((= ai_ucsp_pick 0)
7 r) R, T$ j' ^; J' A% j - (setq ai_ucsp_set1 "0,-1,0"; N2 P& W# d7 s' `
- ai_ucsp_set2 "0,0,1"- b" o9 d6 e5 U- h, R
- )
$ q$ u, ?. t: l6 N- S - )
( @ K4 f& h* j" T7 L/ x" `. v - ((= ai_ucsp_pick 2)& J' C8 q: c& k3 l
- (setq ai_ucsp_set1 "1,0,0"' R( e8 m; k$ e
- ai_ucsp_set2 "0,0,1"
" u) f. m- f. C8 E o+ z' \ - )
, P9 Y$ W7 ]4 L4 L/ f+ \ - )9 x" v- k1 ^, i$ U& r) [* M
- ((= ai_ucsp_pick 3)
& [+ V0 q- y3 X2 u8 l0 A - (setq ai_ucsp_set1 "1,0,0"' ]* j; B/ A$ O2 P& @
- ai_ucsp_set2 "0,-1,0"
" D* W9 J$ X! p5 b. L - )+ O* l& k' y& y/ \/ F1 J5 x
- )( \/ i$ L- a! D/ @3 D0 y7 A
- ((= ai_ucsp_pick 4)
, J$ u: K8 U7 t6 t' b' v5 A - (setq ai_ucsp_set1 "-1,0,0"
& l6 C: p, J: I0 f \ - ai_ucsp_set2 "0,0,1"% d' T/ s. _* i3 R6 l! U2 @
- )8 g$ J/ a; y0 y1 H
- )
$ i# T0 g' p- I7 i - ((= ai_ucsp_pick 5)* a- C2 j7 i% d" u5 P ]
- (setq ai_ucsp_set1 "0,1,0", J0 C+ `6 X7 W4 m( o
- ai_ucsp_set2 "0,0,1"+ I# f; H/ [* p J: j; \
- ): @/ o* d+ n/ T: ^; [
- )
8 \4 ^, y2 f( F6 L2 P - (T6 P5 k ^& _1 E: _# u" U
- (setq ai_ucsp_set1 "1,0,0", ]0 F/ j4 ] r6 A
- ai_ucsp_set2 "0,1,0"+ } B. s E6 P" E$ a5 z
- )
( N, y! U* x; d3 B - )' P) y. R% \# M" U, P
- )
; \/ U8 Q5 C7 K+ q- J$ S4 p! m! y - (command "_.UCS" "_3P" ai_ucsp_set0 : O0 F' S0 U: P1 k; h
- (strcat ai_ucsp_a ai_ucsp_set1)
* ?# K0 B" U- O+ s6 o9 W - (strcat ai_ucsp_a ai_ucsp_set2)6 p' F6 c- v* c$ U4 ]
- )
+ H, ?0 B* J5 Z# Q8 x' @ - )
% a2 c0 S( l" @1 m; X. V- { - )
; _) U3 a c( Y9 O& s5 Y - )
7 o* ?! G, H5 ?! M# w* x - )
& M: F9 } R2 @' @- R% T - )/ ~; c/ o$ P; ~; i; u9 P4 o; g
- " m# f- C) O% ~: G8 t! `+ p
- (defun ai_ucsp_p (val currtile); o$ u, Q+ \2 P" n; e0 a
- (mode_tile ai_ucsp_currtile 4)4 X& `- F/ x- n5 `/ X
- (setq ai_ucsp_pick val" z, g% F' ?6 L1 b
- ai_ucsp_sv nil1 p$ a0 C/ @* ?+ @
- ai_ucsp_currtile currtile; a" k i$ H' i9 I( O5 g- S$ }; a
- )
B/ S& @' h$ B6 y$ V0 F4 y - (if (/= val 1)
3 ?; p! [8 R5 f - (setq ai_ucsp_chg T)
8 E2 m3 S t6 w - )$ i% {0 ~& M6 @# L7 ^+ ^
- (mode_tile ai_ucsp_currtile 4)
i5 D( K& c3 Y - )
# D @7 A# A. X2 a* `) c$ }* `! O" N6 L/ ^+ c - + e6 h& d5 V" g
- (defun ai_ucsp_swcs ()
- m0 ]& |( A7 D - (mode_tile ai_ucsp_currtile 4)
: |$ T0 J' Z' j! C7 O9 u- B - (set_tile "ucsp_a_wcs" "1")1 s9 @& Z0 F0 m4 m
- (setq ai_ucsp_pick 67 W5 n2 h R* z8 l# N# R+ K
- ai_ucsp_sv nil, A/ t- N* T, R& \ b1 E$ w6 W
- ai_ucsp_currtile "ucsp_world"0 \3 q8 F$ k$ I/ F. n
- )
( g* ?" L# N: v7 \, T: S - (if (/= 1 (getvar "WORLDUCS"))) e0 h6 y! Q: c- Z) E
- (setq ai_ucsp_chg T)
, F. E1 g% _4 J# B - (setq ai_ucsp_chg nil) i6 |& _, v1 J0 K6 \" q
- )9 _) G0 t) w7 D6 m% S: a0 a( o2 z
- (mode_tile ai_ucsp_currtile 4)
, V( [5 j/ b$ i6 ] - )
! N9 g0 m1 {/ h8 {2 G
8 J2 Z/ L3 u, r7 ? t- (defun ai_ucsp_cview ()' O/ P7 ~5 G9 ]3 a
- (mode_tile ai_ucsp_currtile 4), p, `# J6 @2 @ }: G
- (setq ai_ucsp_sv T " P3 V! j6 U( D# N+ G
- ai_ucsp_chg nil( B" H+ }/ c* @
- ai_ucsp_currtile "ucsp_cview"
- q" u, b3 B3 }5 h, F - )
1 W8 f- \( o& R1 S8 ^" P. _ - (set_tile "ucsp_a_wcs" "1")
. o7 G7 g0 C$ |' U - (mode_tile ai_ucsp_currtile 4)$ g- H! P2 {2 {& R0 r3 v% x7 _
- )
& l0 g" c9 j0 n* b8 u
6 a7 i, t- A L4 Q- (defun ai_ucsp_rucs (typ): u5 p* ?& ^$ k% b
- (setq ai_ucsp_a typ)
& s. }. b. T- |9 t% h% Q9 O - (mode_tile ai_ucsp_currtile 2)
! _2 d) I! b0 g8 _2 Z# G& h { - )! L6 W& B! r! Y' n
- + I9 P1 Z# \/ J1 T* I
- (defun ai_ucsp_prev ()
, X3 G0 a/ a8 B - (mode_tile ai_ucsp_currtile 4)
% a$ B/ n2 @5 ]" [, B* }+ D- e/ H - (setq ai_ucsp_prevs T
- F7 s# r/ n$ @- [& q5 W - ai_ucsp_currtile "ucsp_prev"8 ~) \8 l! z2 y
- )( v8 e9 [; v' `' R9 H! l$ k5 b! t
- (mode_tile ai_ucsp_currtile 4)
; ^9 I7 {$ x* L9 ]5 i! p - )& O9 L0 J7 U( c1 H X' X
- 9 `3 W+ g# v2 k3 w5 o
- (defun ai_ucsp_main ( / ai_ucsp_pick ai_ucsp_sv globals)2 z$ G- B1 t. \: g4 g/ J7 Y* N
- (if (not (new_dialog "dducsp" dcl_id))
7 e; j" g& K6 T, u1 J i- j - (exit)4 Z2 L' K% Y6 f7 h" c4 I5 g. }7 k
- ): p+ v0 i5 g3 R) n+ {% e
- . G2 V3 q2 m2 D' x# q( N+ P/ Z' b% K
- (ai_ucsp_start)$ e0 Q2 N/ q! D/ V. |5 y. z
- (setq ai_ucsp_a "@" - C" d& _1 v7 A. ^2 C
- ai_ucsp_pick 2/ b' e5 l/ `! S9 d
- ai_ucsp_currtile "ucsp_top"
4 _2 d& p9 V3 J+ k# f: z# N - )
: p! B. J0 g$ \+ T; o8 B - (if (= 1 (getvar "WORLDUCS"))8 E+ G; h" I: f
- (progn
! n( | `! v* G - (set_tile "ucsp_a_wcs" "1")( g& ~( o1 y* N W
- (setq ai_ucsp_currtile "ucsp_world")
& k p0 X/ Q; `" L - )5 X( I' g5 F6 e. U. j6 M
- (set_tile "ucsp_r_ucs" "1")6 S( [) v V) y, J
- )
, R1 d6 c4 |: ]8 }3 }) R4 o" O) } - (mode_tile ai_ucsp_currtile 2)
/ B! [2 r* l: O6 U - (mode_tile ai_ucsp_currtile 4)
4 @* w; g" K* ?2 _, W3 K2 c- v - (action_tile "ucsp_world" "(ai_ucsp_swcs)")
) ?4 C. D: j8 R) N - (action_tile "ucsp_cview" "(ai_ucsp_cview)"). B" Q* ~8 O8 ^
- (action_tile "ucsp_left" "(ai_ucsp_p 0 $key)")
- V; [) R) f- A* C2 A - (action_tile "ucsp_top" "(ai_ucsp_p 1 $key)")
( D) ]* {* V v7 b8 u9 }* n - (action_tile "ucsp_front" "(ai_ucsp_p 2 $key)")7 f. I% D& U8 H8 ~+ W( W
- (action_tile "ucsp_bottom" "(ai_ucsp_p 3 $key)")
* D; D; b% t( l- [* W# J8 m - (action_tile "ucsp_back" "(ai_ucsp_p 4 $key)")
+ A5 C& \+ s# X. d - (action_tile "ucsp_right" "(ai_ucsp_p 5 $key)")0 ^. b% ~. q! O' a! S' ]7 w" J q
- (action_tile "ucsp_prev" "(ai_ucsp_prev)")" [" H6 U8 \, H3 O" Q: _+ }) f
- (action_tile "ucsp_r_ucs" "(ai_ucsp_rucs \"@\")")
# b6 n; Y+ Y+ O5 U - (action_tile "ucsp_a_wcs" "(ai_ucsp_rucs \"*\")")
1 b. R- C3 X2 t" z, F - (action_tile "accept" "(done_dialog 1)")) b7 D. m& l) n* Y$ V S6 O: F
- (action_tile "cancel" "(done_dialog 0)")% p {/ e9 s$ \0 V9 X/ M
- (action_tile "help" "(help \"\" \"DDUCSP\")")1 Z8 U( Q0 p, X! x
- (if (= (start_dialog) 1)
& o/ Z* e0 G: i- h. U/ [! I - (ai_ucsp_set)0 n& b& Z8 b) S" B9 M m/ h, t) }
- )/ N* N& P1 K- \
- )
- a1 ]4 g* V0 x# s8 A
8 O7 t) x" Y; F$ F* O: h' u* E: m/ q- (defun c:UUS ( / app dcl_id old_cmd old_osmode ai_ucsp_prevs . p4 r: y1 z. L/ Q) f8 r
- ai_ucsp_sw undo_init). B! a& J6 c3 Z. Y# n7 T
- 4 g/ x% [; w) s7 K# i! m* B& T
- ;; Set up error function.
. a9 x! M5 V. {+ Y% Q" | - (setq old_cmd (getvar "CMDECHO") ; save current setting of cmdecho) U$ Q1 H3 Z/ i% p2 p
- old_error *error* ; save current error function9 ~% j0 K3 I0 P5 l) |2 D
- *error* ai_error ; new error function
. e+ ?, H; }# e: b4 r; a - old_osmode (getvar "OSMODE") ; disable OSNAP for duration
* |( f' [/ e( ~2 G9 { - )
. l. \- P r1 R8 W G$ I
7 x8 z: `) w" }. t7 r! _- (setvar "CMDECHO" 0). ^' @" l2 J0 H6 g: v
- % S, a" O" v2 `* s
- (cond
( M' d: A/ u* a - ( (not (ai_notrans))) ; transparent not OK
4 r/ m q7 K1 a - ( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?* A, p& {1 S. [/ g; G
- ( (not (setq dcl_id (ai_dcl "dducsp")))) ; is .DCL file loaded?
! \; D2 T7 B2 R$ {' F5 i - (T (ai_undo_push)2 o2 m3 I' N+ }
- (setvar "OSMODE" 0)
( `9 K* E f5 S. M6 f - (ai_ucsp_main)$ U4 i" W2 b# H% W& u, k0 C6 |
- (setvar "OSMODE" old_osmode)+ B( q3 T; m$ _# O+ C( L# z
- (ai_undo_pop)) K* {) K; Z9 B
- )1 J) H+ Q8 G- w/ s8 g
- ). b% x2 P5 s5 u6 j! ?* |, I0 S
6 R7 H/ p4 y4 M( X; Y1 j1 ]- (setq *error* old_error)
0 Y/ J) s8 L5 c! O" K - (setvar "cmdecho" old_cmd)
% F9 ?( n4 `# _0 Z - $ o7 {" v) p4 q. b$ c) x- a
- (princ)% O4 s1 _( j8 u, W5 y8 u. D/ a
- )% O+ o9 u! u2 e. y0 J5 f. ?
: | u+ g* u' J8 l3 u* q; \- (princ " DDUCSP loaded. ") \6 _/ ~9 ~: o
- (princ)% K! t& q5 F% Q# d7 f }; N
- l7 X( R; w1 i: E# h8 d# }
- ;;;???;;;---------------------------------------------------------------------------------------3 K* D' q2 |' K
, ?' R2 J6 U- t3 O+ S" M- ;;;----------------------------------------------------------------------------4 }& q- C7 {9 G. x: u/ o# r
- ;;;. m5 U$ @; M) p# A' ]" s7 \
- ;;; EXCHPROP.LSP
' |+ R+ I4 R. [ - ;;; Polyline and text modification capabilities added by . q* B1 S* i8 G3 E: z; \
- ;;; Randy Kintzley ' F: E1 |$ I" d9 m! g
- ;;; ; K- u7 P9 k" i; w8 p
- ;;; Copyright (C) 1997 by Autodesk, Inc.4 ^5 e8 @# ?3 T5 b4 t
- ;;;
- K/ X/ k/ W/ g2 j5 [ - ;;; Permission to use, copy, modify, and distribute this software
8 Z1 N$ Y* g# a {$ G0 q& l) t# N - ;;; for any purpose and without fee is hereby granted, provided0 m7 W5 `* b3 S d7 V- Q* E: q
- ;;; that the above copyright notice appears in all copies and" p5 A* `7 r7 C& W
- ;;; that both that copyright notice and the limited warranty and a" S$ B! `/ l3 d( \
- ;;; restricted rights notice below appear in all supporting1 A7 g$ F% K' e: x- j- D
- ;;; documentation.
& M, Q) [7 ?6 U% H - ;;;
2 I2 |% @7 s8 h# k - ;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.) L. ?# ]2 C" Q3 C
- ;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF" b& d6 P/ q" l$ Z0 l( f) J$ @
- ;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
g! Y+ P# }' [* m. \ - ;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
/ F6 m- o. W. u8 P+ s+ T6 g - ;;; UNINTERRUPTED OR ERROR FREE.1 f& `7 a l0 [ P$ [0 V( B5 j
- ;;;) U6 v; W7 w0 D; W0 d: }' e
- ;;; Use, duplication, or disclosure by the U.S. Government is subject to
3 S! M& c# Y: o. L( |# j, H - ;;; restrictions set forth in FAR 52.227-19 (Commercial Computer% O5 Y; P$ _6 T$ I; r% C( a
- ;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) M) u/ R9 a% @ g2 u/ i
- ;;; (Rights in Technical Data and Computer Software), as applicable.
* n% V2 ^; z p1 O; F7 H! _ - ;;;) u/ o0 N2 p) @( R9 t9 i
- ;;;.& G" F; A6 D- P/ N7 y
- ;;; 28 February 1997
/ t: {6 h! P6 T' r - ;;;
7 u& R+ r2 T0 y+ a2 e" L4 T3 Z - ;;;
+ J* q; Z4 m8 N7 i - ;;;----------------------------------------------------------------------------
. _- a% f: |/ f' l - ;;; DESCRIPTION
( |9 A/ u: X: u$ V. Y - ;;;----------------------------------------------------------------------------
; Z, y6 ^+ E% f1 l: ] - ;;; C:EXCHPROP is an extended or enhanced version of ddchprop. This , O" H l- q) f0 H
- ;;; command gives the user the abilitie to change several characteristics " r% y- n% e6 D t
- ;;; of selected polyline and text objects.
6 B7 Z, ^% o9 I F$ X4 n0 Y - ;;; The style and height of selectected text objects can be modified , p. _5 E: Z/ P; ^. ?
- ;;; (including text, mtext and attribute definitions) as well as, width and
1 o6 x' y" s# Y8 ?- o - ;;; elevation characteristics of selected polylines (includes lightweight and , g' S G# V& h J. }( V$ j
- ;;; traditional polylines.)% b' v! M8 h7 T7 N" O/ ?& a
- ;;;----------------------------------------------------------------------------
0 J7 C2 \6 B6 z; X - ;;;----------------------------------------------------------------------------& [& l: P3 _. D/ c. @! K+ ]6 Z7 r
- ;;; Prefixes in command and keyword strings:
7 l$ A1 t. s- Q& \& b$ D - ;;; "." specifies the built-in AutoCAD command in case it has been
5 e" L/ o( A7 U - ;;; redefined.% r/ l: ? r3 K- z6 @4 _& w) B
- ;;; "_" denotes an AutoCAD command or keyword in the native language. e* @! n, @) M9 ^/ d: |! u
- ;;; version, English.
% I7 F. _$ d, L. P2 m% N - ;;;----------------------------------------------------------------------------$ C& X: D! o$ r# d4 a9 H. t
- ;;;# z% M; ]) Z% n# m: l
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;! K' o L: D9 ^2 d/ S" t
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;GLOBAL INFO.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
/ G8 h2 I; L( e# ~ - ;Functions created as result of loading file: exchprop.lsp
# P7 l4 W* x9 s3 k+ P - ; DDCHPROP2
$ Y; n) d" j4 z5 ?9 b2 a - ; DDCHPROP2_INIT" J3 k: p+ R; x2 b% F7 p
- ; DDCHPROP2_SELECT
. e# T' F u; j# G/ B - ;! d4 J- j$ u" g# H8 G3 o1 T
- ;Variables created as result of loading file: exchprop.lsp
6 f) Q0 x# n9 R; P, o - ; OLD_ALLOC
5 U! m$ |1 I \% i4 y' n# F% K - ;
$ E; t0 z6 B7 B - ;Functions created as a result of executing the commands in: exchprop.lsp H3 ~' z; Q: j9 @ M2 w, ?
- ;
! [2 C0 b7 P" Q" Q; |+ d+ T {9 d - ;Variables created as a result of executing the commands in: exchprop.lsp" p/ s$ Z1 u8 |9 a5 f! q
- ; AI_SELTYPE
% @3 N$ P+ x T3 R/ l! y - ; BONUS_ALIVE$ |4 _6 \( }8 z4 l
- ; BONUS_OLD_ERROR
1 a. ~0 O( T! v- \- ?6 { - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;GLOBAL INFO.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
) }- U7 x- @9 g4 T5 E+ } - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
% _7 L6 B( T& G7 Y: `4 y - 8 ~( j" ?1 i, f6 n
- ;;;" D( S0 f8 h p( Y. E
- ;;; Avoid (gc)s on load to improve load time.+ I, |' ` H2 n5 a/ k# F/ K) C
- ;;;
0 F# }) i, v0 v2 h8 ?6 z# e$ ] - (defun do_alloc (/ old_allod new_alloc)
9 Z: Y% w8 R% n4 l1 Q W' l - (setq old_alloc (alloc 2000) new_alloc (alloc 2000))
4 J# c3 k7 p5 c& ], U0 f - (expand (1+ (/ 4750 new_alloc)))
/ L. P Y6 l* }+ e. ~. t - (alloc old_alloc)
3 D8 |$ b/ T3 f5 }: n( Q! t* z/ o - );defun1 ]+ }, o; {; N6 v3 L
- . F2 J: _* R/ e: k0 v! w
- ;runs at load time - rk
" U0 s5 Q# i- g* e$ E8 i - (do_alloc)
e- y4 z4 y. m+ n- l- | - (setq do_alloc nil)
! q( ^- p/ G: r/ ~7 ~3 U& J2 G, i - ;;;
( k1 S- t7 O- n - ;;; ===========================================================================
; |+ D q" b: M9 U5 ^; r - ;;; ===================== load-time error checking ============================ d6 k( w2 U# {3 C, G. l! w
- ;;;0 f" o1 |" Z/ A- ~& |2 m
- % U( J7 m. F& F) U2 G( ^
- (defun ai_abort (app msg)
1 q" c% D/ {# k: N; c - (defun *error* (s)4 P7 p9 c8 f* M4 H( g1 N
- (if old_error (setq *error* old_error))( b1 R5 Y4 g _6 s2 j/ p6 d) b/ E- H
- (princ)0 x2 B% O ~7 Z* m. m
- );defun
1 W- ]$ q6 A4 a& e" Q& f& G4 V - (if msg& o- T/ o, l8 W4 Y5 `! f
- (alert (strcat " Application error: "- h) \ t9 ~' ^2 t: Q6 B+ m
- app0 F" d. t7 S% B/ L1 Z3 x
- " \n\n "" i2 z2 L5 x6 G2 t. y, q
- msg
5 {# `- d# O# o! M0 k - " \n"0 n$ K$ l; e; F, B' c* [. u
- )# G7 A3 m- e) g+ q0 w- s
- );alert
/ q' B' j' }; ~: o+ g! J - );if
+ S! \! a6 [# `' K: @$ | - ;(*error* msg)& k3 ^3 g8 H( R" ~
- (exit)) L7 j% N+ E; w" p+ j" E: c
- );defun ai_abort9 Q- O% m, p3 y7 }: i$ H
- ) k' T# h0 N) Z. b0 l) G
- ;runs at load time - rk; f' R/ }! R( x2 Q- \' Y1 o
- ;(if (and *error* ;added the if wrapper around this - rk.# c6 R+ B/ q/ v
- ; (not old_error)
. J* ^+ Z; N: _4 ?! B: B! g. O - ; );and 7 e! z, N i4 ?. V: A+ D
- ; (setq old_error *error*);setq
) z3 k, z" g, _: ^7 t* h- G - ;);if6 p! y. W. r9 \4 w
- ) V# Q9 u! t6 Y7 c- G1 m
- . j/ h+ l/ ^& V1 Z+ B. R6 ~
- ;;; Check to see if AI_UTILS is loaded, If not, try to find it,
% }% S: h j9 j2 c - ;;; and then try to load it., V: H8 W! j- |) x% R
- ;;;
a7 W. Q1 O H$ G6 r - ;;; If it can't be found or it can't be loaded, then abort the
6 h- I2 w! A4 O9 ^ - ;;; loading of this file immediately, preserving the (autoload), o0 p' L& Q: d" v( L* V, I q( H
- ;;; stub function.
( D. b4 f3 A$ h9 [7 _' c - - M% V( |+ t6 I5 J$ l! u
- ;runs at load time - rk.
2 G- s( w" u: S) k: x: r# S - (cond+ K1 q2 W& @8 C5 [* `+ V
- ( (and ai_dcl (listp ai_dcl))) ; it's already loaded.4 |- S3 l$ ^' i$ g' N
- ( (not (findfile "ai_utils.lsp")) ; find it
* A2 L/ F9 M* Q( H4 r - (ai_abort "EXCHPROP"- U4 y& A2 A) B! K: S. q( K, j
- (strcat "Can't locate file AI_UTILS.LSP."
" }! }' m6 @- c3 `( ~+ p1 f - "\n Check support directory.")" {+ u3 @; i# p" M, T0 k" ?" u
- );ai_abort
. f, h6 y. |3 f5 o) o U% T - )
) e7 z" n; h8 W' m9 k( l - ( (eq "failed" (load "ai_utils" "failed")) ; load it. v$ {9 w) S+ @6 Q# a, F1 J
- (ai_abort "EXCHPROP" "Can't load file AI_UTILS.LSP")
" T* K# i& k+ n - )+ Z. f* m* |& W$ _; l5 o
- );cond close) k# t& U; j. j" @
- / R$ \9 B& E# d
- (if (not (ai_acadapp)) ; defined in AI_UTILS.LSP9 W3 U; S" Z q, F9 u6 ]( B
- (ai_abort "EXCHPROP" nil) ; a Nil <msg> supresses
1 q1 f) Z) _7 b, V2 I; { - );if ; ai_abort's alert box dialog.1 N: Y/ u- M& G( ~
/ V- z) Y( m9 J) i# ~6 Z( u- ;;; ==================== end load-time operations ===========================& P6 o5 z$ |# {
+ B/ q6 w6 L& t- ;;; Initialize program subroutines and variables.
% V- d1 {& f0 z2 j/ M1 E
6 b5 K+ Z j9 z- (defun ddchprop2_init(), o% E& A8 U3 [
( {, W6 p5 p& n: R
/ w) x3 m' w+ T# s4 U# \- / l, {! ~5 f' H3 h
- ;;% p' @+ P3 `8 Z8 j) L
- ;; Define buttons and set values in CHPROP dialogue box ~# O# D: o& B; _: _1 F
- ;;) ]- g7 A% n/ `8 z
- (defun call_chp2 (/ cmdact p1 p2)
% z5 j, v U" v
. b) m6 G, W; ?8 J- (if (not (new_dialog "ch_prop" dcl_id)) " \& X+ \5 {7 Y) ?
- (exit)+ c5 o, g! p" L4 y& k6 U
- )
" I: C5 Z( p: K% O) `
r% I3 w' W6 P' ^4 x4 A# a- (set_tile "error" "")
/ V, t! V- n7 n) M8 A$ v2 } - ;; Set initial dialogue tile values5 @ {, Q, j, H# l; G
- (set_col_tile)5 H9 M. k$ t! P
- (set_tile "t_layer" elayer)# p5 R; {& y1 S$ z1 D3 @, a
- + D) W, h) d# u% [; v- ^6 R6 [% Q
- (cond' n5 d7 H7 I( g% i
- ((= lt-idx nil)
1 c: s3 J s" i& I6 r" [# r: @ - (set_tile "t_ltype" "Varies")+ Y2 Q$ v3 B! E, n- h
- )
% U( X/ Q' b+ q2 f9 Q9 l - ((= lt-idx 0) ; set tile "By layer & layer linetype"
' e( D2 @2 D) L9 _# A$ e. H/ I - (set_tile "t_ltype" (bylayer_lt))
{7 E$ ?* k. q: _( d - )
: z+ y4 M8 ~9 c) p$ w - (T
: L' V( H3 q) {' Y9 n% U% \7 b - (set_tile "t_ltype" (nth lt-idx ltnmlst))( v: \* C" u5 n0 K" I, a2 a$ [
- ) w' _" E1 q" B6 e9 m& Y
- )
5 l1 {5 ^* P/ F$ n+ f$ P& a; b - 1 }& i/ l7 ~/ u$ K a
- (if (or (= ethickness nil)
4 ^: I% m' {+ ^6 X+ E - (= ethickness "")8 r6 }0 l( ?) v* N, Z$ k3 X) U5 X
- (= ethickness "Varies")
p, r+ w+ Y1 G! [7 J. a! P/ |% v - );or
. K/ b% e) m- H0 a$ V8 Z# u - (set_tile "eb_thickness" "")2 c5 e. s: g8 C" g
- (set_tile "eb_thickness" (ai_rtos ethickness))0 w/ g7 n" B6 Y4 Q7 l
- );if
, l: ^, m, f. W/ R6 O - (if (or (= eltscale nil)1 s. g" Z$ f8 g% m4 {/ D
- (= eltscale "")
7 y; F. I. Q) D' Y - (= eltscale "Varies")5 g7 W# _7 q) F
- 7 L8 B; }/ ?; i9 k
- )9 u& e* j$ d, i% d
- (set_tile "eb_ltscale" "")
9 V$ T: w" R- g" @: Z - (set_tile "eb_ltscale" (ai_rtos eltscale))
4 F. Y7 @1 e C - )
0 V, |- n1 S1 X8 X. ] - (if
( W J5 O u7 U6 u9 C) c8 K2 N - (numberp ewidth)$ u6 A8 V( _: o& D; v' U
- (set_tile "poly_wid" (ai_rtos ewidth))' M. w# |" G3 f) m
- (set_tile "poly_wid" ewidth)
! Q0 u6 M( }/ Q" W - )
* ?+ R7 @6 x8 ?( ^ - (if
# b' L" g" O( k# @. z$ c - (numberp eelevation) h, r* v; c) }4 V4 x8 ~, U3 ?, r
- (set_tile "poly_elev" (ai_rtos eelevation))) F8 L- H# P5 B) r
- (set_tile "poly_elev" eelevation)
" m: i3 {% c" ]- g- Y - )- l/ _% D: G8 q: M- [! h5 K
- (if C. Q6 k* w( t7 {/ h
- (numberp eheight)
) e9 R: R+ f: y4 T - (set_tile "text_hgt" (ai_rtos eheight))# ^; |3 o& _3 C2 b9 E2 C3 [) ^
- (set_tile "text_hgt" eheight)1 c2 O l/ i" F3 V
- )
( a2 \7 ~$ E' y2 n: ~, c - (if (not estyle)( T! ?3 i' z2 D- i, a
- (setq estyle "")
! R+ ], I# @) V& ? - );if
$ P0 F1 }0 R9 v, G* l# @ - (setq hair_style_list (tnlist '("style" 16)));setq
( K. ?4 e! x) E) G - (if (not (member estyle hair_style_list))
6 N n4 _+ K' K; a# _+ P4 Y6 [) C - (setq hair_style_list (append hair_style_list (list estyle)));setq' Z, ~. B: ]/ B8 x9 ]3 v
- );if
0 O8 l: K! ~, }( ]( l4 y
6 Q) v3 u# R( k$ h- (setq hair_style_list (acad_strlsort hair_style_list));setq
: a6 x& E* ?6 f2 ?7 E( n - (mpoplst "text_style" hair_style_list)9 |* \# s3 d+ b
- (set_tile "text_style"
5 ^, `$ ]+ O0 l+ }7 d3 C - (itoa (position estyle hair_style_list))$ Z, u, p6 u5 y- v- @; z9 S
- );set_tile $ q, u/ Y8 e& f' o
- / y0 @: U# n! @8 ^" @6 V" T
- ;; Disable tiles if need be... ;@RK
( c3 w0 ^- o3 r" s - (setq a 0)
; I9 ^$ a. p) s3 y - (while ( < a (sslength ss))/ k+ v' ^5 ]2 U- f; s: _
- (setq which_tiles5 A3 }' _" @$ j v: [6 }
- (ai_common_state (cdr (assoc '0 (entget (ssname ss a))))))
: S- |# W3 Z0 d6 ~& E+ ^ - , o6 |* i+ ?3 ~) @; w9 U
- ;; If all fields are enabled, don't bother checking anymore.
; @+ [: `. k5 F# G% \$ S1 \ - (if (/= which_tiles (logior 1 2 4 8 16))
- f7 j) t9 ]( Q% r - (setq a (1+ a))
: m6 |2 H/ Y. B/ p% M W& X" O+ ]9 q' d - (setq a (sslength ss))( C8 o* a) Z6 _6 L; V1 c
- )
9 g; K3 ~4 U% K$ z7 l2 B - )
v1 m! T) ~4 e+ U8 ? - ;; Layer Button and Text Field
0 W k' P. K, s' x0 g( n9 R
; U" M, l# t/ N, Z! ]- (if (/= 1 (logand 1 which_tiles))
, m5 ~* S) H2 T. B, o* k - (progn
7 f/ \# I. X8 |% W( W) t - (mode_tile "t_layer" 1)1 N9 x3 b; u0 i, j. }
- (mode_tile "b_name" 1)
: r2 G& ]- E0 h5 A - )
, f+ l0 z. S* M- i/ I - )
8 E. N5 c3 O; u3 w: f8 {; g - 1 {1 w5 Z5 W m0 _4 [
- ;; Color Button and Text Field
. c) ]- H }2 B - (if (/= 2 (logand 2 which_tiles))
/ e+ P" j) V4 K o$ ~7 R4 { - (progn
$ m0 r3 c0 d' X - (mode_tile "t_color" 1)
. w8 i8 S- d8 Z7 v, e' R - (mode_tile "b_color" 1)/ e; Q: ^. f7 M
- (mode_tile "show_image" 1)0 U' y' Q/ F5 {
- )$ w. d+ q1 Y* H8 v- B7 x
- )
) i0 j5 q, i r5 g. L3 R3 Y - ;; Linetype Button and Text Field7 ]7 i6 q. j' Q0 {1 Q T0 V: a( ?
- (if (/= 4 (logand 4 which_tiles))
/ q/ a% O8 D) | - (progn
0 A) b- I3 d i% x5 I - (mode_tile "t_ltype" 1)
+ I1 f8 s8 R8 _/ z: Z& x: Q - (mode_tile "b_line" 1)
. ]9 h3 Q7 r: Q+ h! j+ k - )
& ^1 U& } J7 l( b" I6 v3 { - )
* R1 e/ h* e5 H8 L - ;; Linetype Scale Edit Field
9 Q5 o& ?! T- |% {. B5 w - (if (/= 8 (logand 8 which_tiles))
, K {" v$ r+ K6 q - (progn3 ?* L: R5 M1 T% ^0 T. u( t; D9 o+ u
- (mode_tile "eb_ltscale" 1)
3 d( p) y$ v5 y0 l1 ] - )6 g! E+ A& D( r$ S; w. |/ g9 _
- )
, n V D/ f8 t$ n" H+ @# A - ;; Thickness Edit Field.- ?- p0 f8 N! U% k3 S& z3 y
- (if (/= 16 (logand 16 which_tiles))6 x2 t } q9 G6 ?2 O' `4 d
- (progn
' `. i2 B: Y2 { i, t7 } - (mode_tile "eb_thickness" 1)
7 w$ \+ ]! z/ N5 { - )
9 Z! q' N) W0 b$ @8 C - )( t$ s( i% V1 l8 c" y
- , H2 [; ^- L! u0 p
- ;; Polyline box and tiles @rk 10:05 AM 1/30/97
1 p: O9 F* d, _0 X- T - (if (not (= 2 (logand 2 eflag))). j$ I S; ~7 ?% W d7 Z8 t
- (progn
; O2 l. M, f( a" E; P" r* |& |+ v - (mode_tile "text_hgt" 1)1 L1 x M u" l7 ]- R, J9 m
- (mode_tile "text_style" 1)8 ?) F8 O8 Z1 {( w" M9 W
- );progn! m, a/ O# I- x0 Q& Z1 p( a
- );if* y3 A# r: K7 E3 s$ ]
- (if (not (= 1 (logand 1 eflag))); ?) ]( `' z a; M2 d0 J
- (progn 5 F, L$ \; z, x) @/ ?
- (mode_tile "poly_wid" 1)
! [6 q8 @- \" ^, } - (mode_tile "poly_elev" 1)& l; N: T8 n6 J! c2 j" r
- );progn then disable polyline fields
) L1 b" G" s9 l$ R. N - );if5 b% e) ]; J) m7 c. n
: E; b+ `3 R, I' Z- ;; Define action for tiles
; X+ I8 Y% e5 ?" f3 e: C' k - (action_tile "b_color" "(setq ecolor (getcolor))")
0 j ~9 ]4 {5 \3 B7 L4 T - (action_tile "show_image" "(setq ecolor (getcolor))")$ G( ^1 d# i) \, N
- (action_tile "b_name" "(setq elayer (getlayer))")4 r: x/ P9 ^$ I; B: p% r
- (action_tile "b_line" "(setq eltype (getltype))")+ e1 ~/ a: G# w7 p2 V
- (action_tile "eb_ltscale" "(getscale $value)")
* H6 C& n/ @/ E) T - (action_tile "eb_thickness" "(getthickness $value)")
# ^# L" a; [6 r; U I/ o - (action_tile "poly_wid" "(getwidth $value)")
4 o- i! f6 u2 R1 _+ w+ A - (action_tile "poly_elev" "(getelevation $value)"); [$ V2 Y) |5 ~! w) Y) j
- (action_tile "text_hgt" "(getheight $value)")
9 W2 ?' j- x# }: h* F9 V - (action_tile "text_style" "(getstyle $value hair_style_list)") 9 d% p: Q- W8 J
- (action_tile "help" "(help \"AC_BONUS.HLP\" \"EXCHPROP\")")
- X. C: N# B8 d$ y' d6 b% B2 R D7 g9 Z - (action_tile "accept" "(test-main-ok)")
- b6 b7 Y! @" R. q' @) P4 H: I - ( A9 Y, P4 |3 \/ z+ N1 p
- (if (= (start_dialog) 1)
, s, C. ^3 N& J# I# G. T - (progn9 T, ^& d h, L+ H
- ; Update special properties for polyline and text selection-sets.! g5 a& U0 C; {* F( x, l
- , t$ Q7 P1 I5 R: T
- (if (and (= 1 (logand 1 eflag)) ; polylines rk chprop1 [* V( g+ N% E8 ?' G
- (or ewidth# [/ z1 X, w5 Y5 ?! J
- eelevation
' V9 }2 u7 g/ |- ` - );or H* f, \, w6 q9 ]; J
- );and0 a7 @, p9 i: j' n5 R4 r" b" H5 }! ~
- (progn M$ H; ~+ ^$ N, o: j5 Y" c3 i
- (setq ss-index 0 9 z- F5 D4 _' ^& O+ \9 _' {
- ss-length (sslength poly_ss)- x2 t+ k5 j% ^* @6 ]: C! \5 y
- );setq
4 B1 V0 U, Z2 R) j- Y! E4 b+ B - (while (< ss-index ss-length)3 B |/ B3 L) t- {2 |3 N' b
- (setq ename (ssname poly_ss ss-index)" U/ z3 n7 h; j
- elist (entget ename)
& G( \2 G1 v6 O8 ]* c - );setq
+ k" d4 A8 o: J - (ucs_2_ent (cdr (assoc 210 elist)));this function lives in ac_bonus.lsp
: n X3 p6 ]" t- } - (if ewidth , m3 ^" Q" W# ~, g! K R* F
- (command "_.pedit" ename "_W" ewidth "_x")
7 k/ y( B7 r$ H' C' F5 W - );if 9 J: ^# O; ], b# Y- B% j& g
- (if eelevation
6 s; e; p! `/ Y - (progn* f; ?. _# |9 W2 I2 Q
- (setq p2 (list 0.0 0.0 eelevation));setq
$ E; @" t- T$ a - (if (equal (cdr (assoc 0 elist)) "POLYLINE")/ k6 T) `1 N6 v# C
- (setq p1 (list 0.0 0.0
8 D M! K- n/ | H" M4 @: o - (caddr (cdr (assoc 10 elist)))( Y- a! ~8 j# q+ v* E' J
- );list
0 ?4 a J2 ~4 U/ h! w - );setq$ E8 I7 s* U& b% s1 t
- (progn. U) _1 z0 c( O: o
- (if (assoc 38 elist)/ N T6 f q7 K6 U% k1 h; G
- (setq p1 (list 0.0 0.0& x( Y D3 [! P$ w2 D
- (cdr (assoc 38 elist))9 d0 c$ `: A1 f
- );list
. W/ [8 T' a% f) Q9 H: q- V1 _7 M - );setq- Q Q- t% P0 b' ~/ Y( \* x. I6 H
- (setq p1 '(0.0 0.0 0.0))4 W0 O: `5 ?2 K# t
- );if* g1 S: K$ S; k/ K$ ]! W( G$ }
- );progn 0 \. M$ y, G" b- i$ R
- );if2 L. y9 K& i8 H6 @( S. Z- x
- (command "_.move" ename "" p1 p2)
% E" |8 j `7 P - );progn then change the elevation of the polyline8 n3 f8 ]( o( v
- );if: c6 _$ `' J2 d4 I( _
- (command "_.ucs" "_p")* \3 o( U' P7 u* j/ F
- (setq ss-index (1+ ss-index)): y" ] p0 d0 u$ U/ @/ c, W U
- );while
& v* m K, P- r$ L - );progn then polylines are in the selset
5 g l+ K4 m8 L1 h2 q4 N2 x+ L8 a - );if: g% q/ |# E8 @. S3 ^
- (if (and (= 2 (logand 2 eflag)) ; text {4 T( e4 y$ E3 c b
- (or eheight
3 h; ^' d& `4 s m3 x! a - estyle
% n& R% z& d1 d# T - );or
/ @: A7 u4 t7 {2 `/ `1 N - );and
& j1 o* S* }2 {% f- W - (progn
" B$ h' N/ W% L8 l B0 r$ c - (setq ss-index 0 ss-length (sslength txt_ss))
! z: I7 m5 i: O, q6 d0 R1 B- s - (while' j* [# E& c8 ?# \) ]4 M1 z5 D& A
- (< ss-index ss-length)3 [6 `7 R ^% _! I
- (setq elist (entget (setq ename (ssname txt_ss ss-index))))
" Y; X5 z& d' R+ y* n7 P - (if (numberp eheight)5 L7 J8 H; c+ [ j% r0 y8 @9 M
- (setq elist (subst (cons 40 eheight)
- O8 L& t, |, U2 w7 g! J - (assoc 40 elist)
1 I; ]3 ?/ W7 Z& c/ o - elist6 |& X" R" a `7 e
- );subst3 V2 Q6 Q ]9 C* N) A5 c$ i# c
- );setq) V7 a' C1 W& D, L( _
- );if( W" A! v G7 {# _) N% a6 I
- (if (and estyle ;(not (equal estyle ""))
# V& Z/ M h/ {: \9 O* t( B - (not (equal estyle (cdr (assoc 7 elist))))
?3 W/ `; ?# I* u0 T* f - );and
( b# {) E7 ?* X6 P0 \ - (progn
% n0 U( k; ^/ _ - ;rk. This needs to be implemented as per mtext font issue in ; ddchprop_notes.txt
$ D. V8 \/ ?+ u: l. _5 y% Z - ;(if (equal "MTEXT" (cdr (assoc 0 elist)))
6 R0 H1 v: o `0 c- Q; P - ; (setq elist (fix_mtext_fonts estyle
# L) a; Y' G& n/ k3 ]! N - ; elist2 q8 `7 Z# E5 F Z
- ; )7 j$ g6 W1 i- f- K
- ; );setq then! _! @, U8 o8 N8 i! |: U3 `5 t0 w/ T
- (setq elist (subst (cons 7 estyle)
Z- K/ k# U. s9 v: G1 p - (assoc 7 elist)
7 M; @4 B) l# t' V) ~, L - elist' N3 T* _/ `& u
- );subst) Z C4 E+ H, `( U
- );setq else, P# ]" Y% A& m y0 T
- ;);if
2 d+ ^7 s0 S. s5 M( B - );progn
- X9 _0 x# {8 Y - );if+ m; O$ C. H- g
- (entmod elist): `2 ?9 @( K4 E. z! u! J8 l. ?
- (setq ss-index (1+ ss-index))
4 a9 r k$ V6 b - );while
+ ?, L2 B# e5 X% i' | - );progn then( i( t, ^ n5 p: y
- );if8 q6 b3 F% l1 F: L. f
: w8 E/ A/ ]7 y- (setq cmdact (getvar "cmdactive"))4 |$ w0 S' ^" A/ P5 {4 ^
- (command "_.chprop" ss "")# g V1 s }% e& u# V
- (if (/= cmdact (getvar "cmdactive")) ; Is CHPROP actually running?
9 r1 P! y" R, A. C* G( D+ H - (progn
% x& B7 v2 l$ e# l( R7 f - (if ecolor/ X6 E$ s0 O! x9 M+ ~2 @% K
- (progn
: I* O( u" `/ u3 q, L& ` - (if (= 0 ecolor) (setq ecolor ;|MSG0|;"BYBLOCK"))2 {' q1 }6 s5 I& s o
- (if (= 256 ecolor) (setq ecolor ;|MSG0|;"BYLAYER")). ~/ h# Q! |. r( Y A8 C* G$ t, \
- (command "_c" ecolor)
1 N: D+ E( {, P) m. Q$ u - );progn then
" t) n; h! h4 @ - ); U9 @) I) ?) A: N7 U% }
- (if (and lt-idx
. G/ B# k. H% W$ V: {& C: Y+ d - (/= eltype ;|MSG0|;"Varies")$ r2 a, e) n! s* G1 {! H/ s7 W
- ), q5 z# p+ H: l) \ S
- (command "_lt" eltype)
1 t* f6 y: a9 L; Z - )/ z3 ]; z$ {; F& T5 q) D& w) S
- (if (and lay-idx 3 n D5 p% n7 U* {1 E
- (/= elayer ;|MSG0|;"Varies")
: a1 n5 b' y( p3 @& d& v* R - )
$ J( w2 V; b; M8 B* T - (command "_la" elayer)5 ?* C9 B& b. m4 q/ C2 T$ ^
- )+ p/ d4 @/ I+ ^+ f) x
- (if (and ethickness
7 I0 E8 j1 X b% m* Y - (/= ethickness "")
, d# u* x! p' w7 t0 y; p$ B* z0 @ - (/= ethickness "Varies") & c7 a2 ~1 z% P( X5 z% }
- )
- z/ x% J# |/ h - (command "_t" ethickness)0 C8 }, Q. R9 R! ~/ X$ a/ B
- )0 N% D( a: {/ m* _7 k) I
- (if (and eltscale (/= eltscale ""))! V. G6 j2 Q( A9 |. q' O; e
- (command "_lts" eltscale)& l, u, L5 x3 T$ |9 D: b2 R
- );if
; c3 ?0 b' x' N8 P9 N4 U - (command "")( S# M( ?& W; H9 ], s" U" Z) E* j
- )
5 z! s3 ]' T, P& E0 z4 b - (princ "\nProperties unchanged") ; CHPROP didn't like our SS set
/ J8 [: h) Y! ]7 V* Y0 } - )
7 a5 k/ b N2 E5 [( {: k K/ e
+ u& |1 w5 ^! ~- I0 v- );progn then OK was picked in the dialog.
# b& h7 g7 U" I3 s( F, n* r - 6 p# |% q: U$ Z
- ;; Fred GERBER - 25-AUG-94
9 z$ K W. U4 \# I - ;; Don't print the "Properties unchanged" message when the user cancels: ]+ g$ |! M& z( t0 v0 J
- ;; the dialog because he knows that already (otherwise he would have
k K: o! f _ - ;; hit the "OK" button). Display the message only if CHPROP fails for$ x- S0 g$ A& C# t9 |* Y( O! M
- ;; some reason, because it is not the expected behavior of the command.
; B" z$ e l8 @0 p" p - ;;
& e4 B! k% q; h1 S0 Z* ` - ;; (princ ;|DDCHPROP2_LSP_8|;"\nProperties unchanged")
$ T/ W5 s( c- X- s% z: _5 X* m& z- U - );if( O% S% w( u3 Y
- (princ)3 R( z% o" G9 o) ?# |$ _" P
- );defun call_chp2
' H5 c% p9 {: a6 N - ;;+ a; ~, u$ M- J4 i
- ;; Function to set the Color text tile and swab to the current color value.3 X: A# y- T) T$ ?
- ;;
4 R* k- x- N, B - (defun set_col_tile()& G- k! v, I) ^ T$ ?
- (cond( ?2 ^* Z( \( Z# p$ L
- ((= ecolor nil)6 z' T: Y: a: x1 g7 y) x7 }! f& _
- (set_tile "t_color" "Varies") E, t$ p! ]0 x6 g+ B5 t: B
- (col_tile "show_image" 0 nil). T+ D+ v) _. [4 l
- )
, x- f; H2 R, s! z7 K- @" k- K/ c - ((= ecolor 0)
% Y* Q8 W2 s3 ^7 y9 S - (set_tile "t_color" "BYBLOCK")! x; @5 ~3 i! J2 W3 `& i3 p' L
- (col_tile "show_image" 7 nil) ; show BYBLOCK as white
G1 F5 m/ C5 h) s4 L# C - )
/ p" s( G% K M - ((= ecolor 1)4 Z# A- Z+ i: ?7 n& m1 ], @
- (set_tile "t_color" "1 red")* T. V8 Q( o* s1 {& y* o( q
- (col_tile "show_image" 1 nil)
- B# M8 P8 Z+ E; i0 @6 D - )
. i2 z1 ?8 m1 a4 I7 m9 y# O - ((= ecolor 2)8 i; M! E/ @: R' K
- (set_tile "t_color" "2 yellow")
# o+ I8 a# b0 q5 T/ {( r - (col_tile "show_image" 2 nil)
8 J- ~$ M# v% j& u: u - )
. o8 z' O% |7 R - ((= ecolor 3)) t% i2 { ?: `& B
- (set_tile "t_color" "3 green")
( `& u- R) U i! z) @+ F - (col_tile "show_image" 3 nil)
% F* O: {: n- o6 b - )
O. w1 _1 G4 R/ T q. a. j - ((= ecolor 4)
+ d+ i1 v# j8 }: s$ V; ~ - (set_tile "t_color" "4 cyan")
6 M6 ] v, ^ y/ f7 N; Q+ Q - (col_tile "show_image" 4 nil)( ^/ ?& W: I; `5 J3 ~& I0 K
- )
5 T- X! R) Q& L: N1 U - ((= ecolor 5)/ t, \1 y2 {! B+ _8 @
- (set_tile "t_color" "5 blue")
- \; U' r& b3 d - (col_tile "show_image" 5 nil), r: Y# s5 W3 I7 g1 S! |0 N
- )1 Z3 _( E% e& Y- c. g
- ((= ecolor 6): p# l5 a. @ r7 H- h- i# n
- (set_tile "t_color" "6 magenta")
! s6 z/ N% L2 a4 _3 J: e - (col_tile "show_image" 6 nil)0 N. f% V+ j( q5 Z) t- L* Z% R
- )0 @8 A' r: v7 ^% j4 J% f
- ((= ecolor 7)
' {/ b2 o/ @, |, q' q - (set_tile "t_color" "7 white")7 k2 A5 G( p3 f4 B. ~' S
- (col_tile "show_image" 7 nil)
4 n/ l7 z H% ]+ {, G5 H - )
( p! L4 _5 {+ E. b - ;; If the color is "BYLAYER", then set the tile to5 I2 u/ B' x f( r
- ;; show it's set By layer, but also indicate the9 H) Q3 R4 b `( N: B( m
- ;; color of the layer - i.e. By layer (red) i5 W3 J3 z+ _$ F
- ((= ecolor 256)2 |7 q6 r8 J* J" g8 e! c
- (set_tile "t_color" (bylayer_col))5 _, S- j& a7 F6 E* }* G
- (col_tile "show_image" cn nil)
# G: w- i: [ z2 c - )
+ a; w- o: Y" J1 ~ - (T& D1 p' y4 g) t* _" t' t, |( y
- (set_tile "t_color" (itoa ecolor))
" o' z7 q0 a3 Q8 x+ ? n - (col_tile "show_image" ecolor nil)$ _5 Q- V7 }! v8 _# m. d! Q8 ]
- )4 q/ N% j/ M: P( C; J) Q
- )1 n$ U# i0 m8 @& R; i* `
- ); X; Y6 b0 F5 M5 {; g% _7 N8 M
- ;;
( l& M* g, o& m' s4 h; k; J - ;; Function to put up the standard color dialogue.9 s$ N0 Y+ Q# I7 T" h- C! x* _, ~
- ;;% A% E9 f# n: s
- (defun getcolor(/ col_def lay_clr temp_color)* N8 e, [2 X, c2 r
- ;; col_def is the default color used when rq_color is called. If ecolor1 ^& W6 R, Q/ u$ k/ C% B3 O
- ;; is nil (varies) then set it to 1, else use the value of ecolor.- K+ n2 N" A8 Z: y, y- L- {
- (if ecolor, i, }( @" O. w# J; w% I% w5 D
- (setq col_def ecolor)5 L5 f( I5 |9 ?
- (setq col_def 1)
+ b! v0 a% u A/ @8 p V1 Y - )4 W7 \' `' x* |% p c
$ G1 [2 y1 r* ~: F& o+ P+ M" z# u- ;; If we're working with a single layer, get its color" h. R# f9 b u1 f: S% y9 ~8 s2 ]; a1 M
- ;; for use in the color swatch if the user selects color BYLAYER.
% Q$ ~' a& h3 ~ - (if (/= elayer ;|MSG0|;"Varies")
6 H1 n, \. v( b0 } - (setq lay_clr (cdr (assoc 62 (tblsearch "layer" elayer))))& ^" S( Y+ { u/ ]& J
- (setq lay_clr 0): u7 n% [6 B2 G; X( g
- ), }0 e( h9 `$ l& l
- (if (numberp (setq temp_color (acad_colordlg col_def T lay_clr)))
A& B& t! B9 P( E0 B; L, G - (progn
4 V0 p- M9 K: ?( s+ a; Y - (setq ecolor temp_color)
" Q' w- H7 x2 \; W - (set_col_tile)
7 i2 Z9 y0 \% ]. D$ ?3 Q - ecolor# |) r3 g: ?2 I# K- @5 _' Q- b; o
- )$ H) z; Y- b# H# @6 h
- ecolor6 Y5 L6 C" X, q# G+ @7 \9 |
- )2 L s$ c; L$ o. T0 _
- )! U7 ?# ], R) a+ S: |" Z. I$ |
- ;;6 V! y" d2 u: e1 u
- ;; This function pops a dialogue box consisting of a list box, image tile,. a; }- M$ Q+ g& E9 G! r% v- b& U
- ;; and edit box to allow the user to select or type a linetype. It returns
: W+ E- R8 v- F# o - ;; the linetype selected.
& O1 L1 b/ c. r4 U1 y% ^ - ;;
1 x4 a* s. g9 V5 E! q - (defun getltype (/ old-idx ltname)2 }" d' N% l. d8 a, S, r1 u
- ;; Initialize a dialogue from dialogue file
- s/ v) j& I! o& h) ^ - (if (not (new_dialog "setltype" dcl_id)) (exit))
# E; v* ^7 O+ h1 G4 M - (start_list "list_lt")
7 V2 m( |, R. H- X; A8 z - (mapcar 'add_list ltnmlst) ; initialize list box
0 w9 o5 d( Y* e! Q - (end_list)
( n/ N- v; @: \4 @' W - (setq old-idx lt-idx)
/ @% [' X9 X1 [/ ^ l! v1 D5 c( v. z y - ;; Show initial ltype in image tile, list box, and edit box) T3 X( W. A L3 Y: l2 \- L% n; M& D6 W
- (if (/= lt-idx nil)
. D+ I! u7 U% q) G' U4 }( B; \ - (ltlist_act (itoa lt-idx))' Z5 d% w) y6 M9 x" V
- (progn
2 `# m* C, A/ I2 ]3 ~ - (set_tile "edit_lt" "")
3 R5 t6 A9 Q' t. k# S1 E - (col_tile "show_image" 0 nil)
8 E) H* v- E5 m6 R. ] - );progn else
5 o7 b$ y' v6 f4 _ - );if
& `7 q8 E3 s, z9 ]2 I$ h) j - (action_tile "list_lt" "(ltlist_act $value)")5 @1 p# o4 ~- d L
- (action_tile "edit_lt" "(ltedit_act)")7 _. U1 G6 Z. x$ G, _
- (action_tile "accept" "(test-ok)"). X! P2 Y0 r& T$ N3 A8 l; N* a
- (action_tile "cancel" "(reset-lt)")
l m9 G! k! p4 N/ J) b - (if (= (start_dialog) 1) ; User pressed OK9 W* F' N. C: t' p( |
- (cond
# Y9 M% w+ H9 V) K - ((or (= lt-idx nil)$ E, _ T4 v! Z
- (= lt-idx (1- (length ltnmlst)))
! n0 a) E0 J7 V: \ - );or
" K4 S7 C+ M' g3 l2 o3 q5 ] - (set_tile "t_ltype" "Varies")9 @% D3 u6 u/ S# b% {) e
- ;|MSG0|;"Varies"
8 s9 B2 `8 l* F% K - )
2 x5 F. Z. M- l3 V; U6 Z' G, L - ((= lt-idx 0)
4 b( w K- L7 x# s5 p$ F" A% U9 s$ o - (set_tile "t_ltype" (bylayer_lt))
( d# Q$ p. ?! |2 l+ ^$ O$ I2 b% v( z6 j - ;|MSG0|;"BYLAYER") c& }; C! }( d- j- y$ L# H
- )
+ Q O/ A' I8 `) Z3 W - ((= lt-idx 1)) w6 @: M; C+ L! U# @
- (set_tile "t_ltype" "BYBLOCK")
) N7 k1 l6 B) A/ {% ]( f* D! { - ;|MSG0|;"BYBLOCK"% r8 `; I1 k. R/ [. e
- )9 k/ [) o8 r+ d+ G% S8 a9 Q; _
- (T
+ g6 T6 m; d9 w6 _% R - (set_tile "t_ltype" ltname)' {; N) X: W& |: v* \
- ltname+ X' ~/ N" ^# u
- )
) A3 X8 j2 a. H0 |3 `( e - );cond then
& B3 `* t5 G. L/ g - eltype) k& `) w9 D7 c2 u# |+ M
- );if$ ?: b \: g# D
- );defun
+ ~& e2 [; I' ^" v' y - ;;
- }- N! f( k8 \( s/ h' @, _ - ;; Edit box entries end up here
1 |: v0 @! F* Z8 n+ y7 i1 } - ;;+ L- c5 K7 b& c# L$ k# A
- (defun ltedit_act ( / flag)
: M7 q! C: }; W A9 t8 X - ;; If linetype name,is valid, then clear error string,
8 V* z/ H) X+ _1 ^2 {; J - ;; call ltlist_act function, and change focus to list box.6 N( {9 Q$ i; Q @
- ;; Else print error message.
4 V- x( I+ Z* M- U1 O" |- p2 F -
9 v& o6 e9 m' d$ a - (setq ltvalue (xstrcase (get_tile "edit_lt")))" Q1 g: p; Q# x
- (if (or (= ltvalue ;|MSG0|;"BYLAYER")1 D: E2 v9 f R
- (= ltvalue "BY LAYER")
% N$ c! r6 L( \3 b" R. u - ): p8 w( ]3 w. w/ T$ ^: I" z
- (setq ltvalue "BYLAYER")) z+ v) C/ c6 R; G/ e+ u
- )
# }1 n! ?( {% m1 D - (if (or (= ltvalue ;|MSG0|;"BYBLOCK")
, d" P# D- {6 \2 ~8 G3 ~, L( |0 C - (= ltvalue "BY BLOCK")- q' M; q" B% K/ U( ?
- )
6 m+ V, w' U% w4 W. \8 D - (setq ltvalue "BYBLOCK"), F$ d$ _# K' o0 W* D/ }, o2 l
- )
3 v- {( X' h; r4 c {* a - (if (setq lt-idx (getindex ltvalue ltnmlst))
3 \" U x3 @ s7 ^3 c/ t" c. f - (progn* G9 ~: A1 A/ ]. {& ^. N1 b
- (set_tile "error" "")
' i- {1 j: d% f# A; {; f - (ltlist_act (itoa lt-idx))9 M0 T" I- X3 |; y7 q
- ;(mode_tile "list_lt" 2)' W' X- T3 r6 M2 x7 ]& J9 \
- );progn then
! c2 J6 c7 z" g7 f7 k - (progn0 C+ Z- j& }# {6 `( y- Y, O
- (if (/= ltvalue ""): k6 ^0 L# B# d2 g9 v3 B- J
- (progn
5 l O5 ^0 x3 o8 p1 m - (set_tile "error" "Invalid linetype.")
; Q* Y2 O/ {7 T8 x! B- u - (setq flag T) w7 ]3 h7 M4 y3 |1 Q
- );progn7 z" \: K d- f1 `( x1 R$ w) y
- )
/ x1 _6 `" N# i9 V - (setq lt-idx old-idx)
; I6 b+ g D' K! d4 N3 h5 w' e# ? - );progn else
9 W' y D+ ^$ h* \ - );if, s& p+ Q% R2 v: |- {" d
- (if (and (not flag) ;added so a return will take you out of the dialog.; ?, P; N0 E3 a1 i! [: x4 E
- (= $reason 1): W9 |1 q/ ^/ J# w6 c
- );and/ _0 j# _; t* ~1 b% P$ U3 X. R5 V A
- (done_dialog 1)
0 ^ k1 {, j- _: I, O* w+ |1 d - );if - I3 S) j& J# A& G6 d
- );defun ltedit_act' N& C- Z: L7 Y* D5 r- @
- ;;7 J3 b' K. q: W. m+ W$ ^/ i: a4 `. B
- ;; List selections end up here
3 T6 g- e3 R. ^! X; f( t - ;;' b8 @; X/ @- [9 ^* S
- (defun ltlist_act (index / dashdata)
- n! u: Q+ Y2 K - ;; Update the list box, edit box, and color tile P& P- f8 r2 ?
- (set_tile "error" "")
+ P; x( ^5 `* g1 g, @$ f& N3 c- v: h - (setq lt-idx (atoi index))9 O [. r1 p6 r, x
- (setq ltname (nth lt-idx ltnmlst))( d* R$ a1 V* w' e$ b6 M
- (setq dashdata (nth lt-idx mdashlist))
( f! n; V$ m8 [) n( P; H; y - (col_tile "show_image" 0 dashdata)
3 b9 ~& q& ^9 H* q& X! n - (set_tile "list_lt" (itoa lt-idx))
0 x1 P$ c# N, d4 ~ - (set_tile "edit_lt" ltname)8 p& n& s8 f# z% @* n8 i9 A
- )$ X$ O( S* h. G/ _2 y
- ;;5 ?! c3 E2 j! h$ v2 {
- ;; Reset to original linetype when cancel it selected! E5 n2 w3 Q" z; l
- ;;* {6 N1 V4 N: N/ m2 O1 ]4 m
- (defun reset-lt (). g9 k$ S4 S! ~2 J" J
- (setq lt-idx old-idx)' L4 i- F& H2 Z5 x% b
- (done_dialog 0), }% n6 |* A! o4 N" w9 v+ u
- )
5 \. f) g" n4 y9 C% q! J& s3 { - ;;) k+ J4 h }! F' `/ J* M: O
- ;; This function pops a dialogue box consisting of a list box and edit box to
N6 U/ ?! P; e2 H5 }7 ] - ;; allow the user to select or type a layer name. It returns the layer name
! g: O% U. E* s# e1 e - ;; selected. It also the status (On, Off, Frozen, etc.) of all layer in the& Q6 e, n. L+ h. m5 C' h9 Z# @
- ;; drawing.
8 f/ M- [0 v& Y1 F4 V - ;;: s. L+ f2 C+ p8 ~2 W& |2 w
- (defun getlayer (/ old-idx layname on off frozth linetype colname)% q) G, Z! v w6 Z
- ;; Create layer list the first time the layer0 P6 Y% ]+ v/ v! U. ?
- ;; dialogue is called.
3 d- u1 t$ d; g, {5 p3 C Y. R! R$ d - (if (not lay-idx)
( `) t0 ?% Q. a7 M0 b0 | - (progn- o0 r6 a1 `* S0 i, v# k0 i
- (makelaylists) ; layer list - laynmlst
I3 ?) X# Z0 ^/ G. { - ;rk$ D" c+ `, B' m) J# y
- (setq lay-idx (getindex elayer laynmlst))
& r( t; s% g( n - );progn1 ]; h, u! h4 |' a; p( x
- );if
& g% d$ [/ [; J3 }! w Z. ] - ! V; c9 s( E- Q% C/ p
- ;; Load a dialogue from dialogue file
3 P1 z7 I0 k( d2 D% _ - (if (not (new_dialog "setlayer" dcl_id)) (exit))3 `$ @0 E% N1 ~* J, z/ k
- (start_list "list_lay")3 M6 q# {( r+ t/ R( s; ]
- (mapcar 'add_list longlist) ; initialize list box
2 o3 p1 H7 X% t* @ - (end_list)0 }% ~% V& N4 A; H5 h* @
- ;; Display current layer, show initial layer name in edit# R4 h" ]- j, `
- ;; box, and highlight list box.' x! ?; S7 f6 Z- U, R
- (setq old-idx lay-idx). Y4 B5 h0 K5 w6 K* Q9 a
- (if (/= lay-idx nil) (laylist_act (itoa lay-idx)))
6 W! G( p7 b' a2 M; u3 \* e - (set_tile "cur_layer" (getvar "clayer"))
2 \8 ` x% w7 c+ Y1 F! J - (action_tile "list_lay" "(laylist_act $value)")) l' c+ ?$ D* U' i) S& Z5 ~* V E6 I3 W
- (action_tile "edit_lay" "(layedit_act)")
`/ B) c* ^( J b - (action_tile "accept" "(test-ok)")4 U6 l1 ?$ l+ d4 V
- (action_tile "cancel" "(reset-lay)")
) l f" \+ s2 U9 e0 S% r - (if (= (start_dialog) 1) ; User pressed OK
7 h5 d" D a: \* r - (progn
% R: z P3 A! k* }, _0 ?2 _5 e - (if (or (= lay-idx nil)( T/ [ j, s; h3 d6 V
- (= lay-idx (1- (length laynmlst)))
5 a: M5 b/ J2 r - );or6 ?! h' b. t! R2 ~3 ^
- (progn
+ V7 }2 J8 ]4 ] - (setq lay-idx nil)
3 e2 n( ]3 v: \5 y# e - (setq layname ;|MSG0|;"VARIES")
6 f. F) x6 m! B/ d' `0 \ - (set_tile "t_layer" "Varies"), I( O+ W! I2 |4 L8 p
- (setq layname "")
" l6 w& ^3 f# N `3 y3 N. h - );progn
+ P( Y5 z1 r& o8 b. E2 p+ I - (set_tile "t_layer" layname)
/ @ v$ M) P m; V( n+ ? - );if- c6 R8 v0 [6 S7 d
- ; If layer or ltype equals bylayer reset their tiles: d& K5 u, j. E- W( D- i% r$ Z
- (if (= lt-idx 0)- f' t6 r% \1 ~$ M7 q
- (set_tile "t_ltype" (bylayer_lt))5 s% O/ Q9 G, }8 U! q, c
- );if
7 C G: Y. R: V" ?) J" c! I - (if (= ecolor 256)' P$ ^0 o6 a' [+ ~* O
- (progn1 J4 z5 r7 ` E' @+ G: w
- (set_tile "t_color" (bylayer_col)) ~* Y; \8 E* k* m2 \& [
- (col_tile "show_image" cn nil)
* j' ^* s% E5 K! x4 J4 u- C - )
6 L3 \3 H7 c W& L( p - );if7 H2 f, O6 J# E0 |( Y1 S
- layname* J6 A' d9 k3 {" j. z
- );progn9 g- M, p5 o, d2 V% E) E: w) ~
- elayer9 H/ K" i, @9 `) o
- );if! {* ]% o. b: W" x3 R h" X e: F% j
- ): w& d8 A9 R7 k' Z/ B# n( X
- ;;+ Y* `8 l O' U& j: ?( i, O6 B' e3 u
- ;; Edit box selections end up here
3 g3 `3 B- L! ?& N8 f# V$ [ - ;;% {* I4 Q5 Y9 g) m( U
- (defun layedit_act()
* {4 L" E7 s4 ? K2 W - ;; Convert layer entry to upper case. If layer name is! f" d0 E& W5 ~. z; D& P
- ;; valid, clear error string, call (laylist_act) function,
" T+ l ^( k- w, U" K% V - ;; and change focus to list box. Else print error message.$ X: T6 z3 {3 f' @4 S9 C
- (setq layvalue (xstrcase (get_tile "edit_lay")))2 p" v0 G4 |0 X1 l7 B* u
- (if (setq lay-idx (getindex layvalue laynmlst))
; P( w: ~# P8 k; c6 U1 d$ {( Y) t - (progn
8 }- z# ]$ j% z1 f - (set_tile "error" "")
; a4 F" l; x, ~ b# W: k/ @+ |" x/ Z - (laylist_act (itoa lay-idx))
+ ^1 C% o8 ^' `8 f5 y7 |# W: t- h - )
5 ^# L+ x9 g) l1 `9 B - (progn6 O2 x5 Q+ g3 W0 L* F: F% D& u
- (set_tile "error" "Invalid layer name.")
$ l# ^9 C u! E" r* \5 G - (mode_tile "edit_lay" 2)
" V) a9 W4 n4 q7 Z: w9 q - (setq lay-idx old-idx)
4 A% Z' e/ E& K( t; J - )
2 p6 m( e& V" B1 W - );if
* d- H, e! O+ q - );defun
* A8 p2 d8 s$ } F$ M3 w - ;;
! w) A0 q& u3 H. k* X - ;; List entry selections end up here5 z. Q& r5 r* r7 U7 S% Q$ x4 L. x6 L
- ;;4 A$ H% F/ L: z7 A
- (defun laylist_act (index / layinfo color dashdata)
3 i$ [0 ` r/ L- Q6 U - ;; Update the list box, edit box, and color tile
) [* I. |* q) b3 W. \ - (set_tile "error" "")# @( o2 f/ P- p# B% E6 n& Z
- (setq lay-idx (atoi index))( f/ n( u" B2 P- y( R
- (if (not (equal lay-idx (1- (length laynmlst))))% G. a' D& U! B' N8 V G! ?& c/ a- ^
- (progn * a" R0 x# F! d J2 a& c
- (setq layname (nth lay-idx laynmlst))
/ s9 P3 E$ ]9 s' r9 p5 t4 e! O - (setq layinfo (tblsearch "layer" layname))
! L- W) b8 r! T& K/ [2 n9 E - (setq color (cdr (assoc 62 layinfo)))
# |( X1 G+ _; B; P4 p/ k* `1 A - (setq color (abs color))
f( X- X W2 E+ T6 } - (setq colname (colorname color))6 d3 @7 [" Z. o, Y
- (set_tile "list_lay" (itoa lay-idx))
4 g% [; f9 W# n4 s' D2 s - (set_tile "edit_lay" layname)
/ h A! U, ~* y8 q& c" O: b7 A; n - ;(mode_tile "list_lay" 2)
; o2 v) T$ b1 U) `" I/ O, ~2 I - );progn then + y" ^- f# J$ L# G- I7 s2 }
- (set_tile "edit_lay" "") 6 y- A5 c+ S* ~
- );if
+ C+ T7 \( i# C) Q0 ^9 N - );defun laylist_act
, g! Y$ o) i; X% S) M: L$ I* Z - ;;: @6 c- ]/ K/ _
- ;; Reset to original layer when cancel is selected/ }8 `6 y, P6 d* C- B
- ;;
8 M# q. w, D& _& C% E6 A - (defun reset-lay ()
5 H+ A: d$ X4 ~ - (setq lay-idx old-idx)4 O7 k% I5 w" g+ H9 J: h
- (done_dialog 0)+ }1 M, x$ y1 O$ D, V
- )( p! L; u0 C) P3 Z' }$ p
- & a8 b2 h; w/ O' `6 x$ d. T
- ;; Checks validity of linetype scale from edit box. It checks to
1 y) y# W! p8 V - ;; see if the value equals "Varies".
$ [3 Q" M$ L% W - ! y0 F7 b, P3 v# y8 X* Z4 o
- (defun getscale (value / rval)
* H& z& U/ [7 g$ C - (setq value (strcase value)
* d, P. D. V7 b) T7 D& z - rval (distof value)
4 N) i6 C# Q0 T9 M/ l4 d - );setq1 g! q: T+ d; b0 l- {: C
- (if (or (= value "")
# y( k' o) R7 T' U - (> rval 0.0)
- q Z4 k; E# X. s - )+ ~3 Z0 W$ ~0 b0 o6 X$ W9 J
- (progn
# ~3 H3 b+ Q* [8 r% t- ~ - (set_tile "error" "")/ G. S9 `9 c/ v) y! p
- (if (= value "")0 v6 U8 c9 x. L' f
- (progn2 @/ U6 }) V' r5 Z1 m- ~. v) `: A
- (set_tile "eb_ltscale" "")
) f8 N' U5 I3 x0 [ - (setq eltscale nil)" w9 R |* F/ L+ H2 ?, K
- );progn then$ d+ p+ z1 D5 f7 |* `, f
- (progn
( f) ?& H. e6 [/ V" w: Q - (setq eltscale (distof value))
- P* r0 @" K/ R u( Y9 W: y - (set_tile "eb_ltscale" (ai_rtos eltscale))5 m3 Z- w& l* d
- eltscale
& s; H+ U5 V5 a% h9 s1 o - );progn else
( Z8 O6 S* r) ^8 \, Z! v - );if+ n3 q% d, U6 l" K9 ~0 ]
- );progn
1 l3 b8 d+ C# R: [) I. T - (progn
% t7 N3 ]: Q: F! K* g1 ?& e; B% p) m - (set_tile "error" "Invalid ltscale.")6 ^# a8 r- ^, ]+ c: o5 ?
- nil. G. |2 M0 _! a) a
- );progn else! c; a* `. S Y6 y( n2 q
- );if+ _/ `. e) B X( J
- );defun. k) G+ r! ~6 V& I
- ;; ^: \# _2 c2 J
- ;; Checks validity of thickness from edit box. Since (atof) returns 0 when a
) B0 N3 o: A" ], ^0 V. [ - ;; string can't be converted to a real, this routine checks if the first- O9 \1 O3 U g5 O# e
- ;; character is "0". It also checks to see if the value equals "Varies".
W% Q$ a$ c7 i3 O8 S - ;;
$ |5 Z2 f: [& k5 @3 k, P/ [# z5 j: Q, Z - (defun getthickness (value)
z' j; m9 i5 F- K* _# q1 M - (setq value (strcase value))
7 m' x- V1 Q8 f h( Z- J; Q& l - (if (or (= value "")
2 T* w, c6 [' h, m' q. s, X7 w - (distof value)& d. y8 e6 |8 S- p+ M8 b) {
- );or
4 P; |; z$ ~' M' ]3 Y# `" c - (progn* _3 M& V% L4 e0 \
- (set_tile "error" "")
; w8 u, m% ~+ v+ T9 k! {$ V - (if (= value "")
2 G8 a( G# h- |- b( c - (progn+ r( D( w7 V; Z1 k
- (set_tile "eb_thickness" "")) W4 d$ U4 I9 j( S6 U1 B
- (setq ethickness nil)
# O6 Y: D x5 F. k; V - );progn1 m8 q: W% W# ^2 H1 L+ B0 R
- (progn7 }: w0 N1 g- L
- (setq ethickness (distof value))
5 s1 @3 P4 s4 j. i9 A - (set_tile "eb_thickness" (ai_rtos ethickness))4 s9 L& s8 y* d. M" ?4 s2 B
- ethickness
. f+ U3 b: R+ y) ~) W# X - );progn* M/ C4 B& f8 R0 a
- );if4 A" Q! B- P( I% n& }3 s' @
- );progn
& C# u# I6 V& w( P# g - (progn
1 ~7 {+ m0 }2 G6 Z - (set_tile "error" "Invalid thickness.")
/ G, C0 k" B D3 ^7 J. ~$ G; D - nil" K. t7 _- s ?8 J" Y0 L! w
- );progn. e" G9 X. @* ?/ f9 q% e
- );if
- m9 \ t5 D2 _7 x b' p3 q - );defun ' |& g) F( n# ]" W! e. Q3 l
- ;;
: ^) W( J" M: v - ;; Checks validity of polyline elevation from edit box.( m& B+ z/ I0 l/ v
- ;;
4 L: ] a& K z9 X0 d. Z N/ |# ? - (defun getelevation (value)
/ e, x: z. |8 x# T - (setq value (strcase value))
- X! \$ Q& B6 q/ }3 Z# M3 _/ A6 | - (if (or (= value "")9 r) P: Q1 t1 I7 j' j. x& e8 J% K W
- (distof value)! J! T1 C+ j9 _& K( I
- )4 X! G; X* O) A1 J& N
- (progn
* N8 U9 @$ B; E5 e! j2 U% r; a- G H - (set_tile "error" "")3 y) u8 w4 R% @ k
- (if (= value "")
: n9 o" S: @& p) I& n5 \/ b - (progn
. b8 q: g. ^& n2 M- x1 ^ - (set_tile "poly_elev" "") L* o- k; r' ]
- (setq eelevation nil)
- j! M* r* u# V# [! f" U - );progn
7 j; U! I: ]. N" k+ ] - (progn8 D: g7 @3 A5 S% w
- (setq eelevation (distof value)), @9 a) C0 Q2 F; q" @* e1 t0 \
- (set_tile "poly_elev" (ai_rtos eelevation))6 E' j3 w1 y1 L8 a
- eelevation
, J6 r- B+ d1 Q9 j - );progn) Q/ N2 x8 p4 c
- );if8 l* t/ Q; M3 n' Z
- );progn1 Y2 H1 p1 O" o# a( z" c% x
- (progn4 k- h& L1 Z2 Q" S) E( G4 I
- (set_tile "error" "Invalid elevation.")$ ^0 d2 t+ n* u- d2 D2 B* t
- nil
5 ]. h3 w. K9 w7 u3 J - );progn
% q6 |6 G/ @! k; T - );if( ~+ m0 N( {4 V8 F
- );defun
, y, j8 g% J" d5 J7 W - ;;4 I* e8 f2 g5 {! Z1 i( W, r
- ;; Checks validity of polyline width from edit box.0 K9 o7 e& @$ v! |: d
- ;;4 d+ o1 f# e$ s/ V8 k
- (defun getwidth (value / rval); ~! P! @# c- n# L8 s
- (setq value (strcase value)
- x; j f: b- @: g5 w4 z' K. A - rval (distof value)
( n: {0 V4 @ p! r - )
: x" K7 S, K" z, G - (if (or (= value "")" ?2 _3 U+ Z# }2 Y* |
- (>= rval 0.0)
( l7 p9 G m3 a$ { - )) W. ?! b i8 d
- (progn: {( c8 F) R |2 N8 Q+ q/ {; G; o
- (set_tile "error" ""). _* }0 \6 N5 r5 d
- (if (= value "")0 u1 S5 X4 e: k7 A2 c: v
- (progn' t+ Q# _. `! |- n% s
- (set_tile "poly_wid" "")5 A) K! w- j1 x) i. T; {
- (setq ewidth nil)
7 I) h5 k3 S2 P - );progn
4 k0 V% I3 y& R. A7 [; K, h - (progn3 x7 Z$ W: E) L# M) G6 w
- (setq ewidth (distof value))) G# N% b L6 {' J* i2 S3 t# \
- (set_tile "poly_wid" (ai_rtos ewidth))" K6 m. i. s, |; k3 y0 q) j
- ;width2 q2 s! [. J% Q2 Y
- );progn
% Y" `$ j5 @ M6 i - );if
) {# h2 d5 s: }2 i* @; } - );progn
( ]/ S/ r6 Q6 ?) v! j7 i6 J4 F - (progn
4 s; |) w2 j9 d4 g# J - (set_tile "error" "Invalid width.")
4 i9 v5 L: Y1 q1 o" e$ ~ - ;(setq ewidth nil)
0 D: Y) Y1 F' l! C - nil " Z& P3 Q2 O- t! I9 u. J/ v4 c
- );progn
3 n& \& n2 L2 j% Y - );if
) u7 U& c- ^# I) v* p# Z - );defun9 o2 B$ O4 H7 G3 c' ^9 Q) N' ~/ X
- ;;, o) l, {+ L9 p3 k+ G- K8 P
- ;; Checks validity of text height from edit box.
8 q; A7 U% D' `5 y - ;;) x+ [! Q; q: f f
- (defun getheight (value / rval)* `( q: n6 Q( A
- (setq value (strcase value)1 W3 X4 H9 |& }8 m4 U" x
- rval (distof value)6 a1 i/ C1 }; y9 `& i0 m
- )$ O& k7 z7 W2 w% A3 z4 F2 {
- (if (or (= value "")
$ E1 W' n( o) ~: @; S - (> rval 0.0)' C& G* `. @! Q n1 b7 d
- )
. t2 w: D* c; I" X# _ - (progn1 P& }3 `4 [9 q9 f, Y( P
- (set_tile "error" ""). @8 K( A4 z4 i# o/ {
- (if (= value "")
# L6 u. ^1 [, e. l) K, Q8 ^ - (progn
0 s/ P& j5 ~9 M+ C - (set_tile "text_hgt" "")( J' r& w. U) T1 e0 T
- (setq eheight nil) P: f5 Y3 \7 _# S+ V! i% [
- );progn* L* g' |2 `4 c$ |2 t/ g# ?! ^
- (progn* A2 N s% D, M, W8 J9 [2 A3 G5 y
- (setq eheight (distof value))8 F% X9 q4 D) u" ^9 i
- (set_tile "text_hgt" (ai_rtos eheight))
4 ^* N3 h$ h6 M( Z - eheight" ~5 M* b0 c. y& J: J* S
- );progn
& i* _4 h( Y* f/ d - );if0 g* y3 n! ~$ o0 x) l! E# p
- );progn
7 \+ N+ \ R* V1 O% H - (progn
# Z4 D9 S( S+ l - (set_tile "error" "Invalid height.")% x' h4 l% k6 ]7 p. J* N# I
- nil
4 [# g# c/ V0 B) W - );progn
: |) o9 O: @5 x+ b8 H( [1 M# Q- ~ - );if: c# R% b' N) U9 |; u: P
- );defun$ N. ]) Z! n( ?# P% F
' p2 M/ @+ a+ K1 A- (defun getstyle (value lst / rval)! D. N( f1 {0 M
- ;(setq value (strcase value))7 j2 E) E2 P# F0 @5 Y. V/ E
- (set_tile "error" "")
8 |2 C0 a' h. D7 W6 ^4 t - (setq estyle (nth (atoi value) lst)), T/ A9 _ _. f5 c4 R1 Q. w
- (if (equal estyle "")
P4 E* @3 V5 ? \1 G. V - (setq estyle nil)
$ H7 M1 Q# w# U: g% x - );if
7 T$ L4 F j9 c& w4 A4 | -
6 F9 ]/ Z. h" y5 ~/ J; ^- Z - );defun getstyle
# |; F9 Z) m5 F n
8 D' ^* b* y) O5 _7 A9 Z* T. L7 {- ;;
% d0 ~! H* C* w% _ s - ;; This function make a list called laynmlst which consists of all the layer
1 }: D! I2 ]6 H& k$ w - ;; names in the drawing. It also creates a list called longlist which
5 }/ U5 |* O5 A; j* F5 z! W" C. O - ;; consists of strings which contain the layer name, color, linetype, etc.
# U2 L* z5 j ^+ V1 x6 |; M; r0 m - ;; Longlist is later mapped into the layer listbox. Both are ordered the! q* V7 v) q7 ^
- ;; same.
3 c; Q5 k: }6 u; q+ ?2 J - ;;- e2 j' i6 u' t1 i0 H! s- n
- (defun makelaylists (/ layname onoff frozth color linetype lock vpf vpn ss cvpname9 i2 L% {2 t: S- M
- xdlist vpldata sortlist name templist bit-70
6 t( W' J0 U' |: H/ t' j - layer_number
5 K$ }2 A {) T - )" f8 t+ \. D8 a/ d# p
- (if (= (setq tilemode (getvar "tilemode")) 0)
, T$ A! T+ a, ]: G# j - (progn
- v- V! m5 ], ^ - (setq ss (ssget "_x" (list (cons 0 "VIEWPORT")
. [ z5 L8 g* |7 ]! M - (cons 69 (getvar "CVPORT")); Z2 y% v8 A& Y+ C1 }4 [
- )
9 f: o ^# c% ^) m) e - )
# {! ?/ B! h0 a7 m- z# \ - )8 o% t+ I) G# v! b
- (setq cvpname (ssname ss 0))6 C3 T/ J3 U+ v8 [) x6 v6 p5 b
- (setq xdlist (assoc -3 (entget cvpname '("acad"))))
* F% J( V. u$ W2 I$ W7 X9 o% ]$ E - (setq vpldata (cdadr xdlist))
& X) y: f8 X: S, r - )
& r1 U/ k! g2 i+ S6 Y - )2 F7 {) n9 [1 r; |) O7 M5 M" ^
- (setq sortlist nil)# X- b+ j* S. }+ F
- (setq templist (tblnext "LAYER" T))
1 L; {3 E! N r: s - (setq layer_number 1)' _6 p2 h, G& U6 U
- (while templist* s, v u" E( H5 G9 \8 U9 c, x
- (if (not (equal 16 (logand 16 (cdr (assoc 70 templist)))))
1 b# p2 Q3 G) ]/ k3 d8 { - (progn 0 r: B+ M" ]3 f \- W0 b
- (setq name (cdr (assoc 2 templist)))
1 X) T* y5 i) c/ A1 g - (setq sortlist (cons name sortlist))2 C* u7 | g6 k: @9 z4 X
- ;; Not dead message...
: k" Z% p, O& G9 Q4 B - (setq layer_number (1+ layer_number))" H. m! ]) Q" d# K+ [5 ~7 T v
- );progn
* H8 m) a F0 Z0 Z: u0 ^9 ` - );if
8 R( U7 c: m# J' s - (setq templist (tblnext "LAYER"))
! o5 u, f- ?% B8 l) G - (if (= (/ layer_number 50.0) (fix (/ layer_number 50.0)))
+ b7 w' v2 D" q/ O - (set_tile "error" (strcat "Collecting..." (itoa layer_number)))
' l* o+ D2 X- B# c, V& M - );if# _' w! H+ v, {
- )$ S+ a7 }3 g3 e- Q
- (set_tile "error" "")2 r* G8 S M- S u8 Q1 @
- (if (>= (getvar "maxsort") (length sortlist))
: j9 W$ B8 Y/ B7 C$ t% H - (progn
% k9 l, R" |* M% q - (if (> layer_number 50)# _* Z! y$ A: C, |, P B; V" }
- (set_tile "error" "Sorting...")
8 L4 G/ I' E/ l5 s* A1 o - ). [( O& ~$ C9 z! Y; t- r
- (setq sortlist (acad_strlsort sortlist))# V/ D# ?! _1 V; |+ ^+ N `
- )
+ ?9 L% K# o4 `4 z" ^ - (setq sortlist (reverse sortlist)). s* M/ T& G; |' W' r
- )
& h, u0 w# h! Q/ s( O - (set_tile "error" "")4 m7 A* w- f( i
- (setq laynmlst sortlist)% i8 v9 o; o& m: t
- ;rk
! w. d3 N8 j" p4 [% M - (setq laynmlst (append laynmlst (list "")))
4 _. @( t+ Q2 ]
( H6 K6 d$ E' h- (setq longlist nil)
- h; @5 ]! @! b - (setq layname (car sortlist))
- e1 B) e' ]* f* C5 `1 K - (setq layer_number 1) _+ K) P8 S9 W& e( S7 W
- (while layname% \6 y8 f& H: z- \8 z
- (if (= (/ layer_number 50.0)
0 X" j: y' \- [) I - (fix (/ layer_number 50.0))
3 B9 q W" J+ F - )6 T- @* j$ E- o3 ~( M9 I5 ^- x
- (set_tile "error" (strcat "Analyzing..." (itoa layer_number)))
8 Y9 s; [7 \6 l- }' j3 x8 e - );if
; A9 ^# m. E- f - (setq layer_number (1+ layer_number))
* I, B" w1 C% \# h) _- a# A) k - (setq laylist (tblsearch "LAYER" layname))
" p& R0 Q. I% }, W3 Q/ _6 j - (setq color (cdr (assoc 62 laylist)))4 ]8 b5 E# l; b
- (if (minusp color)
* Q6 [; M4 v- ?, j - (setq onoff ".")
3 _6 j) h9 s/ c' ?" o8 e% p% G, _4 ^ - (setq onoff "On")1 O; M: U! m6 `, I& v# L
- )
; h6 j/ |' K3 U - (setq color (abs color))
9 n3 w. S& t7 `+ i9 C* n - (setq colname (colorname color))6 R' e$ f3 F( V+ C
- (setq bit-70 (cdr (assoc 70 laylist))). j2 t, O, |; ?* F6 z
- (if (= (logand bit-70 1) 1)/ Y0 z* I; i' E! ?6 E: ?: W
- (setq frozth "F" fchk laylist)- X! h- _ {( [1 [0 k# l
- (setq frozth ".")8 c( x% e0 j5 X- v/ `
- )2 S7 i3 m8 ^9 I7 P- |
- (if (= (logand bit-70 2) 2)
. z8 w- c, h6 M; v7 C" l+ } - (setq vpn "N")# l6 j, t- L# Q3 G
- (setq vpn ".")
B% I2 ^. y* h& f - ). B2 ]8 r* E& B' [3 L9 g' B
- (if (= (logand bit-70 4) 4)4 R S$ |/ G. \, C. h2 Y w
- (setq lock "L")
K( G+ V* x. C* I - (setq lock ".")
7 A a' d0 A% J5 a1 |1 z7 R - )7 b0 V+ g8 `" |9 ^* L. c5 y
- (setq linetype (cdr (assoc 6 laylist)))
% R8 q9 c7 V3 t1 b1 b6 g9 h& y - (setq layname (substr layname 1 31))
4 {# i' o* C1 m. |8 H" b) ^ - (if (= tilemode 0)
* S6 L& g2 a* _ - (progn; c" `! I; j, Z1 G4 P0 y" }
- (if (member (cons 1003 layname) vpldata)
' ?! U$ z" N( S - (setq vpf "C")
% L: E! `; N/ D5 g* G+ }7 y - (setq vpf ".")' ]3 j( Y9 y9 r0 M
- )% e ]' T9 p% X$ p n
- )
3 Z$ u s1 O1 R3 S+ s1 y2 X0 F - (setq vpf ".")) z8 `* N3 i k5 E+ v0 P C, C
- )
0 B, i7 y% V( t5 W8 \0 Y6 k - (setq ltabstr (strcat layname "\t"8 R: r0 x: f& m
- onoff "\t"8 i7 r* L* ?& R; F$ D8 T5 W
- frozth "\t"
4 q/ j/ D9 ^( v - lock "\t"
: h( ~% L1 s' m - vpf "\t"% L+ A4 c% I' G" I( o
- vpn "\t"1 i& ]; R2 U( f7 y$ L( n
- colname "\t"1 @7 |) l s2 ^& f- v9 z1 F6 d, U
- linetype
& B( }. w; M+ U, B7 k1 h7 N - )& w0 |% h% ^/ N) R. e" B
- )) I6 @0 s. t; |! K: x# X
- (setq longlist (append longlist (list ltabstr)))/ R0 ^- I3 S) g; z& N/ F2 r
- (setq sortlist (cdr sortlist)) ^+ {# K; h) d- H7 v. K: _
- (setq layname (car sortlist))" L) \" j2 E1 [7 r3 M. X
- );while+ }4 h' l1 {! j4 \, o0 \
- (setq longlist (append longlist (list "")))4 l* Z* E3 y; |0 U
- (set_tile "error" "")
: m* C2 @+ u3 V! K5 ~# K - )
1 g; V, r1 D% d - ;;) ^. W7 N* U/ F+ u0 Q
- ;; This function makes 2 lists - ltnmlst & mdashlist. Ltnmlst is a list of
; h: H X+ v( h' f - ;; linetype names read from the symbol table. Mdashlist is list consisting7 {( M/ w1 F9 s# @) J3 t. X- o* t- @
- ;; of lists which define the linetype pattern - numbers that indicate dots,# K6 ~! d3 v; G6 P& d3 c- W! x
- ;; dashes, and spaces taken from group code 49. The list corresponds to the6 u8 K- K, ?# k' e+ E# z
- ;; order of names in ltnmlst.( z# o# s' A. l* F9 J
- ;;
. @, F. K8 e1 L# m! h2 n. s2 d! t - (defun makeltlists (/ ltlist ltname)) [& }( D1 K- T5 U2 a
- (setq mdashlist nil)# m5 g, j2 `: k9 [7 p/ _3 G6 W
- (setq ltlist (tblnext "LTYPE" T))% N! g4 S7 o/ ~( W# f
- (setq ltname (cdr (assoc 2 ltlist)))
/ X9 g% g% s7 _0 I3 m3 [/ i - (setq ltnmlst (list ltname)): \. A+ Q& ~3 e6 y
- (while (setq ltlist (tblnext "LTYPE"))* W7 F3 W6 ~6 a6 u
- (if (not (equal 16 (logand 16 (cdr (assoc 70 ltlist)))))
8 O3 d/ j$ k. f% v - (progn
0 f) `. ?/ m/ S - (setq ltname (cdr (assoc 2 ltlist)))
b' C) x0 b" v, Z: a3 Z - (setq ltnmlst (append ltnmlst (list ltname)))) \- M# v3 o! f& N
- );progn
3 F; Q* [: G5 x" p - );if + A. N9 H' T: f' O1 H, N3 v
- );while3 I3 d* V5 `# {$ m( J
- (setq ltnmlst (acad_strlsort ltnmlst))* o+ `0 l' C) i8 ^
- (setq ltnmlst (append ltnmlst (list "")));add by rk / W- S3 H- j* v- X7 n& ?+ k
- (foreach ltname ltnmlst
3 l+ u; ^; [& R - (setq ltlist (tblsearch "LTYPE" ltname))) t$ H# A, Q9 S9 z
- (if (= ltname "CONTINUOUS")
5 l) a0 S/ [5 X2 W% v% Y1 S& L, K - (setq mdashlist (append mdashlist (list "CONT")))
) w" [0 i( x4 }# p' ]. g! X - (setq mdashlist
3 D' l8 t# p$ ^0 w - (append mdashlist (list (add-mdash ltlist)))
1 I+ [) g ?) {" X0 K) h2 P - )
$ w, y/ W4 ?& j( `% \6 A - )
% g) M+ i, W0 m/ L/ u8 _& t' X - )9 g! b8 a$ k- b1 W" u
- (setq ltnmlst (cons "BYBLOCK" ltnmlst))1 H' ^- @6 J! J$ \. T2 I
- (setq mdashlist (cons nil mdashlist))+ r3 a1 x5 l) ^" l# R% ?: `9 S
- (setq ltnmlst (cons "BYLAYER" ltnmlst))
! h7 u/ |7 h) D) O - (setq mdashlist (cons nil mdashlist))' H' a4 z# N7 A; ~9 j# S* t& V! D$ s
- )
/ r( ^+ n/ y5 y' u( j - ;;
4 O% W5 e9 K$ m6 H7 f* V9 Z - ;; Get all the group code 49 values for a linetype and put them in a list9 |5 ^ h1 w) `- i! o4 w" _
- ;; (pen-up, pen-down info)
/ D3 i R& p2 i2 c/ b" _! o - ;;
7 r8 \, `( H5 J# C7 m - (defun add-mdash (ltlist1 / dashlist assoclist dashsize)4 C; Z8 `, e( p4 a; I- K0 }7 {
- (setq dashlist nil) l) Q+ U( Z+ |9 }' }3 u- t
- (while (setq assoclist (car ltlist1))
$ W z! L7 c8 w2 z - (if (= (car assoclist) 49)+ Y5 [" H- I% g& q i
- (progn/ h0 P. u9 T6 _
- (setq dashsize (cdr assoclist))1 y1 _' v5 q2 ?- r' n i& R+ ]
- (setq dashlist (cons dashsize dashlist))
) H- D; \% H5 B3 v3 g- l: G: y - )9 E8 R' s& ~- R2 b0 \3 R' V9 y4 ]2 I% _
- )# e. G/ s p q. v5 b) Z' f
- (setq ltlist1 (cdr ltlist1))
/ K2 _- B4 r6 W/ v( d3 [ - )8 @' r6 n# M o$ a; R
- (setq dashlist (reverse dashlist))8 G1 v) k, }$ M, O# e. r
- )7 ?) z' X0 ~4 L/ h6 w
- ;;
. x& J$ d- g* | - ;; Color a tile, draw linetype, and draw a border around it
2 L" U! i% L$ N+ \; G7 E) l - ;;. Y/ d, E6 x D, J H& \! ~
- (defun col_tile (tile color patlist / x y)
' {! x' L" V9 i - (setq x (dimx_tile tile))
& G1 B- ]& h% y8 a- j - (setq y (dimy_tile tile))5 Y# L9 S; g% {* j% m/ w
- (start_image tile)- t, ^3 @( p/ f' n
- (fill_image 0 0 x y color)' U0 X7 X2 v( \6 `) A+ h! p
- (if (= color 7)
8 h3 ^1 b& @9 D* O( x G. d - (progn" S3 f$ x& ]7 f4 P" X- \
- (if patlist (drawpattern x (/ y 2) patlist 0))
1 Z; k% Y. Y5 \( U# g - (tile_rect 0 0 x y 0)
+ r" {0 @$ @/ f% w( D. _ - )) v2 A/ _/ b) i; M: O$ o
- (progn
$ Q4 @$ T: j- y$ t0 b1 g. U% d7 C - (if patlist (drawpattern x (/ y 2) patlist 7))+ ~7 d- Q- \ E4 L4 X& J- b
- (tile_rect 0 0 x y 7)5 }1 _' l9 W1 E& W/ v: T& q
- )% g) H1 t" S8 A W# o
- )
3 O+ m5 _* Y2 O9 V4 ^3 w9 y; y - (end_image)7 }, u( [7 P5 C* r" N4 F
- )
/ K! F5 e$ l# } - ;;0 k* M9 h* y, P1 P2 \; ]
- ;; Draw a border around a tile
( A% M1 E7 g @8 C ^# [ - ;;: h; H+ e( N0 w0 Z5 p" Y
- (defun tile_rect (x1 y1 x2 y2 color)6 {4 \# b7 [" H/ n
- (setq x2 (- x2 1))
+ P! X+ g* }2 P2 Y* C! y - (setq y2 (- y2 1))
* C/ W' U# N$ `7 z; ?0 h1 x8 k( ^ - (vector_image x1 y1 x2 y1 color)5 I0 p; ?, R# {- D3 _
- (vector_image x2 y1 x2 y2 color)
9 {9 y0 T% J; M7 u D; }2 F' a - (vector_image x2 y2 x1 y2 color)
6 R* A( ~: G6 {& K0 J. J2 U - (vector_image x1 y2 x1 y1 color)+ E0 x6 ?/ f: r R- u
- )
# r0 q7 k2 h! n$ o& v. R - ;;9 l, \. d y" W8 H3 t; h. @
- ;; Draw the linetype pattern in a tile. Boxlength is the length of the image/ ~" j. F8 r$ Z! u# R. [- q
- ;; tile, y2 is the midpoint of the height of the image tile, pattern is a `: }4 W0 V1 I
- ;; list of numbers that define the linetype, and color is the color of the
9 C( p4 X. H9 i- P - ;; tile.
! g% z9 F, x. l( t - ;;
$ L' I* W3 \, C4 K* ~& {+ i - (defun drawpattern (boxlength y2 pattern color / x1 x2$ H; _2 M9 Y: b' l# @
- patlist dash)
: R( n. H) j) W/ j - (setq x1 0 x2 0)1 S2 p' n. f& [ c& X1 C
- (setq patlist pattern)
2 p4 Q6 v" L+ y3 f5 x' V( l5 a+ E - (setq fx 30)/ v- F9 X- P2 v5 N/ H& h3 x
- (if (= patlist "CONT")
. u" R ^+ c/ B: i - (progn
5 M- f! l7 Y/ E0 z _, q - (setq dash boxlength)
# b2 y9 ? w" n( Q+ k) m; @ - (vi)
0 F$ v+ I: S- } - (setq x1 boxlength)3 G) D$ J, O, p$ F3 H
- ): r" d# @6 C- t4 D
- (foreach dash patlist
) \- c8 E' }( Y2 l5 Q0 r+ ]) r - (if (> (abs dash) 2.5); \8 Y6 G! f3 o0 K0 z
- (setq fx 2)
( W; }$ T# T; C" j5 q - )( B! E# @0 T8 A
- )$ ^8 k f1 O' W5 ~9 _4 J4 B
- )
% C' w2 D7 \5 R; N - (while (< x1 boxlength)
- P; s( m7 A# w) ~2 e7 l - (if (setq dash (car patlist))
$ V4 d' T" g) L" h - (progn
' p' X$ g; {, W) N - (setq dash (fix (* fx dash)))
$ |5 k9 M8 x4 K% y - (cond# \0 o3 W1 Y; G% o) i+ A+ k
- ((= dash 0)
/ V% w- V# G9 ]0 f% [; x( P - (setq dash 1)
$ T4 Q0 U. `4 W% \( e; F! { - (vi)1 q0 Q, z3 Z( ?2 ]# l6 _* X( {. Z
- )) d9 ~0 c6 N5 n
- ((> dash 0)
+ e f! V8 t" x2 v2 a$ | - (vi)# _/ ~ L' [7 `8 n
- )
2 B) A; S! R4 H - (T6 a2 w, U% O' M0 }
- (if (< (abs dash) 2) (setq dash 2)) F& i2 B$ T0 y5 T- g9 N
- (setq x2 (+ x2 (abs dash)))2 ]0 n, e# \) ]
- )
/ @( {8 P+ Y% g* K: M/ q8 I1 ^ - )1 R3 Z+ D- d1 n' X6 X; H% e
- (setq patlist (cdr patlist))% x: p) |" T3 e
- (setq x1 x2)0 y4 s: B; R; u" r
- )
! q* o* G' n, b - (setq patlist pattern)# b* g. t# @3 {6 g: k, x) W: H/ J6 k
- )
* d( o+ t) D$ R. E# Z, |" V - )6 D7 u5 c- ]/ u1 G
- ) q+ n* L2 }7 G) X
- ;;
7 V% ~1 p+ y+ X$ B+ N* r9 s' _ - ;; Draw a dash or dot in image tile, f* Y" b; l" D$ g+ N) d" m$ T3 f
- ;;
% X5 R! l4 B! |' e# w - (defun vi ()
6 G/ {! v Q% S4 \+ {# H' f' g - (setq x2 (+ x2 dash))
, o7 X) p& B6 [7 E; R3 S - (vector_image x1 y2 x2 y2 color)' W2 b0 k+ X& `
- )
1 ^+ f' l4 ?; S0 A
9 S7 m# ^7 { @' J @3 R V$ D- ;; This function takes a selection and returns a list of the color,( a' T4 D0 {2 W ~7 T8 `
- ;; linetype, layer, linetype scale, and thickness properties that
, Z" E. s0 ~2 I+ U7 [% @ - ;; are common to every entities in the selection set - (color: A. v$ q8 Z' H5 Y/ _$ F& ~
- ;; linetype layer thickness). If all entities do not share the same
2 P7 R6 [: R; D. B1 { - ;; property value it returns "Varies" in place of the property/ I+ D9 H. w {! l5 W2 h2 C. R/ x
- ;; value. i.e. ("BYLAYER" "DASHED" "Varies" 0)7 b$ X, N7 X C
- ;; The last item in the return list is an integer flag for the5 \ F- F } s" j
- ;; homegenity of the selection-set object types.' r0 N/ X7 C8 u9 m6 f' C9 _% d
- ;; 1 = All polylines
* M6 g6 R* i$ H c3 }8 W - ;; 2 = All text or mtext or attdef, or a combination of the three! ]' X! {/ e( G
- ;; -1 = Any other mix of objects
2 X9 C; \2 X3 _3 ?5 R5 v - ( _2 L' l# t% b3 b; Q# v& d7 R
- (defun getprops (selset / sslen elist color ltype layer ltscale thickness1 ~0 H) f' ?2 g5 ^3 [
- width elevation height go ctr
. _# {) i2 R& D. Q0 B - eflag # v. V; r6 O$ q o. P! D# O7 P
- etype temp
8 g o7 ^' |$ V/ V* T( V - txt_ss ;;;;rk 11:24 AM 1/30/97
; L( F, T; S, D, d. J7 w' W - tmp
& {& `; _4 N( X7 B5 m9 ^ - poly_ss 2 i/ }% L/ A3 U5 P5 r$ w+ v
- style6 @6 ]* V' [7 [ N2 |
- )$ |" v% B2 v' r
' L' z8 }( k3 ?" @7 E) I; a- ' _( O6 \2 ~" }* h
- (setq sslen (sslength selset)
/ V2 t& O- z7 J _( |/ K6 |6 ` - elist (entget (ssname selset 0))
; |' s& n# t2 ^. ^* G" ^ Y& g - etype (strcase (cdr (assoc 0 elist)))! \! i2 ^ n9 _( b
- color (cdr (assoc 62 elist))$ w. G% b" t: M$ n0 D7 [8 r2 \% L
- ltype (cdr (assoc 6 elist))
. |; |, Z* C2 i. g1 o - layer (cdr (assoc 8 elist))3 ]* A0 s! N8 _& W
- thickness (cdr (assoc 39 elist))
* x4 @( Y2 Z8 ^* J. N5 k9 t* z8 { - ltscale (cdr (assoc 48 elist))
5 }+ t- M) h8 H - );setq3 z; Z$ h" @# M% ^0 I6 N
: ^# {8 \/ T; Z. P0 i8 F- (if (not color) (setq color 256))
9 j5 D9 V9 {! s/ n) t u; U - (if (not ltype) (setq ltype "BYLAYER"))
8 U! s Y3 s0 u - (if (not thickness) (setq thickness 0))/ H1 y5 j: X0 p- f: Q1 C
- (if (not ltscale) (setq ltscale 1))
3 |3 U. ~: y( J9 b% C - " U, a% q: t1 l3 ]
- (if (not width) (setq width ""))
$ Q- m& w" A4 B- ]0 H$ s - (if (not elevation) (setq elevation ""))4 d' k) R$ Z7 A7 Y( t
- (if (not height) (setq height ""))
0 Z5 q# q, g; P - : ?7 b+ S" C+ S3 K& Q$ z. ]/ p( j
- (setq go T 7 R5 ]9 t0 r7 u5 ]
- chk-col T
9 O1 b! W9 C! @" e |' o# _8 M - chk-lt T
u/ L6 c3 I. d- C9 v - chk-lay T
7 j$ x6 G# c( p" d) Y/ a7 ?( ? - chk-lts T / u1 u2 e' y7 ^
- chk-th T ' H6 r3 s$ Y% C7 h: k0 f
- ctr 0& c, S9 {- W d/ i& _/ ~
- );setq5 Z$ b* J' K3 g1 M! F: w
0 u0 B- I" ]$ M% S/ H- ;; Page through the selection set. When a property
0 k K- u y2 I( N8 _1 o Y5 v- ^ - ;; does not match, stop checking for that property.
" a T4 n& W2 w - ;; When the selection set is not homogenous, stop checking.
4 e9 {1 T5 L/ D: d( L3 z' N% s - ;; If all properties vary and the set is not a type 1
) B# d, k1 q# C* H# b - ;; (polyline) or type 2 (attdef/text/mtext) set, stop paging.( l+ @/ F3 c' T1 F9 D* K
- 6 _# p2 j4 p) t3 [' f* C; r9 E
- ;Lets set the eflag so we know if the selection set includes any
. T5 k! S0 ~( G/ u* P. }; t) y - ;combination of polylines, lwpolylines, text, mtext or attdefs.$ W! t- Z; f w+ N$ H6 f+ Q
- ! v: ~& e, K* N8 _4 ?
- ;watch out for 3dpolyline and 3dmeshes here! @rk 10:17 AM 1/30/97
. @( Z. Z, A: @2 W; Q' A' O - (setq eflag 0)
# U9 M3 e- G( t7 E7 P - (if (setq poly_ss
( o& ?+ E$ M8 s6 P: D0 a - (ssget "P" (list '(0 . "*POLYLINE"). T' h2 \+ w& V" V5 B; r+ F& y
- '(-4 . "<AND")
; J' ~+ j2 ^% N3 `- h: f8 g - '(-4 . "<NOT") '(-4 . "&=") '(70 . 8) '(-4 . "NOT>")
8 `3 |7 L8 m1 y' Y4 A( S - '(-4 . "<NOT") '(-4 . "&=") '(70 . 16) '(-4 . "NOT>")
# F, ?+ o5 f5 p2 o - '(-4 . "<NOT") '(-4 . "&=") '(70 . 64) '(-4 . "NOT>")
4 G% J4 _7 m/ n4 p6 H0 C6 V6 N) m - '(-4 . "AND>")
3 E8 s) `/ r- Q+ t* {9 M( j - );list9 B5 Q+ [# W1 T' _/ d
- );ssget get 2d polylines (legacy and lw)
) u' ?7 w7 j3 n3 S5 H: g - );setq A# _! O7 F0 Q( c' j' p- w0 i* H
- (progn
9 q7 C9 i; J9 a - (setq eflag (+ eflag 1))
! ^3 r% X" h: r4 I+ n - % A/ k* N' _' j4 `* B0 U. D
- (setq tmp (entget (ssname poly_ss 0)));setq0 h" k9 E" v! z; c$ J, j e
- : y. F$ q# H' ?$ }/ D6 [. Y! k
- (if (equal "POLYLINE" (cdr (assoc 0 tmp)))+ d& x& G8 _- I+ m/ ?% V4 A
- (setq elevation (last (cdr (assoc 10 tmp))))
. T+ s) K* d7 J$ X) K: W - (setq elevation (cdr (assoc 38 tmp)))
, C8 U2 w3 i( `3 N: q g3 [ - );if
& m7 M, q- O6 v; x5 P - (if (not elevation)
( e- f k* c o1 _$ m - (setq elevation 0.0);setq% w9 r3 r7 M5 ~7 ~
- );if: g. s: R8 D' \" P" p& R0 j* Z
- 8 i- M5 _6 D3 X7 X3 s4 \- j
- (setq tmp (ssget "P"
# L2 k& N: D# E* s) m - (list
* g, M1 ]$ U! i" G1 I6 C+ t7 C - '(-4 . "<OR")+ l4 |) k* y) f
- '(-4 . "<AND") % Y' p6 \8 {$ {
- '(0 . "LWPOLYLINE")
+ p+ Y: R2 N2 ]) f - (cons 38 elevation)- k: T/ d7 l6 G9 D; L8 O Z
- '(-4 . "AND>")8 ~$ g2 P$ S1 O- G5 U0 y# A
- '(-4 . "<AND")/ X. T! E2 Q5 |' b
- '(0 . "POLYLINE")4 s4 \* F5 K8 l) o; b* ?7 g
- '(-4 . "*,*,=") 5 D3 F* K; h* ^5 b( e0 n0 F! M% D
- (cons 10 (list 1.0 1.0 elevation)); J( ?5 y& r3 w( k, q/ {
- '(-4 . "AND>")
( ^. \5 s' U: T3 w+ V$ x - '(-4 . "OR>")
H9 t0 ^: K/ h6 l - );list& J. ]; t7 B8 T8 N" p
- );ssget
0 x- v3 ^# p" c) O - );setq
; P5 h6 n1 O. U. ~( }
- t# | Y3 ?! t6 a& h p* H$ Y- (if (and tmp
1 ]1 x) @) j/ c - (equal (sslength tmp) (sslength poly_ss))
; ~3 x N2 T3 x/ O* l9 c8 M n/ ] - );and( p& c6 G0 J6 q7 Y! E0 X0 d
- (setq elevation (ai_rtos elevation));setq# w5 y7 Z8 }; A
- (setq elevation "")5 B, c* o# Q; ?) g s: j
- );if
. K9 h' W. y, `+ e -
( u0 ]0 Q. @" I9 s/ q/ z - (setq width (pl_width_getter poly_ss));setq
1 P: g/ z5 |+ x# N$ X. E -
* J7 m! j8 q6 W) \, D- T' g* t - );progn then 2d polylines and/or lwpolylines are in the HHHHHOUSE!
h: F# @ D- u( T5 A3 y( u5 b - );if
, s$ T P" }( s1 i9 q* Q- x - (command "_.select" selset ""); E" w- K- u9 U# C1 Q5 V2 X& s
-
, l- g) W" i2 J/ `2 c: S - (if (setq txt_ss
4 _- J& o7 N- Y, x F* T* L - (ssget "P" '((-4 . "<OR") (0 . "TEXT") (0 . "MTEXT") ( w& I- \' h P3 ]& m
- (0 . "ATTDEF") (-4 . "OR>"))
. f: t5 a- K6 Q, |# R - )
5 I$ V6 _9 _6 ^; p z. H' [ - );setq- D# \ y7 k& \# p k5 ^' ]& c% y# m
- (progn4 y0 p _& ^" H+ I; n3 l
- (setq eflag (+ eflag 2)), d( x& k4 u3 m( U" K
- (setq height (cdr (assoc 40 (entget (ssname txt_ss 0))))
* J* M: {* P3 v5 M/ U( M- {2 W - tmp (ssget "P" (list (cons 40 height)))
6 Y; m; `+ ^6 k - );setq
/ {: J, F1 @& w' q1 ?. \# b$ e2 x - (if (and tmp- E N# M; s5 `# o7 C: a
- (equal (sslength txt_ss) (sslength tmp))
0 s8 \) n1 M# n8 Z, I% B4 A - );and
: q1 Y; P# o e5 Z$ _! s( P - (setq height (ai_rtos height));setq ;@rk need to translate from float
# _# D/ n1 C- ]7 }. q; e - ;to string and back again easily9 f* R! H) R- T' S+ m6 j+ Z4 T; \3 V
- (setq height "");setq else the height varies
* h& V# R/ X% {0 `8 U7 ` - );if
0 M& J4 Q2 R3 R- Y0 Z _, @3 F+ N - (command "_.select" txt_ss "")
. X* o" H; D7 ?9 M - (setq style (cdr (assoc 7 (entget (ssname txt_ss 0))))
5 k# F1 b7 D+ N. V6 D6 N# }( X - tmp (ssget "P" (list (cons 7 style))) - K: f+ n6 E3 V2 l, C9 Z
- );setq
- D+ ?$ Y0 [; @; `9 ~ - (if (not (and tmp
5 D4 u! A- B6 Q - (equal (sslength txt_ss) (sslength tmp))
' v4 s; P6 F6 w5 r- R2 Y' d. d) } - );and. `7 ?! |! i5 l# Y
- );not
/ M( j' [7 t7 ^' @ - (setq style "");setq then the style varies
6 x: w/ z R# s; |! j- I - );if
. x$ x7 b4 e; r3 L - );progn the text type objects are in the selection set
9 n7 p' \1 G/ k- c* x# Q) P - );if9 f+ f% e" N# Q1 C' _
- (command "_.select" selset "")8 o2 P- |# }0 L3 Z5 x# v, Z
-
: W! `& c" w0 t# ]& r - (while (and (> sslen ctr)
! J5 e6 U- p) Z1 @ e+ y - go
* W, _* `; r3 h' x - );and
+ W% E; T- K1 h5 [ - (setq elist (entget (setq en (ssname selset ctr))))
V+ w3 N& E- c# U3 W+ n - 1 I9 I8 Q5 r0 r' A
- (if chk-col (match-col)), g9 L9 O% p+ Z1 R
- (if chk-lt (match-lt))& m" a) {# ]/ ^5 [8 C
- (if chk-lay (match-lay)): `; d+ L, l$ L
- (if chk-lts (match-lts))
; ]3 O4 w3 L4 M4 b) K - (if chk-th (match-th))4 D @& r/ h8 X( j5 m. p
- ' t* P+ X2 T. J) l& z
- ;(if chk-etype (match-etype))
& v _4 ~ ^) b1 Z
6 u6 p. I( m h- (setq ctr (1+ ctr))/ K( z; Q3 A9 q; o$ ^
- (if (and (not chk-col)" w. x; W2 @0 _. n; y4 u3 G! B
- (not chk-lt)( M$ [/ ~( G t, [. r% a+ F9 r$ S6 X
- (not chk-lay)
7 ?( M+ |8 c: z - (not chk-lts)0 z( y5 K+ n0 H2 y
- (not chk-th)
9 m9 A) ~9 a# e) U - ;(not chk-etype)
" c' k, E) C8 t! K" b$ w0 F) G - );and1 g$ a+ @, T9 @( [& l9 x( z6 m
- (setq go nil). a9 T! \9 E X8 R
- );if
4 k+ X; v1 j; T2 U - );while4 k, d1 h4 I; b8 B! X: C1 Q$ O
- + Z3 ~9 [3 f0 [. h8 B
- (list color ltype layer thickness ltscale" [1 P# j' Q8 \" @+ X
- width elevation height eflag 8 m7 S! S/ Z0 Q6 @0 \( {8 ?) K3 I5 k# \
- style poly_ss txt_ss2 I |% Y4 h0 I
- )6 q: d0 t& D5 b, |1 S
- );defun getprops8 u2 v; V9 G) u; Z8 U' w
& c3 b' V& H0 u# W- ; This is a speedy little routine to tell whether the polylines in / n! u3 @* r* F/ h9 T& i
- ;the selection set argument are of varying width or a constant value. $ y9 g4 \: b( F- f6 m
- ;Looping through the vertex's has to be done for old polylines when
/ `- O% T/ z9 l - ;the polyline header has width values of 0.0. Basically, in this case, . b1 }) K9 A+ S8 b& m
- ;information in the polyline entity header is abmiguous. Width values
& t8 H) |1 k3 R( b3 {! G/ q - ;of 0.0 in the header entity could mean the polyline has a constant ( @. h1 h- z3 v# Z; K
- ;width of 0.0 or it could mean that the polyline has vertex's of varying
( [2 j5 \% ?) f0 |$ Q - ;width.
- @8 A7 g$ X i) O - ;- o1 ~$ \4 X( x) h% I/ h7 `
- ; It's all in wrist. Err a.., I mean it's all in the 'if'
% D' x( F/ ]2 `# q - ;;
* x7 V3 q! X$ ]! [ - (defun pl_width_getter ( ss / ss2 ss3 n na e1 width width_a width_b flag flag2)
$ B4 X5 `, r7 ]: B3 L - % X% ^' {0 K: H( p) w& T
- (if ss
2 A: }& x# D0 Q* ?$ s: P - (command "_.select" ss "")' L7 T. h& Y5 k$ }* S
- );if
. M: g& G& x5 H$ U; m+ P - (setq width "", w6 O( P0 [1 W* L, ~
- flag nil
) ]% b6 k3 m" V - flag2 nil
' n- c& B" T1 w7 g) M$ m. Z - );setq/ y% G! h' E) L1 }1 P8 C+ f( i
- (if (not
$ ^* `/ a: f" r- Y- I: M% Y - (and ss5 S1 j9 ]9 H& s0 a; o r
- (setq ss2 (ssget "p" '((0 . "LWPOLYLINE"))));setq
) Z, y' ?7 w$ a/ i! d - (setq na (ssname ss2 0)
: x% S; d4 l9 Q, u) V - width (cdr (assoc 43 (entget na)))3 ~* c0 W) U, m
- );setq
: K) @7 y8 ]6 a4 A; Z+ h - (setq ss3 (ssget "p" (list '(0 . "LWPOLYLINE")
8 }. }& p( n6 u' D" v$ a9 g - (cons 43 width)
3 J$ v3 ?7 p ` - );list" y- g5 B! u0 B4 H7 B8 [
- );ssget
2 ]$ O% A; Q4 g* v V. b - );setq, Q3 z4 ]3 f* O# }+ {
- (setq flag T) + C$ w! B! v! [- l5 J- [: M
- (equal (sslength ss2) (sslength ss3))) E2 [5 M& U! S z
- );and' ?8 x% u( ~- `2 i8 o; O
- );not1 u4 B) @* A' f
- (progn3 t+ N7 F; S9 j
- (if flag
3 W9 G( G8 N. Z3 t - (setq width nil)
9 K8 o4 W# y2 O. _, o! r. A' o - );if/ ]" u* c) ~# d8 @
- );progn( F! L; O' h& a
- );if
R1 x3 i; R8 j" R, j - " \' ?5 p6 C% t l* L% b# D; J1 G
- (if (not 7 M1 J# [' F* l- D5 D
- (and " Q. U+ n& p/ p
- ss
) T" [9 y2 M, F$ _' N) H - (progn (command "_.select" ss "")
! T x4 K% L. d5 b p - (setq ss2 (ssget "p" '((0 . "POLYLINE"))));setq& M- F8 t1 o8 D X5 g
- ) 6 f" a; ?' W @ w% W# ^- L9 Y
- (setq na (ssname ss2 0)4 M2 O3 B: ~# q3 _3 x+ P8 R' X1 U
- e1 (entget na)
' V* H) n% W$ m, q - width_a (cdr (assoc 40 e1))
& \( W9 g( W' a/ h) j - width_b (cdr (assoc 41 e1))
* g$ v4 _! n, m& }2 A# r - );setq
1 A! s$ E9 s* B: h& z# M0 x6 W8 r - (equal width_a width_b)
4 z0 _9 o; S9 h+ }8 w - (setq ss3 (ssget "p" (list '(0 . "POLYLINE")
4 O/ }) ~* l, i* G/ x, q1 ?! a - (cons 40 width_a)
7 v6 f4 e |$ Q. n - (cons 41 width_b)
0 ^- C3 W `+ g* s* m( Z7 u) P - );list
& b3 g5 T( q; g - );ssget
# z' \* S$ F$ }; z2 y* g - );setq& Z; R$ J( ] [
- (setq flag2 T)2 u2 i& d0 }$ Z: B
- (equal (sslength ss2) (sslength ss3))
& x) K$ n* |. K; D- i0 Q - );and
O5 ^. E. ^% i2 u - );not , k n7 e7 q- ^5 O. W- l
- (progn+ {. C B* z$ h. C
- (if flag2, R/ [4 [% Y4 N7 [# U
- (setq width nil);setq/ `5 ~6 B7 {$ Z) t' _ o
- );if
! m! i9 K$ C3 s' @. M - );progn then3 j. p5 M& f8 }
- (progn( @2 m1 X4 }, E( N
- (if (or (equal width "")
# d0 h5 P$ u( y4 d" `8 { - (not flag)
. z U9 j5 q5 x+ ^% T - );or. X, h1 {' v) l, O! W
- (setq width width_a)
+ i2 `9 }" g0 a - (progn
% E0 @$ I7 h/ N9 {" y+ B - (if (not (equal width width_a)), i$ F. p5 f0 n" C& H$ n+ i
- (setq width "")) u5 o% ~6 Y( p
- );if ; B Y# V' l* U" E+ P4 p% q
- );progn9 C* r H3 D- k8 j! K
- );if, f$ ?8 O6 H, W; T% r' K9 z) N
- );progn1 J* k6 P, c: C& O. Y- X/ ^; y1 U
- );if2 ~: }. t$ @: x/ a$ n& S. w" H
- : j5 D6 t0 w. h4 N7 v7 e
k$ _* `; h; s- ;now for the special handling for old polylines, N# ^ W" R) G. F0 B7 F+ _% t& E; s
- (if (and width
6 y( g( y- o/ T - (equal width 0.0)) a1 O2 |. l( T ?( N" }1 n9 H
- flag2
/ z7 j$ n& T) v' n - );and / q+ H, |! C2 d8 h0 s
- (progn* _) ^4 h% H E( L! s8 x
-
* a0 a+ z- v% D" Q' d# r - (setq n 0);setq; R1 h0 h8 I1 _! y
- (while (and (equal width 0.0)
, ]9 x+ @3 ?& E2 K - (< n (sslength ss3))+ h+ i6 J. h$ Q) J
- );and5 B: |. E2 I( ~
- (setq flag nil2 Y( o! t# y3 s2 d$ y
- na (ssname ss3 n)5 v$ z; x8 F9 o$ H
- na (entnext na)
0 X! e m/ N! ^" l: P( ?& S" n - e1 (entget na)( o$ [8 ?% i9 U; L ~9 P
- );setq% g/ p) R5 q% h5 @2 d" e
- (while (not flag)3 V' s5 R& P1 G9 p% S! @& x
- (if (or (equal (cdr (assoc 0 e1)) "SEQEND")
- N7 m$ k+ Z$ s - (not (equal (cdr (assoc 40 e1)) 0.0))
0 M4 H! `* Q8 x - (not (equal (cdr (assoc 41 e1)) 0.0))5 X# q# K7 k' C) M' i' ], N
- );or
& C* ~ G. M* v. @6 v" ?$ ?2 {3 X/ z - (progn1 v) d6 x3 f% P: \
- (setq flag T);2 H6 c7 d' D( n- j' I
- (if (not (equal (cdr (assoc 0 e1)) "SEQEND"))
/ j" I$ X0 r' | - (setq width nil) ' w* ^* K% D9 S1 ]1 U
- );if* ]0 q+ f* W$ V9 e3 s2 s
- );progn then jump out of the loop
1 p3 E% W+ C$ Q5 H& g( X - (setq na (entnext na)
) X- B3 M/ V% U7 \/ | - e1 (entget na)( s, Y6 ?4 C# j
- );setq
' z% H7 e5 ~" n% G9 k" o - );if # G# J# M$ k9 J. k
- );while
, `% {: r8 O) z! H2 o4 Z& A - (setq n (+ n 1));setq ! L& h/ v2 O; e2 Z- w) J" [) p
- );while 7 V; e% S( P% e- {. _1 j1 [8 o
-
1 T& Z( J9 H7 C% p2 G - );progn then it's a legacy
9 K: \7 H1 B7 c5 f0 \1 ~* e - );if ;legacy polylines that may have varying widths " d- R l. T0 E4 ]
- * v4 {& M6 I( ?0 p- s
- (if (not width)
6 d# x+ l* s h# p4 I6 H - (setq width "");setq7 x" ~4 l; [. `* t# x+ y9 u* T
- );if
. z+ Y+ N4 C1 z - (if (not (equal 'STR (type width)))
) W& `4 c/ B% Y% L5 W* V% \- e - (setq width (ai_rtos width));setq
M# G1 c/ J# N3 e - );if % U) _- k+ u$ n
- 6 q% U/ }" ?/ d" M5 Q i9 |+ e
- width 2 Y& R7 Z1 x( J/ Q9 N& s
- );defun pl_width_getter
7 y/ c R% x a) j0 Q - 0 q+ ?8 |; ]2 \' S3 l; y1 u- S
- 7 q, \" ~8 x+ |- U6 t3 p7 F* ]. j
- (defun match-col (/ ncolor)6 u' z* k4 r2 P' o9 Q" `) m* ~+ r
- (setq ncolor (cdr (assoc 62 elist)))* V8 O- _' c9 {/ C
- (if (not ncolor) (setq ncolor 256))% ?: Q% Z$ O: I: J; W. v
- (if (/= color ncolor)* \4 l" j. Z$ B$ v5 O& _
- (progn
! o' n4 _! v4 k* M" [ - (setq chk-col nil)
. Y/ q- z& Z" u1 e, `* A" [5 |) S - (setq color nil)
: b' l5 p+ n8 P3 [ X- I# s - )
7 S* S2 n0 \. ?" b0 Q/ Q N+ }/ Q - )4 a+ Y, T- a7 L3 S! y3 p: Z
- )
& H5 G" i4 \, b: W! O' u - , J, U% G; A$ j7 w$ D
- (defun match-lt (/ nltype)
' T5 e! F1 t" { - (setq nltype (cdr (assoc 6 elist)))
5 t6 T3 L2 b7 o, O a& V - (if (not nltype) (setq nltype "BYLAYER"))
4 J2 A9 u+ M% T9 h R( @ - (if (/= ltype nltype)! i5 i* v5 n( x) D8 C
- (progn
9 P8 D I# P9 @( ~5 B - (setq chk-lt nil)" D# ]- u( Z! V- `: W
- (setq ltype ;|MSG0|;"Varies")
6 Z+ q! w; l" ] - )
" |: d1 P" |* M+ G! F - )
( j+ ^8 k$ B- G8 W3 {$ ]1 b8 o - )
3 V- o% F+ [3 s1 q0 ]
' {/ }; b: t2 l, u9 d* N- (defun match-lay (/ nlayer)8 }) n& U- C- I' [
- (setq nlayer (cdr (assoc 8 elist)))+ j" q, W2 K4 W) e, A" U
- (if (/= layer nlayer)
* ^; Q2 |8 g& z( j+ Q: |6 r8 j - (progn
; P/ Q5 }% X0 a; S' U - (setq chk-lay nil)
( F; V: P( Z5 U - (setq layer ;|MSG0|;"Varies")
; g/ ^* T& K7 g4 M/ L, m - )
2 a7 O1 J" T% }- \: s( u - )+ b9 y$ a7 T' ~+ U7 O
- )
! K& o0 P, k) }& l. ?/ J) d( f& ? - 8 ]6 O/ x5 w3 y
- (defun match-th (/ nthickness)
2 t' ^$ b+ Z; Z. a9 }: o; {+ ~8 J% i - (setq nthickness (cdr (assoc 39 elist)))* Z3 C; K( I/ L
- (if (not nthickness) (setq nthickness 0))
* K4 A4 j8 |( a: G, C - (if (/= thickness nthickness)8 X6 T5 C+ U& f1 b; V3 p
- (progn1 v( L. X; O( u& |
- (setq chk-th nil)- U# k/ v9 v4 ^; c
- (setq thickness ;|MSG0|;"Varies"); d( w3 X. [5 b/ H
- )
& p# ]9 F8 m2 Y8 H+ C- y' ] - )
+ B3 l# |# i& E8 u9 A - )
* s7 O+ x% g i: P& k: y - ! x( t1 [' M, T, o2 F6 n; ?$ c
- (defun match-lts (/ nltscale)
* ]7 ~$ f$ u; }4 ~7 D, a, o - (setq nltscale (cdr (assoc 48 elist)))
% ]- c" b9 w1 F) Q8 ` - (if (not nltscale) (setq nltscale 1)): w" V. G0 p/ E6 E3 j
- (if (/= ltscale nltscale)# c" ?% d+ R; K+ H
- (progn9 b u' n! D5 c# y5 }( T
- (setq chk-lts nil)0 c4 P3 d4 p O/ Z$ f
- (setq ltscale ;|MSG0|;"Varies")% R& U& K; K2 e" T
- )2 Y. G1 n X/ f: ~( `7 k, X
- )0 U+ t- U" L# v- H! y
- )1 B* \" ~( s3 Q! C
- 0 o% U. x0 T+ E0 o4 P
- ;;) c2 Q2 u0 T7 {& p: @! b t
- ;; If an item is a member of the list, then return its index number, else7 g. ^' P4 g, n4 l: S* u1 }8 H
- ;; return nil.
/ O' k1 C! r2 |* n - ;;
8 D: l) e. S( I" ?5 f: l - (defun getindex (item itemlist / m n)7 G" M2 ? Z+ r7 m, T
- (setq n (length itemlist))
# C/ T: a# W3 f8 \/ u) s( \, w - (if (> (setq m (length (member item itemlist))) 0)
' O+ j& d& s H/ B" m7 E - (- n m)
3 Y2 o/ t6 A0 l/ K - nil
. t c2 a8 Q, }% W2 [ - ): a. }7 s3 J [& q$ k$ G' \0 G
- )
3 B' i D7 E @ - ;;
( y% R2 F* }: N T - ;; This function is called if the linetype is set "BYLAYER". It finds the
; X8 J1 J( N6 M7 Y1 r - ;; ltype of the layer so it can be displayed beside the linetype button.9 B' P) W6 Q: Z8 p0 o
- ;;1 g, Y7 V2 L8 _4 q. ?
- (defun bylayer_lt (/ layname layinfo ltype); Q$ M8 L3 Z0 W5 Y( O; X4 b5 h! N
- (if lay-idx. [2 s; e* Z7 s0 u! X" N
- (progn
+ E6 v8 M$ U* y5 v2 z$ Z! L$ t3 h7 f; v - (setq layname (nth lay-idx laynmlst))
# U u9 ?& Y- ~ G( z- Z - (setq layinfo (tblsearch "layer" layname))
% {) }# L1 M2 S1 Q - (setq ltype (cdr (assoc 6 layinfo)))/ m: h1 j, O% a
- (strcat "BYLAYER" " (" ltype ")")
4 Y B& S# m6 f - )
7 e- C* y$ E+ e* J/ K - "BYLAYER"
3 @" @ w* r! a8 y8 F: c9 E - )
% e6 U. q- I3 T - )* _ S& U1 b' m6 C
- ;;6 Q5 J- J8 d. m1 e6 n% _7 W
- ;; This function is called if the color is set "BYLAYER". It finds the
6 q; a9 q, ~1 _! x" w. e - ;; color of the layer so it can be displayed beside the color button.. N9 a1 z# `: s1 u8 d
- ;;% M' |' Y# g @/ m7 Z6 t
- (defun bylayer_col (/ layname layinfo color): [" W9 O: D) w
- (if lay-idx
7 q1 G% P, }0 N( {2 E - (progn
' ^( W% G2 i* b# H! y4 w3 t - (setq layname (nth lay-idx laynmlst))0 b; F5 H5 j' r
- (setq layinfo (tblsearch "layer" layname))9 S8 [3 U8 v: B( k, |1 S
- (setq color (abs (cdr (assoc 62 layinfo))))3 v' u2 |( a Z2 F- Y8 l
- (setq cn color)1 \! L8 M7 C% o) @2 g4 g
- (strcat "BYLAYER" " (" (colorname color) ")")
9 g* `' u6 c3 U1 M: V! w1 A" r' o) ? - )% Z2 O6 C: I2 Z. Y8 X6 D
- (progn
. S! w) h( ]9 f6 I8 l3 r; _ - (setq layname elayer)8 d- [8 T& H3 G; N8 B7 p! S& Q
- (if (and (/= elayer "")) f! e% j) ]7 A" H. M l4 o8 q0 J
- (/= elayer "Varies")- q* w9 ]! @' R! q- K
- );and
4 Z6 u" p# } J3 }' u* b* a8 X; R - (progn
4 j" t+ d3 J% T - (setq layinfo (tblsearch "layer" elayer))
+ S0 H( a$ V1 Z7 K# w# [ - (setq color (abs (cdr (assoc 62 layinfo)))); v" n- I, C F6 m! f/ I( N
- (setq cn color)0 T$ l u9 g0 [8 B% S
- (strcat "BYLAYER" " (" (colorname color) ")")% v% M/ q$ t6 n1 m# @$ [! Y
- )
. u* a! a% w7 m+ j - (progn' |/ |9 a4 @1 U4 w1 R' p! P
- (setq cn 0)* R! z' O2 J$ f( N4 t* l- G, l) W3 [: G
- "BYLAYER"
5 `2 [9 v; \. l; A4 ?0 B0 j - )
7 _- m d, C( {4 } - );if
) u% v4 N1 S7 v: {% C% N - );progn
, Q! j; M1 c% v+ V - );if6 Z, Q; w# o0 U( v# L+ f7 m
- )
5 g/ y' Q: H; w* |2 O3 q O - ;;
/ r2 a& f9 ~) z8 D: _& X8 B - ;; If there is no error message, then close the dialogue5 @( x% |$ B' S6 }& \' F# s% a1 ]
- ;;# R# ]2 V1 \5 W
- ;; If there is an error message, then set focus to the tile' K- [8 n% I0 G. k6 q4 V. A) O* n
- ;; that's associated with the error message.& ?3 X6 O2 y: Z" V( j! S5 P7 J3 ` Q
- ;;0 F1 b! p e m
- (defun test-ok ( / errtile)
7 _* o [/ S' ~2 r6 J, C3 @: c. u - (setq errtile (get_tile "error"))
: q6 F- _& R) a - (cond
& l2 s# W. ]6 q3 _* R - ( (= errtile "")
& X. _6 z0 m+ _# y8 R - (done_dialog 1))
# k; E W( \& D5 X! O, ]4 ` - ( (= errtile "Invalid thickness.")1 c8 z2 Z2 ?4 b) e
- (mode_tile "eb_thickness" 2))1 U* r' J; P$ n% L3 P
- )4 M; C' W9 l, R4 h. U' i p9 a* _
- )
% M" {3 _' o3 t' B - ;;9 S: Z& k: k0 B3 ^
- ;; OK in main dialogue.
1 `5 d0 r4 w, H: t- N- n - ;;. [$ X0 `- ]7 o8 q
- (defun test-main-ok ( / flag). x. j( U' Q( j( q; M* ]) Q1 Q
- (setq flag T) 1 f9 r7 `/ E' E- M: A% ]5 F
- (if (not (or (distof (get_tile "eb_thickness"))# w: F7 g7 F9 L
- (= "" (get_tile "eb_thickness"))
3 e' k4 Z [4 F9 G3 C! [) ? - );or, I" {" s0 c% K n4 O9 c) f# _
- );not
: s& S' ?. W" ~' K- L - (progn
- h$ X6 \) ]. I/ L4 N - (set_tile "error" "Invalid thickness.")* L: Y( j# ?9 n7 l8 V3 @. x
- (mode_tile "eb_thickness" 2)- u' y$ D& G( H. R3 v9 _! ~ R
- (setq flag nil);setq
' B' z0 S. W2 q5 ?/ @$ _$ H - );progn" ^/ A0 | c& e1 s0 N2 @" u
- );if3 j1 N! j% Y/ K% G
- (if (and flag/ _: }7 u P3 I+ [) \
- (not (or (< 0 (distof (get_tile "eb_ltscale")))7 |/ C4 K2 e0 O8 s
- (= "" (get_tile "eb_ltscale")), S) `( s: r* F' L! f3 x: R4 Q
- );or 7 s& q. e: E( x; h
- );not+ E, \3 Z& u( U$ _3 @
- );and ; ^5 Y7 A1 u E; y/ x3 O9 t
- (progn* Z9 X O9 d; Q6 w# O K
- (set_tile "error" "Invalid ltscale.")0 r4 J* L/ q: X# T3 v
- (mode_tile "eb_ltscale" 2)/ ]* ?9 i" e9 j+ w. ~ j a
- (setq flag nil);
2 C- R3 J5 f& a. L; C - );progn then5 W5 k1 X& N P/ H' _: ?
- );if; x& b$ s; T6 i) u2 z
- (if (and flag* z8 o3 v- O1 p+ Y5 y
- ; Don't test the tile's value unless it's enabled.# m* @$ }& h9 n$ {+ f3 G
- ; We're not set up for the display-only value8 U5 g% N* E: G' k* ]
- ; of "" here in the error handler.
+ Q; a+ F: q& o& P* U- z - (= 2 (logand 2 eflag)): ^' _9 r; o. i- @" E% Z/ v6 s! w* J
- (not (or (< 0 (distof (get_tile "text_hgt"))) ]9 o, c* ]( ]: k
- (= "" (get_tile "text_hgt"))% P4 k, I6 p. q& V9 V/ A
- );or
0 K% k) l' Z' C! o! w - );not
) V% M* q& J7 n5 Q - );and
! s* G+ Q H" j- B/ [4 q8 d" _ - (progn/ V! K2 K7 M# x7 ]0 Y) P
- (set_tile "error" "Invalid height.")
7 ?. n* r3 H- Z - (mode_tile "text_hgt" 2)0 @( H, N. j7 U1 `" ?; G9 F
- (setq flag nil);
+ f+ u1 f/ g5 G8 e2 o( C- H9 ~) } - );progn then! E- _4 ~5 a8 _+ e
- );if' m* H# q7 Z1 ^' X4 w, ~, I2 [
- (if (and flag+ v- c/ g) l. C# m, ^
- (= 1 (logand 1 eflag))
, D! a4 W7 F2 p" i! b' a - (not (or (<= 0 (distof (get_tile "poly_wid"))) F# c* N6 p( V1 i
- (= "" (get_tile "poly_wid"))
' h% E9 C7 [, `2 I: \ - );or8 X" ~" b Z1 N8 Q8 `
- );not
5 X9 a. P& E8 @3 s/ Z. @ - );and
0 k9 r/ Q2 S3 \* d' f3 D - (progn
& ?2 F2 d5 L8 S& t# v - (set_tile "error" "Invalid width.")9 @3 ~7 K: T# d9 P9 B `
- (mode_tile "poly_wid" 2)
& |, b' M* X/ I( r% X! \ - (setq flag nil)
( X2 p. e( p) h6 R& g - );progn then4 \ Z& H4 [! P9 _$ L- x6 ~/ |3 y
- );if " x" H: Z1 D! {# _! `6 c
- (if (and flag* a; ]7 n2 N5 v9 X7 C$ r/ T
- (= 1 (logand 1 eflag))! h" w* _1 v! B# q
- (not (or (distof (get_tile "poly_elev"))
B# v. A" o* n+ s8 c, z# C7 Y - (= "" (get_tile "poly_elev"))! l6 v6 M, r8 D) F
- );or
Q+ n h; E: l e) g8 e - );not
! r* |, f7 K/ l# [7 B8 [% |9 b - );and% n6 [. x _$ c5 U) \, j# ~
- (progn
: j( L* l+ n7 l+ u - (set_tile "error" "Invalid elevation."); [" O; U) ?4 R l; Z6 t- m* a. Q
- (mode_tile "poly_elev" 2)
, w' W$ {- o9 D, ]4 j5 e6 h - (setq flag nil)
% U: B+ q- P% E; U; Q5 t8 e7 U - );progn then# s4 {5 @. e( G
- );if ) x) C& Y6 S6 f: ]) `/ ]
- (if flag 2 | x5 Y! o, X$ ], z# o. i
- (done_dialog 1)
9 v$ J0 \- K+ r6 @ - );if) [) x! @* r" R ] V6 O
- );defun test-main-ok6 E5 _" B# s. q' j2 f T- Q
- R% @1 q1 h& Z; j
- ;;: r" r6 N* S& k: P' E7 _
- ;; A color function used by getlayer.
4 ]% X' O4 K. y. a - ;;
' T( _$ b4 ~- W3 x2 p - (defun colorname (colnum)& v3 w6 i8 v! N: }% E3 `4 J
- (setq cn (abs colnum))
# p- e4 U: b2 C& @ - (cond ((= cn 1) "red")
, W* k4 ?3 {6 i; x; z- s3 V - ((= cn 2) "yellow")
$ g% | t _8 A! g - ((= cn 3) "green")0 W& A- p8 R+ e/ m' E5 B/ k: R
- ((= cn 4) "cyan")+ Y- S0 c3 I* q' p( s
- ((= cn 5) "blue")
- W& |, b* Z5 d- q - ((= cn 6) "magenta") m/ t/ Z ?4 }: M* i8 L
- ((= cn 7) "white")$ \! `* U7 |5 c4 d- J
- (T (itoa cn))
' s3 n5 Y* S: X8 v1 J& j R$ t# X - )- _5 J9 }& ~' Q4 U
- );defun
& m4 n: x& X1 v8 A& i/ W* m
! D. W r/ Z1 A) o8 M- ;;; Construct layer and ltype lists and initialize all
) t" e% B) Y9 R1 X2 z6 { V7 C! Q: O - ;;; program variables:+ W. }/ ?- X u* V
1 H4 M( B6 {* J+ c' y- ; (makelaylists) ; layer list - laynmlst
) r/ _) q. m7 ]1 ^" | - " u. G1 v9 E0 Q& V3 a1 J: ^2 c6 u
- 5 I6 l7 G: @* | k/ g; v B5 g
- (makeltlists) ; linetype lists - ltnmlst, mdashlist
# v0 g& r5 E, ~5 X; j
X$ d8 D0 T9 s% M% T0 K- ;; Find the property values of the selection set.
3 ^5 y& Y: n* N8 s/ M/ [# [! u4 c. Q - ;; (getprops ss) returns a list of properties from
% A! I% e" P8 `) `4 r8 s% | - ;; a selection set - (color ltype layer thickness HEGHT STYLE WIDTH).( j0 A$ B) \/ J3 P
- $ O) `* b! x+ q$ S r, g% [
- (setq proplist (getprops ss));@rk interesting things happen here
% T$ h8 }7 Q; H* i$ w- M! a. M - ; C( r: _( p% @& _
- (setq
" s2 X/ o% ^$ { - ecolor (car proplist)6 Q. i) u* I5 r! p) A8 q
- eltype (nth 1 proplist)
c4 I3 l: M4 @- _& _( P) C - elayer (nth 2 proplist)) q, R. {) ?( E, R4 ]2 L; v
- ethickness (nth 3 proplist)) A+ J& w" {& Z
- eltscale (nth 4 proplist)+ j) N$ T# T9 Q5 w$ ]
- ewidth (nth 5 proplist)
1 k) T" c% ~4 X) D/ C- q. K' V2 t - eelevation (nth 6 proplist)* ]+ s2 `) L. Y6 l: ?
- eheight (nth 7 proplist)
; m$ P) L& R5 C8 | - ;etype (nth 8 proplist);commented out and replaced with the line below. RK.
) h9 V7 f; ~5 A1 z: h3 s9 | - eflag (nth 8 proplist)
5 V8 P: i$ {2 w) w9 J - estyle (nth 9 proplist)# ^; f1 J' g! G" z! O5 E5 Q
- poly_ss (nth 10 proplist)
* f: ]) s& ^0 x0 M7 ` - txt_ss (nth 11 proplist)# H/ t1 S; o) ]7 r
- );setq
/ q1 h$ X8 i/ B3 @% d2 m' V3 z - ( h+ K+ v5 d* m: i
- ;; Find index of linetype, and layer lists* z2 a: W- ^( d
- (cond8 D! n2 X$ b' }( I1 z8 @
- ((= eltype "Varies") (setq lt-idx nil)) U3 k! H [7 \8 o
- ((= eltype "BYLAYER")
) a- @/ {: Y- d, k: d& ]# X - (setq lt-idx (getindex "BYLAYER" ltnmlst)))
$ ]( w) z/ R4 [ - ((= eltype "BYBLOCK")$ B. Z/ k' @$ b$ K. c3 y2 A
- (setq lt-idx (getindex "BYBLOCK" ltnmlst)))9 z F; k" |! p7 l% j% U! I
- (T (setq lt-idx (getindex eltype ltnmlst)))1 r; D7 R" X. {% v
- ) T0 o. N1 }% b
- (if (= elayer "Varies")
' P3 e: K4 H7 X - (setq lay-idx nil)
% }- s$ x) i: F; v% l% A - (setq lay-idx (getindex elayer laynmlst))/ e+ {2 p2 u b% }" n. e3 Q" n
- );if- @( {# _ W* H2 |6 X( k+ e& H
- (if (= ethickness "")/ @7 H% h. Z8 @' \# h
- (setq ethickness nil)
' @* I3 `$ E; }0 A9 y N% ]! D2 ^ - );if
7 S0 M% ` g. {* H - (if (= eltscale ""). U0 Q7 ~3 X K y) {7 {" |- F
- (setq eltscale nil). \7 X, g8 h- ^/ h, [& d3 X/ D: t
- );if
1 ?- b" M' q0 y: \% q - - M, M3 B9 S- `: C/ k. {, K7 Q: M
- );defun ddchprop2_init ; end (ddchprop2_init)3 z. ^$ Q3 z* e: A7 p+ ?
' Q& w4 c0 _$ w7 h/ _- ;;; (ddchprop2_select)
S- U* K- V; {1 F - ;;;
6 S6 h& y; S* P& k4 G( D - ;;; Aquires selection set for DDCHPROP2, in one of three ways:
; W* }3 h4 y7 l! G, K - ;;;
: F5 D# c3 B6 f2 _, Y a - ;;; 1 - Autoselected.+ B; n6 l! y& I9 G
- ;;; 2 - Prompted for.$ u; C8 _7 L6 O& k/ N' N7 e
- ;;; 3 - Passed as an argument in a call to (ddchprop2 <ss> )- T2 a& v' l6 J5 d" A0 {4 G
- ;;;
1 U3 z; ^/ B! S - ;;; The (ddchprop2_select) function also sets the value of the: Q% ]; {' a! r$ b% H; {4 c4 ?1 P+ s
- ;;; global symbol AI_SELTYPE to one of the above three values to' _: r# O; |& {5 ~
- ;;; indicate the method thru which the entity was aquired.
1 a% J, g; j+ |$ B
$ k8 m- _9 G8 f
" v! R+ H$ Q% L/ q5 D j- (defun ddchprop2_select ( / )
/ ]. j# r8 p8 L( Q' }# H - / ?, U- ~% I5 c# Z0 g# X3 h
- 1 X. |' d' [4 G, E' g
- ;returns only entities in ss that are in the current space.
7 N T( v( y' ~2 ?+ P - (defun ss_in_current_space ( ss / a cur_space ss2)8 {3 b+ T" r+ w" |8 C$ }+ A
- % ?/ D/ I' J; _8 V+ l2 Z4 k- m
- (if ss
1 t2 w" v" A f: ~ - (progn) O; V; e) U4 H; T. ?* U
- (if (and (equal (getvar "tilemode") 0)
$ K. c* y4 W" ?! s3 Z& R - (equal (getvar "cvport") 1)$ w$ Z- h7 T- L- `* {- ~
- );and ( g! h# ? C6 ]( H
- (setq cur_space 1);then paper space is where we are.( [9 S% ~2 P! r T4 }3 S& O) Q$ f
- (setq cur_space 0);else model space. t/ }" j; e6 r9 i3 R
- );if
3 R/ Y+ X' q) s b$ _% J - (command "_.select" ss "")9 z v+ e4 E: T/ z$ c& o Y
- (setq ss2 (ssget "p" (list (cons 67 cur_space))));setq
3 `! k- q; n4 R5 q& b4 |% C - (cond ;;;;;tell the user what's going on.4 I3 x) ~" {* d/ L1 b
- ((not ss2) (princ "\nNo objects found in current space."))
, u" C# |9 ~: J1 ^" a+ P0 X- U$ P- i - ((not (equal (sslength ss) (sslength ss2)))
( Z; h) ~0 u& N# @# F - (princ (strcat "\n" (itoa (- (sslength ss) (sslength ss2)))
0 s/ o- l; B) [0 t# X2 W - " object(s) were not in current space."
% `8 _' D9 J" O2 m4 s! F8 f - )# V9 ^3 n- \% N" ~
- )
2 v: G. F; H% T' M8 H) l1 X - ) + v; v5 ^! C8 f: \% H) Q8 m# X
- );cond
" N$ U3 I `) v6 x" Q% R$ ^7 X; t4 r - );progn then% M. Q* V! w' g& O+ C4 ?
- );if
0 X5 S/ ~: x4 I( r/ s - ss2
0 ]% I; Q. O* i1 D* ]% c3 j - );defun ss_in_current_space
5 o/ \, q( Y& D5 J9 x: q; Z
; ?* D1 L! V, n3 ^
% c" u" |' g' J8 {$ M5 X5 }- ;;;begin the work of ddchprop2_select
7 w/ U R* P7 t5 B9 {3 F2 Y; a9 |/ B -
# o0 e- ^! b" o: y4 z! ~/ l4 e - ;; temporarily restore original highlight setting.7 a3 V& h; v% a# ?: G3 e1 x) Z! J4 S
- (b_set_sysvars (assoc "HIGHLIGHT" (car bonus_varlist)))
, l; \- f q3 F/ u$ J! J - (cond/ H( A3 ?! O ?6 e$ h( G: B. z
- ((and ss # A+ d/ L. Z* W1 a+ S
- (eq (type ss) 'pickset)
4 o3 b/ |! J* n W5 V8 z) s5 U - ) ; selection set passed to$ J7 Y" w: ] c& V
- (cond ; (ddchprop2) as argument
+ H+ ~) }) V! k( C4 l' u) T - ((not (zerop (sslength ss))) ; If not empty, then
7 x4 J$ N; ^; {+ c6 U9 \. [( N' Z' v - (setq ai_seltype 3) ; then return pickset.; V. I- `* y1 s% P9 a) n
- (ai_return ss)
8 |8 T$ A* y; M - ); y, ^' Y2 f5 d" q" T
- );cond close5 R9 U7 R. O" L4 C( h+ w* l
- );cond #1 y, P; Q0 N! L5 i3 d+ j% L+ z; v
- ((setq ss (ai_aselect))) ; Use current selection
3 }% V* ]6 O* N1 F! R: m - ; set or prompt for objects
8 A* T+ s+ r: f& }8 u - (T (princ "\nNothing selected.")
* m# k+ N: o: Y5 w+ ]( _( v - (ai_return nil)5 T7 B- O* `2 I% W
- )
& L9 f, b6 v- h7 U" a# r - );cond close
% U Z" a B7 j& B - (b_restore_sysvars); s% `8 D$ x3 g
* U; i( P8 S; B/ R8 _4 P( T- ;(if ss
$ s9 B9 H( e. e - ; (setq ss (ss_remove_locked ss)) ' I d9 p+ ~1 A8 T
- ;);if8 G1 J( P" G; z3 e- [4 Q) s9 f
- (if ss
3 ~- n1 F) A2 }$ I' P. ~- [ - (setq ss (ss_in_current_space ss))
5 r( s$ a8 l; w/ B - );if2 F% `) `/ b0 e! v0 \, Y6 {
- ' l( R: D b+ h5 Y' {
- ss
# i8 d9 d- _3 M - );defun ddchprop2_select6 ]6 f% V& |, ^; H6 N$ k
( v, g4 r5 \1 @& m j( \. W- * H; [0 e. A" [
- ;;; Define command function.
. R# z! _1 a( z; s - (defun C:CCH ()- u* G, q9 @3 s! y7 X" o+ b( E1 G% V
- (ddchprop2 nil)
6 t' @- Q' D# h2 u3 m- b - (princ)* ?' w- o0 G! I# ]
- );defun
' b. V2 m- X5 f! U/ n- F& [ - 6 W: ?! @8 `+ M# T1 G
- 7 e' k6 N' F0 M& D
- ;;; Main program function - callable as a subroutine.$ m7 N; y3 z+ V, ~5 L
- ;;;
9 S) H; ]( Z0 G ~1 ~8 U% R$ L - ;;; (ddchprop2 <pickset> )/ z1 X! {) w3 ?# C: [* A0 f
- ;;;
' {: g6 p, U4 R, s - ;;; <pickset> is the selection set of objects to be changed.: j/ w" S+ I' t
- ;;;& b* X6 I! ~' A* V* t
- ;;; If <pickset> is nil, then the current selection set is0 o$ Z& {0 l! Q: D% y+ I; S
- ;;; aquired, if one exists. Otherwise, the user is prompted
$ k5 a8 W7 c4 n' P - ;;; to select the objects to be changed.- S, Z7 T$ I( H F! Z* ]' k2 C
- ;;;
- U; O" H! \. k7 t" T% c - ;;; Before (ddchprop2) can be called as a subroutine, it must0 n3 G3 u& l; Z% P$ O
- ;;; be loaded first. It is up to the calling application to% u3 F2 O% c$ i) x6 U% b# J
- ;;; first determine this, and load it if necessary.0 ]/ f- C% t3 {% p# j
- % V' b# y. [/ K$ W6 v
- (defun ddchprop2 (ss /
8 X) I3 E! v: M- g, g4 C; u
, C) g1 w c' v2 T% O5 E, L- a
. T Q7 s4 D8 N9 M7 p - add-mdash: c: A; ^ R/ s8 z: c. c! e+ P9 i
- assoclist
8 k0 b$ {) ~+ a4 _( c; x6 J& u o - bit-70: P% g% V- q# ] p) d% }6 K0 T
- boxlength* ?! {5 o6 U7 T$ Z% A
- bylayer-lt8 {" z) n7 @6 V5 J. e1 \0 v
- bylayer_col8 e* L" r% H9 u4 F8 S
- bylayer_lt
/ e$ I8 H+ U0 g5 a+ i9 V5 H - call_chp2
4 t- C/ W+ \' k, e3 c. {* n) ^ - chk-col
3 z7 ?% @# @' c; o - ;chk-etype ;var removed by rk . K1 G% h9 o& R4 t, c3 M8 V4 `' k& `- e
- chk-lay
+ B7 W$ R3 c4 ]7 R8 X - chk-lt. T: w. } k) X
- chk-lts ;var added by rk
* E. U' F# m6 i" q2 v* Z - chk-th) Q1 o* [7 ^6 \) _3 m' N: f
- cmd
2 ^% Z* |/ r: G3 H: W- _( y P9 m - cmdecho Y, b# b; s% O, W* D% B' I
- cn% j+ L) a$ q! H
- cnum% F: }9 d/ P9 C+ \; ]( h: N
- col-idx; I/ Q- |7 ^7 U7 C3 b
- col_def; I; P; b2 \( t/ r! F" v/ `6 d% m f
- col_tile
9 W/ L! B( L9 c7 X# w - colname/ x: E7 q# [8 Z
- colnum
, q7 y9 o o u8 [5 o- m - color
' q5 j4 c; ?2 X! p' O - colorname
. [4 N; }# h, C$ N G - cvpname1 {1 ^7 n: F! U
- dash
7 ~: o7 y1 [8 a0 D8 B - dashdata
$ }; ^! z5 ^5 G- h - dashlist
+ x G( ^( `1 J* r# s - dashsize Z0 o: D$ _; ?$ @) e; p! G
- dcl_id
3 ?! [" E! A- I - ddchprop-err
# x! }+ v# T9 P% U - drawpattern) S/ ~2 a3 T; [9 {) x
- ecolor' f0 _! V# }. K
- eelevation& A7 U0 ]# ~* m2 y% H
- eflag; J: d( k$ w6 u* R7 w$ c
- eheight5 Z4 ^% f* w0 [ C3 i) ]
- elayer5 m# _9 l& U9 D
- elevation) U8 M0 U, Y# [; v( @0 y) }
- elist/ d! ^1 {' A" @( A1 N
- eltscale
) f2 i- L) y; x, f, b- W& J& ` - eltype3 x" |+ c& H1 F
- en
/ W% M! V" l( ` - ename. M% b# D4 ~. a/ `3 V$ Y+ ^- I( l( R. @
- ESTYLE ;var added by rk" n T9 r: B& k# n+ h. P9 A2 B" Y
- ethickness* t4 g( A# R- V/ _+ k( h, q1 z
- ;etype ;var removed by rk2 k9 R9 s5 c$ W, J) K) c/ y
- ewidth4 `4 ]8 `( k' e( g! s9 f0 C& O W
- fchk
+ T& @5 L4 P9 y/ v, f - frozth
! e* Z' N! D; K9 l6 t$ T - fx! N2 m6 h- R1 T8 C) i: z
- getcolor8 }! n- h- ~7 T+ c# ?
- GETELEVATION ;function added by rk
6 @2 j( B9 T' B - GETHEIGHT ;function added by rk9 o; X7 V9 G$ F7 s, ^$ S* A
- getindex
: ]1 |- i8 C: K, y. c# R: v) } - getlayer6 F0 c: V9 j5 x" _; L, y
- ;get_locked_layers ;function added and then removed by rk
2 v" a$ p& ?- l& b, P - getltype! i0 v+ }: U" _
- getprops) c! [7 r( u) a6 m; D4 {) |+ D5 R
- getscale ;function added by rk! l* Z% ^$ ], {
- GETSTYLE ;function added by rk4 V- }( \+ d5 |: q- F
- getthickness/ G# H/ \. k! o' P
- GETWIDTH ;function added by rk
" j( l" ?* Q1 k/ ?7 C - globals
+ O7 W# |$ w( {4 h1 ? - HAIR_STYLE_LIST ;var added by rk
" c q, A9 `. Z/ Q2 Q - height
+ p5 A. z7 V0 V/ f( k: C0 ] - index
" n4 d+ z7 E" } - item) h7 g# ^- s3 m( W7 D% F: v
- item1
- w3 U1 A/ |2 _8 b% S7 {1 @* p - item2
: G$ u+ F8 @& X+ T - itemlist6 ?/ H D1 P |6 N2 l% n5 F
- lay-idx5 x! x3 ], E) s; G
- layedit_act
; x8 W7 H3 O0 _/ K# }5 w7 s - layer) v7 C/ \" ^1 {. \% f
- layinfo
( F8 [4 a! y& c3 v o5 B - laylist
4 D9 y8 @) g* d1 C3 _4 ^* c - laylist_act# c+ E# Y4 N, }; R+ @1 L
- layname
% F5 ~( M& A* n P5 j0 R: p - laynmlst
5 \, Q1 w8 b' j {; V% `! I - layvalue0 {/ g/ V. o# x+ ?$ M) x- Q
- linetype
" ` T+ H8 ]' p* _ Q - list1
' V8 U! ^1 \3 x; P - longlist/ t! ?2 g# ? ^; w
- lt-idx
* m+ e! A: I. ^; t4 o/ d - ltabstr* O" f" x) H# z: ~/ g2 G
- ltedit_act
0 |0 U& u! T! u. k. Y- ^( B - ltidx6 H% M( l! N4 ^5 i, B- H) R
- ltlist
0 ?5 e3 w& P4 u - ltlist1& o3 K+ h" z- v/ X
- ltlist_act
0 J1 {$ N7 J/ }8 x' K - ltname2 t$ O- s. Y0 `7 j
- ltnmlst* s3 }9 y% X/ ?/ v: ]
- ltvalue% u! T' N8 [5 c, U* A6 l: ]2 f1 F
- ltype- U3 ]* M" z0 `6 f
- m" s7 C% |- ]; g2 F
- makelaylists
1 ]1 |! x) N0 u3 j( X9 m8 n% X) u6 n8 M - makeltlists" S+ b' E9 M0 F( W+ }6 h7 C
- match-col6 M# j' Q/ z7 r
- ;match-etype ;function removed by rk
* F- M. Z# q0 L! e" M4 h5 F) w8 \2 U - match-in0 h$ W. @& }4 M, g7 a
- match-lay
: Q" m0 a& B" e# m - match-lt m: _' R$ c! r) F/ `5 W
- match-lts6 K, y& m: j, D0 S
- match-th
9 X( V( e, V# t* S5 }' s$ p - match_col
9 L) x% w& T3 \; g' A. O m5 L - mdashlist/ k/ U3 u g5 l6 f3 v- E1 g' G o9 l& z
- ;MPOPLST ;function added and then move to ac_bonus.lsp by rk# ^9 Y5 w( C5 }) z3 u# M9 {
- n' _- ~6 n/ e8 D+ c! p: V: H t
- name) @4 f# W0 f1 ~( S" A
- ncolor
8 X& G; i6 Z5 I" D+ `4 w g - nlayer# ?; N( Y9 G+ w% ^+ r
- nltype
X/ D& n' [) e! h8 n - nthickness- R7 \" M8 b, Q! T
- off. { e& I5 D- A2 A( O
- old-idx' I7 c7 {. W$ w* e {
- olderr# r6 Y/ b+ D2 l+ E3 N& C: J( j
- on
6 ?2 R) p# ?# Q) a7 y. O - onoff" P/ _& X) O8 J6 T% Z% i
- patlist& o0 t0 h, ?! ?' F
- pattern
( R1 |% }# R& W; o7 d4 q" w - PL_WIDTH_GETTER ;function added by rk0 ]8 x# {( P# e& s. O9 D
- POLY_SS ;var added by rk5 F0 a5 l6 x& e) `
- ;POSITION ;function added by rk and then moved to ac_bonus.lsp
& Z+ J- r5 ?2 \ - proplist
( X( Y5 S! _* t1 u - reset-lay
8 O4 j+ K# q/ F: `- m& _- v - reset-lt
& e) ?& @5 Z% J7 C: w- { - s; {6 }0 j. e7 G4 U
- selset1 _; c5 K. X' J+ e0 ^, p
- set_col_tile
M3 ?" y2 j$ A" v - sortlist- |6 Z& u1 p4 K ~$ m
- ss
6 B( b. _4 P# O( X$ F - ss_in_current_space ;function add by rk., j; u: k5 ^5 N% m
- ss-index. W& s A7 ~! G g, a5 E. c- A; F
- ss-length9 g1 P/ r; f% v" P* \7 K
- ;ss_remove_locked ;function added and then removed by rk.5 c1 ]# [- `3 V( r
- sslen4 O" P' n* j6 P: f. q
- temp_color
# }4 f* c2 `. t - templist
$ y* U. m. e9 Y! g9 N - test-main-ok
& _" k# t3 U3 s2 l I - test-ok
# s* q% @3 Q, A$ ] - testidx
i+ S. z* q+ B) I+ y7 A - testlay
$ a2 m! ?" i5 g# e* _5 n2 }) u - th-value
# s' b: R( w% K) j1 g - thickness
/ b% Q8 a. r0 U) E - tile
$ t' @; g- Z. o O' a - tile_rect
0 V F1 q& D8 e; v K/ u5 s/ { - tilemode
2 V9 W# i" x% e `5 `) R - ;TNLIST ;function removed and moved to ac_bonus.lsp by rk! y" b, e3 U2 x9 Z
- TXT_SS ;var added by rk
# B2 F) H) t! ~7 O - ;undo_init ;removed by rk.0 x5 u" ^3 {) o
- vi/ i& i) L& R6 { x* L
- vpf9 q* d" B2 \) q7 k' H
- vpldata( K) Y1 _" {' [
- vpn
3 p3 b/ X0 |& t \% i$ [3 h* ? - which_tiles- l& d7 w: ^! x" z: z
- width
) O) ^! |; c; z. r - x( R2 [4 v' Z; X8 u! _& E7 e
- x1. T$ h+ v% A3 Q; p
- x21 F5 M+ W( ^* o5 _+ N2 |
- xdlist
' B+ K& N2 `. o1 ~$ h0 Y - y
8 n4 F5 P7 A: t7 {/ @* ?/ I - y1
5 z# N/ {# x" l. b( ]; [, D - y2/ Z" @* S% E: o
- )
" F; L' U+ ^' z' J3 Y - % P8 H# T3 n7 }/ y" ]: w5 J
- (if (and (not init_bonus_error)
5 D1 ]3 d4 n3 G, k - (equal -1 (load "ac_bonus.lsp" -1)) ) [; [5 z' R8 ] M
- );and
/ a7 \+ h" }* C7 F - (progn (alert "Error:\n Cannot find AC_BONUS.LSP.")(exit))8 E' l( N% _3 \7 W& K& h+ C
- );if
0 t9 q0 N+ Z7 I! m3 C5 Z - (init_bonus_error (list
% }3 S, u! d9 r" k - (list "cmdecho" 0
9 r" {' K6 B/ u5 m+ L$ B; @2 ~ - "highlight" 0) n4 o0 X* i/ d3 c) z2 t1 s
- "regenmode" 1: u4 Z4 q2 a; g% l* l7 Y: i
- "ucsicon" 0
3 y: W* s; H* e1 m0 @- f! ?" ~ - )
# N9 O; G, N- ^6 }* g - T ;flag. True means use undo for error clean up.
. l1 ]# E9 C) Z2 g - );list 7 D. D( j, c- z7 a3 }
- );init_bonus_error
2 _- L4 F" k1 ^' a# e' I
: G1 ~8 v, z3 w6 Q0 ~' N8 P/ h# x( D- (cond0 _' I1 O' n$ ~% [
- ( (not (ai_notrans))) ; Not transparent?
$ S6 J. G" W2 f% |8 n - ( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
! j" Q: ~' j9 T! N+ K* y - ( (not (setq dcl_id (ai_dcl "exchprop")))) ; is .DCL file loaded?
6 b9 _& W7 C# R& W8 h - ( (not (setq ss (ddchprop2_select)))) ; objects to modify?
$ K% Z7 {6 [4 ? n$ Y/ c+ u# { - (t $ n/ A4 a2 p% T/ T
- ;(ai_undo_push)' g8 l; a& ]3 N
- (ddchprop2_init) ; Everything's cool,- L& C3 w: R- `6 @1 ?
- (call_chp2) ; so proceed!7 I+ H6 ?1 ?8 q) [- w& n5 q
- ;(ai_undo_pop)1 l7 y y! `+ O8 M7 @4 |
- )
$ Z: T' B+ p7 ~6 J7 _9 y0 W - );cond close
% K) z$ n. v5 }* }3 w" K* D9 ~ - 1 Z- l: q0 ~" `, k; X
- (restore_old_error)
4 m* {! B2 X5 c" L0 Z" a' |
' ^# a w, P) R- (princ)4 U6 q" T _! A# \8 O
- );defun ddchprop2
: ^& O1 {! W' o6 }
+ n3 b5 O* U8 t7 V! r* f& U+ p% g- S5 S- ;;;----------------------------------------------------------------------------
, X1 x6 y/ j R: p- a o# u6 X - / H% e, S0 Z" G9 z; p* C+ [# f# r
- (princ " EXCHPROP loaded."). t5 _) L1 ]0 F* ]' J( [; v+ A
- (princ)
* W" R) r# r. O5 V8 N: P
3 K) T7 M l v+ t6 t- ;;;----------------------------------------------------------------------------
* y# a# d- w! K, m+ ? - ;;;---------------------------------DDCOLOR_LSP--------------------------------
$ Q! |2 f0 n s5 e3 L/ G - ;;;----------------------------------------------------------------------------
1 ]" @! R. g$ V/ F/ W) a - 3 z$ T; E5 D3 a* [
- ; Next available MSG number is 24 6 _0 {( W6 E3 s3 r: Y4 J3 i' }7 D
- ; MODULE_ID DDCOLOR_LSP_6 g& _; W) q# P) q5 |
- ;;;7 `$ F' Z. y& H9 I$ n. h5 q3 p) R
- ;;; ddcolor.lsp/ ^3 M# k3 A7 @1 d- K+ S
- ;;; 8 c% y( R& P F) ~. u
- ;;; Copyright 1990, 1992, 1994, 1996 by Autodesk, Inc./ p3 e! H) G; P" I S; m. ^
- ;;;
+ [2 q1 p; H! E/ W - ;;; Permission to use, copy, modify, and distribute this software7 {% v7 B3 q) ]
- ;;; for any purpose and without fee is hereby granted, provided+ P4 A+ Q1 z `0 E! c7 `4 Z2 {- B
- ;;; that the above copyright notice appears in all copies and
1 t7 Q9 R7 M; b) z - ;;; that both that copyright notice and the limited warranty and
, D' f. d5 q; H# u2 d- P - ;;; restricted rights notice below appear in all supporting! K' G1 S; ^6 L; h) N/ D* N& {5 W. r
- ;;; documentation.& G1 n" u0 R4 \, _" f
- ;;;
9 q( T5 ^$ q2 R @& b - ;;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
- m0 c$ o7 V( ~ N) S, W+ e - ;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
/ b2 w2 z! O" A - ;;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.* u6 u2 c d$ X! U
- ;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
, l2 E1 H7 C( G% k$ t( w - ;;; UNINTERRUPTED OR ERROR FREE.
+ J7 p6 e7 e% E1 P- P, L: ^" c - ;;;+ e+ u F8 B2 @' e# W8 B
- ;;; Use, duplication, or disclosure by the U.S. Government is subject to) n. _2 ]' X# p4 ]
- ;;; restrictions set forth in FAR 52.227-19 (Commercial Computer
: C; c+ s' @& `& l - ;;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
3 p. k5 g# x2 o* H! c - ;;; (Rights in Technical Data and Computer Software), as applicable.; V* Z3 c/ w# D( G3 F4 q
- ;;;
% C) t4 I( F( \, ?' t4 ?6 d! H; m - ;;;.
1 G4 p/ F$ _% o6 Y - ;;;
$ F+ `) y- _% B4 B3 o - ;;;----------------------------------------------------------------------------
! J a+ q. V6 D - ;;; DESCRIPTION& q/ I1 e9 B, X! u2 z" D" _0 Z: O2 b
- ;;; ' N/ ]* K, o1 Q; a n
- ;;; Chromatic Pallete style color selection dialog.. v0 ~4 a) c5 N& ]
- ;;;
3 ]7 c& K L5 G' L& \0 B% c - ;;; Globals:7 `6 W2 y1 F4 l# L. d" Z! t/ r
- ;;;
- |3 ~2 @( X( k$ j5 h8 l. w - ;;; chroma_color - Integer color index. The last value selected
/ U# e9 j a* N( S. ~: T) X6 I - ;;; by the user in chroma dialog. It is not cleared or reset3 h9 \- G: ^* I, q
- ;;; by a cancel. Only used for communication between callback
' R9 V }. C& h, q - ;;; functions and the (chroma) funciton.
' {9 d! P9 f9 R- m* q, c; z# \ - ;;;
3 m# ?4 n7 D1 e. O1 ~0 ?) f - ;;; Depends on the definitions for the dialog provided in chroma.dcl.8 j) l2 z: v' m3 k) s/ `+ j
- ;;; ( C# q. @% L) [
- ;;;
2 [* Z& @ U, Q6 a6 y: {# E - ;;; C:DDCOLOR -- Dialogue front end to the CECOLOR sysvar. Uses the chroma
) {- ~% U$ t! w& f& E/ y& x - ;;; pallete style color selector.
7 x1 M: Y2 d, Y3 f' A& l7 @/ @# k5 m - ;;;* n4 D9 S4 }! e; V
- ;;; ===========================================================================
. B: g, N i) M! U5 g/ a5 g - ;;; ===================== load-time error checking ============================8 t7 e: G/ G1 E
- ;;;2 ^: S2 M: H) \; Q6 [* T6 n) S
: @6 K* {/ w: ^- (defun ai_abort (app msg)3 O( ~$ G, d; ^& C& w
- (defun *error* (s)% K. ]/ W3 B' F+ b: k
- (if old_error (setq *error* old_error))
( @& P; j8 |$ I; j* h) N4 y" z. \ - (princ)7 d8 j3 P$ Z. |! h9 r
- )
/ G) v% _% P/ K8 o* s - (if msg
2 L( i# m/ W: X& [3 _! z# D - (alert (strcat " Application error: "
& w& D7 j( [: P* F6 f - app7 g' i, l8 @6 b7 U
- " \n\n "% b1 F7 Q, ], x" u
- msg! x. [, Y- G( [& Z( T' n" I0 l
- " \n"
% x. _ j* B. H5 Z$ _0 r - )
3 }" l; c3 }' w' X - )
a' k) d3 X7 N& Z5 b V - ). g' v) o- O! s
- (exit)
' ]6 V# p( i+ g8 b - )) l- |+ A5 D6 m- U4 P" i( m# [
- . J' f2 B6 \% g( R* i! y
- ;;; Check to see if AI_UTILS is loaded, If not, try to find it,
0 _3 {" C2 {$ |$ L* A+ W# E - ;;; and then try to load it.
y: p5 E1 z n0 y! E! F - ;;;
3 x- Q0 L( w3 \+ O - ;;; If it can't be found or it can't be loaded, then abort the
% j6 n) z. @' H - ;;; loading of this file immediately, preserving the (autoload)
G. I' M8 b" d n0 H6 a# s# ~ - ;;; stub function.
# ?0 ~2 H; o! a! n/ Y% |; ]2 H1 H5 ]
$ e6 n* F( ?; K, [- (cond
% O! d8 b$ k% @ - ( (and ai_dcl (listp ai_dcl))) ; it's already loaded." U2 K* ^; o& U1 X
- 2 O$ X# R8 J9 S+ M4 N0 }
- ( (not (findfile "ai_utils.lsp")) ; find it+ v, W3 F h, S. }7 `* B9 `2 H8 |
- (ai_abort "DDCOLOR"0 [5 b v8 T' Q* L( a! n; u
- (strcat "Can't locate file AI_UTILS.LSP."5 v5 L4 A6 G9 Z5 i2 n8 n+ K
- "\n Check support directory."))): ?6 w: z' g+ S& Z/ c" f5 A
- 9 P+ d2 C4 E! x$ d6 R
- ( (eq "failed" (load "ai_utils" "failed")) ; load it
) _5 L2 U" t* y/ {' T: I2 n* W - (ai_abort "DDCOLOR" "Can't load file AI_UTILS.LSP"))
+ T- ~0 J0 u' c - )2 J. w# A) u5 f. w7 a
3 X% B* b! w8 c7 v _% z, U- (if (not (ai_acadapp)) ; defined in AI_UTILS.LSP
2 ^! y2 o0 `: z; g - (ai_abort "DDCOLOR" nil) ; a Nil <msg> supresses
5 |& i0 E1 f9 @5 \& s - ) ; ai_abort's alert box dialog.
r- O( e0 p2 L4 |( \3 w" v - 5 \8 J" P& @( D& K+ v) r( `- n
- ;;; ==================== end load-time operations ===========================6 V+ v& u5 }) ?, b& ^# R, S* j) c0 |
K n& d) h P+ z- (defun c:ccc (/ co_oce clrx co_err co_oer lay_clr): C# o. y. ?4 g3 S9 h+ w) n
-
# @9 d$ P: ]1 E5 n - ;; Main Color function, called by setup code.
6 I: B) b$ O9 g+ m- t0 C8 \: m - (defun ddcolor_main()3 u% Z( H! K6 v1 E: d- D9 l
- ! r N0 T5 N8 b$ f* Y# _6 s
- (graphscr)
+ p: H ?& l% f. i$ z. X - ; M/ t3 l* i& X2 i
- ;; Get the color of the current layer, for possible BYLAYER color swatch.
3 U: c8 T# }. V9 p8 ]# K - (setq lay_clr (cdr (assoc 62 (tblsearch "layer" (getvar "clayer")))))
' U: l6 j5 g! R+ d; P - ' P& q/ r) v. I0 Y
- ;; Call the dialog here...
1 P6 ?' ^1 Q/ B - (setq clr (acad_colordlg (cstoci (getvar "cecolor")) T lay_clr))3 b( L- E9 U2 b8 C# k- X) G
- ! { y3 f1 v( x% i! s+ f( U
- (if clr# C4 i2 P* ^0 C. a
- (setvar "CECOLOR" (citocs clr)))
. ]3 }/ S5 M4 K+ j - )
7 N2 \# \; l$ T! s& \( T F/ L$ _, q. b - ( I9 Z R( O4 j. R
- ;;;6 j$ ~" b) I" ~+ d7 j; c( J
- ;;; CSTOCI -- Color string to color index
& U" ^/ s; T4 `+ n2 o - ;;; Convert an arbitrary case string into a color index.
3 d5 V' ^$ X' }) y3 h - ;;; Returns nil if string is not a valid color.
$ k, j2 s9 y, U& u: P; W7 ` - ;;;
5 D' x1 s+ S m8 F f9 [% x - (defun cstoci (str): Y6 s/ G4 D- M1 g5 S* W2 m- T$ c0 U
- (setq str (strcase str))
+ W& T3 k) C+ d }. | - (cond
& u( A1 Z! i: x8 f' z - ((= str "RED") 1)
$ a& w% [9 W P5 G) A - ((= str "YELLOW") 2)
% b! }9 h, N2 n2 D9 E - ((= str "GREEN") 3)2 h0 n9 g9 z; W7 v s0 ~
- ((= str "CYAN") 4)
3 h* x! _7 |- E% B J; n( b - ((= str "BLUE") 5)$ M& l4 d$ M% ^! M+ _
- ((= str "MAGENTA") 6)* ?/ ?5 r u' j+ I
- ((= str "WHITE") 7)
: z, r+ w6 G z9 a8 @ - ((= str "BYLAYER") 256)
J, Y, ]+ e8 E$ |$ e# P; ~ - ((= str "BYBLOCK") 0)
% z: t: s! u1 |6 h& R5 \; O2 x2 O9 U - ((= str "BY LAYER") 256)
6 i2 w5 C1 X3 H! a7 d - ((= str "BY BLOCK") 0)
, o# V+ Z+ h- Q: X - ((and (< 0 (atoi str)) (> 256 (atoi str))) (atoi str)) |* L; y- F) C: Z# R& g
- (nil))6 h; }! g( n7 ]- [
- )
2 h4 e f2 Q6 R5 }# c p4 q ^
6 {$ T( |6 \# F) c) m8 r8 S: Q- / f J( k' _# L+ N: n. n
- ;;;; x, y1 j/ k/ I, R( B4 h" [* W- g
- ;;; CITOCS -- Convert color index into standard color name.2 w) j1 y. P% x: P2 X
- ;;; Will return the standard and logical color names as text E: i5 V$ @; L ~( ]4 Z
- ;;; strings. Returns nil for out-of-range color indicies.
- \3 Z8 b5 j% L! V% z - ;;;! k/ Z" e/ P. M7 k+ B% c9 B
- (defun citocs(i)
' `, J: h1 o. { V. T" M - (cond
/ v& A' R B2 Q; M2 R; |. y - ((= i 0) "BYBLOCK")
+ c- M) W# v$ L - ((= i 1) "red")
5 T2 n) E# }2 r: g; Y. ~ - ((= i 2) "yellow")
$ ^ F5 Q2 K$ V4 n1 L2 p: X - ((= i 3) "green")" T4 ^9 \! D% R8 Y
- ((= i 4) "cyan")
. E/ ]- y( Z; K0 L# Y3 [% A - ((= i 5) "blue")
9 W8 ^2 ?& N# \; t' F; } - ((= i 6) "magenta")2 k( \# T# ]. U) q
- ((= i 7) "white")
' X! N! F& M5 p/ x2 Y: q - ((= i 256) "BYLAYER")
9 f- w! ^- Y' a+ J) o; h; F1 A - ((and (< 0 i) (> 256 i)) (itoa i))- X& T, I, P- B
- (nil)): L" s& q" [% U/ _) Y4 ]
- )
" R# m3 |4 ?$ p0 Z7 H - + I1 a3 n" [* Q8 ]$ @/ _$ ]
- ;; Start of ddcolor2 u0 B) u4 T9 |4 S* h; G; q0 \
- (setq old_cmd (getvar "cmdecho") ; save current setting of cmdecho) A# F% v8 P+ g0 t
- old_error *error* ; save current error function4 U3 A1 k/ h) Y$ k
- *error* ai_error ; new error function8 L/ v6 |# F: _" x7 |& F
- )
. w$ i6 [6 o7 |+ I - 6 J" v& R2 ^) q$ d" o5 H! g0 P
- (setvar "cmdecho" 0)! P8 d% g/ d- M" n
% I7 ~6 e8 l/ `5 ~4 D( c- (cond. j6 Y. S; h" F
- ( (not (ai_trans))) ; transparent OK o6 K3 M& C% K7 I Q
- ( (not (ai_acadapp))) ; ACADAPP.EXP xloaded?
4 X: i, Z% t0 x# F1 j [& P - # @0 ?; {! v4 h$ J3 X
- (t (if (and (/= 1 (logand 1 (getvar "cmdactive")))$ S7 i* b# g0 O: X
- (/= 8 (logand 8 (getvar "cmdactive")))
9 X: t7 X9 A# q x- q+ f - )
. n* V/ ~! n6 [% Y; g: j - (ai_undo_push)
h* z/ x6 c' k+ A - ), j9 u" c& l7 f @7 [! M, W
$ _& |) ^7 ^. k9 X! V J- (ddcolor_main) ; proceed!) M8 X2 _6 W1 t4 I1 a! Q
. E# U9 O$ V% p7 U- (if (and (/= 1 (logand 1 (getvar "cmdactive")))/ N, {5 p) S5 Z) D& H
- (/= 8 (logand 8 (getvar "cmdactive")))
4 f% H }, ~5 B8 k& ?& q: ^ - )# W& c, e/ ]0 K5 [! K
- (ai_undo_pop)
) {& W2 p( h& G: r - )8 Y2 G% e! x8 w) M. t; e
- )
6 H# ^/ [, J( `' n n3 ] - )8 d7 R% L D( I; E: h x$ Y1 k
- 0 c3 d' r5 B2 |' L y/ J' v; P
- (setq *error* old_error) ' j2 b( i+ P, Y/ y) r
- (setvar "cmdecho" old_cmd)% L F' V. D7 |- B4 T1 W
- (princ)
$ @) _; J, F2 U, M, P5 e - " j- S$ |& Y& `; Q* q3 o
- )9 d( n( o/ ?& G0 `4 r! x
* x/ p+ t1 W5 Q- ;;;----------------------------------------------------------------------------
8 ]+ e/ |# v5 ?9 V. P0 v8 u - / A) d8 X) `1 A3 W/ X5 z4 d
- (princ " DDCOLOR loaded. ")
$ h' ?" W" H' v+ u0 T. o - (princ)
# l) T- W, B5 ~5 b
( ^6 H7 o" t. B. N# F7 E% w' K* r- ;;;--------------------------------------------------------------------------;1 h- C& R4 l- G& Q, H5 Q
- ;;;---------------Chon NHANH Nhieu Doi Tuong GIONG THUOC TINH----------------;6 s2 B/ F8 v* k, t' \4 O6 Z
- ;;;--------------------------------------------------------------------------;4 U: A- U" m# ? D7 d' c7 m
- ;;; ssx.lsp
; D$ A9 O6 x: x - ;;; Copyright (C) 1990 by Autodesk, Inc.
9 f! S8 c' u8 f9 u3 H - ;;; Copyright (C) 1991 by Control Systems, Inc.; b5 n+ Y# w* T( F( {9 l9 `
- ;;;
+ J. y7 `; q9 d! a; e - ;;; Permission to use, copy, modify, and distribute this software and its8 `; b- k5 l. m9 K( s7 D" k
- ;;; documentation for any purpose and without fee is hereby granted.
) `0 t( a+ @. z: t - ;;;
5 E6 D6 K9 L; h4 G - ;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
7 p/ ^+ a9 V2 f7 w) a - ;;; ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF# \+ K" j8 A' z' R" T w
- ;;; MERCHANTABILITY ARE HEREBY DISCLAIMED./ q7 k. C; B6 o
- ;;;
0 B* T3 h' a9 t3 l) \ - ;;; Larry Knott Version 2.0 7/18/88* a; s2 {; f0 E
- ;;; Carl Bethea & Jan S. Yoder Version 3.0) v6 K! n$ W. d. z: D
- ;;; Enhancements to (ssx).
. t& F+ u- N& @2 n4 @8 k - ;;; 15 March 1990 ; T) R2 ^+ v( ?* j( q, y
- ;;;
% g0 n; `9 I& ^5 W - ;;; ARTIST Software, Inc Version 4.0 December 1991 m% {" O) ?% E- C# i; g
- ;;; Modified for FLEXICON usage. If the variable FLEXVAR = 1,
3 K/ g( t! o, \5 T - ;;; use Flexicon menus* c; d1 \: G7 n3 X- ~
- ;;;
, M% p- F: X, R: @ G4 ` - ;;;--------------------------------------------------------------------------;, O$ X' K; [- l. M
- ;;; DESCRIPTION% u; `: O- z; I+ T
- ;;; SSX.LSP
! x( y: y5 q& j: @' { - ;;;
8 z- s* H* k: N- ^3 V' b8 p0 R - ;;; "(SSX)" - Easy SSGET filter routine.
y% A1 h! O. z. A( I' P& a - ;;; 3 g7 E# B& j+ u
- ;;; Creates a selection set. Either type "SSX" at the "Command:" prompt 1 `" P' F2 P) D+ G0 s( X
- ;;; to create a "previous" selection set or type "(SSX)" in response to # v+ y. P! @" C
- ;;; any "Select objects:" prompt. You may use the functions "(A)" to add
) m1 e9 Z8 `0 r - ;;; entities and "(R)" to remove entities from a selection set during / O, ]3 `& r4 O9 S8 C, w+ V% c
- ;;; object selection. More than one filter criteria can be used at a
% }/ G% c3 {+ g9 @/ V% Z. a - ;;; time.
" A5 q0 E0 Q/ I+ Z/ ~0 y- H - ;;; 1 c3 E# V) |! w6 b, q Z7 a, U
- ;;; SSX returns a selection set either exactly like a selected. K& W- i# x% ]/ z: g7 U3 _+ e
- ;;; entity or, by adjusting the filter list, similar to it.& S" t* Y2 Q- | }* j. J
- ;;;9 E* Z) K( k) W! f; M# v. R/ U1 Y
- ;;; The initial prompt is this:
; P0 d$ L" B1 k/ k) E, Q! P; ` - ;;;
0 J+ j+ F& z* [ {% W - ;;; Command: ssx- F2 `! q/ B: Y+ H+ K! a
- ;;; Select object/<None>: (RETURN)& V# i/ E# V" ^3 K Z) _. ?! D
- ;;; >>Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector:
" }$ {; F$ w4 ~- b2 n0 V4 i. v) i - ;;;
8 @$ Z8 A& `# w# }6 v) S. l - ;;; Pressing RETURN at the initial prompt gives you a null selection
- ^, p K( `/ n* k& g" m e3 F - ;;; mechanism just as (ssx) did in Release 10, but you may select an & E" M7 I5 x1 q& l$ A% [3 B
- ;;; entity if you desire. If you do so, then the list of valid types 2 u2 I {2 r# I- z6 t: [
- ;;; allowed by (ssget "x") are presented on the command line.
( {3 m' l# Z. s - ;;; ( m2 T' w* U% W' d5 G, M
- ;;; Select object/<None>: (a LINE selected)/ t" ^7 D" V$ v% B; e2 `
- ;;; Filter: ((0 . "LINE") (8 . "0") (39 . 2.0) (62 . 1) (210 0.0 0.0 1.0))
( P( c( ^, j7 E& g/ N2 e - ;;; >>Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector:
( C: G- O' E' {$ _6 ]- E }9 | - ;;;
1 O6 ?4 S9 e# T5 \ - ;;; At this point any of these filters may be removed by selecting the
! M; K. N( Z2 ~ - ;;; option keyword, then pressing RETURN.4 g( a9 Z1 _. m7 N
- ;;;
1 q1 V S. h: Q - ;;; >>Layer name to add/<RETURN to remove>: (RETURN)
* ], D. n' ~+ v( I, B @, S5 d - ;;; / X' }2 j$ r- N& c
- ;;; Filter: ((0 . "LINE") (39 . 2.0) (62 . 1) (210 0.0 0.0 1.0))
6 i6 }# u# o- R0 I$ E: n - ;;; >>Block name/Color/Entity/Flag/LAyer/LType/Pick/Style/Thickness/Vector: " e) l( {4 k: ^0 o2 x" e2 [
- ;;; 2 h# m# \# p+ N! g* o$ o; v' t- i
- ;;; If an item exists in the filter list and you elect to add a new item, 4 d- {6 X: S! d0 _' J( E- w
- ;;; the old value is overwritten by the new value, as you can have only
- H7 U/ l; G. @+ @) e6 a* ~; v j - ;;; one of each type in a single (ssget "x") call.
2 x: X I) D) H; {4 m5 L: n - ;;;
% W1 F5 `8 P8 f. w - ;;;--------------------------------------------------------------------------;, h. ?' \) O" o9 W0 t2 ^) |2 m
- ;;;, Y, d+ ?2 f8 x- I2 ]0 C! F* q, u4 C
- ;;; Find the dotted pairs that are valid filters for ssget
7 b \( L9 D1 W# p - ;;; in entity named "ent". ]% J3 k# t/ `6 w: {8 }& d) o! V5 B
- ;;;
* g2 ~2 ]/ Z, Y$ g$ N - ;;; ssx_fe == SSX_Find_Entity
! r) M! ]4 m" u4 z4 i m4 t; Y - ;;;
, n( O% { v5 B) E3 A: ? - (defun ssx_fe (/ x data fltr ent)
w& R, ]- W3 Z- P% [ - (if (and (= flexvar 1)(/= t2 "Pick"))
3 Q! q9 g( T! `+ b5 [ - (setq ent nil)
+ F' _. L9 l6 [: E9 O# q3 o" m - (setq ent (car (entsel "\nSelect object/<None>: "))), G* o' U; |1 d( q( C' e+ u. ~3 E
- )
" s9 ?. Z2 k7 b( d! A9 k5 s# ^4 \ - (if ent2 {+ m% p, R# p# U, e" r
- (progn
' _3 l* { X6 k; L: G3 D0 B. e% O& f - (setq data (entget ent))' i" w: P. s: U9 w! |8 D
- (foreach x '(0 2 6 7 8 39 62 66 210) ; do not include 382 C" n( p" s8 ?' @
- (if (assoc x data)
5 B' r$ j0 n( Y2 ?' r L w# x' A+ B - (setq fltr
; [; V9 s( M& x6 h. ^5 y - (cons (assoc x data) fltr)2 l' E* p- |' n+ B$ K' ^( F5 c
- )( ~% o4 X2 ]3 I% p9 P8 S
- )
, y( ^2 l% ^4 L9 S - ) ' C9 @% a. {: y9 c6 d
- (reverse fltr): k J2 |: Q$ J* D# u6 u
- )
7 _# B3 ^4 F$ i) N7 y1 O0 X' c3 T8 ? - )
# r# A) G& j; R8 @# _6 u - )
# _( G, ~' l) e$ t8 H - ;;;! A+ N: H' }/ C
- ;;; Remove "element" from "alist".
+ ]2 N8 ]5 l; Y0 e$ z3 D- H8 V, l8 s+ U - ;;;2 ]% @% V5 }2 C Z5 e
- ;;; ssx_re == SSX_Remove_Element
6 X( ]. Y: k9 k/ y( s+ ]4 {/ q - ;;;4 r" i7 v- L, H Y6 n
- (defun ssx_re (element alist)
( _" C8 F5 a( w& R7 }3 U - (append( y; u T8 K4 h1 c" o
- (reverse (cdr (member element (reverse alist))))
; S$ V! N& `- c - (cdr (member element alist)) , T; R8 `7 d9 i; R9 ]6 u" g6 G( V Q
- )% _7 p- Y' g/ t! o E1 K9 i
- ) F6 t" c' `! R. p! i5 V
- ;;;* S* V4 Q' S2 l7 ~" v
- ;;; INTERNAL ERROR HANDLER
7 C. E" W! ]# W( \, m% D1 d - ;;;% @7 k/ c% r( m* i
- (defun ssx_er (s) ; If an error (such as CTRL-C) occurs
, Y& ]8 K. n6 k- l3 X9 A+ _# @: h - ; while this command is active.... S& N5 H8 K4 G& o4 Q
- (if (/= s "Function cancelled")
5 b0 a. E7 C2 z* h; c: @ - (princ (strcat "\nError: " s))- Z9 H8 F! k2 x# N
- )' p2 f& e4 G4 h8 C
- (if olderr (setq *error* olderr)) ; Restore old *error* handler9 f: _6 h$ a( A1 V, q* W3 R
- (setq flexvar 0) o! Q! F3 g5 c, Z8 W9 X
- (princ)+ t a" E9 T$ t; d' p% m7 \5 H8 V7 Z
- )8 ?: C; ^# _) H
- ;;;
) {7 K% M# ~6 p, I) W M/ j" q3 O - ;;; Flexicon call routine
' P% l- H' O1 C - ;;;, _- M7 r# F% Y; a; k
- (defun flexmnu (a)
b; ^; w2 _& d: t+ [) @( _ - (if (= flexvar 1)
9 \6 Q$ Q6 o% T! ]- l/ \. n - (command "FLEXICON" (strcat "FLEX" a))
" \8 d1 ^3 ?/ i( z0 n% P* B - )0 g r; e3 s0 ]$ i, s r
- )* G$ k" _, x5 T5 ^
/ M, e; h+ H5 W4 A, x- ;;;
7 w# z$ ~( P' r o, ^4 ] - ;;; Get the filtered sel-set.
" |6 n. \- p: T T0 c# U - ;;;- q& w2 E" ^) S+ C0 i9 e3 ?
- ;;;
% | W7 h* m. D - (defun ssx (/ olderr)
# n s' m$ }# d9 M* H - (gc) ; close any sel-sets
) b; f# Q) _; L9 ~) ?9 b+ o - (setq olderr *error* ' C3 h/ P3 q: I6 m, m
- *error* ssx_er ' |% _& n- b# c; ?. o# L& ~9 [
- )
- B6 H1 k# m# ~* t2 b - (setq fltr (ssx_fe))
, D; k* F5 I' D9 J - (ssx_gf fltr)
/ H" E3 x3 u3 E9 ` - (if (= flexvar 1)
: W+ [0 ^7 `8 W# b. `3 S! ~ - (progn8 I4 x; M, P. [% ?/ q
- (prompt "\n \n \nNow select the required EDIT command and (P)revious.")
C% P/ q- x' }* n7 {$ I$ @ - (flexmnu "EDIT")
' l! @# Y8 K8 ~: ]0 h# b/ _ - )8 J/ @) h& F0 e6 Q
- (command "p")
/ Z* a3 K3 T5 y" a% _" w - )
8 o" o" h7 _; s0 i+ A) | - (princ)4 B2 e6 O" r: z- Q( P
- )
@2 N) S1 p" p$ X, Y" Y - ;;;3 Z8 f6 [0 x+ a
- ;;; Build the filter list up by picking, selecting an item to add,
) G* T; l7 b3 p4 z - ;;; or remove an item from the list by selecting it and pressing RETURN.$ A" `0 y4 k8 M7 F# H) X. C
- ;;;
4 H) v5 P7 \2 |" ~8 d - ;;; ssx_gf == SSX_Get_Filters
5 G3 D7 A+ t5 s" ~6 v4 n& K4 V - ;;;6 U) M( g8 _! \$ w, O$ O# [0 b
- (defun ssx_gf (f1 / t1 t2 t3 f1 f2)
9 j) q% p$ u& t8 A! g* m6 ` - (while 9 k+ T- z" K* u s! P
- (progn+ M4 r3 T0 X% Z1 k) B% Z& }
- (flexmnu "SSX")
/ w/ l" s. f8 f; w3 D- V - (cond (f1 (prompt "\nFilter: ") (prin1 f1)))
7 L( S/ {/ M* R - (initget ' i$ L8 r: V) q. Y
- "Block Color Entity Flag LAyer LType Pick Style Thickness Vector")( ]4 ? N. f$ }
- (setq t1 (getkword (strcat
; J% t, X8 I( }, G7 N6 | - "\n>>Block name/Color/Entity/Flag/"
2 l; s: W; ?8 r) V - "LAyer/LType/Pick/Style/Thickness/Vector: ")))
# z/ r6 [( {9 ^) j% r3 ~# ~4 r- e - )- y7 f- W! Q: H0 r3 b& F8 U
- (setq t2- i- x! X, V2 Z8 J
- (cond3 A) M& ~2 m' a; C2 n$ n7 i2 M
- ((eq t1 "Block") 2) ((eq t1 "Color") 62)) R2 {9 n3 s P7 l3 ^1 E4 j
- ((eq t1 "Entity") 0) ((eq t1 "LAyer") 8)4 ]5 R0 w: C. Q3 o3 i: h3 ?$ q& q
- ((eq t1 "LType") 6) ((eq t1 "Style") 7)
2 ]% ?; Y& n2 W5 s" I - ((eq t1 "Thickness") 39) ((eq t1 "Flag" ) 66)5 ^, x% ]8 m# `/ ^
- ((eq t1 "Vector") 210)/ T) l P$ n5 i$ r' P. V" a
- (T t1)
9 [$ D( y r. z, H4 y+ B - ) T1 E, |+ g V3 Y+ u" Z
- )
$ i4 M% p3 M! L- ?3 ~ - (setq t3
3 I+ @7 \/ \- w% w c - (cond
8 P) o/ N9 G* m+ ^ - ((= t2 2)
! j- [3 |. a- A J# X9 w+ y - (if (= flexvar gtads 1)
' F4 B3 u& {7 u) T& m8 V; h - (progn
& B d; B; ~& h4 n# ^6 R( u+ y( F - (prompt "\n>>Block name to add/<RETURN to remove>: ")
+ Q! ?* C2 \& f3 H$ y. n - (gttable "BLOCK")
* I2 k: R* a0 W5 u+ L: x% D( x* h+ d - )
; K) n9 i! Y9 r" E0 z9 f - (getstring "\n>>Block name to add/<RETURN to remove>: ")' r4 p! k: Y2 O7 J
- )
+ W/ y, F. A9 b - ): V0 N- ?4 {5 o0 z' A _
- ((= t2 62) (initget 4 "?")! P' }3 k3 c+ z4 B9 I
- (cond5 a1 e4 V) x' |
- ((or (eq (setq t3 (getint
( O: B& i2 s' q# H; @+ J - "\n>>Color number to add/?/<RETURN to remove>: ")) "?")
% g8 u. y" C4 y# J7 f$ E! Z4 a - (> t3 256))
, |+ l; N$ g9 X5 Z" e7 D - (ssx_pc) ; Print color values.
, Y* ]( U* A; ~' c0 z, ~ - nil6 F( u7 u3 T6 H9 P
- )1 V( A3 h( r0 e$ ?1 J
- (T; p; k2 Q/ ^9 D% H% Y0 d# [& `
- t3 ; Return t3.
2 y) v& @7 |4 s) W - )
3 @4 \9 _1 D7 f' ] - )
0 ?1 {1 G1 M1 z& k6 x! f - )
3 K2 }" a, ^! d& V" t5 K! i2 Y9 L - ((= t2 0) (getstring "\n>>Entity type to add/<RETURN to remove>: "))9 R* @ ]2 e/ |
- ((= t2 8)1 o1 s, Z. l8 e3 j4 N* O
- (if (= flexvar gtads 1)) M* d' t2 [" m$ Q1 F9 g4 W, V3 e
- (progn0 V4 [5 S5 l2 c6 K, J# D7 w
- (prompt "\n>>Layer name to add/<RETURN to remove>: ")
0 y9 s- \+ x: _4 X - (gttable "LAYER")
9 B0 D' Y8 N: |) o - )
; {, c3 p0 k# M4 ^' H9 F - (getstring "\n>>Layer name to add/<RETURN to remove>: ")- p% F5 M/ \0 v/ m
- )8 g& }" h2 b2 K
- ): U- c. L% {- R
- ((= t2 6)
( S( b3 N7 D6 }, f( m4 h0 |! e - (if (= flexvar gtads 1) L' ?& j0 E) D
- (progn. J8 x5 L2 P' ^; p; C
- (prompt "\n>>Linetype name to add/<RETURN to remove>: ")
- I3 y I8 J ?4 M: }6 V - (gttable "LTYPE")5 x/ \4 J! P1 B& O7 L& {
- )
6 p; l' G7 B; y: o* B - (getstring "\n>>Linetype name to add/<RETURN to remove>: ")
1 M; Z/ N7 o4 r8 P+ ] - )
) \5 y. u- r: E+ p. Z - )+ V9 C$ V- T# v8 c1 H
- ((= t2 7)
+ ~4 P2 v! k) I. N2 a2 M9 s5 ? - (if (= flexvar gtads 1)9 \+ z* T1 D1 `# q# b- H
- (progn
3 Z. O5 I) Q K$ h2 z; | - (prompt "\n>>Text style name to add/<RETURN to remove>: ")
5 e6 _( L& U% E( l# ^0 Q8 w - (gttable "STYLE")4 ?! m( N* Y6 D0 X' J& ^
- )/ D) }( d8 ]& M5 ^3 [0 K$ g& g
- (getstring "\n>>Text style name to add/<RETURN to remove>: ")
Q0 W3 H9 s1 o. q9 R' l, Y - )/ e/ M* ]2 _* R
- ). o. C+ T+ x# @: q5 I
- ((= t2 39)
9 j/ i! r6 Y! w5 `2 A/ a0 n1 E# R - (prompt "\n>>Thickness to add/<RETURN to remove>: ")
, ^' q; d/ b# V$ j% A - (if(= flexvar gtads 1)(gtfnum"Thickness to add:")(getreal))& y6 _, l3 F3 x$ p1 ^+ K( d a5 P
- )
( ?4 k4 `: E& n - ((= t2 66) (if (assoc 66 f1) nil 1))1 R. K6 J( {& _, R& U! v0 o- v
- ((= t2 210)
/ \" F7 M3 D; F7 H0 G - (getpoint "\n>>Extrusion Vector to add/<RETURN to remove>: ")
; s4 p- j: [" W% t. b' f! v - )( h$ q N! ~. v: P3 V* ^5 Q. d" H7 y
- (T nil)
H- u! _' G9 Q( T- Q1 i - )! O, E$ s @7 v7 e, I2 k8 K( F3 a
- )
2 `- b& W* ~- x) d$ E" n- j - (cond6 l. L7 r) K3 T1 T0 r6 P" A% u9 Q
- ((= t2 "Pick") (setq f1 (ssx_fe) t2 nil)) ; get entity- q! J5 S, N) K" F
- ((and f1 (assoc t2 f1)) ; already in the list. R! s! Z3 j; c5 a; ~( `
- (if (and t3 (/= t3 ""))' s, p5 E% L4 J' N/ i5 H$ O! ^! ~
- ;; Replace with a new value...
: J. V. }+ i1 l2 ^1 k0 E8 _3 ? - (setq f1 (subst (cons t2 t3) (assoc t2 f1) f1)) 2 W7 m% b; @: M4 L+ F9 Z
- ;; Remove it from filter list...
2 H% u- I0 F( E" @1 n* Q - (setq f1 (ssx_re (assoc t2 f1) f1))
1 T3 B1 d/ l( N" ?3 _; c+ `2 u - ) ) ?, I0 m9 Y, H* B
- )" r& s$ o; C' R; m& ^2 o
- ((and t3 (/= t3 ""))
) c2 \7 ^; J+ U. U, p - (setq f1 (cons (cons t2 t3) f1))
5 W9 c9 \ t: J/ S& ?: Q - )
) Z+ V+ h m4 c8 y0 u- V3 j - (T nil)
- B; }2 e; e5 w, ]2 W3 J - )* M1 e; D5 A( d' `) Y
- )' t2 Y1 s* M. a$ Y$ o8 S: M
- (if f1 (setq f2 (ssget "x" f1)))& O& G& v4 {. L! b
- (setq *error* olderr)/ X9 t9 N. g2 N9 e: T" ^
- (if (and f1 f2)
1 A% A% y G& I# X" g - (progn
, T5 {" r: h3 K1 x& M3 p' P. u8 w* V5 w- P - (princ (strcat "\n" (itoa (sslength f2)) " found. ")). Q6 y9 X) ]* G# U: \. z$ w- j5 V
- f2 5 @# A. \3 Q/ w6 I0 V6 k7 v5 A
- )
0 ~) w& o9 [( o* _4 n - (progn (princ "\n0 found.") (prin1))
' X; [- a( U, b9 k) x - )) m7 d" X$ a. G D8 Y0 G
- )
8 ^' \: X! s' y* v) W - ;;;
3 v) H/ m1 O6 x6 O; F - ;;; Print the standard color assignments.
2 E2 \1 [! w) B0 m$ A - ;;;* k6 M: E/ i R; h
- ;;;# b; {( R. x3 l/ j5 g- {2 u
- (defun ssx_pc ()4 a, k: x0 Z: G A3 Z0 ^! J
- (if textpage (textpage) (textscr))
: p* d: W3 P: G: f - (princ "\n "). d% N5 D0 p4 @3 j: t4 r
- (princ "\n Color number | Standard meaning ")6 u* y0 w/ M/ Q6 t! g- s) X" ~- x
- (princ "\n ________________|____________________")
2 j3 Z2 R" @; ~/ J) m - (princ "\n | ")
: D Y3 L$ J% W3 g& {3 T: [) h - (princ "\n 0 | <BYBLOCK> ")' U7 D8 ~9 o6 k% |3 D# v
- (princ "\n 1 | Red ")
4 U9 H% k( Q; t( t - (princ "\n 2 | Yellow ")( D# N( S0 A& I* r
- (princ "\n 3 | Green ")
4 N+ G& L( q1 v1 q# g0 z1 N0 p2 l - (princ "\n 4 | Cyan ")+ r! | c/ T, [& Y8 `+ w. m4 n
- (princ "\n 5 | Blue ")# o" D" G" ?0 X4 n' B O* o; N6 Z) B
- (princ "\n 6 | Magenta ") I& z0 `- j: Z. ~% }* S
- (princ "\n 7 | White ")- j; o1 K' ?3 l' a$ S
- (princ "\n 8...255 | -Varies- ")
- |* p* v4 R9 _- O! r; p - (princ "\n 256 | <BYLAYER> ")
- J, P8 Q8 S; X - (princ "\n \n\n\n")
' ~1 E6 W/ p. x. k8 z6 p - )! b% P1 ]1 a4 N9 ]# t# `
- ;;;+ I" o2 |( F6 z D; Y" G2 r0 l
- ;;; C: function definition.8 |$ I7 p% ~5 W# i
- ;;;& ^/ B9 |. L$ f, W
- (defun c:ssx () (ssx)(princ))
4 v K0 v, ~7 K - (princ "\n\tType \"ssx\" at a Command: prompt or ")
# u7 S6 P' J3 z8 y - (princ "\n\t(ssx) at any object selection prompt. ")/ g8 d1 ?, @+ R0 c5 H' u O9 u6 S9 t
- (princ)
& _' p) f% v7 e( K4 Q0 E
7 G* Z& @& s/ R% \+ K4 ]5 |; b( x: e* y- ;;;--------------------------------------------------------------------------;0 D" k) J4 ?2 p& q5 {
- ;;;--------------------------------------------------------------------------;
) u: l3 S8 A% R2 V9 o - ;;;--------------------------------------------------------------------------;) M/ u& t: l5 \+ S5 A8 A
- (defun S::STARTUP ()
1 h% d7 H& a9 X - (setvar "cmdecho" 0)
) @3 S; f# {9 a' F1 L' @0 { - (setvar "cmdecho" 1)% d+ |0 v) F* f$ y/ }7 n
- (setvar "LTSCALE" 10)
( v- f) {- W. `7 `( S: K8 W5 a - ) u d4 h; K' n5 G; F# ]0 N* G
- ;(command "_load" "chenKH.fas")- Z* R1 a7 ^2 Y6 K4 A+ Y
- ;(command "_load" "ctcot.fas")% m, u* r l! r3 j S/ X
- ;(command "_load" "damdoc.fas")" K0 `3 s% O& b3 b0 Q4 f7 B4 r
- ;(command "_load" "ghichu.fas")
/ ?2 d& d) [# i$ E' U- \+ K( b - ;(command "_load" "hamtutao.lsp")
$ ^' _% p0 ^) I" H - ;(command "_load" "KHOITAO.fas"). d! j: |0 O! B/ @
- ;(command "_load" "KHthep.fas")
, d2 p# n' g1 }) I7 [2 h - ;(command "_load" "mbmong.dcl")
/ H/ p2 M# k% x: R+ _; D/ Y# D - ;(command "_load" "mbmong.fas")" ~3 E) b$ G# n- V
- ;(command "_load" "mccot.fas")
3 i, ^- \/ f& P - ;(command "_load" "mcdam.fas"), R y' y- N, ^, I
- ;(command "_load" "mcmong1.dcl")
4 Z. \% @7 t r, D - ;(command "_load" "mcmong1.fas"): c, |6 \6 C( r$ K ]4 w
- ;(command "_load" "mcmong2.dcl")8 [- o' g2 S$ l8 y3 P& F
- ;(command "_load" "mcmong2.fas")
/ R. Y8 e* P% q* D* M - ;(command "_load" "mcmong3.dcl")
6 V5 \ `* u6 F$ ~* D6 y - ;(command "_load" "mcmong3.fas")% ~# p8 _( t: F/ @0 o
- ;(command "_load" "mcsan.fas")& E7 X' d' Q6 P0 j
- ;(command "_load" "thepdai.fas")9 j, ^7 G: f. j( {4 y: J
- ;(command "_load" "thepdoc.fas")
) b8 w4 o4 d m \ - ;(command "_load" "thepmb.fas")- Z. s, }/ R; ~
- ;(command "_load" "thepphbo.fas")
- V# y3 u+ t, D) i: o' E - (command "_script" "thongso.scr")
; J( \( ^6 m6 S9 W7 Z( n0 h m- t - ;(command "_load" "thongso1.dcl")
& I% Z$ | p5 N - ;(command "_load" "thongso1.fas")" F# n: ]' @0 c" f/ k- f
- ;(command "_load" "thongso2.dcl")4 |7 F$ [* w x K
- ;(command "_load" "thongso2.fas")
6 Y! T3 H1 b6 ]3 \- v - ;(command "_load" "tietdien.fas")
+ V3 K4 y+ m4 y - ;(command "_load" "vehan.fas") ~ S# \+ J# e2 n
- (command "_load" "phamDuy782006_TKT.lsp")# f6 V0 h1 x2 \/ h, V
- (command "_load" "phamduy782006ganhtd.lsp")
: x; U; t2 x0 s9 R N B0 L5 ` - (command "_load" "phamduy782006ganhtds.lsp")" R3 X5 F1 _ w0 B2 E8 V
- (command "_load" "phamduy782006htd.dcl")
( r# }; B4 b- d! z C* W - (princ)
0 c' R: N) K( K, X2 G. c% U - )* W# n/ _/ ~% Q: l
4 v( B8 P% N+ k% y- ;; Silent load.. j9 k, X7 Z1 l1 x& B
- (princ)
& l8 E/ k% X% I/ ?& s6 U
- C7 \, j8 D- z+ D o- 6 D% ?% i: W/ b8 O1 Y
- ;; Silent load for the Express Tools.
, V N" Z" E# ?% } - ;; Altering this line will affect Express Tools functionality
+ I. W* M. b# ]# D8 b - (load "acettest.fas" (princ))
5 W& n7 i# L) o; ?# ^ - �32
Sao chép mã * n$ z/ r8 b( _4 w# P
00st Cách Thêm Menu & Lisp Vẽ & Fonts Chữ mở Gõ Chữ Administrator để Gõ- l: q) g: t" z4 @3 A
|
|