[Solved] Check for open Contours

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
SM_MaGa
Junior Member
Posts: 10
Joined: Tue Apr 13, 2021 3:20 pm

[Solved] Check for open Contours

Post by SM_MaGa » Fri Sep 10, 2021 9:52 am

Hello,

i am looking for a way to check via script if the outer contours of a .dxf Drawing are all closed.

In my scenario the customer uploads a .dxf File that he wants to be processed but before
doing so we need to check if there are any open outer contours which would make the drawing invalid.

Does anyone have an idea of how i can realise this?

Thanks for your support.
Last edited by SM_MaGa on Thu Oct 07, 2021 5:26 pm, edited 1 time in total.

CVH
Premier Member
Posts: 1544
Joined: Wed Sep 27, 2017 4:17 pm

Re: Check for open Contours

Post by CVH » Fri Sep 10, 2021 10:26 am

Hi,
Here you let us know you have worked out how to find and handle 'contours'.
https://qcad.org/rsforum/viewtopic.php?t=8508

What is left of non-connecting entities are candidates for open contours.
Or by slicing out ids of contour entities from a global id list ... RDocument.queryAllEntities(undone, allBlocks, type=RS.EntityAll)
Or by selecting the found contours and inversing the selection.
This still may need some filtering ... e.g.: Text, solids, hatches .... :wink:

Regards,
CVH

SM_MaGa
Junior Member
Posts: 10
Joined: Tue Apr 13, 2021 3:20 pm

Re: Check for open Contours

Post by SM_MaGa » Thu Oct 07, 2021 5:26 pm

Hi CVH,

thanks four your input.
Thanks to that i could develop a solution for this problem.

I now export all Information needed (Start and Endpoints for all Entities that offer this Information)
and check in the ERP System if each Start/End-Point has a connecting Start/End-Point on the same Contour.

Greetings,
SM_MaGa

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”