Message 1 of 4
ACAD VBA text value get Selectionset on screen

Not applicable
03-08-2019
01:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.
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.