.NET

.NET

Reply
Active Member
ManfredM
Posts: 10
Registered: ‎04-26-2006
Message 1 of 3 (88 Views)

Update blockreference in Acad2k7???

88 Views, 2 Replies
05-04-2006 06:50 AM
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???
Active Member
ManfredM
Posts: 10
Registered: ‎04-26-2006
Message 2 of 3 (88 Views)

Re: Update blockreference in Acad2k7???

05-06-2006 08:38 AM in reply to: ManfredM
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!
Distinguished Contributor
wesbird
Posts: 359
Registered: ‎12-05-2003
Message 3 of 3 (88 Views)

Re: Update blockreference in Acad2k7???

05-08-2006 05:52 AM in reply to: ManfredM
for my experise, you did not work with transition properly. make sure you commit every transition. especially you have embed transition.
Vault Pro 2014, Windows 7 64 bit, AutoCAD (ACA, Map) 2014
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.