Will SelectWindowPolygon and SelectCrossingWindow work in a headless AutoCAD environment?

Will SelectWindowPolygon and SelectCrossingWindow work in a headless AutoCAD environment?

santhoshr151194
Contributor Contributor
210 Views
3 Replies
Message 1 of 4

Will SelectWindowPolygon and SelectCrossingWindow work in a headless AutoCAD environment?

santhoshr151194
Contributor
Contributor

I'm building an application that needs to run both in interactive AutoCAD and in headless/cloud environments such as the Design Automation API or accoreconsole.exe.
One of the core requirements is efficiently selecting entities within specific polyline boundaries, especially when working with large and complex drawings.

Specific Questions:
- Are SelectWindowPolygon and SelectCrossingWindow supported in headless AutoCAD environments like Design Automation API or accoreconsole.exe?
- If they are supported, are there any known limitations or behavioral differences compared to running them in an interactive AutoCAD session?
- What are the best practices for implementing entity selection in a way that works consistently across both interactive and headless environments?

At the moment, I'm using a fallback approach that iterates through all entities in ModelSpace and performs manual geometric bounds checking, but it's considerably slower for large drawings. Any insights or recommendations would be greatly appreciated!
Thanks in advance.

0 Likes
211 Views
3 Replies
Replies (3)
Message 2 of 4

ActivistInvestor
Mentor
Mentor

No they will not work in a headless AutoCAD setup because they require a display. They use display information to select objects, so if there is no graphical view they will not work. 

 

 

0 Likes
Message 3 of 4

daniel_cadext
Advisor
Advisor

iterating is faster than select all. You could probably get pretty good results if you optimize your code. Getting all the objects in a 2d extents should be very fast

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
0 Likes
Message 4 of 4

442884080
Contributor
Contributor

I’m developing a .NET add-in that runs on accoreconsole.exe, and I’m using SelectCrossingWindow() to process DWG files.
With some drawings it works fine, but with others it just returns Error.
I don’t see any difference between the files, so I’m not sure what the issue is.

0 Likes