Page 1 of 1

Entity from his center point

Posted: Tue Nov 07, 2017 9:38 am
by dzenita
Hi everyone,

I am coding in a script, and I have to get the entity from it's center point.
Is it possible? Is there a function that gets entity from his center ?


Thanks,
Dzenita

Re: Entity from his center point

Posted: Thu Nov 09, 2017 3:15 pm
by andrew
You can query entities based on location using:

Code: Select all

var ids = doc.queryIntersectedEntitiesXY(new RBox(x1,y1, x2,y2), true);
This will return all entities whose bounding box intersects with the given rectangle defined by corners x1,y1 and x2,y2.

If this does not solve your problem, please elaborate on what you are trying to do.