Hello
When I began this thread I was starting to write a program that draws contour lines. My input is a co-ordinate text file. The points are on a square grid, but I don't know how the grid is defined, that is I don't know which 4 points define each square. I have to work with a large number of points, up to several million. I have written some similar things in vba and used a MS Access database to store the points outside of autocad, with some success. I knew that speed would be an important factor in this case, so I thought that this would be a good time to try vb.net. After being unable to deal with the database in vb.net, I decided to write the program in vba. The vba program works very well (see attached file) but as I thought, it takes too long to do the job. The attached jpgout file from autocad is based on 500000 points, about 495000 squares, and took about 30 minutes to finish. I use an empty Access file where I have predefined the tables, fields,indexes etc. All the numbers are converted to long integers before being stored in the database. Here are examples of the code that I use in vba to connect to and use the database file:
FileCopy "e:\John\AU-JHL1\AU-JHL2.mdb", "z:\temp3.mdb"
Set dbsObj = DBEngine.Workspaces(0).OpenDatabase("z:\temp3.mdb")
Set rstObj = dbsObj.OpenRecordset("tblSquares", dbOpenTable)
Set rstObj1 = dbsObj.OpenRecordset("tblcoorsJHL2", dbOpenTable)
Set rstObj2 = dbsObj.OpenRecordset("tblcoorsJHL2", dbOpenTable)
.
.
.
ssql = "SELECT tblcoorsJHL2.indexjhl2 FROM tblcoorsJHL2 WHERE ((tblcoorsJHL2.yxdata=" & Trim(Str(yrso1&)) & ") And (tblcoorsJHL2.xxdata=" & Trim(Str(xrso1&)) & "));"
Set rstObj2 = dbsObj.OpenRecordset(ssql)
.
.
.
ssql = "SELECT tblcoorsJHL2.yxdata, tblcoorsJHL2.xxdata,tblcoorsJHL2.zxdata From tblcoorsJHL2 WHERE tblcoorsJHL2.IndexJHL2=" & Trim(Str(c1)) & ";"
Set rstObj2 = dbsObj.OpenRecordset(ssql)
So what I really need to know is how to do the equivalent in vb.net. I hope that I am correct in understanding that vb.net will be significantly faster than vba. Placing the db file on a ram disk had no effect on the speed. Half of the run time is spent defining the squares by point id and the other half interpolating the squares and drawing plines in autocad. Any tips on any of these subjects will be greatly appreciated.
Thank you all,
John