How do I stop warning messages in the terminal?

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
jay
Newbie Member
Posts: 7
Joined: Mon Oct 31, 2022 5:28 am

How do I stop warning messages in the terminal?

Post by jay » Sat Sep 16, 2023 1:55 pm

Is it possible to disable warning message in the terminal, when executing a batch script?

I have managed to disable debug messages. I just cannot find a way to disable warning messages....

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

Re: How do I stop warning messages in the terminal?

Post by andrew » Sat Sep 16, 2023 2:37 pm

Debug and warning messages are streamed to stderr.

You can stream stderr to nul with (Windows):

Code: Select all

./dwg2svg.bat ... 2> nul
Or (Linux / macOS):

Code: Select all

dwg2svg.sh ... 2>/dev/null

jay
Newbie Member
Posts: 7
Joined: Mon Oct 31, 2022 5:28 am

Re: How do I stop warning messages in the terminal?

Post by jay » Sun Sep 17, 2023 12:35 am

Thank you, Andrew.

Unfortunately, I have found that was not my problem...
Original and output drawings attached.

1. Is it possible to disable debugging and warning messages all together?
- There are ~500 warnings being thrown for invalid splines.

2. Currently, I have a drawing that has some very poorly constructed splines and it takes ~70 seconds to 'clean up' using command line.
- Using the exact same functions through the GUI takes about 3 seconds.
- Functions are removing zero length entities and conversion to polyline from selection.

3. If the drawing is first opened and closed with QCAD, the problem goes away. Then the functions can be executed in a reasonable time.
- No modifications/functions applied. Simply opened and closed.
- It is also strange that the input file is modified when opened and closed by QCAD. A significant number of the splines are removed (~500). I suspect
this is a large part of the reason.

Looking forward to hearing your thoughts on the time discrepancy.
Attachments
cleaned.dxf
(522.16 KiB) Downloaded 205 times
hummingbird.dxf
(637.15 KiB) Downloaded 190 times

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

Re: How do I stop warning messages in the terminal?

Post by CVH » Sun Sep 17, 2023 2:13 am

Hi,
There are indeed (almost) zero length entities in the drawing.
Bridging gaps between splines:
  • 70 Lines, summed 0.00704 long
    2 arcs with radius 0.000098
Where two spline meet
  • 36 polylines, total length = zero
    480 splines, total length = zero
I don't know their native format because I did open the file in the QCAD GUI.
On loading QCAD or Open Design libraries may already fix entity issues.
May I ask what application created this DXF file?

The meaningful splines look more like Beziers segments.
In general they are not all perfectly tangentially connected.
QCAD has no method merging them back into longer spline chains.
jay wrote:
Sun Sep 17, 2023 12:35 am
- Functions are removing zero length entities and conversion to polyline from selection.
Not aware of such Command Line tool thus I suspect a custom tool.
I think you are better of with re-coding your tool.
Select all (visible) entities, reject invalid and (almost) Null-length entities.
Explode remaining to line and arcs.
Optional remove all duplicate segments.
Convert these segments to polylines given a certain tolerance.
Replace all initial content by new polylines. (... Always keep a copy or store as new file just in case of ...)

BTW: QCAD kept on failing on the 'Cleaned' file zooming in deeper and back out. :shock:
Once I normalized the 87 polylines that didn't occur anymore, still, the screen update in high zoom seems to slow down.
Could be a second selection color issue ...?

Regards,
CVH
Last edited by CVH on Sun Sep 17, 2023 6:17 pm, edited 1 time in total.

jay
Newbie Member
Posts: 7
Joined: Mon Oct 31, 2022 5:28 am

Re: How do I stop warning messages in the terminal?

Post by jay » Sun Sep 17, 2023 4:24 am

Thank you, CVH.

1. I'll look to make changes, based on your feedback and see how I get on.

2. I do not know the tool that created the original SVG drawing.
  • The 'file' is acquired as an svg/collection of vectors. Then imported into QCAD for processing.
    Probably COREL. Given my past experiences with their work...
3. Yes, tools are custom. I write my own and enjoy testing other tools in the process :)

4. I have not much failure in QCAD. Though, my experience is limited.

5. Do you know how to process multiple files through command line tools without opening and closing QCAD each time?
  • I'm not at all familiar with bash scripting. Assuming that's what it is...
Last edited by jay on Sun Sep 17, 2023 10:50 am, edited 1 time in total.

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

Re: How do I stop warning messages in the terminal?

Post by CVH » Sun Sep 17, 2023 7:48 am

Please open a new topic for unrelated questions.
That makes the forum searchable. :wink:
jay wrote:
Sun Sep 17, 2023 4:24 am
5. Do you know how to process multiple files through command line tools without opening and closing QCAD each time?
I'm not at all familiar with bash scripting. Assuming that's what it is...
Unrelated to QCAD.

Bash scripting see:
https://www.qcad.org/rsforum/viewtopic. ... 640#p29644
On windows called a batch file ...

I don't think you need to open the QCAD GUI for each ... QCAD can run without the GUI.

Regards,
CVH

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

Re: How do I stop warning messages in the terminal?

Post by CVH » Mon Sep 18, 2023 7:53 am

CVH wrote:
Sun Sep 17, 2023 7:48 am
I don't think you need to open the QCAD GUI for each ... QCAD can run without the GUI.
Needed to look this up :wink: :
https://github.com/qcad/qcad/blob/maste ... neTool.dox

Regrads,
CVH

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”