Diameter Dimensions for Sweep Profile
Link copied
Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.
Is this inside a family definition, or where? Have you researched how to achieve the desired result manually in the UI? What are the exact steps to achieve that?
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 😃
One quick point that is worth to mention is adding the diameter dimension is only allowed in sketch edit mode of the profile. Not sure if this is the cause, but let us see what it could be!
Another quick note: when using Lookup to investigate the diameter dimension I created manually it shows the same "arcRef" and "origin" I set. The difference is "view" shows null and instead arcRef it shows references.
Note: I used the dimension ID to search for the element in Lookup 😄
@naveen.kumar.t would you please check with the development team if this is not a bug in Revit 2022.
@ctm_mka This is impossible, during edit mode Lookup is deactivated
The only way is as I showed you before, get the id of the curve or the dimension, use it outside the sweep/profile edit in mode Lookup to get to the dimension.
Dear Mustafa,
Sorry for not jumping in sooner. I am on leave and therefore trying to remain completely inactive here. I'm afraid I am not completely succeeding...
I asked the development team for you.
Cheers
Jeremy
We ran into a similar issue, and we gave up after few tries. In Revit 2023/2024 in Families trying to add a Diameter Dimension to a Model Line fails with the same error as yours. We did not have time to investigate too much, but it is simple to replicate:
In a Family, create a SketchPlane where the curve is.
Create an arc from a curve.
Create a ModelCurve from the arc in the SketchPlane.
Try to create NewDiameterDimension to the ModelCurve -> it fails with the same error message.
---------------------------
Error
---------------------------
Error: One of the conditions for the inputs was not satisfied. Consult the documentation for requirements for each argument.
---------------------------
OK
---------------------------