Skip to content

Instantly share code, notes, and snippets.

View ricaun's full-sized avatar

Luiz Henrique Cassettari ricaun

View GitHub Profile
@ricaun
ricaun / Blink.ino.with_bootloader.standard.bat
Last active April 6, 2023 13:47
Upload atmega328p firmware using avrdude and usbasp
@ricaun
ricaun / PrintValues
Created July 11, 2022 22:14 — forked from esfand/PrintValues
MSBuild Property Demo
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0"
DefaultTargets="PrintValues"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Add>$([MSBuild]::Add(5,9))</Add>
<Subtract01>$([MSBuild]::Subtract(90,768))</Subtract01>
<Mult01>$([MSBuild]::Multiply(4,9))</Mult01>
<Div01>$([MSBuild]::Divide(100,5.2))</Div01>
@ricaun
ricaun / netcore.csproj
Created January 9, 2024 19:45
Revit 2025 - .NET Core
<!-- Net Core -->
<PropertyGroup Condition="!$(TargetFramework.StartsWith('net4'))">
<EnableDynamicLoading>true</EnableDynamicLoading>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<GenerateDependencyFile>false</GenerateDependencyFile>
</PropertyGroup>
@ricaun
ricaun / AppScale.cs
Created March 18, 2024 21:17
BitmapSource Dpi Extension to scale dpi image to fit in the 32x32 inside Revit
using Autodesk.Revit.UI;
using ricaun.Revit.UI;
namespace RevitAddin.Forum.Revit
{
[AppLoader]
public class AppScale : IExternalApplication
{
private RibbonPanel ribbonPanel;
public Result OnStartup(UIControlledApplication application)
@ricaun
ricaun / code.cmd
Last active August 2, 2024 11:46
File to use in Revit 2025 to force Macro Manager to open csproj file with your IDE.
@echo off
REM Navigate to the specified directory
cd /d "%~1"
REM Loop through all .csproj files and open them
for %%f in (*.csproj) do (
start "" "%%~f"
)
@ricaun
ricaun / AsyncExternalEventHandler.cs
Created July 24, 2024 14:07
Simple Async ExternalEventHandler for Revit API
using Autodesk.Revit.UI;
using System;
using System.Threading.Tasks;
public class AsyncExternalEventHandler : IExternalEventHandler
{
private readonly Action<UIApplication> execute;
private readonly ExternalEvent externalEvent;
private TaskCompletionSource<bool> eventCompleted;
public AsyncExternalEventHandler(Action<UIApplication> execute)