Skip to content

How to move entities between layouts #1076

Answered by mozman
sunblog3 asked this question in Q&A
Discussion options

You must be logged in to vote

It's hard to stop users from doing stupid things when the data format allows for a lot of stupid things.

In this case you are trying to assign entities from modelspace to a new block, but each entity can only be assigned to one layout. The add_entity() method is a low level tool and should only be used if you know what you are doing.

There exist a method for moving entities to between layouts: BaseLayout.move_to_layout()

And no, there is no way to prevent this from happening in the first place, as adding an entity to a second layout can be an intermediate step in a larger workflow:

  • ezdxf is a tool for programmers, not an end-user application!
  • you need to understand the basics of the data…

Replies: 1 comment 3 replies

Comment options

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

@mozman
Comment options

@mozman
Comment options

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