Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
65 Posts
1 Kudo
Registered: ‎07-23-2008
Post 1 of 5
Accepted Solution

Need help loading a particular net assembly

153 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.

(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
 

*Expert Elite*
3,600 Posts
550 Kudos
Registered: ‎12-17-2004
Post 2 of 5

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
65 Posts
1 Kudo
Registered: ‎07-23-2008
Post 3 of 5

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*
3,600 Posts
550 Kudos
Registered: ‎12-17-2004
Post 4 of 5

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*
3,600 Posts
550 Kudos
Registered: ‎12-17-2004
Post 5 of 5

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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!