[Qgis-user] DXF Export symbolLayer

DelazJ delazj at gmail.com
Mon Jun 12 05:39:43 PDT 2023


Hi,
Sorry if it has been said (I did not read every thing) but if I'm not wrong
there is an option to use field values and get split layers in output dxf
file. This is under the "Output layer attribute" column [0]. Unfortunately,
there is a bug (for many versions now) [1] that hides by default that
column in the dialog.

[0]
https://docs.qgis.org/3.28/en/docs/user_manual/managing_data_source/create_layers.html#creating-new-dxf-files
[1] https://github.com/qgis/QGIS/issues/49958

Harrissou

Le lun. 12 juin 2023 à 13:31, Richard McDonnell via QGIS-User <
qgis-user at lists.osgeo.org> a écrit :

> 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>
> *Sent:* 12 June 2023 08:08
> *To:* Richard McDonnell <richard.mcdonnell at opw.ie>
> *Cc:* 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>
> *Gesendet:* Freitag, 9. Juni 2023 15:18
> *An:* Simon Gröchenig <groechenig at zt-gis.at>
> *Cc:* qgis-user at lists.osgeo.org <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> *On Behalf Of *Simon
> Gröchenig via QGIS-User
> *Sent:* 09 June 2023 10:12
> *To:* 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
>
>
>
> [image: cid:image001.jpg at 01D99D13.FED5BC60]
>
>
>
> Albin Egger-Str. 10
>
> 9900 Lienz
>
> Tel: +43 4852-68568-31
>
> Email: groechenig at zt-gis.at
>
> Web: http://www.zt-gis.at/
>
>
> _______________________________________________
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230612/137ce04d/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 1879 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230612/137ce04d/attachment-0001.jpg>


More information about the QGIS-User mailing list