Why cant I place detail component by curve?

I cant place my detail component to view but i can create detail from that curve.
How can I fix it.
Thank so much.

i’m trying use node “by point in view” but it don’t run

I think so there is some problem with view. Can you try with this node for View input? View1

1 Like

I’m trying but It have the same result

can you show in the graph with details below of each node

1 Like


Thank so much :smiley:

Is your rebar slab family a detail component meaning a 2D annotation, or a model element meaning a 3D object?

1 Like

This family is a detail component by line


I want to show off my floor rebar on structural plan as in the picture. When I want to Edit Sketch I must go to section view. I don’t think it affects the outcome

I have 2 question:

  • How can i place detail component by curve?
  • Can I change instance for each detail component?

Provide an rvt including the family and dyn files and we can help as the detail component by curve pretty much always works.

1 Like

File revit 2020: https://drive.google.com/file/d/19wHBDJCa_HA9X0K8VJ656OfIJwTFYHtX/view?usp=sharing
File Dynamo: Place Detail Component Floor Rebar.dyn (25.6 KB)
File Revit have 2 view: Source and Result

Do you have a 2019 version of this family by any chance?

File Revit 2019: https://drive.google.com/file/d/1RY_4upJayc3l-tb7gIoI7ujd78xQm5gu/view?usp=sharing
Thank you so much :smiley:

Well, I have it figured out. Your curve isn’t in the same plane as your view.

Feel free to follow along as I’m going to ‘teach a man to fish’ here so that you and others will be able to solve this stuff more readily in the future. Not all ‘fixes’ are this easy, but the concepts here are good ‘how to’ steps for resolving python based nodes in the future.

Start by opening the DetailComponent.ByCurve node in the Clockwork package (double click on it to do so), select the useful bits (anything that isn’t an input or output node), switch back to the active dyn document and paste them in. You can then remove some of the ‘no longer necessary’ stuff like turn into list, and the like.

Once that was done you can pretty easily see that the issue starts (and continues) with the Python code which @Andreas_Dieckmann was using. Making a few easy edits to it as per this post by @Konrad_K_Sobon will allow us to understand what is going wrong.

Side note, we owe both of these guys some thanks for the accessible content and documentation which they continue to provide the larger community. :smiley:

This was my resulting code, including some markups used to differentiate what I changed.
# Original Code by Andreas Dieckmann
# https://github.com/andydandy74/ClockworkForDynamo
# edited by Jacob Small, following the instructions in this post:
# https://forum.dynamobim.com/t/convert-circuit-path-from-api-to-line/40408/5?u=jacobsmall

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
curves = UnwrapElement(IN[0])
famtype = UnwrapElement(IN[1])
view = UnwrapElement(IN[2])
version = IN[3]
elementlist = list()
counter = 0

TransactionManager.Instance.EnsureInTransaction(doc)
for curve in curves:
if version > 2015:
if not(famtype.IsActive): famtype.Activate()
try:
# added line to set error report to none if there is no failure.
errorReport = None
newobj = doc.Create.NewFamilyInstance(curve.ToRevitType(),famtype,view)
elementlist.append(newobj.ToDSType(False))
except:
# revised except lines to import the traceback and set the error report acordingly.
import traceback
errorReport = traceback.format_exc()

TransactionManager.Instance.TransactionTaskDone()
# updated the output to include a list of the elements and the traceback
OUT = [elementlist,errorReport]

That edit allows access to the resulting element list, as well as the error report for anything which fails in the output results. Reviewing that error report, the reason behind the failureis pretty straight forward:

Traceback (most recent call last): File "<string>", line 30, in <module> Exception: The line is not in the plane of view. Parameter name: line

With that bit of knowledge, it’s pretty clear what you have to do: move the curve onto the same plane as the view. From here on out this is basic Dynamo, just a matter of finding the right nodes.

Fortunately we have a handy node also in the Clockwork package that we can leverage to find out what plane the linework needs to be on: the View.Plane node. There is also and an out of the box node called Curve.PullOntoPlane which will adjust the curve geometry and location as needed. Your actual use case may require a few tweaks to stuff like list lacing and levels.

From there things should just work with the old node, no edits required and you don’t even have to make a new custom node, or maintain the python in the .dyn.

I’ll make an issue on the Clockwork package’s GitHub repo tomorrow, which will included the code above so that if he thinks that it would be worthwhile then Andreas can update the package to include that error handling.

6 Likes

I’m a newbie, i think it very helpful for all.
Thanks :heart_eyes:

1 Like

Glad I could help. :slight_smile:

I have a little question: How can I find a node (View.Plan), I seach ViewPlan and PlanView, but it dont show. I went into ClockWork to get it out, but it took more time. Do you have any trick?

I’m try, it’s very well, but I have a question more, Why I active view “Source”, node “Active view” return result is “Result”


I has a lot of work to do

  • Place Detail Component middle rebar set
  • Change Instance parameter

Not sure - where are you seeing this node and what are you expecting it to do?

I can’t comform, but this is likely because you ran the graph before changing the view. Nodes only update their results if their inputs change. This keeps you from having to recalculate every node on the canvas as you build your graph. Try disconnecting and reconnecting the inputs to get it to update.

I think I need re-open file after each run to update Active view.

Disconnect the input from the current document input. Run the graph. Reconnect the document input. Run the graph.

Or, add a boolean switch in a code block to flip between the document and the document. If you need help with this option start a new topic as these are pretty far off the original request.

1 Like