Skip to content

Identifying dxf entities from exported svg elements #540

Answered by mbway
LaDeKlint asked this question in Q&A
Discussion options

You must be logged in to vote
  1. It may be possible to pass metadata through matplotlib to the resulting svg by implementing a custom matplotlib.backends.backend_svg.RendererSVG. Using matplotlib.artist.Artist.set_gid you could implement a custom version of the ezdxf.addons.drawing.matplotlib.MatplotlibBackend which sets the id of each artist to some value which can be linked back to the dxf, then when your custom SVG renderer is writing out individual svg tags you may be able to obtain the id of the entity currently being drawn and be able to link that all the way back to the dxf entity id. But as you can see this won't be easy. An alternative would be to implement an SVGBackend to ezdxf directly. This is something whi…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@mozman
Comment options

@LaDeKlint
Comment options

@eevleevs
Comment options

Answer selected by LaDeKlint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants