QCAD command line scripting - Request for Info

This forum is for 'Work-in-Progress' QCAD user developed script Add Ons and Plug-ins.

Please use this forum to request/submit your script Add-Ons & Plug-in idea's.

Moderators: andrew, Husky, J-J

Post Reply
hbr
Registered Member
Posts: 2
Joined: Mon Aug 15, 2016 2:46 pm

QCAD command line scripting - Request for Info

Post by hbr » Mon Aug 15, 2016 3:15 pm

file1.dxf
input file 1
(99.29 KiB) Downloaded 119 times
file2.dxf
input file 2
(98.78 KiB) Downloaded 112 times
file3.dxf
result of the merge command
(97.86 KiB) Downloaded 111 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 ?

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

Re: QCAD command line scripting - Request for Info

Post by andrew » Mon Aug 15, 2016 5:50 pm

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

hbr
Registered Member
Posts: 2
Joined: Mon Aug 15, 2016 2:46 pm

Re: QCAD command line scripting - Request for Info

Post by hbr » Tue Aug 16, 2016 5:47 pm

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
Attachments
QCADMerge.PNG
Command prompt - merge command
QCADMerge.PNG (13.27 KiB) Viewed 4194 times
s.xml
xml file
(278 Bytes) Downloaded 130 times
s3.dxf
merged file
(143.26 KiB) Downloaded 113 times
s2.dxf
second file
(99.71 KiB) Downloaded 110 times
s1.dxf
first file
(199.16 KiB) Downloaded 112 times

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

Re: QCAD command line scripting - Request for Info

Post by andrew » Tue Aug 16, 2016 8:34 pm

- 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.

Post Reply

Return to “QCAD 'Script Add-On & Plug-in challenge' - Work in Progress”