Message 1 of 6

Not applicable
07-13-2019
04:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
This is probably one of the most ridiculous questions I will ever ask, but I have to do it...
Once I have opened a transaction I am trying to unfreeze a specific layer and then in the same transaction be able to select it. Is this possible or am i required to open one transaction, apply the change and then open another to select the layer? My code (in part) is as follows.
Using tr As Transaction = doc.TransactionManager.StartTransaction() Dim bt As BlockTable = CType(tr.GetObject(db.BlockTableId, OpenMode.ForWrite), BlockTable) Dim btr As BlockTableRecord = CType(tr.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite), BlockTableRecord) Dim lt As LayerTable = tr.GetObject(db.LayerTableId, OpenMode.ForRead) ' Turn on the cabling layer just in case If lt.Has("Cabling") Then Dim ltr As New LayerTableRecord() ltr.Name = "Cabling" lt.UpgradeOpen() ltr.IsFrozen = False Else ed.WriteMessage(vbLf & "No cabling exists...") Return End If Dim psr As PromptSelectionResult = ed.GetSelection(New SelectionFilter(tv1)) If (psr.Status <> PromptStatus.OK) Then Return End If
I am not able to find a way to commit the layer change and then be able to select it. the layer change does not take effect and hence I am left with the program jumping out on the return.
Does anyone have some advice that may help me to understand what i am doing wrong?
Thank you.
Solved! Go to Solution.