I have a piece of code that needs closed polylines.
I use the following selectionfilter to filter the selection so I can only select closed polylines:
Dim sf As New SelectionFilter(New TypedValue() {New TypedValue(0, "LWPOLYLINE"), New TypedValue(70, 1)})
Today I noticed that in some drawings this filter won't select all the closed polylines for me.
After some experimenting I found the 'linetype generation' property of the polylines to be the problem. If this is enabled the above filter will not let me select a closed polyline. If I disable it, there is no problem.
How can I make my code for selecting closed polylines more robust? Is there a 'TypedValue' for closed polylines with the linetype generation enabled?
Solved! Go to Solution.
Solved by Jeff_M. Go to Solution.
Thanks Jeff_M!
This works well!!
It looks so simple. I was digging further into this just now, and I already found the bitcode 128, but I could not get it to work.
I was messing around with Conditional selections (AND, OR, etc.).Your solution looks really elegant, but it leaves me with another question:What does the (-4, "&") mean?the 128 is not mentioned in your code. So how does this work?
Nevermind... I found the info I needed right here.
Your solution just looks for any polyline that is closed but it can have other properties as well, as long as it is closed....