I have no AutoCAD experience, so is not something I can personally help
with. I agree with Andrius in that there are probably very few people
would need (or want) this kind of integration. On the other hand, if
AutoCAD has a .NET API then using IronRuby is a least a possibility.
Is there anyone in the IronRuby community familiar with AutoCAD and it’s
API’s willing to give Murat a hand with this?
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
That is the hardest part. It took me awhile to get step 1 to work.
Use either the “win32ole” library or .net libraries to connect to
excel. The best place I have found to read about the win32ole library
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.
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.
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.
I am happy to hear your noise. I hope that open source
programming languages will be very popular and attractive
for this type of programming (Acad, Office, and others).
So please you refresh and develop your gem…
On 03/09/2011 03:52 AM, David B. wrote:
But I would be willing to try again if there is some interest.
AL.cs - C# bridge (build project and type ‘netload’ in AutoCAD to load
resulting .dll file)
xl_2_acad.rb - after you have successfully load ironruby type ‘RBLOAD’ @
AutoCAD command prompt and select this file
xl_2_acad.xlsx - must be at location ‘C:\xl_2_acad.xlsx’ to work or
change ruby script
I have attached the code and excel files that I used. (the ruby code is
literally thrown together) Let me know if your were successful. I will
continue to try and get IronRuby 1+ to work and even possibly the
‘win32ole’ library since I am used to scripting excel with it instead of
the .net methods. Also I will try and get David’s helper methods up and