Показать имя Листа выбранного блока

Olga94
отредактировано 26 авг Раздел: API

Здравствуйте Уважаемые программисты NanoCAD!

Есть код vba-excel (см. ниже). Подскажите пожалуйста как вывести имя Листа для "lBlock" (если он в пространстве Листа)?

On Error Resume Next
Set acadApp = GetObject(, "nanoCAD.Application")

On Error Resume Next
Set acadDoc = acadApp.ActiveDocument
On Error GoTo 0

If acadDoc Is Nothing Then
Set acadDoc = acadApp.Documents.Add
acadApp.Visible = True
End If

Dim lBlockObj As AcadEntity
Dim lBlock As AcadObject
Dim varAttributes As Variant

Dim objSelectionSet As nanoCAD.SelectionSet

Dim EntGroup(0 To 0) As Integer
Dim EntData(0 To 0) As Variant
Dim V As Integer

EntGroup(0) = 0
EntData(0) = "INSERT"
For I = 0 To acadDoc.SelectionSets.Count - 1
If acadDoc.SelectionSets.Item(I).Name = "TempSSet" Then acadDoc.SelectionSets("TempSSet").DELETE
Next I
Set objSelectionSet = acadDoc.SelectionSets.Add("TempSSet")
objSelectionSet.SelectOnScreen EntGroup, EntData
I = 1

Cells(ActiveCell.Row, 6).Activate

For Each lBlockObj In objSelectionSet


row_at = Cells(Rows.Count, 2).End(xlUp).Row
Set lBlock = acadDoc.SelectionSets("TempSSet").Item(I - 1)
n_at = 0
If lBlock.HasAttributes Then
hand_1 = lBlock.Handle
ind2 = 0
For w = ActiveCell.Row To row_at
If Cells(w, 2) = hand_1 Then
Cells(w, 6).Activate
ind2 = 1
End If
If ind2 = 0 Then Cells(row_at + 1, 6).Activate
Next w
ActiveCell.Offset(0, -4) = lBlock.Handle
ActiveCell.Offset(0, -2) = lBlock.EffectiveName
ActiveCell.Offset(0, -1) = lBlock.Name

??? имя Листа для "lBlock" (если он в пространстве Листа)?

ActiveCell.Offset(1, 0).Activate

End If

I = I + 1

Set lBlock = Nothing

Next lBlockObj

Теги темы:

Ответы