Hi:
I hope somebody can help me. I am trying to create a simple 3D Box in AutoCAD 2007 using VB 2005 and ActiveX. Based on what I have read so far, it appears that I need to create a ComClass template and then use the NETLOAD AutoCAD command to load my unmanaged application. This is what I have for the ComClass template:
_
Public Class ComTFCBuild
#Region "COM GUIDs"
' These GUIDs provide the COM identity for this class
' and its COM interfaces. If you change them, existing
' clients will no longer be able to access the class.
Public Const ClassId As String = "bf4c0501-aede-4435-a7ad-63c8530bdffe"
Public Const InterfaceId As String = "999efde1-1898-48b8-98cc-39c6138b7f13"
Public Const EventsId As String = "efbb0675-80f8-4803-97a5-347501575f7f"
#End Region
' A creatable COM class must have a Public Sub New()
' with no parameters, otherwise, the class will not be
' registered in the COM registry and cannot be created
' via CreateObject.
Public Sub New()
MyBase.New()
End Sub
Public Sub Start()
Dim MyBox As New ClsMyBox
MyBox.Create()
End Sub
End Class
And this is what I have for the ClsMyBox class:
Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.Common
Public Class ClsMyBox
Public Sub Create()
Dim ObjAcad As New AcadApplication
Dim ThisDrawing As AcadDocument
Dim Obj As Acad3DSolid
Dim ZeroOrgin() As Double = {0, 0, 0}
ObjAcad.Visible = True
ThisDrawing = ObjAcad.ActiveDocument
Obj = ThisDrawing.ModelSpace.AddBox(ZeroOrgin, 2, 4, 😎
End Sub
End Class
Is this the way it is supposed to work? If it is, then how do I tell AutoCAD to use the Start routine after executing the NETLOAD command?
Thanks in advance for your help.
Raul Aguilar
McMichaels Design Group