Entity from his center point

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules
Always indicate Operating system, QCAD version
Attach Drawing files, Screenshots
Post one question per topic.
Post Reply
Newbie Member
Posts: 6
Joined: Thu Oct 19, 2017 2:34 pm

Entity from his center point

Post by dzenita » Tue Nov 07, 2017 9:38 am

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 ?


User avatar
Site Admin
Posts: 5604
Joined: Fri Mar 30, 2007 6:07 am

Re: Entity from his center point

Post by andrew » Thu Nov 09, 2017 3:15 pm

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.

Post Reply

Return to “QCAD 'How Do I' Questions”