Passing Blockreference-object between methods

 Hello all, 

Quick question: 

I've got a .Net solution that was designed on AutoCAD2009 wich makes extensive use of functions returning BlockReference-objects.
dummy example : 
[code]    Sub A()
        Dim dummBlockRef As BlockReference = B()
        'Continue code able to refer to dummBlockRef and its members/properties
    End Sub

    Function B() As BlockReference

        Dim returnBlockRef As BlockReference
        ' Get the current document and database, and start a transaction
        Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
        Dim acCurDb As Database = acDoc.Database

        ' Lock the document
        Using acLckDoc As DocumentLock = acDoc.LockDocument()

            ' Start a transaction in the new database
            Using acTrans = acDoc.TransactionManager.StartOpenCloseTransaction()
                'Find/get/set/modify returnBlockRef goes here
                returnBlockRef = 
            End Using

        End Using

        Return returnBlockRef

    End Function[/code]

This worked very well, altoughmight not be best-practice.

In BricsCAD however, I find that the returned BlockReference is no longer use-able once the transaction responsible for getting the Blockreference was closed.
How come AutoCAD left me with a usable BlockReference after the transaction was closed but BricsCAD does not ? 

I have alot of code passing trough BlockReferences & entities this way. What is the best action i can take to adept my code to make it run on BricsCAD ? 

Cheers,

Bert

Comments

This discussion has been closed.