View Full Version : Excel VBA to Lisp
LSElite
2015-02-04, 05:14 AM
Hey All
I am currently making a spreadsheet used for managing our autocad drawings.
It currently works by being read from autocad and manipulating the drawings from inside autocad.
Is there a way of working in reverse and running a program from excel(VBA) so that it can open cad and run lisp routines?
Cheers
peter
2015-02-04, 08:32 PM
I have never done that but I am sure it is possible.
I will have to think on that one.
Using .net would be the way I would do that instead of vba
P=
dgorsman
2015-02-04, 10:20 PM
Possible via COM, but far easier to have AutoCAD consume the workbook/worksheet as a data source. Do you see an advantage to running AutoCAD from the outside?
LSElite
2015-02-05, 01:51 AM
Cheers for the feed back guys.
The advantage I see from running lisp outside of cad is purely circumstantial.
I have a drawing management system that we complete when we start a new job.
It creates the drawing files, manages titleblock information along with a few other perks, but is unable to reach into the .dwg files and manipulate them.
as it stands this is a separate step using script pro on all the drawings.
I would simply like to make it so when we generate the drawings from the excel sheet, it can open each cad file and run the setup routine instead of having this additional step.
It is not a major issue but with more and more aspects of our drawings getting managed from this register I can see more opportunities for excel to interact with cad.
peter
2015-02-05, 03:09 AM
I would write it in VB.net (or c#)
I would suggest Jerry Winters book on VB.Net for AutoCAD.
It has examples on how to run AutoCAD from a windows application.
It should be possible to create a link that would allow you to call that application from VBa inside Excel.
There may be examples to add the AutoCAD application to VBa inside Excel available.
P=
LSElite
2015-02-05, 03:52 AM
Cheers Peter.
I've been interested at looking into .net for awhile (hoping to try my hand at revit programming one of these days).
This sounds like a great way of getting started.
Do you know where I could find a copy of the book? (preferably in Australia)
Even an ebook would be good (would save me the 3 months of shipping...)
peter
2015-02-05, 06:20 AM
http://www.vbcad.com/vbcadbooks.htm
dgorsman
2015-02-05, 07:31 PM
Ah, so you want the drawings to react to changes from outside AutoCAD. *Very* tricky to get that right e.g. what happens if the file is open already?
Since this is a set-up type procedure and the drawings will be modified anyways, it would be easy enough to have the drawing check back with the Excel file when a user opens it in read-write mode (no point doing anything if its read-only) and prompt for changes, or make the changes silently, set a flag to avoid repeating, etc.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.