Question

Setting autocad_lineweight and autocad_linetype at Layer level writing DWG/DXF


Badge

Hi,

Is it possible to set AutoCAD Lineweight and Linetype at Layer level instead of Object/Entity level? I am using DWGStyler transformer and a DWG Template.

 

Each object is represented with the correct lineweight and linetype; however, these are set at object level instead of layer level as you can see in the below picture.

 

CaptureThanks,

Ana


7 replies

Badge +4

Hi @anamanvil​ ,

 You can use attributeFilter to separate each layer and apply the changes.

Please take a look at the example below.

You can also check the link below for some good examples.

https://community.safe.com/s/article/working-with-the-dwgstyler

 

Badge

Hi @anamanvil​ ,

 You can use attributeFilter to separate each layer and apply the changes.

Please take a look at the example below.

You can also check the link below for some good examples.

https://community.safe.com/s/article/working-with-the-dwgstyler

 

Hi Caneraking,

 

Thanks for your reply.

 

I am using attributeFilter to separate each Category; however, within each Category where I define the colour, I have multiple options (up to 40 possible LineType); therefore, it would be tricky to maintain the Workspace in the future. But I imagine is a fair workaround if I cannot find a better solution.

 

It just doesn't make sense that you can make the DWG dynamic by using DWGStyler but then you need to separate so that the LineStyle is set at a Layer Level...

Badge +4

Hi Caneraking,

 

Thanks for your reply.

 

I am using attributeFilter to separate each Category; however, within each Category where I define the colour, I have multiple options (up to 40 possible LineType); therefore, it would be tricky to maintain the Workspace in the future. But I imagine is a fair workaround if I cannot find a better solution.

 

It just doesn't make sense that you can make the DWG dynamic by using DWGStyler but then you need to separate so that the LineStyle is set at a Layer Level...

Hi Ana,

Would you be able to provide a sample dataset and template, I can try to come up with a better answer.

Badge

Hi Caneraking,

 

Thanks for your reply.

 

I am using attributeFilter to separate each Category; however, within each Category where I define the colour, I have multiple options (up to 40 possible LineType); therefore, it would be tricky to maintain the Workspace in the future. But I imagine is a fair workaround if I cannot find a better solution.

 

It just doesn't make sense that you can make the DWG dynamic by using DWGStyler but then you need to separate so that the LineStyle is set at a Layer Level...

Hi Caneraking,

 

I am going with your approach as it seems to working well. So Attribute Filter and specific AutoCAD Writer. Is working with regards to Linetype but not for Lineweight. Do you know how I can set the Lineweight at Layer Level too? I am using an Attribute_Creator and setting up 'autocad_lineweight' to 30. I can visualize it but is not gathered within the layer properties as instead this is set to Default.

Badge +20

You can get inspiration from nieslsgetrits answer from 03-May-2019 on this post. Set ByLayer color (autocad_layer_color) in DWG. (safe.com)

See also autocad_layer_lineweight in the documentation Feature Representation (safe.com)

Badge

You can get inspiration from nieslsgetrits answer from 03-May-2019 on this post. Set ByLayer color (autocad_layer_color) in DWG. (safe.com)

See also autocad_layer_lineweight in the documentation Feature Representation (safe.com)

Thanks Caracadrian, very helpful. Unfortunately, I am only able to show autocad_layer_lineweight and autocad_layer_linetype when reading a DWG and not when writing, which is what I am looking for? Am I missing something?

Badge +20

Thanks Caracadrian, very helpful. Unfortunately, I am only able to show autocad_layer_lineweight and autocad_layer_linetype when reading a DWG and not when writing, which is what I am looking for? Am I missing something?

It appears that the example I gave you isn't very useful. Layer colour and linetype can be set via Parameter on Writer, layer lineweight can not.

The fact is it can only be set via a template file as layers aren't writen as features.

nieslsgetrits approach was to dynamically create a template via a WorkspaceRunner by iteratively writing layer properties via parameters (set by attributes from the first workspace).

If your dwg files are standardised you can create a template and set it in the writer parameters. For something dynamic you should post an idea Idea List (safe.com) and wait for a new build.

Reply