Running a macro from acad.lsp...?

Status
Not open for further replies.

Alain

Usenet Archive
Joined
Apr 18, 2000
Messages
16
Reaction score
0
Hi all.

I need to run a specific macro at acad startup. I've been told on this site that you can do this through the ACAD.LSP file, which is suppose to be executed at AutoCAD startup. Now my problem with that is quite simple: I don't know squat about coding in lisp... Could anyone that knows LISP enough could give me an example of what I need to write in my ACAD.LSP file? I assume that it needs only a few lines of codes.

Thanks!

Alain
 
what do you want to have happen at startup??
Dave
"alain" wrote:

Hi all.

I need to run a specific macro at acad startup. I've been told on this
site
that you can do this through the ACAD.LSP file, which is suppose to be executed at AutoCAD startup. Now my problem with that is quite simple: I don't know squat about coding in lisp... Could anyone that knows LISP enough could give me an example of what I need to write in my ACAD.LSP
file?
I assume that it needs only a few lines of codes.

Thanks!

Alain
 
I want autocad to run a specific macro on startup. The macro itself might change, so that's why I need to trigger it through the ACAD.LSP file, which I'll be able to change at will. This is for a document control software I'm trying to write, where, depending on the users entry, autocad will open a document automatiically, change a value in the Title Block, print it and close itself. That would be one macro. I will have more to manage.
"Dave Jones" wrote:

what do you want to have happen at startup??
Dave
"alain" wrote:

> Hi all.
>
> I need to run a specific macro at acad startup. I've been told on this site
> that you can do this through the ACAD.LSP file, which is suppose to be
> executed at AutoCAD startup. Now my problem with that is quite simple:
I
> don't know squat about coding in lisp... Could anyone that knows LISP
> enough could give me an example of what I need to write in my ACAD.LSP file?
> I assume that it needs only a few lines of codes.
>
> Thanks!
>
> Alain
>
>
 
if you can do it with a script (.scr) file, you can launch a script by using acad launch switches behind the target in the properties of a desktop launch icon, otherwise make a .mnl file (if you don't have one already)by the exact same name of your menu, anything in here will load when menu is loaded.
"alain" wrote:

I want autocad to run a specific macro on startup. The macro itself might change, so that's why I need to trigger it through the ACAD.LSP file,
which
I'll be able to change at will.
This is for a document control software I'm trying to write, where, depending on the users entry, autocad will open a document automatiically, change a value in the Title Block, print it and close itself. That would
be
one macro. I will have more to manage.
"Dave Jones" wrote:

> what do you want to have happen at startup??
> Dave
> "alain" wrote:
>
> > Hi all.
> >
> > I need to run a specific macro at acad startup. I've been told on
this
> site
> > that you can do this through the ACAD.LSP file, which is suppose to be
> > executed at AutoCAD startup. Now my problem with that is quite
simple:
I
> > don't know squat about coding in lisp... Could anyone that knows LISP
> > enough could give me an example of what I need to write in my ACAD.LSP
> file?
> > I assume that it needs only a few lines of codes.
> >
> > Thanks!
> >
> > Alain
> >
> >
>
...
 
Thanks for the answer, but it doesn't solve my problem. I know I can execute any acad command from a script, my problem is that I don't know how to write the script it self.... Does anyone has a sample or something? thanks.
"KBenoit" wrote:

if you can do it with a script (.scr) file, you can launch a script by
using
acad launch switches behind the target in the properties of a desktop
launch
icon, otherwise make a .mnl file (if you don't have one already)by the
exact
same name of your menu, anything in here will load when menu is loaded.
"alain" wrote:

> I want autocad to run a specific macro on startup. The macro itself
might
> change, so that's why I need to trigger it through the ACAD.LSP file, which
> I'll be able to change at will.
> This is for a document control software I'm trying to write, where,
> depending on the users entry, autocad will open a document
automatiically,
> change a value in the Title Block, print it and close itself. That
would
be
> one macro. I will have more to manage.
> "Dave Jones" wrote:
>
> > what do you want to have happen at startup??
> > Dave
> > "alain" wrote:
> >
> > > Hi all.
> > >
> > > I need to run a specific macro at acad startup. I've been told on this ...
be
> > > executed at AutoCAD startup. Now my problem with that is quite simple:
> I
> > > don't know squat about coding in lisp... Could anyone that knows
LISP
> > > enough could give me an example of what I need to write in my
ACAD.LSP
> > file?
> > > I assume that it needs only a few lines of codes.
> > >
> > > Thanks!
> > >
> > > Alain
> > >
> > >
> >
> >
>
>
 
well, there are various shareware script utilities around that do this, or you can do it the free way. Download DOSLIB from www.mcneel.com (free) and use this to create a script for all drawings in the current directory

(defun C:MYSCRIPT (/ scrfile dwgfile)
(dos_chdir (getvar "dwgprefix"))
(setq scrfile (open "MYSCRIPT.SCR" "w"))
(foreach dwgfile (setq dir (dos_dir "*.dwg"))
(write-line (strcat "open " (dos_pwdir) dwgfile) scrfile) (write-line (strcat "DOSOMETHING " "DOSOMETHING " "DOSOMETHING") scrfile)) (close scrfile) ) hth, Dave

"alain" wrote:

Thanks for the answer, but it doesn't solve my problem. I know I can execute any acad command from a script, my problem is that I don't know
how
to write the script it self.... Does anyone has a sample or something? thanks.
"KBenoit" wrote:

> if you can do it with a script (.scr) file, you can launch a script by using
> acad launch switches behind the target in the properties of a desktop launch
> icon, otherwise make a .mnl file (if you don't have one already)by the exact
> same name of your menu, anything in here will load when menu is loaded.
> "alain" wrote:
...
to
be
> > > > executed at AutoCAD startup. Now my problem with that is quite
> simple:
> > I
> > > > don't know squat about coding in lisp... Could anyone that knows LISP
> > > > enough could give me an example of what I need to write in my ACAD.LSP
> > > file?
> > > > I assume that it needs only a few lines of codes.
> > > >
> > > > Thanks!
...
 
Status
Not open for further replies.

Latest threads

Back
Top