Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

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

Need help loading a particular net assembly

141 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*
hmsilva
Posts: 2,645
Registered: ‎12-17-2004
Message 2 of 5 (134 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
e.g.
Posts: 65
Registered: ‎07-23-2008
Message 3 of 5 (127 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*
hmsilva
Posts: 2,645
Registered: ‎12-17-2004
Message 4 of 5 (125 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*
hmsilva
Posts: 2,645
Registered: ‎12-17-2004
Message 5 of 5 (111 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
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