Using the FamilyInstance.ByPoint node in a Python Script node


#1

Hi, I have some issues using the FamilyInstance.ByPoint node in a Python Script.

I have the following error message:

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “<string>”, line 24, in <module>
AttributeError: ‘type’ object has no attribute ‘ByPoint’

Any ideas?

This is my Python script:

<hr />

 

import clr

clr.AddReference(‘ProtoGeometry’)

from Autodesk.DesignScript.Geometry import *
#The inputs to this node will be stored as a list in the IN variable.
dataEnteringNode = IN

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

============================================================== Imports ================================================

clr.AddReference(‘DSCoreNodes’)
import DSCore
from DSCore import *

clr.AddReference(‘RevitAPI’)
import Autodesk
from Autodesk.Revit.DB import *

========================================================== INPUTS ===================================================

Point = IN[0]
familySymbol = IN[1]
view = IN[2]

F = []

for i in range(0, len(Point)):
F.append(FamilyInstance.ByPoint(familySymbol, Point[i]))
path = ‘C:\Users\Erecting Process’ + str(i) + '.png’
view.ExportAsImage(path)

OUT = F

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

<hr />

 

Thanks!


#2

Hello Justin,

Are you trying to use Dynamo’s built in node? If so something like this should suffice:

2015-07-26_13-13-30


#3

Thank you Dimitar, it works fine!

Amazing to see how efficient this community is!

 

But I have another issue. Actually I’m trying to add my FamilyInstances one by one while exporting an image at each step. Unfortunately, the same image is saved for all the iterations.

I’m thinking about using the Transaction.End node but I’m not sure if I’m doing it right…

Any idea?

Thank you for your help!

Capture