Thank you for your reply. I am very new to python and gave it my best shot but cannot figure it out. I tried adding UnwrapElement(IN).ToRevitType() to my code but I get the err "Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 28, in
AttributeError: ‘List[object]’ object has no attribute ‘ToRevitType’"
From my research I get this err because I am trying to run .ToRevitType() on a list rather than the items in the list.
I liked your code better though and think I almost got it to work with a list but not quite there. I get this err when I run your code (with my changes) on a list of marks.
“Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 38, in
TypeError: expected Line, got list”
After hours and hours of trying to figure this out I finally got it to work. The code I provided above and the archi-lab Rotate Family nodes both work. The problem was not with the code but that you cannot rotate an elevation marker without a view on it. Yep thats it just make sure you have at least one view active on the marker and it will rotate just fine.
Would you be able to post a screen shot of what your graph looks like and the problem that you are having. My graph has a bunch of other stuff in it and this could be a great learning opportunity for you and others looking at this post.
The Python script and the archi-lab node work differently so please also specify what one you are using.
It seems to work right when rotating 90 degrees but not when rotating a random angle. The same happened with the previous graph.
I can’t find a pattern or a reason. It’s really strange. The axis seems to be just a perpendicular line to the floor plane in all cases so that shouldn’t be the issue, it may just affect the location of the marker but not the angle.
The last code you provided moves the marker far away from the original point (maybe the line-axis coordinates need to be converted from Dynamo format to API format?).
I’VE THINK I’VE FOUND SOMETHING: for whatever reason the angle needs to be angle/2, sometimes…
Well, It seems that dynamo needs to calculate the angle first and then connect the node to rotate the marker. Also we need to be careful with the direction of the rotation, not only the angle when using the output from Vector.AngleWithVector node.
Also it seems we need to close and open dynamo to work (may keep wrong values in memory from previous runs) and rotate in the right direction, not just the angle from the Vector.AngleWithVector node.
+angle will rotate anti clockwise
-angle will do clockwise
The angle will depend on the wall’s external face side as well, which is not very intuitive.
Yes, I tried that graph and happens what I commented. Same seems to happen with the graph I posted before except the marker remains in almost the same position when rotated.
If it makes a difference that marker I’m rotating is off axis from vert / horiz and the true north.
Anyway it seems that the trick is finding out the direction of rotation before rotating (which varies depending on which wall is selected, probably depending on the wall’s relative position from the marker).
Thanks for your help.
By the way, to get an Autodesk.Revit.DB element from a Dynamo one we use UnwrapElement.
However, how can be converted an Autodesk.Revit.DB to a Dynamo element?
This is the final version of my graph based on @Steven and @awilliams code above (thanks both). I won’t try to figure out the direction of rotation so I added an option to select it ( usually the smaller rotation is the right direction).
Inputs are the Elevation Mark to rotate, the wall to look at and the elevation that will look at that wall (and the direction of rotation clockwise or not).