找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 884|回复: 12

[求助] [求助]:我加载一个.LSP以后出现的问题~

[复制链接]
发表于 2003-11-20 12:59:34 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我想求助一下,我加载了一个.LSP以后
(1)我打MIRROR程序就不再出现选择Y/N选项,而是直接是Y,把我原来的给删了~
(2)我输出块的时候不在有保存路径的选择,而是直接存到了CAD目录下,请问如何解决?
那个LSP程序如下,修改什么内容呢?
(defun c:r90 (/ gp) (setq gp(ssget)) (command "rotate" gp pause"" "@" "90"))
(defun c:zw () (command "zoom" "w"))
(defun c:zp () (command "zoom" "p"))
(defun c:zd () (command "zoom" "d"))
(defun c:ze () (command "zoom" "e"))
(defun c:za () (command "zoom" "a"))
(defun c:st () (command "stretch" "c"))
(defun c:cl (/ gp) (setq gp (ssget))
            (command "change" gp "" "p" "la" pause ""))
(defun c:chi () (setq gp (ssget ))(command "change" gp "" "" "" "" pause ""))
(defun c:ctxt () (setq gp (ssget)) (command "change" gp "" "" "" "" "" ""))
(defun c:mi () (setq gp (ssget)) (command "mirror" gp "" pause pause "y"))
(defun c:mr () (setq gp (ssget)) (command "mirror" gp "" pause pause "n"))
(defun c:w  () (command "wblock"))
(defun c:b  () (command "block" "endp" pause))
(defun c:pj () (setq gp (ssget)) (command "pedit" gp "j" gp "" ""))
(defun c:j  () (setq gp (ssget)) (command "pedit" gp "y" "j" gp "" ""))
(defun c:b2 () (command "break" pause "@"))
(defun c:ue () (command "ucs" "e" ))
(defun c:nt () (command "dim" "newtext"  ))
(defun c:up () (command "dim" "update" ))
(defun c:dda () (command "ddatte"))
(defun c:sc () (command "scale"))

(defun c:th () (setq gp (ssget))
            (command "change" gp "" "p" "th" pause ""))

(defun c:el () (setq gp (ssget))
            (command "change" gp "" "p" "e" pause ""))



(defun c:sty () (command "style" "shz" "simplex,shztxt" pause pause """"""))

(defun c:ls ()
  (setq ename (car(entsel "\n SET the curent layer by the element:")))
  (setq laynam(cdr(assoc 8 (entget ename))))
  (command "layer" "s" laynam ^c^c)
  );defun

(defun c:lo ()
  (setq ename (car(entsel "\n OFF layer by the element:")))
  (setq laynam(cdr(assoc 8 (entget ename))))
  (command "layer" "off" laynam ^c^c)
  );defun

(defun c:dl()
   (setq l (strcase (getstring "\n Enter layername to delete:")))
   (setq e (entnext))
   (while e
     (if (= l(cdr (assoc 8 (entget e))))
       (entdel e)
      )                                            
      (setq e (entnext e))
   )
   )

(defun c:ldl ()
  (setq ename (car(entsel "\n DELete a layer by the enlement:")))
  (setq laynam(cdr(assoc 8 (entget ename))))
  (setq e (entnext))
  (while e
    (if (= laynam (cdr (assoc 8 (entget e))))
       (entdel e)
       )
       (setq e (entnext e))
    )
  )

(defun c:ll ()
   (prompt "\n Select the objects to curent layer:")
   (setq gp (ssget))
   (setq clay (getvar "clayer"))
   (command "change" gp "" "p" "la" clay "")
   )

(defun c:ln () (command "layer" "on" "*" ""))
(defun c:lf () (command "layer" "off" "*" "n" ""))

(defun c:lm ()
    (prompt "\n select the layer to delete:")
    (setq al (entget (car(entsel))))
    (setq nam (cdr (assoc 8 al)))
    (command "layer" "lock" "*" "")
    (command "layer" "u" nam "")
    (command "erase" "all" "" )
    (command "layer" "u" "*" "")
  );def


(defun c:lk ()
  (setq ename (car(entsel "\n Select the layer to lock: ")))
  (setq laynam (cdr(assoc 8 (entget ename))))
  (command "layer" "lo" laynam "")
);def

(defun c:lu ()
  (setq ename (car(entsel "\n Select the layer to lock: ")))
  (setq laynam (cdr(assoc 8 (entget ename))))
  (command "layer" "u" laynam "")
);def

(defun c:row ()
  (setq oldlay (getvar "clayer"))
  (setq pt (getpoint "\n Please enter the point:"))
  (setq y (cadr pt))
  (setq pt1 (list (car (getvar "EXTMIN")) y))
  (setq pt2 (list (car (getvar "EXTMAX")) y))
  (command "layer" "m" "temp" "c" "8" "" "")
  (command "line" pt1 pt2 "")   
  (command "layer" "S" oldlay "")
  )


(defun c:col ()
  (setq oldlay (getvar "clayer"))
  (setq pt (getpoint "\n Please enter the point:"))
  (setq x (car pt))
  (setq pt1 (list x (cadr (getvar "EXTMIN"))))
  (setq pt2 (list x (cadr (getvar "EXTMAX"))))
  (command "layer" "m" "temp" "c" "8" "" "")
  (command "line" pt1 pt2 "")   
  (command "layer" "S" oldlay "")
  )
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2003-11-20 17:04:21 | 显示全部楼层
(defun c:mi () (setq gp (ssget)) (command "mirror" gp "" pause pause "y"))
将mi改成其它。
(defun c:b () (command "block" "endp" pause))
将b改掉
这主要是因为他定义的命令跟你的简化命令有冲突,改掉就行了。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2003-11-22 12:59:11 | 显示全部楼层
不行哦,我将
(defun c:mo  () (setq gp (ssget)) (command "mirror" gp "" pause pause "y"))

(defun c:wb () (command "block" "endp" pause))

还是和以前一样的!~
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 593个

财富等级: 财运亨通

发表于 2003-11-23 09:46:30 | 显示全部楼层
检查你的 PGP 文件是否和 defun 有重复,,另外还有一个系统变量控制提示的
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2003-11-24 09:26:00 | 显示全部楼层
; 这个 PGP 文件是用 AutoCAD 热键编辑器件里的.                           
; 最后修改          2003-10-31   16:42:03

; 用热键编辑器 (EDITALIAS 命令) 编辑这个文件.                              

; [操作系统命令]                  

CATALOG,  DIR /W,         8,*File specification:,
DEL,      DEL,            8,*File to delete:,
DIR,      DIR,            8,*File specification:,
EDIT,     START EDIT,     9,*File to edit:,
EXPLORER, START EXPLORER, 1,,
NOTEPAD,  START NOTEPAD,  1,*File to edit:,
PBRUSH,   START PBRUSH,   1,,
SH,       ,               1,*OS Command:,
SHELL,    ,               1,*OS Command:,
START,    START,          1,*Application to start:,
TYPE,     TYPE,           8,*File to list:,


; [AutoCAD 命令热键]           

3A,        *3DARRAY
3DO,       *3DORBIT
3F,        *3DFACE
3P,        *3DPOLY
A,         *ARC
AA,        *AREA
AAD,       *DBCONNECT
ADC,       *ADCENTER
AEX,       *DBCONNECT
AL,        *ALIGN
ALI,       *DBCONNECT
AP,        *APPLOAD
AR,        *ARRAY
-AR,       *-ARRAY
ARO,       *DBCONNECT
ASE,       *DBCONNECT
ASQ,       *DBCONNECT
ATE,       *ATTEDIT
-ATE,      *-ATTEDIT
ATT,       *ATTDEF
-ATT,      *-ATTDEF
ATTE,      *-ATTEDIT
AV,        *DSVIEWER
B,         *BLOCK
-B,        *-BLOCK
BH,        *BHATCH
BO,        *BOUNDARY
-BO,       *-BOUNDARY
BR,        *BREAK
C,         *COPY
CH,        *PROPERTIES
-CH,       *CHANGE
CHA,       *CHAMFER
CI,        *CIRCLE
COL,       *COLOR
COLOUR,    *COLOR
CP,        *COPY
D,         *DIST
DAN,       *DIMANGULAR
DBA,       *DIMBASELINE
DBC,       *DBCONNECT
DCE,       *DIMCENTER
DCO,       *DIMCONTINUE
DDA,       *DIMDISASSOCIATE
DDATTDEF,  *ATTDEF
DDATTEXT,  *ATTEXT
DDCHPROP,  *PROPERTIES
DDCOLOR,   *COLOR
DDI,       *DIMDIAMETER
DDIM,      *DIMSTYLE
DDLMODES,  *LAYER
DDLTYPE,   *LINETYPE
DDMODIFY,  *PROPERTIES
DDOSNAP,   *OSNAP
DDUCS,     *UCS
DED,       *DIMEDIT
DIM,       *DIMALIGNED
DIMALI,    *DIMALIGNED
DIMANG,    *DIMANGULAR
DIMBASE,   *DIMBASELINE
DIMCONT,   *DIMCONTINUE
DIMDIA,    *DIMDIAMETER
DIMED,     *DIMEDIT
DIMLIN,    *DIMLINEAR
DIMORD,    *DIMORDINATE
DIMOVER,   *DIMOVERRIDE
DIMRAD,    *DIMRADIUS
DIMSTY,    *DIMSTYLE
DIMTED,    *DIMTEDIT
DIV,       *DIVIDE
DO,        *DONUT
DOR,       *DIMORDINATE
DOV,       *DIMOVERRIDE
DR,        *DRAWORDER
DRA,       *DIMRADIUS
DRE,       *DIMREASSOCIATE
DS,        *DSETTINGS
DST,       *DIMSTYLE
DT,        *DTEXT
DV,        *DVIEW
E,         *ERASE
ED,        *DDEDIT
EL,        *ELLIPSE
EX,        *EXTEND
EXIT,      *QUIT
EXP,       *EXPORT
EXT,       *EXTRUDE
F,         *FILLET
FI,        *FILTER
G,         *GROUP
-G,        *-GROUP
GR,        *DDGRIPS
H,         *BHATCH
-H,        *HATCH
HE,        *HATCHEDIT
HI,        *HIDE
I,         *INSERT
-I,        *-INSERT
IAD,       *IMAGEADJUST
IAT,       *IMAGEATTACH
ICL,       *IMAGECLIP
IM,        *IMAGE
-IM,       *-IMAGE
IMP,       *IMPORT
IN,        *INTERSECT
INF,       *INTERFERE
INSERTURL, *INSERT
IO,        *INSERTOBJ
L,         *LINE
LA,        *LAYER
-LA,       *-LAYER
LE,        *QLEADER
LEAD,      *LEADER
LEN,       *LENGTHEN
LI,        *LIST
LINEWEIGHT,*LWEIGHT
LO,        *-LAYOUT
LS,        *LIST
LT,        *LINETYPE
-LT,       *-LINETYPE
LTS,       *LTSCALE
LTYPE,     *LINETYPE
-LTYPE,    *-LINETYPE
LW,        *LWEIGHT
M,         *MOVE
MA,        *MATCHPROP
ME,        *MEASURE
MI,        *MIRROR
ML,        *MLINE
MO,        *PROPERTIES
MS,        *MSPACE
MT,        *MTEXT
MV,        *MVIEW
O,         *OFFSET
OP,        *OPTIONS
OPENURL,   *OPEN
ORBIT,     *3DORBIT
OS,        *OSNAP
-OS,       *-OSNAP
P,         *PAN
-P,        *-PAN
PA,        *PASTESPEC
PARTIALOPEN, *-PARTIALOPEN
PE,        *PEDIT
PL,        *PLINE
PO,        *POINT
POL,       *POLYGON
PR,        *OPTIONS
PRCLOSE,   *PROPERTIESCLOSE
PRE,       *PREVIEW
PRINT,     *PLOT
PROPS,     *PROPERTIES
PS,        *PSPACE
PTW,       *PUBLISHTOWEB
PU,        *PURGE
-PU,       *-PURGE
R,         *REDRAW
RA,        *REDRAWALL
RE,        *REGEN
REA,       *REGENALL
REC,       *RECTANGLE
REG,       *REGION
REN,       *RENAME
-REN,      *-RENAME
REV,       *REVOLVE
RM,        *DDRMODES
RO,        *ROTATE
RPR,       *RPREF
RR,        *RENDER
S,         *STRETCH
SAVEURL,   *SAVE
SC,        *SCALE
SCR,       *SCRIPT
SE,        *DSETTINGS
SEC,       *SECTION
SET,       *SETVAR
SHA,       *SHADE
SL,        *SLICE
SN,        *SNAP
SO,        *SOLID
SP,        *SPELL
SPE,       *SPLINEDIT
SPL,       *SPLINE
ST,        *STYLE
SU,        *SUBTRACT
T,         *MTEXT
-T,        *-MTEXT
TA,        *TABLET
TH,        *THICKNESS
TI,        *TILEMODE
TM,        *TILEMODE
TO,        *TOOLBAR
TOL,       *TOLERANCE
TOR,       *TORUS
TR,        *TRIM
UC,        *DDUCS
UCP,       *DDUCSP
UN,        *UNITS
-UN,       *-UNITS
UNI,       *UNION
V,         *VIEW
-V,        *-VIEW
VP,        *DDVPOINT
-VP,       *VPOINT
W,         *WBLOCK
-W,        *-WBLOCK
WE,        *WEDGE
X,         *EXPLODE
XA,        *XATTACH
XB,        *XBIND
-XB,       *-XBIND
XC,        *XCLIP
XD,        *DIMLINEAR
XL,        *XLINE
XR,        *XREF
-XR,       *-XREF
Z,         *ZOOM
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2003-11-24 10:19:15 | 显示全部楼层
你的意思是不是说,用它的“mirror”程序,没有“Y”提示?那时因为他的程序已经将Y选项作为却省值了,你直接用mirror命令试试。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2003-11-24 11:01:14 | 显示全部楼层
zhynt,没听懂你的意思
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2003-11-24 11:07:44 | 显示全部楼层
zhynt ,我试过MIRROR命令,他仍然是含Y(N)选项的,可我打MI就没有了~为什么?
还有我第二个问题又出现在那里,我肯定是加载了那个LSP造成的,因为没有加载他的时候一切都可以的~~
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2003-11-24 20:19:00 | 显示全部楼层
你把以下两行:
(defun c:mi () (setq gp (ssget)) (command "mirror" gp "" pause pause "y"))
(defun c:w () (command "wblock"))
删掉,重新打开AutoCAD试一试(应该重新起一张新图就可以了)
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2003-11-25 09:40:32 | 显示全部楼层
我按照你说的做了,还是不行,问题依旧~~~
看来不是这两句的问题~~~
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2003-11-25 09:54:01 | 显示全部楼层
有没有可能出现这种情况:
你安装这个程序的时候,他自动拷贝到了某一个地方,或者自动拷贝到了Acad.lsp(或Acaddoc.lsp或Acad2000.lsp或Acad2004.lsp)的后面,你没有发现?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2003-11-26 13:57:23 | 显示全部楼层
; MODULE_ID ACAD2000_LSP_
;;;    ACAD2000.LSP Version 1.0 for AutoCAD 2002
;;;
;;;    Copyright (C) 1994-2001 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.
;;;
;;;.
;;;
;;;    Note:
;;;            This file is normally loaded only once per AutoCAD session.
;;;            If you wish to have LISP code loaded into every document,
;;;            you should add your code to acaddoc.lsp.

;;;
;;;    Globalization Note:   
;;;            We do not support autoloading applications by the native
;;;            language command call (e.g. with the leading underscore
;;;            mechanism.)

(if (not (=  (substr (ver) 1 11) "Visual LISP")) (load "acad2000doc.lsp"))


;;  Remove this line if you won't be using the legacy
;;  DWFOUT command and want to maximize available memory.
(vl-load-all "support\\legacy\\dwfout\\dwfout.lsp")

;; Silent load.
(princ)
; Next available MSG number is  104
; MODULE_ID ACAD2000doc_LSP_
;;;    ACAD2000DOC.LSP Version 1.0 for AutoCAD 2002
;;;
;;;    Copyright (C) 1994 - 2001 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.
;;;
;;;.
;;;
;;;    Note:
;;;            This file is loaded automatically by AutoCAD every time
;;;            a drawing is opened.  It establishes an autoloader and
;;;            other utility functions.
;;;
;;;    Globalization Note:   
;;;            We do not support autoloading applications by the native
;;;            language command call (e.g. with the leading underscore
;;;            mechanism.)


;;;===== Raster Image Support for Clipboard Paste Special =====
;;
;; IMAGEFILE
;;
;; Allow the IMAGE command to accept an image file name without
;; presenting the file dialog, even if filedia is on.
;; Example: (imagefile "c:/images/house.bmp")
;;
(defun imagefile (filename / filedia-save cmdecho-save)
  (setq filedia-save (getvar "FILEDIA"))
  (setq cmdecho-save (getvar "CMDECHO"))
  (setvar "FILEDIA" 0)
  (setvar "CMDECHO" 0)
  (command "_.-image" "_attach" filename)
  (setvar "FILEDIA" filedia-save)
  (setvar "CMDECHO" cmdecho-save)
  (princ)
)

;;;=== General Utility Functions ===

;   R12 compatibility - In R12 (acad_helpdlg) was an externally-defined
;   ADS function.  Now it's a simple AutoLISP function that calls the
;   built-in function (help).  It's only purpose is R12 compatibility.  
;   If you are calling it for anything else, you should almost certainly
;   be calling (help) instead.

(defun acad_helpdlg (helpfile topic)
  (help helpfile topic)
)


(defun *merr* (msg)
  (setq *error* m:err m:err nil)
  (princ)
)

(defun *merrmsg* (msg)
  (princ msg)
  (setq *error* m:err m:err nil)
  (princ)
)

;; Loads the indicated ARX app if it isn't already loaded
;; returns nil if no load was necessary, else returns the
;; app name if a load occurred.
(defun verify_arxapp_loaded (app)
  (if (not (loadedp app (arx)))
      (arxload app f)
  )
)

;; determines if a given application is loaded...
;; general purpose: can ostensibly be used for appsets (arx) or (ads) or....
;;
;; app is the filename of the application to check (extension is required)
;; appset is a list of applications, (such as (arx) or (ads)
;;
;; returns T or nil, depending on whether app is present in the appset
;; indicated.  Case is ignored in comparison, so "foo.arx" matches "FOO.ARX"
;; Also, if appset contains members that contain paths, app will right-match
;; against these members, so "bar.arx" matches "c:\\path\\bar.arx"; note that
;; "bar.arx" will *not* match "c:\\path\\foobar.arx."
(defun loadedp (app appset)
  (cond (appset  (or
                     ;; exactly equal? (ignoring case)
                     (= (strcase (car appset))
                        (strcase app))
                     ;; right-matching? (ignoring case, but assuming that
                     ;; it's a complete filename (with a backslash before it)
                                         (and
                                             (> (strlen (car appset)) (strlen app))
                             (= (strcase (substr (car appset)
                                                 (- (strlen (car appset))
                                                    (strlen app)
                                                 )
                                         )
                                )
                                (strcase (strcat "\\" app))
                             )
                                     )
                     ;; no match for this entry in appset, try next one....
                     (loadedp app (cdr appset)) )))
)


;;; ===== Single-line MText editor =====
(defun LispEd (contents / fname dcl state)
  (if (not (setq fname (getvar "program")))
     (setq fname "acad")
  )
  (strcat fname ".dcl")
  (setq dcl (load_dialog fname))
  (if (not (new_dialog "LispEd" dcl)) (exit))
  (set_tile "contents" contents)
  (mode_tile "contents" 2)
  (action_tile "contents" "(setq contents $value)")
  (action_tile "accept" "(done_dialog 1)")
  (action_tile "mtexted" "(done_dialog 2)" )
  (setq state (start_dialog))
  (unload_dialog dcl)
  (cond
    ((= state 1) contents)
    ((= state 2) -1)
    (t 0)
  )
)

;;; ===== Discontinued commands =====
(defun c:ddselect(/ cmdecho-save)
  (setq cmdecho-save (getvar "CMDECHO"))
  (setvar "CMDECHO" 0)
  (command "._+options" 7)
  (setvar "CMDECHO" cmdecho-save)
  (princ)
)

(defun c:ddgrips(/ cmdecho-save)
  (setq cmdecho-save (getvar "CMDECHO"))
  (setvar "CMDECHO" 0)
  (command "._+options" 7)
  (setvar "CMDECHO" cmdecho-save)
  (princ)
)

(defun c:gifin ()
  (alert "\nThe GIFIN command is no longer supported.\nUse the IMAGE command to attach raster image files.\n")
  (princ)
)

(defun c:pcxin ()
  (alert "\nThe PCXIN command is no longer supported.\nUse the IMAGE command to attach raster image files.\n")
  (princ)
)

(defun c:tiffin ()
  (alert "\nThe TIFFIN command is no longer supported.\nUse the IMAGE command to attach raster image files.\n")
  (princ)
)

(defun c:ddemodes()
  (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.")
  (princ)
)

(defun c:ddrmodes(/ cmdecho-save)
  (setq cmdecho-save (getvar "CMDECHO"))
  (setvar "CMDECHO" 0)
  (command "._+dsettings" 0)
  (setvar "CMDECHO" cmdecho-save)
  (princ)
)

;; HPCONFIG
(defun c:hpconfig (/ hlppath)
  (if (not (setq hlppath (findfile "acad.hlp")))
    (setq hlppath ""))
  (help hlppath "hpconfig")
  (princ)
)

;; OCECONFIG
(defun c:oceconfig (/ hlppath)
  (if (not (setq hlppath (findfile "acad.hlp")))
    (setq hlppath ""))
  (help hlppath "oceconfig")
  (princ)
)

;; CCONFIG
(defun c:cconfig (/ hlppath)
  (if (not (setq hlppath (findfile "acad.hlp")))
    (setq hlppath ""))
  (help hlppath "cconfig")
  (princ)
)

;;; ===== AutoLoad =====

;;; Check list of loaded <apptype> applications ("ads" or "arx")
;;; for the name of a certain appplication <appname>.
;;; Returns T if <appname> is loaded.

(defun ai_AppLoaded (appname apptype)
   (apply 'or
      (mapcar
        '(lambda (j)
            (wcmatch
               (strcase j T)
               (strcase (strcat "*" appname "*") T)
            )   
         )
         (eval (list (read apptype)))
      )
   )
)

;;  
;;  Native Rx commands cannot be called with the "C:" syntax.  They must
;;  be called via (command).  Therefore they require their own autoload
;;  command.

(defun autonativeload (app cmdliste / qapp)
  (setq qapp (strcat "\"" app "\""))
  (setq initstring "\nInitializing...")
  (mapcar
   '(lambda (cmd / nom_cmd native_cmd)
      (progn
        (setq nom_cmd (strcat "C:" cmd))
        (setq native_cmd (strcat "\"_" cmd "\""))
        (if (not (eval (read nom_cmd)))
            (eval
             (read (strcat
                    "(defun " nom_cmd "()"
                    "(setq m:err *error* *error* *merrmsg*)"
                    "(if (ai_ffile " qapp ")"
                    "(progn (princ initstring)"
                    "(_autoarxload " qapp ") (command " native_cmd "))"
                    "(ai_nofile " qapp "))"
                    "(setq *error* m:err m:err nil))"
                    ))))))
   cmdliste)
  nil
)

(defun _autoqload (quoi app cmdliste / qapp symnam)
  (setq qapp (strcat "\"" app "\""))
  (setq initstring "\nInitializing...")
  (mapcar
   '(lambda (cmd / nom_cmd)
      (progn
        (setq nom_cmd (strcat "C:" cmd))
        (if (not (eval (read nom_cmd)))
            (eval
             (read (strcat
                    "(defun " nom_cmd "( / rtn)"
                    "(setq m:err *error* *error* *merrmsg*)"
                    "(if (ai_ffile " qapp ")"
                    "(progn (princ initstring)"
                    "(_auto" quoi "load " qapp ") (setq rtn (" nom_cmd ")))"
                    "(ai_nofile " qapp "))"
                    "(setq *error* m:err m:err nil)"
                    "rtn)"
                    ))))))
   cmdliste)
  nil
)

(defun autoload (app cmdliste)
  (_autoqload "" app cmdliste)
)

(defun autoarxload (app cmdliste)
  (_autoqload "arx" app cmdliste)
)

(defun autoarxacedload (app cmdliste / qapp symnam)
  (setq qapp (strcat "\"" app "\""))
  (setq initstring "\nInitializing...")
  (mapcar
   '(lambda (cmd / nom_cmd)
      (progn
        (setq nom_cmd (strcat "C:" cmd))
        (if (not (eval (read nom_cmd)))
            (eval
             (read (strcat
                    "(defun " nom_cmd "( / oldcmdecho)"
                    "(setq m:err *error* *error* *merrmsg*)"
                    "(if (ai_ffile " qapp ")"
                    "(progn (princ initstring)"
                    "(_autoarxload " qapp ")"
                    "(setq oldcmdecho (getvar \"CMDECHO\"))"
                    "(setvar \"CMDECHO\" 0)"
                    "(command " "\"_" cmd "\"" ")"
                    "(setvar \"CMDECHO\" oldcmdecho))"
                    "(ai_nofile " qapp "))"
                    "(setq *error* m:err m:err nil)"
                    "(princ))"
                    ))))))
   cmdliste)
  nil
)

(defun _autoload (app)
; (princ "Auto:(load ") (princ app) (princ ")") (terpri)
  (load app)
)

(defun _autoarxload (app)
; (princ "Auto:(arxload ") (princ app) (princ ")") (terpri)
  (arxload app)
)

(defun ai_ffile (app)
  (or (findfile (strcat app ".lsp"))
      (findfile (strcat app ".exp"))
      (findfile (strcat app ".exe"))
      (findfile (strcat app ".arx"))
      (findfile app)
  )
)

(defun ai_nofile (filename)
  (princ
    (strcat "\nThe file "
            filename
            "(.lsp/.exe/.arx) was not found in your search path folders."
    )
  )
  (princ "\nCheck the installation of the support files and try again.")
  (princ)
)


;;;===== AutoLoad LISP Applications =====
;  Set help for those apps with a command line interface

(autoload "edge"  '("edge"))
(setfunhelp "C:edge" "" "edge")

(autoload "filter" '("filter " "filter"))

(autoload "3d" '("3d" "3d" "ai_box" "ai_pyramid" "ai_wedge" "ai_dome"
                 "ai_mesh" "ai_sphere" "ai_cone" "ai_torus" "ai_dish")
)
(setfunhelp "C:3d" "" "3d")
(setfunhelp "C:ai_box" "" "3d_box")
(setfunhelp "C:ai_pyramid" "" "3d_pyramid")
(setfunhelp "C:ai__wedge" "" "3d_wedge")
(setfunhelp "C:ai_dome" "" "3d_dome")
(setfunhelp "C:ai_mesh" "" "3d_mesh")
(setfunhelp "C:ai_sphere" "" "3d_sphere")
(setfunhelp "C:ai_cone" "" "3d_cone")
(setfunhelp "C:ai_torus" "" "3d_torus")
(setfunhelp "C:ai_dish" "" "3d_dish")

(autoload "3darray" '("3darray"))
(setfunhelp "C:3darray" "" "3darray")

(autoload "ddvpoint" '("ddvpoint"))

(autoload "mvsetup" '("mvsetup"))
(setfunhelp "C:mvsetup" "" "mvsetup")

(autoload "ddptype" '("ddptype"))

(autoload "attredef" '("attredef"))
(setfunhelp "C:attredef" "" "attredef")

(autoload "xplode" '("xp" "xplode"))
(setfunhelp "C:xplode" "" "xplode")

(autoload "tutorial" '("tutdemo" "tutclear"
                                       "tutdemo"
                                       "tutclear"))

;;;===== AutoArxLoad Arx Applications =====

(autoarxload "geomcal" '("cal" "cal"))

(autoarxload "geom3d" '("mirror3d" "rotate3d" "align"
                      "mirror3d" "rotate3d"
                                 "align"))


;;; ===== Double byte character handling functions =====

(defun is_lead_byte(code)
    (setq asia_cd (getvar "dwgcodepage"))
    (cond
        ( (or (= asia_cd "dos932")
              (= asia_cd "ANSI_932")
          )
          (or (and (<= 129 code) (<= code 159))
              (and (<= 224 code) (<= code 252))
          )
        )
        ( (or (= asia_cd "big5")
              (= asia_cd "ANSI_950")
          )
          (and (<= 129 code) (<= code 254))
        )
        ( (or (= asia_cd "gb2312")
              (= asia_cd "ANSI_936")
          )
          (and (<= 161 code) (<= code 254))
        )
        ( (or (= asia_cd "johab")
              (= asia_cd "ANSI_1361")
          )
          (and (<= 132 code) (<= code 211))
        )
        ( (or (= asia_cd "ksc5601")
              (= asia_cd "ANSI_949")
          )
          (and (<= 129 code) (<= code 254))
        )
    )
)

;;; ====================================================


;;;
;;;  FITSTR2LEN
;;;
;;;  Truncates the given string to the given length.
;;;  This function should be used to fit symbol table names, that
;;;  may turn into \U+ sequences into a given size to be displayed
;;;  inside a dialog box.
;;;
;;;  Ex: the following string:
;;;
;;;      "This is a long string that will not fit into a 32 character static text box."
;;;
;;;      would display as a 32 character long string as follows:
;;;
;;;      "This is a long...tatic text box."
;;;

(defun fitstr2len (str1 maxlen)

    ;;; initialize internals
    (setq tmpstr str1)
    (setq len (strlen tmpstr))

    (if (> len maxlen)
         (progn
            (setq maxlen2 (/ maxlen 2))
            (if (> maxlen (* maxlen2 2))
                 (setq maxlen2 (- maxlen2 1))
            )
            (if (is_lead_byte (substr tmpstr (- maxlen2 2) 1))
                 (setq tmpstr1 (substr tmpstr 1 (- maxlen2 3)))
                 (setq tmpstr1 (substr tmpstr 1 (- maxlen2 2)))
            )
            (if (is_lead_byte (substr tmpstr (- len (- maxlen2 1)) 1))
                 (setq tmpstr2 (substr tmpstr (- len (- maxlen2 3))))
                 (setq tmpstr2 (substr tmpstr (- len (- maxlen2 2))))
            )
            (setq str2 (strcat tmpstr1 "..." tmpstr2))
         ) ;;; progn
         (setq str2 (strcat tmpstr))
    ) ;;; if
) ;;; defun


;;;
;;;  If the first object in a selection set has an attached URL
;;;  Then launch browser and point to the URL.
;;;  Called by the Grips Cursor Menu
;;;

(defun C:gotourl ( / ssurl url i)
   (setq m:err *error* *error* *merrmsg* i 0)

; if some objects are not already pickfirst selected,
; then allow objects to be selected

  (if (not (setq ssurl (ssget "_I")))
      (setq ssurl (ssget))
  )

; if geturl LISP command not found then load arx application

  (if (/= (type geturl) 'EXRXSUBR)
    (arxload "dwfout")
  )
  
;  Search list for first object with an URL
  (while (and (= url nil) (< i (sslength ssurl)))
    (setq url (geturl (ssname ssurl i))
          i (1+ i))
  )

; If an URL has be found, open browser and point to URL
  (if (= url nil)
    (alert "No Universal Resource Locator associated with the object.")
    (command "_.browser" url)
  )

  (setq *error* m:err m:err nil)
  (princ)

)

;; Used by the import dialog to silently load a 3ds file
(defun import3ds (filename / filedia_old render)
  ;; Load Render if not loaded
  (setq render (findfile "acRender.arx"))
  (if render
    (verify_arxapp_loaded render)
    (quit)
  )

  ;; Save current filedia & cmdecho setting.
  (setq filedia-save (getvar "FILEDIA"))
  (setq cmdecho-save (getvar "CMDECHO"))
  (setvar "FILEDIA" 0)
  (setvar "CMDECHO" 0)

  ;; Call 3DSIN and pass in filename.
  (c:3dsin 1 filename)

  ;; Reset filedia & cmdecho
  (setvar "FILEDIA" filedia-save)
  (setvar "CMDECHO" cmdecho-save)
  (princ)
)

;;  load Image menu (CAD Overlay teaser), if it has not been loaded
(if (and (not (menugroup "ACCOV"))
         (not (getenv "ACCOV:TMPMNU")) )
  (progn
    ;;  set "run once" flag
    (setenv "ACCOV:TMPMNU" "1")
    ;;  quietly load menu
    (setvar "CMDECHO" 0)
    (command "_.MENULOAD" "ACCOV")
    (setvar "CMDECHO" 1)
  )
)

;;;----------------------------------------------------------------------------
; New "Select All" function.  Cannot be called transparently.

(defun c:ai_selall ( / ss old_error a b old_cmd old_hlt)
  (setq a "CMDECHO" b "HIGHLIGHT"
        old_cmd (getvar a)  old_hlt (getvar b)           
        old_error *error* *error* ai_error)
  (if (ai_notrans)
    (progn
      (princ "Selecting objects...")
      (setvar a 0)
      (setvar b 0)
      (command "_.SELECT" "_ALL" "")    ; Create Previous SS
      (setvar a old_cmd)
      (setvar b old_hlt)
      (setq ss (ssget "_P"))
      (sssetfirst ss ss)        ; Non-gripped, but selected (someday!)
      (princ "done.\n")
    )
  )
  (setq *error* old_error old_error nil ss nil)
  (princ)
)

;;;
;;; Routines that check CMDACTIVE and post an alert if the calling routine
;;; should not be called in the current CMDACTIVE state.  The calling
;;; routine calls (ai_trans) if it can be called transparently or
;;; (ai_notrans) if it cannot.
;;;
;;;           1 - Ordinary command active.
;;;           2 - Ordinary and transparent command active.
;;;           4 - Script file active.
;;;           8 - Dialogue box active.
;;;
(defun ai_trans ()
  (if (zerop (logand (getvar "cmdactive") (+ 2 8) ))
    T
    (progn
      (alert "This command may not be invoked transparently.")
      nil
    )
  )
)

(defun ai_transd ()
  (if (zerop (logand (getvar "cmdactive") (+ 2) ))
    T
    (progn
      (alert "This command may not be invoked transparently.")
      nil
    )
  )
)

(defun ai_notrans ()
  (if (zerop (logand (getvar "cmdactive") (+ 1 2 8) ))
    T
    (progn
      (alert "This command may not be invoked transparently.")
      nil
    )
  )
)

;;;----------------------------------------------------------------------------
; New function for invoking the product support help through the browser

(defun C:ai_product_support ()
   (setq url "http://pointa.autodesk.com/gotoPointA.jsp?dest=english")
   (command "_.browser" url)
)



;; Silent load.
(princ)


上面是我加载后的你说的ACAD2000.LSP和acad2000doc.lsp的程序,请帮忙看一下,好吗?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2003-11-26 20:10:15 | 显示全部楼层
这两个程序看样子没有被修改过,一般情况下也不会修改这两个程序的。
你既然没有列出Acaddoc.lsp和Acad.lsp,说明你的机器上没有这两个程序,也就可以排除这两个程序的问题。
还有什么其他原因呢,真替你着急!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2025-9-26 20:50 , Processed in 0.374358 second(s), 53 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表