AcousticalConsultant
Technical User
Hello,
I've created a VBA program within AutoCAD which creates a graph based on user input values. The program contains a class for the graph itself and a class for each curve that is plotted. It works great within AutoCAD, but I would like to extend the functionality to within Excel. That is, I would like to have a macro in Excel that allows the user to highlight the cells which he would like graphed and then the macro creates a graph in AutoCAD using my program.
As I see it, there are two ways of doing this and I can't seem to get either of them to work. The first (preferred) way is to be able to use my user-defined classes inside Excel so that when I instantiate a class, it would perform the work within AutoCAD. I've already linked a reference to AutoCAD and I can define AutoCAD types, but it doesn't see my own classes. How can I reference user-defined classes?
The other way would be to simply gather all the values inside Excel and pass them all into AutoCAD. However, I seem to only be able to "Run" an AutoCAD macro from within Excel. It doesn't let me pass any values or parameters.
I guess a final way would be for Excel to create a text file, dump all the data in there and then have AutoCAD retrieve it. But if possible, I would like the first method to work. It just seems like the most elegant solution.
Any ideas?
Oh, while I'm at it, about the part of letting the user highlight cells in Excel, when a user form is loaded, the user can't do anything other than interact with the form. Is there any way to have a user-form write "Select the desired cells" and allow the user the control to select them, like when creating a graph in Excel, you can click the little "select values" icon and as you drag and select cells, it automatically enters the formula into the textbox.
Any help is appreciated!
Thanks!
I've created a VBA program within AutoCAD which creates a graph based on user input values. The program contains a class for the graph itself and a class for each curve that is plotted. It works great within AutoCAD, but I would like to extend the functionality to within Excel. That is, I would like to have a macro in Excel that allows the user to highlight the cells which he would like graphed and then the macro creates a graph in AutoCAD using my program.
As I see it, there are two ways of doing this and I can't seem to get either of them to work. The first (preferred) way is to be able to use my user-defined classes inside Excel so that when I instantiate a class, it would perform the work within AutoCAD. I've already linked a reference to AutoCAD and I can define AutoCAD types, but it doesn't see my own classes. How can I reference user-defined classes?
The other way would be to simply gather all the values inside Excel and pass them all into AutoCAD. However, I seem to only be able to "Run" an AutoCAD macro from within Excel. It doesn't let me pass any values or parameters.
I guess a final way would be for Excel to create a text file, dump all the data in there and then have AutoCAD retrieve it. But if possible, I would like the first method to work. It just seems like the most elegant solution.
Any ideas?
Oh, while I'm at it, about the part of letting the user highlight cells in Excel, when a user form is loaded, the user can't do anything other than interact with the form. Is there any way to have a user-form write "Select the desired cells" and allow the user the control to select them, like when creating a graph in Excel, you can click the little "select values" icon and as you drag and select cells, it automatically enters the formula into the textbox.
Any help is appreciated!
Thanks!