Jump to content

Filter closed polygons from open polygons


Recommended Posts

Is there a way to custom select and separate closed polygons from open polygons where all other attributes are the same. The select similar tool doesn't seem to have anything that will do the job, neither does the custom selection option, unless I am missing something.

Link to comment

I don't think the custom select command will do it. Not sure if it's possible to even make a one-line script to do this.

This is a pretty easily scriptable problem. I'll attach an example in vectorscript that select only closed or only open polys, but it would be just as easy to do in python and I bet it would be easy to do in marionette.

hth

mk

Edited by michaelk
Link to comment
  • 8 months later...

I couldn't find it on this computer.  And I don't remember writing this script :-0

 

But it was probably something like this:

 

Procedure SelectClosedPolys;
{Badly scripted by Michael Klaers  -  michaelk@verysmallgroup.com}
{March, 2017}
{This script selects all closed polygons and polylines in a drawing}

VAR
    
    PolyHand        : Handle;                 
    
PROCEDURE SelectIt(PolyHand:HANDLE);
BEGIN
    IF IsPolyClosed(PolyHand)
        THEN SetSelect(PolyHand);
END;

{------------------------------Begin Main------------------------------}
BEGIN
    DSelectAll;
    ForEachObject(SelectIt, (((T=POLY)|(T=POLYLINE))));
END;
{------------------------------End Main------------------------------}

RUN(SelectClosedPolys);

 

 

And this:



 

Procedure SelectOpenPolys;
{Badly scripted by Michael Klaers  -  michaelk@verysmallgroup.com}
{March, 2017}
{This script selects all open polygons and polylines in a drawing}

VAR
    
    PolyHand        : Handle;                 
    
PROCEDURE SelectIt(PolyHand:HANDLE);
BEGIN
    IF NOT IsPolyClosed(PolyHand)
        THEN SetSelect(PolyHand);
END;

{------------------------------Begin Main------------------------------}
BEGIN
    DSelectAll;
    ForEachObject(SelectIt, (((T=POLY)|(T=POLYLINE))));
END;
{------------------------------End Main------------------------------}

RUN(SelectOpenPolys);

 

I'll also attach a file.

 

 

mk

 

 

Select Open or Closed Polys.vwx

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...