removed Revit 2021 SDK contents

This commit is contained in:
Jeremy Tammik
2021-04-20 11:25:53 +02:00
parent 68771b6636
commit 1133a82dc5
2969 changed files with 0 additions and 940446 deletions
@@ -1,54 +0,0 @@
//
// (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.UI;
using Autodesk.Revit.ApplicationServices;
namespace Revit.SDK.Samples.UIAPI.CS
{
class ApplicationAvailabilityClass : IExternalCommandAvailability
{
public bool IsCommandAvailable(UIApplication applicationData,
Autodesk.Revit.DB.CategorySet selectedCategories)
{
Application revitApplication = applicationData.Application;
ApplicationOptions options = ApplicationOptions.Get();
switch (options.Availability)
{
case ApplicationAvailablity.ArchitectureDiscipline:
return revitApplication.IsArchitectureEnabled;
case ApplicationAvailablity.StructuralAnalysis:
return revitApplication.IsStructuralAnalysisEnabled;
case ApplicationAvailablity.MEP:
return revitApplication.IsSystemsEnabled;
}
return true;
}
}
}
@@ -1,67 +0,0 @@
//
// (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.UI;
namespace Revit.SDK.Samples.UIAPI.CS
{
public enum ApplicationAvailablity
{
Always,
ArchitectureDiscipline,
StructuralAnalysis,
MEP
}
public class ApplicationOptions
{
public ApplicationAvailablity Availability { get; set; }
public static void Initialize(ExternalApp application)
{
s_options = new ApplicationOptions();
s_options.m_eApplication = application;
}
public static ApplicationOptions Get()
{
if (s_options == null)
throw new Exception("Static options was not initialized");
return s_options;
}
private static ApplicationOptions s_options = null;
private ExternalApp m_eApplication;
private ApplicationOptions()
{
Availability = ApplicationAvailablity.Always;
}
}
}
-103
View File
@@ -1,103 +0,0 @@
namespace Revit.SDK.Samples.UIAPI.CS
{
partial class FurnitureFamilyDragAndDropForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("Content 1");
System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem("Content 2");
this.listView1 = new System.Windows.Forms.ListView();
this.listBox1 = new System.Windows.Forms.ListBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// listView1
//
this.listView1.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
listViewItem1,
listViewItem2});
this.listView1.Location = new System.Drawing.Point(12, 38);
this.listView1.MultiSelect = false;
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(729, 380);
this.listView1.TabIndex = 1;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.listView_MouseMove);
//
// listBox1
//
this.listBox1.FormattingEnabled = true;
this.listBox1.Location = new System.Drawing.Point(757, 38);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(216, 381);
this.listBox1.TabIndex = 2;
this.listBox1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.listBox1_MouseMove);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 13);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(153, 13);
this.label1.TabIndex = 3;
this.label1.Text = "Loaded furniture family symbols";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(757, 13);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(132, 13);
this.label2.TabIndex = 4;
this.label2.Text = "Load new furniture families";
//
// FurnitureFamilyDragAndDropForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1004, 430);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.listBox1);
this.Controls.Add(this.listView1);
this.Name = "FurnitureFamilyDragAndDropForm";
this.Text = "DragAndDrop";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FurnitureFamilyDragAndDropForm_FormClosed);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
}
}
@@ -1,211 +0,0 @@
//
// (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.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Forms;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
namespace Revit.SDK.Samples.UIAPI.CS
{
public partial class FurnitureFamilyDragAndDropForm : System.Windows.Forms.Form
{
public static BuiltInCategory FamilyCategory
{
get
{
return BuiltInCategory.OST_Furniture;
}
}
private static FurnitureFamilyDragAndDropForm s_form;
public static FurnitureFamilyDragAndDropForm GetTheForm(Document document)
{
if (s_form == null)
{
s_form = new FurnitureFamilyDragAndDropForm(document);
}
s_form.UpdateLoadedFamilies();
return s_form;
}
/// <summary>
/// Display class for the external family file listbox.
/// </summary>
private class FamilyListBoxMember
{
public string FullPath;
public string Name;
public FamilyListBoxMember(string fullPath, string name)
{
FullPath = fullPath;
Name = name;
}
public override String ToString()
{
return Name;
}
}
private Document m_document;
/// <summary>
/// Construct and populate the form.
/// </summary>
/// <param name="document"></param>
private FurnitureFamilyDragAndDropForm(Document document)
{
InitializeComponent();
m_document = document;
UpdateFamilyFileList();
}
private void UpdateFamilyFileList()
{
// Visit each Revit library looking for Furniture families
IDictionary<String, String> libraryPaths = m_document.Application.GetLibraryPaths();
foreach (String libraryPath in libraryPaths.Values)
{
foreach (String directory in System.IO.Directory.EnumerateDirectories(libraryPath, "*Furniture", SearchOption.AllDirectories))
{
foreach (String familyFile in System.IO.Directory.EnumerateFiles(directory, "*.rfa", SearchOption.AllDirectories))
{
// Add each Furniture family to the listbox
String fileName = Path.GetFileName(familyFile);
FamilyListBoxMember member = new FamilyListBoxMember(familyFile, fileName);
listBox1.Items.Add(member);
}
}
}
}
private void UpdateLoadedFamilies()
{
ListView.ListViewItemCollection collection = listView1.Items;
collection.Clear();
// Setup list view with loaded families
ImageList imageList = new ImageList();
Size size = new Size(50, 50);
imageList.ImageSize = size;
FilteredElementCollector collector = new FilteredElementCollector(m_document);
collector.OfCategory(FamilyCategory);
collector.OfClass(typeof(FamilySymbol));
foreach (FamilySymbol familySymbol in collector.Cast<FamilySymbol>())
{
ListViewItem item = new ListViewItem();
item.Tag = familySymbol.Id;
item.Text = familySymbol.Family.Name + "::" + familySymbol.Name;
item.ToolTipText = "Drag to place instances of " + item.Text + " in the active document.";
Bitmap bitmap = familySymbol.GetPreviewImage(size);
if (bitmap != null)
{
imageList.Images.Add(bitmap);
int index = imageList.Images.Count - 1;
item.ImageIndex = index;
}
collection.Add(item);
}
listView1.LargeImageList = imageList;
}
// Drag action from list view
private void listView_MouseMove(object sender, MouseEventArgs e)
{
if (System.Windows.Forms.Control.MouseButtons == MouseButtons.Left)
{
ListViewItem selectedItem = this.listView1.SelectedItems.Cast<ListViewItem>().FirstOrDefault<ListViewItem>();
if (selectedItem != null)
{
// Use custom Revit drag and drop behavior
LoadedFamilyDropHandler myhanlder = new LoadedFamilyDropHandler();
UIApplication.DoDragDrop(selectedItem.Tag, myhanlder);
}
}
}
// Drag action from list box
private void listBox1_MouseMove(object sender, MouseEventArgs e)
{
if (System.Windows.Forms.Control.MouseButtons == MouseButtons.Left)
{
FamilyListBoxMember member = (FamilyListBoxMember)listBox1.SelectedItem;
// Use standard Revit drag and drop behavior
List<String> data = new List<String>();
data.Add(member.FullPath);
UIApplication.DoDragDrop(data);
}
}
private void FurnitureFamilyDragAndDropForm_FormClosed(object sender, FormClosedEventArgs e)
{
s_form = null;
}
}
/// <summary>
/// Custom handler for placement of loaded family types
/// </summary>
public class LoadedFamilyDropHandler : IDropHandler
{
public void Execute(UIDocument document, object data)
{
try
{
ElementId familySymbolId = (ElementId)data;
FamilySymbol symbol = document.Document.GetElement(familySymbolId) as FamilySymbol;
if (symbol != null)
{
document.PromptForFamilyInstancePlacement(symbol);
}
}
catch (Autodesk.Revit.Exceptions.OperationCanceledException)
{
// user canceled the operation
}
}
}
}
@@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -1,63 +0,0 @@
//
// (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;
namespace Revit.SDK.Samples.UIAPI.CS
{
/// <summary>
/// Implement this method as an external command for Revit.
/// </summary>
/// <param name="commandData">An object that is passed to the external application
/// which contains data related to the command,
/// such as the application object and active view.</param>
/// <param name="message">A message that can be set by the external application
/// which will be displayed if a failure or cancellation is returned by
/// the external command.</param>
/// <param name="elements">A set of elements to which the external application
/// can add elements that are to be highlighted in case of failure or cancellation.</param>
/// <returns>Return the status of the external command.
/// A result of Succeeded means that the API external method functioned as expected.
/// Cancelled can be used to signify that the user cancelled the external operation
/// at some point. Failure should be returned if the application is unable to proceed with
/// the operation.</returns>
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
public class DragAndDropCommand : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
// show the form
FurnitureFamilyDragAndDropForm form = FurnitureFamilyDragAndDropForm.GetTheForm(commandData.View.Document);
form.Show();
form.BringToFront();
return Result.Succeeded;
}
}
}
-254
View File
@@ -1,254 +0,0 @@
//
// (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 System.IO;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Forms;
using System.Windows.Media.Imaging;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using RApplication = Autodesk.Revit.ApplicationServices.Application;
namespace Revit.SDK.Samples.UIAPI.CS
{
public class ExternalApp : IExternalApplication
{
static String addinAssmeblyPath = typeof(ExternalApp).Assembly.Location;
/// <summary>
/// Loads the default Mass template automatically rather than showing UI.
/// </summary>
/// <param name="application">An object that is passed to the external application
/// which contains the controlled application.</param>
void createCommandBinding(UIControlledApplication application)
{
RevitCommandId wallCreate = RevitCommandId.LookupCommandId("ID_NEW_REVIT_DESIGN_MODEL");
AddInCommandBinding binding = application.CreateAddInCommandBinding(wallCreate);
binding.Executed += new EventHandler<Autodesk.Revit.UI.Events.ExecutedEventArgs>(binding_Executed);
binding.CanExecute += new EventHandler<Autodesk.Revit.UI.Events.CanExecuteEventArgs>(binding_CanExecute);
}
BitmapSource convertFromBitmap(System.Drawing.Bitmap bitmap)
{
return System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(
bitmap.GetHbitmap(),
IntPtr.Zero,
Int32Rect.Empty,
BitmapSizeOptions.FromEmptyOptions());
}
void createRibbonButton(UIControlledApplication application)
{
application.CreateRibbonTab("AddIn Integration");
RibbonPanel rp = application.CreateRibbonPanel("AddIn Integration", "Testing");
PushButtonData pbd = new PushButtonData("Wall", "Goto WikiHelp for wall creation",
addinAssmeblyPath,
"Revit.SDK.Samples.UIAPI.CS.CalcCommand");
ContextualHelp ch = new ContextualHelp(ContextualHelpType.ContextId, "HID_OBJECTS_WALL");
pbd.SetContextualHelp(ch);
pbd.LongDescription = "We redirect the wiki help for this button to Wall creation.";
pbd.LargeImage = convertFromBitmap(Revit.SDK.Samples.UIAPI.CS.Properties.Resources.StrcturalWall);
pbd.Image = convertFromBitmap(Revit.SDK.Samples.UIAPI.CS.Properties.Resources.StrcturalWall_S);
PushButton pb = rp.AddItem(pbd) as PushButton;
pb.Enabled = true;
pb.AvailabilityClassName = "Revit.SDK.Samples.UIAPI.CS.ApplicationAvailabilityClass";
PushButtonData pbd1 = new PushButtonData("GotoGoogle", "Go to Google",
addinAssmeblyPath,
"Revit.SDK.Samples.UIAPI.CS.CalcCommand");
ContextualHelp ch1 = new ContextualHelp(ContextualHelpType.Url, "http://www.google.com/");
pbd1.SetContextualHelp(ch1);
pbd1.LongDescription = "Go to google.";
pbd1.LargeImage = convertFromBitmap(Revit.SDK.Samples.UIAPI.CS.Properties.Resources.StrcturalWall);
pbd1.Image = convertFromBitmap(Revit.SDK.Samples.UIAPI.CS.Properties.Resources.StrcturalWall_S);
PushButton pb1 = rp.AddItem(pbd1) as PushButton;
pb1.AvailabilityClassName = "Revit.SDK.Samples.UIAPI.CS.ApplicationAvailabilityClass";
PushButtonData pbd2 = new PushButtonData("GotoRevitAddInUtilityHelpFile", "Go to Revit Add-In Utility",
addinAssmeblyPath,
"Revit.SDK.Samples.UIAPI.CS.CalcCommand");
ContextualHelp ch2 = new ContextualHelp(ContextualHelpType.ChmFile, Path.GetDirectoryName(addinAssmeblyPath) + @"\RevitAddInUtility.chm");
ch2.HelpTopicUrl = @"html/3374f8f0-dccc-e1df-d269-229ed8c60e93.htm";
pbd2.SetContextualHelp(ch2);
pbd2.LongDescription = "Go to Revit Add-In Utility.";
pbd2.LargeImage = convertFromBitmap(Revit.SDK.Samples.UIAPI.CS.Properties.Resources.StrcturalWall);
pbd2.Image = convertFromBitmap(Revit.SDK.Samples.UIAPI.CS.Properties.Resources.StrcturalWall_S);
PushButton pb2 = rp.AddItem(pbd2) as PushButton;
pb2.AvailabilityClassName = "Revit.SDK.Samples.UIAPI.CS.ApplicationAvailabilityClass";
PushButtonData pbd3 = new PushButtonData("PreviewControl", "Preview all views",
addinAssmeblyPath,
"Revit.SDK.Samples.UIAPI.CS.PreviewCommand");
pbd3.LargeImage = convertFromBitmap(Revit.SDK.Samples.UIAPI.CS.Properties.Resources.StrcturalWall);
pbd3.Image = convertFromBitmap(Revit.SDK.Samples.UIAPI.CS.Properties.Resources.StrcturalWall_S);
PushButton pb3 = rp.AddItem(pbd3) as PushButton;
pb3.AvailabilityClassName = "Revit.SDK.Samples.UIAPI.CS.ApplicationAvailabilityClass";
PushButtonData pbd5 = new PushButtonData("Drag_And_Drop", "Drag and Drop", addinAssmeblyPath,
"Revit.SDK.Samples.UIAPI.CS.DragAndDropCommand");
pbd5.LargeImage = convertFromBitmap(Revit.SDK.Samples.UIAPI.CS.Properties.Resources.StrcturalWall);
pbd5.Image = convertFromBitmap(Revit.SDK.Samples.UIAPI.CS.Properties.Resources.StrcturalWall_S);
PushButton pb5 = rp.AddItem(pbd5) as PushButton;
pb5.AvailabilityClassName = "Revit.SDK.Samples.UIAPI.CS.ApplicationAvailabilityClass";
}
/// <summary>
/// Implement this method to implement the external application which should be called when
/// Revit is about to exit,Any documents must have been closed before this method is called.
/// </summary>
/// <param name="application">An object that is passed to the external application
/// which contains the controlled application.</param>
/// <returns>Return the status of the external application.
/// A result of Succeeded means that the external application successfully shutdown.
/// Cancelled can be used to signify that the user cancelled the external operation at
/// some point.
/// If false is returned then the Revit user should be warned of the failure of the external
/// application to shut down correctly.</returns>
public Result OnShutdown(UIControlledApplication application)
{
return Result.Succeeded;
}
/// Implement this method to implement the external application which should be called when
/// Revit starts before a file or default template is actually loaded.
/// </summary>
/// <param name="application">An object that is passed to the external application
/// which contains the controlled application.</param>
/// <returns>Return the status of the external application.
/// A result of Succeeded means that the external application successfully started.
/// Cancelled can be used to signify that the user cancelled the external operation at
/// some point.
/// If false is returned then Revit should inform the user that the external application
/// failed to load and the release the internal reference.</returns>
public Result OnStartup(UIControlledApplication application)
{
s_uiApplication = application;
ApplicationOptions.Initialize(this);
createCommandBinding(application);
createRibbonButton(application);
// add custom tabs to options dialog.
AddTabCommand addTabCommand = new AddTabCommand(application);
addTabCommand.AddTabToOptionsDialog();
return Result.Succeeded;
}
public UIControlledApplication UIControlledApplication
{
get { return s_uiApplication; }
}
private UIControlledApplication s_uiApplication;
void binding_CanExecute(object sender, Autodesk.Revit.UI.Events.CanExecuteEventArgs e)
{
e.CanExecute = true;
}
void binding_Executed(object sender, Autodesk.Revit.UI.Events.ExecutedEventArgs e)
{
UIApplication uiApp = sender as UIApplication;
if (uiApp == null)
return;
String famTemplatePath = uiApp.Application.FamilyTemplatePath;
String conceptualmassTemplatePath = famTemplatePath + @"\Conceptual Mass\Mass.rft";
if (System.IO.File.Exists(conceptualmassTemplatePath))
{
//uiApp.OpenAndActivateDocument(conceptualmassTemplatePath);
Document familyDocument = uiApp.Application.NewFamilyDocument(conceptualmassTemplatePath);
if (null == familyDocument)
{
throw new Exception("Cannot open family document");
}
String fileName = Guid.NewGuid().ToString() + ".rfa";
familyDocument.SaveAs(fileName);
familyDocument.Close();
uiApp.OpenAndActivateDocument(fileName);
FilteredElementCollector collector = new FilteredElementCollector(uiApp.ActiveUIDocument.Document);
collector = collector.OfClass(typeof(View3D));
var query = from element in collector
where element.Name == "{3D}"
select element; // Linq query
List<Autodesk.Revit.DB.Element> views = query.ToList<Autodesk.Revit.DB.Element>();
View3D view3D = views[0] as View3D;
if(view3D != null)
uiApp.ActiveUIDocument.ActiveView = view3D;
}
}
}
/// <summary>
/// Implement this method as an external command for Revit.
/// </summary>
/// <param name="commandData">An object that is passed to the external application
/// which contains data related to the command,
/// such as the application object and active view.</param>
/// <param name="message">A message that can be set by the external application
/// which will be displayed if a failure or cancellation is returned by
/// the external command.</param>
/// <param name="elements">A set of elements to which the external application
/// can add elements that are to be highlighted in case of failure or cancellation.</param>
/// <returns>Return the status of the external command.
/// A result of Succeeded means that the API external method functioned as expected.
/// Cancelled can be used to signify that the user cancelled the external operation
/// at some point. Failure should be returned if the application is unable to proceed with
/// the operation.</returns>
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
public class CalcCommand : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
TaskDialog.Show("Dummy command", "This is a dummy command for buttons associated to contextual help.");
return Result.Succeeded;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

@@ -1,88 +0,0 @@
//
// (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;
}
}
@@ -1,20 +0,0 @@
<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>
@@ -1,53 +0,0 @@
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;
}
}
}
@@ -1,24 +0,0 @@
<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>
@@ -1,75 +0,0 @@
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; } }
}
@@ -1,144 +0,0 @@
<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>
@@ -1,54 +0,0 @@
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;
}
}
@@ -1,43 +0,0 @@
<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>
@@ -1,60 +0,0 @@
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;
}
}
@@ -1,84 +0,0 @@
//
// (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
{
/// <summary>
/// Implement this method as an external command for Revit.
/// </summary>
/// <param name="commandData">An object that is passed to the external application
/// which contains data related to the command,
/// such as the application object and active view.</param>
/// <param name="message">A message that can be set by the external application
/// which will be displayed if a failure or cancellation is returned by
/// the external command.</param>
/// <param name="elements">A set of elements to which the external application
/// can add elements that are to be highlighted in case of failure or cancellation.</param>
/// <returns>Return the status of the external command.
/// A result of Succeeded means that the API external method functioned as expected.
/// Cancelled can be used to signify that the user cancelled the external operation
/// at some point. Failure should be returned if the application is unable to proceed with
/// the operation.</returns>
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
public class PreviewCommand : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
_dbdocument = commandData.Application.ActiveUIDocument.Document;
TransactionGroup outerGroup = new TransactionGroup(_dbdocument, "preview control");
outerGroup.Start();
try
{
PreviewModel form = new PreviewModel(commandData.Application.Application, new ElementId(-1));
form.ShowDialog();
}
catch (Exception e)
{
throw e;
}
finally
{
outerGroup.RollBack();
}
return Result.Succeeded;
}
private Document _dbdocument = null;
}
}
@@ -1,142 +0,0 @@
namespace Revit.SDK.Samples.UIAPI.CS
{
partial class PreviewModel
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.panel1 = new System.Windows.Forms.Panel();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this._cbDocuments = new System.Windows.Forms.ComboBox();
this._cbViews = new System.Windows.Forms.ComboBox();
this._elementHostWPF = new System.Windows.Forms.Integration.ElementHost();
this.panel2 = new System.Windows.Forms.Panel();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this._elementHostWPF);
this.panel1.Controls.Add(this.panel2);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(467, 452);
this.panel1.TabIndex = 0;
//
// label2
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(266, 20);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(38, 13);
this.label2.TabIndex = 4;
this.label2.Text = "Views:";
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(9, 20);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(64, 13);
this.label1.TabIndex = 3;
this.label1.Text = "Documents:";
//
// _cbDocuments
//
this._cbDocuments.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this._cbDocuments.FormattingEnabled = true;
this._cbDocuments.Location = new System.Drawing.Point(12, 56);
this._cbDocuments.Name = "_cbDocuments";
this._cbDocuments.Size = new System.Drawing.Size(183, 21);
this._cbDocuments.TabIndex = 2;
this._cbDocuments.SelectedIndexChanged += new System.EventHandler(this.cbDocs_SelIdxChanged);
//
// _cbViews
//
this._cbViews.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this._cbViews.FormattingEnabled = true;
this._cbViews.Location = new System.Drawing.Point(269, 56);
this._cbViews.Name = "_cbViews";
this._cbViews.Size = new System.Drawing.Size(183, 21);
this._cbViews.TabIndex = 1;
this._cbViews.SelectedIndexChanged += new System.EventHandler(this.cbViews_SelIdxChanged);
//
// _elementHostWPF
//
this._elementHostWPF.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this._elementHostWPF.Location = new System.Drawing.Point(0, 0);
this._elementHostWPF.Name = "_elementHostWPF";
this._elementHostWPF.Size = new System.Drawing.Size(467, 367);
this._elementHostWPF.TabIndex = 0;
this._elementHostWPF.Text = "elementHost1";
this._elementHostWPF.Child = null;
//
// panel2
//
this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel2.Controls.Add(this._cbViews);
this.panel2.Controls.Add(this.label2);
this.panel2.Controls.Add(this._cbDocuments);
this.panel2.Controls.Add(this.label1);
this.panel2.Location = new System.Drawing.Point(3, 363);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(461, 89);
this.panel2.TabIndex = 5;
//
// PreviewModel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(467, 452);
this.Controls.Add(this.panel1);
this.Name = "PreviewModel";
this.Text = "PreviewModel";
this.panel1.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.ComboBox _cbViews;
private System.Windows.Forms.Integration.ElementHost _elementHostWPF;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox _cbDocuments;
private System.Windows.Forms.Panel panel2;
}
}
@@ -1,247 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using RView = Autodesk.Revit.DB.View;
using RApplication = Autodesk.Revit.ApplicationServices.Application;
namespace Revit.SDK.Samples.UIAPI.CS
{
public partial class PreviewModel : System.Windows.Forms.Form
{
public PreviewModel(RApplication application, ElementId viewId)
{
InitializeComponent();
_application = application;
_uiApplication = new UIApplication(application);
_dbDocument = _uiApplication.ActiveUIDocument.Document;
updateDocumentList(_dbDocument);
updateViewsList(_uiApplication.ActiveUIDocument.ActiveView.Id);
}
private void updateViewsList(ElementId viewId)
{
// fill the combobox with printable views <name + id>
FilteredElementCollector collecotr = new FilteredElementCollector(_dbDocument);
collecotr.OfClass(typeof(Autodesk.Revit.DB.View));
IEnumerable<Autodesk.Revit.DB.View> secs = from Element f in collecotr where (f as Autodesk.Revit.DB.View).CanBePrinted == true select f as Autodesk.Revit.DB.View;
_cbViews.Items.Clear();
DBViewItem activeItem = null;
foreach (Autodesk.Revit.DB.View dbView in secs)
{
if (viewId == null || viewId.IntegerValue < 0)
{
activeItem = new DBViewItem(dbView, _dbDocument);
viewId = dbView.Id;
}
if (dbView.Id == viewId)
{
activeItem = new DBViewItem(dbView, _dbDocument);
_cbViews.Items.Add(activeItem);
}
else
_cbViews.Items.Add(new DBViewItem(dbView, _dbDocument));
}
_cbViews.SelectedItem = activeItem;
}
private void updateDocumentList(Document selectedDocument)
{
// fill the documents to the comboxbox _cbDocuments.
DBDocumentItem activeItem = null;
_cbDocuments.Items.Clear();
DocumentSetIterator docIter = _application.Documents.ForwardIterator();
docIter.Reset();
while (docIter.MoveNext())
{
Document dbDoc = docIter.Current as Document;
String documentName = null;
DBDocumentItem item = null;
if (dbDoc != null)
{
if (dbDoc.IsFamilyDocument)
{
item = new DBDocumentItem(dbDoc.PathName, dbDoc);
}
else
{
String projName = dbDoc.ProjectInformation.Name;
if (String.IsNullOrEmpty(projName) || projName.ToLower().CompareTo("project name") == 0)
{
if (String.IsNullOrEmpty(dbDoc.PathName))
documentName = projName;
else
documentName = new System.IO.FileInfo(dbDoc.PathName).Name;
}
else
documentName = projName;
item = new DBDocumentItem(documentName, dbDoc);
}
if (dbDoc.Equals(selectedDocument))
{
_dbDocument = selectedDocument;
activeItem = item;
}
_cbDocuments.Items.Add(item);
}
}
_cbDocuments.Items.Add(new DBDocumentItem());
_cbDocuments.SelectedItem = activeItem;
}
private void cbViews_SelIdxChanged(object sender, EventArgs e)
{
System.Windows.Forms.ComboBox cb = sender as System.Windows.Forms.ComboBox;
if (cb == null)
return;
DBViewItem dbItem = cb.SelectedItem as DBViewItem;
if (dbItem == null)
return;
//if (_currentDBViewId == null)
// return;
//RView currentView = _dbDocument.get_Element(_currentDBViewId) as RView;
//if(currentView == null)
// return;
//if (dbItem.UniqueId.ToLower().CompareTo(currentView.UniqueId.ToLower()) != 0)
// return;
PreviewControl vc = _elementHostWPF.Child as PreviewControl;
if (vc != null)
vc.Dispose();
_elementHostWPF.Child = new PreviewControl(_dbDocument, dbItem.Id);
_currentDBViewId = dbItem.Id;
}
private ElementId _currentDBViewId = null;
private Document _dbDocument = null;
private RApplication _application = null;
private UIApplication _uiApplication = null;
private void cbDocs_SelIdxChanged(object sender, EventArgs e)
{
DBDocumentItem documentItem = _cbDocuments.SelectedItem as DBDocumentItem;
if (documentItem.Document == _dbDocument)
return;
if (documentItem.IsNull)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.DefaultExt = "rvt";
ofd.Filter = "Revit project files (*.rvt)|*.rvt|Revit family files (*.rfa)|*.rfa|Revit family template files (*.rft)|*.rft";
if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
try
{
_dbDocument = _application.OpenDocumentFile(ofd.FileName);
}
catch (System.Exception)
{
}
if (_dbDocument != null)
{
updateDocumentList(_dbDocument);
updateViewsList(null);
}
}
else
{
// the combobox should show the current document item.
String documentName;
String projName = _dbDocument.ProjectInformation.Name;
if (String.IsNullOrEmpty(projName) || projName.ToLower().CompareTo("project name") == 0)
{
if (String.IsNullOrEmpty(_dbDocument.PathName))
documentName = projName;
else
documentName = new System.IO.FileInfo(_dbDocument.PathName).Name;
}
else
documentName = projName;
foreach (DBDocumentItem dbItem in _cbDocuments.Items)
{
if (dbItem.Name.ToLower().CompareTo(documentName.ToLower()) == 0)
{
_cbDocuments.SelectedItem = dbItem;
break;
}
}
}
}
else
{
_dbDocument = documentItem.Document;
updateViewsList(null);
}
}
}
public class DBViewItem
{
public DBViewItem(RView dbView, Document dbDoc)
{
ElementType viewType = dbDoc.GetElement(dbView.GetTypeId()) as ElementType;
Name = viewType.Name + " " + dbView.Name;
Id = dbView.Id;
UniqueId = dbView.UniqueId;
}
public override String ToString()
{
return Name;
}
public String Name { get; set; }
public ElementId Id { get; set; }
public String UniqueId { get; set; }
}
public class DBDocumentItem
{
public DBDocumentItem(String name, Document doc)
{
Name = name;
Document = doc;
IsNull = false;
}
public DBDocumentItem()
{
IsNull = true;
}
public override string ToString()
{
if (IsNull)
return "<Open Document...>";
return Name;
}
public bool IsNull { get; set; }
public String Name { get; set; }
public Document Document { get; set; }
}
}
@@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("UIAPI")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UIAPI")]
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("bae35eaf-9bd1-4add-b739-d1c1edf37c03")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
-93
View File
@@ -1,93 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Revit.SDK.Samples.UIAPI.CS.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Revit.SDK.Samples.UIAPI.CS.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap autodesk {
get {
object obj = ResourceManager.GetObject("autodesk", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap StrcturalWall {
get {
object obj = ResourceManager.GetObject("StrcturalWall", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap StrcturalWall_S {
get {
object obj = ResourceManager.GetObject("StrcturalWall_S", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}
@@ -1,130 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="autodesk" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\autodesk.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="StrcturalWall" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\StrcturalWall.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="StrcturalWall_S" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\StrcturalWall-S.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

-11
View File
@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
<AddIn Type="Application">
<Name>UIAPI Application</Name>
<Assembly>UIAPI.dll</Assembly>
<AddInId>054e0e25-adc5-4657-b0e0-d831ac1c40c0</AddInId>
<FullClassName>Revit.SDK.Samples.UIAPI.CS.ExternalApp</FullClassName>
<VendorId>ADSK</VendorId>
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
</AddIn>
</RevitAddIns>
-168
View File
@@ -1,168 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{4B81280E-72CB-4414-A4F7-C2CAC7FEDBF5}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Revit.SDK.Samples.UIAPI.CS</RootNamespace>
<AssemblyName>UIAPI</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UIAutomationProvider" />
<Reference Include="WindowsBase" />
<Reference Include="WindowsFormsIntegration" />
</ItemGroup>
<ItemGroup>
<Compile Include="ApplicationAvailabilityClass.cs" />
<Compile Include="ApplicationOptions.cs" />
<Compile Include="ExternalApplication.cs" />
<Compile Include="DragAndDrop\DragAndDrop.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="DragAndDrop\DragAndDrop.designer.cs">
<DependentUpon>DragAndDrop.cs</DependentUpon>
</Compile>
<Compile Include="DragAndDrop\DragAndDropCommand.cs" />
<Compile Include="OptionsDialog\AddTabCommand.cs" />
<Compile Include="OptionsDialog\Options.xaml.cs">
<DependentUpon>Options.xaml</DependentUpon>
</Compile>
<Compile Include="OptionsDialog\UserControl1.xaml.cs">
<DependentUpon>UserControl1.xaml</DependentUpon>
</Compile>
<Compile Include="OptionsDialog\UserControl2.xaml.cs">
<DependentUpon>UserControl2.xaml</DependentUpon>
</Compile>
<Compile Include="OptionsDialog\UserControl3.xaml.cs">
<DependentUpon>UserControl3.xaml</DependentUpon>
</Compile>
<Compile Include="PreviewControl\PreviewCommand.cs" />
<Compile Include="PreviewControl\PreviewModel.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PreviewControl\PreviewModel.designer.cs">
<DependentUpon>PreviewModel.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="DragAndDrop\DragAndDrop.resx">
<DependentUpon>DragAndDrop.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PreviewControl\PreviewModel.resx">
<DependentUpon>PreviewModel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="Resources\StrcturalWall.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\StrcturalWall-S.png" />
</ItemGroup>
<ItemGroup>
<Page Include="OptionsDialog\Options.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="OptionsDialog\UserControl1.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="OptionsDialog\UserControl2.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="OptionsDialog\UserControl3.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Content Include="Images\autodesk.jpg" />
<Content Include="UIAPI.addin" />
</ItemGroup>
<Import Project="$(SolutionDir)VSProps\SDKSamples.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
</PropertyGroup>
</Project>