Message 1 of 5
How to make .bundle install run a command each time drawing is opened
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I've got a project that has one lisp function I want to run at the beginning of the session, "acad.lsp style"...and a different function that I want to run each time a document is opened, "acaddoc.lsp style". Both functions run fine when starting the session but the "per Document" code never runs when opening a new document. Can someone help?
Here is my test code:
(defun c:PerSessionCommand () (princ "\nAddin Per Session running...") (princ) ) (defun c:PerDocumentCommand () (princ "\nAddin Per Document running...") (princ) )
Here are my components from PackageContents.xml
<Components>
<RuntimeRequirements OS="Win64" Platform="AutoCAD*" SeriesMin="R20.0" SeriesMax="R22.0" />
<ComponentEntry
AppName="StartupPerDocument"
ModuleName="./Contents/testStartup.lsp"
PerDocument="True"
LoadOnAutoCADStartup="True">
<Commands GroupName="StartupPerDocument">
<Command Local="PerDocumentCommand" Global="PerDocumentCommand" StartupCommand="True" />
</Commands>
</ComponentEntry>
<ComponentEntry
AppName="StartupPerSession"
ModuleName="./Contents/testStartup.lsp"
PerDocument="False"
LoadOnAutoCADStartup="True">
<Commands GroupName="StartupPerSession">
<Command Local="PerSessionCommand" Global="PerSessionCommand" StartupCommand="True" />
</Commands>
</ComponentEntry>
</Components>
This is starting the session when both run fine.
Nothing from addin runs when opening a new document.
I must be missing something. Right?
James LeVieux