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

Selecting closed polylines with 'Linetype generation' enabled.

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
R.Gerritsen4967
3294 Views, 2 Replies

Selecting closed polylines with 'Linetype generation' enabled.

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?

2 REPLIES 2
Message 2 of 3
Jeff_M
in reply to: R.Gerritsen4967

The DXF code 70 for polylines is a bit code, 1 = closed, 128 = ltgen enabled. So use the relational test "&":

Dim sf As New SelectionFilter(New TypedValue() {New TypedValue(0, "LWPOLYLINE"), New TypedValue(-4, "&"), New TypedValue(70, 1)})

 

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 3
R.Gerritsen4967
in reply to: Jeff_M

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....

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