Message 1 of 2
Layouts block.count problem!

Not applicable
09-17-2015
03:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good evening for everyone,
need help )))
I wrote the code for explode some objects in layout. I get Layout.Block.Count before explode and I get Layout.Block.Count after explode objects. These Count(Before) and Count(After) are similar!!! What I do wrong?
Imports Autodesk.AutoCAD.Runtime Imports Autodesk.AutoCAD.Interop Imports Autodesk.AutoCAD.Interop.Common <CommandMethod("GALAUTODESKENTITIESSHOW", CommandFlags.Session)> Public Sub SPDS_Autodesk_Entities() Dim acApp As IAcadApplication = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication Dim acDoc As IAcadDocument = acApp.ActiveDocument For Each acLayout As IAcadLayout In acDoc.Layouts acDoc.ActiveLayout = acLayout acApp.ZoomExtents() Select Case Strings.Trim(acLayout.Name) Case "Model", "Модель", "Элементы оформления" Case Else Dim acSelSet As IAcadSelectionSet = acDoc.SelectionSets.Add("SS" & acLayout.Name) acSelSet.SelectOnScreen() MsgBox("Before: " & acSelSet.Count) Dim acEntityBefore As Long = acLayout.Block.Count acDoc.SendCommand("_ctab" & vbCr & acLayout.Name & vbCr) For Each acEntity As IAcadObject In acSelSet Select Case acEntity.ObjectName Case "AcDbBlockReference" Dim acEntityCopy As IAcadEntity = acEntity.Copy acEntityCopy.Layer = "Exploded_Entities" acDoc.SendCommand("_explode" & vbCr & "(handent """ & acEntityCopy.Handle & """)" & vbCr & vbCr) End Select Next MsgBox("After: " & acDoc.ActiveLayout.Block.Count) End Select Next End Sub
In fact, until the explosion objects have 2 object, and after the explosion - 76!
Shows: 2 before the explosion, after 3!
Can anyone explain, what I do wrong?