I’m trying to develop an interface using python and windows forms to enable the user to navigate between objects in a file.
Basically, I’ve managed to do everything except the main point itself: zooming the object.
I’ve found out a way of doing so using Document.SendCommand and then using the zoom command with the coordinates of the object. But there’s a problem: the command only appears to be sent when the application is closed and dynamo stops running.
I believe it isn’t a common problem among the community since dynamo isn’t really supposed to be used in such way, but not being able to update the view during the run is becoming an unavoidable problem for me and I’d be glad if anyone could help with ideas! Thanks a lot!
The Arkance Systems Node Library contains nodes to zoom to objects or to a view. I’ve used it to create multiple screenshots in a loop, so it works while running.
Maybe you can loop a transaction in Python to force finishing the code inside the transaction. Don’t know if that really works, but you can try.
My initial idea was to use the arkance systems node this way you mentioned, but I don’t know how to access this library’s nodes via python.
I’ve tried it a few times, added the reference to it but didn’t find the right way to import it directly and/or access its nodes - and didn’t find any example online. Is there any trick or something i’m missing?
If you have any idea about how to access it via python it’d be so helpful!!
Thanks for your answer!!
This post is very complete and I’ll surely give a try to some of the approaches! If any of them do work, I’ll come back to share it!
It worked in the first attempt (must be a miracle hahaha)!!
And, in fact, there’s no need to call a transaction as we are using the editor. Here comes the code of the method I used and a video of it in practice: