Great work @Mark.Ackerley. A possible improvement would be to put it all in a while loop so you can keep picking walls instead of having to rerun the program each time. Then, when you press esc or cancel out of the PickObject method, it returns a OperationCanceledException and you can use that as a way to exit the while loop.
So I tried this, only had to do 3 things:
from Autodesk.Revit.Exceptions import OperationCanceledException under the
from ...DB import *
2. Put everything below
multiDim = IN under its own main() function.
3. Then at the bottom, I wrote:
And now the graph lets you keep picking until you press Esc and it finishes. Once again, great work. I had some issues with my company’s standard template (ref array returned empty list) so I will try to investigate it on my own and let you know.
After more testing, this brings up another issue but should be easily solved. All of the dimension creations done in the while loop are considered a single ‘action’ in Revit, so one undo removes all. I think if you set up the transaction using the Transaction class under Revit.DB, you can make each one their own transaction. So let’s say you are 10 walls deep into the dimensioning and you dimension the wrong wall, you can press undo a single time to get rid of just the one.