Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
Posts: 65
Registered: ‎07-23-2008
Message 1 of 5 (124 Views)
Accepted Solution

Need help loading a particular net assembly

124 Views, 4 Replies
01-23-2013 07:27 AM

Hello everybody,

 

I need a little bit of help because I don't know how to program in lisp. I have a master lisp routine that runs when Autocad is opening. I have some computers running Autocad 2010 and others with Autocad 2012 and from the master lisp routine (which is the same) I need to load a net assembly (one for Autocad 2010 or another for Autocad 2012).

 

I was thinking to query for Autocad version and if it is Autocad 2010, then load the first dll, or if it is Autocad 2012 then load the second dll, but I don't know how to do this in lisp.

 

Thank you very much for your help.

 

e.g.

*Expert Elite*
Posts: 2,387
Registered: ‎12-17-2004
Message 2 of 5 (117 Views)

Re: Need help loading a particular net assembly

01-23-2013 07:38 AM in reply to: e.g.
(if (Equal (getvar "ACADVER") "18.s (LMS Tech)" );AC2012
  (load "Ac2012xxxxx.dll")
    ); if not, do not do anything
(if (Equal (getvar "ACADVER") "18.0s (LMS Tech)" );AC2010
  (load "Ac2010xxxxx.dll")
    ); if not, do not do anything

 

Hope that helps

 

Henrique
 

Valued Contributor
Posts: 65
Registered: ‎07-23-2008
Message 3 of 5 (110 Views)

Re: Need help loading a particular net assembly

01-23-2013 07:52 AM in reply to: hmsilva

Yes, thank you very much.

 

e.g.

*Expert Elite*
Posts: 2,387
Registered: ‎12-17-2004
Message 4 of 5 (108 Views)

Re: Need help loading a particular net assembly

01-23-2013 07:53 AM in reply to: e.g.

You're welcome, e. g.

 

EDITED

 

e. g. wrote:
...I need to load a net assembly..


Sorry, I have read too fast!!!

 

(if (and (Equal (getvar "ACADVER") "18.s (LMS Tech)") ;AC2012
	 (findfile "Ac2012xxxxx.dll")
    )
  (vl-cmdf "netload" "Ac2012xxxxx.dll")
); if not, do not do anything
(if (and (Equal (getvar "ACADVER") "18.0s (LMS Tech)") ;AC2010
	 (findfile "Ac2012xxxxx.dll")
    )
  (vl-cmdf "netload" "Ac2010xxxxx.dll")
); if not, do not do anything

 

Henrique

*Expert Elite*
Posts: 2,387
Registered: ‎12-17-2004
Message 5 of 5 (94 Views)

Re: Need help loading a particular net assembly

01-23-2013 08:47 AM in reply to: e.g.

and a typo

 

where is "18.s (LMS Tech)"  should be "18.2s (LMS Tech)" for AC2012

 

Henrique

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
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

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

Ask the Community