Message 1 of 3
Matrix3d Block Entity Position

Not applicable
01-18-2011
05:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, i have been trying to get the matrix3d transform for any entity, solid3d block but thing seems like not work out for me. I tried with a simple line, using the start point and end point of the line to compute my own matrix3d transform but what about if the line is in a block. The start point and end point of a line in block is always the same, maybe it referencing to the block origin.
below is a simple prompt to get the entity and if the entity is a block reference then it will add a line with start(-15,0,0) End(15,0,0) so is there any way to get the start point and end point of the line in WCS? and not referencing to the block?
Entity aEntity = (Entity)Trans.GetObject(PromptResult.ObjectId, OpenMode.ForRead); if (aEntity.GetType() == typeof(BlockReference)) { BlockReference aBlockReference = (BlockReference)aEntity; Line aLine = new Line(new Point3d(-15, 0, 0), new Point3d(15, 0, 0)); BlockTableRecord btr = (BlockTableRecord)Trans.GetObject(aBlockReference.BlockTableRecord, OpenMode.ForRead); btr.UpgradeOpen(); btr.AppendEntity(aLine); Trans.AddNewlyCreatedDBObject(aLine, true); Trans.Commit(); }
Thanks