I’m trying to modify a python script which will batch load and place a family into a series of families.
What is the python method to “place family by point?”
Here is what I have so far: (line 46 is where I need help)
import clr
clr.AddReference('RevitAPI')
clr.AddReference('RevitServices')
from Autodesk.Revit.DB import Document, FamilySource, IFamilyLoadOptions
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
# The inputs to this node will be stored as a list in the IN variables.
paths = IN[0]
docpaths = IN[1]
# wrap input inside a list (if not a list)
if not isinstance(paths, list):
paths = [paths]
if not isinstance(docpaths, list):
docpaths = [docpaths]
# ensure loaded families can overwrite existing familiies
class FamilyOption(IFamilyLoadOptions):
def OnFamilyFound(self, familylnUse, overwriteParameterValues):
overwriteParameterValues = True
def OnSharedFamilyFound(self, sharedFamily, familyInUse, source,
overwriteParameterValues):
source = FamilySource.Family
overwriteParameterValues = True
return True
# core processing
documents = []
families = []
for docpath in docpaths:
doc=app.OpenDocumentFile(docpath)
documents.append(doc)
for path in paths:
family_doc = app.OpenDocumentFile(path)
families.append(family_doc)
for document in documents:
map(lambda family: family.LoadFamily(document, FamilyOption()), families)
# HELP HERE - I have no idea what this line should be
map(lambda family: family.PlaceFamily())
map(lambda family: family.Close(False), families)
map(lambda document: document.Close(True), documents)
# Assign your output to the OUT variable.
OUT = [paths, docpaths]
I’m sure this is a simple answer for those who already know but I searched the revit api docs and didn’t see any obvious way to do what I want. Is it somewhere in the FamilyInstanceCreationData Constructor?