This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//using DotNetOpenAuth and RestSharp | |
WebServerClient client = new WebServerClient( | |
new AuthorizationServerDescription | |
{ | |
TokenEndpoint = new Uri("https://myurl/oauth"), | |
ProtocolVersion = ProtocolVersion.V20 | |
}, "client", "secret"); | |
var token = client.GetClientAccessToken(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string url = "https://myurl.com"; | |
string client_id = "client_id"; | |
string client_secret = "client_secret"; | |
//request token | |
var restclient = new RestClient(url); | |
RestRequest request = new RestRequest("request/oauth") {Method = Method.POST}; | |
request.AddHeader("Accept", "application/json"); | |
request.AddHeader("Content-Type", "application/x-www-form-urlencoded"); | |
request.AddParameter("client_id", client_id); | |
request.AddParameter("client_secret", client_secret); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//source http://stackoverflow.com/questions/9683279/make-the-current-commit-the-only-initial-commit-in-a-git-repository | |
rm -rf .git | |
git init | |
git add . | |
git commit -m "Initial commit" | |
git remote add origin <github-uri> | |
git push -u --force origin master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Autodesk Revit addins are generally loaded from the following locations. | |
User Addins: | |
%appdata%\Autodesk\Revit\Addins\ | |
%appdata%\Autodesk\ApplicationPlugins\ | |
Machine Addins (for all users of the machine): | |
C:\ProgramData\Autodesk\Revit\Addins\ | |
Addins packaged for the Autodesk Exchange store: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Random ID Generator | |
/// more ideas: http://www.anotherchris.net/csharp/friendly-unique-id-generation-part-2/ | |
/// </summary> | |
/// <param name="length">Length of the string</param> | |
/// <returns></returns> | |
public static string RandomString(int length) | |
{ | |
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | |
var random = new Random(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# =============== # | |
# Unity generated # | |
# =============== # | |
[Tt]emp/ | |
[Oo]bj/ | |
[Bb]uild | |
/[Bb]uilds/ | |
/[Ll]ibrary/ | |
sysinfo.txt | |
*.stackdump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Unity ## | |
*.cs diff=csharp text | |
*.cginc text | |
*.shader text | |
*.mat merge=unityyamlmerge eol=lf | |
*.anim merge=unityyamlmerge eol=lf | |
*.unity merge=unityyamlmerge eol=lf | |
*.prefab merge=unityyamlmerge eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import clr | |
clr.AddReference("RevitAPI") | |
import Autodesk | |
from Autodesk.Revit.DB import ElementId | |
clr.AddReference("RevitServices") | |
import RevitServices | |
from RevitServices.Persistence import DocumentManager | |
clr.AddReference("System") | |
from System.Collections.Generic import List |
OlderNewer