mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-09-19 18:48:48 +00:00
integrate Revit 2025 SDK
This commit is contained in:
@@ -21,18 +21,14 @@
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Diagnostics;
|
||||
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
using TaskDialog = Autodesk.Revit.UI.TaskDialog;
|
||||
|
||||
namespace Revit.SDK.Samples.ImportExport.CS
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace Revit.SDK.Samples.ImportExport.CS
|
||||
{
|
||||
partial class ExportIMGOptionsForm
|
||||
@@ -35,9 +37,10 @@ namespace Revit.SDK.Samples.ImportExport.CS
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
if (disposing)
|
||||
{
|
||||
components.Dispose();
|
||||
components?.Dispose();
|
||||
((IDisposable)m_exportOptions)?.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
@@ -22,16 +22,13 @@
|
||||
|
||||
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 TaskDialog = Autodesk.Revit.UI.TaskDialog;
|
||||
|
||||
namespace Revit.SDK.Samples.ImportExport.CS
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -38,10 +38,8 @@ namespace Revit.SDK.Samples.ImportExport.CS
|
||||
#endregion
|
||||
|
||||
#region Class Properties
|
||||
/// <summary>
|
||||
/// Combine
|
||||
/// </summary>
|
||||
public bool Combine
|
||||
|
||||
internal bool Combine
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
@@ -42,10 +42,11 @@ namespace Revit.SDK.Samples.ImportExport.CS
|
||||
/// </summary>
|
||||
private ExportPDFData m_data;
|
||||
|
||||
/// <summary>
|
||||
/// ExportPDFOptionsForm constructor
|
||||
/// </summary>
|
||||
public ExportPDFOptionsForm(ExportPDFData data)
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="data">Pdf export data</param>
|
||||
public ExportPDFOptionsForm(ExportPDFData data)
|
||||
{
|
||||
m_data = data;
|
||||
InitializeComponent();
|
||||
|
||||
@@ -21,16 +21,13 @@
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
using TaskDialog = Autodesk.Revit.UI.TaskDialog;
|
||||
|
||||
namespace Revit.SDK.Samples.ImportExport.CS
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -21,19 +21,14 @@
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Reflection;
|
||||
using System.IO;
|
||||
|
||||
using Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
using TaskDialog = Autodesk.Revit.UI.TaskDialog;
|
||||
|
||||
namespace Revit.SDK.Samples.ImportExport.CS
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -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.Text;
|
||||
|
||||
using Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
namespace Revit.SDK.Samples.ImportExport.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Data class which stores the information for importing image format
|
||||
/// </summary>
|
||||
class ImportInventorData : ImportData
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="commandData">Revit command data</param>
|
||||
/// <param name="importFormat">Format to import</param>
|
||||
public ImportInventorData(ExternalCommandData commandData, ImportFormat importFormat)
|
||||
: base(commandData, importFormat)
|
||||
{
|
||||
m_filter = "Autodesk Exchange Files (*.adsk)|*.adsk";
|
||||
m_title = "Import Inventor File";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Collect the parameters and import
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override bool Import()
|
||||
{
|
||||
|
||||
//Import
|
||||
Transaction t = new Transaction(m_activeDoc);
|
||||
t.SetName("Import");
|
||||
t.Start();
|
||||
Document doc =m_commandData.Application.Application.OpenBuildingComponentDocument(m_importFileFullName);
|
||||
t.Commit();
|
||||
|
||||
return doc == null ? false : true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,205 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project Sdk="">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{3505D5A1-24CB-46C3-8077-276BC07757D9}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Revit.SDK.Samples.ImportExport.CS</RootNamespace>
|
||||
<AssemblyName>ImportExport</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<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>
|
||||
<DocumentationFile>bin\Debug\ImportExport.XML</DocumentationFile>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</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>
|
||||
<Import Project="$(SolutionDir)VSProps\SDKSamples.Sdk.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DocumentationFile>bin\Debug\ImportExport.XML</DocumentationFile>
|
||||
<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="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Compile Remove="Export\ExportDWGOptionsData.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Command.cs" />
|
||||
<Compile Include="Export\ExportIMGData.cs">
|
||||
</Compile>
|
||||
<Compile Include="Export\ExportIMGOptionsForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Export\ExportIMGOptionsForm.Designer.cs">
|
||||
<DependentUpon>ExportIMGOptionsForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Export\ExportPDFData.cs" />
|
||||
<Compile Include="Export\ExportPDFOptionsForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Export\ExportPDFOptionsForm.Designer.cs">
|
||||
<DependentUpon>ExportPDFOptionsForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Export\ExportSATData.cs" />
|
||||
<Compile Include="Export\ExportDXFData.cs" />
|
||||
<Compile Include="Export\ExportDGNData.cs" />
|
||||
<Compile Include="Export\ExportDGNOptionsForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Export\ExportDGNOptionsForm.Designer.cs">
|
||||
<DependentUpon>ExportDGNOptionsForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Export\ExportFBXData.cs" />
|
||||
<Compile Include="Export\ExportGBXMLData.cs" />
|
||||
<Compile Include="Export\ExportDWFOptionForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Export\ExportDWFOptionForm.Designer.cs">
|
||||
<DependentUpon>ExportDWFOptionForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Export\ExportDWFData.cs" />
|
||||
<Compile Include="Export\ExportData.cs" />
|
||||
<Compile Include="Export\ExportDataWithViews.cs" />
|
||||
<Compile Include="Export\ExportDWGData.cs" />
|
||||
<Compile Include="Export\ExportBaseOptionsData.cs" />
|
||||
<Compile Include="Export\ExportBaseOptionsForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Export\ExportBaseOptionsForm.Designer.cs">
|
||||
<DependentUpon>ExportBaseOptionsForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Import\ImportGBXMLData.cs" />
|
||||
<Compile Include="Import\ImportImageData.cs" />
|
||||
<Compile Include="Import\ImportData.cs" />
|
||||
<Compile Include="Import\ImportDWGData.cs" />
|
||||
<Compile Include="Import\ImportDWGForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Import\ImportDWGForm.Designer.cs">
|
||||
<DependentUpon>ImportDWGForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Export\ExportWithViewsForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Export\ExportWithViewsForm.Designer.cs">
|
||||
<DependentUpon>ExportWithViewsForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainData.cs" />
|
||||
<Compile Include="MainForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainForm.Designer.cs">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Export\SelectViewsData.cs" />
|
||||
<Compile Include="Export\SelectViewsForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Export\SelectViewsForm.Designer.cs">
|
||||
<DependentUpon>SelectViewsForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Unit.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Export\ExportDWFOptionForm.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>ExportDWFOptionForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Export\ExportDGNOptionsForm.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>ExportDGNOptionsForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Export\ExportIMGOptionsForm.resx">
|
||||
<DependentUpon>ExportIMGOptionsForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Export\ExportPDFOptionsForm.resx">
|
||||
<DependentUpon>ExportPDFOptionsForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Export\ExportWithViewsForm.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>ExportWithViewsForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Export\ExportBaseOptionsForm.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>ExportBaseOptionsForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Import\ImportDWGForm.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>ImportDWGForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MainForm.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Export\SelectViewsForm.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>SelectViewsForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</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>
|
||||
-->
|
||||
<Import Project="$(SolutionDir)VSProps\SDKSamples.Sdk.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.py"
|
||||
if exist %25FILEFORSAMPLEREG%25 py -3 %25FILEFORSAMPLEREG%25 "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
|
||||
|
||||
@@ -21,14 +21,13 @@
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using Autodesk.Revit;
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
using TaskDialog = Autodesk.Revit.UI.TaskDialog;
|
||||
|
||||
namespace Revit.SDK.Samples.ImportExport.CS
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -55,3 +55,4 @@ using System.Runtime.InteropServices;
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: System.Runtime.Versioning.SupportedOSPlatformAttribute("windows7.0")]
|
||||
Reference in New Issue
Block a user