Message 1 of 3
Entity.UpgradeOpen
Not applicable
10-15-2008
09:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
i'm having issues with upgrading an entity so i can change its layer... here's what i have
{color:#333399}Dim myLock As AutoCAD.ApplicationServices.DocumentLock = myDoc.LockDocument()
Using Trans As AutoCAD.DatabaseServices.Transaction = myDb.TransactionManager.StartTransaction
{color}
i tried it with a transaction, without a transaction, with a document lock, without a document lock, all i get is{color:#ff0000} {color}{color:#ff0000}eInvalidOpenState{color}, i'm not sure where i'm going wrong here... any help would be more than appreciated. if you need any other info let me know.
btw, i'm getting my entity from another transaction:
{color:#333399}Dim ent As AutoCAD.DatabaseServices.Entity = CType(Trans.GetObject(obId, AutoCAD.DatabaseServices.OpenMode.ForRead), AutoCAD.DatabaseServices.Entity){color}
{color:#333399}Dim myLock As AutoCAD.ApplicationServices.DocumentLock = myDoc.LockDocument()
Using Trans As AutoCAD.DatabaseServices.Transaction = myDb.TransactionManager.StartTransaction
{color}
{color:#333399}Try
{color}
{color:#333399}ent.UpgradeOpen(){color:#333399}Catch ex As Exception
ent.Layer = lay
ent.DowngradeOpen()
{color}
{color}
{color:#333399}myUtility.Prompt(vbLf & "Unable to change layer: " & ex.Message)
{color}
{color:#333399}End Try{color:#333399}End Using myLock.Dispose(){color}
Trans.Commit()
{color}
i tried it with a transaction, without a transaction, with a document lock, without a document lock, all i get is{color:#ff0000} {color}{color:#ff0000}eInvalidOpenState{color}, i'm not sure where i'm going wrong here... any help would be more than appreciated. if you need any other info let me know.
btw, i'm getting my entity from another transaction:
{color:#333399}Dim ent As AutoCAD.DatabaseServices.Entity = CType(Trans.GetObject(obId, AutoCAD.DatabaseServices.OpenMode.ForRead), AutoCAD.DatabaseServices.Entity){color}