WriteDsd method get exception randomly

WriteDsd method get exception randomly

ptranU2KHX
Advocate Advocate
410 Views
3 Replies
Message 1 of 4

WriteDsd method get exception randomly

ptranU2KHX
Advocate
Advocate

Hi everyone,

 

I am experiencing an issue that is quite weird, it happens randomly so I can not trace the cause.

In my code, when I create Dsd file using DsdData.WriteDsd method, sometimes I get this exception with the message "Operation is not valid due to the current state of the object."

 

Do you have any ideas about why this happens? Thank you in advance.

 

*UPDATED

Here is a partial block of my work

Public Sub Publish(ByVal dsdFile As String, ByVal dsdColl As DsdEntryCollection, ByVal plotFile As String, ByVal shType As SheetType)

        Dim dsData As New DsdData()
        dsData.SetDsdEntryCollection(dsdColl)

        dsData.SheetType = shType
        dsData.NoOfCopies = 1
        dsData.DestinationName = plotFile

        dsData.WriteDsd(dsdFile)
0 Likes
411 Views
3 Replies
Replies (3)
Message 2 of 4

ptranU2KHX
Advocate
Advocate

I really need help!

0 Likes
Message 3 of 4

_gile
Consultant
Consultant

Hi,

If you want someone to help you, you need to provide more details.

Finding the origin of a "random" exception is often very difficult, but doing so without seeing a line of code is impossible.

You should at least post the code of the method which throws the exception and describe the context this method runs.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 4 of 4

ptranU2KHX
Advocate
Advocate

@_gile thank you for your help. I did not realize this. I have just updated this post.

0 Likes