I found myself engaged in a discussion regarding using internal (efm/vbs) clients compared to dotNet/VisualStudio based scripts, and am interested in hearing if anyone here can explain the difference.
An example. We are using the method Block.AddLine2 in an experimental script. Using the method internally works like a charm with tens of thousands of lines, but using it in a DotNet based code, lots of times the method returns 'Nothing' instead of the object. Why is this ?
The vbs looks like this :
For x=0 to 100 step 10
for Y = 0 to 100 step 10
Set DxDesignerLine = Activeview.Block.AddLine2(1,1,x*10,y*10)
If not DxDesignerLine is nothing then
DxDesignerLine.LineStyle = 3
DxDesignerLine.Color = RGB(253,127,3)
Nothingcounter = Nothingcounter+1
MsgBox GoodCounter &" ; "& NothingCounter
During our discussion, we wondered if this is a timing issue, or has something to do with threading or the fact that the communication between server (Viewdraw.exe) and the clients (vbs/efm versus compiled .exe) gets disturbed when the client is external (.exe) ?
Also, does anyone have a suggestion how to work around this issue ?
I have attached the full script (the dxdApp.Visible statements are an attempt to reduce errors, since we found that it sometimes helps)