public static Dictionary <string, object> CreateFlakeboardStripesProperties(FlakeboardStripesProperties props) { List <FS_Rectangle> allLines = CreateFlakeboardRectangles(props); var instanceProps = ByPointInstanceProperties.CreateList( allLines.Select(l => l.Length).ToList(), allLines.Select(l => l.Width).ToList(), props.FlakeboardType, allLines.Select(l => l.CenterPosition).ToList(), props.FlakeboardRotation); return(ByPointInstanceProperties.AsDictionary(instanceProps)); }
/// <summary> /// NOT WORKING YET /// Generates flakeboard stripes objects from the given properties. /// </summary> /// <param name="props">Needed properties.</param> public static List <FamilyInstance> CreateFlakeboardStripesDirectly(FlakeboardStripesProperties props) { List <FS_Rectangle> allLines = CreateFlakeboardRectangles(props); List <FamilyInstance> allInstances = new List <FamilyInstance>(); foreach (var item in allLines) { allInstances.Add(FamilyHelper.Create( props.FlakeboardType, props.FloorData.Level, Point.ByCoordinates(item.CenterPosition.X, item.CenterPosition.Y, item.CenterPosition.Z), props.FlakeboardRotation, item.Length, item.Width )); } return(allInstances); }
private static List <FS_Rectangle> CreateFlakeboardRectangles(FlakeboardStripesProperties props) { FS_WithLines filler = new FS_WithLines( new FL_FixedPartFixedSpaceVariableEnd( props.FlakeboardLength, props.FlakeboardDistanceAlong, false, false), new FL_FixedPartSize_VariableSpacing( props.DesiredAccrossFlakeboardDistance, props.FlakeboardWidth, false)); var result = filler.Fill(new FS_LineFilledSpace( props.FloorData.BoothData.LengthX - 2 * props.FlakeboardDistanceToBounds, props.FloorData.BoothData.LengthY - 2 * props.FlakeboardDistanceToBounds, props.FlakeBoardDirection)); //Remove Space Rectangles accross lines result = RemoveUnevenIndices(result); //Flatten result list var allLines = new List <FS_Rectangle>(); foreach (var line in result) { //Remove space rectangles along lines var filteredLines = RemoveUnevenIndices(line); allLines.AddRange(filteredLines); } //Add Distance To Bound in AccrossDirection allLines.ForEach(r => { r.CenterPosition.X += props.FlakeboardDistanceToBounds; r.CenterPosition.Y += props.FlakeboardDistanceToBounds; }); return(allLines); }