Stream(ArrayList data, HostedSweepType hostSweepType) { data.Add(new Snoop.Data.ClassSeparator(typeof(HostedSweepType))); // No data at this level yet! FasciaType fasciaType = hostSweepType as FasciaType; if (fasciaType != null) { Stream(data, fasciaType); return; } Autodesk.Revit.DB.Architecture.GutterType gutterType = hostSweepType as Autodesk.Revit.DB.Architecture.GutterType; if (gutterType != null) { Stream(data, gutterType); return; } SlabEdgeType slabEdgeType = hostSweepType as SlabEdgeType; if (slabEdgeType != null) { Stream(data, slabEdgeType); return; } }
public static List <SlabEdge> ByReferenceArray(Revit.Elements.Element Floor, Revit.Elements.Element SlabEdgeType) { var doc = DocumentManager.Instance.CurrentDBDocument; List <SlabEdge> slab = new List <SlabEdge>(); ElementId id = Elements.UnwrapElement(SlabEdgeType); SlabEdgeType unwrapSlabEdge = doc.GetElement(id) as SlabEdgeType; Console.WriteLine(id); ElementId floorId = Elements.UnwrapElement(Floor); Autodesk.Revit.DB.Floor elem = doc.GetElement(floorId) as Autodesk.Revit.DB.Floor; Options geomOptions = new Options(); GeometryElement solid = elem.get_Geometry(geomOptions); try { foreach (GeometryElement k in solid) { ReferenceArray referenceArray = new ReferenceArray(); referenceArray.Clear(); //IEnumerable<ReferenceArray> reference = Line as IEnumerable<ReferenceArray>; //foreach (Autodesk.DesignScript.Geometry.Curve host in k) //{ // //var curve = host.ToRevitType(); // //var host = curve.ToProtoType(); // //Reference j = host as Reference; // Curve curve = host.ToRevitType(); // Reference refc = curve.Reference; // referenceArray.Append(refc); //} TransactionManager.Instance.EnsureInTransaction(doc); SlabEdge slabcreator = doc.Create.NewSlabEdge(unwrapSlabEdge, referenceArray); slabcreator.ToDSType(true); slab.Add(slabcreator); TransactionManager.Instance.TransactionTaskDone(); } return(slab); } catch (Exception ex) { throw ex; } }
private void Stream(ArrayList data, SlabEdgeType gutterType) { data.Add(new Snoop.Data.ClassSeparator(typeof(SlabEdgeType))); // No data at this level yet! }
Stream(ArrayList data, SlabEdgeType gutterType) { data.Add(new Snoop.Data.ClassSeparator(typeof(SlabEdgeType))); // No data at this level yet! }