Replies: 1 comment
-
So it seems, as noted here, that creating a block reference with attributes is only possible by immediately assigning it an owner (BlockTableRecord). I thought that a way to create a reference "in memory" (it would be saved in the database anyway) could be to dynamically create a BTR and set it as the owner in the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to add a few new functions to help with working with blocks:
get_block_reference
- create a block reference, the reference is added to the database (db.addObject(block_ref)
), the user is responsible for adding it to the transaction and/or to the modelspace; returnsDb.ObjectId[Db.BlockReference]
add_block_definition
- add a block from a dwg/dxf file to the database, if the name is given instead of the path, search for it in the search path, returnsDb.ObjectId[Db.BlockTableRecord]
get_block_by_name
- if the block does not exist in the database, it tries to add it usingadd_block_definition
, returnsDb.ObjectId[Db.BlockTableRecord]
I already have prototypes of these functions for my own use, but I need to refine them a bit. Suggestions/thoughts/ideas for other functions are welcome.
Beta Was this translation helpful? Give feedback.
All reactions