Do you need to write it in VB6?
It can be done right from the VBIDE if you want ...
But since you asked ...
IMHO the AC object should NEVER be added to a VB program except at runtime, otherwise you create problems that occur between the object model of different versions of AutoCAD....
So how do you do it???
I know you asked for no code, but in the interest of helping you in your endevour (plus I already use this function alot in VB) I will share it ...
'Function to find AutoCAD or load it if not found
Function GetAcadObject() As Object
'Get the AutoCAD.Application as defined in the registry
Set GetAcadObject = GetObject(, "AutoCAD.Application")
'if we could not get it, then it is not running so...
If Err <> 0 Then
Err.Clear
'lets create it ..i.e. start AutoCAD
Set GetAcadObject = CreateObject("AutoCAD.Application")
If Err <> 0 Then
'if we can't start it then notify the user
MsgBox "Could not load or find AutoCAD.", vbExclamation
End
End If
End If
End Function
The function call is used in this scenario:
Dim AC as Object
Set AC = GetAcadObject
Now this does not help you in programming the task at hand, because you do not have the object model loaded into VB6, to add it do this ...
In your VB6 program select Project->References
Scroll to the AutoCAD200xType Library and check the box
To be able to access the AutoCAD object model in VB6 define all of your variable types (i.e. Drawing, Line etc.) as the appropriate AutoCAD types. This includes the above example, rather than define AC as an object (which it should be in the final build) define it as AcadApplication. This will improve your ability to write code in the IDE. Once you have completed your coding and the program works properly, go back and put in generic types for the AutoCAD objects (i.e. As Object) and if you use any AutoCAD types for other variable DIMs change them to either a Variant or equivalent VB data type.
Now, there are some other issues that you probably will encounter, but I will let you tell me what they are and I will address them as the need arises.