mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-08-15 18:14:02 +00:00
added Revit 2022 SDK minus except *rvt and *rfa
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
# SharpDevelop 4.2.0.8783
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "GetTimeElapsed_VBNet", "GetTimeElapsed_VBNet\GetTimeElapsed_VBNet.vbproj", "{C1499A1C-B9A0-4C5F-AC2E-E6F7C0B787D9}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
RevitVSTA|Any CPU = RevitVSTA|Any CPU
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{C1499A1C-B9A0-4C5F-AC2E-E6F7C0B787D9}.RevitVSTA|Any CPU.ActiveCfg = RevitVSTA|Any CPU
|
||||
{C1499A1C-B9A0-4C5F-AC2E-E6F7C0B787D9}.RevitVSTA|Any CPU.Build.0 = RevitVSTA|Any CPU
|
||||
{C1499A1C-B9A0-4C5F-AC2E-E6F7C0B787D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C1499A1C-B9A0-4C5F-AC2E-E6F7C0B787D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C1499A1C-B9A0-4C5F-AC2E-E6F7C0B787D9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C1499A1C-B9A0-4C5F-AC2E-E6F7C0B787D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!-- This section defines project-level properties.
|
||||
|
||||
Project Type Guids - Must include {A860303F-1F3F-4691-B57E-529FC101A107};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} for a VB.NET VSTA project.
|
||||
Configuration - Specifies whether the default configuration is Release or Debug.
|
||||
Platform - Specifies what CPU the output of this project can run on.
|
||||
ProductVersion - The version of Visual Studio.
|
||||
SchemaVersion - The project file schema version.
|
||||
OutputType - Must be "Library" for VSTA.
|
||||
RootNamespace - In C#, this specifies the namespace given to new files.
|
||||
In Visual Basic, all objects are wrapped in this namespace at runtime.
|
||||
AssemblyName - Name of the output assembly.
|
||||
TargetFrameworkVersion - The version of the .NET Framework this project targets.
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<ProjectTypeGuids>{A860303F-1F3F-4691-B57E-529FC101A107};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">RevitVSTA</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>GetTimeElapsed_VBNet</RootNamespace>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
<ProjectGuid>{C1499A1C-B9A0-4C5F-AC2E-E6F7C0B787D9}</ProjectGuid>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
</PropertyGroup>
|
||||
<!-- This section defines properties that are set when the "RevitVSTA" configuration is
|
||||
selected.
|
||||
|
||||
DebugType - If full enables a debugger to be attached to a running program.
|
||||
If pdbonly allows source code debugging when the program is started in the debugger but will only
|
||||
display assembler when the running program is attached to the debugger.
|
||||
If none debugging is disabled.
|
||||
DebugSymbols - If true, create symbols (.pdb). If false, do not create symbols.
|
||||
Optimize - If true, optimize the build output. If false, do not optimize.
|
||||
OutputPath - Output path of the project relative to the project file.
|
||||
DefineDebug - If true, defines the DEBUG. If false, DEBUG is not defined.
|
||||
DefineTrace - If true, defines the TRACE. If false, TRACE is not defined.
|
||||
NoWarn - Listed warning numbers will be ignored.
|
||||
-->
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'RevitVSTA|AnyCPU' ">
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
|
||||
<Optimize>True</Optimize>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<DebugType>None</DebugType>
|
||||
<DefineConstants>TRACE=1</DefineConstants>
|
||||
<OutputPath>..\..\Addin\</OutputPath>
|
||||
<AssemblyName>GetTimeElapsed_VBNet</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<!-- This sections specifies references for the project. -->
|
||||
<ItemGroup>
|
||||
<Reference Include="RevitAPIUI, Version=2011.0.0.0, Culture=neutral, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\RevitAPIUI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.AddIn">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="RevitAPI">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\RevitAPI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<!-- Visual Basic supports Importing namespaces (equivalent to using statements in C#).-->
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
</ItemGroup>
|
||||
<!-- This section defines the user source files that are part of the
|
||||
project.
|
||||
|
||||
Compile - Specifies a source file to compile.
|
||||
EmbeddedResource - Specifies a .resx file for embedded resources.
|
||||
None - Specifies a file that is not to be passed to the compiler (for instance,
|
||||
a text file or XML file).
|
||||
-->
|
||||
<ItemGroup>
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="ThisApplication.designer.vb">
|
||||
<DependentUpon>ThisApplication.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ThisApplication.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<!-- Include the build rules for a VB project.-->
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.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>
|
||||
-->
|
||||
<!-- This section defines VSTA properties that describe the host-changable project properties. -->
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{A860303F-1F3F-4691-B57E-529FC101A107}">
|
||||
<ProjectProperties HostName="VSTAHostName" HostPackage="{C1B21C64-9E6F-4923-A89D-9F958503C1CE}" ApplicationType="usd" Language="vb" TemplatesPath="" />
|
||||
<Host Name="Architecture2011">
|
||||
<HostItem Name="ThisApplication" Code="ThisApplication.vb" CanonicalName="ThisApplication" DisplayName="ThisApplication" Blueprint="ThisApplication.Designer.xml" GeneratedCode="ThisApplication.designer.vb" />
|
||||
</Host>
|
||||
<ProjectClient>
|
||||
<HostIdentifier>MEP2011</HostIdentifier>
|
||||
<InProcHost>{f2d1070d-feff-4610-9403-9476ff28253d}</InProcHost>
|
||||
</ProjectClient>
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports 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.
|
||||
|
||||
' Review the values of the assembly attributes
|
||||
|
||||
<Assembly: AssemblyTitle("GetTimeElapsed_VBNet")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("Autodesk, Inc.")>
|
||||
<Assembly: AssemblyProduct("GetTimeElapsed_VBNet")>
|
||||
<Assembly: AssemblyCopyright("Copyright @ Autodesk, Inc. 2009")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: CLSCompliant(True)>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
<Assembly: Guid("850d7483-e379-4018-bdb0-612c14540596")>
|
||||
|
||||
' 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")>
|
||||
Generated
+61
@@ -0,0 +1,61 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <autogenerated>
|
||||
' This code was generated by a tool.
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </autogenerated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict Off
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
'''</summary>
|
||||
'This class was auto-generated by the Strongly Typed Resource Builder
|
||||
'class via a tool like ResGen or Visual Studio.NET.
|
||||
'To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
'with the /str option, or rebuild your VS project.
|
||||
Class MyResources
|
||||
|
||||
Private Shared _resMgr As System.Resources.ResourceManager
|
||||
|
||||
Private Shared _resCulture As System.Globalization.CultureInfo
|
||||
|
||||
Friend Sub New()
|
||||
MyBase.New
|
||||
End Sub
|
||||
|
||||
'''<summary>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
'''</summary>
|
||||
<System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Public Shared ReadOnly Property ResourceManager() As System.Resources.ResourceManager
|
||||
Get
|
||||
If (_resMgr Is Nothing) Then
|
||||
Dim temp As System.Resources.ResourceManager = New System.Resources.ResourceManager("My.Resources.MyResources", GetType(MyResources).Assembly)
|
||||
_resMgr = temp
|
||||
End If
|
||||
Return _resMgr
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
'''</summary>
|
||||
<System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Public Shared Property Culture() As System.Globalization.CultureInfo
|
||||
Get
|
||||
Return _resCulture
|
||||
End Get
|
||||
Set
|
||||
_resCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
<?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>
|
||||
Generated
+38
@@ -0,0 +1,38 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <autogenerated>
|
||||
' This code was generated by a tool.
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </autogenerated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict Off
|
||||
Option Explicit On
|
||||
|
||||
|
||||
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared m_Value As MySettings
|
||||
|
||||
Private Shared m_SyncObject As Object = New Object
|
||||
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Public Shared ReadOnly Property Value() As MySettings
|
||||
Get
|
||||
If (MySettings.m_Value Is Nothing) Then
|
||||
System.Threading.Monitor.Enter(MySettings.m_SyncObject)
|
||||
If (MySettings.m_Value Is Nothing) Then
|
||||
Try
|
||||
MySettings.m_Value = New MySettings
|
||||
Finally
|
||||
System.Threading.Monitor.Exit(MySettings.m_SyncObject)
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
Return MySettings.m_Value
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
Generated
+80
@@ -0,0 +1,80 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:2.0.50727.3603
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict Off
|
||||
Option Explicit On
|
||||
|
||||
|
||||
|
||||
'''
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Applications.ProgrammingModel.dll", "9.0.0.0"), _
|
||||
Global.System.CLSCompliantAttribute(false)> _
|
||||
Partial Public NotInheritable Class ThisApplication
|
||||
Inherits Autodesk.Revit.UI.Macros.ApplicationEntryPoint
|
||||
|
||||
Public Event Startup As System.EventHandler
|
||||
|
||||
Public Event Shutdown As System.EventHandler
|
||||
|
||||
'''
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
|
||||
Private Sub OnStartup()
|
||||
Globals.ThisApplication = Me
|
||||
End Sub
|
||||
|
||||
'''
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
|
||||
Protected Overrides Sub FinishInitialization()
|
||||
MyBase.FinishInitialization
|
||||
Me.OnStartup
|
||||
If (Not (Me.StartupEvent) Is Nothing) Then
|
||||
RaiseEvent Startup(Me, System.EventArgs.Empty)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'''
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
|
||||
Protected Overrides Sub OnShutdown()
|
||||
If (Not (Me.ShutdownEvent) Is Nothing) Then
|
||||
RaiseEvent Shutdown(Me, System.EventArgs.Empty)
|
||||
End If
|
||||
MyBase.OnShutdown
|
||||
End Sub
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
|
||||
Protected Overrides ReadOnly Property PrimaryCookie() As String
|
||||
Get
|
||||
Return "ThisApplication"
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
|
||||
'''
|
||||
Partial Public NotInheritable Class Globals
|
||||
|
||||
Private Shared _ThisApplication As ThisApplication
|
||||
|
||||
Friend Shared Property ThisApplication() As ThisApplication
|
||||
Get
|
||||
Return _ThisApplication
|
||||
End Get
|
||||
Set
|
||||
If (_ThisApplication Is Nothing) Then
|
||||
_ThisApplication = value
|
||||
Else
|
||||
Throw New System.NotSupportedException
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
Imports System
|
||||
Imports System.IO
|
||||
Imports System.Diagnostics
|
||||
Imports System.Collections.Generic
|
||||
|
||||
Imports Autodesk
|
||||
Imports Autodesk.Revit
|
||||
Imports Autodesk.Revit.DB
|
||||
Imports Autodesk.Revit.DB.Events
|
||||
Imports Autodesk.Revit.UI
|
||||
Imports Autodesk.Revit.UI.Events
|
||||
|
||||
<Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)> _
|
||||
<Autodesk.Revit.DB.Macros.AddInIdAttribute("A2616C96-88D8-4C9D-B4EF-E84147DEE20B")> _
|
||||
Partial Public Class ThisApplication
|
||||
|
||||
Private m_dicLastSaved As New Dictionary(Of Document, DateTime)()
|
||||
|
||||
Private Sub Module_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup
|
||||
InitializeDicLastSaved()
|
||||
AddHandler Me.Application.DocumentSaved, AddressOf ThisApplication_DocumentSaved
|
||||
AddHandler Me.Application.DocumentOpened, AddressOf ThisApplication_DocumentOpened
|
||||
AddHandler Me.Application.DocumentCreated, AddressOf ThisApplication_DocumentCreated
|
||||
AddHandler Me.Application.DocumentClosing, AddressOf ThisApplication_DocumentClosing
|
||||
End Sub
|
||||
|
||||
Private Sub Module_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown
|
||||
RemoveHandler Me.Application.DocumentSaved, AddressOf ThisApplication_DocumentSaved
|
||||
RemoveHandler Me.Application.DocumentOpened, AddressOf ThisApplication_DocumentOpened
|
||||
RemoveHandler Me.Application.DocumentCreated, AddressOf ThisApplication_DocumentCreated
|
||||
RemoveHandler Me.Application.DocumentClosing, AddressOf ThisApplication_DocumentClosing
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Initialize
|
||||
''' </summary>
|
||||
Private Sub InitializeDicLastSaved()
|
||||
For Each document As Document In Me.Application.Documents
|
||||
m_dicLastSaved.Add(document, DateTime.MaxValue)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' DocumentCreated event, add the created document into m_dicLastSaved
|
||||
''' </summary>
|
||||
''' <param name="sender">sender</param>
|
||||
''' <param name="args">DocumentCreatedEventArgs</param>
|
||||
Private Sub ThisApplication_DocumentCreated(ByVal sender As Object, ByVal args As Autodesk.Revit.DB.Events.DocumentCreatedEventArgs)
|
||||
m_dicLastSaved.Add(args.Document, DateTime.MaxValue)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' DocumentClosing event, remove the closing document from m_dicLastSaved
|
||||
''' </summary>
|
||||
''' <param name="sender">sender</param>
|
||||
''' <param name="args">DocumentClosingEventArgs</param>
|
||||
Private Sub ThisApplication_DocumentClosing(ByVal sender As Object, ByVal args As Autodesk.Revit.DB.Events.DocumentClosingEventArgs)
|
||||
m_dicLastSaved.Remove(args.Document)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' DocumentOpened event, add the opened document into m_dicLastSaved
|
||||
''' </summary>
|
||||
''' <param name="sender">sender</param>
|
||||
''' <param name="args">DocumentOpenedEventArgs</param>
|
||||
Private Sub ThisApplication_DocumentOpened(ByVal sender As Object, ByVal args As Autodesk.Revit.DB.Events.DocumentOpenedEventArgs)
|
||||
m_dicLastSaved.Add(args.Document, DateTime.MaxValue)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' DocumentSaved event, record the current DataTime for the saved document
|
||||
''' </summary>
|
||||
''' <param name="sender">sender</param>
|
||||
''' <param name="args">DocumentSavedEventArgs</param>
|
||||
Private Sub ThisApplication_DocumentSaved(ByVal sender As Object, ByVal args As Autodesk.Revit.DB.Events.DocumentSavedEventArgs)
|
||||
Me.m_dicLastSaved(args.Document) = DateTime.Now
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' FormatTimeSpan
|
||||
''' </summary>
|
||||
''' <param name="elapse">TimeSpan</param>
|
||||
''' <returns>the string of TimeSpan</returns>
|
||||
Private Function FormatTimeSpan(ByVal elapse As TimeSpan) As [String]
|
||||
Dim elapseStr As [String] = elapse.ToString()
|
||||
Dim lastIndexOfDot As Integer = elapseStr.LastIndexOf("."c)
|
||||
Return elapseStr.Substring(0, lastIndexOfDot)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' GetTimeElapsedSinceLastSave
|
||||
''' </summary>
|
||||
Public Sub GetTimeElapsedSinceLastSave()
|
||||
Dim text As [String] = [String].Format("{0,-30}{1,-30}", "Document Full Name", "Elapse Time Since Last Save(day.hh:mm:ss)") & vbLf
|
||||
For Each pair As KeyValuePair(Of Document, DateTime) In m_dicLastSaved
|
||||
Dim strElapsed As [String] = [String].Empty
|
||||
If pair.Value = DateTime.MaxValue Then
|
||||
strElapsed = "Never"
|
||||
Else
|
||||
strElapsed = FormatTimeSpan(DateTime.Now - pair.Value)
|
||||
End If
|
||||
|
||||
Dim fileName As [String] = System.IO.Path.GetFileName(pair.Key.PathName)
|
||||
If [String].IsNullOrEmpty(fileName) Then
|
||||
fileName = "*New*"
|
||||
End If
|
||||
|
||||
text += [String].Format("{0,-30}{1,-30}", fileName, strElapsed) & vbLf
|
||||
Next
|
||||
|
||||
System.Windows.Forms.MessageBox.Show(text, "Macro GetTimeElapsedSinceLastSave")
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user