Page 1 of 1

QCAD command line scripting - Request for Info

Posted: Mon Aug 15, 2016 3:15 pm
by hbr
file1.dxf
input file 1
(99.29 KiB) Downloaded 622 times
file2.dxf
input file 2
(98.78 KiB) Downloaded 607 times
file3.dxf
result of the merge command
(97.86 KiB) Downloaded 613 times
platform Windows 10, QCAD Pro license,
i have 2 input files a DXF and a js that i want to combine and pubilish as a dxf by a command line solution.

first input file : file1.dxf (and the title section contains a number from 1 upto 1001)
second input file : file1.js that addLine(94.0,420.0,94.0,421.0) entries

can combine the two files by: qcad.exe file1.dxf -exec file1.js
after processing the wanted result is shown on the screen.

how can i automatically save the result in an automated way on a command line based solution.

As alternative solution i have tried the "QCAD merg " command:

merge -t R27 o -file3.dxf input.xml (file1 and File2 are attached)
try to view it by:
qcad.exe file3.dxf

no result on the screen - nor in model-space / nor in paper-space

the file3.dxf contains some input - no display at all and i can not judge the correctness of the merge.

Could you provide me some guidance on how to continue and publish my results in an automated way ?

Re: QCAD command line scripting - Request for Info

Posted: Mon Aug 15, 2016 5:50 pm
by andrew
Please have a look at the sources of the merge tool for a complete example of how to create a command line tool that reads and writes files:
https://github.com/qcad/qcad/blob/maste ... rawings.js

Re: QCAD command line scripting - Request for Info

Posted: Tue Aug 16, 2016 5:47 pm
by hbr
Andrew,

i have elaborated the code
have s1.dxf and s2.dxf,

merge -o s3.dxf s.xml

compare the output in notepad and find a lot of differences.

do not have a reference to start from and i would like to learn how to merge correctly :(

S1.dxf is shown correctly in QCAD, S2.dxf is shown correctly in QCAD

s3.dxf has dxf format but i seem not be able to present it on the screen - always an empty view


could you point to the issue such that i can learn and improve ?

Kind Regards
Hugo

Re: QCAD command line scripting - Request for Info

Posted: Tue Aug 16, 2016 8:34 pm
by andrew
- The XML file is not valid (remove first line with the text "XML format:"). You can validate XML files online for example at http://www.xmlvalidation.com/
- The paths to your source files are not correct ("/s1.dxf"). Try "s1.dxf" if the files are in the same directory as the XML file or the absolute, complete path.