Skip to content

Latest commit

History

46 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

RevitAPISnippets

Revit API snippets for Visual Studio.

Visual Studio 2019ReleaseStarsForksIssuesIssuesContributorsLicense MIT

Installation

  1. Download or clone this repo;
  2. On Visual Studio, go to Tools > Code Snippets Manager... or press Ctrl + K and Ctrl + B;
  3. Click on Add button.
  4. Navigate to the folder where you saved this repo;
  5. Open the repo Folder > Snippets and Select the RevitAPI folder according to your Revit version (E.g.: RevitAPI2020);
  6. Click on OK.

How to use

  1. After installation, type the command (as in the Snippets List) command and press tab 2x;

Revit API Snippets - Example of snippet

  1. Use tab to navigate through fields and edit them as you wish;

Revit API Snippets - Example of snippet

  1. Press enter to complete the command.

Youtube logo Watch this video to see a more detailed use of Revit API snippets.



Snippets

List of snippets ready to use:

CommandDescription
rvtiexcomCreates a sample of a IExternal Command implemented with the main codes.
rvtallinstcatCollects all instances in the project by the builtin category.
rvtalltypescatCollects all element types in the project by the builtin category.
rvtgetparamdoubGets a parameter value as a double.
rvtgetparamelmidGets a parameter value as an ElementId.
rvtgetparamintGets a parameter value as an integer.
rvtgetparamstrGet Parameter Value As String.
rvtgetparamvalstrGet Parameter Value As Value String.
rvtsetparamSet Parameter Value.
rvtsetparamstrSet Parameter Value String.
rvtselfiltCreates a sample of a Selection Filter code implementing ISelectionFilter interface.
rvtgetselGets the elements in the model.
rvtpickelmsCreates a selection of elements in the model.
rvttransCreates a sample of a Transaction code.

Contributors

If you have any snippets that you think might be interesting to share, follow the steps below to contribute to this project:

Instructions

  1. Fork this repo;
  2. Use the template inside Snippets > Templates > Csharp.snippet;
  3. Use the prefixrvt to name your shortcut (E.g.: rvt + getsel (abbreviation to Get Selection) = rvtgetsel);
  4. Be sure that your shortcut doesn't exist in the Snippets List;
  5. Write your snippets in individual files grouped inside folders of their respective subject (E.g.: rvtselfilt is inside Selection folder);
  6. Commit and Push your changes to your forked repo;
  7. Send a Pull Request to Develop branch.

More Information

For more information, feel free to contact me via email mayconrfreitas@gmail.com or LinkedIn.


License

This project is licensed under the MIT Licence.


Do you like this solution? Please star this project on GitHub!

About

Revit API snippets for Visual Studio.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages