-
-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into release/46beta
- Loading branch information
Showing
143 changed files
with
1,582 additions
and
756 deletions.
There are no files selected for viewing
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1"/></startup></configuration> |
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
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
Binary file added
BIN
+37.3 KB
...DevTools.extension/pyRevitDev.tab/Debug.panel/Debug Dialog Config.panelbutton/tooltip.mp4
Binary file not shown.
17 changes: 17 additions & 0 deletions
17
...ug.panel/Unit Tests.pulldown/Test FillPatternViewer.pushbutton/TestFillPatternViewer.xaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:controls="clr-namespace:pyRevitLabs.TargetApps.Revit.Controls;assembly=pyRevitLabs.TargetApps.Revit" | ||
Title="Test FillPatternPreview Control" | ||
Width="300" ResizeMode="NoResize" | ||
ShowInTaskbar="False" SizeToContent="Height" | ||
WindowStartupLocation="CenterScreen" | ||
ScrollViewer.VerticalScrollBarVisibility="Disabled" | ||
HorizontalContentAlignment="Center"> | ||
<StackPanel Margin="10" HorizontalAlignment="Stretch"> | ||
<Label FontWeight="Bold">Pattern Name:</Label> | ||
<ComboBox x:Name="pat_name_cb" Height="25px" SelectionChanged="fill_pattern_changed"/> | ||
<DockPanel Margin="0,10,0,0" Height="250"> | ||
<controls:FillPatternViewerControl x:Name="fillpattern_control"/> | ||
</DockPanel> | ||
</StackPanel> | ||
</Window> |
31 changes: 31 additions & 0 deletions
31
...yRevitDev.tab/Debug.panel/Unit Tests.pulldown/Test FillPatternViewer.pushbutton/script.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pylint: disable=C0111,E0401,C0103,W0201,W0613 | ||
from pyrevit import revit, DB | ||
from pyrevit import forms | ||
from pyrevit import script | ||
|
||
|
||
logger = script.get_logger() | ||
output = script.get_output() | ||
|
||
|
||
class TestFillPatternViewer(forms.WPFWindow): | ||
def __init__(self, xaml_file_name): | ||
forms.WPFWindow.__init__(self, xaml_file_name) | ||
self.pat_name_cb.ItemsSource = \ | ||
sorted([x.GetFillPattern().Name | ||
for x in revit.query.get_all_fillpattern_elements( | ||
DB.FillPatternTarget.Drafting | ||
)]) | ||
self.pat_name_cb.SelectedIndex = 0 | ||
|
||
def fill_pattern_changed(self, sender, args): | ||
selected_fillpattern = \ | ||
revit.query.get_fillpattern_element( | ||
self.pat_name_cb.SelectedItem, | ||
DB.FillPatternTarget.Drafting | ||
).GetFillPattern() | ||
if selected_fillpattern: | ||
self.fillpattern_control.FillPattern = selected_fillpattern | ||
|
||
|
||
TestFillPatternViewer('TestFillPatternViewer.xaml').show(modal=True) |
Binary file added
BIN
+37.3 KB
...pyRevitDev.tab/Debug.panel/Unit Tests.pulldown/Test pyRevit Button.pushbutton/tooltip.mp4
Binary file not shown.
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
Binary file added
BIN
+2.38 KB
...ab/Debug.panel/Unit Tests.pulldown/pyRevitLabs Module Tests.pushbutton/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
Binary file removed
BIN
-1.11 KB
...itDevTools.extension/pyRevitDev.tab/Debug.panel/pyRevitLabs.pushbutton/icon.png
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"builtin": "True", | ||
"default_enabled": "False", | ||
"type": "extension", | ||
"rocket_mode_compatible": "True", | ||
"name": "pyRevitTemplates", | ||
"description": "Tools for maintaining Revit Templates", | ||
"author": "Ehsan Iran-Nejad", | ||
"author_profile": "https://keybase.io/ein", | ||
"url": "https://github.com/eirannejad/pyRevit.git", | ||
"website": "http://eirannejad.github.io/pyRevit/", | ||
"image": "", | ||
"dependencies": [] | ||
} |
File renamed without changes
69 changes: 69 additions & 0 deletions
69
...tab/Templates.panel/Template.pulldown/Generate FilledRegion Swatches.pushbutton/script.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
"""Generate filledregion swatches in active view.""" | ||
#pylint: disable=E0401,C0103 | ||
from pyrevit.framework import List | ||
from pyrevit import revit, DB | ||
|
||
|
||
MAX_WIDTH = 16 | ||
DIRECTION = 1 # OR -1 | ||
|
||
|
||
def make_title(base_point, fr_type): | ||
tnote_typeid = \ | ||
revit.doc.GetDefaultElementTypeId(DB.ElementTypeGroup.TextNoteType) | ||
DB.TextNote.Create(revit.doc, | ||
revit.activeview.Id, | ||
DB.XYZ(base_point.X, base_point.Y + 1, base_point.Z), | ||
1/12.0, | ||
revit.ElementWrapper(fr_type).name, | ||
tnote_typeid | ||
) | ||
|
||
|
||
def make_filledregion_element(base_point, fr_type): | ||
cloop = DB.CurveLoop() | ||
cloop.Append( | ||
DB.Line.CreateBound( | ||
DB.XYZ(base_point.X, base_point.Y, base_point.Z), | ||
DB.XYZ(base_point.X + 1, base_point.Y, base_point.Z) | ||
) | ||
) | ||
cloop.Append( | ||
DB.Line.CreateBound( | ||
DB.XYZ(base_point.X + 1, base_point.Y, base_point.Z), | ||
DB.XYZ(base_point.X + 1, base_point.Y + DIRECTION, base_point.Z) | ||
) | ||
) | ||
cloop.Append( | ||
DB.Line.CreateBound( | ||
DB.XYZ(base_point.X + 1, base_point.Y + DIRECTION, base_point.Z), | ||
DB.XYZ(base_point.X, base_point.Y + DIRECTION, base_point.Z) | ||
) | ||
) | ||
cloop.Append( | ||
DB.Line.CreateBound( | ||
DB.XYZ(base_point.X, base_point.Y + DIRECTION, base_point.Z), | ||
DB.XYZ(base_point.X, base_point.Y, base_point.Z) | ||
) | ||
) | ||
|
||
DB.FilledRegion.Create(revit.doc, | ||
fr_type.Id, | ||
revit.activeview.Id, | ||
List[DB.CurveLoop]([cloop])) | ||
|
||
|
||
def make_swatch(index, fr_type): | ||
row = 0 + (index / MAX_WIDTH) | ||
col = index - (MAX_WIDTH * row) | ||
base_point = DB.XYZ(col, row * DIRECTION, 0) | ||
make_title(base_point, fr_type) | ||
make_filledregion_element(base_point, fr_type) | ||
|
||
|
||
filledregion_types = revit.query.get_types_by_class(DB.FilledRegionType) | ||
with revit.Transaction('Generate FilledRegion Swatched'): | ||
for idx, filledregion_type in enumerate( | ||
sorted(filledregion_types, | ||
key=lambda x: revit.ElementWrapper(x).name)): | ||
make_swatch(idx, filledregion_type) |
Binary file added
BIN
+13.9 KB
...s.panel/Template.pulldown/Generate FilledRegion Swatches.pushbutton/tooltip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+961 Bytes
...ate.pulldown/Generate FilledRegion Types from Fill Patterns.pushbutton/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions
15
...nel/Template.pulldown/Generate FilledRegion Types from Fill Patterns.pushbutton/script.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
"""Generate FilledRegion Swatches""" | ||
#pylint: disable=E0401,C0103 | ||
from pyrevit import revit, DB | ||
|
||
|
||
fillpats = revit.query.get_types_by_class(DB.FillPatternElement) | ||
with revit.Transaction('Generate FilledRegion Types'): | ||
for fillpat in fillpats: | ||
if fillpat.Name.startswith('#'): | ||
print(fillpat.Name) | ||
filledregion_type = \ | ||
revit.create.create_filledregion(fillpat.Name, fillpat) | ||
filledregion_type.ForegroundPatternColor = DB.Color(128, 128, 128) | ||
filledregion_type.LineWeight = 1 | ||
filledregion_type.IsMasking = True |
Binary file added
BIN
+1.26 KB
...RevitTemplates.extension/pyRevit.tab/Templates.panel/Template.pulldown/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Templates[afterall:] |
Oops, something went wrong.