How to move Revit Group using Dynamo? Python or OOTB

python
dynamo
#1

Hi I am trying to move a Revit group using dynamo.

I took out the location of the group (Revit element), then construct a vector, then move this Revit element inside a python script. However, I have a problem in converting Dynamo vector to Revit vector which is Revit XYZ. I attach the photo of the script here.
Error:
IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 25, in
AttributeError: ‘List[object]’ object has no attribute ‘ToXyz’

Thanks, Minh Chau

0 Likes

#2

the overall code

0 Likes

#3

The error is very clear, you are attempting to call the ToXyz() method on a list rather than a singleton. Remember Python doesn’t replicate like DesignScript, so you will need to use a for loop to iterate your input list and access each member.

0 Likes

#4

oh yeah. I thought python script takes in an array and straight away can apply the conversion. Thanks a lot!

0 Likes

#5

As much as I admire your attempt to do this with Python, I don’t see why not just use the default OOTB nodes.

Point.Deconstruct is from Wombat package but can be replaced with OOTB nodes as well. Point.X, Point.Y…

Cheers!

Ps. Next time, please post code as code formatted text instead of an image. If the answer wasn’t this obvious, someone would want to re-create the error and re-typing your code from the image is a waste of time. Please read here before posting: How to get help on the Dynamo forums

1 Like