{"id":20597996,"url":"https://github.com/mayconrfreitas/revitapisnippets","last_synced_at":"2025-04-15T00:17:11.717Z","repository":{"id":40262134,"uuid":"491659168","full_name":"mayconrfreitas/RevitAPISnippets","owner":"mayconrfreitas","description":"Revit API snippets for Visual Studio.","archived":false,"fork":false,"pushed_at":"2025-03-04T22:08:03.000Z","size":1668,"stargazers_count":24,"open_issues_count":1,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-15T00:16:49.714Z","etag":null,"topics":["api","autodesk","csharp","revit","revit-api","revitapi","snippets","visual-studio"],"latest_commit_sha":null,"homepage":"","language":"Vim Snippet","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mayconrfreitas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-12T20:30:49.000Z","updated_at":"2025-03-04T22:08:07.000Z","dependencies_parsed_at":"2022-09-09T02:04:39.405Z","dependency_job_id":null,"html_url":"https://github.com/mayconrfreitas/RevitAPISnippets","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayconrfreitas%2FRevitAPISnippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayconrfreitas%2FRevitAPISnippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayconrfreitas%2FRevitAPISnippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayconrfreitas%2FRevitAPISnippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mayconrfreitas","download_url":"https://codeload.github.com/mayconrfreitas/RevitAPISnippets/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248981270,"owners_count":21193147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","autodesk","csharp","revit","revit-api","revitapi","snippets","visual-studio"],"created_at":"2024-11-16T08:24:42.973Z","updated_at":"2025-04-15T00:17:11.691Z","avatar_url":"https://github.com/mayconrfreitas.png","language":"Vim Snippet","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RevitAPISnippets\n\nRevit API snippets for Visual Studio and JetBrains Rider.\n\n[![Visual Studio 2019](https://img.shields.io/badge/Visual%20Studio%202019-16.11.7+-blue)](#)\n[![JetBrains Rider 2022](https://img.shields.io/badge/JetBrains%20Rider%20-2022-blue)](#)\n[![Release](https://img.shields.io/github/v/release/mayconrfreitas/RevitAPISnippets)](https://github.com/mayconrfreitas/RevitAPISnippets/releases)\n[![Stars](https://img.shields.io/github/stars/mayconrfreitas/RevitAPISnippets)](https://github.com/mayconrfreitas/RevitAPISnippets/stargazers)\n[![Forks](https://img.shields.io/github/forks/mayconrfreitas/RevitAPISnippets)](https://github.com/mayconrfreitas/RevitAPISnippets/network/members)\n[![Issues](https://img.shields.io/github/issues-raw/mayconrfreitas/RevitAPISnippets)](https://github.com/mayconrfreitas/RevitAPISnippets/issues)\n[![Issues](https://img.shields.io/github/issues-closed-raw/mayconrfreitas/RevitAPISnippets)](https://github.com/mayconrfreitas/RevitAPISnippets/issues?q=is%3Aissue+is%3Aclosed)\n[![Contributors](https://img.shields.io/github/contributors/mayconrfreitas/RevitAPISnippets)](https://github.com/mayconrfreitas/RevitAPISnippets/graphs/contributors)\n[![License MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\n\n## Installation For Visual Studio\n\n1. [Download](https://github.com/mayconrfreitas/RevitAPISnippets/archive/refs/heads/main.zip) or [clone](git-client://clone?repo=https%3A%2F%2Fgithub.com%2Fmayconrfreitas%2FRevitAPISnippets) this repo;\n2. On Visual Studio, go to `Tools \u003e Code Snippets Manager...` or press \u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003eK\u003c/kbd\u003e and \u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003eB\u003c/kbd\u003e;\n3. Click on `Add` button.\n4. Navigate to the folder where you saved this repo;\n5. Open the repo [`Folder \u003e Snippets`](./Snippets/) and Select the RevitAPI folder according to your Revit version (E.g.: [`RevitAPI2020`](./Snippets/RevitAPI2020/));\n6. Click on `OK`.\n\n## Installation For JetBrains Rider\nDownload the Settings File (.zip) for Rider and Import to your project. You can leave this file zipped as when we import these settings, we will need a zip file.\n\nAfter download, open Rider. Click on File \u003e Manage IDE Settings \u003e Import Settings... \n\n![](./Source/images/rider_importSettings.png)\n\nNavigate to the zip file downloaded and click \"Select Folder\".\n\n![](./Source/images/rider_importSettingsDialog.png)\n\nYou should see a new dialog display that asks if you desire to import the Live Templates\n\n![](./Source/images/rider_importSettingsSelection.png)\n\nFinally, Restart Rider.\n\n![](./Source/images/rider_importSettingsFinal.png)\n\n## How to use\n\n1. After installation, type the command (as in the [Snippets List](#snippets)) `command` and press \u003ckbd\u003etab\u003c/kbd\u003e 2x;\n\u003cp\u003e\n\t\u003cimg width=\"800\" src=\"./Source/gifs/howtouse_01.gif\" alt=\"Revit API Snippets - Example of snippet\"\u003e\n\u003c/p\u003e\n\n2. Use \u003ckbd\u003etab\u003c/kbd\u003e to navigate through fields and edit them as you wish;\n\u003cp\u003e\n\t\u003cimg width=\"800\" src=\"./Source/gifs/howtouse_02.gif\" alt=\"Revit API Snippets - Example of snippet\"\u003e\n\u003c/p\u003e\n\n3. Press \u003ckbd\u003eenter\u003c/kbd\u003e to complete the command.\n\n\u003cbr /\u003e\n\n### [![Youtube logo](./Source/images/youtube-logo.png)](https://youtu.be/moD7CYUkJHw) Watch this [video](https://youtu.be/moD7CYUkJHw) to see a more detailed use of Revit API snippets.\n\n\u003cbr /\u003e\n\n---\n\n## Snippets\n\nBelow is a hyperlink to each individual .snippet for Visual Studio. JetBrains Rider code is the exact same, but the settings cannot be visualized the same way on GitHub.\n\nList of snippets ready to use:\n\n| Command                                                                       | Description                                                                          |\n|------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|\n| [rvtiexcom](./Snippets/RevitAPI2020/CreateIExternalCommand.snippet)                            | Creates a sample of a IExternal Command implemented with the main codes.             |\n| [rvtallinstcat](./Snippets/RevitAPI2020/Collector/CollectAllInstancesByCategory.snippett)      | Collects all instances in the project by the builtin category.                       |\n| [rvtalltypescat](./Snippets/RevitAPI2020/Collector/CollectAllTypesByCategory.snippet)          | Collects all element types in the project by the builtin category.                   |\n| [rvtgetparamdoub](./Snippets/RevitAPI2020/Parameters/GetParameterValueAsDouble.snippet)        | Gets a parameter value as a double.                                                  |\n| [rvtgetparamelmid](./Snippets/RevitAPI2020/Parameters/GetParameterValueAsElementId.snippet)    | Gets a parameter value as an ElementId.                                              |\n| [rvtgetparamint](./Snippets/RevitAPI2020/Parameters/GetParameterValueAsInteger.snippet)        | Gets a parameter value as an integer.                                                |\n| [rvtgetparamstr](./Snippets/RevitAPI2020/Parameters/GetParameterValueAsString.snippet)         | Get Parameter Value As String.                                                       |\n| [rvtgetparamvalstr](./Snippets/RevitAPI2020/Parameters/GetParameterValueAsValueString.snippet) | Get Parameter Value As Value String.                                                 |\n| [rvtsetparam](./Snippets/RevitAPI2020/Parameters/SetParameterValue.snippet)                    | Set Parameter Value.                                                                 |\n| [rvtsetparamstr](./Snippets/RevitAPI2020/Parameters/SetParameterValueString.snippet)           | Set Parameter Value String.                                                          |\n| [rvtselfilt](./Snippets/RevitAPI2020/Selection/CreateSelectionFilter.snippet)                  | Creates a sample of a Selection Filter code implementing ISelectionFilter interface. |\n| [rvtgetsel](./Snippets/RevitAPI2020/Selection/GetSelectedElements.snippet)                     | Gets the elements in the model.                                                      |\n| [rvtpickelms](./Snippets/RevitAPI2020/Selection/SelectElements.snippet)                        | Creates a selection of elements in the model.                                        |\n| [rvttrans](./Snippets/RevitAPI2020/Transactions/CreateTransaction.snippet)                     | Creates a sample of a Transaction code.                                              |\n---\n\n## Contributors\n\nIf you have any snippets that you think might be interesting to share, follow the steps below to contribute to this project:\n\n### Instructions\n1. [Fork](https://github.com/mayconrfreitas/RevitAPISnippets/fork) this repo;\n2. Use the `template` inside [`Snippets \u003e Templates \u003e Csharp.snippet`](./Snippets/Templates/Csharp.snippet);\n3. Use the **prefix** `rvt` to name your **shortcut** (E.g.: `rvt` + `getsel` (abbreviation to Get Selection) = [`rvtgetsel`](./Snippets/RevitAPI2020/Selection/GetSelectedElements.snippet));\n4. **Be sure** that your shortcut doesn't exist in the [Snippets List](#snippets);\n5. Write your snippets in **individual files** grouped inside folders of their **respective subject** (E.g.: [rvtselfilt](./Snippets/RevitAPI2020/Selection/CreateSelectionFilter.snippet) is inside [Selection](./Snippets/RevitAPI2020/Selection/) folder);\n6. `Commit` and `Push` your changes to your forked repo;\n7. Send a `Pull Request` to [Develop branch](https://github.com/mayconrfreitas/RevitAPISnippets/tree/develop).\n\n### More Information\n\nFor more information, feel free to contact me via email `mayconrfreitas@gmail.com` or [LinkedIn](https://www.linkedin.com/in/maycon-freitas/).\n\n---\n\n## License\n\nThis project is [licensed](LICENSE) under the [MIT Licence](https://en.wikipedia.org/wiki/MIT_License).\n\n---\n\nDo you like this solution? Please [star this project on GitHub](../../stargazers)!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayconrfreitas%2Frevitapisnippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmayconrfreitas%2Frevitapisnippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayconrfreitas%2Frevitapisnippets/lists"}