Page 1 of 1

Problem with line type when converting DWG to PDF

Posted: Wed May 22, 2019 8:53 pm
by sistemas.caw
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

Re: Problem with line type when converting DWG to PDF

Posted: Thu May 23, 2019 12:46 pm
by andrew
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:

Code: Select all

dwg2dwg -s INSUNITS:1 -f -o out.dwg in.dwg

Re: Problem with line type when converting DWG to PDF

Posted: Thu May 23, 2019 1:44 pm
by sistemas.caw
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"

Re: Problem with line type when converting DWG to PDF

Posted: Fri May 24, 2019 8:50 am
by andrew
That would be caused by the linetype scale (LTSCALE) of 20.

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

Re: Problem with line type when converting DWG to PDF

Posted: Fri May 24, 2019 6:23 pm
by sistemas.caw
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?

Re: Problem with line type when converting DWG to PDF

Posted: Fri May 24, 2019 7:00 pm
by andrew
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.

Re: Problem with line type when converting DWG to PDF

Posted: Tue May 28, 2019 1:11 pm
by sistemas.caw
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.

Re: Problem with line type when converting DWG to PDF

Posted: Thu May 30, 2019 3:31 pm
by andrew
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).

Re: Problem with line type when converting DWG to PDF

Posted: Fri May 31, 2019 6:46 pm
by sistemas.caw
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?

Re: Problem with line type when converting DWG to PDF

Posted: Mon Jun 03, 2019 11:11 am
by andrew
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.

Re: Problem with line type when converting DWG to PDF

Posted: Tue Jun 04, 2019 12:24 pm
by sistemas.caw
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?

Re: Problem with line type when converting DWG to PDF

Posted: Mon Jun 10, 2019 2:48 pm
by sistemas.caw
Hello Andrew,

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

Posted: Tue Jun 11, 2019 9:13 am
by andrew
We will likely release a snapshot this or next week.

Re: Problem with line type when converting DWG to PDF

Posted: Tue Jun 11, 2019 1:31 pm
by sistemas.caw
Ok Andrew,

I'll wait. Thanks.