Message 1 of 6
Link objects of array with polyline

Not applicable
07-25-2012
08:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Everyone,
So i'm a bit stuck here. I've managed to create an array using custom blocks. This array is obviously comprised of "x" columns and "x" rows. What i'm trying to do is have the ability to essentially link all of the objects per column (and/or per row) with a polyline. So if i have 5 columns generated, I would like to have 5 polylines extend over those columns. Does anyone have an example of how to do something like this. Essentially what i'm looking to do is create something of a grid using the objects in my array as placemarkers. Sorry if this seems vague.
*Edited because i forgot to post some code
Cheers
Vince
And now for a bit of existing code
//Use the upper-left corner of the objects extents for the array base point Extents3d acExts = bref.Bounds.GetValueOrDefault(); Point2d acPt2dArrayBase = new Point2d(acExts.MinPoint.X, acExts.MaxPoint.Y); //Track the objects created for each column DBObjectCollection acDBObjCollCols = new DBObjectCollection(); acDBObjCollCols.Add(bref); //Create the number of objects in the first column int nColumnsCount = 1; while (nColumns > nColumnsCount) { BlockReference acEntClone = bref.Clone() as BlockReference; 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); // acEntClone.ExplodeToOwnerSpace(); nColumnsCount = nColumnsCount + 1; } //Set a value in radians for 90 degress double dAng = Math.PI / 2; //Track the objects created for each row and column DBObjectCollection acDBObjCollLvls = new DBObjectCollection(); foreach (DBObject acObj in acDBObjCollCols) { acDBObjCollLvls.Add(acObj); } // Create the number of objects for each row foreach (Entity acEnt in acDBObjCollCols) { int nRowsCount = 1; while (nRows > nRowsCount) { BlockReference acEntClone = acEnt.Clone() as BlockReference; 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; }