TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Luke on February 26, 2008, 09:02:52 AM

Title: Inserting a drawing with a lisp
Post by: Luke on February 26, 2008, 09:02:52 AM
I have a lisp file that is in my startup suite.  It load all my support lisps and now I think I want to make it load some support drawings.  Having trouble with that.

(command "insert" "LCC_Annotation.dwg")  :|
Title: Re: Inserting a drawing with a lisp
Post by: CAB on February 26, 2008, 09:26:33 AM
Short on time, but you should not use COMMAND in the start up.
Else look at this:
Code: [Select]
(setq sysattdia (getvar "ATTDIA"))
(setq sysattreq (getvar "ATTREQ"))
(setq systxteva (getvar "TEXTEVAL"))
(setvar "ATTDIA" 0)
(setvar "ATTREQ" 0)
(setvar "TEXTEVAL" 0)


    (command "-insert" bname "0,0,0" "1.0" "" "0.0" )


(setvar "ATTDIA"   sysattdia)
(setvar "ATTREQ"   sysattreq)
(setvar "TEXTEVAL" systxteva)
Title: Re: Inserting a drawing with a lisp
Post by: rkmcswain on February 27, 2008, 08:22:12 AM
As CAB says, the (command) function will generally not work in a startup lisp.

It needs to be defined in the S::STARTUP function.

Details on all of this are in the Customization Guide (http://www.kxcad.net/autodesk/autocad/AutoCAD_2008_Customization_Guide/WS73099cc142f4875513fb5cd10c4aa30d6b-7f62.htm)
Title: Re: Inserting a drawing with a lisp
Post by: mjfarrell on February 27, 2008, 08:31:35 AM
why not insert that dwg into the appropriate DWT?
Title: Re: Inserting a drawing with a lisp
Post by: Luke on February 27, 2008, 11:30:35 AM
I can and will be putting it in my template. 

However, I want it to be availabe for use in old drawings.  My template is brand new and only use when starting a new drawing.  But if going into an existing drawing I want this LCC_Annotation.dwg to load into the old drawings.