Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm inserting a dynamic block reference into drawing that has a custom grip used for moving the block.
By changing the value of DynamicBlockReferenceProperty position property, the grip is at the correct position after insert but the block geometry stays in place.
Any ideas how to fix this issue?
Code (this snippet is inside a transaction):
var blkRef = new BlockReference(Point3d.Origin, blkRecId);
var currentSpace = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
var blkRefId = currentSpace.AppendEntity(blkRef);
tr.AddNewlyCreatedDBObject(blkRef, true);
if (blkRef.IsDynamicBlock)
{
var dynProps = blkRef.DynamicBlockReferencePropertyCollection;
foreach (DynamicBlockReferenceProperty prop in dynProps)
{
if (prop.PropertyName == "Position1 X")
prop.Value = 1.0;
if (prop.PropertyName == "Position1 Y")
prop.Value = 1.0;
}
}
Solved! Go to Solution.