Load a VB.NET dll with a Lisp routine

Load a VB.NET dll with a Lisp routine

Anonymous
Not applicable
1,380 Views
8 Replies
Message 1 of 9

Load a VB.NET dll with a Lisp routine

Anonymous
Not applicable
I am used to load my VB.NET library's with a lisp routine.

This lisp routine is added to the "Startup Suite", so it should be loaded every time I start this profile of Autocad.
When I look in the list of loaded applications, this lisp routine shows up, so it should be loaded. If this is so then the command line in it (load the VB.NET dll) is not executed.

When I add this line to the Acad.lsp the dll will be loaded, but then it will be loaded in every profile and that is not what I want.

Is there another method to just load the dll I want in the profile I have chosen ? It should happen automaticly since my users dont want to push a button to start the loading of the dll.

with kind regards,

Harold van Aarsen
0 Likes
1,381 Views
8 Replies
Replies (8)
Message 2 of 9

Anonymous
Not applicable
How you try to load VBA.NET dll? With (command ..) function?
I've not tested that but you can try to load it with (vla-SendCommand ...) function.
0 Likes
Message 3 of 9

Anonymous
Not applicable
I use the following line:

(command "Netload" "c:/hsb-assist/Vz_Settings/DotNet/2006/acVogelzang2006.dll")

Could you tell me something more about the val-sendcommand ?
0 Likes
Message 4 of 9

Anonymous
Not applicable
[code]
(setvar "filedia" 0)
(vl-load-com)
(vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "_.netload \"c:/hsb-assist/Vz_Settings/DotNet/2006/acVogelzang2006.dll\"\n")
[/code]
0 Likes
Message 5 of 9

Anonymous
Not applicable
where have you put it?

if it is in your acaddoc.lsp it may be exicuted before the command line is
initialized so doesn't actually run. if so look at (defun s::startup) this
is run after the commandline is initilaized.


wrote in message news:5210988@discussion.autodesk.com...
I use the following line:

(command "Netload"
"c:/hsb-assist/Vz_Settings/DotNet/2006/acVogelzang2006.dll")

Could you tell me something more about the val-sendcommand ?
0 Likes
Message 6 of 9

Anonymous
Not applicable
Could you give me an example of how to create a lisp routine with the s::startup routine so the netload wil be performed after initialization.

This because netload has to performed after initialization
0 Likes
Message 7 of 9

Anonymous
Not applicable
is it this simple ????!

(defun s::startup ()
(command "Netload" "c:/hsb-assist/Vz_Settings/DotNet/2006/acVogelzang2006.dll")
);defun s::startup

It seems do its job just fine.

Please if somebody has other ideas please tell them here I am always in for improvement.
0 Likes
Message 8 of 9

Anonymous
Not applicable
from the autocad help

(defun-q MYSTARTUP ( )... your startup function ... )(setq S::STARTUP
(append S::STARTUP MYSTARTUP))note this will run each time a drawing is
loaded wrote in message
news:5211693@discussion.autodesk.com...
is it this simple ????!

(defun s::startup ()
(command "Netload"
"c:/hsb-assist/Vz_Settings/DotNet/2006/acVogelzang2006.dll")
);defun s::startup

It seems do its job just fine.

Please if somebody has other ideas please tell them here I am always in for
improvement.
0 Likes
Message 9 of 9

Anonymous
Not applicable
Harold, you do need to use the append approach shown in the documentation.
The approach you used in your post overwrites any other prior startup
functions, which could cause other customizations to fail.

Also, the append approach assumes the other developers used defun-q when
they appended to the S::Startup function, which can be a poor assumption.

<>

--
R. Robert Bell


"Mark Gardiner" wrote in message
news:5211718@discussion.autodesk.com...
from the autocad help

(defun-q MYSTARTUP ( )... your startup function ... )(setq S::STARTUP
(append S::STARTUP MYSTARTUP))note this will run each time a drawing is
loaded wrote in message
news:5211693@discussion.autodesk.com...
is it this simple ????!

(defun s::startup ()
(command "Netload"
"c:/hsb-assist/Vz_Settings/DotNet/2006/acVogelzang2006.dll")
);defun s::startup

It seems do its job just fine.

Please if somebody has other ideas please tell them here I am always in for
improvement.
0 Likes