Message 1 of 4
Dynamic Block object visibility state
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I need some help. @_gile
How to change an object that is in a visibility state to another?
I cloned (or added) some objects inside the block. How do I determine in which state of visibility the object should stay?
All cloned objects are in all visibility states. They must remain in the "remover" state of visibility and i don't know how to put them in this state of visibility. Cloned objects are on a different layer.
I've attached some dwg files for better understanding.
I used this code to clone the objects in the block.
For Each id As ObjectId In btr
Dim ent As Entity = id.GetObject(OpenMode.ForRead)
If layersOriginais.Contains(UCase(ent.Layer)) Then
Dim posicaoLayer As Integer = Array.IndexOf(layersOriginais, ent.Layer)
Dim collection As New ObjectIdCollection()
collection.Add(ent.Id)
Dim mapping As New IdMapping()
db.DeepCloneObjects(collection, btr.Id, mapping, False)
Dim ent2 As Entity
Using Tx As Transaction = db.TransactionManager.StartTransaction()
Dim pair1 As IdPair = mapping(ent.ObjectId)
ent2 = TryCast(Tx.GetObject(pair1.Value, OpenMode.ForWrite), Entity)
ent2.Layer = layersSP(posicaoLayer)
ent2.ColorIndex = 256
blkref.RecordGraphicsModified(True)
Tx.Commit()
Tx.Dispose()
End Using
End If
Next
btr.UpdateAnonymousBlocks()
Next
Thanks.