.NET

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

Update blockreference in Acad2k7???

86 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 (86 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: 351
Registered: ‎12-05-2003
Message 3 of 3 (86 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.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!