Click here to Skip to main content
15,916,463 members
Home / Discussions / COM
   

COM

 
GeneralCSocket & critical sections under IIS 6 Pin
Sorin28-Mar-05 15:43
Sorin28-Mar-05 15:43 
Generalmutithreading in com Pin
satishrg27-Mar-05 17:08
satishrg27-Mar-05 17:08 
GeneralIMAGES TO MOVIE file Pin
Emiliano27-Mar-05 14:16
Emiliano27-Mar-05 14:16 
GeneralConsuming .NET events in unmanaged code Pin
ischen_s127-Mar-05 5:02
ischen_s127-Mar-05 5:02 
Generalautocad and VB Pin
everzwijn227-Mar-05 4:40
everzwijn227-Mar-05 4:40 
GeneralRe: autocad and VB Pin
mlatimer29-Mar-05 8:38
mlatimer29-Mar-05 8:38 
GeneralRe: autocad and VB Pin
everzwijn230-Mar-05 6:34
everzwijn230-Mar-05 6:34 
GeneralRe: autocad and VB Pin
mlatimer30-Mar-05 18:53
mlatimer30-Mar-05 18:53 
Using VB 6:

Start a new EXE project.
From project menu, select references.
Tick AutoCAD 2xxx Type Library.
Create your UI.

The rectangle is probably to be made up of 4 seperate lines.
The code will need to connect to AutoCAD (or open/start it if it is not already started).
Get the current drawing database.
Create the lines.

To connect to AutoCAD, somthing like:

Sub Ch2_ConnectToAcad()
Dim acadApp As AcadApplication
On Error Resume Next

Set acadApp = GetObject(, "AutoCAD.Application.16")
If Err Then
Err.Clear
Set acadApp = CreateObject("AutoCAD.Application.16")
If Err Then
MsgBox Err.Description
Exit Sub
End If
End If
MsgBox "Now running " + acadApp.Name +
" version " + acadApp.Version
End Sub

Next, set the document variable to the Document object in the AutoCAD application. The Document object is returned by the ActiveDocument property of the Application object.

Dim acadDoc as AcadDocument
Set acadDoc = acadApp.ActiveDocument


Then draw..

' Define and create the line
Dim lineObj As AcadLine
Dim startPoint(0 To 2) As Double
Dim endPoint(0 To 2) As Double
startPoint(0) = 0
startPoint(1) = 0
startPoint(2) = 0
endPoint(0) = 1
endPoint(1) = 1
endPoint(2) = 1
Set lineObj = acadDoc .ModelSpace. _
AddLine(startPoint, endPoint)
lineObj.Update

Happy drawing! Big Grin | :-D
GeneralRe: autocad and VB Pin
everzwijn231-Mar-05 10:10
everzwijn231-Mar-05 10:10 
GeneralRe: autocad and VB Pin
mlatimer31-Mar-05 10:14
mlatimer31-Mar-05 10:14 
GeneralRe: autocad and VB Pin
everzwijn231-Mar-05 10:22
everzwijn231-Mar-05 10:22 
GeneralRe: autocad and VB Pin
everzwijn231-Mar-05 10:47
everzwijn231-Mar-05 10:47 
GeneralRe: autocad and VB Pin
everzwijn231-Mar-05 11:05
everzwijn231-Mar-05 11:05 
GeneralRe: autocad and VB Pin
everzwijn231-Mar-05 11:11
everzwijn231-Mar-05 11:11 
GeneralRe: autocad and VB Pin
everzwijn21-Apr-05 7:06
everzwijn21-Apr-05 7:06 
GeneralEvent Threading Pin
zx2c426-Mar-05 16:30
zx2c426-Mar-05 16:30 
GeneralExplorer Tree view events Pin
khan++25-Mar-05 19:55
khan++25-Mar-05 19:55 
GeneralRe: Explorer Tree view events Pin
khan++28-Mar-05 18:48
khan++28-Mar-05 18:48 
GeneraliTunes COM SDK Pin
zx2c425-Mar-05 13:58
zx2c425-Mar-05 13:58 
GeneralRe: iTunes COM SDK Pin
Gerald Schwab25-Mar-05 14:30
Gerald Schwab25-Mar-05 14:30 
GeneralRe: iTunes COM SDK Pin
zx2c425-Mar-05 15:05
zx2c425-Mar-05 15:05 
GeneralRe: iTunes COM SDK Pin
zx2c426-Mar-05 6:35
zx2c426-Mar-05 6:35 
GeneralRe: iTunes COM SDK Pin
zx2c426-Mar-05 16:27
zx2c426-Mar-05 16:27 
QuestionIs MDAC new Version backwork compatible? Pin
netboy202025-Mar-05 8:04
netboy202025-Mar-05 8:04 
AnswerRe: Is MDAC new Version backwork compatible? Pin
John M. Drescher25-Mar-05 8:35
John M. Drescher25-Mar-05 8:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.