Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Trouble switching to acaddoc.lsp from acad.lsp

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
260 Views, 6 Replies

Trouble switching to acaddoc.lsp from acad.lsp

Can't I just put a single lone line like
this in acaddoc.lsp to run on the
startup of every drawing?:
(load "myfile.lsp")

When I was using the previous setup with
acad.lsp, I only loaded additional
routines like this:
(defun c:LABEL() (load "LABEL.lsp")
(c:label))
...so that it was only loaded if you
call it

But, now I've got half of my routines in
a separate file that I want to load
every time. Does this need to go in the
c:startup format? Maybe that's what I've
done wrong.

thanks,
Paul
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Anonymous

Specifically, a shortcut version of mtext
"MT" does not work correctly as if perhaps
acad.pgp were overwriting my custom
definition with the standard command. Maybe
this is the problem... that the pgp file
operates in a different sequence with
acaddoc.lsp versus acad.lsp?

When I pull up the appload dialogue box,
myfile.lsp shows (greyed out) in the list of
"loaded applications" but at least some of
the commands defined there do not work until
I manually load the file. I may have other
versions floating around, or at least at
work, there is an acad.lsp that may be
overwriting somehow. Sorry if I'm a bit
muddled about this. I don't see that the old
version is loading but wonder because I have
had so many versions bouncing around in this
transition.


> Can't I just put a single lone line like
> this in acaddoc.lsp to run on the
> startup of every drawing?:
> (load "myfile.lsp")
>
> When I was using the previous setup with
> acad.lsp, I only loaded additional
> routines like this:
> (defun c:LABEL() (load "LABEL.lsp")
> (c:label))
> ...so that it was only loaded if you
> call it
>
> But, now I've got half of my routines in
> a separate file that I want to load
> every time. Does this need to go in the
> c:startup format? Maybe that's what I've
> done wrong.
>
> thanks,
> Paul
Message 3 of 7
Anonymous
in reply to: Anonymous

Paul,

Why not use this in your ACAD.lsp

;chargement automatique de ACAD.lsp pour chaque nouveau dessin de la session
courante
(setvar "ACADLSPASDOC" 1)

So acad.lsp is loaded in each drawing, and you can work as before.

Bernard
ATC
45700 Villemandeur
France
Paul Furman a écrit dans le message :
3BB750F6.BDEFF0D8@edgehill.net...
> Can't I just put a single lone line like
> this in acaddoc.lsp to run on the
> startup of every drawing?:
> (load "myfile.lsp")
>
> When I was using the previous setup with
> acad.lsp, I only loaded additional
> routines like this:
> (defun c:LABEL() (load "LABEL.lsp")
> (c:label))
> ...so that it was only loaded if you
> call it
>
> But, now I've got half of my routines in
> a separate file that I want to load
> every time. Does this need to go in the
> c:startup format? Maybe that's what I've
> done wrong.
>
> thanks,
> Paul
>
Message 4 of 7
Anonymous
in reply to: Anonymous

Darn, that's pretty much how I had it before. That's a good way to set it up
automatically if I can't make this work though, thanks.

I tried deleting the competing entry in acad.pgp & it had no effect.

I did a test, after setting the visual lisp editor to debug > animate mode to
track what was happening, it would run some of the commands defined in
myfile.lsp but not animated as I would expect.

What I've been doing is just typing (load "myfile") when I run across the
missing mtext shortcut to make it load properly so I did that... & the commands
suddenly begin running in animated mode as expected.

Hmmm?



Bernard Flavignard wrote:

> Paul,
>
> Why not use this in your ACAD.lsp
>
> ;chargement automatique de ACAD.lsp pour chaque nouveau dessin de la session
> courante
> (setvar "ACADLSPASDOC" 1)
>
> So acad.lsp is loaded in each drawing, and you can work as before.
>
> Bernard
> ATC
> 45700 Villemandeur
> France
> Paul Furman a écrit dans le message :
> 3BB750F6.BDEFF0D8@edgehill.net...
> > Can't I just put a single lone line like
> > this in acaddoc.lsp to run on the
> > startup of every drawing?:
> > (load "myfile.lsp")
> >
> > When I was using the previous setup with
> > acad.lsp, I only loaded additional
> > routines like this:
> > (defun c:LABEL() (load "LABEL.lsp")
> > (c:label))
> > ...so that it was only loaded if you
> > call it
> >
> > But, now I've got half of my routines in
> > a separate file that I want to load
> > every time. Does this need to go in the
> > c:startup format? Maybe that's what I've
> > done wrong.
> >
> > thanks,
> > Paul
> >
Message 5 of 7
Anonymous
in reply to: Anonymous

OK well... just so you know....

I simply pasted the separate routines all into my acaddoc.lsp & it works
perfectly again. I even tried renaming it acad.lsp & that wasn't the
problem . Anyways, it's all solved.
Message 6 of 7
Anonymous
in reply to: Anonymous

Paul
you might find it useful to look at the Autoload function for this purpose,
I use a heap in the .mnl file of my partial menu to my apparent success.
cheers
Steve

Paul Furman wrote in message
news:3BB750F6.BDEFF0D8@edgehill.net...
> routines like this:
> (defun c:LABEL() (load "LABEL.lsp")
> (c:label))
> ...so that it was only loaded if you
> call it
Message 7 of 7
Anonymous
in reply to: Anonymous

Thanks, that was suggested by someone else but I have a dozen or more & always
changing commands defined in this lisp file... good to know for the example I
showed below though!

From the help files:

Adding the following code to your acaddoc.lsp file automatically loads the
commands CMD1, CMD2, and CMD3 from the cmds.lsp file:
(autoload "CMDS" '("CMD1" "CMD2" "CMD3"))

and the NEWCMD command from the newcmd.lsp file:
(autoload "NEWCMD" '("NEWCMD"))

Scribble wrote:

> Paul
> you might find it useful to look at the Autoload function for this purpose,
> I use a heap in the .mnl file of my partial menu to my apparent success.
> cheers
> Steve
>
> Paul Furman wrote:
> > routines like this:
> > (defun c:LABEL() (load "LABEL.lsp")
> > (c:label))
> > ...so that it was only loaded if you
> > call it

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost