Load a LISP at startup of a template
Load a LISP at startup of a template
(OP)
Hi you all
I would like to post this question:
How could I load a certain LISP when I open a certain Template? I'm thinking of embedding a VBA macro in that template. The VBA macro would then trigger on EndOpen and load the LISP. But I can't seem to get it to work! Does anyone out there have a clue about this or maybe have a suggestion on a better way?.
---------------------------------------------------
Nothing's impossible, it just takes a little longer
I would like to post this question:
How could I load a certain LISP when I open a certain Template? I'm thinking of embedding a VBA macro in that template. The VBA macro would then trigger on EndOpen and load the LISP. But I can't seem to get it to work! Does anyone out there have a clue about this or maybe have a suggestion on a better way?.
---------------------------------------------------
Nothing's impossible, it just takes a little longer





RE: Load a LISP at startup of a template
In embedded Project of that template, as you said,
ThisDrawing.SendCommands (load "myLisp")
ThisDrawing.SendCommands MyLispCommand
Assuming Acad2000.
This wiont do in Acad14
RE: Load a LISP at startup of a template
Problem is I don't know how to get the event EndOpen to trigger. Once that is done I don't think I will have a problem with loading the LISP :)
And thank you for mentioning that it will only work in 2000. Do you or does someone have a clue how to get it to work in R14 as well?
Thank you in advance!
----------------------------------------------
Nothing's impossible, it just takes a bit longer
RE: Load a LISP at startup of a template
I managed to get to he endOpen in Acad14 but could not embed the project in the drawing. Though I think I had done this before.
Menu-Tools-Macro-VBEditor
Click on ThisDrawing - Code
AcadDocument (in the first dropList box)
EndOpen (in the second dropList box)
sendKeys "myLispCommand" & vbCrLf, 1
In Acad2000.
EndOpen is not there!
EndSave etc are there thoug, useless for our purpose here.
Lets wait for more comments.
Thanks
RE: Load a LISP at startup of a template
Acad2k
I think the EndOpen event is an application event in 2k. And as I beginning to understand it one has to initialize the event handler as a class module, before any event will be recognized. But how to run the event initialization? I mean I want the code to run on an event first thing it does!
Acad14
I got the code to work according to your post:)
But as you I couldn't find a way to embed it.
Let's see if anything else drops in...
Thanks
-----------------------------------------------------
Nothing's impossible, it just takes a little longer