Hi all,
I have a strange one for you. A few weeks ago I coded an app to extract attributes out of an AutoCAD drawing using VBA code running from MS Access. Initially I was surprised that it handled such a complex revision numbering system straight off the bat. I say complex, because there are basically two systems of revision numbering in one - major revisions are pure numeric, and 'in between' revisions are either pure alpha, or alpha-numeric (but with the number first). I'd rather not explain the whole history of it, as it took many months to develop to a functional level, but suffice it to say that it is not possible to change the revision numbering system so I must find a programmatic solution to this problem.
OK, history lesson over. The problem is this:
In essence, the typical progression of revisions goes like this: A, B, C, 0, 0A, 0B, 1,....etc.
All of the drawings display both the current and one immediately preceding revision and its detail. It is possible, therefore, to see a drawing with current rev. B, but also displaying the detail of rev. A. (both as attributed blocks). This is fine, as the VBA code simply grabs all of the detail from each of the blocks, places that data into an array, and then compares the two strings that contain the 'A' and the 'B', and then copies the detail from the array of B (the greater of A and B) into a new array and uses that new array to populate the database with the current revision detail. All good so far!
The problem occurs when you have a drawing that displays revisions C and 0. When I first wrote the code this would evaluate as C > 0 = true, but since I wrote that code I have received a new PC which is now evaluating that as C > 0 = false.
Now obviously many things could have changed seeing as I now have a new PC, I guess what I'm looking for is some advice as to where to start looking. The main thing that changed, apart from the hardware of course, is that I've gone from XP Pro to XP Pro x64. I'm still using the same version of MS Office (Office 2000 - don't ask!), and the same version of AutoCAD (2009). I've checked things like the regional and language settings, and as best I can tell they're the same as my old PC. At the moment I'm out of ideas. It doesn't make any sense to me why one system would evaluate it one way and another a different way.
BTW, here's the code that does the comparison:
If arAttr2(0).TextString > arAttr3(0).TextString Then
arCurrRev = arAttr2
Else
arCurrRev = arAttr3
End If
Any ideas will be greatly appreciated.
Cheers,...Jon.
I have a strange one for you. A few weeks ago I coded an app to extract attributes out of an AutoCAD drawing using VBA code running from MS Access. Initially I was surprised that it handled such a complex revision numbering system straight off the bat. I say complex, because there are basically two systems of revision numbering in one - major revisions are pure numeric, and 'in between' revisions are either pure alpha, or alpha-numeric (but with the number first). I'd rather not explain the whole history of it, as it took many months to develop to a functional level, but suffice it to say that it is not possible to change the revision numbering system so I must find a programmatic solution to this problem.
OK, history lesson over. The problem is this:
In essence, the typical progression of revisions goes like this: A, B, C, 0, 0A, 0B, 1,....etc.
All of the drawings display both the current and one immediately preceding revision and its detail. It is possible, therefore, to see a drawing with current rev. B, but also displaying the detail of rev. A. (both as attributed blocks). This is fine, as the VBA code simply grabs all of the detail from each of the blocks, places that data into an array, and then compares the two strings that contain the 'A' and the 'B', and then copies the detail from the array of B (the greater of A and B) into a new array and uses that new array to populate the database with the current revision detail. All good so far!
The problem occurs when you have a drawing that displays revisions C and 0. When I first wrote the code this would evaluate as C > 0 = true, but since I wrote that code I have received a new PC which is now evaluating that as C > 0 = false.
Now obviously many things could have changed seeing as I now have a new PC, I guess what I'm looking for is some advice as to where to start looking. The main thing that changed, apart from the hardware of course, is that I've gone from XP Pro to XP Pro x64. I'm still using the same version of MS Office (Office 2000 - don't ask!), and the same version of AutoCAD (2009). I've checked things like the regional and language settings, and as best I can tell they're the same as my old PC. At the moment I'm out of ideas. It doesn't make any sense to me why one system would evaluate it one way and another a different way.
BTW, here's the code that does the comparison:
If arAttr2(0).TextString > arAttr3(0).TextString Then
arCurrRev = arAttr2
Else
arCurrRev = arAttr3
End If
Any ideas will be greatly appreciated.
Cheers,...Jon.