get names of blocks using wildcard

get names of blocks using wildcard

Anonymous
Not applicable
627 Views
3 Replies
Message 1 of 4

get names of blocks using wildcard

Anonymous
Not applicable
Hi. Is there any way to get blocks using wildcard character?
For example, selection set block name filter X111*01 will return:
X111zzz01
X111bbb01
X111cccccc01

Is there any way to do this is vb.net? Thanks...
0 Likes
628 Views
3 Replies
Replies (3)
Message 2 of 4

arcticad
Advisor
Advisor
if myString like "X111*01" then
...
end if
---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 3 of 4

chiefbraincloud
Collaborator
Collaborator
You can use wildcards in a selection filter.
Dim myfilter() As TypedValue = New TypedValue() {New TypedValue(0, "INSERT"), New TypedValue(2, "PAT*")}

and you can 'Or' them together to get more than one pattern to match

Dim myfilter() As TypedValue = New TypedValue() {New TypedValue(0, "INSERT"), New TypedValue(DxfCode.Operator, "")}
Dave O.                                                                  Sig-Logos32.png
0 Likes
Message 4 of 4

chiefbraincloud
Collaborator
Collaborator

Sorry, I was just digging around for a bit of code I remember seeing, and I realized that the text in my post is incomplete.  I'm not sure if I did that. or the site, but just in case you still need it, or if anyone else comes here looking for an answer, here is a complete filter definition using Or's and Wildcards

 

Dim myfilter() As TypedValue = New TypedValue() {New TypedValue(0, "INSERT"), New TypedValue(DxfCode.Operator, "<or"), New TypedValue(2, "Blk1*"), New TypedValue(2, "Blk2*"), New TypedValue(DxfCode.Operator, "or>")}

 

(Then you can create a new SelectionFilter passing the TypedValue Array to the constructor)

Dave O.                                                                  Sig-Logos32.png
0 Likes