ACAD VBA text value get Selectionset on screen

ACAD VBA text value get Selectionset on screen

Anonymous
Not applicable
2,057 Views
3 Replies
Message 1 of 4

ACAD VBA text value get Selectionset on screen

Anonymous
Not applicable

Hi,

 

I have lots of text in different layers and text object. How can I choose "Layer3"   "121" value with selectin all drawing. "165" is only example number, it can be chance different drawings.

acad_2019-03-09_00-17-36.jpg

I try to write :

Sub SelectionSetFilterTextNoktasal()

    Dim ssYazi As AcadSelectionSet
    
    Dim filterType(0) As Integer
    Dim filterData(0) As Variant
    Dim FilterData2(0) As Variant
    
    Dim pYazi As acadText
    Dim pYazist As String

    Dim nKatman As AcadLayer
    Dim nKatmanAdi As String
    
    On Error Resume Next
        nKatmanAdi = "Layer3": Set nKatman = ThisDrawing.Layers.Add(nKatmanAdi): nKatman.color = acWhite
    On Error GoTo 0

    For Each ssYazi In ThisDrawing.SelectionSets
        If ssYazi.Name = "PP1" Then ssYazi.Delete
    Next ssYazi

    Set ssYazi = ThisDrawing.SelectionSets.Add("PP1")
    
    filterType(0) = 8
    filterData(0) = "Layer3"
    
    ssYazi.SelectOnScreen filterType, filterData
    
    Set pYazi = ThisDrawing.SelectionSets.Add("PP1")
    
    pYazist = pYazi.TextString

    MsgBox ("Text: " & pYazist)

End Sub

This code is not work but I couldnt solve. Help me for this. Thanks.

 

0 Likes
2,058 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

Hi, it s me again. 

Please help me for that.  🙂 

0 Likes
Message 3 of 4

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> Please help me for that

I guess we would, if we would understand the problem you have.

 

E.g. I have no idea what you mean by that:

>> How can I choose "Layer3" "121" value with selectin all drawing.

>> "165" is only example number, it can be chance different drawings.

 

Describe your job to do, what does not work in your code and provide a dwg-file that has the structure you want to work with your code.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 4 of 4

Anonymous
Not applicable

so sorry to my bad english,

 

at first I can explain the problem.

 

in firt massage jpeg is include  ( 1  44  AC  121  XX  1QR )

I have lots of this code set and every value is different layer.

Now I want to add all this text sets in table, and tables lable's last column can be calculation results (1*44)(first and second column value).

 

Thanks.

 

0 Likes