Place detail item family by curve in drafting view


#1

Hi

All the nodes I can find to place a family by line require to input a level.

Is there a way to place a detail item family by line in a drafting view (no level)?

Thnaks!


#2

In the API Docs:
This overload applies only to 2D family line based detail symbols. The type/symbol that is used must be loaded into the document before this method is called. Families and their symbols can be loaded using the Document.LoadFamily or Document.LoadFamilySymbol methods.

http://www.revitapidocs.com/2018.1/899076fd-73d2-5be0-8872-b8f389d4ba49.htm

document.Create.NewFamilyInstance(line,famtype,view)

I’ve modified the code in FamilyInstance.ByPointInView node to make it line based but got the error “TypeError: expected XYZ, got Line” in this line:
newobj = doc.Create.NewFamilyInstance(line,famtype,view)

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
lines = UnwrapElement(IN[0])
famtype = UnwrapElement(IN[1])
view = UnwrapElement(IN[2])
elementlist = list()
counter = 0

TransactionManager.Instance.EnsureInTransaction(doc)
# make sure familysymbol is active
if famtype.IsActive == False:
	famtype.Activate()
	doc.Regenerate()

for line in lines:
	newobj = doc.Create.NewFamilyInstance(line,famtype,view)
	elementlist.append(newobj.ToDSType(False))
TransactionManager.Instance.TransactionTaskDone()
OUT = elementlist

Please anybody can help?


#3

Clockwork has a DetailComponent.ByCurve node.


#4

Thanks man, worked like a charm and helped me to fix the Python code, just needed to convert Dynamo lines to Revit lines :slight_smile: :

newobj = doc.Create.NewFamilyInstance(line .ToRevitType() ,famtype,view)