.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Update blockreference in Acad2k7???

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
202 Views, 2 Replies

Update blockreference in Acad2k7???

We had insert a blockreference into modelspace, reference is shown in database, but not on screen. After saving and reloading the drawing the blockreference is visible.
What shall we do to show block after insert???
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

We tried the block reference property RecordGraphicsModified with openmode.forwrite, but it didn't work.
Now we uses a workaround regenerating the insert layer like this:
' uses the acmgdinternal.dll of AutoCAD root folder
Imports Autodesk.AutoCAD.Internal

Public Sub RegenLayer(ByVal Layername As String)
Dim LayerIDs(0) As ObjectId
'creates new layer if not exists with color mix red green and blue
Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
Dim tm As DBTransMan = db.TransactionManager
Dim ta As Transaction = tm.StartTransaction()
Dim LTR As LayerTable = CType(tm.GetObject(db.LayerTableId, OpenMode.ForRead, False), LayerTable)
'Check if Layer exists...
If LTR.Has(Layername) Then
LayerIDs(0) = LTR.Item(Layername)
Dim RegPen As Integer = LayerUtilities.RegenPending
LayerUtilities.RegenLayers(LayerIDs, RegPen)
ta.Commit()
End If
ta.Dispose()
tm.Dispose()
End Sub

It works!
Message 3 of 3
wesbird
in reply to: Anonymous

for my experise, you did not work with transition properly. make sure you commit every transition. especially you have embed transition.
Windows 10 64 bit, AutoCAD (ACA, Map) 2023

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost