public static void WorkingRoutine() { Document famDoc; //This is within my family document. XYZ dir = XYZ.BasisX.Negate() XYZ norm = XYZ.BasisZ //This makes a 1/32" line. XYZ p = new XYZ(0,0,0); XYZ q = p + (.002605 * dir); Curve curve = Line.CreateBound(p, q); CurveArray array = new CurveArray(); array.Append(curve); // we will get one of the Revit default profiles for Duct. In this case, Duct - Round FamilySymbol orgProfileSym = null; GetProfileFamilySymbol(famDoc, out orgProfileSym); FamilySymbolProfile profile = famDoc.Application.Create.NewFamilySymbolProfile(orgProfileSym); //Sketch Plane Plane gPlane = famDoc.Application.Create.NewPlane(normal, p); SketchPlane sPlane = SketchPlane.Create(famDoc, gPlane); Sweep connSweep = famDoc.FamilyCreate.NewSweep(true, array, sPlane, profile, 0, ProfilePlaneLocation.Start); } // THIS IS THE ROUTINE THAT DOESNT WORK. // It appears that copying the 'orgFamSym' value makes the Sweep not work. // I need to figure out why. public static void NonWorkingRoutine() { Document famDoc; //This is within my family document. XYZ dir = XYZ.BasisX.Negate() XYZ norm = XYZ.BasisZ //This makes a 1/32" line. XYZ p = new XYZ(0,0,0); XYZ q = p + (.002605 * dir); Curve curve = Line.CreateBound(p, q); CurveArray array = new CurveArray(); array.Append(curve); // we will get one of the Revit default profiles for Duct. In this case, Duct - Round FamilySymbol orgProfileSym = null; GetProfileFamilySymbol(famDoc, out orgProfileSym); // In this instance, we will make a copy of that family symbol so we can have multiple connectors FamilySymbol profileSym = CreateNewConnProfileType(4, orgProfileSym) FamilySymbolProfile profile = famDoc.Application.Create.NewFamilySymbolProfile(profileSym); //Sketch Plane Plane gPlane = famDoc.Application.Create.NewPlane(normal, p); SketchPlane sPlane = SketchPlane.Create(famDoc, gPlane); Sweep connSweep = famDoc.FamilyCreate.NewSweep(true, array, sPlane, profile, 0, ProfilePlaneLocation.Start); } public static void GetProfileFamilySymbol(Document doc, out FamilySymbol sym) { sym = null; string profileLocation = @"C:\ProgramData\Autodesk\RME\2014\Libraries\US Imperial\Duct\Fittings\Profiles\Duct - Round.rfa"; doc.LoadFamilySymbol(profileLocation, "Duct - Round", out sym); if ((!sym.IsActive) && (sym != null)) { sym.Activate(); doc.Regenerate(); } } public static FamilySymbol CreateNewConnProfileType(double diameter, orgType) { string symName = "Conn 1"; FamilySymbol rtnSym = orgType.Duplicate(symName) as FamilySymbol; SetParameter(diameter, ref rtnSym); return rtnSym; } public static void SetParameter(string paramName, double paramValue, ref FamilySymbol sym) { //This routine is in place because Revit 2016+ does not allow for the use of the Element.get_Parameter method. ParameterSet ps = sym.Parameters; foreach (Parameter p in ps) { if (p.Definition.Name == paramName) { try { p.Set(paramValue); } catch { } } } }