Replies: 3 comments 12 replies
-
Hi Ben, interesting topic, definitively has potential. One additional way to integrate this would be a builder, something like this: using (var db = AcadDatabase.Active())
{
db.ModelSpace
.Add(b => b.BlockReference()
.FromBlock(acBlkTbl["TestBlock"])
.WithPosition(point3d)
.WithAttributeReferences());
} This makes creating the AttributeReferences and setting the position optional. |
Beta Was this translation helpful? Give feedback.
-
I like the blockTableRecord.NewBlockReference(point3d) notation.
I'm afraid this won't work, we can't add properties like Tags to a type, only methods via extension methods. The only way to do that would be to have our own BlockReference type, which is not a good idea.
In my optionion dictionaries are not a good thing for initialization because they are too unspecific. You don't know which options you have (which strings are allowed keys) without looking into documentation. No IntelliSense either. |
Beta Was this translation helpful? Give feedback.
-
If we should limit our discussion on block references, what is your opinion of what finalised API design should be? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Came across a discussion on the forums. Someone wants to add a block reference:
Before
After
What if we want to amend the attribute reference(s)?
Or if we know what the tags / values on initialization, we could simply pass in a dictionary:
Bad idea?
Beta Was this translation helpful? Give feedback.
All reactions