Skip to content

Instantly share code, notes, and snippets.

View stephensmitchell's full-sized avatar

Stephen S. Mitchell stephensmitchell

  • Earth
View GitHub Profile
@stephensmitchell
stephensmitchell / Export Part Views as DXF.py
Created February 13, 2024 23:46
getalibrepath-function-and-alibrescript
from __future__ import division # This fixes division with integers. For example the 1 / 2 = 0.5 instead of 0
import os # for working with file paths
import clr
import _winreg
from AlibreX import ADUnits, ADDrawingViewType, ADDetailingOption, ADViewOrientation, IAD2DPoint, IADTransformation
Win = Windows()
def InputChanged(Index, Value):
https://help.alibre.com/articles/#!alibre-help-v27/wrap Pro
https://help.alibre.com/articles/#!alibre-help-v27/workspace-preferences-working-with-redlines Pro
https://help.alibre.com/articles/#!alibre-help-v27/workspace-preferences-menu-structure-toolbars Pro
https://help.alibre.com/articles/#!alibre-help-v27/workspace-preferences-menu-structure-custom-toolbars Pro
https://help.alibre.com/articles/#!alibre-help-v27/workspace-preferences-grid-snapping-to-the-grid Pro
https://help.alibre.com/articles/#!alibre-help-v27/workspace-preferences-grid-showing-or-hiding-the-grid Pro
https://help.alibre.com/articles/#!alibre-help-v27/workspace-preferences-grid-setting-the-grid Pro
https://help.alibre.com/articles/#!alibre-help-v27/workspace-preferences-about-split-views Pro
https://help.alibre.com/articles/#!alibre-help-v27/using-menus Pro
https://help.alibre.com/articles/#!alibre-help-v27/thread-data Pro
@stephensmitchell
stephensmitchell / gist:0e705b903b0d956938473eb75708efac
Created July 29, 2023 03:48
Append options example - Alibre Script
Options.append(['Pattern 2D Sketch', WindowsInputTypes.Sketch, None])
Options.append(['Number of Patterns', WindowsInputTypes.Integer, 10])
@stephensmitchell
stephensmitchell / Command.fs
Created March 3, 2023 09:51 — forked from pzurek/Command.fs
A quick F# example for Revit
namespace FSharpPanelBuilder
open System
open System.Collections.Generic
open Autodesk.Revit
open Autodesk.Revit.UI
open Autodesk.Revit.Attributes
open Autodesk.Revit.DB
open Autodesk.Revit.UI.Selection
namespace Tsunami.Server
open System
open System.IO
open System.Linq
open System.Net
open System.Net.Sockets
open System.Text
open System.Threading
open System.Runtime.Serialization
// Based on the SDK Sampl GeometryCreation_BooleanOperations
// This is testing code. Many improvements can be made before use in real work
#r @"C:\Program Files\Autodesk\Revit 2016\RevitAPI.dll"
#r @"C:\Program Files\Autodesk\Revit 2016\RevitDBAPI.dll"
#r @"C:\Program Files\Autodesk\Revit 2016\RevitAPIUI.dll"
#r @"C:\Program Files\Mantis\Tsunami.IDEDesktop.dll"
open Autodesk.Revit
open Autodesk.Revit.UI
@stephensmitchell
stephensmitchell / Scenes.cs
Created November 30, 2022 21:13 — forked from bma73/Scenes.cs
Unity3D: Editor window which lists all scenes avaible in the current project and loads them by clicking on the according button.
using UnityEditor;
using UnityEngine;
using System.IO;
using System.Collections.Generic;
public class Scenes : EditorWindow
{
[MenuItem("Window/Scenes...", false)]
public static void ShowWindow ()
{
@stephensmitchell
stephensmitchell / Edit Light Properties Rhino
Created August 4, 2022 18:39 — forked from fraguada/Edit Light Properties Rhino
Small example method to edit Rhino light properties
private void RunScript(Guid id, Color col, double pow, ref object A)
{
Rhino.DocObjects.ObjRef obj = new Rhino.DocObjects.ObjRef(id);
Rhino.DocObjects.LightObject lobj = obj.Object() as Rhino.DocObjects.LightObject;
lobj.LightGeometry.Diffuse = col;
lobj.LightGeometry.Intensity = pow;
lobj.CommitChanges();
}
@stephensmitchell
stephensmitchell / chat-frontend.js
Created June 26, 2022 01:10 — forked from martinsik/chat-frontend.js
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
@stephensmitchell
stephensmitchell / index.html
Created May 1, 2022 04:14
Three.js+ImGui JavaScript
<canvas id="output" tabindex="1"></canvas>