Skip to content

Instantly share code, notes, and snippets.

snooping open source

Chuong Ho chuongmep

snooping open source
View GitHub Profile
# Way 1
a = "12354+656565865"
num1 = ""
num2 = ""
index = 1
for i in range(len(a)):
if str.isdigit(a[i]):
num1 += a[i]
index += 1
# these commands get executed in the current scope
# of each new shell (but not for canned commands)
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Architecture import *
from Autodesk.Revit.DB.Analysis import *
uidoc = __revit__.ActiveUIDocument
doc = __revit__.ActiveUIDocument.Document
from Autodesk.Revit.UI import TaskDialog
View convertdynamo.cs
using System.Linq;
using System.Reflection;
using Autodesk.DesignScript.Runtime;
using Autodesk.Revit.DB;
using Revit.Elements;
using RevitServices.Persistence;
using dynCategory = Revit.Elements.Category;
using dynDocument = Revit.Application.Document;
using dynElement = Revit.Elements.Element;
using dynElementSelector = Revit.Elements.ElementSelector;
def is_symmetric(s,i,j):
if i>=j:
return True
if s[i]!=s[j]:
return False
return is_symmetric(s,i+1,j-1)
n = int(input())
s = input()
print("YES" if is_symmetric(s,0,n-1) else "NO")
View View3DSpeckleBIMDemo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View temppath.cs
using System.IO;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using MessageBox = System.Windows.MessageBox;
namespace Test
public class Lab : IExternalCommand
View CreateNewSweptBlend.cs
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
Autodesk.Revit.Creation.Application app = commandData.Application.Application.Create;
Document doc = commandData.Application.ActiveUIDocument.Document;
using (Transaction tran = new Transaction(doc, "Test"))
//ElementId id = doc.GetElement(new ElementId(1)).Id;
View githubdownload.cs
using System.Net;
using Octokit;
var client = new GitHubClient(new ProductHeaderValue("xxx"));
var releases = client.Repository.Release.GetAll("chuongmep", "revitaddinmanager");
var latest = releases.Result.First();
"The latest release is tagged at {0} and is named {1}",
View support.cs
public override void Action()
Application.ActiveDocument.CurrentSelection.Changed += CurrentSelection_Changed;
public void CurrentSelection_Changed(object sender, EventArgs e)
var selection = Application.ActiveDocument.CurrentSelection;
Application.ActiveDocument.CurrentSelection.Changed -= CurrentSelection_Changed;
View eventhander.cs
public class test : IExternalCommand
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
commandData.Application.DialogBoxShowing += new EventHandler<DialogBoxShowingEventArgs>(OnDialogShowing);
commandData.Application.Application.FailuresProcessing += new EventHandler<FailuresProcessingEventArgs>(OnFailuresProcessing);
commandData.Application.Application.FailuresProcessing -= OnFailuresProcessing;
commandData.Application.DialogBoxShowing -= OnDialogShowing;