[Ironruby-core] [AutoCAD and IronRuby]

Timothy Barnes lists at ruby-forum.com
Wed Mar 2 15:40:39 EST 2011


I have played around with this.

There are 2 steps:

1. Using the example given in the "Through the Interface" post you have 
to use an existing .net language to create a "script engine" to allow 
AutoCAD and Ironruby to talk. You should be able to copy Kean Walmsley's 
script directly, pick the right .dll's for you version of AutoCAD, load 
them and in your project in either Visual Studio or I have used 
SharpDevelop, and follow the rest of Kean's directions to run scripts in 
AutoCAD.

That is the hardest part.  It took me awhile to get step 1 to work.

2. Use either the "win32ole" library or .net libraries to connect to 
excel. The best place I have found to read about the win32ole library 
is: http://rubyonwindows.blogspot.com/search/label/excel
If you want to use .net libraries and you can't find ironruby examples, 
find VB.net examples and the are the easiest to translate to ruby.

Side Notes:

1. MRI ruby can connect to autocad using the "win32ole" library. It is 
virtually the same as using VBA. Don't know how long this ability will 
last since VBA is going away.

2. David Blackmon has created helper libraries for drawing things in 
autocad at:
http://www.davidkblackmon.com/autocad
B/c coding autocad in .net is very messy.
My understanding is David took what Kean did in his post and tried 
improve and expand it.  Last I tried to get David's version to work I 
couldn't. But I knew a lot less then :) I am not sure if he is actively 
working on his autocad_helper library or not.

The previous commenters were correct in that there is not many people 
interested in this subject yet. I am.

I am constanly working in excel and autocad so I will be glad to answer 
any question that I can. If you can give me your version of windows and 
your version of Autocad I can probably get you started. From there you 
can explore the vast undiscovered potential the 2-3 other people 
interested in this subject get to wander in.

Timothy Barnes

-- 
Posted via http://www.ruby-forum.com/.


More information about the Ironruby-core mailing list