Problem with line type when converting DWG to PDF
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
-
- Junior Member
- Posts: 24
- Joined: Wed Apr 10, 2019 3:51 pm
Problem with line type when converting DWG to PDF
Hello,
We have some drawings that have lines with property "linetype" setted as "Dash dot".
When we open these files with QCad, the scale of this lines are distorted if compared with same drawing opened with TrueView.
More critical, when we try to convert this file to PDF with DWG2PDF, lines with "linetype" setted as "Dash dot" are converted as "Continuous".
Could you help us with this problem?
S.O.: Windows 10 Professional
QCad Version: 3.22.0.10
Script used to convert DWG to PDF:
dwg2pdf.bat -a -c -d -f -n -l -w 0.1 -fs romans standard -fs romand standard -o "C:\temp\croquis\2pdf\CAD.pdf" "C:\temp\croquis\2pdf\CAD.DWG"
Attached Files:
CAD.dwg - drawing for reference;
CAD.pdf - Cad.dwg converted to pdf with DWG2PDF
CAD_QCAD.png - CAD.dwg opened with QCAD
CAD_TRUEVIEW.png - CAD.dwg opened with TrueView
We have some drawings that have lines with property "linetype" setted as "Dash dot".
When we open these files with QCad, the scale of this lines are distorted if compared with same drawing opened with TrueView.
More critical, when we try to convert this file to PDF with DWG2PDF, lines with "linetype" setted as "Dash dot" are converted as "Continuous".
Could you help us with this problem?
S.O.: Windows 10 Professional
QCad Version: 3.22.0.10
Script used to convert DWG to PDF:
dwg2pdf.bat -a -c -d -f -n -l -w 0.1 -fs romans standard -fs romand standard -o "C:\temp\croquis\2pdf\CAD.pdf" "C:\temp\croquis\2pdf\CAD.DWG"
Attached Files:
CAD.dwg - drawing for reference;
CAD.pdf - Cad.dwg converted to pdf with DWG2PDF
CAD_QCAD.png - CAD.dwg opened with QCAD
CAD_TRUEVIEW.png - CAD.dwg opened with TrueView
Re: Problem with line type when converting DWG to PDF
The drawing unit is set to "None". I think Trueview might assume "Inch" in this case.
If you open the drawing in QCAD and set Edit > Drawing Preferences > General > Drawing Unit > Drawing Unit to "Inch", it will display as desired.
Using command line tools, you can set the drawing unit using dwg2dwg:
If you open the drawing in QCAD and set Edit > Drawing Preferences > General > Drawing Unit > Drawing Unit to "Inch", it will display as desired.
Using command line tools, you can set the drawing unit using dwg2dwg:
Code: Select all
dwg2dwg -s INSUNITS:1 -f -o out.dwg in.dwg
-
- Junior Member
- Posts: 24
- Joined: Wed Apr 10, 2019 3:51 pm
Re: Problem with line type when converting DWG to PDF
Dear Andrew,
Thank you very much for your quickly reply. I changed Drawing Unit to "Inch" and then QCad show this line correctly.
But, when I convert to PDF, this line still is displayed as "Continuous" as showed in file"Cad.pdf"
Thank you very much for your quickly reply. I changed Drawing Unit to "Inch" and then QCad show this line correctly.
But, when I convert to PDF, this line still is displayed as "Continuous" as showed in file"Cad.pdf"
Re: Problem with line type when converting DWG to PDF
That would be caused by the linetype scale (LTSCALE) of 20.
Try this:
Try this:
Code: Select all
dwg2dwg -s INSUNITS:1 -s LTSCALE:0.2 -f -o CAD_fixed.dwg CAD.dwg
dwg2pdf -a -c -d -f -n -l -w 0.1 -fs romans standard -fs romand standard -o CAD.pdf CAD_fixed.dwg
-
- Junior Member
- Posts: 24
- Joined: Wed Apr 10, 2019 3:51 pm
Re: Problem with line type when converting DWG to PDF
Hello Andrew,
Thank you very much for your help.
Although this drawing is with scale of 20, I think that when I use dwg2pdf with -a (autofit) parameter the drawing is scaling and dashed line not.
This behaviour occur with QCad print preview too (See attached files).
I think that QCad need to print (and/or generate pdf) the drawn with same features that is displayed outside preview.
Is possible correct this QCad behaviour?
Thank you very much for your help.
Although this drawing is with scale of 20, I think that when I use dwg2pdf with -a (autofit) parameter the drawing is scaling and dashed line not.
This behaviour occur with QCad print preview too (See attached files).
I think that QCad need to print (and/or generate pdf) the drawn with same features that is displayed outside preview.
Is possible correct this QCad behaviour?
- Attachments
-
- CAD_PREVIEW.png (50.08 KiB) Viewed 12195 times
-
- CAD.png (32.86 KiB) Viewed 12195 times
Re: Problem with line type when converting DWG to PDF
Line type patterns (and also lineweights) are paper based. For example a dashed line with 2mm dashes has 2mm dashes on paper (independent of the scale at which the drawing is printed). This is expected / correct behaviour. The linetype scale factor can be used to adjust all linetype scales on paper if desired.
-
- Junior Member
- Posts: 24
- Joined: Wed Apr 10, 2019 3:51 pm
Re: Problem with line type when converting DWG to PDF
Hello Andrew,
Thanks for your help, now I'm understanding what is happening. QCad works with dashed lines paper based. But this is a problem for me. We have other software working in parallel with QCad as Trueview, Autocad, etc.
These other software do not work with dashed lines paper based (See attached files), then, I have softwares printing differently same DWG file. The critical problem for me is that we choose QCad to convert DWG files to PDF and later print to manufacture. With the problem with dashed lines, our factory is manufacturing wrong parts of our product what is a big problem.
I want to see with you the possibility that script dwg2pdf has an option to scaling dashed lines with all other entities of the drawing, not paper based as work now.
Thanks for your help, now I'm understanding what is happening. QCad works with dashed lines paper based. But this is a problem for me. We have other software working in parallel with QCad as Trueview, Autocad, etc.
These other software do not work with dashed lines paper based (See attached files), then, I have softwares printing differently same DWG file. The critical problem for me is that we choose QCad to convert DWG files to PDF and later print to manufacture. With the problem with dashed lines, our factory is manufacturing wrong parts of our product what is a big problem.
I want to see with you the possibility that script dwg2pdf has an option to scaling dashed lines with all other entities of the drawing, not paper based as work now.
- Attachments
-
- trueview_preview.png (49.69 KiB) Viewed 12094 times
-
- trueview.png (123.08 KiB) Viewed 12094 times
-
- Librecad_preview.png (78.56 KiB) Viewed 12094 times
-
- Librecad.png (69.87 KiB) Viewed 12094 times
-
- autocad_preview.png (30.76 KiB) Viewed 12094 times
-
- autocad.png (73.25 KiB) Viewed 12094 times
Re: Problem with line type when converting DWG to PDF
In your screenshots you appear to be printing / viewing the model space. In model space, linetypes are not scaled to paper units (as there is no paper and everything is in drawing units).
I can offer you to implement a switch to override the linetype scale in dwg2pdf (i.e. -ltscale=1).
I can offer you to implement a switch to override the linetype scale in dwg2pdf (i.e. -ltscale=1).
-
- Junior Member
- Posts: 24
- Joined: Wed Apr 10, 2019 3:51 pm
Re: Problem with line type when converting DWG to PDF
Hello Andrew,
The LTSCALE could help, but I'm afraid with possibility that this parameter correct some drawings and mess others. Autocad have a parameter named "PSLTSCALE". This parameter is used to control if line type is scaled to paper units or to drawing units (See attached Autocad documentation).
I see at QCad source code documentation that QCad have this parameter too (See attached documentation), but I didn't find how to set it.
Have any way to set this parameter to this drawn? If yes, is possible to add a switch to override this parameter in dwg2pdf?
The LTSCALE could help, but I'm afraid with possibility that this parameter correct some drawings and mess others. Autocad have a parameter named "PSLTSCALE". This parameter is used to control if line type is scaled to paper units or to drawing units (See attached Autocad documentation).
I see at QCad source code documentation that QCad have this parameter too (See attached documentation), but I didn't find how to set it.
Have any way to set this parameter to this drawn? If yes, is possible to add a switch to override this parameter in dwg2pdf?
- Attachments
-
- PSLTSCALE_DOC_SOURCE_QCAD.PNG (40.72 KiB) Viewed 11980 times
-
- PSLTSCALE_DOC_AUTOCAD.PNG (19.13 KiB) Viewed 11980 times
-
- Autocad_LineTypePaperSpaceUnits.png (16.72 KiB) Viewed 11980 times
Re: Problem with line type when converting DWG to PDF
As far as I can see from your screenshots, you are printing the model space somehow. PSLTSCALE affects only printing from paper space which might be the reason why your prints look fine. I think you are somehow printing the current screen "as displayed". This is uncommon in CAD.
In any case: setting the linetype scale (LTSCALE) to 1 guarantees that dashes are visible as dashes (if the line is long enough to show them). I'd recommend that solution.
In any case: setting the linetype scale (LTSCALE) to 1 guarantees that dashes are visible as dashes (if the line is long enough to show them). I'd recommend that solution.
-
- Junior Member
- Posts: 24
- Joined: Wed Apr 10, 2019 3:51 pm
Re: Problem with line type when converting DWG to PDF
Hello Andrew,
Thanks for your help. I did tests with some dwg files with dashed line setting LTSCALE to 1 and I get acceptable results.
Could you add INSUNITS (I have some dwg files that are without drawing unit defined too) and LTSCALE switch to dwg2pdf?
Thanks for your help. I did tests with some dwg files with dashed line setting LTSCALE to 1 and I get acceptable results.
Could you add INSUNITS (I have some dwg files that are without drawing unit defined too) and LTSCALE switch to dwg2pdf?
-
- Junior Member
- Posts: 24
- Joined: Wed Apr 10, 2019 3:51 pm
Re: Problem with line type when converting DWG to PDF
Hello Andrew,
Do you have a prevision to release a new QCad Version with theses new switch of dwg2pdf?
Do you have a prevision to release a new QCad Version with theses new switch of dwg2pdf?
Re: Problem with line type when converting DWG to PDF
We will likely release a snapshot this or next week.
-
- Junior Member
- Posts: 24
- Joined: Wed Apr 10, 2019 3:51 pm
Re: Problem with line type when converting DWG to PDF
Ok Andrew,
I'll wait. Thanks.
I'll wait. Thanks.