I have a VB.net program that has worked for several years that analyzes all dimensions of a drawing.
In a particular drawing, the system runs through 4 dimensions before it crashes with a
"Attempted to read or write protected memory. This is often an indication that other memory is corrupt." error.
I have recently upgraded to solidworks 2015.
The DLL version is 18.104.22.168
Here is some code:
swDispDim = swView.GetFirstDisplayDimension5
swDim = swDispDim.GetDimension
swTol = swDim.Tolerance
if swTol.Type = Nothing Then <--------------- On the fourth dimension, this is where the Read/Write error will occur, when trying to read the value of swTol.Type
Thank you very much for your time!
I don't know if this is the problem, but when checking if an object is "Nothing", you use the "Is" keyword rather than equals:
if swTol.Type Is Nothing Then
oh - and check that swTol is not nothing first:
If Not swTol Is Nothing Then...
Retrieving data ...