Hello @jeremy_tammik
Yes, I'm trying this in Family Editor, here is my code:
IList<ElementId> elementIds = sweep.ProfileSketch.GetAllElements();
foreach (ElementId elemid in elementIds)
{
Element element = family.GetElement(elemid);
if (element is ModelArc marc)
{
if (marc.GeometryCurve is Arc arc)
{
FilteredElementCollector views = new FilteredElementCollector(family).OfCategory(BuiltInCategory.OST_Views).OfClass(typeof(View3D));
View3D v = views.FirstOrDefault(v => v.Name == "{3D}") as View3D;
Reference arcRef = arc.Reference;
XYZ origin = arc.Center;
family.FamilyCreate.NewDiameterDimension(v, arcRef, origin);
}
}
}
And it is achievable by UI, edit any Conduit Fitting Family that is created using a sweep. Edit the sweep -> Edit the Profile -> Put Diameter Dimension on the Profile curves.

My problem is with line 13 it throws error:

Please advise 😃
¯\_(ツ)_/¯
Let it work like a charm.
Mustafa Salaheldin


Digital Integration Manager, DuPod
Facebook |
Twitter |
LinkedIn