Message 1 of 3
Not applicable
03-28-2012
08:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey Guys,
I'm creating an array using a block from an existing dwg file on my drive. When i import this block on it's own, i can explode it to ownerspace with "bref.ExplodeToOwnerSpace();" but when i'm creating the array, i don't have this ability and i'm left with one of my blocks in the array exploded, and the rest not. How do i explode the blocks in the array? When i try to use acEntClone.ExplodeToOwnerSpace(); it doesn't exist and i only have the option of acEntClone.Explode().
Cheers
Vince
The Original Block
Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
Database acCurDb = acDoc.Database;
LayerTable acLyrTbl;
acLyrTbl = tr.GetObject(acCurDb.LayerTableId, OpenMode.ForRead) as LayerTable;
string sLayerName = "CH-SPR";
BlockReference bref = new BlockReference(pCenter, BlkId);
acCurDb.Clayer = acLyrTbl[sLayerName];
string SlayerName2 = "CH-SPR";
btr.AppendEntity(bref);
bref.Layer = SlayerName2;
tr.AddNewlyCreatedDBObject(bref, true);
bref.ExplodeToOwnerSpace();
bref.Erase();The Array Code
int nColumnsCount = 1;
while (nColumns > nColumnsCount)
{
Entity acEntClone = bref.Clone() as Entity;
acDBObjCollCols.Add(acEntClone);
//Calculate the new point for the copied object (move)
Point2d acPt2dTo = PolarPoints(acPt2dArrayBase, dArrayAng, dColumnOffset * nColumnsCount);
Vector2d acVec2d = acPt2dArrayBase.GetVectorTo(acPt2dTo);
Vector3d acVec3d = new Vector3d(acVec2d.X, acVec2d.Y, 0);
acEntClone.TransformBy(Matrix3d.Displacement(acVec3d));
btr.AppendEntity(acEntClone);
acTrans.AddNewlyCreatedDBObject(acEntClone, true);
nColumnsCount = nColumnsCount + 1;
}
and
foreach (Entity acEnt in acDBObjCollCols)
{
int nRowsCount = 1;
while (nRows > nRowsCount)
{
Entity acEntClone = acEnt.Clone() as Entity;
acDBObjCollLvls.Add(acEntClone);
//Calculate the new point for the copied object (move)
Point2d acPt2dTo = PolarPoints(acPt2dArrayBase, dArrayAng + dAng, dRowOffset * nRowsCount);
Vector2d acVec2d = acPt2dArrayBase.GetVectorTo(acPt2dTo);
Vector3d acVec3d = new Vector3d(acVec2d.X, acVec2d.Y, 0);
acEntClone.TransformBy(Matrix3d.Displacement(acVec3d));
btr.AppendEntity(acEntClone);
acTrans.AddNewlyCreatedDBObject(acEntClone, true);
nRowsCount = nRowsCount + 1;
}
}
Solved! Go to Solution.