Message 1 of 6
Place a block in a specific rectangle

Not applicable
08-17-2017
03:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I can place a block using a Point as a position and change his scale using the bellow code :
string blockName = name; BlockTable bt = db.BlockTableId.GetObject(OpenMode.ForRead) as BlockTable; BlockTableRecord blockDef = bt[blockName].GetObject(OpenMode.ForRead) as BlockTableRecord; BlockTableRecord ms = bt[BlockTableRecord.ModelSpace].GetObject(OpenMode.ForWrite) as BlockTableRecord; using (BlockReference blockRef = new BlockReference(position, blockDef.ObjectId)) { blockRef.ScaleFactors = new Scale3d(scale); blockRef.Layer = layer; id = ms.AppendEntity(blockRef); myT.AddNewlyCreatedDBObject(blockRef, true); }
but i want to place the block in a specific rectangle for which i can recover the extent, means that i need to use just the extent to place the block in the rectange without using the scale. is that possible an how ?
thank you.