Set different rotation per family instance


#1

Hello all,

This is my first post here and I’m still new to Dynamo so my knowledge is limited. In short what I would like to achieve is to set a different rotation value per inserted family instance.

What I have done so far:

  • I link a CAD file in Revit,
  • from the CAD geometry I filter the centerpoints on which I would like to insert my Revit family instance.
  • The points are sorted by X-coordinate value to chronologically insert the family instance in the project.
  • I load in an Excel file with a parameter value I want to add to the family instance and add this to the created family instance (The parameter values are chronologically added according to the ascending x-value)
  • I load in an Excel file with a rotation value per family instance. The rotation values are in the same order as the family instances are created (ascending x-coordinate value)

Then my problem, when I use FamilyInstance.SetRotation command, it asks for a double as rotation value. My thoughts where to rotate the family instances in the same way as I add the parameter values, with a list in the correct value order so each instance is rotated with the value index correlation to the create order. This seems to be impossible. Does somebody have a way to achieve my goal?

Thanks in advance!

Regards,

Peter


#2

@Peter.Schakel Please make visible the node outputs (lists) and warnings.
Providing the relevant files would be best


#3

This is the image, but I can’t upload the dynamo file, it says “sorry, new users can not upload attachments”


#4

Set readAsStrings to false on the Excel.ReadFromFile node and see what happens


#5

Two observations …

  1. You’re feeding strings to an input port that expects numbers
    On Excel.ReadFromFile read as string should be false (Alternately use String.ToNumber )
  2. The length of your elements list and rotation list don’t match
    While it still might work, ideally they should be of equal length

#6

Thank you, this solves my problem!


#7

Thanks for the observations, same as Yna_Db the correction to false fixed the problem. I also just noticed it is not the same length, thanks I’m going to fix this!