Author Topic: SelectionFilter based on Circle's center coordinate  (Read 376 times)

0 Members and 1 Guest are viewing this topic.

ThisisforAiur

• Mosquito
• Posts: 3
SelectionFilter based on Circle's center coordinate
« 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!

gile

• Water Moccasin
• Posts: 2251
• Marseille, France
Re: SelectionFilter based on Circle's center coordinate
« Reply #1 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 and its related topics.
Speaking English as a French Frog

ThisisforAiur

• Mosquito
• Posts: 3
Re: SelectionFilter based on Circle's center coordinate
« Reply #2 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.