Detail component from curve

Good morning, finally I’m able to draw cables inside cable trays, according to a specified route.
As you can see from the screenshot there are two different curves: the first one is a 3D polycurve and is the real cable that I’m using for calculation. The second one is the projection for 2D cable drawing.
So, I can draw easily a detail line with the Clockwork package but the detail component by curve is not working. I have a detail component by line with all the parameters and I can’t use it.

Hello Cesare!

Looks like you are showing a screenshot of something that is working. What are you doing when it’s not working?

Just to guess: Does your path consist of only straight lines? If not that may cause an error.

If you copy the python script out of the custom node and run your code, that might give you some usefull error messages.

1 Like

Morning Einar,
actually I have two different flows: one is ending with detail curve and this is working, the other one is ending with detail component by curve and this is not working. As you can see from the screenshot is giving to me a null list.
I would like to use a detail component line based because I have a family line based with all the information about cable as shared parameter and I can easily calculate also the total length from this.
With the line based component I can also control the family type and I can choose different kind of cable.

Not sure if this helps- was on a similar topic (related to conduits rather than cables) - but similar issue of calculating run lengths

Andrew

Morning! Yes, I’m sorry, I see it now.

Could you expand the geometry explode node to see if you’ve got only lines? Also double click the detailComponent.ByCurve node, copy the python block, paste it into your graph and reconnect the ports. That will give you som better error messages than null. Or maybe upload your files.

Here the extraction of code from the python node.
It gives me an error

Which Revit version your using?

2016 R2 and Dynamo 1.0.0

Put your mouse pointer over the yellow note symbol and take a screenshot of the message that appear:

What happens if you add a Flatten node to your curves before you plug it in to python?

The error is changed but is not correct. I’m retreiving the plane according to the selected view.
I think there’s something wrong in the node but I can’t understand what.

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

Boom! It works now :grin:

Try this DYF file Detail Family By Curve.dyf (7.2 KB)

Nothing changed, same error…what is the difference?

Mmm…
As you can see my screenshot. I have tested in Revit 2017. It is working from my side.

1 Like

Ok solved in another way :slight_smile:
Thank you for all your effort…I’ll finalize the definition and then I can share with the forum

1 Like

Hey @Cesare_Caoduro3 thanks for sharing! I am trying to get something similar to work and it seems we are getting the same results. I am getting unexpected “null” values when using DetailComponent.ByCurve, this process would be ideal as it allows for the specification of the view the detail component will be placed. When I try to use the FamilyInstance.ByCurve it doesnt give me an option to specify the view and seems to arbitrarily pick a view with that Level Associated. image

A single family type (rather than a list) seems to do the trick.

Levels should also resolve this.