DetailComponent.ByCurve works only on a single View?

I have this scripts which places Line Based Detail Families over
Walls from a Linked model. It works fine a for single view,
but not when i try to make it work for multiple views.
I tried most (all?) level and lacing combinations, but no luck.
Or did i get my levels and lacing wrong?
Or can the node only deal with one View?

Single View

Multiple Views

DetailComponent.ByCurve

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:
		newobj = doc.Create.NewFamilyInstance(curve.ToRevitType(),famtype,view)
		elementlist.append(newobj.ToDSType(False))
	except:
		elementlist.append(None)
TransactionManager.Instance.TransactionTaskDone()
OUT = elementlist

EDIT
For DetailCurve.ByCurve it works, just not for DetailComponents.

I’m assuming the curve and familyType iniputs both have 3 sublists to match the 3 views? Try using view @L1 to ensure that each view is paired with each sublist from the other inputs.

If that doesn’t work, you can always duplicate each view for each other input. One-to-one inputs will always work.

You assumed right @Nick_Boyts. I already tried Views @1 with no luck.

Or not?

Your original screenshot shows 210 items but you seem to have 155 views. Which is correct? Also, if you have one-to-one inputs you don’t need list levels.

At that point had 3 Floor Plans selected (and therefore more items).

Still…

Isn’t that what you’re trying to accomplish? Multiple instances to multiple views? It’s hard to tell what the issue is if you’re not being consistent and we can’t see all your inputs. Are the inputs in the last image still all a list of 3 sublists?

The amount of Floor Plans can be different as well the amount of Walls per Floor Plan.
I can do it View By View (the Green part),
but i want to do multiple Views at once (the Pink part).

Right, but for now we need to keep things consistent while we troubleshoot. Pick a working example and then find a solution. The number of views or walls is irrelevant. If it works for a list it works for a list - the length of the list doesn’t matter.

To keep things simple, can you filter some instances down so the inputs lists are only a few items long? Let’s shoot for 2 curves/types for each of 3 views. Then we’ll be able to see all our data at once and understand the structure without having to guess.

I will do that as soon as i get home.

The number of views is irrelevant.

Well, not really i guess , because it only works when feeding ONE View :stuck_out_tongue_winking_eye:.
In that case i only have the Walls from the Linked Model for that (associated) Level,
thus no sublists for each input for the DetailComponent.ByCurve node.

Length is irrelevant. Structure is not. That’s the important thing to keep in mind. We need to get your list structure working.

I think it is not the structure, but (a restriction of) the node. My guess it only works with single Lists
and not when using Sublists.

But hang in there, you will get a smaller sample size (where you can see the structure) :wink:.

1 Like

@Nick_Boyts here you go :point_down:

Working

Not working

Seems you have lacing set too. Switch lacing back to Auto. If that still doesn’t work, duplicate the views so you have one-to-one inputs and no list levels.

I already tried that before, see earlier post and this :point_down:.

Only the creator of the node (it is from Clockwork)
might have a final answer?

Maybe i have to accept we have to do it View by View or
maybe someone has an alternative / workaround?

ChatGPT didn’t have a solution :stuck_out_tongue_winking_eye:.
I hoped a change in the embedded Python could ‘fix’ things :upside_down_face:.

@BimAmbit you like challenges no? Any ideas? :stuck_out_tongue_winking_eye:

The only “limitations” of the node are the intended structures of the inputs. If you hover over the inputs you can see the specified structure expected for each one:

  • curve: Curve
  • familyType: var[]..[]
  • view: var[]..[]

This is a little different then what I would have expected. The node wants one curve but any list of types and views. This means we do have to force list levels to accept each other input with the curve.


Or if you’re using the same familyType for each curve you can simplify.

Correct me if i am wrong, but your use create the Detail Component in the same View(?).
If so did you try it feeding different Views?
I need it to work on (multiple) Floor Plan Views specifically.

No, i have different Families depending on the Wall Type.

It works with multiple views. Give it a shot.

I’ll go have a look tomorrow. I’ll keep you posted.

@Nick_Boyts @bvs1982 Nick’s approach looks pretty promising. Lacing and List Levels, really is a rabbit hole.

@Nick_Boyts
Kinda what i thought (i believe i already tried this before), it doesn’t work
for multiple different Views.
Index 0 to 71 is Floor Plan 1 and Index 72 to 154 is Floor Plan 2.
It works for you because you use the same View(?).