### Install and Run Keras Example
Source: https://jeremytammik.github.io/tbc/a/1517_text_rotat
These commands demonstrate the process of installing Keras using its setup script and then running a sample question answering example script named `babi_rnn.py`.
```shell
/a/src/deep_learning $ cd kears
/a/src/deep_learning/keras $ sudo python setup.py install
/a/src/deep_learning/keras $ cd examples
/a/src/deep_learning/keras/examples $ python babi_rnn.py
```
--------------------------------
### Create Extrusion
Source: https://jeremytammik.github.io/tbc/a/zip/CreateAirHandlerFixes
This snippet demonstrates the creation of a 3D extrusion feature. It takes a profile, a sketch plane, and offset parameters to generate the extrusion. The extrusion's start and end offsets are then set, and the resulting feature is added to a combined elements list for further manipulation.
```csharp
extr usions[i] = f.NewExt rusion(isS olid[i], p rofile, sk etchPlane,
extrusionO ffsets[i, 1]);extr usions[i]. StartOffse t = extrus ionOffsets [i, 0];
m_co mbineEleme nts.Append (extrusion s[i]);
```
--------------------------------
### Getting Started with the Revit 2009 API
Source: https://jeremytammik.github.io/tbc/a/1785_dmu_loop_project_param
An introductory guide for developers beginning with the Revit 2009 API, covering initial setup and fundamental concepts.
```csharp
// Basic setup and first steps for Revit 2009 API development.
```
--------------------------------
### Example Execution of install.bat
Source: https://jeremytammik.github.io/tbc/a/1438_addin_wizard_2017
An example of running the install.bat script and its output, showing the creation of zip archives and copying of files for both C# and Visual Basic Revit addin wizards.
```text
Y:\VisualStudioRevitAddinWizard > install.bat
Creating C# wizard archive C:\Users\tammikj\AppData\Local\Temp\Revit2017AddinWizardCs0.zip...
updating: App.cs (deflated 54%)
updating: Command.cs (deflated 59%)
updating: Properties/ (stored 0%)
updating: Properties/AssemblyInfo.cs (deflated 56%)
updating: RegisterAddin.addin (deflated 66%)
updating: TemplateIcon.ico (deflated 67%)
updating: TemplateRevitCs.csproj (deflated 68%)
updating: TemplateRevitCs.csproj.user (deflated 30%)
updating: TemplateRevitCs.vstemplate (deflated 65%)
Copying C# wizard archive to C:\Users\tammikj\Documents\Visual Studio 2015\Templates\ProjectTemplates\Visual C#...
1 file(s) copied.
Creating VB wizard archive C:\Users\tammikj\AppData\Local\Temp\Revit2017AddinWizardVb0.zip...
updating: AdskApplication.vb (deflated 68%)
updating: AdskCommand.vb (deflated 58%)
updating: My Project/ (stored 0%)
updating: My Project/AssemblyInfo.vb (deflated 54%)
updating: RegisterAddin.addin (deflated 66%)
updating: TemplateIcon.ico (deflated 67%)
updating: TemplateRevitVb.vbproj (deflated 72%)
updating: TemplateRevitVb.vstemplate (deflated 62%)
Copying VB wizard archive to C:\Users\tammikj\Documents\Visual Studio 2015\Templates\ProjectTemplates\Visual Basic...
1 file(s) copied.
Y:\VisualStudioRevitAddinWizard >
```
--------------------------------
### Getting Started with the Revit 2009 API (VB.NET)
Source: https://jeremytammik.github.io/tbc/a/0688_unit_display_str
An introductory guide for developers new to the Revit 2009 API. It covers fundamental concepts and setup procedures.
```vb.net
' Example code for getting started with the Revit 2009 API would go here.
```
--------------------------------
### Using Process.Start to Open a Project or Family
Source: https://jeremytammik.github.io/tbc/a/0064_revit_serial_number
Demonstrates how to launch external applications or files, specifically Revit projects or families, using the `Process.Start` method in C#. This is useful for creating links to external resources or automating the opening of specific files.
```csharp
using System.Diagnostics;
public void OpenRevitFile(string filePath)
{
try
{
Process.Start(filePath);
}
catch (Exception ex)
{
TaskDialog.Show("Error", $"Could not open file: {ex.Message}");
}
}
// Example usage:
// OpenRevitFile(@"C:\Path\To\Your\Project.rvt");
// OpenRevitFile(@"C:\Path\To\Your\Family.rfa");
```
--------------------------------
### Getting Started with the Revit 2009 API
Source: https://jeremytammik.github.io/tbc/a/0607_cable_tray_shape
An introductory guide to using the Revit 2009 API. This covers fundamental concepts and setup for developers new to this version.
```C#
// Code example for getting started with Revit 2009 API would go here.
// This is a placeholder as no specific code was provided in the input text.
```
--------------------------------
### Load Revit SDK Samples (C#)
Source: https://jeremytammik.github.io/tbc/a/0285_rectangular_duct_corners
Demonstrates how to load and manage samples from the Revit SDK. This often involves navigating the SDK directory structure and opening solution files.
```csharp
void LoadSdkSamples() {
// Logic to locate and load SDK samples
// This might involve using System.IO to find .sln files
// and potentially launching Visual Studio.
}
```
--------------------------------
### WAV Database, Python and GUI Tutorials
Source: https://jeremytammik.github.io/tbc/a/0948_dwg_issues
Covers tutorials on working with WAV databases, Python scripting, and creating graphical user interfaces (GUIs) in the context of Revit development.
```Python
# Example Python code for database interaction or GUI creation
```
--------------------------------
### Getting Revit Install Path and Product GUID
Source: https://jeremytammik.github.io/tbc/a/1418_win10_security
This snippet explains how to programmatically retrieve the installation path of Revit and its product GUID, which can be useful for deployment and licensing.
```csharp
// Example: Getting Revit install path (requires registry access)
// string installPath = Registry.GetValue(...);
```
```vb
' Example: Getting Revit install path (requires registry access)
' Dim installPath As String = Registry.GetValue(...)
```
--------------------------------
### Creating a Group and How to Fish - VB.NET Example
Source: https://jeremytammik.github.io/tbc/a/0815_au_adn_open
Provides a VB.NET example for creating groups of elements in Revit, possibly accompanied by advice on approaching API challenges.
```vbnet
' VB.NET example for creating a group
' Dim group As Group = document.Create.NewGroup(selectedElements)
' group.Name = "My New Group"
```
--------------------------------
### Retrieve Revit Install Path and Product GUID
Source: https://jeremytammik.github.io/tbc/a/0119_cases_1
Code snippet to get the installation path of Revit and its product GUIDs, useful for application deployment and registration.
```csharp
string revitInstallPath = Autodesk.Revit.DB.Installation.RevitProductInfo.InstallDir;
string productGuid = Autodesk.Revit.DB.Installation.RevitProductInfo.ProductGuid;
```
--------------------------------
### Start Method for Rendering Process - C#
Source: https://jeremytammik.github.io/tbc/a/0981_custom_exporter_json
Initiates the rendering process by printing 'Start' to the debug output and returning true, indicating successful initiation. This method serves as the entry point for the rendering workflow. Dependencies include the Debug class.
```csharp
public bool Start()
{
Debug.Print( "Start" );
return true;
}
```
--------------------------------
### Getting the Revit Install Path and Product GUIDs
Source: https://jeremytammik.github.io/tbc/a/0317_addinmanager
Provides methods to find the installation directory of Revit and retrieve the unique product GUIDs for different Revit versions. This is useful for system integration and licensing.
```C#
using Microsoft.Win32;
///
/// Gets the Revit installation path from the registry.
///
/// The Revit version (e.g., "2023").
/// The installation path, or null if not found.
public string GetRevitInstallPath(string version)
{
string installPath = null;
string registryPath = $"SOFTWARE\Autodesk\Revit\{version}";
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(registryPath))
{
if (key != null)
{
object value = key.GetValue("InstallDir");
if (value != null)
{
installPath = value.ToString();
}
}
}
return installPath;
}
///
/// Gets the Revit Product GUID from the registry.
///
/// The Revit version (e.g., "2023").
/// The Product GUID, or null if not found.
public string GetRevitProductGuid(string version)
{
string productGuid = null;
string registryPath = $"SOFTWARE\Autodesk\Revit\{version}";
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(registryPath))
{
if (key != null)
{
object value = key.GetValue("ProductGuid");
if (value != null)
{
productGuid = value.ToString();
}
}
}
return productGuid;
}
```
--------------------------------
### Getting Revit Product GUIDs (VB.NET)
Source: https://jeremytammik.github.io/tbc/a/1306_3dwc_svg_01
A VB.NET implementation for retrieving the Product GUID of installed Revit versions, useful for automation and integration tasks.
```vbnet
Public Function GetRevitProductGuidVB(versionName As String) As Guid
' Implementation to get the Product GUID
' ...
Return guid
End Function
```
--------------------------------
### Create Revit Add-In Manifest with Command and Application
Source: https://jeremytammik.github.io/tbc/a/0902_whats_new_2011
Demonstrates how to create a new .addin manifest file using the RevitAddInUtility API. This involves instantiating RevitAddInManifest, adding RevitAddInCommand and RevitAddInApplication objects, and saving the manifest to a file. It utilizes the RevitProductUtility to get installed Revit products.
```csharp
//create a new addin manifest
RevitAddInManifest Manifest = new RevitAddInManifest();
//create an external command
RevitAddInCommand command1 = new RevitAddInCommand(
"full path\assemblyName.dll", Guid.NewGuid(),
"namespace.className" );
command1.Description = "description";
command1.Text = "display text";
//this command only visible in Revit MEP, Structure,
// and only visible in Project document or when no
// document at all
command1.VisibilityMode = VisibilityMode.NotVisibleInArchitecture
| VisibilityMode.NotVisibleInFamily;
//create an external application
RevitAddInApplication application1
= new RevitAddInApplication( "appName",
"full path\assemblyName.dll",
Guid.NewGuid(), "namespace.className" );
//add both command(s) and application(s) into manifest
Manifest.AddInCommands.Add( command1 );
Manifest.AddInApplications.Add( application1 );
//save manifest to a file
RevitProduct revitProduct1 = RevitProductUtility
.GetAllInstalledRevitProducts()[0];
Manifest.SaveAs( revitProduct1.AllUsersAddInFolder
+ "\RevitAddInUtilitySample.addin" );
```
--------------------------------
### Getting Revit Product GUIDs
Source: https://jeremytammik.github.io/tbc/a/1306_3dwc_svg_01
Shows how to retrieve the Product GUID for installed Revit versions. This unique identifier is often required for various API operations and licensing checks.
```csharp
public Guid GetRevitProductGuid(string versionName)
{
// Implementation to get the Product GUID
// ...
return guid;
}
```
--------------------------------
### Revit Add-in Start-up Command Implementation
Source: https://jeremytammik.github.io/tbc/a/1635_contextualhelp
This C# code defines the entry point for a Revit add-in command. The Execute method is responsible for initiating the add-in's functionality, in this case, by displaying a test dialogue (TestDlg). It adheres to the IExternalCommand interface required by Revit for add-in commands.
```csharp
using Autodesk.Revit.UI;
using Autodesk.Revit.DB;
using Autodesk.Revit.Attributes;
namespace TestAddin
{
[Transaction( TransactionMode.Manual )]
[Regeneration( RegenerationOption.Manual )]
public class StartUpCmd : IExternalCommand
{
public Result Execute(
ExternalCommandData commandData,
ref string message,
ElementSet elements )
{
TestDlg testDlg = new TestDlg();
testDlg.ShowDialog();
return Result.Succeeded;
}
}
}
```
--------------------------------
### Use Process.Start to Open Project/Family (Revit)
Source: https://jeremytammik.github.io/tbc/a/0086_category_comparison
Demonstrates how to use the `Process.Start` method in .NET to open a Revit project or family file from an external application or script. This is useful for automating workflows.
```csharp
using System.Diagnostics;
public void OpenRevitFile(string filePath)
{
try
{
Process.Start("Revit.exe", filePath); // Assumes Revit.exe is in the system's PATH or specified explicitly
}
catch (Exception ex)
{
// Handle exceptions, e.g., file not found, Revit not installed
System.Diagnostics.Debug.WriteLine($"Error opening file: {ex.Message}");
}
}
```
--------------------------------
### Getting the Revit Install Path and Product GUID in Revit API
Source: https://jeremytammik.github.io/tbc/a/0605_transformed_geo
Provides methods to retrieve the Revit installation path and product GUIDs using the API. This information is often needed for licensing, deployment, or accessing supporting files. It involves querying application registry keys or properties.
```csharp
Revit Install Path and Product GUIDs
```
--------------------------------
### Place Family Instance with Host and Level (Revit API C#)
Source: https://jeremytammik.github.io/tbc/a/0475_place_furniture
This example demonstrates the recommended approach for placing furniture instances: using the NewFamilyInstance overload that specifies both a host element and a level. This method ensures correct placement and representation in the UI, similar to manual placement.
```csharp
doc.Create.NewFamilyInstance(
xyz,
familySymbol,
hostElement,
level,
StructuralType.NonStructural );
```
--------------------------------
### Getting Started with Revit 2009 API
Source: https://jeremytammik.github.io/tbc/a/1418_win10_security
This snippet provides introductory information and code examples for developers beginning with the Revit 2009 API.
```plaintext
Consult the Revit 2009 SDK documentation and samples for initial setup and basic API usage.
```
--------------------------------
### Initial Attempt to Create Revit Family Instance (.NET)
Source: https://jeremytammik.github.io/tbc/a/0200_electrical_and_lighting
This code snippet shows an initial approach to creating a family instance in Revit. It attempts to host a lighting fixture on a ceiling by providing location, symbol, and host element. However, this method can lead to issues with the fixture's host properties and copyability, as the host information might not be correctly assigned.
```csharp
FamilyInstance inst
= doc.Create.NewFamilyInstance(
location, symbol, ceil,
StructuralType.NonStructural );
```
--------------------------------
### Get Revit API Cases 1 in Revit API
Source: https://jeremytammik.github.io/tbc/a/0862_grand_canyon
This likely refers to a series of case studies or examples for the Revit API, with this being the first installment. Content is unspecified.
```C#
// Placeholder for Revit API case study examples.
```
--------------------------------
### New Revit Applications (C#)
Source: https://jeremytammik.github.io/tbc/a/0057_polygon_transformation
Provides guidance or examples for starting new Revit API application development. This likely covers project setup and basic add-in structure.
```csharp
// This would cover creating a new Visual Studio project targeting the Revit API,
// setting up references, and implementing the IExternalApplication interface.
```
--------------------------------
### Running Forge Boilerplate Sample
Source: https://jeremytammik.github.io/tbc/a/1494_roomedit3dv3_diff
This sequence outlines the steps to set up and run an unmodified Forge Node.js boilerplate application. It includes cloning the repository, installing dependencies, building the project, and starting the development server.
```bash
# Create a fresh clone of the forge-boilers.nodejs repo.
# Navigate to the step 6 sample app: $ cd forge-boilers.nodejs/6\ -\ viewer+server+data-mng+derivatives/
# Install the required npm modules: npm install
# Build: npm run build-dev
# Run: npm run dev
# Test: open http://localhost:3000 in your browser
```