- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So this is my code below:
using (transaction)
{
// Get the block table from the drawing
BlockTable blocktable = (BlockTable)transaction.GetObject(acCurDb.BlockTableId, OpenMode.ForRead);
if (!blocktable.Has(givenPANBLK))
{
// Create our new block table record...
BlockTableRecord blocktablerecord = new BlockTableRecord();
// ... and set its properties
blocktablerecord.Name = givenPANBLK;
// Set the insertion point for the block
blocktablerecord.Origin = new Point3d(originPt.X, originPt.Y, originPt.Z);
// Add some lines to the block to form a square (the entities belong directly to the block)
DBObjectCollection ents =
SquareOfLines(
panelThickness, originPt, givenLeftHeight, givenRightHeight);
foreach (Entity ent in ents)
{ blocktablerecord.AppendEntity(ent); }
foreach (Entity ent in entsREW)
{ blocktablerecord.AppendEntity(ent);}
}
// Add an attribute definition to the block
//
// PANEL NAME
//
{
AttributeDefinition acAttDef = new AttributeDefinition();
acAttDef.Position = new Point3d(originPt.X, originPt.Y, originPt.Z);
acAttDef.Verifiable = true;
acAttDef.Prompt = Constants.PANBLK_PROMPT_PANELNAME;
acAttDef.Tag = Constants.PANBLK_TAG_PANELNAME;
acAttDef.TextString = "A";
acAttDef.Height = panelNameTextHeight;
acAttDef.ColorIndex = 132;
acAttDef.Layer = Constants.LAYER_PANNAME;
acAttDef.Invisible = false;
blocktablerecord.AppendEntity(acAttDef);
}
////
//// and many more Attribute definitions.
Now, How do I update the color of the lines per block? I need to update them only when they are selected.
Thank You for your help in advance.
Solved! Go to Solution.