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) > famtype = UnwrapElement(IN) > view = UnwrapElement(IN) > version = IN > 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
Try this DYF file Detail Family By Curve.dyf (7.2 KB)
Nothing changed, same error…what is the difference?
As you can see my screenshot. I have tested in Revit 2017. It is working from my side.
Ok solved in another way
Thank you for all your effort…I’ll finalize the definition and then I can share with the forum
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.
Levels should also resolve this.
@JacobSmall please explain. Levels, from my understanding, would not give me the option to specify which view the detail component would be placed in.
I think @JacobSmall means @List Levels read this http://dynamobim.org/introducing-listlevel-working-with-lists-made-easier/ . Have you tried right clicking node and change lacing to longest?
Thanks!! I dont know why i didnt think of that… it worked.
As @Kulkul clarified, list levels and lacing will resolve this as well:
You can also use List.OfRepeatedItems or List.Cycleto build matching lists as needed.