# Detail component from curve

**URL:** <https://forum.dynamobim.com/t/detail-component-from-curve/4585>\
**Category:** Revit\
**Tags:** cabletrays\
**Created:** [June 18, 2016, 12:52pm UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585 "2016-06-18T12:52:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cesare\_Caoduro3](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cesare_caoduro3/32/9974_2.png) [@Cesare\_Caoduro3](https://forum.dynamobim.com/u/Cesare_Caoduro3)\
**Post date:** [June 18, 2016, 12:52pm UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/1 "2016-06-18T12:52:55Z")

</div>

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.

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/2/2ea6ffe05b47f576011a34d7852c8052247fe4ed.png)

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [June 18, 2016, 7:13pm UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/2 "2016-06-18T19:13:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Cesare\_Caoduro3](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cesare_caoduro3/32/9974_2.png) [@Cesare\_Caoduro3](https://forum.dynamobim.com/u/Cesare_Caoduro3)\
**Post date:** [June 19, 2016, 5:15am UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/3 "2016-06-19T05:15:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Andrew\_Hannell](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/andrew_hannell/32/103315_2.png) [@Andrew\_Hannell](https://forum.dynamobim.com/u/Andrew_Hannell)\
**Post date:** [June 19, 2016, 5:23am UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/4 "2016-06-19T05:23:52Z")

</div>

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

> [@Conduit Run Lengths](https://forum.dynamobim.com/t/conduit-run-lengths/3913):
>
> I am a self admitted total newb to Dyanmo but I am hoping you nice folks can help me out with something I want to create. I am looking to be able to select a conduit run and have dynamo extract the overall length of the conduit run and populate a shared or project parameter with the value it extracts so that I can build a tag that will allow me to give the guys in the field run lengths without having to generate a bunch of schedules for small stuff like smurf tube in the deck. Any help or ideas …

Andrew

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [June 19, 2016, 5:39am UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/5 "2016-06-19T05:39:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Cesare\_Caoduro3](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cesare_caoduro3/32/9974_2.png) [@Cesare\_Caoduro3](https://forum.dynamobim.com/u/Cesare_Caoduro3)\
**Post date:** [June 19, 2016, 6:47am UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/6 "2016-06-19T06:47:02Z")

</div>

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

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/c/ce662ab5e11ae0cd368b7f7ea4b3c9e5e20c5315.JPG)

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [June 19, 2016, 6:52am UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/7 "2016-06-19T06:52:40Z")

</div>

Which Revit version your using?

---

<div class="post-metadata">

**Author:** ![Cesare\_Caoduro3](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cesare_caoduro3/32/9974_2.png) [@Cesare\_Caoduro3](https://forum.dynamobim.com/u/Cesare_Caoduro3)\
**Post date:** [June 19, 2016, 7:02am UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/8 "2016-06-19T07:02:54Z")

</div>

2016 R2 and Dynamo 1.0.0

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [June 19, 2016, 7:19am UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/9 "2016-06-19T07:19:22Z")

</div>

Put your mouse pointer over the yellow note symbol and take a screenshot of the message that appear:  
 ![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/1/1a05f048e7ca4d67eecd730e610ecb883041ce2e.png)

---

<div class="post-metadata">

**Author:** ![Cesare\_Caoduro3](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cesare_caoduro3/32/9974_2.png) [@Cesare\_Caoduro3](https://forum.dynamobim.com/u/Cesare_Caoduro3)\
**Post date:** [June 19, 2016, 7:32am UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/10 "2016-06-19T07:32:31Z")

</div>

![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/2/24e21552662b97a984509a368b9c7e8fb1cd9e96.png)

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [June 19, 2016, 7:38am UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/11 "2016-06-19T07:38:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Cesare\_Caoduro3](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cesare_caoduro3/32/9974_2.png) [@Cesare\_Caoduro3](https://forum.dynamobim.com/u/Cesare_Caoduro3)\
**Post date:** [June 19, 2016, 7:58am UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/12 "2016-06-19T07:58:04Z")

</div>

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.

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/1/15774210a682219b5126125712ad9b6282bb59c0.png)

```
> 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
```

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [June 19, 2016, 8:42am UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/13 "2016-06-19T08:42:48Z")

</div>

Boom! It works now 😁

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/2/24cf7dbe870beba2e691128daf1ddaf0b5160c81.png)

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [June 19, 2016, 8:45am UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/14 "2016-06-19T08:45:24Z")

</div>

Try this DYF file [Detail Family By Curve.dyf](https://forum.dynamobim.com/uploads/short-url/u11ILkQBu0y1z2rpuTwHyOTDsHx.dyf) (7.2 KB)

---

<div class="post-metadata">

**Author:** ![Cesare\_Caoduro3](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cesare_caoduro3/32/9974_2.png) [@Cesare\_Caoduro3](https://forum.dynamobim.com/u/Cesare_Caoduro3)\
**Post date:** [June 19, 2016, 8:56am UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/15 "2016-06-19T08:56:28Z")

</div>

Nothing changed, same error…what is the difference?

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [June 19, 2016, 8:58am UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/16 "2016-06-19T08:58:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Cesare\_Caoduro3](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cesare_caoduro3/32/9974_2.png) [@Cesare\_Caoduro3](https://forum.dynamobim.com/u/Cesare_Caoduro3)\
**Post date:** [June 19, 2016, 10:37am UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/17 "2016-06-19T10:37:19Z")

</div>

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

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/0/0c41fc01affec032309bf1edadd554526ec1f832.JPG)

---

<div class="post-metadata">

**Author:** ![dana.defilippi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dana.defilippi/32/117119_2.png) [@dana.defilippi](https://forum.dynamobim.com/u/dana.defilippi)\
**Post date:** [April 18, 2018, 2:21pm UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/18 "2018-04-18T14:21:47Z")

</div>

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](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/4/442ac63a3d39d1d9ad1722b44c54cbdca09805a8.png)

---

<div class="post-metadata">

**Author:** ![dana.defilippi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dana.defilippi/32/117119_2.png) [@dana.defilippi](https://forum.dynamobim.com/u/dana.defilippi)\
**Post date:** [April 18, 2018, 3:38pm UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/19 "2018-04-18T15:38:41Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/4/046b7870775c8b5acc1ff771225f6b666eab4c67.png)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [April 18, 2018, 3:41pm UTC](https://forum.dynamobim.com/t/detail-component-from-curve/4585/20 "2018-04-18T15:41:45Z")

</div>

Levels should also resolve this.

[Next page](https://forum.dynamobim.com/t/detail-component-from-curve/4585.md?page=2)
