Repository navigation
|
Thanks for your attention! I've attached my code and the dxf file, thanks again! These are the dxf files on Google Drive |
Replies: 1 comment 1 reply
|
The DIMENSION entity stores the parameters for the dimension line. The visual representation is rendered into an anonymous geometry block "*Dnnnn" . To change the layer of the visual representation you have to re-render the dimension line - the result will look different than the rendering from CAD applications, or you change the layer of all entities in the geometry block: The copy/remove procedure of your code is not necessary, layers are not containers they are just attributes. for dimension in msp.query(f'DIMENSION[layer=="{ori_dim_layer_name}"]'):
dimension.dxf.layer = new_dim_layer_name
block = dimension.get_geometry_block()
if block:
for entity in block:
entity.dxf.layer = new_dim_layer_name |


The DIMENSION entity stores the parameters for the dimension line. The visual representation is rendered into an anonymous geometry block "*Dnnnn" .
To change the layer of the visual representation you have to re-render the dimension line - the result will look different than the rendering from CAD applications, or you change the layer of all entities in the geometry block:
The copy/remove procedure of your code is not necessary, layers are not containers they are just attributes.