Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roomhelper #5

Merged
merged 11 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import revitron
import pyrevit
from qualitron import AreaHelperManager,AreaHelperWindow
from qualitron import AreasHelperManager, AreasHelperWindow
import Autodesk.Revit.UI as ui

if __name__ == "__main__":
Expand All @@ -11,9 +11,8 @@
selection = revitron.Selection.get()
runWindow = True

# Select areas function
if selection:
areaIds = AreaHelperManager.selectAreas(selection)
areaIds = AreasHelperManager.selectTargets(selection,'AreasHelper_')
if areaIds:
count = str(len(areaIds))
decide = ui.TaskDialog.Show("AreaHelper","Select " + count + " area(s)?",
Expand All @@ -24,12 +23,11 @@
runWindow = False
revitron.Selection.set(areaIds)

# If no selection, show window
if runWindow:
revitron.DOC.MassDisplayTemporaryOverride = revitron.DB\
.MassDisplayTemporaryOverrideType\
.ShowMassFormAndFloors
main = AreaHelperWindow(xamlfile,
AreaHelperManager())
main = AreasHelperWindow(xamlfile,
AreasHelperManager())
main.Show()

Binary file not shown.
Binary file modified Revitron.tab/Qualitron.panel/AreaHelper.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.
78 changes: 40 additions & 38 deletions Revitron.tab/Qualitron.panel/AreaHelper.pushbutton/ui.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,27 +92,29 @@

<StackPanel>

<DockPanel Margin="10,30,10,10">
<Label Content="Area Scheme: "
Foreground="White"
HorizontalAlignment="Left"/>
<ComboBox Name="combo_scheme"
SelectedIndex="0"
Width="150"
HorizontalAlignment="Right"
SelectionChanged="comboSchemeChanged"/>
</DockPanel>

<DockPanel Margin="10">
<Label Content="Level: "
HorizontalAlignment="Left"
Foreground="White"/>
<ComboBox Name="combo_level"
SelectedIndex="0"
Width="150"
HorizontalAlignment="Right"
SelectionChanged="comboLevelChanged"/>
</DockPanel>
<StackPanel Name="comboPanel">
<DockPanel Margin="10,30,10,10">
<Label Content="Area Scheme: "
Foreground="White"
HorizontalAlignment="Left"/>
<ComboBox Name="combo_scheme"
SelectedIndex="0"
Width="150"
HorizontalAlignment="Right"
SelectionChanged="comboSchemeChanged"/>
</DockPanel>

<DockPanel Margin="10">
<Label Content="Level: "
HorizontalAlignment="Left"
Foreground="White"/>
<ComboBox Name="combo_level"
SelectedIndex="0"
Width="150"
HorizontalAlignment="Right"
SelectionChanged="comboLevelChanged"/>
</DockPanel>
</StackPanel>

<Grid Margin="30">
<Grid.ColumnDefinitions>
Expand All @@ -121,23 +123,23 @@
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>

<Button
Name="button_refresh" Grid.Column="1" Style="{StaticResource PressButton}"
Width="95" Height="95" Click="refreshClicked"
/>

<Button
Name="button_bake" Grid.Column="2" Style="{StaticResource PressButton}"
HorizontalAlignment="Left" VerticalAlignment="Bottom"
Width="50" Height="50" Click="bakeClicked"
/>

<Button
Name="button_close" Grid.Column="0" Style="{StaticResource PressButton}"
HorizontalAlignment="Right" VerticalAlignment="Bottom"
Width="50" Height="50" Click="closeClicked"
Content="Close"
/>
<Button
Name="button_refresh" Grid.Column="1" Style="{StaticResource PressButton}"
Width="95" Height="95" Click="refreshClicked"
/>

<Button
Name="button_bake" Grid.Column="2" Style="{StaticResource PressButton}"
HorizontalAlignment="Left" VerticalAlignment="Bottom"
Width="50" Height="50" Click="bakeClicked"
/>

<Button
Name="button_close" Grid.Column="0" Style="{StaticResource PressButton}"
HorizontalAlignment="Right" VerticalAlignment="Bottom"
Width="50" Height="50" Click="closeClicked"
Content="Close"
/>

</Grid>

Expand Down
12 changes: 12 additions & 0 deletions Revitron.tab/Qualitron.panel/Check3D.pushbutton/Check3D_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from qualitron import View3DChecker


if __name__ == "__main__":
try:
View3DChecker.create()
except:
import traceback
print(traceback.format_exc())



Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-

import revitron
import pyrevit
from qualitron import RoomsHelperManager, RoomsHelperWindow
import Autodesk.Revit.UI as ui

if __name__ == "__main__":

xamlfile = pyrevit.script.get_bundle_file("ui.xaml")
selection = revitron.Selection.get()
runWindow = True

if selection:
areaIds = RoomsHelperManager.selectTargets(selection,'RoomsHelper_')
if areaIds:
count = str(len(areaIds))
decide = ui.TaskDialog.Show("RoomsHelper","Select " + count + " room(s)?",
ui.TaskDialogCommonButtons.Yes|
ui.TaskDialogCommonButtons.No
)
if decide == ui.TaskDialogResult.Yes:
runWindow = False
revitron.Selection.set(areaIds)

if runWindow:
revitron.DOC.MassDisplayTemporaryOverride = revitron.DB\
.MassDisplayTemporaryOverrideType\
.ShowMassFormAndFloors
main = RoomsHelperWindow(xamlfile,
RoomsHelperManager())
main.Show()

Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
192 changes: 192 additions & 0 deletions Revitron.tab/Qualitron.panel/RoomHelper.pushbutton/ui.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Rooms Helper"
SizeToContent="WidthAndHeight" ResizeMode="NoResize"
WindowStartupLocation="Manual"
ShowInTaskbar="False"
Closing="windowClosing"
Topmost="True"
WindowStyle="None"
Background="#00FFFFFF"
AllowsTransparency="True">

<Window.Resources>
<Style x:Key="PressButton" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid>
<Ellipse>
<Ellipse.Style>
<Style TargetType="Ellipse">
<Style.Triggers>

<DataTrigger
Binding="{Binding Content,
RelativeSource={RelativeSource AncestorType=Button}}"
Value="Purge"
>
<Setter
Property="Fill"
Value="PaleVioletRed"/>
</DataTrigger>

<DataTrigger
Binding="{Binding Content,
RelativeSource={RelativeSource AncestorType=Button}}"
Value="Visualize"
>
<Setter
Property="Fill"
Value="LightSeaGreen"/>
</DataTrigger>

<DataTrigger
Binding="{Binding Content,
RelativeSource={RelativeSource AncestorType=Button}}"
Value="Bake"
>
<Setter
Property="Fill"
Value="LightGray"/>
</DataTrigger>

<DataTrigger
Binding="{Binding Content,
RelativeSource={RelativeSource AncestorType=Button}}"
Value=""
>
<Setter
Property="Fill"
Value="#1c2630"/>
</DataTrigger>

<DataTrigger
Binding="{Binding Content,
RelativeSource={RelativeSource AncestorType=Button}}"
Value="Close"
>
<Setter
Property="Fill"
Value="LightGray"/>
</DataTrigger>

</Style.Triggers>
</Style>
</Ellipse.Style>
</Ellipse>
<ContentPresenter
Focusable="False"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
<Label
Name="label_refresh"
FontSize="10"
Content = "{Binding Tag,
RelativeSource={RelativeSource AncestorType=Button}}"
Opacity="0.5"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Padding="0,30,0,0"
Focusable="False"
/>
</Grid>

<ControlTemplate.Triggers>
<Trigger
Property="IsMouseOver"
Value="True">
<Setter
Property="Opacity"
Value="0.7"/>
</Trigger>
<Trigger
Property="IsPressed"
Value="True">
<Setter
Property="Opacity"
Value="1"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Border CornerRadius="15"
Background="#23303d"
Margin="20"
BorderBrush="#66ffffff"
BorderThickness="1"
MouseLeftButtonDown="dragWindow"
UseLayoutRounding="True">
<Border.Effect>
<DropShadowEffect
Color="{DynamicResource pyRevitDarkColor}"
BlurRadius="15"
Opacity="0.25"/>
</Border.Effect>

<StackPanel Margin="0,30,0,0">

<StackPanel Name="comboPanel">
<DockPanel Margin="10">
<Label Content="Level: "
HorizontalAlignment="Left"
Foreground="White"/>
<ComboBox Name="combo_level"
SelectedIndex="0"
Width="150"
HorizontalAlignment="Right"
SelectionChanged="comboLevelChanged"/>
</DockPanel>
</StackPanel>

<Grid Margin="30">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="95"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button
Name="button_refresh"
Grid.Column="1"
Style="{StaticResource PressButton}"
Width="95"
Height="95"
Click="refreshClicked"
/>

<Button
Name="button_bake"
Grid.Column="2"
Style="{StaticResource PressButton}"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Width="50"
Height="50"
Click="bakeClicked"
/>

<Button
Name="button_close"
Grid.Column="0"
Style="{StaticResource PressButton}"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Width="50"
Height="50"
Click="closeClicked"
Content="Close"
/>
</Grid>

</StackPanel>
</Border>
</Window>






4 changes: 3 additions & 1 deletion Revitron.tab/Qualitron.panel/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ layout:
- Settings[title:Settings]
- Visualize[title:Visualize]
- Clear[title:Clear Colors]
- AreaHelper[title:Area Helper]
- AreaHelper[title:Areas Helper]
- RoomHelper[title:Rooms Helper]
- Check3D[title:Check 3D]
2 changes: 1 addition & 1 deletion lib/qualitron/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
from qualitron.colors import *
from qualitron.providers import *
from qualitron.analyze import *
from qualitron.areas import *
from qualitron.spaces import *
from qualitron.event import *
Loading
Loading