Visual Basic Help

Visual Basic Help

Anonymous
Not applicable
403 Views
3 Replies
Message 1 of 4

Visual Basic Help

Anonymous
Not applicable
Hello,

I wrote a VBA program in AutoCAD 2005. Perhaps this is a stupid question, but, is there a way to write this same app. in straight VB and open an AutoCAD file and insert the points into the database without ever having to launch AutoCAD? Thanks for help and attached is my VBA code.

CK

Sub PointCloud()

Dim Xcoordarray(0 To 2500000) As Double
Dim Ycoordarray(0 To 2500000) As Double
Dim Zcoordarray(0 To 2500000) As Double
Dim Nothingarray1(0 To 2500000) As Double
Dim Nothingarray2(0 To 2500000) As Double
Dim Nothingarray3(0 To 2500000) As Double
Dim Nothingarray4(0 To 2500000) As Double

Dim PointArray(0 To 2) As Double

I = 0

Open "C:\WOA W-Pad Scan XYZ i RGB1.asc" For Input As #1

Do While Not EOF(1)
Input #1, Xcoord, Ycoord, Zcoord, NOTHING1, NOTHING2, NOTHING3, NOTHING4
Xcoordarray(I) = Xcoord
Ycoordarray(I) = Ycoord
Zcoordarray(I) = Zcoord
Nothingarray1(I) = NOTHING1
Nothingarray2(I) = NOTHING2
Nothingarray3(I) = NOTHING3
Nothingarray4(I) = NOTHING4

PointArray(0) = Xcoord
PointArray(1) = Ycoord
PointArray(2) = Zcoord

ThisDrawing.ModelSpace.AddPoint (PointArray)

I = I + 1

Loop

Close #1

End Sub
0 Likes
404 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Yes.
Check out ObjectDbx
do a google search as there is no documentation in acad help


wrote in message news:[email protected]...
Hello,

I wrote a VBA program in AutoCAD 2005. Perhaps this is a stupid question,
but, is there a way to write this same app. in straight VB and open an
AutoCAD file and insert the points into the database without ever having to
launch AutoCAD?
0 Likes
Message 3 of 4

Anonymous
Not applicable
Thanks for the reply. ObjectDBX is discontinued, I guess it's RealDWG now. Is there a way to get ObjectDBX now? I am running ACAD 2006. Thanks.
0 Likes
Message 4 of 4

Anonymous
Not applicable
wrote in message news:[email protected]...
Thanks for the reply. ObjectDBX is discontinued,

Funny, it's not discontinued here.(05, 06, 07)
:-)

set a reference to dbx in tools/references
Private moDbxDoc As AXDBLib.AxDbDocument
Set moDbxDoc =
ThisDrawing.Application.GetInterfaceObject("ObjectDBX.AxDbDocument.16")
0 Likes