Public Class Form1
Private Sub MySub()
Connect2ACAD() 'procedure that checks for running autocad and opens new if not open.
Dim oApp As AcadApplication
Dim oDoc As AcadDocument
oApp = GetActiveObject("AutoCAD.Application.16")
oApp.Visible = True
oDoc = oApp.Documents.Open(filenam)
The inputs and outputs of the function I have in VBA are all double datatype where the output is the area of a region created.
I know there's a RunMacro command, but this can't be used with input parameters or outputs. Any help whatsoever would be greatly appreciated - including better methods to start from scratch. Thanks,
The only way I figured out how to get around it is the same way that I get LISP to talk with VBA or VB .net...Have the VB.net program write a txt file with the data needed for the VBA function...Then VBA reads in the file selecting what it needs...Then VBA writes out a file that tells VB.net what it needs...If you use "RunMacro" I think .net waits for it to finish...I could be wrong though...I know that if you run it from the command line via "SendCommand" .net waits...I know this is a conveluded way to do it, but I have no idea how else to make it work...Hope this helped...