.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

get names of blocks using wildcard

3 REPLIES 3
Reply
Message 1 of 4
a7v1n
481 Views, 3 Replies

get names of blocks using wildcard

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...
3 REPLIES 3
Message 2 of 4
arcticad
in reply to: a7v1n

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



(defun botsbuildbots() (botsbuildbots))
Message 3 of 4
chiefbraincloud
in reply to: a7v1n

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
Message 4 of 4
chiefbraincloud
in reply to: a7v1n

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost