Skip to content

Instantly share code, notes, and snippets.

Ali Asad imAliAsad

Block or report user

Report or block imAliAsad

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@imAliAsad
imAliAsad / ExtractFamilyParameterData.cs
Created Jan 21, 2018
Extract or read Revit family parameter data and convert its internal ( Imperial ) unit into the metrics unit
View ExtractFamilyParameterData.cs
/// <summary>
/// Extract all family type properties data
/// </summary>
/// <param name="app"></param>
private MultiValueDictionary<string, Tuple<string, string>> ExtractFamilyParameterInfo(Application app)
{
//Open Revit Family File in a separate document
var doc = app.OpenDocumentFile(FamilyPath);
@imAliAsad
imAliAsad / LoadNoHiddenFiles.cs
Created Jan 17, 2018
C# don't show the hidden files
View LoadNoHiddenFiles.cs
var dirs = Directory.GetDirectories(@"C:\")
.Select(d => new { Attr = new DirectoryInfo(d).Attributes, Dir = d })
.Where(x => !x.Attr.HasFlag(FileAttributes.System))
.Where(x => !x.Attr.HasFlag(FileAttributes.Hidden))
.Select(x => x.Dir)
.ToList();
@imAliAsad
imAliAsad / CreateFile.cs
Created Jan 17, 2018
Create a file or folder if it doesn't exist in C#
View CreateFile.cs
string path = @"E:\FamilyBrowser\";
string FullPath = @"E:\FamilyBrowser\Architecture\Annotation\Cable Tray\Fittings\Channel Horizontal Bend.rfa";
// Extract file path info
var newpath = FullPath.Replace(path, "");
newpath = newpath.Replace(".rfa", "");
newpath = path + @"IMG\" + newpath;
// Store File Path Info
var fileinfo = new System.IO.FileInfo(newpath + ".png");
@imAliAsad
imAliAsad / CopyFiles.bat
Created Dec 26, 2017
Copy files to multiple computers in a network by using a batchfile
View CopyFiles.bat
:: Usage
:: This batch file code is used to copy the files from one computer to all other computers with in a network
:: Make sure you'll have the access to that computer where you wish to copy the file.
:: How to use it
:: Put all the files on the same folder where this batch file is located
:: Put the target.txt file on the same folder where the same batch file is located.
:: target.txt file should contain the target folder address in this format
:: "\\LAE20039\C$\Users\Ali asad\AppData\Roaming\Autodesk\Revit\Addins\2017\"
View SimplePool.cs
///
/// Simple pooling for Unity.
/// Author: Martin "quill18" Glaude (quill18@quill18.com)
/// Latest Version: https://gist.github.com/quill18/5a7cfffae68892621267
/// License: CC0 (http://creativecommons.org/publicdomain/zero/1.0/)
/// UPDATES:
/// 2015-04-16: Changed Pool to use a Stack generic.
///
/// Usage:
///
You can’t perform that action at this time.