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

Wrong filter but seems to be worked...

5 REPLIES 5
Reply
Message 1 of 6
Hallex
427 Views, 5 Replies

Wrong filter but seems to be worked...

Can somebody explain me why this filter is working?

Dim filter(1) As TypedValue

filter(0) = New TypedValue(DxfCode.Start, "INSERT")

filter(1) = New TypedValue(66, 1)

Dim sf As New SelectionFilter(filter)

Dim opts As PromptSelectionOptions = New PromptSelectionOptions()

opts.MessageForAdding = ControlChars.CrLf & "Select block references: "

psr = ed.GetSelection(opts,sf)

ss = psr.Value

If ss.Count > 0 Then

ed.WriteMessage(vbCr & "Selected " & ss.Count & " attributed blocks")
End If

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
5 REPLIES 5
Message 2 of 6
chiefbraincloud
in reply to: Hallex

>>Can somebody explain me why this filter is working?

at first I assumed you meant NOT working, then I saw the title of the post.... What makes you say Wrong filter?

I always just use "0" instead of DxfCode.Start, but technically using DxfCode.Start is probably safer, just in case autodesk would happen to change it from 0 later.
Dave O.                                                                  Sig-Logos32.png
Message 3 of 6
Hallex
in reply to: Hallex

I mean this worked like a charm for me,
but I think the filter was created wrongly

~'J'~
_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 4 of 6
chiefbraincloud
in reply to: Hallex

Well, That's the same way I do it... so I don't think there's anything wrong with it. I even think I learned to do it that way from the .NET tutorial in the ObjectARX docs, so if someone has a better way, I'm all ears.
Dave O.                                                                  Sig-Logos32.png
Message 5 of 6
Hallex
in reply to: Hallex

Thanks a lot
Regards,

~'J'~
_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 6 of 6
chiefbraincloud
in reply to: Hallex

I suppose technically, I usually do this:

Dim myFilter() As TypedValue = {New TypedValue(0, "INSERT"), New TypedValue(66, 1)}

Which is little cleaner the way I see it, but amounts to the same thing.

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