TransactionManager

TransactionManager

Anonymous
Not applicable
230 Views
1 Reply
Message 1 of 2

TransactionManager

Anonymous
Not applicable
I am apparently doing something wrong with the TransactionManager. I haven't completely
read all the stuff on it in help yet, so this may be a bit premature but.....

I want to be able to run this sub multiple times while the program is active. It runs OK
the first time, then hangs on the Set oTxn= line the second time through. Do I have to
give each tranasction a different name or clear it or ??

Any clues appreciated. 8^)


Public Sub test()

If bInUndoLoop = True Then

''''Set oTxnMgr = oApp.TransactionManager
Set oTxn = Nothing

' Start a regular transaction
Set oTxn = oTxnMgr.StartTransaction(oDoc, "Test1")
Do Stuff
oTxn.End
bInUndoLoop = False
oDoc.Update

End If


End Sub

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program
0 Likes
231 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Still struggling with this.

Basically what I am doing is wrapping the creation of a constraint in a Transaction. It
works fine if I just undo after creating it, but if I allow the user to adjust the offset
of the constraint via a textbox then the next time I recreate the constraint I get a
failure on ODoc.Update right after the creation.

Here is the basic layout.

Start Transaction
Add Constraint using a value from a textbox for the offset
oDoc.update
end transaction

At this point I can undo and recreate the constraint fine unless after the transaction I
change the textbox value which in turn changes the offset of the above constraint.

I suppose the constraint offset change needs to be included in the transaction, but I
can't see any easy way to do it since I will never know when the user is done with the
textbox, and I don't really want the text change to be undone anyhow.

Any help or suggestions greatly appreciated 8^)

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"Kent Keller" wrote in message
news:AFD4BAAC466173C24F40D3766E517724@in.WebX.maYIadrTaRb...
> I am apparently doing something wrong with the TransactionManager.
0 Likes