TheSwamp

Code Red => .NET => Topic started by: ThisisforAiur on December 18, 2019, 11:14:36 AM

Title: SelectionFilter based on Circle's center coordinate
Post by: ThisisforAiur on December 18, 2019, 11:14:36 AM
Hi,
Is there a way to implement a selectionfilter based on the circle's center coordinate with C# like one of the criteria in FILTER command?
Let say I want to select the circles with the center X>=0 and Y>=0 and Z=0.
With the following code it can create a filter to select the circles with radius >=10.0.
But I can not find a way to implement the filter based on circle's center coordinate.
Is that possible to do so?

    TypedValue[] Arr = new TypedValue[]
    {
        new TypedValue((int)DxfCode.Start, "CIRCLE"),
        new TypedValue((int)DxfCode.Operator, ">="),
        new TypedValue((int)DxfCode.Real, 10.0),
    }

Thanks!
Title: Re: SelectionFilter based on Circle's center coordinate
Post by: gile on December 18, 2019, 11:57:09 AM
Hi,

try like this:
Code - C#: [Select]
  1. var typedValues = new[]
  2. {
  3.     new TypedValue(0, "CIRCLE"),
  4.     new TypedValue(-4, ">=,>=,="),
  5.     new TypedValue(10, new Point3d(0.0, 0.0, 0.0))
  6. };

The AutoLISP documentation is the most exhaustive one about selection filters. You can read this section (https://help.autodesk.com/view/OARX/2019/ENU/?guid=GUID-7BE77062-C359-4D01-915B-69CF672C653B) and its related topics.
Title: Re: SelectionFilter based on Circle's center coordinate
Post by: ThisisforAiur on December 18, 2019, 10:40:04 PM
Hi Gile.
Thanks a lot!
Kind of surprised that the operator parameter can take multiple operations in one with comma separated.