Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	bin/pyrevit-hosts.json
  • Loading branch information
eirannejad committed Nov 9, 2020
2 parents 4319ff0 + cc70530 commit 738cac0
Show file tree
Hide file tree
Showing 89 changed files with 1,224 additions and 234 deletions.
134 changes: 133 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,137 @@
<img src="static/logo/pyRevitLogo R5_WithTitle.svg" width="640" />

&nbsp;

[![GitHub issues](https://img.shields.io/github/issues/eirannejad/pyRevit.svg?style=for-the-badge)](https://github.com/eirannejad/pyRevit/issues)
[![GitHub forks](https://img.shields.io/github/forks/eirannejad/pyRevit.svg?style=for-the-badge)](https://github.com/eirannejad/pyRevit/network)
[![GitHub stars](https://img.shields.io/github/stars/eirannejad/pyRevit.svg?style=for-the-badge&colorB=red)](https://github.com/eirannejad/pyRevit/stargazers)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg?style=for-the-badge)](http://www.gnu.org/licenses/gpl-3.0)
[![madewithloveinportland](https://img.shields.io/badge/%3C%2F%3E%20with%20%3C3-Portland%2C%20OR-green.svg?style=for-the-badge)](https://en.wikipedia.org/wiki/Portland,_Oregon)
[![madewithloveinportland](https://img.shields.io/badge/%3C%2F%3E%20with%20%3C3-Portland%2C%20OR-green.svg?style=for-the-badge)](https://en.wikipedia.org/wiki/Portland,_Oregon)

&nbsp;

pyRevit helps you quickly sketch out your automation and addon ideas, in whichever language that you are most comfortable with, inside the Revit environment and using its APIs. It also ships with an extensive set of powerful tools that showcase its capabilities as a development environment. Download and install pyRevit, launch Revit, and note the new pyRevit tab that includes these tools. pyRevit also ships with a handy CLI utility for customized configuration and deployment of your tools, and a telemetry server to monitor pyRevit usage across your teams.

&nbsp;

### pyRevit can help you

- Add a **powerful set of free tools to your Revit workflows**.
- **Sketch out** your automation **ideas quickly** in python
- **Write your own Revit addons** for Revit using python ([IronPython](https://ironpython.net/) or [CPython](https://www.python.org/)), C#, VB.Net
- **Distribute your tools** (pyRevit, [Dynamo](https://dynamobim.org/), or [Grasshopper](https://www.rhino3d.com/inside)) easily to your teams using a unified interface
- **Share your tools** with the community

&nbsp;

# Getting Started

## Get Started Using pyRevit

[Install pyRevit](https://www.notion.so/Install-pyRevit-98ca4359920a42c3af5c12a7c99a196d)

[Create Custom Patterns](https://www.notion.so/Create-Custom-Patterns-6b8db11b87ed49d98144b75407685152)

[Manage Keynotes](https://www.notion.so/Manage-Keynotes-6f083d6f66fe43d68dc5d5407c8e19da)

[Configure pyRevit](https://www.notion.so/Configure-pyRevit-461d8f564ba743d0ad7e843a7b3b2afe)

[Install Extensions](https://www.notion.so/Install-Extensions-0753ab78c0ce46149f962acc50892491)

**** More guides are available here

[HOW TO Guides](https://www.notion.so/HOW-TO-Guides-dc20e0e227b74d9bbc775699904152cb)

## Get Started Developing for pyRevit

[Create Your First Command](https://www.notion.so/Create-Your-First-Command-2509b43e28bd498fba937f5c1be7f485)

**** Read the docs to know everything about pyRevit scripts, extensions, ...

[Developer Docs](https://www.notion.so/Developer-Docs-2c88f3ecccde422d9504e20b6b9e04f8)

**** pyRevit has a powerful command line utility

[pyRevit CLI](https://www.notion.so/pyRevit-CLI-c50de95259114db795db5bd3f19f8e2a)

**** And when you are ready to deploy your tools to your team

[pyRevit For Teams](https://www.notion.so/pyRevit-For-Teams-ddc6c312d6f6488691eed2ec7704fd97)

&nbsp;

# Staying Updated

Follow [pyRevit on Twitter](https://twitter.com/pyrevit) to stay notified about the upcoming changes and follow [pyRevit Release Notes](https://github.com/eirannejad/pyRevit/releases) for the breaking changes

**** Check out the blog for news

[Blog](https://www.notion.so/Blog-5bcadb69d8ab43c8ba5ee547e42a129f)

**** And the future plans for pyRevit are laid out here

[Roadmap](https://www.notion.so/Roadmap-8f353f66ffe94a5ea6676f0d3c5df5bd)

&nbsp;

# Dealing with Issues

Check the list of [Currently Open](https://github.com/eirannejad/pyRevit/issues) and [Previously Reported Issues](https://github.com/eirannejad/pyRevit/issues?q=is%3Aissue+is%3Aclosed) for anything similar to yours.

**** See the FAQ page for questions

[FAQs](https://www.notion.so/FAQs-70774c29e0ed41388f9a7857bc2e24dc)

**** See the guide below on how to report new issues

[Reporting New Issues](https://www.notion.so/Reporting-New-Issues-f1fdd62cf6074b318bfe8ddfbc2d8d98)

&nbsp;

# Getting Involved

**** Get involved with the community of developers, creating tools with and for pyRevit

[Community](https://www.notion.so/Community-eb501192c78c4d2f884f0cc34532058e)

## Share Your Passion

**** Help making pyRevit better

[Help with Documentation](https://www.notion.so/Help-with-Documentation-3ad04b6431a046a3bc9ca584eeea51fa)

[Help Translate pyRevit](https://www.notion.so/Help-Translate-pyRevit-c26063a6c9824667a07c6a40b28c70d4)

[Create Tutorials](https://www.notion.so/Create-Tutorials-d25685ddb11d4eb6a76001325715cfb5)

[Share Revit Build Numbers](https://www.notion.so/Share-Revit-Build-Numbers-90817d95875c48d0accb802035bfcb68)

## Share Your Code

**** Help making pyRevit core and tools better

[Improve pyRevit Core](https://www.notion.so/Improve-pyRevit-Core-109f014ece0043ed8e523605312b1305)

[Contribute New Tools](https://www.notion.so/Contribute-New-Tools-800ecc0cee8e47b484f22359c4fe4307)

[Share Your Extensions](https://www.notion.so/Share-Your-Extensions-48ff84d4eae846f4aa9567fca32ff4fe)

[Bundle Shelf](https://www.notion.so/Bundle-Shelf-d1b57b18fd33426aa77d29de2e8b6cf7)

## Share Your Coins

**** Help making pyRevit financially stronger

[Support on Patreon](https://www.notion.so/Support-on-Patreon-cdf92ba547154f7a85d32b526dc5e59b)

[Supporters](https://www.notion.so/Supporters-4f3350243ba24dcd8228df6262723629)

&nbsp;

---

**</>** with 🖤 in [Portland](https://en.m.wikipedia.org/wiki/Portland,_Oregon), Oregon

Copyright Ⓒ 2014-2020 by Ehsan Iran-Nejad (pyrevitlabs.io) - All Rights Reserved

No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher.
Binary file modified bin/engines/2710/pyRevitLoader.dll
Binary file not shown.
Binary file modified bin/engines/2710/pyRevitRunner.dll
Binary file not shown.
Binary file modified bin/engines/273/pyRevitLoader.dll
Binary file not shown.
Binary file modified bin/engines/273/pyRevitRunner.dll
Binary file not shown.
Binary file modified bin/engines/277/pyRevitLoader.dll
Binary file not shown.
Binary file modified bin/engines/277/pyRevitRunner.dll
Binary file not shown.
Binary file modified bin/engines/278/pyRevitLoader.dll
Binary file not shown.
Binary file modified bin/engines/278/pyRevitRunner.dll
Binary file not shown.
Binary file modified bin/engines/279/pyRevitLoader.dll
Binary file not shown.
Binary file modified bin/engines/279/pyRevitRunner.dll
Binary file not shown.
Binary file modified bin/engines/378/pyRevitLabs.PythonNet.dll
Binary file not shown.
Binary file modified bin/engines/385/pyRevitLabs.PythonNet.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.Common.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.CommonCLI.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.CommonWPF.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.DeffrelDB.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.Emojis.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.Json.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.Language.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.MahAppsMetro.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.NLog.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.PyRevit.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.TargetApps.AutoCAD.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.TargetApps.Navisworks.dll
Binary file not shown.
Binary file modified bin/pyRevitLabs.TargetApps.Revit.dll
Binary file not shown.
Binary file modified bin/pyrevit-autocomplete.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion bin/pyrevit-hosts.json
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@
"source": "https://help.autodesk.com/view/RVT/2021/ENU/?guid=RevitReleaseNotes_2021updates_2021_1_1_html"
},
"product": "Autodesk Revit",
"release": "2020.1.1",
"release": "2021.1.1",
"version": "21.1.10.26",
"build": "20200909_1515",
"target": "x64",
Expand Down
12 changes: 12 additions & 0 deletions bin/pyrevit-products.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
[
{
"product": "pyRevit",
"release": "4.8.3",
"version": "4.8.3",
"key": "{696310B4-5E37-4437-B047-20954E4B2814}"
},
{
"product": "pyRevit",
"release": "4.8.2",
Expand Down Expand Up @@ -203,6 +209,12 @@
"version": "4.6.1",
"key": "{EF91A585-DC0C-43B8-B88B-4C130F430E84}"
},
{
"product": "pyRevit CLI",
"release": "4.8.3",
"version": "4.8.3",
"key": "{F0958CD1-EEF8-481D-871C-7501947EC650}"
},
{
"product": "pyRevit CLI",
"release": "4.8.2",
Expand Down
Binary file modified bin/pyrevit-stubsbuilder.exe
Binary file not shown.
Binary file modified bin/pyrevit-telemetryserver.exe
Binary file not shown.
Binary file modified bin/pyrevit-toast.exe
Binary file not shown.
Binary file modified bin/pyrevit.exe
Binary file not shown.
1 change: 1 addition & 0 deletions dev/_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def title(self):
ChangeGroup(tag="runtime", header="Runtime"),
ChangeGroup(tag="framework", header="Framework Updates"),
ChangeGroup(tag="installer", header="Installer"),
ChangeGroup(tag="cli", header="Command Line Utility"),
ChangeGroup(tag="bundles", header="Script bundles"),
ChangeGroup(tag="tele", header="Telemetry"),
ChangeGroup(tag="api", header="API"),
Expand Down
4 changes: 2 additions & 2 deletions dev/pyRevit/AssemblyVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;

[assembly: AssemblyVersion("4.8.2")]
[assembly: AssemblyFileVersion("4.8.2")]
[assembly: AssemblyVersion("4.8.3")]
[assembly: AssemblyFileVersion("4.8.3")]
8 changes: 6 additions & 2 deletions dev/pyRevitLabs/pyRevitCLI/PyRevitCLI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,9 @@ private static void ProcessArguments() {
else if (all("update"))
PyRevitCLICloneCmds.UpdateClone(
allClones: arguments["--all"].IsTrue,
cloneName: TryGetValue("<clone_name>")
cloneName: TryGetValue("<clone_name>"),
username: TryGetValue("--username"),
password: TryGetValue("--password")
);

else
Expand Down Expand Up @@ -432,7 +434,9 @@ private static void ProcessArguments() {
else if (all("update"))
PyRevitCLIExtensionCmds.UpdateExtension(
all: arguments["--all"].IsTrue,
extName: TryGetValue("<extension_name>")
extName: TryGetValue("<extension_name>"),
username: TryGetValue("--username"),
password: TryGetValue("--password")
);

else if (IsHelpMode)
Expand Down
4 changes: 2 additions & 2 deletions dev/pyRevitLabs/pyRevitCLI/PyRevitCLICloneCmds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ internal static void
}

internal static void
UpdateClone(bool allClones, string cloneName) {
UpdateClone(bool allClones, string cloneName, string username, string password) {
// TODO: ask for closing running Revits

// prepare a list of clones to be updated
Expand Down Expand Up @@ -260,7 +260,7 @@ internal static void
// update clones that do not include this process
foreach (var clone in targetClones) {
logger.Debug("Updating clone \"{0}\"", clone.Name);
PyRevitClones.Update(clone);
PyRevitClones.Update(clone, username, password);
}

// now update myClone if any, as last step
Expand Down
6 changes: 3 additions & 3 deletions dev/pyRevitLabs/pyRevitCLI/PyRevitCLIExtensionCmds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ internal static void
}

internal static void
UpdateExtension(bool all, string extName) {
UpdateExtension(bool all, string extName, string username, string password) {
if (all)
PyRevitExtensions.UpdateAllInstalledExtensions();
PyRevitExtensions.UpdateAllInstalledExtensions(username, password);
else if (extName != null)
PyRevitExtensions.UpdateExtension(extName);
PyRevitExtensions.UpdateExtension(extName, username, password);
}
}
}
4 changes: 2 additions & 2 deletions dev/pyRevitLabs/pyRevitCLI/Resources/UsagePatterns.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Usage:
pyrevit clones commit <clone_name> [<commit_hash>] [--log=<log_file>]
pyrevit clones origin <clone_name> --reset [--log=<log_file>]
pyrevit clones origin <clone_name> [<origin_url>] [--log=<log_file>]
pyrevit clones update (--all | <clone_name>) [--log=<log_file>]
pyrevit clones update (--all | <clone_name>) [--log=<log_file>] [--username=<username>] [--password=<password>]
pyrevit clones deployments <clone_name>
pyrevit clones engines <clone_name>
pyrevit attach --help
Expand Down Expand Up @@ -49,7 +49,7 @@ Usage:
pyrevit extensions sources [--help]
pyrevit extensions sources forget --all [--log=<log_file>]
pyrevit extensions sources (add | forget) <source_json_or_url> [--log=<log_file>]
pyrevit extensions update (--all | <extension_name>) [--log=<log_file>]
pyrevit extensions update (--all | <extension_name>) [--log=<log_file>] [--username=<username>] [--password=<password>]
pyrevit releases --help
pyrevit releases [--pre] [--notes]
pyrevit releases latest [--pre] [--notes]
Expand Down
21 changes: 15 additions & 6 deletions dev/pyRevitLabs/pyRevitLabs.Common/GitInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.Web.UI.WebControls.Adapters;
using LibGit2Sharp;
using pyRevitLabs.NLog;

Expand Down Expand Up @@ -106,12 +106,19 @@ public static void CheckoutBranch(string repoPath, string branchName) {

// rebase current branch and pull from master
// @handled @logs
public static UpdateStatus ForcedUpdate(string repoPath) {
public static UpdateStatus ForcedUpdate(string repoPath, string username, string password) {
logger.Debug("Force updating repo \"{0}\"...", repoPath);
try {
var repo = new Repository(repoPath);
var options = new PullOptions();
options.FetchOptions = new FetchOptions();
var fetchOpts = new FetchOptions();

// add username and password to clone options, if provided by user
if (username != null && password != null)
fetchOpts.CredentialsProvider =
(_url, _usernameFromUrl, _credTypes) => new UsernamePasswordCredentials { Username = username, Password = password };

options.FetchOptions = fetchOpts;

// before updating, let's first
// forced checkout to overwrite possible local changes
Expand Down Expand Up @@ -233,10 +240,12 @@ public static string GetCheckedoutBranch(string repoPath) {
// get the checkedout branch from repopath
// @handled @logs
public static string GetHeadCommit(string repoPath) {
string head = null;
if (IsValidRepo(repoPath))
return new Repository(repoPath).Head.Tip.Id.ToString();
logger.Debug("Can not determine head commit hash for \"{0}\"", repoPath);
return null;
head = new Repository(repoPath).Head?.Tip?.Id.ToString();
if (head is null)
logger.Debug("Can not determine head commit hash for \"{0}\"", repoPath);
return head;
}

// get the checkedout branch from repopath
Expand Down
13 changes: 10 additions & 3 deletions dev/pyRevitLabs/pyRevitLabs.Common/UserEnv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ public static Version GetInstalledDotNetVersion() {

public static List<string> GetInstalledDotnetTargetPacks() {
var targetPackPaths = new List<string>();
var frameworkPath = @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework";
var frameworkPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86),
@"Reference Assemblies\Microsoft\Framework\.NETFramework"
);
foreach (string path in Directory.GetDirectories(frameworkPath))
if (Regex.Match(Path.GetFileName(path), @"\d\..+").Success)
targetPackPaths.Add(path);
Expand All @@ -61,7 +64,10 @@ public static List<string> GetInstalledDotnetTargetPacks() {

public static List<string> GetInstalledDotnetCoreTargetPacks() {
var targetPackPaths = new List<string>();
var frameworkPath = @"C:\Program Files\dotnet\sdk";
var frameworkPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles),
@"dotnet\sdk"
);
foreach (string path in Directory.GetDirectories(frameworkPath))
if (Regex.Match(Path.GetFileName(path), @"\d\..+").Success)
targetPackPaths.Add(path);
Expand All @@ -80,7 +86,8 @@ public static string GetLoggedInUserName() {
foreach (ManagementObject oReturn in oReturnCollection) {
return oReturn["UserName"].ToString();
}
} catch (Exception ex) {
}
catch (Exception ex) {
logger.Debug("Failed to get logged in username. | {0}", ex.Message);
}
return null;
Expand Down
10 changes: 7 additions & 3 deletions dev/pyRevitLabs/pyRevitLabs.PyRevit/PyRevitAttachments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,17 @@ public static List<PyRevitAttachment> GetAttachments() {

// get all attachments for a revit version
// @handled @logs
public static List<PyRevitAttachment> GetAllAttached(int revitYear) =>
GetAttachments().Where(x => x.Product.ProductYear == revitYear).OrderBy(x => x.AllUsers).ToList();
public static List<PyRevitAttachment> GetAllAttached(int revitYear) {
var attachments = GetAttachments().Where(x => x.Product.ProductYear == revitYear);
if (attachments.Count() > 0)
return attachments.OrderBy(x => x.AllUsers).ToList();
return new List<PyRevitAttachment>();
}

// get attachment for a revit version
// @handled @logs
public static PyRevitAttachment GetAttached(int revitYear) {
return GetAllAttached(revitYear)?.First();
return GetAllAttached(revitYear)?.FirstOrDefault();
}

}
Expand Down
Loading

0 comments on commit 738cac0

Please sign in to comment.