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?
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
Here’s an example of how to achieve what you are asking for with Dynamo:
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.
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.
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!!
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…
Hello Chris Mckeown,
I think Konrad is talking about new version of Package Manager which he has published.
I’ve just noticed these updates. Apologies….didn’t tick the notify by email box.
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
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.
No, it’s the built-in node that returns integers:
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
Love it! You guys know my nodes better than me. 🙂 I will fix that stuff…one day. Thanks Andreas!
I updated that Rotate Family node and re-posted to Package Manager. It should be working fine now.
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.
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. 🙂 Thanks for looking at it.
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.
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.
Is there any way to convert an integer into an element id?
<pre style=”color: #000000;”>def toRvtId(_id):
if isinstance(_id, int) or isinstance(_id, str):
id = ElementId(int(_id))
elif isinstance(_id, ElementId):
I have started learning Dynamo today. and I have couple of questions.
1. Why when I open the example files attached to download file in a standalone version it works well, however when I open the same file in Dynamo extended into Revit, all the nodes have the null output?
2. I f I am going to model a freeform surface ( Facade) in Dynamo standalone, How all pieces will be convertable in to the Revit? ( I meant for designing a non-standard form out of definitions of roof, ceiling, wall, and so on) how the model can interact with revit?
your response is so appreciated.
1. I have no idea. I never work with the stand alone version. Please direct this question as well as example files/images etc. to the Dynamo Development team. They will be much better suited to answer this question.
2. Well, there are some custom tools available to generate Walls or Adaptive Components. It’s not going to be easy, or straight forward, but its not impossible. Give it a try and post questions as you go and I am sure that community here will be more than happy to assist you.
I am trying to use Konrad’s method but having some difficulties.
1- Does this method work with non planner curves, when I try to retrieve the curve tangent at intervals i get the first vector correct but the rest of the readings with the same value which I believe is wrong and impossible.
2- It seems I am missing something cause I cant find the “Transform Basis X & Y” nodes, also I don’t understand the relation between alpha and beta angles.
Sorry if my questions seems silly but I’m a newbie. Thanks in advance.
Sorry to disappoint you my friend but this post was originally made on <span style=”color: #7f8c8d;”>April 7, 2014, <span style=”color: rgb(0, 0, 0);”>and Dynamo has simply moved on since then. This entire definition is outdated, most of the nodes used are no longer part of the package or were never brought along for the ride. This is just part of the inconvenient truth that Dynamo has completely restructured since version 6.3 and there are quite few things that simply won’t work in newer versions. </span></span>
Good day Konrad,
I am using your method. And I have a question. Could you help me with it?
I want to add attribute Rotate (around Z axis) in family… Is it possible to add property “rotation” into family and if I will change numbers of degrees it will be rotated without Dynamo.
This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.