Skip to content

Instantly share code, notes, and snippets.

View imAliAsad's full-sized avatar
:octocat:

Ali Asad imAliAsad

:octocat:
View GitHub Profile
@imAliAsad
imAliAsad / command.py
Last active November 22, 2018 10:52
Important commands for machine learning
p5 generate -b projectName
Use ServerName = (LocalDb)\MSSQLLocalDB
@imAliAsad
imAliAsad / tensorflowConfig.py
Created November 20, 2018 08:18
Tensorflow configuration
import tensorflow as tf
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
@imAliAsad
imAliAsad / SelectionSquare.cs
Created November 6, 2018 04:52
Create a rectangle selection behavior in unity like in strategy games
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace Tutorial
{
public class SelectionSquare : MonoBehaviour
{
public Camera Camera;
[SerializeField]
@imAliAsad
imAliAsad / GamepadFlycam.cs
Last active September 6, 2021 17:58
Use gamepad controller to fly free camera in gameview. This is the improved and customized script of Unity's ExtendedFlycam script
using System;
using UnityEngine;
using System.Collections;
public class GamepadFlycam : MonoBehaviour
{
public float cameraSensitivity = 90;
@imAliAsad
imAliAsad / GamepadFlycam.cs
Created November 1, 2018 11:31
Use gamepad controller to fly free camera in gameview. This is the improved and customized script of Unity's ExtendedFlycam script
using System;
using UnityEngine;
using System.Collections;
public class GamepadFlycam : MonoBehaviour
{
public float cameraSensitivity = 90;
@imAliAsad
imAliAsad / ElementsInView.cs
Last active June 3, 2018 06:25
Get all elements in active view - Revit api C#
FilteredElementCollector allElementsInView = new FilteredElementCollector(document, document.ActiveView.Id);
IList elementsInView = (IList)allElementsInView.ToElements();
@imAliAsad
imAliAsad / Configuration.cs
Created April 1, 2018 05:58
Window service that will copy all updated files from a network drive and paste it into a local drive
public static class Configuration
{
public static readonly string ArchcorpAddinFolderPath = @"O:\IT\4th Door\Ali Asad\Projects\Revit Addins\Test Archcorp Addins\";
public static readonly string AutodeskRevitAddinFolderPath = $"C:\\Users\\{Environment.UserName}\\AppData\\Roaming\\Autodesk\\Revit\\Addins\\";
public static readonly List<string> AutodeskVersion = new List<string> { @"2015\", @"2017\", @"2018\", @"2019\" };
public static readonly string DeleteAddinNamePrefix = "delete_";
}
@imAliAsad
imAliAsad / Win32Api.cs
Created March 25, 2018 12:37 — forked from teocomi/Win32Api.cs
Run Revit commands using Win32 API
/// <summary>
/// Run Revit commands using Win32 API
/// </summary>
public class Win32Api
{
[DllImport("user32.dll")]
private static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll")]
static extern bool SetFocus(IntPtr hWnd);
@imAliAsad
imAliAsad / App.cs
Created February 21, 2018 05:37
Create a button in a custom ribbon in Revit and add the functionality to enable/disable the revit addin button
class App : IExternalApplication
{
public static PushButton Pushbutton { get; set; }
public Result OnStartup(UIControlledApplication application)
{
OnButtonCreate(application);
return Result.Succeeded;
}
@imAliAsad
imAliAsad / FParameterData.cs
Last active February 8, 2024 15:13
Read and export all parameter data of a family
public class FParameterData
{
public string Family { get; set; }
public string BuiltinParameter { get; set; }
public string ParameterType { get; set; }
public string ParameterName { get; set; }
public string ParameterValue { get; set; }
public string ParameterGroup { get; set; }
public string BuiltinGroup { get; set; }