[Qgis-user] DXF Export symbolLayer

Richard McDonnell richard.mcdonnell at opw.ie
Tue Jun 13 01:05:31 PDT 2023


Hi Simon,
Sorry, but this appears to be out of my area of expertise and more in line with that of the Dev's. It would look, to me, to be the way QGIS exports the symbols (Blocks)

The only other way I can see for you to change them is, using some CAD Package, manually RENAME<https://forums.autodesk.com/t5/autodesk-community-tips-autocad/autocad-rename-streamline-your-block-library/ta-p/11895193> the Blocks.
I have looked at it myself and its straightforward enough..

1.       Open the DXF

2.       Type REN and hit return

3.       Select Blocks in Named Objects

a.       A block you want to rename symbolLayer0 for example

b.       In the blank field at the bottom give it the name you want Grenzpunkt

c.       Click Rename To:

d.       Repeat for as many block groups as you want, then clock OK when finished


[cid:image001.png at 01D99DD6.33CA7A10] [cid:image006.png at 01D99DD5.C9310C50]

I hope this gets you sorted, but maybe having a few more custom options in exporting the DXF's for cases like this would be handy.
Kind Regards,

Richard





--
Richard McDonnell MSc GIS, FME Certified Professional
FRM Data Management

--
Oifig na nOibreacha Poiblí
Office of Public Works

Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
--
M +353 87 688 5964 T +353 46 942 2409
https://gov.ie/opw

--
To send me files larger than 30MB, please use the link below https://filetransfer.opw.ie/filedrop/richard.mcdonnell@opw.ie

Email Disclaimer: https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/

--
MSc GIS, FME Certified Professional

--
Oifig na nOibreacha Poiblí
Office of Public Works

Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
--
M +353 87 688 5964 T +353 46 942 2409
https://https://gov.ie/opw<https://www.opw.ie>

--
Email Disclaimer: https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/<https://www.opw.ie/en/disclaimer/>
From: Simon Gröchenig <groechenig at zt-gis.at>
Sent: 12 June 2023 14:14
To: Richard McDonnell <richard.mcdonnell at opw.ie>
Cc: qgis-user at lists.osgeo.org
Subject: AW: DXF Export symbolLayer

Hi,

thank you for your effort. Still, I have the same result.

Here is a screenshot where I visualize the DXF file in AutoCAD viewer. I have highlighted the "Layer" and "Name" values. I would like to modify the Name from symbolLayer1 to a custom value.

[cid:image002.png at 01D99DD6.33CA7A10]
https://www.sgroe.at/Screenshot 2023-06-12-150500.png

According to https://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf, I would like to change the block name (Group code 2).

INSERT
  5
97
100
AcDbEntity
100
AcDbBlockReference
  8
GP
  2 <<<<<
symbolLayer0 <<<<<
 50
0.0
 10
12.7812486278025137
 20
46.84633353466695382
  0

Simon

________________________________
Von: Richard McDonnell <richard.mcdonnell at opw.ie<mailto:richard.mcdonnell at opw.ie>>
Gesendet: Montag, 12. Juni 2023 12:52
An: Simon Gröchenig <groechenig at zt-gis.at<mailto:groechenig at zt-gis.at>>
Cc: qgis-user at lists.osgeo.org<mailto:qgis-user at lists.osgeo.org> <qgis-user at lists.osgeo.org<mailto:qgis-user at lists.osgeo.org>>
Betreff: RE: DXF Export symbolLayer


Hi Simon,

Apologies, I didn't quite understand what you were trying to do. So let's start from the beginning again.

Thank you for sending on a sample, it helps greatly to understand what you are trying to do. Im still not 100% on what you are trying to achieve, so I have included two separate examples based on your data.



In this first example, I will assume you are just trying to output the Layer as a DXF with symbols and styling as you have them shown on the canvas, this can simply be done by...



1.       Selecting Project from the Menubar then Import/Export - Export Project to DXF

2.       In the next window set the Save As field set the Location you want your DXF along with giving it a name.

3.       Symbology Scale This will depend on what scales the DXF is being printed out at, I have set 250 for the example

4.       CRS, I have kept it the same as your Project

5.       Layer This is the Layers you want to export, in this case sqq_subset

6.       If you are only exporting only what's in Canvas view tick Export features intersecting the current map extent, otherwise untick this to export whole Layer

7.       The only other thing I would tick in Export Labels as MTEXT if you have labels you want in your outputs.

8.       Click OK





Now if you want a DXF with two layers, Grenzpunkt and Others? You will need to split your single Layer into multiple layers. For the purposes of this I will assume were going for the two you have styled.



I don't know why I can't add actual columns, only virtual only seems to be allowed



Ok, so first thing to remember is DXF is not a smart dataset, so we need to dumb down your data a little.

To do this, we need to split the dataset into two layers, one for Grenzpunkt and one for Others

So firstly we need to categorise all data into the Layers we want (Grenzpunkt and Others), to do this we do something similar to what we done before. We create a column let's call it "sgg_subset" and into this we can use the following formula



CASE WHEN  "TYP" = 20  THEN 'Grenzpunkt'

ELSE 'Others'

END



Next we use the Split vector layer tool to create however many layers we want, in our case two. We use our layers attribute as the Unique ID field, making sure the  Add prefix to filenames is ticked (what we called our column) or unticked, as you require. You can now specify the Output file type and the Output directory. You can now click Run



Once this is completed, load you're newly created Layers into the Project and style as required.

Now we can export to DXF using the tool in the first example. The difference being we want the ONLY newly created individual layers ticked in the Layer box



If you want to improve how the styling, symbology is output, you will need to work on the QGIS Style, modifying it to get the desired output in DXF.



Any of the steps above can be modified to suit the outputs you want.

I have attached a zip file with the updated project and the output DXF examples, I hope it helps.

Regards,



Richard















--
Richard McDonnell MSc GIS, FME Certified Professional
FRM Data Management

--
Oifig na nOibreacha Poiblí
Office of Public Works

Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
--
M +353 87 688 5964 T +353 46 942 2409
https://gov.ie/opw

--
To send me files larger than 30MB, please use the link below https://filetransfer.opw.ie/filedrop/richard.mcdonnell@opw.ie

Email Disclaimer: https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/



--
MSc GIS, FME Certified Professional

--
Oifig na nOibreacha Poiblí
Office of Public Works

Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
--
M +353 87 688 5964 T +353 46 942 2409
https://https://gov.ie/opw<https://www.opw.ie>

--
Email Disclaimer: https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/<https://www.opw.ie/en/disclaimer/>


From: Simon Gröchenig <groechenig at zt-gis.at<mailto:groechenig at zt-gis.at>>
Sent: 12 June 2023 08:08
To: Richard McDonnell <richard.mcdonnell at opw.ie<mailto:richard.mcdonnell at opw.ie>>
Cc: qgis-user at lists.osgeo.org<mailto:qgis-user at lists.osgeo.org>
Subject: AW: DXF Export symbolLayer



Hi Richard,



thank you for your support.



I have added a (virtual) attribute 'RefName' with a similar CASE WHEN statement. But I don't see how this should change the DXF-output.



Some information:

  *   I have a point layer that I want to export to a DXF-file using the native:dxfexport algorithm.
  *   This layer has a categorized renderer.
  *   For the DXF export, I also set a field ("sgg_code" is my case) to split the features into several DXF-layers.
  *   Now I also have a field "RefName".
  *   The RefName corresponds with the expression used for the categorized rendering.
  *   And the RefName does NOT match the field "sgg_code" used for the DXF-split.
  *   I want to use the RefName (or labels set in categorized renderer) values instead of symbolLayer0, symbolLayer1, ...

I have attached a simple project with the point layer.

Simon





________________________________

Von: Richard McDonnell <richard.mcdonnell at opw.ie<mailto:richard.mcdonnell at opw.ie>>
Gesendet: Freitag, 9. Juni 2023 15:18
An: Simon Gröchenig <groechenig at zt-gis.at<mailto:groechenig at zt-gis.at>>
Cc: qgis-user at lists.osgeo.org<mailto:qgis-user at lists.osgeo.org> <qgis-user at lists.osgeo.org<mailto:qgis-user at lists.osgeo.org>>
Betreff: RE: DXF Export symbolLayer



Hi Simon,

You don't mention the field name in QGIS, but in the example below, I will use "TEST"

Create a new field, giving it a name, it can be "RefName" if you like, you can then create an expression like



CASE WHEN " TEST " ='symbolLayer0' THEN 'SomeOtherStringA'

WHEN " TEST " ='symbolLayer1' THEN 'SomeOtherStringB'

END



This should look at the "TEST" Attribute and where it has 'symbolLayer0' it will output 'SomeOtherStringA' and where "TEST" is 'symbolLayer1' it will output 'SomeOtherStringB'

When its complete you can delete any attributes you don't need

I hope that helps,



Regards,



Richard



--
Richard McDonnell MSc GIS, FME Certified Professional
FRM Data Management

--
Oifig na nOibreacha Poiblí
Office of Public Works

Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
--
M +353 87 688 5964 T +353 46 942 2409
https://gov.ie/opw

--
To send me files larger than 30MB, please use the link below https://filetransfer.opw.ie/filedrop/richard.mcdonnell@opw.ie

Email Disclaimer: https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/




--
MSc GIS, FME Certified Professional

--
Oifig na nOibreacha Poiblí
Office of Public Works

Sráid Jonathan Swift, Baile Átha Troim, Co na Mí, C15 NX36
Jonathan Swift Street, Trim, Co Meath, C15 NX36
--
M +353 87 688 5964 T +353 46 942 2409
https://https://gov.ie/opw<https://www.opw.ie>

--
Email Disclaimer: https://www.gov.ie/en/organisation-information/439daf-email-disclaimer/<https://www.opw.ie/en/disclaimer/>


From: QGIS-User <qgis-user-bounces at lists.osgeo.org<mailto:qgis-user-bounces at lists.osgeo.org>> On Behalf Of Simon Gröchenig via QGIS-User
Sent: 09 June 2023 10:12
To: qgis-user at lists.osgeo.org<mailto:qgis-user at lists.osgeo.org>
Subject: [Qgis-user] DXF Export symbolLayer



Hi all,



I am trying to configure a DXF export using the native:dxfexport algorithm and layer symbology.



Using the categorized rendering for a vector layer results in values "symbolLayer0", "symbolLayer1", ... in the dxf-file. In Autodesk Viewer these values are the "Name", ArcMap imports these as "RefName" attribute.



My question: how can I modify the values symbolLayer0, symbolLayer1, ... to another string? A third-party tool requires special values here.



Best regards
Simon





------------------------------------------------

Vermessungskanzlei Neumayr

Simon Gröchenig - Geoinformation



[cid:image001.jpg at 01D99D13.FED5BC60]



Albin Egger-Str. 10

9900 Lienz

Tel: +43 4852-68568-31

Email: groechenig at zt-gis.at<mailto:groechenig at zt-gis.at>

Web: http://www.zt-gis.at/


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230613/04b5c16f/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.jpg
Type: image/jpeg
Size: 1879 bytes
Desc: image004.jpg
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230613/04b5c16f/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 13507 bytes
Desc: image006.png
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230613/04b5c16f/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 25887 bytes
Desc: image001.png
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230613/04b5c16f/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 86912 bytes
Desc: image002.png
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230613/04b5c16f/attachment-0005.png>


More information about the QGIS-User mailing list