Rotate generic family with dynamo


#1

Having placed generic model families along a spline in rvt using dynamo, can I rotate the family (or maybe the dynamo xyz) such that families remain perpendicular to the spline path?


#2

thanks zach.


#3

Unfortunately we don't yet have a rotate node for families (it is on our internal TODO list), but you can add a rotation instance parameter to your family that moves the geometry and use a Set Family Instance Parameter to manipulate it.



If it is a Generic Model Point Based you could also add a point to serve as a rotation pointer


#4

Russ,

Here’s an example of how to achieve what you are asking for with Dynamo:

http://autodeskvasari.com/forum/topics/rotate-generic-family-with-dynamo

-K


#5

Hey Gents

I am using the demonstration and getting the following error in the Python script.

Traceback (most recent call last):

File “<string>”, line 25, in <module>

TypeError: Line is not Iterable

All my Watches are showing as passing correct datatypes and so on, so I am not sure of the exact issue as I am not familiar with Python. Any thoughts would be welcome.

Rotate Error

 

 


#6

Adam,

It’s because your input was a single item and not a list. I fixed that in the node and published it to the Package Manager. Please download the latest version and your error will go away.

Thank you,

-K


#7

Thanks Konrad!!

Worked perfectly, I should have realized it was a list issue since it pops up as a list DataType and not being Iterable.

One of these days I should familiarize myself with Python!!


#8

Hello, I am new to dynamo so excuse this question, when you say “Please download the latest version and your error will go away.” do you mean Dynamo or a library? If a library, is it on GitHub? If Dynamo, I am using the latest version of Dynamo and see no reference to Rotate Family…


#9

Hello Chris Mckeown,

I think Konrad is talking about new version of Package Manager which he has published.

Thanks,

Riteesh


#10

I’ve just noticed these updates. Apologies…didn’t tick the notify by email box.

Great work!


#11

Hey Konrad, I can’t seem to get the Rotate Family node to work. I am feeding it an element ID, an axis (which I understand is a line, typically straight up and down in the Z-direction if I’m rotating in Plan view), and an angle, which I’m converting to radians. For some reason it doesn’t seem to want to work. I’m in a project environment in Revit 2015, running dynamo v 0.7.5.3566

 

I appeciate the help!Rotate Family


#12

Josh,

Is that Element.Id node from Clockwork package? I think its output is not an ElementId but a integer value representing an element id. These two are different. Please use Element Id node from Archi-lab package. It should work then.

Ps. I will fix the rotate node to make sure that it works with integers too. It’s my bad.

 


#13

No, it’s the built-in node that returns integers:

IdNotInteger

It’s actually two other things:

First, Konrad’s node expects a list of items (a list of axes, a list of element IDs and a list of angles), you are supplying single elements. Secondly, you’ll need to add two lines of code into the python script that is contained in the node (anywhere before line 25 should be fine):

clr.AddReference("RevitNodes")
import Revit

#14

Love it! You guys know my nodes better than me. :slight_smile: I will fix that stuff…one day. Thanks Andreas!


#15

Andreas, Josh,

I updated that Rotate Family node and re-posted to Package Manager. It should be working fine now.

Good luck!


#16

Hi All,

It’s interesting using this node, it points out a couple of reasons why we didn’t put in this functionality “out of the box” because of some of the somewhat hidden complexities of the seemingly simple operation. They are managable issues, and it’s awesome to have it, and a big thanks to Konrad for doing it. Just pointing out some logical gotchas

  • Family Rotation isn’t a parameter of the family, rather, it’s an adjustment that you make at the time of placement of the family. So if I rotate the family 45 degrees and then make an adjustment of my rotation parameter to 46 degrees, I end up with a rotation of 91 degrees relative to the original placement. This is pretty different than adjusting a rotation parameter of the family itself where a change from 45 to 46 degrees would result in a CHANGE of 1 degree.

  • The idea of an Axis is very different in Revit versus most other applications. Here, the node is asking for a Line instead of a vector, which seems sensible in terms of how the Revit interface asks for some things, but different than the general geometric environment of Dynamo. This could be handled in the node, of course, to take a centerpoint of rotation and a vector, then converting that into a line to feed the Revit API.

  • Degrees v radians. Revit API deals in radians, most people’s heads deal with degrees, and default behavior for Dynamo calculations are in degrees. Again, this can just be a choice by the node developer about including a conversion factor in the node itself

One other thing that I think is a bug; If I put in a rotation of 0.1, run, then change the rotation to 0.0, if I just start hitting Run over and over, the family will keep rotating by 0.1. It seems to hold on to the last non-zero angle.

 


#17

Zach,

These are all valid points. I am very aware of this and made sure that users are too by posting those exact same comments on my download page when the node was originally created in 0.6.3 version:

 

And also later when I updated it for the 0.7.1 version:

I personally built in a check for what my desired angle was vs what the current state of the family rotation is and only fed the difference into the Rotate node. I understand that this might be somewhat of a burden for newer users, but I am confident that they can figure it out. Maybe this node should come with a disclaimer that its for advanced users only. :slight_smile: Thanks for looking at it.

Capture


#18

Konrad, you are right. I went to your page here:

And copy and pasted the top sections where they matched. That fixed the problem. Really wierd. Only thing I could tell is that the color of the ‘ProtoGeometry’ changed to yellow. It didn’t appear to have any extra indents or spaces.

Thanks for the reply.


#19

Josh,

It has changed to yellow because that’s the indication that its a String. Any string has to be enclosed in either “something” or ‘something’ for Python to recognize it as a string. I am not sure why quotation marks for stripped from code that I posted.


#20

Is there any way to convert an integer into an element id?