def make_filledregion(fillpattern_name, fillpattern_id): filledregion_types = FilteredElementCollector(doc).OfClass( clr.GetClrType(FilledRegionType)) source_fr = filledregion_types.FirstElement() with Transaction(doc, 'Create Filled Region') as t: t.Start() new_fr = source_fr.Duplicate(fillpattern_name) new_fr.FillPatternId = fillpattern_id t.Commit()
gridsIntersection = [] # Create IntersectionArray object interRes = clr.Reference[IntersectionResultArray]() # Check for intersections and append grids names as pairs and intersection points for gC in gridsColumn: for gR in gridsRow: inter = gC.Curve.Intersect(gR.Curve, interRes) gCName = gC.LookupParameter("Name").AsString() gRName = gR.LookupParameter("Name").AsString() gridsPair.append((gCName, gRName)) gridsIntersection.append(interRes.Item[0].XYZPoint) # Select family to place in intersections markingSymbol = FilteredElementCollector(doc).OfCategory( BuiltInCategory.OST_GenericModel) markingSymbol.OfClass(FamilySymbol).ToElements() familyToPlace = markingSymbol.FirstElement() for element in markingSymbol: if element.FamilyName == "CoG": cogSymbol = element # Place families in the intersection grids for point in gridsIntersection: familyPlaced = doc.Create.NewFamilyInstance( point, familyToPlace, Structure.StructuralType.NonStructural) print(gridsIntersection)
for p in tesseCurve: if len(finalPoints) == 0: finalPoints.append(endPoint) else: dist += endPoint.DistanceTo(p) if dist > stepsize: finalPoints.append(p) dist = 0 endPoint = p # Retrieve family to place on points markingSymbol = FilteredElementCollector(doc).OfCategory( BuiltInCategory.OST_GenericModel) markingSymbol.OfClass(FamilySymbol).ToElements() cogSymbol = markingSymbol.FirstElement() for element in markingSymbol: if element.FamilyName == "CoG": cogSymbol = element # Create a individual transaction t = Transaction(doc, "Divide curve") # Start individual transaction t.Start() for p in finalPoints: doc.Create.NewFamilyInstance(p, cogSymbol, Structure.StructuralType.NonStructural) # Commit transaction t.Commit()