Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for JetBrains Rider #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 40 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# RevitAPISnippets

Revit API snippets for Visual Studio.
Revit API snippets for Visual Studio and JetBrains Rider.

[![Visual Studio 2019](https://img.shields.io/badge/Visual%20Studio%202019-16.11.7+-blue)](#)
[![JetBrains Rider 2022](https://img.shields.io/badge/JetBrains%20Rider%20-2022-blue)](#)
[![Release](https://img.shields.io/github/v/release/mayconrfreitas/RevitAPISnippets)](https://github.com/mayconrfreitas/RevitAPISnippets/releases)
[![Stars](https://img.shields.io/github/stars/mayconrfreitas/RevitAPISnippets)](https://github.com/mayconrfreitas/RevitAPISnippets/stargazers)
[![Forks](https://img.shields.io/github/forks/mayconrfreitas/RevitAPISnippets)](https://github.com/mayconrfreitas/RevitAPISnippets/network/members)
Expand All @@ -12,7 +13,7 @@ Revit API snippets for Visual Studio.
[![License MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)


## Installation
## Installation For Visual Studio

1. [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;
2. On Visual Studio, go to `Tools > Code Snippets Manager...` or press <kbd>Ctrl</kbd> + <kbd>K</kbd> and <kbd>Ctrl</kbd> + <kbd>B</kbd>;
Expand All @@ -21,6 +22,25 @@ Revit API snippets for Visual Studio.
5. Open the repo [`Folder > Snippets`](./Snippets/) and Select the RevitAPI folder according to your Revit version (E.g.: [`RevitAPI2020`](./Snippets/RevitAPI2020/));
6. Click on `OK`.

## Installation For JetBrains Rider
Download 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.

After download, open Rider. Click on File > Manage IDE Settings > Import Settings...

![](./Source/images/rider_importSettings.png)

Navigate to the zip file downloaded and click "Select Folder".

![](./Source/images/rider_importSettingsDialog.png)

You should see a new dialog display that asks if you desire to import the Live Templates

![](./Source/images/rider_importSettingsSelection.png)

Finally, Restart Rider.

![](./Source/images/rider_importSettingsFinal.png)

## How to use

1. After installation, type the command (as in the [Snippets List](#snippets)) `command` and press <kbd>tab</kbd> 2x;
Expand All @@ -45,25 +65,26 @@ Revit API snippets for Visual Studio.

## Snippets

List of snippets ready to use:
Below 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.

Command | Description
------------------------------------------------------------------------------------------------|------------------------------------------------------------------------
[rvtiexcom](./Snippets/RevitAPI2020/CreateIExternalCommand.snippet) | Creates a sample of a IExternal Command implemented with the main codes.
[rvtallinstcat](./Snippets/RevitAPI2020/Collector/CollectAllInstancesByCategory.snippett) | Collects all instances in the project by the builtin category.
[rvtalltypescat](./Snippets/RevitAPI2020/Collector/CollectAllTypesByCategory.snippet) | Collects all element types in the project by the builtin category.
[rvtgetparamdoub](./Snippets/RevitAPI2020/Parameters/GetParameterValueAsDouble.snippet) | Gets a parameter value as a double.
[rvtgetparamelmid](./Snippets/RevitAPI2020/Parameters/GetParameterValueAsElementId.snippet) | Gets a parameter value as an ElementId.
[rvtgetparamint](./Snippets/RevitAPI2020/Parameters/GetParameterValueAsInteger.snippet) | Gets a parameter value as an integer.
[rvtgetparamstr](./Snippets/RevitAPI2020/Parameters/GetParameterValueAsString.snippet) | Get Parameter Value As String.
[rvtgetparamvalstr](./Snippets/RevitAPI2020/Parameters/GetParameterValueAsValueString.snippet) | Get Parameter Value As Value String.
[rvtsetparam](./Snippets/RevitAPI2020/Parameters/SetParameterValue.snippet) | Set Parameter Value.
[rvtsetparamstr](./Snippets/RevitAPI2020/Parameters/SetParameterValueString.snippet) | Set Parameter Value String.
[rvtselfilt](./Snippets/RevitAPI2020/Selection/CreateSelectionFilter.snippet) | Creates a sample of a Selection Filter code implementing ISelectionFilter interface.
[rvtgetsel](./Snippets/RevitAPI2020/Selection/GetSelectedElements.snippet) | Gets the elements in the model.
[rvtpickelms](./Snippets/RevitAPI2020/Selection/SelectElements.snippet) | Creates a selection of elements in the model.
[rvttrans](./Snippets/RevitAPI2020/Transactions/CreateTransaction.snippet) | Creates a sample of a Transaction code.
List of snippets ready to use:

| Command | Description |
|------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
| [rvtiexcom](./Snippets/RevitAPI2020/CreateIExternalCommand.snippet) | Creates a sample of a IExternal Command implemented with the main codes. |
| [rvtallinstcat](./Snippets/RevitAPI2020/Collector/CollectAllInstancesByCategory.snippett) | Collects all instances in the project by the builtin category. |
| [rvtalltypescat](./Snippets/RevitAPI2020/Collector/CollectAllTypesByCategory.snippet) | Collects all element types in the project by the builtin category. |
| [rvtgetparamdoub](./Snippets/RevitAPI2020/Parameters/GetParameterValueAsDouble.snippet) | Gets a parameter value as a double. |
| [rvtgetparamelmid](./Snippets/RevitAPI2020/Parameters/GetParameterValueAsElementId.snippet) | Gets a parameter value as an ElementId. |
| [rvtgetparamint](./Snippets/RevitAPI2020/Parameters/GetParameterValueAsInteger.snippet) | Gets a parameter value as an integer. |
| [rvtgetparamstr](./Snippets/RevitAPI2020/Parameters/GetParameterValueAsString.snippet) | Get Parameter Value As String. |
| [rvtgetparamvalstr](./Snippets/RevitAPI2020/Parameters/GetParameterValueAsValueString.snippet) | Get Parameter Value As Value String. |
| [rvtsetparam](./Snippets/RevitAPI2020/Parameters/SetParameterValue.snippet) | Set Parameter Value. |
| [rvtsetparamstr](./Snippets/RevitAPI2020/Parameters/SetParameterValueString.snippet) | Set Parameter Value String. |
| [rvtselfilt](./Snippets/RevitAPI2020/Selection/CreateSelectionFilter.snippet) | Creates a sample of a Selection Filter code implementing ISelectionFilter interface. |
| [rvtgetsel](./Snippets/RevitAPI2020/Selection/GetSelectedElements.snippet) | Gets the elements in the model. |
| [rvtpickelms](./Snippets/RevitAPI2020/Selection/SelectElements.snippet) | Creates a selection of elements in the model. |
| [rvttrans](./Snippets/RevitAPI2020/Transactions/CreateTransaction.snippet) | Creates a sample of a Transaction code. |
---

## Contributors
Expand Down
Binary file added Source/images/rider_importSettings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Source/images/rider_importSettingsDialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Source/images/rider_importSettingsFinal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Source/images/rider_importSettingsSelection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added settings.zip
Binary file not shown.