startup loading lisps

ChrisL

Usenet Archive
Joined
Aug 11, 2003
Messages
23
Reaction score
0
I'm trying to get my acad.lsp to load some of my frequently used lisps. I don't know coding and tried using the good ole F1. I can't figure what it is I'm doing wrong. this is what I got:
(defun S::STARTUP
(load "lispname")
etc.etc.

please any help with this is appreciated
 
I use the autoload - lispname - lispcommand

(autoload "reinsert" '("rein"))

I'm sure this isn't the only way to do it

"ChrisL" <> wrote:

I'm trying to get my acad.lsp to load some of my frequently used lisps. I don't know coding and tried using the good ole F1. I can't figure what it is I'm doing wrong. this is what I got:
(defun S::STARTUP
(load "lispname")
etc.etc.

please any help with this is appreciated
 
That should do it ... provided the rest of your S::STARTUP function is coded correctly. What happens? Anything? Show us the rest of your code, and maybe someone will be able to point to a specific problem.
___
 
Paul,
I have no rest of the code. Which is probably the problem. When I open a new DWG I either get an error saying I have an "extra rght paren on input" or something like that. Or "malformatted list" how should the S::STARTUP code end?
 
Each parenthesis that you open must be closed....

(defun S::STARTUP
(load "lispname")
etc.etc.
) ---> this close the defun

ChrisL a écrit :
 
Most of the people here have an acad.lsp. Post the acad.lsp that you have and someone will clean it up for you. Additionally, if you also post the functions you want to load with each dwg, they will also do one for you and this will allow you to do the remainder.
 
Walt thanks...
I would post it but currently it is nothing(well nothing that works). All I want is to beable to load some shareware lisps that I have upon opening a new dwg. I have the option set, to load the acad.lsp in every dwg. If someone could post the code that I need, then I could just change the lisp name that would be great.
 
That's not the way it works. However, I will post one below. You will have to make changes you see fit.

(DEFUN S::STARTUP
(COMMAND "STYLE" "STANDARD" "romans" "" "" "" "" "" "") (SETVAR "AUPREC" 2) ;angular units precision set to 2 places (SETVAR "BLIPMODE" 0) ;turns off blips (SETVAR "CMDECHO" 0) ;turns off lisp echoing (COMMAND "SETVAR" "COORDS" 0) ;turns off dynamics coordinate updating ;(COMMAND "SETVAR" "DIMCLRT" 0) ;dimension text color (SETVAR "DIMEXE" 0.09) ;extension line distance past dim line (COMMAND "SETVAR" "DISPSILH" 1) ;to hide during plotting (SETVAR "DIMTAD" 1) ;dim text above dim line-default is 0 (SETVAR "DIMTIH" 1) ;dim text aligned (SETVAR "DIMTXSTY" "STANDARD") ;dim text style (SETVAR "DIMTXT" 0.125) ;dim text height (SETVAR "DIMCEN" 0.09) ;zero draws no centermark for ;center, dia & radius subcommands

(SETVAR "DIMUNIT" 6) ;arch units format
(SETVAR "DIMDEC" 5) ;dimension decimal places-5= 1/32th inch (SETVAR "DIMAUNIT" 0) ;no decimal places on angular dimension (SETVAR "LUNITS" 4) ;arch linear units (COMMAND "UNITS" 4 32 1 2 0 "N") ;arch, sixteenths, dec deg, 2 places

(SETVAR "DIMUPT" 0) ;user placement of dim text-1allows dim placed outside for radius and diam (COMMAND "SETVAR" "DIMZIN" 7) ;supresses zero feet but not zero inches (COMMAND "SETVAR" "EDGEMODE" 1) ;cutting & boundary edge (SETVAR "FILEDIA" 1) ;dialog boxes enabled (COMMAND "SETVAR" "FONTALT" "ROMANSD") ;alternate font (SETVAR "FACETRES" 10) ;smoothness of shaded and hidden lines (SETVAR "ISAVEPERCENT" 0) ;saves all of dwg instead of most recent part

(SETVAR "MIRRTEXT" 0) ;mirroring text normally
(COMMAND "SETVAR" "OSMODE" 32) ;intersection obj snap
(COMMAND "SETVAR" "LTSCALE" (/ (GETVAR "DIMSCALE") 2))
(COMMAND "SETVAR" "SAVETIME" 10) ;10 minutes automatic saving (SETVAR "SORTENTS" 23) ;object sort order (SETVAR "TEXTQLTY" 25) ;faster regen for texts (COMMAND "SETVAR" "TEXTSTYLE" "STANDARD") ;text style name (COMMAND "SETVAR" "TEXTSIZE" 0.125) ;text height (COMMAND "TIME" "OFF" "") ;"on" checks times, dates of when ;dwg worked on (SETVAR "UCSICON" 1) ;ucs icon on (COMMAND "VIEWRES" "" 1000) ;resolution for smoother circles

(if (not (tblsearch "layer" "1"))
(command "layer" "M" "1" "c" "red" "1" "L" "continuous" "1" "")) (if (not (tblsearch "layer" "2")) (command "layer" "M" "2" "c" "yellow" "2" "L" "continuous" "2" "")) (if (not (tblsearch "layer" "3")) (command "layer" "M" "3" "c" "green" "3" "L" "continuous" "3" "")) (if (not (tblsearch "layer" "4")) (command "layer" "M" "4" "c" "cyan" "4" "L" "hidden" "4" "")) (if (not (tblsearch "layer" "5")) (command "layer" "M" "5" "c" "RED" "5" "L" "center" "5" "")) (command "SETVAR" "CLAYER" "0") ) ; (VMON) (prompt "\nLoading Acad.lsp...Please wait.....")
 
Walt,
I admitt I'm not a lisp expert but I do know for a fact that what I'm looking for can be done. I think Mack Attack's post is closer to what I'm looking for. Your lisp seems to set-up your document. I want mine just to load some tools. I had this acad.lsp at my previous job but I'm having problems getting it from them.
 
To simplify things I just added a little section under the acad.lsp (or acad2000doc.lsp in my case) to accomplish what you are looking for.  It is a little easier than creating a sperate .lsp file.  I hope this helps (I also like to give a small description after the lsp to describe what it does, just a personal preference)

 

 

;;;===== PBA AutoLoad LISP Applications =====
;;; Modified by Brian E. Mackey October 2001

 

(autoload "Batt" '("batt"));;draws batt insulation from specific points (autoload "Bup" '("bup"));;draws a blow up line around specified points (autoload "Cln" '("cln"));;clean intersections (autoload "Curve" '("crv"));;offsets incrimental lines to show a curved object (autoload "dimarcl" '("Dimarcl"));;dimensions an arc (autoload "dimnote" '("dpm" "dho" "dvf" "deq" "dor" "dty" "dmn"));;dimension text (autoload "mmt" '("mmt"));; adds one string of text to another mtext (autoload "new-door" '("nd" "xd"));;add new and exterior doors, trims wall lines to headers (autoload "offdel" '("ofd"));;offset a line and then delete it (autoload "offpr" '("ofp"));;offsets a line into a pair and deletes the original (autoload "offst" '("ofl"));;offset a line to a specified layer (autoload "offwall" '("ptyp"));; (autoload "pdn" '("pdn"));;changes the snap angle to a selected line (autoload "pl" '("exist"));;wall fill to specific layer (autoload "reinsert" '("rein"));;Insert another block by touching an existing one (autoload "sellay" '("sellay" "selx" "sl" "slx" "fl" "ol" "kl" "ul" "ml" "il" "ilx")) (autoload "snapr" '("snapr"));;changes the snap angle by 15deg incriments (autoload "vplim" '("vpl"));draws a boundry line in model space from a selected viewport (autoload "wdwall" '("wdwall"));;draws lines to look liked a wood wall

 

;;======= PBA Commands ===========
;;; Modified by Brian E. Mackey October 2001

 

(defun C:ZA (command ".ZOOM" "ALL")(prin1))
(defun C:ZD (command ".ZOOM" "DYNAMIC")(prin1))
(defun C:ZE (command ".ZOOM" "EXTENTS")(prin1))
(defun C:ZP (command ".ZOOM" "PREVIOUS")(prin1))
(defun C:ZR (command ".ZOOM" "REALTIME")(prin1))
(defun C:ZS (command ".ZOOM" "SCALE" ".9x")(prin1))
(defun C:ZW (command ".ZOOM" "WINDOW")(prin1))
(defun C:CON (command ".DIM" ".CONTINUE")(prin1))
(defun C:HOM (command ".DIM" ".HOME")(prin1))
(defun C:UP (command ".DIM" ".UPDATE")(prin1))

 

;;======= PBA Variables ===========
;;; Modified by Brian E. Mackey May 2002
(setvar "filletrad" 0.0).
(setvar "chamfera" 0.0)
(setvar "chamferb" 0.0)

 
 
It would take very little effort on your part to glean the information you need by simply starting at F1, and looking in the Customization Guide. As an alternative, simply browse some of the many, many, LISP routines that have been posted here and perhaps thousands of locations on the Web.

If you *really* need a bit of spoon-feeding, then try this: to automatically load LISP files named MyLisp01.lsp and MyLisp02.lsp, you would need only

(defun S::STARTUP
(load "MyLisp01")
(load "MyLisp02")
);;<-- this paren closes the S::STARTUP definition

To open additional files, just add more calls to the (load ...) function.
___

ChrisL said:
Paul,
I have no rest of the code. Which is probably the problem. When I open a
new DWG I either get an error saying I have an "extra rght paren on input" or something like that. Or "malformatted list" how should the S::STARTUP code end?
 
Thanks Mack any everyone else trying to help. I managed to retrieve my old file which is this:

(setq S::STARTUP (append S::STARTUP mystartup))

(defun c:breakat (command"break" pause "f" pause "@" )) (defun c:corner (command"fillet" "r" "0" "fillet" )) (defun c:ptx (command "pdmode" "3")) (load "lydelmrg") (load "thread") (load "spring") (load "3dspiral") (load "flatten") (load "xplode") (load "getarea") (load "clipit") (load "extrim") (load "polydis") (load "mstretch") (load "ssx") (load "attredef") (load "flipdim") (load "fudge") (load "heal") (load "bolt") (load "ai_utils") (load "ddptype") (load "txtmatch") (load "blkupd") (defun C:FLOAT (princ "\nSelect Objects to Float ...") (setq sset (ssget)) (if sset (progn (command "_.COPY" sset "" "0,0,0" "@") (command "_.ERASE" sset "") ) ) (princ) ) (load "blkscale") (load "cpy2layr") (load "insrot") (load "span12") (load "txt2mtxt") (defun C:CHGPREV &nbsp;&nbsp;(setq sset (ssget "P")) &nbsp;&nbsp;(if sset &nbsp;&nbsp;&nbsp;&nbsp;(progn &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(sssetfirst sset sset) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(command "_.PROPERTIES") &nbsp;&nbsp;&nbsp;&nbsp;) &nbsp;&nbsp;)
)

Thanks again.
 
.... and ... ? Are you saying this works, or not?
___

ChrisL said:
Thanks Mack any everyone else trying to help. I managed to retrieve my old
file which is this:
 

Latest threads

Back
Top