Toposurface. API

Toposurface. API

dimazimnickij
Explorer Explorer
353 Views
3 Replies
Message 1 of 4

Toposurface. API

dimazimnickij
Explorer
Explorer

I need to select all toposurfaces directly from the project database. How to do it?

0 Likes
354 Views
3 Replies
Replies (3)
Message 2 of 4

jeremy_tammik
Alumni
Alumni

The one and only method to programmatically select elements from the Revit database is the filtered element collector. You add filters to that selecting the elements you want. The filters can check for category, class (.NET), specific properties and other things. Selecting toposurfaces is trivial: filter for the TopographySurface class:

 

https://www.revitapidocs.com/2022/64242f41-69e1-84be-f21b-84783e81364a.htm

 

This and all other questions you might run into at this level are covered in full by the Revit API getting started material, so I suggest you work through that before doing anything else:

  

https://thebuildingcoder.typepad.com/blog/about-the-author.html#2

  

Numerous sample code snippets of filtering are collected in The Building Coder samples CmdCollectorPerformance.cs module:

  

https://github.com/jeremytammik/the_building_coder_samples/blob/master/BuildingCoder/CmdCollectorPer...

    

Articles on filtering are listed in the corresponding topic group on The Building Coder:

  

https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.9

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 4

dimazimnickij
Explorer
Explorer

Thanks! I will try it

0 Likes
Message 4 of 4

dimazimnickij
Explorer
Explorer
You are right, I am a beginner. My task is to automate the drawing of a trench in a toposurface.
0 Likes