Message 1 of 4
Visual Basic Help
Not applicable
09-26-2006
06:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
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