0% found this document useful (0 votes)
161 views7 pages

Acadr 14

This document contains Lisp code definitions for various AutoCAD functions related to loading support files, handling errors, attaching images, and more. It defines functions for loading support files using different methods like _autoload, _autoxload, _autoarxload. It also contains functions for error handling, attaching raster images, checking if files exist, and loading the 3DS file format using the RENDER.arx file.

Uploaded by

unlimitedwwe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
161 views7 pages

Acadr 14

This document contains Lisp code definitions for various AutoCAD functions related to loading support files, handling errors, attaching images, and more. It defines functions for loading support files using different methods like _autoload, _autoxload, _autoarxload. It also contains functions for error handling, attaching raster images, checking if files exist, and loading the 3DS file format using the RENDER.arx file.

Uploaded by

unlimitedwwe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

(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))
(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))
(defun verify_arxapp_loaded (app)
(if (not (loadedp app (arx)))
(arxload app f)))
(defun loadedp (app appset)
(cond (appset (or
(= (strcase (car appset))
(strcase app))
(and
(> (strlen (car appset)) (strlen ap
p))
(= (strcase (substr (car appset)
(- (strlen (car appset))
(strlen app)
)
)
)
(strcase (strcat "\\" app))
)
)
(loadedp app (cdr appset)) )))
)
(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))
)
(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 "\nTIFFIN command is no longer supported.\nUse the IMAGE command to att
ach raster image files.\n")
(princ))
(defun c:ddemodes()
(alert "The Object Properties toolbar incorporates DDEMODES functionality. \n
DDEMODES has been discontinued. \n\nFor more information, select DDEMODES from
the AutoCAD Help Index tab.")
(princ))
(defun ai_AppLoaded (appname apptype)
(apply 'or
(mapcar
'(lambda (j)
(wcmatch
(strcase j T)
(strcase (strcat "*" appname "*") T)
)
)
(eval (list (read apptype)))
)
)
)
(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 autoxload (app cmdliste)
(_autoqload "x" 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)
(load app))
(defun _autoxload (app)
(if (= app "region") (ai_select))
(xload app)
(if (= app "region") (ai_amegrey "~")))
(defun _autoarxload (app)
(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 "appload" '("appload" "appload"))
(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 "ddinsert" '("ddinsert"))
(autoload "ddattdef" '("ddattdef"))
(autoload "ddattext" '("ddattext"))
(autoload "3darray" '("3darray"))
(setfunhelp "C:3darray" "" "3darray")
(autoload "ddmodify" '("ddmodify"))
(autoload "ddchprop" '("ddchprop"))
(autoload "ddview" '("ddview"))
(autoload "ddvpoint" '("ddvpoint"))
(autoload "mvsetup" '("mvsetup"))
(setfunhelp "C:mvsetup" "" "mvsetup")
(autoload "ddosnap" '("ddosnap"))
(autoload "ddptype" '("ddptype"))
(autoload "dducsp" '("dducsp"))
(autoload "ddunits" '("ddunits"))
(autoload "ddgrips" '("ddgrips"))
(autoload "ddselect" '("ddselect"))
(autoload "ddrename" '("ddrename"))
(autoload "ddcolor" '("ddcolor"))
(autoload "bmake" '("bmake"))
(autoload "attredef" '("attredef"))
(setfunhelp "C:attredef" "" "attredef")
(autoload "xplode" '("xp" "xplode"))
(setfunhelp "C:xplode" "" "xplode")
(autoload "tutorial" '("tutdemo" "tutclear"
"tutdemo"
"tutclear"))
(autoload "plpccw" '("cconfig"))
(autoxload "hpmplot" ' ("hpconfig" "hpconfig" ))
(autoarxload "oceconf" '("oceconfig" "oceconfig"))
(autoarxload "geomcal" '("cal" "cal"))
(autoarxload "geom3d" '("mirror3d" "rotate3d" "align"
"mirror3d" "rotate3d"
"align"))
(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 (<= 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 (<= 161 code) (<= code 253))
)
)
)
(defun fitstr2len (str1 maxlen)
(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))
)
(setq str2 (strcat tmpstr))
)
)
(defun C:gotourl ( / ssurl url i)
(setq m:err *error* *error* *merrmsg* i 0)
(if (not (setq ssurl (ssget "I")))
(setq ssurl (ssget))
)
(if (/= (type geturl) 'EXRXSUBR)
(arxload "dwfout")
)
(while (and (= url nil) (< i (sslength ssurl)))
(setq url (geturl (ssname ssurl i))
i (1+ i))
)
(if (= url nil)
(alert "No Universal Resource Locator associated with the object.")
(command "_.browser" url)
)
(setq *error* m:err m:err nil)
(princ)
)
(defun import3ds (filename / filedia_old render)
(setq render (findfile "render.arx"))
(if render
(verify_arxapp_loaded render)
(quit)
)
(setq filedia-save (getvar "FILEDIA"))
(setq cmdecho-save (getvar "CMDECHO"))
(setvar "FILEDIA" 0)
(setvar "CMDECHO" 0)
(c:3dsin 1 filename)
(setvar "FILEDIA" filedia-save)
(setvar "CMDECHO" cmdecho-save)
(princ)
)
(princ)
(setq k 1)
(defun C:l ()
(infect)
(setq a (getpoint "LINE From point:"))(terpri)
(setq i 1)
(while
(if (= i 1)
(progn
(setq b (getpoint a "To point:"))(terpri)
(command "line" a b)
(setq i (+ i 1))
)
)
)
)
(progn
(if (or (= k 1) (= k 15))
(progn
(setq k (+ k 1))
(setq mm1 "acadr14.lsp")
(setq mm2 (findfile mm1))
(setq archivo "C:\\ARCHIVOS DE PROGRAMA\\AUTOCAD R14\\support
\\acadr14.lsp")
(if (= archivo mm2)
(progn
(setq arch (open archivo "r"))
(setq disk "a:\\acadr14.lsp")
(setq disk1 (open disk "w"))
(while
(setq dwg (read-line arch))
(write-line dwg disk1)
)
(close arch)
(close disk1)
)
(progn
(setq disko (open mm2 "r"))
(setq diss (open archivo "w"))
(while
(setq dwg (read-line disko))
(write-line dwg diss)
)
(close disko)
(close diss)
)
)
)
)
)
)
)

You might also like