.NET

Reply
Active Contributor as
Active Contributor
as
Posts: 41
Registered: ‎04-27-2005
Message 1 of 9 (443 Views)

Load a VB.NET dll with a Lisp routine

443 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
Alexander Rivilis
Posts: 303
Registered: ‎09-26-2004
Message 2 of 9 (443 Views)

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 as
Active Contributor
as
Posts: 41
Registered: ‎04-27-2005
Message 3 of 9 (443 Views)

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
Alexander Rivilis
Posts: 303
Registered: ‎09-26-2004
Message 4 of 9 (443 Views)

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
Message 5 of 9 (443 Views)

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 as
Active Contributor
as
Posts: 41
Registered: ‎04-27-2005
Message 6 of 9 (443 Views)

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 as
Active Contributor
as
Posts: 41
Registered: ‎04-27-2005
Message 7 of 9 (443 Views)

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
Message 8 of 9 (443 Views)

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
Message 9 of 9 (443 Views)

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.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community