.NET

.NET

Reply
Active Contributor
41 Posts
0 Kudos
Registered: ‎04-27-2005
Post 1 of 9

Load a VB.NET dll with a Lisp routine

517 Views, 8 Replies
06-19-2006 07:10 AM
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
Distinguished Contributor
303 Posts
1 Kudo
Registered: ‎09-26-2004
Post 2 of 9

Re: Load a VB.NET dll with a Lisp routine

06-19-2006 07:45 AM in reply to: as
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.
Active Contributor
41 Posts
0 Kudos
Registered: ‎04-27-2005
Post 3 of 9

Re: Load a VB.NET dll with a Lisp routine

06-19-2006 10:07 AM in reply to: as
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 ?
Distinguished Contributor
303 Posts
1 Kudo
Registered: ‎09-26-2004
Post 4 of 9

Re: Load a VB.NET dll with a Lisp routine

06-19-2006 11:17 AM in reply to: as
[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]
*Mark Gardiner
Post 5 of 9

Re: Load a VB.NET dll with a Lisp routine

06-19-2006 06:36 PM in reply to: as
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 ?
Active Contributor
41 Posts
0 Kudos
Registered: ‎04-27-2005
Post 6 of 9

Re: Load a VB.NET dll with a Lisp routine

06-19-2006 10:06 PM in reply to: as
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
Active Contributor
41 Posts
0 Kudos
Registered: ‎04-27-2005
Post 7 of 9

Re: Load a VB.NET dll with a Lisp routine

06-19-2006 10:16 PM in reply to: as
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.
*Mark Gardiner
Post 8 of 9

Re: Load a VB.NET dll with a Lisp routine

06-20-2006 12:20 AM in reply to: as
from the autocad help

(defun-q MYSTARTUP ( )... your startup function ... )(setq S::smileyfrustrated:TARTUP
(append S::smileyfrustrated:TARTUP 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.
*R. Robert Bell
Post 9 of 9

Re: Load a VB.NET dll with a Lisp routine

06-20-2006 08:18 AM in reply to: as
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::smileyfrustrated:tartup 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::smileyfrustrated:TARTUP
(append S::smileyfrustrated:TARTUP 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.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post