Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3fd7cff
commit 83ac2f1
Showing
17 changed files
with
294 additions
and
27 deletions.
There are no files selected for viewing
Empty file.
34 changes: 34 additions & 0 deletions
34
pyRevitMEP.tab/Tools.panel/Element3DRotation.pushbutton/RotateOptions.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,34 @@ | ||
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
Title="Set rotation angle:" Height="500" Width="500" ShowInTaskbar="False" | ||
WindowStartupLocation="CenterScreen" ScrollViewer.VerticalScrollBarVisibility="Disabled" HorizontalContentAlignment="Center"> | ||
<StackPanel Margin="20" HorizontalAlignment="Stretch"> | ||
<DockPanel> | ||
<GroupBox Header="Rotate on itself:" Margin="0,0,10,0"> | ||
<StackPanel Margin="10"> | ||
<Image x:Name="xyz_img" Width="100" Margin="0,10"/> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="50" /> | ||
<ColumnDefinition Width="50" /> | ||
<ColumnDefinition Width="50" /> | ||
</Grid.ColumnDefinitions> | ||
|
||
<TextBlock Text="X Axis" Grid.Column="0" HorizontalAlignment="Center" FontWeight="Bold" Foreground="#f00"/> | ||
<TextBlock Text="Y Axis" Grid.Column="1" HorizontalAlignment="Center" FontWeight="Bold" Foreground="#0f0"/> | ||
<TextBlock Text="Z Axis" Grid.Column="2" HorizontalAlignment="Center" FontWeight="Bold" Foreground="#00f"/> | ||
<TextBox x:Name="x_axis" Text="0" Width="30" Height="30" Grid.Column="0" Margin="0,20,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" /> | ||
<TextBox x:Name="y_axis" Text="0" Width="30" Height="30" Grid.Column="1" Margin="0,20,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" /> | ||
<TextBox x:Name="z_axis" Text="0" Width="30" Height="30" Grid.Column="2" Margin="0,20,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" /> | ||
</Grid> | ||
<TextBlock x:Name="warning" Text="" Width="150" HorizontalAlignment="Left" Foreground="#f00" TextWrapping="WrapWithOverflow" /> | ||
<Button Content="Go" Height="30" Margin="10,10" Click="around_itself_click"/> | ||
</StackPanel> | ||
</GroupBox> | ||
<GroupBox Header="Rotate around selected axis:"> | ||
<StackPanel Margin="20"> | ||
</StackPanel> | ||
</GroupBox> | ||
</DockPanel> | ||
</StackPanel> | ||
</Window> |
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
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions
43
pyRevitMEP.tab/Tools.panel/FamilyDelete.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,43 @@ | ||
""" | ||
Copyright (c) 2017 Cyril Waechter | ||
Python scripts for Autodesk Revit | ||
This file is part of pyRevitMEP repository at https://github.com/CyrilWaechter/pyRevitMEP | ||
pyRevitMEP is an extension for pyRevit. It contain free set of scripts for Autodesk Revit: | ||
you can redistribute it and/or modify it under the terms of the GNU General Public License | ||
version 3, as published by the Free Software Foundation. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
See this link for a copy of the GNU General Public License protecting this package. | ||
https://github.com/CyrilWaechter/pyRevitMEP/blob/master/LICENSE | ||
""" | ||
from revitutils import doc, selection | ||
|
||
# noinspection PyUnresolvedReferences | ||
from Autodesk.Revit.DB import Transaction, FamilySymbol | ||
|
||
__doc__ = "Delete selected families from project" | ||
__title__ = "Family delete" | ||
__author__ = "Cyril Waechter" | ||
|
||
t = Transaction(doc, "Delete families from project") | ||
t.Start() | ||
|
||
try: | ||
# Find families of selected object and delete it | ||
for el in selection.elements: | ||
family_id = el.Symbol.Family.Id | ||
doc.Delete(family_id) | ||
|
||
except: # print a stack trace and error messages for debugging | ||
import traceback | ||
traceback.print_exc() | ||
t.RollBack() | ||
|
||
else: | ||
t.Commit() |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions
44
pyRevitMEP.tab/Tools.panel/FamilyTypeDelete.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,44 @@ | ||
""" | ||
Copyright (c) 2017 Cyril Waechter | ||
Python scripts for Autodesk Revit | ||
This file is part of pyRevitMEP repository at https://github.com/CyrilWaechter/pyRevitMEP | ||
pyRevitMEP is an extension for pyRevit. It contain free set of scripts for Autodesk Revit: | ||
you can redistribute it and/or modify it under the terms of the GNU General Public License | ||
version 3, as published by the Free Software Foundation. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
See this link for a copy of the GNU General Public License protecting this package. | ||
https://github.com/CyrilWaechter/pyRevitMEP/blob/master/LICENSE | ||
""" | ||
|
||
from revitutils import doc, selection | ||
|
||
# noinspection PyUnresolvedReferences | ||
from Autodesk.Revit.DB import Transaction, FamilySymbol | ||
|
||
__doc__ = "Delete selected families from project" | ||
__title__ = "Familytype delete" | ||
__author__ = "Cyril Waechter" | ||
|
||
t = Transaction(doc, "Delete families from project") | ||
t.Start() | ||
|
||
try: | ||
# Find families of selected object and delete it | ||
for el in selection.elements: | ||
familytype_id = el.GetTypeId() | ||
doc.Delete(familytype_id) | ||
|
||
except: # print a stack trace and error messages for debugging | ||
import traceback | ||
traceback.print_exc() | ||
t.RollBack() | ||
|
||
else: | ||
t.Commit() |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions
45
pyRevitMEP.tab/Tools.panel/ParameterDelete.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,45 @@ | ||
""" | ||
Copyright (c) 2017 Cyril Waechter | ||
Python scripts for Autodesk Revit | ||
This file is part of pyRevitMEP repository at https://github.com/CyrilWaechter/pyRevitMEP | ||
pyRevitMEP is an extension for pyRevit. It contain free set of scripts for Autodesk Revit: | ||
you can redistribute it and/or modify it under the terms of the GNU General Public License | ||
version 3, as published by the Free Software Foundation. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
See this link for a copy of the GNU General Public License protecting this package. | ||
https://github.com/CyrilWaechter/pyRevitMEP/blob/master/LICENSE | ||
""" | ||
|
||
from revitutils import doc | ||
|
||
# noinspection PyUnresolvedReferences | ||
from Autodesk.Revit.DB import Transaction, FilteredElementCollector, ParameterElement | ||
|
||
__doc__ = "Delete project parameters including hidden ones" | ||
__title__ = "Project Parameter delete" | ||
__author__ = "Cyril Waechter" | ||
|
||
#Retrieve all parameters in the document | ||
params = FilteredElementCollector(doc).OfClass(ParameterElement) | ||
filteredparams = [] | ||
|
||
#Store parameters which has a name starting with "magi" or "MC" | ||
for param in params: | ||
if param.Name.startswith(("magi", "MC")): #startswith method accept tuple | ||
filteredparams.append(param) | ||
print param.Name | ||
|
||
#Delete all parameters in the list | ||
t = Transaction(doc, "Delete parameters") | ||
t.Start() | ||
for param in filteredparams: | ||
doc.Delete(param.Id) | ||
t.Commit() | ||
|
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions
65
pyRevitMEP.tab/Tools.panel/ViewTypeCopy.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,65 @@ | ||
""" | ||
Copyright (c) 2017 Cyril Waechter | ||
Python scripts for Autodesk Revit | ||
This file is part of pyRevitMEP repository at https://github.com/CyrilWaechter/pyRevitMEP | ||
pyRevitMEP is an extension for pyRevit. It contain free set of scripts for Autodesk Revit: | ||
you can redistribute it and/or modify it under the terms of the GNU General Public License | ||
version 3, as published by the Free Software Foundation. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
See this link for a copy of the GNU General Public License protecting this package. | ||
https://github.com/CyrilWaechter/pyRevitMEP/blob/master/LICENSE | ||
""" | ||
from revitutils import doc, selection | ||
|
||
# noinspection PyUnresolvedReferences | ||
from Autodesk.Revit.DB import Transaction, Element, BuiltInParameter | ||
# noinspection PyUnresolvedReferences | ||
from Autodesk.Revit import Exceptions | ||
|
||
__doc__ = "Copy view types" | ||
__title__ = "Copy view type" | ||
__author__ = "Cyril Waechter" | ||
|
||
try: | ||
t = Transaction(doc, "Rename views") | ||
t.Start() | ||
for view in selection.elements: # Loop trough selected views | ||
view_typeid = doc.GetElement(view.GetTypeId()) # Get ViewFamilyType Id | ||
view_typename = Element.Name.GetValue(view_typeid) # Get ViewFamilyType Name | ||
|
||
# Get Scope Box name if it exist | ||
try: | ||
view_scopebox = view.get_Parameter(BuiltInParameter.VIEWER_VOLUME_OF_INTEREST_CROP) | ||
view_scopebox_name = "" if view_scopebox.Value() is None else "_" + view_scopebox.AsValueString() | ||
except AttributeError: | ||
view_scopebox_name = "" | ||
|
||
# Get view reference level if it exist | ||
view_genlevel = "" if view.GenLevel is None else view.GenLevel.Name | ||
|
||
# Future view name | ||
view_name = "{c}_{a}{b}".format(a=view_genlevel, b=view_scopebox_name, c=view_typename, ) | ||
|
||
# Rename view | ||
i = 0 | ||
while True: | ||
try: | ||
view.Name = view_name if i == 0 else view_name + str(i) | ||
except Exceptions.ArgumentException: | ||
i += 1 | ||
except: | ||
raise | ||
else: | ||
break | ||
t.Commit() | ||
except: # print a stack trace and error messages for debugging | ||
import traceback | ||
traceback.print_exc() | ||
t.RollBack() |
Empty file.
Empty file.