Practical Notes on Impractical Things

I just learned that the two introductory images presented in the article on the

Revit form creation API

came from Zach Kron, whose blog

Buildz

presents lots of interesting ‘practical notes on making impractical things’ in Revit.

Here is a pointer to a completely different kind of practical note on another blog:

Disable Auto Setback in Framing Template

Several developers have been struggling with some of the hard-coded Revit behaviour.
Miroslav Schonauer just pointed out that he and Sarah Capes found a solution for one specific problem on an Autodesk Consulting project, which is documented in this article on

how to disable auto setback in a framing template
.

And to round off today’s

potpourri
,
here is another issue around the topic of form creation:

NewSweptBlend Failure

Question:
I am trying to use the NewSweptBlend method, but it throws an exception saying “The attempted operation is not permitted in this type of family.” What can I do to solve this?

Answer:
This indicates that swept blends are not supported in the category type of the family where you are attempting to create it.

If it is a 2D family type, you would get this exception, and maybe also on a few other types as well.

In your specific case, the code uses a Conceptual Mass template and tries to create a SweptBlend in it.
If you want to work in a Conceptual Mass template, you must use the NewSweptBlendForm method instead.
If you want to use NewSweptBlend, then use a non-mass template.


Comments

6 responses to “Practical Notes on Impractical Things”

  1. Shifali Avatar
    Shifali

    Dear Jeremy,
    A very Happy New Year to you and your team.
    I am back with a query. I need to draw a single curve from two different curves.I am trying to do it with CurveArray. In this CurveArray, I am inserting the two different curves and now using this curveArray need to draw a third curve.say, I have two semi circles and need to draw it as one complete circle in document.
    I am using the following code for it:
    CurveArray newArray = new CurveArray();
    newArray.Insert(arc.GeometryCurve, 0);
    newArray.Insert(arc2.GeometryCurve, 1);
    What should I do further or is this possible in api to draw a single curve using two or more curves?
    Regards,
    Shifali

  2. Shifali Avatar
    Shifali

    Hi Jeremy,
    I searched for it in Revit User Interface, in it we can draw circle from “Home -> Model Line -> Draw(choose Circle Option)” but I am not getting its option in RevitAPI with ModelLine if I have its radius and center.
    Regards,
    Shifali

  3. shifali Avatar
    shifali

    Dear Jeremy,
    Thank you for your support. Please ignore the above issue as I have resolved it with the help of Revit API chm.
    Regards,
    Shifali

  4. Dear Shifali,
    Way to go, man!
    Congratulations, and Happy New Year to you too!
    So what was the solution you found?
    Cheers, Jeremy.

  5. shifali Avatar
    shifali

    Dear Jeremy,
    I have drawn the circle using Detail arc only with which i was drawing the semi circle on active document with some modifications. I am using the following method to draw complete circle with center and radius known:
    XYZ norm = XYZ.BasisZ;
    double startAngle = 0; // The unit is radian
    double endAngle = 2 * Math.PI; //arc will be a circle
    Autodesk.Revit.Geometry.Plane objPlane = new Plane(norm, centerPoint);
    Arc arcCircle = revitApp.Create.NewArc(objPlane, radiusOfCircle, startAngle, endAngle);
    DetailArc arcCircleDet = doc.Create.NewDetailCurve(doc.ActiveView, arcCircle) as DetailArc;

  6. Dear Shifali,
    Thank you for the code snippet, it looks just fine to me.
    Cheers, Jeremy.

Leave a Reply to shifaliCancel reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading