I can query the XYZ values from an element easily with Dynamo but is it also possible to query the rotation of a placed family?
what I mean by that is if I rotate a family in Revit can i query in Dynamo how much it was rotated (from its original position, not the previous position)?
Any help would be appreciated.
There is no parameter in Revit that records the rotations that you make. However Revit records all your actions and puts them in a Journal file. Those are stored in
“C:\Users#your user name#\AppData\Local\Autodesk\Revit\Autodesk Revit #your version#\Journals”
So if you’re really desperate to trace all the rotations on a family, you can delve in the appropriate journal file and re-trace the rotations. But be warned - all your inputs are recorded raw and the end result is almost pure gibberish. I am not sure but I think there are some plug-ins for Revit that can read the journal file and make some sense out of it.
Python node used to have a dictionary you could dump data into for repeated runs, but I think that is gone now, you could use Dynamo and excel to record the position, if the position changes you record a new entry in the excel table, if it is the same you do not.
Another possibility is to store the data in a family instance parameter.
Thanks for the replies,
the Journal file was a dead end unfortunately.
After some looking around in the revit database I think I found a methode to get the data needed.
I published the node named “Elements.position_rotation_mirrored”.
it get the x,y,z value and the rotation in degrees, it also indicates if the element is mirrored.
Martin, I need the exact same information that you said you published. Where did you publish it at and would it be possible to post it here for me? I am brand new to all of this and I think this may be the missing link (node) I have been looking for.
James, The package can be found in dynamo trough the menu “packages”->“search for a package”.
i also added a link to the file Elements.position-rotation-mirrored
Martin, thank you for that. I was able to download it at the house then sneak it past our firewall that way.
I am still having trouble though. Now that I have the rotation information I have not figured out a way to convey that information the new family that I am inserting. Especially when I am trying to replace more than one family at a time.
James, I haven’t had time to figure out how to rotate elements with python yet but its on my shortlist. Once i have it ill post it here.
did you try Rotate Family from Archi-lab package? Look under the hood of that node to get the Python code.
Thank you for the reply. i really don’t know any coding so i will wait on better minds to figure that one out.
I have started a new thread at the above location so any insights on my errors on this would be appreciated.
I Finally found the time to learn a bit more about c# and Revit and managed to make the node I needed (tried a few but they where obsolete).
It is named Elements.Rotate, and can also be found trough “search for a package” in Dynamo
Is it correct that the node doesn’t work anymore?
I need to find the rotation of a family.
Arno, I just changed the class name of ‘Elements’ to ‘ElementList’, hooked up the nodes as per the attached image and now it works fine!