mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-08-17 10:59:05 +00:00
added Revit 2022 SDK minus except *rvt and *rfa
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
//
|
||||
// (C) Copyright 2003-2019 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using RApplication = Autodesk.Revit.ApplicationServices.Application;
|
||||
|
||||
namespace Revit.SDK.Samples.UIAPI.CS
|
||||
{
|
||||
public class AddTabCommand
|
||||
{
|
||||
|
||||
public AddTabCommand(UIControlledApplication application)
|
||||
{
|
||||
_application = application;
|
||||
}
|
||||
|
||||
public bool AddTabToOptionsDialog()
|
||||
{
|
||||
_application.DisplayingOptionsDialog +=
|
||||
new EventHandler<Autodesk.Revit.UI.Events.DisplayingOptionsDialogEventArgs>(Command_DisplayingOptionDialog);
|
||||
return true;
|
||||
}
|
||||
|
||||
void Command_DisplayingOptionDialog(object sender, Autodesk.Revit.UI.Events.DisplayingOptionsDialogEventArgs e)
|
||||
{
|
||||
// Actual options
|
||||
Revit.SDK.Samples.UIAPI.CS.OptionsDialog.Options optionsControl = new Revit.SDK.Samples.UIAPI.CS.OptionsDialog.Options();
|
||||
ContextualHelp ch = new ContextualHelp(ContextualHelpType.Url, "http://www.autodesk.com/");
|
||||
TabbedDialogExtension extension = new TabbedDialogExtension(optionsControl, optionsControl.OnOK);
|
||||
extension.OnRestoreDefaultsAction = optionsControl.OnRestoreDefaults;
|
||||
extension.SetContextualHelp(ch);
|
||||
e.AddTab("Demo options", extension);
|
||||
|
||||
// Demo options
|
||||
UserControl3 userControl3 = new UserControl3("Product Information");
|
||||
ContextualHelp ch3 = new ContextualHelp(ContextualHelpType.Url, "http://www.google.com/");
|
||||
TabbedDialogExtension tdext3 = new TabbedDialogExtension(userControl3,
|
||||
userControl3.OnOK);
|
||||
tdext3.OnCancelAction = userControl3.OnCancel;
|
||||
tdext3.OnRestoreDefaultsAction = userControl3.OnRestoreDefaults;
|
||||
tdext3.SetContextualHelp(ch);
|
||||
e.AddTab("Product Information", tdext3);
|
||||
|
||||
UserControl2 userControl2 = new UserControl2("Copy of SteeringWheels");
|
||||
TabbedDialogExtension tdext2 = new TabbedDialogExtension(userControl2,
|
||||
userControl2.OnOK);
|
||||
tdext2.OnCancelAction = userControl2.OnCancel;
|
||||
e.AddTab("SteeringWheels(Copy)", tdext2);
|
||||
|
||||
UserControl1 userControl1 = new UserControl1();
|
||||
ContextualHelp ch1 = new ContextualHelp(ContextualHelpType.Url, "http://www.google.com/");
|
||||
TabbedDialogExtension tdext1 = new TabbedDialogExtension(userControl1,
|
||||
userControl1.OnOK);
|
||||
tdext1.OnCancelAction = userControl1.OnCancel;
|
||||
tdext1.OnRestoreDefaultsAction = userControl1.OnRestoreDefaults;
|
||||
tdext1.SetContextualHelp(ch);
|
||||
e.AddTab("WPF components", tdext1);
|
||||
}
|
||||
|
||||
private UIControlledApplication _application = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<UserControl x:Class="Revit.SDK.Samples.UIAPI.CS.OptionsDialog.Options"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="512" d:DesignWidth="432">
|
||||
<Grid Background="White">
|
||||
<Border BorderBrush="Silver" BorderThickness="1" Height="90" HorizontalAlignment="Left" Margin="20,147,0,0" Name="border2" VerticalAlignment="Top" Width="389" Grid.Row="2">
|
||||
<ComboBox Height="23" Name="ButtonAccessibility" Width="120">
|
||||
<ComboBoxItem Content="Always available" IsSelected="True" />
|
||||
<ComboBoxItem Content="Architecture discipline only" />
|
||||
<ComboBoxItem Content="Structural analysis only" />
|
||||
<ComboBoxItem Content="MEP disciplines" />
|
||||
</ComboBox>
|
||||
</Border>
|
||||
<Label Content="Discipline checks (Autodesk Revit)" Height="28" HorizontalAlignment="Left" Margin="25,121,0,0" Name="label2" VerticalAlignment="Top" />
|
||||
<Label Content="Buttons available in:" Height="28" HorizontalAlignment="Right" Margin="0,147,24,0" Name="label3" VerticalAlignment="Top" Width="383" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Revit.SDK.Samples.UIAPI.CS.OptionsDialog
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for Options.xaml
|
||||
/// </summary>
|
||||
public partial class Options : UserControl
|
||||
{
|
||||
public Options()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Revit.SDK.Samples.UIAPI.CS.ApplicationOptions options = ApplicationOptions.Get();
|
||||
|
||||
|
||||
ButtonAccessibility.SelectedIndex = (int)options.Availability;
|
||||
}
|
||||
|
||||
public void OnOK()
|
||||
{
|
||||
Revit.SDK.Samples.UIAPI.CS.ApplicationOptions options = ApplicationOptions.Get();
|
||||
|
||||
options.Availability = (ApplicationAvailablity)ButtonAccessibility.SelectedIndex;
|
||||
|
||||
}
|
||||
|
||||
public void OnRestoreDefaults()
|
||||
{
|
||||
ButtonAccessibility.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
private bool GetCheckbuttonChecked(CheckBox checkBox)
|
||||
{
|
||||
if (checkBox.IsChecked.HasValue)
|
||||
return checkBox.IsChecked.Value;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<UserControl x:Class="Revit.SDK.Samples.UIAPI.CS.UserControl1"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="512" d:DesignWidth="432">
|
||||
<Grid Background="White">
|
||||
<GroupBox Header="Others" Height="488" HorizontalAlignment="Left" Margin="12,12,0,0" Name="groupBox1" VerticalAlignment="Top" Width="408">
|
||||
<StackPanel Height="462" Name="stackPanel1" Width="391">
|
||||
<Calendar Height="170" Name="calendar1" Width="180" />
|
||||
<DatePicker Height="25" Name="datePicker1" Width="115" />
|
||||
<DataGrid AutoGenerateColumns="False" Height="232" Margin="6,26,6,6" Name="dataGrid1" Width="374" ItemsSource="{Binding}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Name" Width="80" Binding="{Binding Name}"/>
|
||||
<DataGridTextColumn Header="Age" Width="50" Binding="{Binding Age}"/>
|
||||
<DataGridCheckBoxColumn Header="Pass Exam?" Width="100" Binding="{Binding Pass}"/>
|
||||
<DataGridHyperlinkColumn Header="Email" Width="150" Binding="{Binding Email}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using RApplication = Autodesk.Revit.ApplicationServices.Application;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace Revit.SDK.Samples.UIAPI.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for UserControl1.xaml
|
||||
/// </summary>
|
||||
public partial class UserControl1 : UserControl
|
||||
{
|
||||
|
||||
public UserControl1()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
ObservableCollection<Member> memberData = new ObservableCollection<Member>();
|
||||
memberData.Add(new Member(){Name = "Joe", Age = "23", Pass = true, Email = new Uri("mailto:Joe@school.com")});
|
||||
memberData.Add(new Member(){Name = "Mike", Age = "20",Pass = false,Email = new Uri("mailto:Mike@school.com")});
|
||||
memberData.Add(new Member(){Name = "Lucy", Age = "25",Pass = true,Email = new Uri("mailto:Lucy@school.com")});
|
||||
dataGrid1.DataContext = memberData;
|
||||
_name = "WPF components";
|
||||
}
|
||||
|
||||
private void onbtn_click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
TaskDialog.Show("Hello", _name);
|
||||
}
|
||||
|
||||
public void OnOK()
|
||||
{
|
||||
TaskDialog.Show("OK", _name);
|
||||
}
|
||||
|
||||
public void OnCancel()
|
||||
{
|
||||
TaskDialog.Show("OnCancel", _name);
|
||||
}
|
||||
|
||||
public void OnRestoreDefaults()
|
||||
{
|
||||
TaskDialog.Show("OnRestoreDefaults", _name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
String _name;
|
||||
}
|
||||
|
||||
public enum SexOpt { Male, Female };
|
||||
|
||||
public class Member
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Age { get; set; }
|
||||
public bool Pass { get; set; }
|
||||
public Uri Email { get; set; } }
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
<UserControl x:Class="Revit.SDK.Samples.UIAPI.CS.UserControl2"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="512" d:DesignWidth="432">
|
||||
<Grid Background="White">
|
||||
<StackPanel Height="512" Name="stackPanel1" VerticalAlignment="Top" HorizontalAlignment="Left" Width="432">
|
||||
<GroupBox Header="Text Visibility" Height="88" Name="groupBox1" Width="418">
|
||||
<Grid>
|
||||
<Grid Height="65" HorizontalAlignment="Left" Name="grid1" VerticalAlignment="Top" Width="406">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="27*" />
|
||||
<ColumnDefinition Width="383*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox Height="16" HorizontalAlignment="Left" Margin="6,6,0,0" Name="checkBox1" VerticalAlignment="Top" IsChecked="True" />
|
||||
<CheckBox Grid.ColumnSpan="1" Grid.Row="1" Grid.RowSpan="1" Height="16" HorizontalAlignment="Left" Margin="6,6,0,0" Name="checkBox2" VerticalAlignment="Top" IsChecked="True" />
|
||||
<CheckBox Grid.ColumnSpan="1" Grid.Row="2" Height="16" HorizontalAlignment="Left" Margin="6,6,0,0" Name="checkBox3" VerticalAlignment="Top" IsChecked="True" />
|
||||
<TextBlock Grid.Column="1" Grid.RowSpan="1" Height="23" HorizontalAlignment="Left" Margin="0,4,0,0" Name="textBlock1" Text="Show tool messages (always ON for basic wheels)" VerticalAlignment="Top" />
|
||||
<TextBlock Grid.Column="1" Grid.Row="1" Grid.RowSpan="1" Height="23" HorizontalAlignment="Left" Margin="0,4,0,0" Name="textBlock2" Text="Show tooltips (always ON for basic wheels)" VerticalAlignment="Top" />
|
||||
<TextBlock Grid.Column="1" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="0,4,0,0" Name="textBlock3" Text="Show tool cursor text (always ON for basic wheels)" VerticalAlignment="Top" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="Big Steering Wheel Appearance" Height="64" Name="groupBox2" Width="422">
|
||||
<Grid>
|
||||
<Grid Height="41" HorizontalAlignment="Left" Name="grid2" VerticalAlignment="Top" Width="410">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="102*" />
|
||||
<ColumnDefinition Width="134*" />
|
||||
<ColumnDefinition Width="113*" />
|
||||
<ColumnDefinition Width="60*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Height="22" HorizontalAlignment="Left" Margin="69,10,0,0" Name="textBlock4" Text="Size:" VerticalAlignment="Top" Width="33" />
|
||||
<ComboBox Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="1,10,0,0" Name="comboBox1" VerticalAlignment="Top" Width="133">
|
||||
<ComboBoxItem Content="Small" />
|
||||
<ComboBoxItem Content="Normal" IsSelected="True" />
|
||||
<ComboBoxItem Content="Large" />
|
||||
</ComboBox>
|
||||
<TextBlock Grid.Column="2" Height="25" HorizontalAlignment="Left" Margin="65,10,0,0" Name="textBlock5" Text="Opacity:" VerticalAlignment="Top" Width="48" />
|
||||
<ComboBox Grid.Column="3" Height="23" HorizontalAlignment="Left" Margin="0,8,0,0" Name="comboBox2" VerticalAlignment="Top" Width="54">
|
||||
<ComboBoxItem Content="25%" />
|
||||
<ComboBoxItem Content="50%" IsSelected="True" />
|
||||
<ComboBoxItem Content="75%" />
|
||||
<ComboBoxItem Content="90%" />
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="Mini Wheel Appearance" Height="64" Name="groupBox3" Width="422">
|
||||
<Grid>
|
||||
<Grid Height="41" HorizontalAlignment="Left" Name="grid3" VerticalAlignment="Top" Width="410">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="102*" />
|
||||
<ColumnDefinition Width="134*" />
|
||||
<ColumnDefinition Width="113*" />
|
||||
<ColumnDefinition Width="60*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Height="22" HorizontalAlignment="Left" Margin="69,10,0,0" Name="textBlock6" Text="Size:" VerticalAlignment="Top" Width="33" />
|
||||
<ComboBox Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="1,10,0,0" Name="comboBox3" VerticalAlignment="Top" Width="133">
|
||||
<ComboBoxItem Content="Small" />
|
||||
<ComboBoxItem Content="Normal" IsSelected="True" />
|
||||
<ComboBoxItem Content="Large" />
|
||||
</ComboBox>
|
||||
<TextBlock Grid.Column="2" Height="25" HorizontalAlignment="Left" Margin="65,10,0,0" Name="textBlock7" Text="Opacity:" VerticalAlignment="Top" Width="48" />
|
||||
<ComboBox Grid.Column="3" Height="23" HorizontalAlignment="Left" Margin="0,8,0,0" Name="comboBox4" VerticalAlignment="Top" Width="54">
|
||||
<ComboBoxItem Content="25%" />
|
||||
<ComboBoxItem Content="50%" IsSelected="True" />
|
||||
<ComboBoxItem Content="75%" />
|
||||
<ComboBoxItem Content="90%" />
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="Look Tool Behavior" Height="64" Name="groupBox4" Width="422">
|
||||
<Grid>
|
||||
<Grid Height="41" HorizontalAlignment="Left" Name="grid4" VerticalAlignment="Top" Width="410">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="29*" />
|
||||
<ColumnDefinition Width="381*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox Grid.ColumnSpan="2" Height="16" HorizontalAlignment="Left" Margin="8,14,0,0" Name="checkBox4" VerticalAlignment="Top" />
|
||||
<TextBlock Grid.Column="1" Height="30" HorizontalAlignment="Left" Margin="0,12,0,0" Name="textBlock8" Text="Invert vertical axis (Pull mouse back to look up)" VerticalAlignment="Top" Width="321" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="Walk Tool" Height="102" Name="groupBox5" Width="422">
|
||||
<Grid>
|
||||
<Grid Height="79" HorizontalAlignment="Left" Name="grid5" VerticalAlignment="Top" Width="410" Visibility="Visible">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="55*" />
|
||||
<ColumnDefinition Width="26*" />
|
||||
<ColumnDefinition Width="236*" />
|
||||
<ColumnDefinition Width="33" />
|
||||
<ColumnDefinition Width="60*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox Height="16" HorizontalAlignment="Left" Margin="6,6,0,0" Name="checkBox5" VerticalAlignment="Top" IsChecked="True" />
|
||||
<TextBlock Grid.Column="1" Grid.ColumnSpan="3" Height="26" HorizontalAlignment="Left" Margin="0,4,0,0" Name="textBlock9" Text="Move parallel to ground plane" VerticalAlignment="Top" Width="321" />
|
||||
<TextBlock Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="1" Height="27" HorizontalAlignment="Left" Name="textBlock10" Text="Speed Factor:" VerticalAlignment="Top" Width="321" />
|
||||
<Slider Grid.Column="2" Grid.Row="2" Height="26" HorizontalAlignment="Left" Margin="1,0,0,0" Name="slider1" VerticalAlignment="Top" Width="229" />
|
||||
<TextBlock Grid.Column="1" Grid.Row="2" Height="26" HorizontalAlignment="Left" Margin ="1,6,0,0" Name="textBlock11" Text="0.1" VerticalAlignment="Center" Width="47" />
|
||||
<TextBlock Grid.Column="3" Grid.Row="2" Height="23" HorizontalAlignment="Left" Name="textBlock12" Text="10.0" VerticalAlignment="Center" Margin="0,3,0,0" />
|
||||
<TextBox Grid.Column="4" Grid.Row="2" Height="20" HorizontalAlignment="Left" Margin="3,0,0,0" Name="textBox1" VerticalAlignment="Top" Width="41" Text="3" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="Zoom Tool" Height="64" Name="groupBox6" Width="422">
|
||||
<Grid>
|
||||
<Grid Height="41" HorizontalAlignment="Left" Name="grid6" VerticalAlignment="Top" Width="410">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="29*" />
|
||||
<ColumnDefinition Width="381*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox Grid.ColumnSpan="2" Height="16" HorizontalAlignment="Left" Margin="8,14,0,0" Name="checkBox6" VerticalAlignment="Top" />
|
||||
<TextBlock Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="0,12,0,0" Name="textBlock13" Text="Zoom in one increment with each mouse click " VerticalAlignment="Top" Width="381" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="Orbit Tool" Height="64" Name="groupBox7" Width="422">
|
||||
<Grid>
|
||||
<Grid Height="41" HorizontalAlignment="Left" Name="grid7" VerticalAlignment="Top" Width="410">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="29*" />
|
||||
<ColumnDefinition Width="381*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox Grid.ColumnSpan="2" Height="16" HorizontalAlignment="Left" Margin="8,14,0,0" Name="checkBox7" VerticalAlignment="Top" IsChecked="True" />
|
||||
<TextBlock Grid.Column="1" Height="30" HorizontalAlignment="Left" Margin="0,12,0,0" Name="textBlock14" Text="Keep scene upright" VerticalAlignment="Top" Width="321" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using RApplication = Autodesk.Revit.ApplicationServices.Application;
|
||||
|
||||
namespace Revit.SDK.Samples.UIAPI.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for UserControl2.xaml
|
||||
/// </summary>
|
||||
public partial class UserControl2 : UserControl
|
||||
{
|
||||
public UserControl2(String name)
|
||||
{
|
||||
InitializeComponent();
|
||||
_name = name;
|
||||
}
|
||||
|
||||
private void onbtn_click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
TaskDialog.Show("Hello", _name);
|
||||
}
|
||||
|
||||
public void OnOK()
|
||||
{
|
||||
TaskDialog.Show("OK", _name);
|
||||
}
|
||||
|
||||
public void OnCancel()
|
||||
{
|
||||
TaskDialog.Show("OnCancel", _name);
|
||||
}
|
||||
|
||||
public void OnRestoreDefaults()
|
||||
{
|
||||
TaskDialog.Show("OnRestoreDefaults", _name);
|
||||
}
|
||||
|
||||
String _name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<UserControl x:Class="Revit.SDK.Samples.UIAPI.CS.UserControl3"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="512" d:DesignWidth="432">
|
||||
<Grid Background="White">
|
||||
<GroupBox Header="Product Information" Height="512" HorizontalAlignment="Left" Name="groupBox1" VerticalAlignment="Top" Width="432">
|
||||
<Grid>
|
||||
<Grid Height="489" HorizontalAlignment="Left" Name="grid1" VerticalAlignment="Top" Width="420">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Image Height="230" HorizontalAlignment="Left" Margin="6,6,0,0" Name="image1" VerticalAlignment="Top" Width="408" Source="/TestCases;component/Images/autodesk.jpg" />
|
||||
<RichTextBox Grid.Row="1" Height="230" HorizontalAlignment="Left" Margin="6,10,0,0" Name="richTextBox1" VerticalAlignment="Top" Width="408" >
|
||||
<FlowDocument>
|
||||
<Paragraph>
|
||||
<Bold>Copyright © 2012 Autodesk, Inc. All Rights Reserved.</Bold>
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
All use of this Software is subject to the terms and conditions of the Autodesk End User License Agreement accepted upon installation of this Software and/or packaged with the Software.
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
<Bold>Trademarks</Bold>
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
Autodesk, AutoCAD, Buzzsaw, DWF, DWG, DWG TrueView, DXF, FBX, Freewheel, Heidi, Hoops, Revit, ShowMotion, SteeringWheels and ViewCube are either registered trademarks or trademarks of Autodesk, Inc., and/or its subsidiaries and/or affiliates.
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
Python is a registered trademark of Python Software Foundation.
|
||||
</Paragraph>
|
||||
<Paragraph>
|
||||
ACE™, TAO™, CIAO™, and CoSMIC™ are copyrighted by Douglas C. Schmidt and his research group at Washington University, University of California, Irvine, and Vanderbilt University, Copyright (c) 1993-2009, all rights reserved.
|
||||
</Paragraph>
|
||||
</FlowDocument>
|
||||
</RichTextBox>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using RApplication = Autodesk.Revit.ApplicationServices.Application;
|
||||
using System.Windows.Interop;
|
||||
|
||||
|
||||
namespace Revit.SDK.Samples.UIAPI.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for UserControl3.xaml
|
||||
/// </summary>
|
||||
public partial class UserControl3 : UserControl
|
||||
{
|
||||
public UserControl3(String name)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_name = name;
|
||||
|
||||
this.image1.Source = getBitmapAsImageSource(Revit.SDK.Samples.UIAPI.CS.Properties.Resources.autodesk);
|
||||
}
|
||||
|
||||
public static ImageSource getBitmapAsImageSource(System.Drawing.Bitmap bitmap)
|
||||
{
|
||||
IntPtr hBitmap = bitmap.GetHbitmap();
|
||||
return Imaging.CreateBitmapSourceFromHBitmap(hBitmap, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
|
||||
}
|
||||
|
||||
public void OnOK()
|
||||
{
|
||||
TaskDialog.Show("OK", _name);
|
||||
}
|
||||
|
||||
public void OnCancel()
|
||||
{
|
||||
TaskDialog.Show("OnCancel", _name);
|
||||
}
|
||||
|
||||
public void OnRestoreDefaults()
|
||||
{
|
||||
TaskDialog.Show("OnRestoreDefaults", _name);
|
||||
}
|
||||
|
||||
String _name;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user