Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

How to Focus Revit View on an Element Using an External Script?

j.lek
Explorer

How to Focus Revit View on an Element Using an External Script?

j.lek
Explorer
Explorer

Hello everyone,

I'm currently working on a project where I need to automate the selection and display of elements in Revit based on their Element ID. Specifically, I'm developing a script to check openings (sparingen) in Revit, and I want the script to iterate through them one by one.

I'm wondering if there's a way to achieve this through an external script, such as Python or Dynamo. In particular, I'd like the script to focus the Revit view on each opening (sparingen) as it iterates through them.

I'm looking to replicate the same functionality as the built-in "Select by ID" and "Show" functions in Revit, but within an external script.

I've explored various methods for automating element selection and display in Revit, but I'm facing challenges with the specific task of focusing the view on each element.

Could someone please advise if there's a way to accomplish this task either through Dynamo, Python, or any other method? I'm specifically looking for assistance with the part of the script that focuses the Revit view on the current element being processed.

Any insights or suggestions would be greatly appreciated.

Thank you in advance for your help!

Best regards,
Joury

 
0 Likes
Reply
232 Views
1 Reply
Reply (1)

jeremy_tammik
Autodesk
Autodesk

You can achieve the desired result using the ShowElements method:

  

    

More details by The Building Coder:

  

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes