Hello,
I have a problem when i receive a .dxf with the draw preferences in inches. Until this moment, i had worked with mm files, but i have a file with inch tolerances and, when i copy and paste in new file, this measure is changed x25,4 (find attached both files).
If i change that configuration to "none" in both file, the measurement is preserved and i think is correct for my project. Is it possible to change this configuration after open the file by script way?
Thanks.
Change draw preferences by script
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Re: Change draw preferences by script
Hi,
Isn't that nice - QCAD converts correctly and knows that a inch is 25.4 mmsinase wrote: ↑Wed Mar 24, 2021 5:43 pmHello,
I have a problem when i receive a .dxf with the draw preferences in inches. Until this moment, i had worked with mm files, but i have a file with inch tolerances and, when i copy and paste in new file, this measure is changed x25,4 (find attached both files).
Please explain "correct for my project". In my understanding a converted unit from inch to mm by a multiplication of 25.4 times is correct. How can a change to none/none provide a correct calculated drawing info?
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Re: Change draw preferences by script
Hello,
I will receive .dxf or .dwg files and i need to merge all of them (these files have elements, text, dimensions... that i don't need). I do that helping my with the merge and bbox command, to try to organizate as much as possible all the figures (i use VB to programming this operations). That operations are executed on the bakground and, when i have the complete file with all draws, i need to select only the figures that i need to calculate different properties (area, perimeter, number of loops, ...). For that, is necesary to select each figure and put on other new file (cut and paste operation by script) and other secundary application is tasked to calculate the properties that i have told before.
Is for that because i need to asegurate that all measures must be in mm or none, because the intention isn't to check the draw unit measure in any moment, and that secoundary app will calculate all measures in mm.
Thank you.
Regards.
I will receive .dxf or .dwg files and i need to merge all of them (these files have elements, text, dimensions... that i don't need). I do that helping my with the merge and bbox command, to try to organizate as much as possible all the figures (i use VB to programming this operations). That operations are executed on the bakground and, when i have the complete file with all draws, i need to select only the figures that i need to calculate different properties (area, perimeter, number of loops, ...). For that, is necesary to select each figure and put on other new file (cut and paste operation by script) and other secundary application is tasked to calculate the properties that i have told before.
Is for that because i need to asegurate that all measures must be in mm or none, because the intention isn't to check the draw unit measure in any moment, and that secoundary app will calculate all measures in mm.
Thank you.
Regards.
Re: Change draw preferences by script
Hi,
Among others,
https://www.qcad.org/doc/qcad/latest/de ... ument.html
document units can be set by script.
https://www.qcad.org/doc/qcad/latest/de ... f8e2780516
Important: That doesn't convert between units.
A value 101.123 stays 101.123 ... mm, inches, kilometers ....
In essence a dxf has no unit.
Using 'none' to merge would NOT convert at all when importing.
Regards,
CVH
Among others,
https://www.qcad.org/doc/qcad/latest/de ... ument.html
document units can be set by script.
https://www.qcad.org/doc/qcad/latest/de ... f8e2780516
Important: That doesn't convert between units.
A value 101.123 stays 101.123 ... mm, inches, kilometers ....
In essence a dxf has no unit.
Using 'none' to merge would NOT convert at all when importing.
Regards,
CVH
Re: Change draw preferences by script
Thank you, i think that i will can to work on this way, I can open every document, to change that parameter with getDocument().setUnit(RS.Millimeter); and save.
I will try to automatizate this.
I have found a post with similar topic:
https://qcad.org/rsforum/viewtopic.php? ... nit#p17723
Thank you again for your help.
Regards.
I will try to automatizate this.
I have found a post with similar topic:
https://qcad.org/rsforum/viewtopic.php? ... nit#p17723
Thank you again for your help.
Regards.