mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-10-02 07:04:00 +00:00
removed Revit 2021 SDK contents
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RevitAddIns>
|
||||
<AddIn Type="Command">
|
||||
<Assembly>AutoJoin.dll</Assembly>
|
||||
<ClientId>ac7c9e70-077e-4693-8f2e-aea13dd2fad3</ClientId>
|
||||
<FullClassName>Revit.SDK.Samples.AutoJoin.CS.Command</FullClassName>
|
||||
<Text>Auto Join</Text>
|
||||
<Description>Automatically join geometry of combinable elements.</Description>
|
||||
<VisibilityMode>AlwaysVisible</VisibilityMode>
|
||||
<VendorId>ADSK</VendorId>
|
||||
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
|
||||
</AddIn>
|
||||
</RevitAddIns>
|
||||
@@ -1,198 +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 Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
|
||||
namespace Revit.SDK.Samples.AutoJoin.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Join all the overlapping generic forms in this document.
|
||||
/// </summary>
|
||||
public class AutoJoin
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
public AutoJoin()
|
||||
{
|
||||
m_elements = new List<CombinableElement>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Join geometry between overlapping solids.
|
||||
/// </summary>
|
||||
/// <param name="document">The active document</param>
|
||||
/// <returns>The number of geometry combination be joined in this document.</returns>
|
||||
public int Join(Document document)
|
||||
{
|
||||
int combinated = 0;
|
||||
|
||||
// CombinableElement is of an element type that exists in the API, but not in Revit's native object model.
|
||||
// We use a combination of GenericForm and GeomCombination elements instead to find all CombinableElement.
|
||||
LogicalOrFilter filter = new LogicalOrFilter(
|
||||
new ElementClassFilter(typeof(GenericForm)),
|
||||
new ElementClassFilter(typeof(GeomCombination)));
|
||||
|
||||
FilteredElementIterator itor = (new FilteredElementCollector(document)).WherePasses(filter).GetElementIterator();
|
||||
itor.Reset();
|
||||
while (itor.MoveNext())
|
||||
{
|
||||
GenericForm gf = itor.Current as GenericForm;
|
||||
if (null != gf && !gf.IsSolid)
|
||||
continue;
|
||||
|
||||
CombinableElement ce = itor.Current as CombinableElement;
|
||||
if (null == ce)
|
||||
continue;
|
||||
else
|
||||
m_elements.Add(ce);
|
||||
}
|
||||
// Added all solid forms in this document.
|
||||
|
||||
while (1 < m_elements.Count)
|
||||
{
|
||||
GeomCombination geomCombination = JoinOverlapping(m_elements, document);
|
||||
if (null == geomCombination)
|
||||
{
|
||||
return combinated;//No overlapping.
|
||||
}
|
||||
|
||||
combinated++;
|
||||
}
|
||||
|
||||
return combinated;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Join the overlapped elements in the list.
|
||||
/// </summary>
|
||||
/// <param name="elements">the element list may includes overlapping.</param>
|
||||
/// <param name="document">the active document</param>
|
||||
/// <returns>the joined geometry combination, the joined elements is removed from the list.</returns>
|
||||
public GeomCombination JoinOverlapping(List<CombinableElement> elements, Document document)
|
||||
{
|
||||
CombinableElementArray joinedElements = new CombinableElementArray();
|
||||
|
||||
// try to find the first overlapping.
|
||||
foreach (CombinableElement aElement in elements)
|
||||
{
|
||||
foreach (CombinableElement xElement in elements)
|
||||
{
|
||||
if (IsOverlapped(aElement, xElement))
|
||||
{
|
||||
joinedElements.Append(aElement);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (1 == joinedElements.Size)
|
||||
break;
|
||||
}
|
||||
|
||||
if (0 == joinedElements.Size)
|
||||
{
|
||||
return null;//Can not find any overlapping.
|
||||
}
|
||||
|
||||
// try to find all elements overlapped the first element.
|
||||
foreach (CombinableElement aElement in elements)
|
||||
{
|
||||
if (IsOverlapped(aElement, joinedElements.get_Item(0)))
|
||||
{
|
||||
joinedElements.Append(aElement);
|
||||
}
|
||||
}
|
||||
|
||||
List<CombinableElement> allCanJoin = new List<CombinableElement>();
|
||||
bool isNew = false;
|
||||
do
|
||||
{
|
||||
allCanJoin.Clear();
|
||||
isNew = false;
|
||||
|
||||
// try to find all elements overlapped joinedElements
|
||||
foreach (CombinableElement aElement in joinedElements)
|
||||
{
|
||||
foreach (CombinableElement xElement in elements)
|
||||
{
|
||||
if (IsOverlapped(aElement, xElement))
|
||||
{
|
||||
allCanJoin.Add(xElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (CombinableElement aElement in allCanJoin)
|
||||
{
|
||||
bool isContained = false;
|
||||
|
||||
for (int ii = 0; ii < joinedElements.Size; ii++)
|
||||
{
|
||||
if (aElement.Id.IntegerValue == joinedElements.get_Item(ii).Id.IntegerValue)
|
||||
{
|
||||
isContained = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isContained)
|
||||
{
|
||||
isNew = true;
|
||||
joinedElements.Append(aElement);
|
||||
}
|
||||
}
|
||||
} while (isNew);// find all elements which overlapped with joined geometry combination.
|
||||
|
||||
|
||||
// removed the joined elements from the input list.
|
||||
foreach (CombinableElement aElement in joinedElements)
|
||||
{
|
||||
elements.Remove(aElement);
|
||||
}
|
||||
|
||||
return document.CombineElements(joinedElements);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tell if the element A and B are overlapped.
|
||||
/// </summary>
|
||||
/// <param name="elementA">element A</param>
|
||||
/// <param name="elementB">element B</param>
|
||||
/// <returns>return true if A and B are overlapped, or else return false.</returns>
|
||||
public bool IsOverlapped(CombinableElement elementA, CombinableElement elementB)
|
||||
{
|
||||
if (elementA.Id.IntegerValue == elementB.Id.IntegerValue)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Options geOptions = Command.s_appCreation.NewGeometryOptions();
|
||||
return Intersection.IsOverlapped(elementA.get_Geometry(geOptions), elementB.get_Geometry(geOptions));
|
||||
}
|
||||
|
||||
private List<CombinableElement> m_elements;// this element list to combine geometry.
|
||||
}
|
||||
}
|
||||
@@ -1,85 +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>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{B0F48DFB-6DAF-4451-8E7C-2617485D7CE0}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>AutoJoin</RootNamespace>
|
||||
<AssemblyName>AutoJoin</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>
|
||||
</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="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AutoJoin.cs" />
|
||||
<Compile Include="Command.cs" />
|
||||
<Compile Include="Intersection.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</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>
|
||||
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
|
||||
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,119 +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 Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
using AppCreation = Autodesk.Revit.Creation.Application;
|
||||
|
||||
namespace Revit.SDK.Samples.AutoJoin.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// This sample demonstrates how to automatically join geometry
|
||||
/// between multiple generic forms for use in family modeling and massing.
|
||||
/// </summary>
|
||||
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
|
||||
[Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
|
||||
[Autodesk.Revit.Attributes.Journaling(Autodesk.Revit.Attributes.JournalingMode.NoCommandData)]
|
||||
public class Command : IExternalCommand
|
||||
{
|
||||
|
||||
public static AppCreation s_appCreation;
|
||||
|
||||
/// <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>
|
||||
public virtual Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData
|
||||
, ref string message, Autodesk.Revit.DB.ElementSet elements)
|
||||
{
|
||||
Transaction trans = new Transaction(commandData.Application.ActiveUIDocument.Document, "Revit.SDK.Samples.AutoJoin");
|
||||
trans.Start();
|
||||
if (null == s_appCreation)
|
||||
{
|
||||
// share for class Intersection.
|
||||
s_appCreation = commandData.Application.Application.Create;
|
||||
}
|
||||
|
||||
UIDocument doc = commandData.Application.ActiveUIDocument;
|
||||
CombinableElementArray solids
|
||||
= new CombinableElementArray();
|
||||
|
||||
ElementSet es = new ElementSet();
|
||||
foreach (ElementId elemId in es)
|
||||
{
|
||||
es.Insert(doc.Document.GetElement(elemId));
|
||||
}
|
||||
if (0 < es.Size)
|
||||
{
|
||||
foreach (Autodesk.Revit.DB.ElementId elementId in doc.Selection.GetElementIds())
|
||||
{
|
||||
Autodesk.Revit.DB.Element element = doc.Document.GetElement(elementId);
|
||||
System.Diagnostics.Trace.WriteLine(element.GetType().ToString());
|
||||
|
||||
GenericForm gf = element as GenericForm;
|
||||
if (null != gf && !gf.IsSolid)
|
||||
continue;
|
||||
|
||||
CombinableElement ce = element as CombinableElement;
|
||||
if (null != ce)
|
||||
solids.Append(ce);
|
||||
}
|
||||
|
||||
if (solids.Size < 2)
|
||||
{
|
||||
message = "At least 2 combinable elements should be selected.";
|
||||
trans.RollBack();
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
|
||||
doc.Document.CombineElements(solids);
|
||||
|
||||
//The selected generic forms are joined, whether or not they overlap.
|
||||
trans.Commit();
|
||||
return Autodesk.Revit.UI.Result.Succeeded;
|
||||
}
|
||||
|
||||
AutoJoin autojoin = new AutoJoin();
|
||||
autojoin.Join(doc.Document);
|
||||
//All overlapping generic forms are joined.
|
||||
trans.Commit();
|
||||
return Autodesk.Revit.UI.Result.Succeeded;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,160 +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 Autodesk.Revit.Creation;
|
||||
using Autodesk.Revit.DB;
|
||||
|
||||
using GeometryElement = Autodesk.Revit.DB.GeometryElement;
|
||||
using AppCreation = Autodesk.Revit.Creation.Application;
|
||||
|
||||
namespace Revit.SDK.Samples.AutoJoin.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Tell if two geometry objects are overlapping or not.
|
||||
/// </summary>
|
||||
class Intersection
|
||||
{
|
||||
/// <summary>
|
||||
/// Tell if the geometry object A and B are overlapped.
|
||||
/// </summary>
|
||||
/// <param name="geometryA">geometry object A</param>
|
||||
/// <param name="geometryB">geometry object B</param>
|
||||
/// <returns>return true if A and B are overlapped, or else return false.</returns>
|
||||
public static bool IsOverlapped(GeometryObject geometryA, GeometryObject geometryB)
|
||||
{
|
||||
List<Face> facesOfA = new List<Face>();
|
||||
List<Curve> curvesOfB = new List<Curve>();
|
||||
|
||||
GetAllFaces(geometryA, facesOfA);
|
||||
GetAllCurves(geometryB, curvesOfB);
|
||||
|
||||
foreach (Face face in facesOfA)
|
||||
{
|
||||
foreach (Curve curve in curvesOfB)
|
||||
{
|
||||
if (face.Intersect(curve) == Autodesk.Revit.DB.SetComparisonResult.Overlap)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get all faces of the geometry object and insert them to the list
|
||||
/// </summary>
|
||||
/// <param name="geometry">the geometry object</param>
|
||||
/// <param name="faces">the face list</param>
|
||||
private static void GetAllFaces(GeometryObject geometry, List<Face> faces)
|
||||
{
|
||||
if (geometry is GeometryElement)
|
||||
{
|
||||
GetAllFaces(geometry as GeometryElement, faces);
|
||||
return;
|
||||
}
|
||||
|
||||
if (geometry is Solid)
|
||||
{
|
||||
GetAllFaces(geometry as Solid, faces);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static void GetAllFaces(GeometryElement geoElement, List<Face> faces)
|
||||
{
|
||||
//foreach (GeometryObject geObject in geoElement.Objects)
|
||||
IEnumerator<GeometryObject> Objects = geoElement.GetEnumerator();
|
||||
while (Objects.MoveNext())
|
||||
{
|
||||
GeometryObject geObject = Objects.Current;
|
||||
|
||||
GetAllFaces(geObject, faces);
|
||||
}
|
||||
}
|
||||
|
||||
private static void GetAllFaces(Solid solid, List<Face> faces)
|
||||
{
|
||||
foreach (Face face in solid.Faces)
|
||||
{
|
||||
faces.Add(face);
|
||||
}
|
||||
}
|
||||
|
||||
private static void GetAllCurves(GeometryObject geometry, List<Curve> curves)
|
||||
{
|
||||
if (geometry is GeometryElement)
|
||||
{
|
||||
GetAllCurves(geometry as GeometryElement, curves);
|
||||
return;
|
||||
}
|
||||
|
||||
if (geometry is Solid)
|
||||
{
|
||||
GetAllCurves(geometry as Solid, curves);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private static void GetAllCurves(GeometryElement geoElement, List<Curve> curves)
|
||||
{
|
||||
//foreach (GeometryObject geObject in geoElement.Objects)
|
||||
IEnumerator<GeometryObject> Objects = geoElement.GetEnumerator();
|
||||
while (Objects.MoveNext())
|
||||
{
|
||||
GeometryObject geObject = Objects.Current;
|
||||
|
||||
GetAllCurves(geObject, curves);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static void GetAllCurves(Solid solid, List<Curve> curves)
|
||||
{
|
||||
foreach (Face face in solid.Faces)
|
||||
{
|
||||
GetAllCurves(face, curves);
|
||||
}
|
||||
}
|
||||
|
||||
private static void GetAllCurves(Face face, List<Curve> curves)
|
||||
{
|
||||
foreach (EdgeArray loop in face.EdgeLoops)
|
||||
{
|
||||
foreach (Edge edge in loop)
|
||||
{
|
||||
List<Autodesk.Revit.DB.XYZ> points = edge.Tessellate() as List<Autodesk.Revit.DB.XYZ>;
|
||||
for (int ii = 0; ii + 1 < points.Count; ii++)
|
||||
{
|
||||
Line line = Line.CreateBound(points[ii], points[ii + 1]);
|
||||
curves.Add(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +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("AutoJoin")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Autodesk, Inc.")]
|
||||
[assembly: AssemblyProduct("AutoJoin")]
|
||||
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2009")]
|
||||
[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("26bf733b-b9f1-4375-80b2-adaa26b5541f")]
|
||||
|
||||
// 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 Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
Binary file not shown.
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RevitAddIns>
|
||||
<AddIn Type="Command">
|
||||
<Assembly>AutoParameter.dll</Assembly>
|
||||
<ClientId>74c58f2c-0b37-42e1-a1db-abec149c71fc</ClientId>
|
||||
<FullClassName>Revit.SDK.Samples.AutoParameter.CS.AddParameterToFamily</FullClassName>
|
||||
<Text>AddParameterToFamily</Text>
|
||||
<Description>Sample to show how to automatically add a large set of parameters to a family.</Description>
|
||||
<VisibilityMode>AlwaysVisible</VisibilityMode>
|
||||
<VendorId>ADSK</VendorId>
|
||||
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
|
||||
</AddIn>
|
||||
<AddIn Type="Command">
|
||||
<Assembly>AutoParameter.dll</Assembly>
|
||||
<ClientId>892df373-8008-400b-96ea-855cd4220b41</ClientId>
|
||||
<FullClassName>Revit.SDK.Samples.AutoParameter.CS.AddParameterToFamilies</FullClassName>
|
||||
<Text>AddParameterToFamilies</Text>
|
||||
<Description>Sample to show how to automatically add a large set of parameters to multiple family files.</Description>
|
||||
<VisibilityMode>AlwaysVisible</VisibilityMode>
|
||||
<VendorId>ADSK</VendorId>
|
||||
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
|
||||
</AddIn>
|
||||
</RevitAddIns>
|
||||
@@ -1,84 +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>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{EE7D1F8F-8DD3-4627-A00F-12F683066A1D}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>AutoParameter</RootNamespace>
|
||||
<AssemblyName>AutoParameter</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>
|
||||
</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="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="FamilyParameterAssigner.cs" />
|
||||
<Compile Include="Command.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</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>
|
||||
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
|
||||
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,292 +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 System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
using Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
namespace Revit.SDK.Samples.AutoParameter.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// A class inherits IExternalCommand interface.
|
||||
/// this class read parameter data from txt files and add them to the active family document.
|
||||
/// </summary>
|
||||
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
|
||||
[Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
|
||||
[Autodesk.Revit.Attributes.Journaling(Autodesk.Revit.Attributes.JournalingMode.NoCommandData)]
|
||||
public class AddParameterToFamily : IExternalCommand
|
||||
{
|
||||
// the active Revit application
|
||||
private Autodesk.Revit.UI.UIApplication m_app;
|
||||
|
||||
/// <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>
|
||||
public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData,
|
||||
ref string message,
|
||||
ElementSet elements)
|
||||
{
|
||||
m_app = commandData.Application;
|
||||
MessageManager.MessageBuff = new StringBuilder();
|
||||
|
||||
try
|
||||
{
|
||||
bool succeeded = AddParameters();
|
||||
|
||||
if (succeeded)
|
||||
{
|
||||
return Autodesk.Revit.UI.Result.Succeeded;
|
||||
}
|
||||
else
|
||||
{
|
||||
message = MessageManager.MessageBuff.ToString();
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
message = e.Message;
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// add parameters to the active document
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// if succeeded, return true; otherwise false
|
||||
/// </returns>
|
||||
private bool AddParameters()
|
||||
{
|
||||
Document doc = m_app.ActiveUIDocument.Document;
|
||||
if (null == doc)
|
||||
{
|
||||
MessageManager.MessageBuff.Append("There's no available document. \n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!doc.IsFamilyDocument)
|
||||
{
|
||||
MessageManager.MessageBuff.Append("The active document is not a family document. \n");
|
||||
return false;
|
||||
}
|
||||
|
||||
FamilyParameterAssigner assigner = new FamilyParameterAssigner(m_app.Application, doc);
|
||||
// the parameters to be added are defined and recorded in a text file, read them from that file and load to memory
|
||||
bool succeeded = assigner.LoadParametersFromFile();
|
||||
if (!succeeded)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Transaction t = new Transaction(doc, Guid.NewGuid().GetHashCode().ToString());
|
||||
t.Start();
|
||||
succeeded = assigner.AddParameters();
|
||||
if (succeeded)
|
||||
{
|
||||
t.Commit();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
t.RollBack();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} // end of class "AddParameterToFamily"
|
||||
|
||||
/// <summary>
|
||||
/// A class inherits IExternalCommand interface.
|
||||
/// this class read parameter data from txt files and add them to the family files in a folder.
|
||||
/// </summary>
|
||||
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
|
||||
[Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
|
||||
[Autodesk.Revit.Attributes.Journaling(Autodesk.Revit.Attributes.JournalingMode.NoCommandData)]
|
||||
public class AddParameterToFamilies : IExternalCommand
|
||||
{
|
||||
// the active Revit application
|
||||
private Autodesk.Revit.ApplicationServices.Application m_app;
|
||||
|
||||
/// <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>
|
||||
public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData,
|
||||
ref string message,
|
||||
ElementSet elements)
|
||||
{
|
||||
m_app = commandData.Application.Application;
|
||||
MessageManager.MessageBuff = new StringBuilder();
|
||||
|
||||
try
|
||||
{
|
||||
bool succeeded = LoadFamiliesAndAddParameters();
|
||||
|
||||
if (succeeded)
|
||||
{
|
||||
return Autodesk.Revit.UI.Result.Succeeded;
|
||||
}
|
||||
else
|
||||
{
|
||||
message = MessageManager.MessageBuff.ToString();
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
message = e.Message;
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// search for the family files and the corresponding parameter records
|
||||
/// load each family file, add parameters and then save and close.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// if succeeded, return true; otherwise false
|
||||
/// </returns>
|
||||
private bool LoadFamiliesAndAddParameters()
|
||||
{
|
||||
bool succeeded = true;
|
||||
|
||||
List<string> famFilePaths = new List<string>();
|
||||
|
||||
Environment.SpecialFolder myDocumentsFolder = Environment.SpecialFolder.MyDocuments;
|
||||
string myDocs = Environment.GetFolderPath(myDocumentsFolder);
|
||||
string families = myDocs + "\\AutoParameter_Families";
|
||||
if (!Directory.Exists(families))
|
||||
{
|
||||
MessageManager.MessageBuff.Append("The folder [AutoParameter_Families] doesn't exist in [MyDocuments] folder.\n");
|
||||
}
|
||||
DirectoryInfo familiesDir = new DirectoryInfo(families);
|
||||
FileInfo[] files = familiesDir.GetFiles("*.rfa");
|
||||
if (0 == files.Length)
|
||||
{
|
||||
MessageManager.MessageBuff.Append("No family file exists in [AutoParameter_Families] folder.\n");
|
||||
}
|
||||
foreach (FileInfo info in files)
|
||||
{
|
||||
if (info.IsReadOnly)
|
||||
{
|
||||
MessageManager.MessageBuff.Append("Family file: \"" + info.FullName + "\" is read only. Can not add parameters to it.\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
string famFilePath = info.FullName;
|
||||
Document doc = m_app.OpenDocumentFile(famFilePath);
|
||||
|
||||
if (!doc.IsFamilyDocument)
|
||||
{
|
||||
succeeded = false;
|
||||
MessageManager.MessageBuff.Append("Document: \"" + famFilePath + "\" is not a family document.\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
// return and report the errors
|
||||
if (!succeeded)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
FamilyParameterAssigner assigner = new FamilyParameterAssigner(m_app, doc);
|
||||
// the parameters to be added are defined and recorded in a text file, read them from that file and load to memory
|
||||
succeeded = assigner.LoadParametersFromFile();
|
||||
if (!succeeded)
|
||||
{
|
||||
MessageManager.MessageBuff.Append("Failed to load parameters from parameter files.\n");
|
||||
return false;
|
||||
}
|
||||
Transaction t = new Transaction(doc, Guid.NewGuid().GetHashCode().ToString());
|
||||
t.Start();
|
||||
succeeded = assigner.AddParameters();
|
||||
if (succeeded)
|
||||
{
|
||||
t.Commit();
|
||||
doc.Save();
|
||||
doc.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
t.RollBack();
|
||||
doc.Close();
|
||||
MessageManager.MessageBuff.Append("Failed to add parameters to " + famFilePath + ".\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} // end of class "AddParameterToFamilies"
|
||||
|
||||
/// <summary>
|
||||
/// store the warning/error messeges when executing the sample
|
||||
/// </summary>
|
||||
static class MessageManager
|
||||
{
|
||||
static StringBuilder m_messageBuff = new StringBuilder();
|
||||
/// <summary>
|
||||
/// store the warning/error messages
|
||||
/// </summary>
|
||||
public static StringBuilder MessageBuff
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_messageBuff;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_messageBuff = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
# This is a Revit family parameter file.
|
||||
# allows to edit manually.
|
||||
# make sure the "ParamGroup" and "ParamType" values are correct (with or without "BuiltInParameterGroup." and "ParameterType." doesn't affect the sample).
|
||||
|
||||
|
||||
*ParamName ParamGroup ParamType IsInstance
|
||||
FamilyParam1 PG_TEXT Text false
|
||||
FamilyParam2 BuiltInParameterGroup.PG_TEXT ParameterType.Text true
|
||||
@@ -1,475 +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 System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Reflection;
|
||||
|
||||
using Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
|
||||
namespace Revit.SDK.Samples.AutoParameter.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// add parameters(family parameters/shared parameters) to the opened family file
|
||||
/// the parameters are recorded in txt file following certain formats
|
||||
/// </summary>
|
||||
class FamilyParameterAssigner
|
||||
{
|
||||
#region Memeber Fields
|
||||
private Autodesk.Revit.ApplicationServices.Application m_app;
|
||||
private FamilyManager m_manager = null;
|
||||
string m_assemblyPath;
|
||||
// indicate whether the parameter files have been loaded. If yes, no need to load again.
|
||||
bool m_paramLoaded;
|
||||
|
||||
// set the paramName as key of dictionary for exclusiveness (the names of parameters should be unique)
|
||||
private Dictionary<string /*paramName*/, FamilyParam> m_familyParams;
|
||||
private DefinitionFile m_sharedFile;
|
||||
private string m_familyFilePath = string.Empty;
|
||||
private string m_sharedFilePath = string.Empty;
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// constructor
|
||||
/// </summary>
|
||||
/// <param name="app">
|
||||
/// the active revit application
|
||||
/// </param>
|
||||
/// <param name="doc">
|
||||
/// the family document which will have parameters added in
|
||||
/// </param>
|
||||
public FamilyParameterAssigner(Autodesk.Revit.ApplicationServices.Application app, Document doc)
|
||||
{
|
||||
m_app = app;
|
||||
m_manager = doc.FamilyManager;
|
||||
m_familyParams = new Dictionary<string, FamilyParam>();
|
||||
m_assemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
m_paramLoaded = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// load the family parameter file (if exists) and shared parameter file (if exists)
|
||||
/// only need to load once
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// if succeeded, return true; otherwise false
|
||||
/// </returns>
|
||||
public bool LoadParametersFromFile()
|
||||
{
|
||||
if (m_paramLoaded)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// load family parameter file
|
||||
bool famParamFileExist;
|
||||
bool succeeded = LoadFamilyParameterFromFile(out famParamFileExist);
|
||||
if (!succeeded)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// load shared parameter file
|
||||
bool sharedParamFileExist;
|
||||
succeeded = LoadSharedParameterFromFile(out sharedParamFileExist);
|
||||
if (!(famParamFileExist || sharedParamFileExist))
|
||||
{
|
||||
MessageManager.MessageBuff.AppendLine("Neither familyParameter.txt nor sharedParameter.txt exists in the assembly folder.");
|
||||
return false;
|
||||
}
|
||||
if (!succeeded)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
m_paramLoaded = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// load family parameters from the text file
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// return true if succeeded; otherwise false
|
||||
/// </returns>
|
||||
private bool LoadFamilyParameterFromFile(out bool exist)
|
||||
{
|
||||
exist = true;
|
||||
// step 1: find the file "FamilyParameter.txt" and open it
|
||||
string fileName = m_assemblyPath + "\\FamilyParameter.txt";
|
||||
if (!File.Exists(fileName))
|
||||
{
|
||||
exist = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
FileStream file = null;
|
||||
StreamReader reader = null;
|
||||
try
|
||||
{
|
||||
file = new FileStream(fileName, FileMode.Open, FileAccess.Read);
|
||||
reader = new StreamReader(file);
|
||||
|
||||
// step 2: read each line, if the line records the family parameter data, store it
|
||||
// record the content of the current line
|
||||
string line;
|
||||
// record the row number of the current line
|
||||
int lineNumber = 0;
|
||||
while (null != (line = reader.ReadLine()))
|
||||
{
|
||||
++lineNumber;
|
||||
// step 2.1: verify the line
|
||||
// check whether the line is blank line (contains only whitespaces)
|
||||
Match match = Regex.Match(line, @"^\s*$");
|
||||
if (true == match.Success)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// check whether the line starts from "#" or "*" (comment line)
|
||||
match = Regex.Match(line, @"\s*['#''*'].*");
|
||||
if (true == match.Success)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// step 2.2: get the parameter data
|
||||
// it's a valid line (has the format of "paramName paramGroup paramType isInstance", separate by tab or by spaces)
|
||||
// split the line to an array containing parameter items (format of string[] {"paramName", "paramGroup", "paramType", "isInstance"})
|
||||
string[] lineData = Regex.Split(line, @"\s+");
|
||||
// check whether the array has blank items (containing only spaces)
|
||||
List<string> values = new List<string>();
|
||||
foreach (string data in lineData)
|
||||
{
|
||||
match = Regex.Match(data, @"^\s*$");
|
||||
if (true == match.Success)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
values.Add(data);
|
||||
}
|
||||
|
||||
// verify the parameter items (should have 4 items exactly: paramName, paramGroup, paramType and isInstance)
|
||||
if (4 != values.Count)
|
||||
{
|
||||
MessageManager.MessageBuff.Append("Loading family parameter data from \"FamilyParam.txt\".");
|
||||
MessageManager.MessageBuff.Append("Line [\"" + line + "]\"" + "doesn't follow the valid format.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
// get the paramName
|
||||
string paramName = values[0];
|
||||
// get the paramGroup
|
||||
string groupString = values[1];
|
||||
// in case the groupString is format of "BuiltInParameterGroup.PG_Text", need to remove the "BuiltInParameterGroup.",
|
||||
// keep the "PG_Text" only
|
||||
int index = -1;
|
||||
if (0 <= (index = groupString.ToLower().IndexOf("builtinparametergroup")))
|
||||
{
|
||||
// why +1? need to remove the "." after "builtinparametergroup"
|
||||
groupString = groupString.Substring(index + 1 + "builtinparametergroup".Length);
|
||||
}
|
||||
BuiltInParameterGroup paramGroup = (BuiltInParameterGroup)Enum.Parse(typeof(BuiltInParameterGroup), groupString);
|
||||
|
||||
// get the paramType
|
||||
string typeString = values[2];
|
||||
if (0 <= (index = typeString.ToLower().IndexOf("parametertype")))
|
||||
{
|
||||
// why +1? need to remove the "." after "builtinparametergroup"
|
||||
typeString = typeString.Substring(index + 1 + "parametertype".Length);
|
||||
}
|
||||
ParameterType paramType = (ParameterType)Enum.Parse(typeof(ParameterType), typeString);
|
||||
// get data "isInstance"
|
||||
string isInstanceString = values[3];
|
||||
bool isInstance = Convert.ToBoolean(isInstanceString);
|
||||
|
||||
// step 2.3: store the parameter fetched, check for exclusiveness (as the names of parameters should keep unique)
|
||||
FamilyParam param = new FamilyParam(paramName, paramGroup, paramType, isInstance, lineNumber);
|
||||
// the family parameter with the same name has already been stored to the dictionary, raise an error
|
||||
if (m_familyParams.ContainsKey(paramName))
|
||||
{
|
||||
FamilyParam duplicatedParam = m_familyParams[paramName];
|
||||
string warning = "Line " + param.Line + "has a duplicate parameter name with Line " + duplicatedParam.Line + "\n";
|
||||
MessageManager.MessageBuff.Append(warning);
|
||||
continue;
|
||||
}
|
||||
m_familyParams.Add(paramName, param);
|
||||
}
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
MessageManager.MessageBuff.AppendLine(e.Message);
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (null != reader)
|
||||
{
|
||||
reader.Close();
|
||||
}
|
||||
if (null != file)
|
||||
{
|
||||
file.Close();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// load family parameters from the text file
|
||||
/// </summary>
|
||||
/// <param name="exist">
|
||||
/// indicate whether the shared parameter file exists
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// return true if succeeded; otherwise false
|
||||
/// </returns>
|
||||
private bool LoadSharedParameterFromFile(out bool exist)
|
||||
{
|
||||
exist = true;
|
||||
string filePath = m_assemblyPath + "\\SharedParameter.txt";
|
||||
if (!File.Exists(filePath))
|
||||
{
|
||||
exist = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
m_app.SharedParametersFilename = filePath;
|
||||
try
|
||||
{
|
||||
m_sharedFile = m_app.OpenSharedParameterFile();
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
MessageManager.MessageBuff.AppendLine(e.Message);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// add parameters to the family file
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// if succeeded, return true; otherwise false
|
||||
/// </returns>
|
||||
public bool AddParameters()
|
||||
{
|
||||
// add the loaded family parameters to the family
|
||||
bool succeeded = AddFamilyParameter();
|
||||
if (!succeeded)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// add the loaded shared parameters to the family
|
||||
succeeded = AddSharedParameter();
|
||||
if (!succeeded)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// add family parameter to the family
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// if succeeded, return true; otherwise false
|
||||
/// </returns>
|
||||
private bool AddFamilyParameter()
|
||||
{
|
||||
bool allParamValid = true;
|
||||
if (File.Exists(m_familyFilePath) &&
|
||||
0 == m_familyParams.Count)
|
||||
{
|
||||
MessageManager.MessageBuff.AppendLine("No family parameter available for adding.");
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (FamilyParameter param in m_manager.Parameters)
|
||||
{
|
||||
string name = param.Definition.Name;
|
||||
if (m_familyParams.ContainsKey(name))
|
||||
{
|
||||
allParamValid = false;
|
||||
FamilyParam famParam = m_familyParams[name];
|
||||
MessageManager.MessageBuff.Append("Line " + famParam.Line + ": paramName \"" + famParam.Name + "\"already exists in the family document.\n");
|
||||
}
|
||||
}
|
||||
|
||||
// there're errors in the family parameter text file
|
||||
if (!allParamValid)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (FamilyParam param in m_familyParams.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
m_manager.AddParameter(param.Name, param.Group, param.Type, param.IsInstance);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
MessageManager.MessageBuff.AppendLine(e.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// load shared parameters from shared parameter file and add them to family
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// if succeeded, return true; otherwise false
|
||||
/// </returns>
|
||||
private bool AddSharedParameter()
|
||||
{
|
||||
if (File.Exists(m_sharedFilePath) &&
|
||||
null == m_sharedFile)
|
||||
{
|
||||
MessageManager.MessageBuff.AppendLine("SharedParameter.txt has an invalid format.");
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (DefinitionGroup group in m_sharedFile.Groups)
|
||||
{
|
||||
foreach (ExternalDefinition def in group.Definitions)
|
||||
{
|
||||
// check whether the parameter already exists in the document
|
||||
FamilyParameter param = m_manager.get_Parameter(def.Name);
|
||||
if (null != param)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
m_manager.AddParameter(def, def.ParameterGroup, true);
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
MessageManager.MessageBuff.AppendLine(e.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}// end of class "FamilyParameterAssigner"
|
||||
|
||||
/// <summary>
|
||||
/// record the data of a parameter: its name, its group, etc
|
||||
/// </summary>
|
||||
class FamilyParam
|
||||
{
|
||||
string m_name;
|
||||
/// <summary>
|
||||
/// the caption of the parameter
|
||||
/// </summary>
|
||||
public string Name
|
||||
{
|
||||
get { return m_name; }
|
||||
}
|
||||
|
||||
BuiltInParameterGroup m_group;
|
||||
/// <summary>
|
||||
/// the group of the parameter
|
||||
/// </summary>
|
||||
public BuiltInParameterGroup Group
|
||||
{
|
||||
get { return m_group; }
|
||||
}
|
||||
|
||||
ParameterType m_type;
|
||||
/// <summary>
|
||||
/// the type of the parameter
|
||||
/// </summary>
|
||||
public ParameterType Type
|
||||
{
|
||||
get { return m_type; }
|
||||
}
|
||||
|
||||
bool m_isInstance;
|
||||
/// <summary>
|
||||
/// indicate whether the parameter is an instance parameter or a type parameter
|
||||
/// </summary>
|
||||
public bool IsInstance
|
||||
{
|
||||
get { return m_isInstance; }
|
||||
}
|
||||
|
||||
int m_line;
|
||||
/// <summary>
|
||||
/// record the location of this parameter in the family parameter file
|
||||
/// </summary>
|
||||
public int Line
|
||||
{
|
||||
get { return m_line; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// default constructor, hide this by making it "private"
|
||||
/// </summary>
|
||||
private FamilyParam()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// constructor which exposes for invoking
|
||||
/// </summary>
|
||||
/// <param name="name">
|
||||
/// parameter name
|
||||
/// </param>
|
||||
/// <param name="group">
|
||||
/// indicate which group the parameter belongs to
|
||||
/// </param>
|
||||
/// <param name="type">
|
||||
/// the type of the parameter
|
||||
/// </param>
|
||||
/// <param name="isInstance">
|
||||
/// indicate whethe the parameter is an instance parameter
|
||||
/// </param>
|
||||
/// <param name="line">
|
||||
/// record the location of this parameter in the family parameter file
|
||||
/// </param>
|
||||
public FamilyParam(string name, BuiltInParameterGroup group, ParameterType type, bool isInstance, int line)
|
||||
{
|
||||
m_name = name;
|
||||
m_group = group;
|
||||
m_type = type;
|
||||
m_isInstance = isInstance;
|
||||
m_line = line;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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("AutoParameter")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Autodesk")]
|
||||
[assembly: AssemblyProduct("AutoParameter")]
|
||||
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2009")]
|
||||
[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("ada3d2b6-01c5-4c69-9b4b-3bf1c24423ce")]
|
||||
|
||||
// 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")]
|
||||
@@ -1,241 +0,0 @@
|
||||
{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe2052\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
|
||||
{\f11\fbidi \fmodern\fcharset128\fprq1{\*\panose 02020609040205080304}MS Mincho{\*\falt \'82\'6c\'82\'72 \'96\'be\'92\'a9};}{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt \'cb\'ce\'cc\'e5};}
|
||||
{\f34\fbidi \froman\fcharset1\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f39\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@SimSun;}{\f40\fbidi \fmodern\fcharset128\fprq1{\*\panose 02020609040205080304}@MS Mincho;}
|
||||
{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt \'cb\'ce\'cc\'e5};}
|
||||
{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
|
||||
{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt \'cb\'ce\'cc\'e5};}
|
||||
{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f41\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
|
||||
{\f42\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f44\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f45\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f46\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
|
||||
{\f47\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f48\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f49\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f51\fbidi \fswiss\fcharset238\fprq2 Arial CE;}
|
||||
{\f52\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}{\f54\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f55\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f56\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}
|
||||
{\f57\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}{\f58\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f59\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}
|
||||
{\f153\fbidi \fmodern\fcharset0\fprq1 MS Mincho Western{\*\falt \'82\'6c\'82\'72 \'96\'be\'92\'a9};}{\f151\fbidi \fmodern\fcharset238\fprq1 MS Mincho CE{\*\falt \'82\'6c\'82\'72 \'96\'be\'92\'a9};}
|
||||
{\f152\fbidi \fmodern\fcharset204\fprq1 MS Mincho Cyr{\*\falt \'82\'6c\'82\'72 \'96\'be\'92\'a9};}{\f154\fbidi \fmodern\fcharset161\fprq1 MS Mincho Greek{\*\falt \'82\'6c\'82\'72 \'96\'be\'92\'a9};}
|
||||
{\f155\fbidi \fmodern\fcharset162\fprq1 MS Mincho Tur{\*\falt \'82\'6c\'82\'72 \'96\'be\'92\'a9};}{\f158\fbidi \fmodern\fcharset186\fprq1 MS Mincho Baltic{\*\falt \'82\'6c\'82\'72 \'96\'be\'92\'a9};}
|
||||
{\f173\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt \'cb\'ce\'cc\'e5};}{\f433\fbidi \fnil\fcharset0\fprq2 @SimSun Western;}{\f443\fbidi \fmodern\fcharset0\fprq1 @MS Mincho Western;}{\f441\fbidi \fmodern\fcharset238\fprq1 @MS Mincho CE;}
|
||||
{\f442\fbidi \fmodern\fcharset204\fprq1 @MS Mincho Cyr;}{\f444\fbidi \fmodern\fcharset161\fprq1 @MS Mincho Greek;}{\f445\fbidi \fmodern\fcharset162\fprq1 @MS Mincho Tur;}{\f448\fbidi \fmodern\fcharset186\fprq1 @MS Mincho Baltic;}
|
||||
{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
|
||||
{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
||||
{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt \'cb\'ce\'cc\'e5};}
|
||||
{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
|
||||
{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
|
||||
{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
|
||||
{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
|
||||
{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
||||
{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt \'cb\'ce\'cc\'e5};}
|
||||
{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}
|
||||
{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
|
||||
{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
|
||||
{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
|
||||
\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1
|
||||
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025
|
||||
\ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext0 \sqformat \spriority0 Normal;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
|
||||
\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
|
||||
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
|
||||
\snext11 \ssemihidden \sunhideused \sqformat Normal Table;}}{\*\rsidtbl \rsid5400579\rsid13842053}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator Carl Zhang}
|
||||
{\creatim\yr2010\mo3\dy4\hr16\min58}{\revtim\yr2010\mo3\dy4\hr16\min59}{\version3}{\edmins1}{\nofpages2}{\nofwords479}{\nofchars3088}{\nofcharsws3560}{\vern32771}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
|
||||
\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
|
||||
\widowctrl\ftnbj\aenddoc\trackmoves1\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120\dghorigin1701
|
||||
\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\rsidroot5400579 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2
|
||||
\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6
|
||||
\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang
|
||||
{\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\af31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 {
|
||||
\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 Application:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 AutoParameter}{\rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0
|
||||
\b\f0\fs20\insrsid13842053
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 Revit Platform:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 All\line }{\rtlch\fcs1 \ab\af1\afs20
|
||||
\ltrch\fcs0 \b\f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 Revit Version:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 2011.0\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0
|
||||
\b\f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 First Released For:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 2010.0\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid13842053
|
||||
\hich\af1\dbch\af31505\loch\f1 Programming Language:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 C#\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1
|
||||
Skill Level:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 Medium\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 Category:}{\rtlch\fcs1 \af1\afs20
|
||||
\ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 Parameters, Families\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 Type:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0
|
||||
\f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 ExternalCommand\line \line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 Subject:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053
|
||||
\hich\af1\dbch\af31505\loch\f1 Auto add parameters to family document}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid13842053 .}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0
|
||||
\b\f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 Summary:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 \line \hich\af1\dbch\af31505\loch\f1
|
||||
This sample demonstrates how to automatically add parameters (shared or not) to family documents}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid13842053 .}{\rtlch\fcs1 \ai\af0\afs20 \ltrch\fcs0 \i\f0\fs20\insrsid13842053
|
||||
\par }{\rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f0\fs20\insrsid13842053
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 Classes: }{\rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f0\fs20\insrsid13842053
|
||||
\par }\pard \ltrpar\ql \fi360\li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid5400579
|
||||
\hich\af1\dbch\af31505\loch\f1 UI.}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 IExternalCommand}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid13842053
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.\hich\af1\dbch\af31505\loch\f1 Document}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid13842053
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid5400579 \hich\af1\dbch\af31505\loch\f1 DB.}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0
|
||||
\f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 FamilyManager
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 DB.}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 FamilyParameter
|
||||
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 DB}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 .ExternalDefinition}{
|
||||
\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid13842053
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f0\fs20\insrsid13842053
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 Project Files:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Command.cs}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid13842053
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1
|
||||
This file contains 2 classes: AddParameterToFamily and AddParameterToFamilies. AddParameterToFamily implements the Execute method and be used to add parameters to the active family document. AddPar\hich\af1\dbch\af31505\loch\f1 \hich\f1
|
||||
ameterToFamilies implements the Execute method and be used to add parameters to all families in the \'93\loch\f1 \hich\f1 AutoParameter_Families\'94\loch\f1 \hich\f1 folder under \'93\loch\f1 \hich\f1 My Documents\'94\loch\f1 folder}{\rtlch\fcs1
|
||||
\af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid13842053 .
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 FamilyParameterAssigner.cs
|
||||
\par \hich\af1\dbch\af31505\loch\f1 This file contains the class FamilyParameterAssigner. This cla\hich\af1\dbch\af31505\loch\f1 ss adds all the parameters to the family file}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid13842053 .
|
||||
\par
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 Description:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1
|
||||
\par \hich\af1\dbch\af31505\loch\f1 This sample utilizes FamilyManager class to implement the features: add parameters (shared or not) to the specified family file}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid13842053 .
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\tx360\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 -\tab \hich\af1\dbch\af31505\loch\f1 To add family parameters, use the AddParameter(String paramName
|
||||
\hich\af1\dbch\af31505\loch\f1 , BuiltInParameterGroup paramGroup, ParameterType paramType, bool isInstance) method;
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 -\tab \hich\af1\dbch\af31505\loch\f1
|
||||
To add shared parameters, use the AddParameter(ExternalDefinition familyDefinition, BuiltInParameterGroup paramGroup}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid13842053 ,}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053
|
||||
\hich\af1\dbch\af31505\loch\f1 bool isInstance) method;}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid13842053
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid13842053
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 Instructions:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\cf2\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\cf2\insrsid13842053
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\tx360\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 1.\tab \hich\af1\dbch\af31505\loch\f1
|
||||
In order to auto-add parameters to family files, user should prepare the parameter files: family parameter file and shared parameter file.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid13842053
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 \hich\f1 The family parameter file should be named as \'93\loch\f1 \hich\f1
|
||||
familyParameter.txt\'94\loch\f1 and put in the same folder as the sample DLL. }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid13842053
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 The\hich\af1\dbch\af31505\loch\f1 \hich\f1 shared parameter file should be named as \'93\loch\f1 \hich\f1 sharedParameter.txt\'94\loch\f1
|
||||
and put in the same folder as the sample DLL.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid13842053
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid13842053 \hich\af1\dbch\af31505\loch\f1 Here is a sample for how to organize the files:}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid13842053
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid13842053
|
||||
\par }\pard \ltrpar\ql \li720\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin720\itap0 {\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid13842053 \hich\af0\dbch\af31505\loch\f0 RootFolder:
|
||||
\par }{\rtlch\fcs1 \af11\afs24 \ltrch\fcs0 \fs24\loch\af11\hich\af0\dbch\af11\insrsid13842053 \loch\af11\hich\af0\dbch\f11 \uc2\u9474\'84\'a0}{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \fs24\loch\af0\hich\af0\dbch\af11\insrsid13842053 \hich\af0\dbch\af11\loch\f0
|
||||
AutoParameter.dll\tab }{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \fs24\highlight16\loch\af0\hich\af0\dbch\af11\insrsid13842053 \hich\af0\dbch\af11\loch\f0 (this is the sample DLL)}{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0
|
||||
\fs24\loch\af0\hich\af0\dbch\af11\insrsid13842053
|
||||
\par \hich\af0\dbch\af11\loch\f0 }{\rtlch\fcs1 \af11\afs24 \ltrch\fcs0 \fs24\loch\af11\hich\af0\dbch\af11\insrsid13842053 \loch\af11\hich\af0\dbch\f11 \uc2\u9474\'84\'a0}{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \fs24\loch\af0\hich\af0\dbch\af11\insrsid13842053
|
||||
\hich\af0\dbch\af11\loch\f0 SharedParameter.txt
|
||||
\par \hich\af0\dbch\af11\loch\f0 }{\rtlch\fcs1 \af11\afs24 \ltrch\fcs0 \fs24\loch\af11\hich\af0\dbch\af11\insrsid13842053 \loch\af11\hich\af0\dbch\f11 \uc2\u9474\'84\'a0}{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \fs24\loch\af0\hich\af0\dbch\af11\insrsid13842053
|
||||
\hich\af0\dbch\af11\loch\f0 FamilyParameter.txt
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \fs20\loch\af0\hich\af0\dbch\af11\insrsid13842053
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\tx360\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \fs20\loch\af1\hich\af1\dbch\af11\insrsid13842053 \hich\af1\dbch\af11\loch\f1 2.\tab \hich\f1
|
||||
The format for the parameter files: for shared parameter file, it follows the format of Revit shared parameter file; for family parameter file, it has a similar format: Every line starts with \'93\loch\f1 \hich\f1 #\'94\loch\f1 \hich\f1 or \'93\loch\f1
|
||||
\hich\f1 *\'94\loch\f1 will be treated as the\hich\af1\dbch\af11\loch\f1 \hich\f1 comment line and will be skipped, every parameter line should follow this format: \'93\loch\f1 ParamName\tab ParamGroup\tab ParamType\tab \hich\f1 IsInstance\'94\loch\f1
|
||||
, and be separated by spaces}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \fs20\loch\af0\hich\af0\dbch\af11\insrsid13842053 .
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \fs20\loch\af1\hich\af1\dbch\af11\insrsid13842053 \hich\af1\dbch\af11\loch\f1 Here is a template for the family parameter file: }{
|
||||
\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \fs20\loch\af0\hich\af0\dbch\af11\insrsid13842053
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \fs20\loch\af1\hich\af1\dbch\af11\insrsid13842053 \hich\af1\dbch\af11\loch\f1 # This is a Revit family parameter file.
|
||||
\par \hich\af1\dbch\af11\loch\f1 # allows\hich\af1\dbch\af11\loch\f1 to edit manually.
|
||||
\par \hich\af1\dbch\af11\loch\f1 # make sure the "ParamGroup" and "ParamType" values are correct (with or without #"BuiltInParameterGroup." and "ParameterType." doesn't affect the features).
|
||||
\par
|
||||
\par \hich\af1\dbch\af11\loch\f1 *ParamName\tab ParamGroup\tab ParamType\tab IsInstance
|
||||
\par \hich\af1\dbch\af11\loch\f1 FamilyParam1\tab PG_TEXT\tab \tab Text\tab false
|
||||
\par \hich\af1\dbch\af11\loch\f1 Fa\hich\af1\dbch\af11\loch\f1 milyParam2\tab BuiltInParameterGroup.PG_TEXT\tab ParameterType.Text\tab true
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \fs20\loch\af0\hich\af0\dbch\af11\insrsid13842053
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\tx360\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \fs20\loch\af1\hich\af1\dbch\af11\insrsid13842053 \hich\af1\dbch\af11\loch\f1 3.\tab \hich\f1
|
||||
In order to add parameters to a family file, Launch Revit, open the family file, and click the external command \'93\loch\f1 \hich\f1 AddParameterToFamily\'94\hich\af1\dbch\af11\loch\f1
|
||||
, all parameters (shared or not) will be added to the active family document;}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \fs20\loch\af0\hich\af0\dbch\af11\insrsid13842053
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \fs20\loch\af1\hich\af1\dbch\af11\insrsid13842053 \hich\af1\dbch\af11\loch\f1 4.\tab
|
||||
In order to add parameters to multiple family files, need to follow the steps:
|
||||
\par }\pard \ltrpar\ql \fi-420\li840\ri0\nowidctlpar\tx840\wrapdefault\faauto\rin0\lin840\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \fs20\loch\af1\hich\af1\dbch\af11\insrsid13842053 \hich\af1\dbch\af11\loch\f1 a)\tab \hich\f1 Create a folder \'93\loch\f1
|
||||
\hich\f1 AutoParameter_Families\'94\loch\f1 \hich\f1 in \'93\loch\f1 \hich\f1 My Documents\'94\loch\f1 folder;
|
||||
\par }\pard \ltrpar\ql \fi-420\li840\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin840\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \fs20\loch\af1\hich\af1\dbch\af11\insrsid13842053 \hich\af1\dbch\af11\loch\f1 b)\tab Put all the family file
|
||||
\hich\af1\dbch\af11\loch\f1 s into that new folder, make sure all files are write-able (if some files are read-only, the parameters can\hich\f1 \rquote \loch\f1 t be added in.);}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\fs20\loch\af0\hich\af0\dbch\af11\insrsid13842053
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \fs20\loch\af1\hich\af1\dbch\af11\insrsid13842053 \hich\af1\dbch\af11\loch\f1 c)\tab \hich\f1 Launch Revit, create a project, click the external command \'93\loch\f1 \hich\f1 AddParameterToFamilies\'94\loch\f1
|
||||
, all the parameters will be added to all the\hich\af1\dbch\af11\loch\f1 \hich\f1 family files in the \'93\loch\f1 \hich\f1 AutoParameter_Families\'94\loch\f1 folder
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \fs20\loch\af0\hich\af0\dbch\af11\insrsid13842053
|
||||
\par }{\*\themedata 504b030414000600080000002100828abc13fa0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb6ac3301045f785fe83d0b6d8
|
||||
72ba28a5d8cea249777d2cd20f18e4b12d6a8f843409c9df77ecb850ba082d74231062ce997b55ae8fe3a00e1893f354e9555e6885647de3a8abf4fbee29bbd7
|
||||
2a3150038327acf409935ed7d757e5ee14302999a654e99e393c18936c8f23a4dc072479697d1c81e51a3b13c07e4087e6b628ee8cf5c4489cf1c4d075f92a0b
|
||||
44d7a07a83c82f308ac7b0a0f0fbf90c2480980b58abc733615aa2d210c2e02cb04430076a7ee833dfb6ce62e3ed7e14693e8317d8cd0433bf5c60f53fea2fe7
|
||||
065bd80facb647e9e25c7fc421fd2ddb526b2e9373fed4bb902e182e97b7b461e6bfad3f010000ffff0300504b030414000600080000002100a5d6a7e7c00000
|
||||
00360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4fc7060abb08
|
||||
84a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b63095120f88d94fbc
|
||||
52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462a1a82fe353
|
||||
bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f7468656d652f7468
|
||||
656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b4b0d592c9c
|
||||
070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b4757e8d3f7
|
||||
29e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f7468656d65
|
||||
312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87615b8116d8
|
||||
a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad79482a9c04
|
||||
98f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b5d8a314d3c
|
||||
94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab999fb7b471
|
||||
7509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9699640f671
|
||||
9e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd5868b37a088d1
|
||||
e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d60cf03ac1a5
|
||||
193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f9e7ef3f2d1
|
||||
17d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be15c308d3f2
|
||||
8acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a99793849c26ae6
|
||||
6252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d32a423279a
|
||||
668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2af074481847
|
||||
bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86e877f0034e
|
||||
16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb44f95d843b
|
||||
5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a6409fb44d0
|
||||
8741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c3d9058edf2
|
||||
c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db02565e85f3b966
|
||||
0d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276b9f7dec44b
|
||||
7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8c33585b5fb
|
||||
9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e51440ca2e0
|
||||
088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95b21be5ceaf
|
||||
8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff6dce591a26
|
||||
ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec69ffb9e65d0
|
||||
28d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239b75a5bb1e6
|
||||
345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a44959d366ad93
|
||||
b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e82db8df9f30
|
||||
254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f74
|
||||
68656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f24
|
||||
51eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e3198
|
||||
720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528
|
||||
a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100828abc13fa0000001c0200001300000000000000000000000000
|
||||
000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b000000000000000000000000
|
||||
002b0100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c00000000000000000000000000140200007468
|
||||
656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b000016000000000000000000
|
||||
00000000d10200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b010000270000000000
|
||||
00000000000000009b0900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000960a00000000}
|
||||
{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
|
||||
617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
|
||||
6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
|
||||
656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
|
||||
{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
|
||||
\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
|
||||
\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
|
||||
\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
|
||||
4d73786d6c322e534158584d4c5265616465722e352e3000000000000000000000060000
|
||||
d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffffec69d9888b8b3d4c859eaf6cd158be0f000000000000000000000000b030
|
||||
6cf878bbca01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000105000000000000}}
|
||||
Binary file not shown.
@@ -1,412 +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 Autodesk.Revit;
|
||||
using Autodesk.Revit.Creation;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using Autodesk.Revit.DB.Mechanical;
|
||||
using Autodesk.Revit.DB.Plumbing;
|
||||
|
||||
namespace Revit.SDK.Samples.CreateAirHandler.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Create one air handler and add connectors.
|
||||
/// </summary>
|
||||
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
|
||||
[Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
|
||||
[Autodesk.Revit.Attributes.Journaling(Autodesk.Revit.Attributes.JournalingMode.NoCommandData)]
|
||||
public class Command : IExternalCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// The revit application
|
||||
/// </summary>
|
||||
private static Autodesk.Revit.ApplicationServices.Application m_application;
|
||||
|
||||
/// <summary>
|
||||
/// The current document of the application
|
||||
/// </summary>
|
||||
private static Autodesk.Revit.DB.Document m_document;
|
||||
|
||||
/// <summary>
|
||||
/// the factory to creaate extrusions and connectors
|
||||
/// </summary>
|
||||
private FamilyItemFactory f;
|
||||
|
||||
/// <summary>
|
||||
/// the extrusion array
|
||||
/// </summary>
|
||||
private Extrusion[] extrusions;
|
||||
|
||||
/// <summary>
|
||||
/// The list of all the elements to be combined in the air handler system
|
||||
/// </summary>
|
||||
private CombinableElementArray m_combineElements;
|
||||
|
||||
#region Data used to create extrusions and connectors
|
||||
/// <summary>
|
||||
/// Data to create extrusions and connectors
|
||||
/// </summary>
|
||||
private Autodesk.Revit.DB.XYZ[,] profileData = new Autodesk.Revit.DB.XYZ[5, 4]
|
||||
{
|
||||
// In Array 0 to 2, the data is the points that defines the edges of the profile
|
||||
{
|
||||
new Autodesk.Revit.DB.XYZ (-17.28, -0.53, 0.9),
|
||||
new Autodesk.Revit.DB.XYZ (-17.28, 11, 0.9),
|
||||
new Autodesk.Revit.DB.XYZ (-0.57, 11, 0.9),
|
||||
new Autodesk.Revit.DB.XYZ (-0.57, -0.53, 0.9)
|
||||
},
|
||||
{
|
||||
new Autodesk.Revit.DB.XYZ (-0.57, 7, 6.58),
|
||||
new Autodesk.Revit.DB.XYZ (-0.57, 7, 3),
|
||||
new Autodesk.Revit.DB.XYZ (-0.57, 3.6, 3),
|
||||
new Autodesk.Revit.DB.XYZ (-0.57, 3.6, 6.58)
|
||||
},
|
||||
{
|
||||
new Autodesk.Revit.DB.XYZ (-17.28, -0.073, 7.17),
|
||||
new Autodesk.Revit.DB.XYZ (-17.28, 10.76, 7.17),
|
||||
new Autodesk.Revit.DB.XYZ (-17.28, 10.76, 3.58),
|
||||
new Autodesk.Revit.DB.XYZ (-17.28, -0.073, 3.58)
|
||||
},
|
||||
// In Array 3 and 4, the data is the normal and origin of the plane of the arc profile
|
||||
{
|
||||
new Autodesk.Revit.DB.XYZ (0, -1, 0),
|
||||
new Autodesk.Revit.DB.XYZ (-9, 0.53, 7.17),
|
||||
null,
|
||||
null
|
||||
},
|
||||
{
|
||||
new Autodesk.Revit.DB.XYZ (0, -1, 0),
|
||||
new Autodesk.Revit.DB.XYZ (-8.24, 0.53, 0.67),
|
||||
null,
|
||||
null
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// the normal and origin of the sketch plane
|
||||
/// </summary>
|
||||
private Autodesk.Revit.DB.XYZ[,] sketchPlaneData = new Autodesk.Revit.DB.XYZ[5, 2]
|
||||
{
|
||||
{new Autodesk.Revit.DB.XYZ (0, 0, 1), new Autodesk.Revit.DB.XYZ (0, 0, 0.9)},
|
||||
{new Autodesk.Revit.DB.XYZ (1, 0, 0), new Autodesk.Revit.DB.XYZ (-0.57, 0, 0)},
|
||||
{new Autodesk.Revit.DB.XYZ (-1, 0, 0), new Autodesk.Revit.DB.XYZ (-17.28, 0, 0)},
|
||||
{new Autodesk.Revit.DB.XYZ (0, -1, 0), new Autodesk.Revit.DB.XYZ (0, 0.53, 0)},
|
||||
{new Autodesk.Revit.DB.XYZ (0, -1, 0), new Autodesk.Revit.DB.XYZ (0, 0.53, 0)}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// the start and end offsets of the extrusion
|
||||
/// </summary>
|
||||
private double[,] extrusionOffsets = new double[5, 2]
|
||||
{
|
||||
{-0.9, 6.77},
|
||||
{0, -0.18},
|
||||
{0, -0.08},
|
||||
{1, 1.15},
|
||||
{1, 1.15}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// whether the extrusion is solid
|
||||
/// </summary>
|
||||
private bool[] isSolid = new bool[5] { true, false, false, true, true };
|
||||
|
||||
/// <summary>
|
||||
/// the radius of the arc profile
|
||||
/// </summary>
|
||||
private double arcRadius = 0.17;
|
||||
|
||||
/// <summary>
|
||||
/// the height and width of the connector
|
||||
/// </summary>
|
||||
private double[,] connectorDimensions = new double[2, 2]
|
||||
{
|
||||
{3.58, 3.4},
|
||||
{3.59, 10.833}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// the flow of the connector
|
||||
/// </summary>
|
||||
private double flow = 547;
|
||||
|
||||
/// <summary>
|
||||
/// Transaction of ExternalCommand
|
||||
/// </summary>
|
||||
private Transaction m_transaction;
|
||||
#endregion
|
||||
|
||||
#region IExternalCommand Members
|
||||
/// <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>
|
||||
public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData, ref string message,
|
||||
ElementSet elements)
|
||||
{
|
||||
// set out default result to failure.
|
||||
Autodesk.Revit.UI.Result retRes = Autodesk.Revit.UI.Result.Failed;
|
||||
m_application = commandData.Application.Application;
|
||||
m_document = commandData.Application.ActiveUIDocument.Document;
|
||||
f = m_document.FamilyCreate;
|
||||
extrusions = new Extrusion[5];
|
||||
m_combineElements = new CombinableElementArray();
|
||||
|
||||
m_transaction = new Transaction(m_document, "External Tool");
|
||||
m_transaction.Start();
|
||||
|
||||
if (m_document.OwnerFamily.FamilyCategory.Name !=
|
||||
m_document.Settings.Categories.get_Item(BuiltInCategory.OST_MechanicalEquipment).Name) // FamilyCategory.Name is not "Mechanical Equipment".
|
||||
{
|
||||
message = "Please make sure you opened a template of Mechanical Equipment.";
|
||||
return retRes;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
CreateExtrusions();
|
||||
m_document.Regenerate();
|
||||
CreateConnectors();
|
||||
m_document.Regenerate();
|
||||
m_document.CombineElements(m_combineElements);
|
||||
m_document.Regenerate();
|
||||
}
|
||||
catch (Exception x)
|
||||
{
|
||||
m_transaction.RollBack();
|
||||
message = x.Message;
|
||||
return retRes;
|
||||
}
|
||||
|
||||
m_transaction.Commit();
|
||||
|
||||
retRes = Autodesk.Revit.UI.Result.Succeeded;
|
||||
return retRes;
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// get all planar faces of an extrusion
|
||||
/// </summary>
|
||||
/// <param name="extrusion">the extrusion to read</param>
|
||||
/// <returns>a list of all planar faces of the extrusion</returns>
|
||||
public List<PlanarFace> GetPlanarFaces(Extrusion extrusion)
|
||||
{
|
||||
// the option to get geometry elements
|
||||
Options m_geoOptions = m_application.Create.NewGeometryOptions();
|
||||
m_geoOptions.View = m_document.ActiveView;
|
||||
m_geoOptions.ComputeReferences = true;
|
||||
|
||||
// get the planar faces
|
||||
List<PlanarFace> m_planarFaces = new List<PlanarFace>();
|
||||
Autodesk.Revit.DB.GeometryElement geoElement = extrusion.get_Geometry(m_geoOptions);
|
||||
//foreach (GeometryObject geoObject in geoElement.Objects)
|
||||
IEnumerator<GeometryObject> Objects = geoElement.GetEnumerator();
|
||||
while (Objects.MoveNext())
|
||||
{
|
||||
GeometryObject geoObject = Objects.Current;
|
||||
|
||||
Solid geoSolid = geoObject as Solid;
|
||||
if (null == geoSolid)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
foreach (Face geoFace in geoSolid.Faces)
|
||||
{
|
||||
if (geoFace is PlanarFace)
|
||||
{
|
||||
m_planarFaces.Add(geoFace as PlanarFace);
|
||||
}
|
||||
}
|
||||
}
|
||||
return m_planarFaces;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// create the extrusions of the air handler system
|
||||
/// </summary>
|
||||
private void CreateExtrusions()
|
||||
{
|
||||
Autodesk.Revit.Creation.Application app = m_application.Create;
|
||||
CurveArray curves = null;
|
||||
CurveArrArray profile = null;
|
||||
Plane plane = null;
|
||||
SketchPlane sketchPlane = null;
|
||||
|
||||
#region Create the cuboid extrusions
|
||||
|
||||
for (int i = 0; i <= 2; ++i)
|
||||
{
|
||||
// create the profile
|
||||
curves = app.NewCurveArray();
|
||||
curves.Append(Line.CreateBound(profileData[i, 0], profileData[i, 1]));
|
||||
curves.Append(Line.CreateBound(profileData[i, 1], profileData[i, 2]));
|
||||
curves.Append(Line.CreateBound(profileData[i, 2], profileData[i, 3]));
|
||||
curves.Append(Line.CreateBound(profileData[i, 3], profileData[i, 0]));
|
||||
profile = app.NewCurveArrArray();
|
||||
profile.Append(curves);
|
||||
|
||||
// create the sketch plane
|
||||
plane = Plane.CreateByNormalAndOrigin(sketchPlaneData[i, 0], sketchPlaneData[i, 1]);
|
||||
sketchPlane = SketchPlane.Create(m_document, plane);
|
||||
|
||||
// create the extrusion
|
||||
extrusions[i] = f.NewExtrusion(isSolid[i], profile, sketchPlane,
|
||||
extrusionOffsets[i, 1]);
|
||||
extrusions[i].StartOffset = extrusionOffsets[i, 0];
|
||||
m_combineElements.Append(extrusions[i]);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Create the round extrusions
|
||||
|
||||
for (int i = 3; i <= 4; ++i)
|
||||
{
|
||||
// create the profile
|
||||
profile = app.NewCurveArrArray();
|
||||
|
||||
curves = app.NewCurveArray();
|
||||
plane = Plane.CreateByNormalAndOrigin(profileData[i, 0], profileData[i, 1]);
|
||||
curves.Append(Arc.Create(plane, arcRadius, 0, Math.PI * 2));
|
||||
profile.Append(curves);
|
||||
|
||||
// create the sketch plane
|
||||
plane = Plane.CreateByNormalAndOrigin(sketchPlaneData[i, 0], sketchPlaneData[i, 1]);
|
||||
sketchPlane = SketchPlane.Create(m_document, plane);
|
||||
|
||||
// create the extrusion
|
||||
extrusions[i] = f.NewExtrusion(isSolid[i], profile, sketchPlane,
|
||||
extrusionOffsets[i, 1]);
|
||||
extrusions[i].StartOffset = extrusionOffsets[i, 0];
|
||||
m_combineElements.Append(extrusions[i]);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// create the connectors on the extrusions
|
||||
/// </summary>
|
||||
private void CreateConnectors()
|
||||
{
|
||||
List<PlanarFace> m_planarFaces = null;
|
||||
Parameter param = null;
|
||||
|
||||
#region Create the Supply Air duct connector
|
||||
|
||||
// get the planar faces of extrusion1
|
||||
m_planarFaces = GetPlanarFaces(extrusions[1]);
|
||||
|
||||
// create the Supply Air duct connector
|
||||
//DuctConnector connSupplyAir = f.NewDuctConnector(m_planarFaces[0].Reference,
|
||||
// DuctSystemType.SupplyAir);
|
||||
ConnectorElement connSupplyAir = ConnectorElement.CreateDuctConnector(m_document, DuctSystemType.SupplyAir, ConnectorProfileType.Rectangular, m_planarFaces[0].Reference);
|
||||
param = connSupplyAir.get_Parameter(BuiltInParameter.CONNECTOR_HEIGHT);
|
||||
param.Set(connectorDimensions[0, 0]);
|
||||
param = connSupplyAir.get_Parameter(BuiltInParameter.CONNECTOR_WIDTH);
|
||||
param.Set(connectorDimensions[0, 1]);
|
||||
param = connSupplyAir.get_Parameter(BuiltInParameter.RBS_DUCT_FLOW_DIRECTION_PARAM);
|
||||
param.Set(2);
|
||||
param = connSupplyAir.get_Parameter(BuiltInParameter.RBS_DUCT_FLOW_CONFIGURATION_PARAM);
|
||||
param.Set(1);
|
||||
param = connSupplyAir.get_Parameter(BuiltInParameter.RBS_DUCT_FLOW_PARAM);
|
||||
param.Set(flow);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Create the Return Air duct connector
|
||||
|
||||
// get the planar faces of extrusion2
|
||||
m_planarFaces = GetPlanarFaces(extrusions[2]);
|
||||
|
||||
// create the Return Air duct connector
|
||||
//DuctConnector connReturnAir = f.NewDuctConnector(m_planarFaces[0].Reference,
|
||||
// DuctSystemType.ReturnAir);
|
||||
ConnectorElement connReturnAir = ConnectorElement.CreateDuctConnector(m_document, DuctSystemType.ReturnAir, ConnectorProfileType.Rectangular, m_planarFaces[0].Reference);
|
||||
param = connReturnAir.get_Parameter(BuiltInParameter.CONNECTOR_HEIGHT);
|
||||
param.Set(connectorDimensions[1, 0]);
|
||||
param = connReturnAir.get_Parameter(BuiltInParameter.CONNECTOR_WIDTH);
|
||||
param.Set(connectorDimensions[1, 1]);
|
||||
param = connReturnAir.get_Parameter(BuiltInParameter.RBS_DUCT_FLOW_DIRECTION_PARAM);
|
||||
param.Set(1);
|
||||
param =
|
||||
connReturnAir.get_Parameter(BuiltInParameter.RBS_DUCT_FLOW_CONFIGURATION_PARAM);
|
||||
param.Set(1);
|
||||
param = connReturnAir.get_Parameter(BuiltInParameter.RBS_DUCT_FLOW_PARAM);
|
||||
param.Set(flow);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Create the Supply Hydronic pipe connector
|
||||
|
||||
// get the planar faces of extrusion3
|
||||
m_planarFaces = GetPlanarFaces(extrusions[3]);
|
||||
|
||||
// create the Hydronic Supply pipe connector
|
||||
//PipeConnector connSupplyHydronic = f.NewPipeConnector(m_planarFaces[0].Reference,
|
||||
// PipeSystemType.SupplyHydronic);
|
||||
ConnectorElement connSupplyHydronic = ConnectorElement.CreatePipeConnector(m_document, PipeSystemType.SupplyHydronic, m_planarFaces[0].Reference);
|
||||
param = connSupplyHydronic.get_Parameter(BuiltInParameter.CONNECTOR_RADIUS);
|
||||
param.Set(arcRadius);
|
||||
param =
|
||||
connSupplyHydronic.get_Parameter(BuiltInParameter.RBS_PIPE_FLOW_DIRECTION_PARAM);
|
||||
param.Set(2);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Create the Return Hydronic pipe connector
|
||||
|
||||
// get the planar faces of extrusion4
|
||||
m_planarFaces = GetPlanarFaces(extrusions[4]);
|
||||
|
||||
// create the Hydronic Return pipe connector
|
||||
//PipeConnector connReturnHydronic = f.NewPipeConnector(m_planarFaces[0].Reference,
|
||||
// PipeSystemType.ReturnHydronic);
|
||||
ConnectorElement connReturnHydronic = ConnectorElement.CreatePipeConnector(m_document, PipeSystemType.ReturnHydronic, m_planarFaces[0].Reference);
|
||||
param = connReturnHydronic.get_Parameter(BuiltInParameter.CONNECTOR_RADIUS);
|
||||
param.Set(arcRadius);
|
||||
param =
|
||||
connReturnHydronic.get_Parameter(BuiltInParameter.RBS_PIPE_FLOW_DIRECTION_PARAM);
|
||||
param.Set(1);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RevitAddIns>
|
||||
<AddIn Type="Command">
|
||||
<Assembly>CreateAirHandler.dll</Assembly>
|
||||
<ClientId>624e832a-d412-4365-8060-5adb9e921128</ClientId>
|
||||
<FullClassName>Revit.SDK.Samples.CreateAirHandler.CS.Command</FullClassName>
|
||||
<Text>Create Air Handler</Text>
|
||||
<Description>Create one air handler and add connectors.</Description>
|
||||
<VisibilityMode>AlwaysVisible</VisibilityMode>
|
||||
<VendorId>ADSK</VendorId>
|
||||
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
|
||||
</AddIn>
|
||||
</RevitAddIns>
|
||||
@@ -1,84 +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>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{3251A8F4-57C3-4D4E-B5C8-6E7AC7D4E17A}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CreateAirHandler</RootNamespace>
|
||||
<AssemblyName>CreateAirHandler</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<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>
|
||||
</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="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Command.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</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>
|
||||
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
|
||||
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
Binary file not shown.
@@ -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("CreateAirHandler")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Autodesk, Inc.")]
|
||||
[assembly: AssemblyProduct("CreateAirHandler")]
|
||||
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2009")]
|
||||
[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("dc6759c3-7d5d-460e-8a8f-635e336daf12")]
|
||||
|
||||
// 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")]
|
||||
Binary file not shown.
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RevitAddIns>
|
||||
<AddIn Type="Command">
|
||||
<Assembly>CreateTruss.dll</Assembly>
|
||||
<ClientId>25edaeaf-21d7-45a3-b16b-010d159f8fcf</ClientId>
|
||||
<FullClassName>Revit.SDK.Samples.CreateTruss.CS.Command</FullClassName>
|
||||
<Text>Create Truss</Text>
|
||||
<Description>Create truss in truss family document.</Description>
|
||||
<VisibilityMode>AlwaysVisible</VisibilityMode>
|
||||
<VendorId>ADSK</VendorId>
|
||||
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
|
||||
</AddIn>
|
||||
</RevitAddIns>
|
||||
@@ -1,302 +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.Data;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using Autodesk.Revit.DB.Structure;
|
||||
|
||||
using Element = Autodesk.Revit.DB.Element;
|
||||
using View = Autodesk.Revit.DB.View;
|
||||
|
||||
namespace Revit.SDK.Samples.CreateTruss.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// A class inherits IExternalCommand interface.
|
||||
/// this class creates a mono truss in truss family document.
|
||||
/// </summary>
|
||||
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
|
||||
[Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
|
||||
[Autodesk.Revit.Attributes.Journaling(Autodesk.Revit.Attributes.JournalingMode.NoCommandData)]
|
||||
public class Command : IExternalCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// The Revit application
|
||||
/// </summary>
|
||||
private static Autodesk.Revit.ApplicationServices.Application m_application;
|
||||
|
||||
/// <summary>
|
||||
/// The current document of the application
|
||||
/// </summary>
|
||||
private static Autodesk.Revit.DB.Document m_document;
|
||||
|
||||
/// <summary>
|
||||
/// The Application Creation object is used to create new instances of utility objects.
|
||||
/// </summary>
|
||||
private Autodesk.Revit.Creation.Application m_appCreator;
|
||||
|
||||
/// <summary>
|
||||
/// the creation factory to create model lines, dimensions and alignments
|
||||
/// </summary>
|
||||
private Autodesk.Revit.Creation.FamilyItemFactory m_familyCreator;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Implement this method as an external command for Revit.
|
||||
/// </summary>
|
||||
/// <param name="revit">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>
|
||||
public Autodesk.Revit.UI.Result Execute(Autodesk.Revit.UI.ExternalCommandData revit,
|
||||
ref string message,
|
||||
ElementSet elements)
|
||||
{
|
||||
try
|
||||
{
|
||||
m_application = revit.Application.Application;
|
||||
m_document = revit.Application.ActiveUIDocument.Document;
|
||||
|
||||
// it can support in truss family document only
|
||||
if (!m_document.IsFamilyDocument
|
||||
|| m_document.OwnerFamily.FamilyCategory.Id.IntegerValue != (int)BuiltInCategory.OST_Truss)
|
||||
{
|
||||
message = "Cannot execute truss creation in non-truss family document";
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
|
||||
m_appCreator = m_application.Create;
|
||||
m_familyCreator = m_document.FamilyCreate;
|
||||
|
||||
Transaction newTran = new Transaction(m_document);
|
||||
newTran.Start("NewTrussCurve");
|
||||
|
||||
// Start the truss creation
|
||||
MakeNewTruss();
|
||||
|
||||
newTran.Commit();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
message = ex.ToString();
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
return Autodesk.Revit.UI.Result.Succeeded;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Example demonstrating truss creation in the Autodesk Revit API. This example constructs
|
||||
/// a "mono" truss aligned with the reference planes in the (already loaded) truss family
|
||||
/// document.
|
||||
/// </summary>
|
||||
private void MakeNewTruss()
|
||||
{
|
||||
// Constants for arranging the angular truss members
|
||||
double webAngle = 35.0;
|
||||
double webAngleRadians = (180 - webAngle) * Math.PI / 180.0;
|
||||
Autodesk.Revit.DB.XYZ angleDirection = new Autodesk.Revit.DB.XYZ(Math.Cos(webAngleRadians), Math.Sin(webAngleRadians), 0);
|
||||
|
||||
// Look up the reference planes and view in which to sketch
|
||||
ReferencePlane top = null, bottom = null, left = null, right = null, center = null;
|
||||
View level1 = null;
|
||||
List<Autodesk.Revit.DB.Element> elements = new List<Autodesk.Revit.DB.Element>();
|
||||
ElementClassFilter refPlaneFilter = new ElementClassFilter(typeof(ReferencePlane));
|
||||
ElementClassFilter viewFilter = new ElementClassFilter(typeof(View));
|
||||
LogicalOrFilter filter = new LogicalOrFilter(refPlaneFilter, viewFilter);
|
||||
FilteredElementCollector collector = new FilteredElementCollector(m_document);
|
||||
elements.AddRange(collector.WherePasses(filter).ToElements());
|
||||
foreach (Element e in elements)
|
||||
{
|
||||
// skip view templates because they're invisible invalid for truss creation
|
||||
View view = e as View;
|
||||
if (null != view && view.IsTemplate)
|
||||
continue;
|
||||
//
|
||||
switch (e.Name)
|
||||
{
|
||||
case "Top": top = e as ReferencePlane; break;
|
||||
case "Bottom": bottom = e as ReferencePlane; break;
|
||||
case "Right": right = e as ReferencePlane; break;
|
||||
case "Left": left = e as ReferencePlane; break;
|
||||
case "Center": center = e as ReferencePlane; break;
|
||||
case "Level 1": level1 = e as View; break;
|
||||
}
|
||||
}
|
||||
if (top == null || bottom == null || left == null
|
||||
|| right == null || center == null || level1 == null)
|
||||
throw new InvalidOperationException("Could not find prerequisite named reference plane or named view.");
|
||||
|
||||
SketchPlane sPlane = level1.SketchPlane;
|
||||
|
||||
// Extract the geometry of each reference plane
|
||||
Line bottomLine = GetReferencePlaneLine(bottom);
|
||||
Line leftLine = GetReferencePlaneLine(left);
|
||||
Line rightLine = GetReferencePlaneLine(right);
|
||||
Line topLine = GetReferencePlaneLine(top);
|
||||
Line centerLine = GetReferencePlaneLine(center);
|
||||
|
||||
// Create bottom chord along "bottom" from "left" to "right"
|
||||
Autodesk.Revit.DB.XYZ bottomLeft = GetIntersection(bottomLine, leftLine);
|
||||
Autodesk.Revit.DB.XYZ bottomRight = GetIntersection(bottomLine, rightLine);
|
||||
ModelCurve bottomChord = MakeTrussCurve(bottomLeft, bottomRight, sPlane, TrussCurveType.BottomChord);
|
||||
if (null != bottomChord)
|
||||
{
|
||||
// Add the alignment constraint to the bottom chord.
|
||||
Curve geometryCurve = bottomChord.GeometryCurve;
|
||||
// Lock the bottom chord to bottom reference plan
|
||||
m_familyCreator.NewAlignment(level1, bottom.GetReference(), geometryCurve.Reference);
|
||||
}
|
||||
|
||||
// Create web connecting top and bottom chords on the right side
|
||||
Autodesk.Revit.DB.XYZ topRight = GetIntersection(topLine, rightLine);
|
||||
ModelCurve rightWeb = MakeTrussCurve(bottomRight, topRight, sPlane, TrussCurveType.Web);
|
||||
if (null != rightWeb)
|
||||
{
|
||||
// Add the alignment constraint to the right web chord.
|
||||
Curve geometryCurve = rightWeb.GeometryCurve;
|
||||
// Lock the right web chord to right reference plan
|
||||
m_familyCreator.NewAlignment(level1, right.GetReference(), geometryCurve.Reference);
|
||||
}
|
||||
|
||||
// Create top chord diagonally from bottom-left to top-right
|
||||
ModelCurve topChord = MakeTrussCurve(bottomLeft, topRight, sPlane, TrussCurveType.TopChord);
|
||||
if (null != topChord)
|
||||
{
|
||||
// Add the alignment constraint to the top chord.
|
||||
Curve geometryCurve = topChord.GeometryCurve;
|
||||
// Lock the start point of top chord to the Intersection of left and bottom reference plan
|
||||
m_familyCreator.NewAlignment(level1, geometryCurve.GetEndPointReference(0), left.GetReference());
|
||||
m_familyCreator.NewAlignment(level1, geometryCurve.GetEndPointReference(0), bottom.GetReference());
|
||||
// Lock the end point of top chord to the Intersection of right and top reference plan
|
||||
m_familyCreator.NewAlignment(level1, geometryCurve.GetEndPointReference(1), top.GetReference());
|
||||
m_familyCreator.NewAlignment(level1, geometryCurve.GetEndPointReference(1), right.GetReference());
|
||||
}
|
||||
|
||||
// Create angled web from midpoint to the narrow end of the truss
|
||||
Autodesk.Revit.DB.XYZ bottomMidPoint = GetIntersection(bottomLine, centerLine);
|
||||
Line webDirection = Line.CreateUnbound(bottomMidPoint, angleDirection);
|
||||
Autodesk.Revit.DB.XYZ endOfWeb = GetIntersection(topChord.GeometryCurve as Line, webDirection);
|
||||
ModelCurve angledWeb = MakeTrussCurve(bottomMidPoint, endOfWeb, sPlane, TrussCurveType.Web);
|
||||
|
||||
// Add a dimension to force the angle to be stable even when truss length and height are modified
|
||||
Arc dimensionArc = Arc.Create(
|
||||
bottomMidPoint, angledWeb.GeometryCurve.Length / 2, webAngleRadians, Math.PI, Autodesk.Revit.DB.XYZ.BasisX, Autodesk.Revit.DB.XYZ.BasisY);
|
||||
Dimension createdDim = m_familyCreator.NewAngularDimension(
|
||||
level1, dimensionArc, angledWeb.GeometryCurve.Reference, bottomChord.GeometryCurve.Reference);
|
||||
if (null != createdDim)
|
||||
createdDim.IsLocked = true;
|
||||
|
||||
// Create angled web from corner to top of truss
|
||||
Autodesk.Revit.DB.XYZ bottomRight2 = GetIntersection(bottomLine, rightLine);
|
||||
webDirection = Line.CreateUnbound(bottomRight2, angleDirection);
|
||||
endOfWeb = GetIntersection(topChord.GeometryCurve as Line, webDirection);
|
||||
ModelCurve angledWeb2 = MakeTrussCurve(bottomRight, endOfWeb, sPlane, TrussCurveType.Web);
|
||||
|
||||
// Add a dimension to force the angle to be stable even when truss length and height are modified
|
||||
dimensionArc = Arc.Create(
|
||||
bottomRight, angledWeb2.GeometryCurve.Length / 2, webAngleRadians, Math.PI, Autodesk.Revit.DB.XYZ.BasisX, Autodesk.Revit.DB.XYZ.BasisY);
|
||||
createdDim = m_familyCreator.NewAngularDimension(
|
||||
level1, dimensionArc, angledWeb2.GeometryCurve.Reference, bottomChord.GeometryCurve.Reference);
|
||||
if (null != createdDim)
|
||||
createdDim.IsLocked = true;
|
||||
|
||||
//Connect bottom midpoint to end of the angled web
|
||||
ModelCurve braceWeb = MakeTrussCurve(bottomMidPoint, endOfWeb, sPlane, TrussCurveType.Web);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Utility method to create a truss model curve.
|
||||
/// </summary>
|
||||
/// <param name="start">The start point.</param>
|
||||
/// <param name="end">The end point.</param>
|
||||
/// <param name="sketchPlane">The sketch plane for the new curve.</param>
|
||||
/// <param name="type">The type of truss curve.</param>
|
||||
/// <returns>the created truss model curve.</returns>
|
||||
private ModelCurve MakeTrussCurve(Autodesk.Revit.DB.XYZ start, Autodesk.Revit.DB.XYZ end, SketchPlane sketchPlane, TrussCurveType type)
|
||||
{
|
||||
Line line = Line.CreateBound(start, end);
|
||||
ModelCurve trussCurve = m_familyCreator.NewModelCurve(line, sketchPlane);
|
||||
trussCurve.TrussCurveType = type;
|
||||
m_document.Regenerate();
|
||||
|
||||
return trussCurve;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Utility method for to extract the geometry of a reference plane in a family.
|
||||
/// </summary>
|
||||
/// <param name="plane">The reference plane.</param>
|
||||
/// <returns>An unbounded line representing the location of the plane.</returns>
|
||||
private Line GetReferencePlaneLine(ReferencePlane plane)
|
||||
{
|
||||
// Reset the "elevation" of the plane's line to Z=0, since that's where the lines will be placed.
|
||||
// Otherwise, some intersection calculation may fail
|
||||
Autodesk.Revit.DB.XYZ origin = new XYZ(
|
||||
plane.BubbleEnd.X,
|
||||
plane.BubbleEnd.Y,
|
||||
0.0);
|
||||
|
||||
Line line = Line.CreateUnbound(origin, plane.Direction);
|
||||
|
||||
return line;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Utility method for getting the intersection between two lines.
|
||||
/// </summary>
|
||||
/// <param name="line1">The first line.</param>
|
||||
/// <param name="line2">The second line.</param>
|
||||
/// <returns>The intersection point.</returns>
|
||||
/// <exception cref="InvalidOperationException">Thrown when an intersection can't be found.</exception>
|
||||
private Autodesk.Revit.DB.XYZ GetIntersection(Line line1, Line line2)
|
||||
{
|
||||
IntersectionResultArray results;
|
||||
Autodesk.Revit.DB.SetComparisonResult result = line1.Intersect(line2, out results);
|
||||
|
||||
if (result != Autodesk.Revit.DB.SetComparisonResult.Overlap)
|
||||
throw new InvalidOperationException("Input lines did not intersect.");
|
||||
|
||||
if (results == null || results.Size != 1)
|
||||
throw new InvalidOperationException("Could not extract intersection point for lines.");
|
||||
|
||||
IntersectionResult iResult = results.get_Item(0);
|
||||
Autodesk.Revit.DB.XYZ intersectionPoint = iResult.XYZPoint;
|
||||
|
||||
return intersectionPoint;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{8D917AFE-5CCC-4FA7-91C0-CD0C216AF7A3}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CreateTruss</RootNamespace>
|
||||
<AssemblyName>CreateTruss</AssemblyName>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<TargetFrameworkSubset>
|
||||
</TargetFrameworkSubset>
|
||||
<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>
|
||||
</DocumentationFile>
|
||||
</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="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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="CreateTruss.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</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>
|
||||
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
|
||||
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -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("CreateTruss")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Autodesk, Inc.")]
|
||||
[assembly: AssemblyProduct("CreateTruss")]
|
||||
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2009")]
|
||||
[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("D6CD6541-7FE1-431b-93F2-B618472363B6")]
|
||||
|
||||
// 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")]
|
||||
Binary file not shown.
@@ -1,169 +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.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
using Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using Element = Autodesk.Revit.DB.Element;
|
||||
using GeometryElement = Autodesk.Revit.DB.GeometryElement;
|
||||
using Instance = Autodesk.Revit.DB.Instance;
|
||||
|
||||
namespace Revit.SDK.Samples.DWGFamilyCreation.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// To add an external command to Autodesk Revit
|
||||
/// the developer should implement an object that
|
||||
/// supports the IExternalCommand interface.
|
||||
/// </summary>
|
||||
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
|
||||
[Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
|
||||
[Autodesk.Revit.Attributes.Journaling(Autodesk.Revit.Attributes.JournalingMode.NoCommandData)]
|
||||
public class Command : IExternalCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// Revit application
|
||||
/// </summary>
|
||||
Autodesk.Revit.UI.UIApplication m_app;
|
||||
/// <summary>
|
||||
/// Revit document
|
||||
/// </summary>
|
||||
Document m_doc;
|
||||
|
||||
/// <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>
|
||||
public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData,
|
||||
ref string message, Autodesk.Revit.DB.ElementSet elements)
|
||||
{
|
||||
try
|
||||
{
|
||||
m_app = commandData.Application;
|
||||
m_doc = commandData.Application.ActiveUIDocument.Document;
|
||||
if (null == m_doc)
|
||||
{
|
||||
message = "There is no active document.";
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
|
||||
if (!m_doc.IsFamilyDocument)
|
||||
{
|
||||
message = "Current document is not a family document.";
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
|
||||
// Get the view where the dwg file will be imported
|
||||
View view = GetView();
|
||||
if (null == view)
|
||||
{
|
||||
message = "Opened wrong template file, please use the provided family template file.";
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
|
||||
// The dwg file which will be imported
|
||||
string AssemblyDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
|
||||
string DWGFile = "Desk.dwg";
|
||||
string DWGFullPath = Path.Combine(AssemblyDirectory, DWGFile);
|
||||
|
||||
Transaction transaction = new Transaction(m_doc, "DWGFamilyCreation");
|
||||
transaction.Start();
|
||||
// Import the dwg file into current family document
|
||||
DWGImportOptions options = new DWGImportOptions();
|
||||
options.Placement = Autodesk.Revit.DB.ImportPlacement.Origin;
|
||||
options.OrientToView = true;
|
||||
ElementId elementId = null;
|
||||
m_doc.Import(DWGFullPath, options, view, out elementId);
|
||||
|
||||
// Add type parameters to the family
|
||||
AddParameters(DWGFile);
|
||||
transaction.Commit();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
message = ex.ToString();
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
|
||||
return Autodesk.Revit.UI.Result.Succeeded;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add type parameters to the family
|
||||
/// </summary>
|
||||
/// <param name="DWGFileName">Name of imported dwg file</param>
|
||||
private void AddParameters(string DWGFileName)
|
||||
{
|
||||
// Get the family manager
|
||||
FamilyManager familyMgr = m_doc.FamilyManager;
|
||||
|
||||
// Add parameter 1: DWGFileName
|
||||
familyMgr.NewType("DWGFamilyCreation");
|
||||
FamilyParameter paraFileName = familyMgr.AddParameter("DWGFileName", Autodesk.Revit.DB.BuiltInParameterGroup.INVALID,
|
||||
Autodesk.Revit.DB.ParameterType.Text, false);
|
||||
familyMgr.Set(paraFileName, DWGFileName);
|
||||
|
||||
// Add parameter 2: ImportTime
|
||||
String time = DateTime.Now.ToString("yyyy-MM-dd");
|
||||
FamilyParameter paraImportTime = familyMgr.AddParameter("ImportTime", Autodesk.Revit.DB.BuiltInParameterGroup.INVALID,
|
||||
Autodesk.Revit.DB.ParameterType.Text, false);
|
||||
familyMgr.Set(paraImportTime, time);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the view where the dwg file will be imported
|
||||
/// </summary>
|
||||
/// <returns>The view where the dwg file will be imported</returns>
|
||||
private View GetView()
|
||||
{
|
||||
View view = null;
|
||||
List<Autodesk.Revit.DB.Element> views = new List<Autodesk.Revit.DB.Element>();
|
||||
FilteredElementCollector collector = new FilteredElementCollector(m_app.ActiveUIDocument.Document);
|
||||
views.AddRange(collector.OfClass(typeof(View)).ToElements());
|
||||
foreach (View v in views)
|
||||
{
|
||||
if (!v.IsTemplate && v.ViewType == Autodesk.Revit.DB.ViewType.FloorPlan && v.Name == "Ref. Level")
|
||||
{
|
||||
view = v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RevitAddIns>
|
||||
<AddIn Type="Command">
|
||||
<Assembly>DWGFamilyCreation.dll</Assembly>
|
||||
<ClientId>288339ab-7003-4457-aceb-736fb74a29f3</ClientId>
|
||||
<FullClassName>Revit.SDK.Samples.DWGFamilyCreation.CS.Command</FullClassName>
|
||||
<Text>DWGFamilyCreation</Text>
|
||||
<Description>Import dwg file into family document.</Description>
|
||||
<VisibilityMode>AlwaysVisible</VisibilityMode>
|
||||
<VendorId>ADSK</VendorId>
|
||||
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
|
||||
</AddIn>
|
||||
</RevitAddIns>
|
||||
@@ -1,99 +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>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{D39B82F4-2BDA-443B-A707-4EBDE04A86FA}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Revit.SDK.Samples.ImportExport.CS</RootNamespace>
|
||||
<AssemblyName>DWGFamilyCreation</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\DWGFamilyCreation.xml</DocumentationFile>
|
||||
<TreatWarningsAsErrors>false</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>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DocumentationFile>bin\Debug\DWGFamilyCreation.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.Xml" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Command.cs" />
|
||||
<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="Properties\Resources.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</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>
|
||||
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
|
||||
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,57 +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.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("DWGFamilyCreation")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("DWGFamilyCreation")]
|
||||
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2009")]
|
||||
[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("17637b51-499c-47ad-a41c-afba4811f207")]
|
||||
|
||||
// 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 Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
-135
@@ -1,135 +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.ImportExport.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.ImportExport.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 string similar to cm.
|
||||
/// </summary>
|
||||
internal static string DUT_CENTIMETERS {
|
||||
get {
|
||||
return ResourceManager.GetString("DUT_CENTIMETERS", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to '.
|
||||
/// </summary>
|
||||
internal static string DUT_DECIMAL_FEET {
|
||||
get {
|
||||
return ResourceManager.GetString("DUT_DECIMAL_FEET", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to ".
|
||||
/// </summary>
|
||||
internal static string DUT_DECIMAL_INCHES {
|
||||
get {
|
||||
return ResourceManager.GetString("DUT_DECIMAL_INCHES", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to '.
|
||||
/// </summary>
|
||||
internal static string DUT_FEET_FRACTIONAL_INCHES {
|
||||
get {
|
||||
return ResourceManager.GetString("DUT_FEET_FRACTIONAL_INCHES", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to ".
|
||||
/// </summary>
|
||||
internal static string DUT_FRACTIONAL_INCHES {
|
||||
get {
|
||||
return ResourceManager.GetString("DUT_FRACTIONAL_INCHES", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to m.
|
||||
/// </summary>
|
||||
internal static string DUT_METERS {
|
||||
get {
|
||||
return ResourceManager.GetString("DUT_METERS", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to m.
|
||||
/// </summary>
|
||||
internal static string DUT_METERS_CENTIMETERS {
|
||||
get {
|
||||
return ResourceManager.GetString("DUT_METERS_CENTIMETERS", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to mm.
|
||||
/// </summary>
|
||||
internal static string DUT_MILLIMETERS {
|
||||
get {
|
||||
return ResourceManager.GetString("DUT_MILLIMETERS", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,144 +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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="DUT_CENTIMETERS" xml:space="preserve">
|
||||
<value>cm</value>
|
||||
</data>
|
||||
<data name="DUT_DECIMAL_FEET" xml:space="preserve">
|
||||
<value>'</value>
|
||||
</data>
|
||||
<data name="DUT_DECIMAL_INCHES" xml:space="preserve">
|
||||
<value>"</value>
|
||||
</data>
|
||||
<data name="DUT_FEET_FRACTIONAL_INCHES" xml:space="preserve">
|
||||
<value>'</value>
|
||||
</data>
|
||||
<data name="DUT_FRACTIONAL_INCHES" xml:space="preserve">
|
||||
<value>"</value>
|
||||
</data>
|
||||
<data name="DUT_METERS" xml:space="preserve">
|
||||
<value>m</value>
|
||||
</data>
|
||||
<data name="DUT_METERS_CENTIMETERS" xml:space="preserve">
|
||||
<value>m</value>
|
||||
</data>
|
||||
<data name="DUT_MILLIMETERS" xml:space="preserve">
|
||||
<value>mm</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,201 +0,0 @@
|
||||
{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe2052\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
|
||||
{\f13\fbidi \fswiss\fcharset128\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt \'91\'76\'91\'cc};}{\f34\fbidi \froman\fcharset1\fprq2{\*\panose 02040503050406030204}Cambria Math;}
|
||||
{\f39\fbidi \fswiss\fcharset128\fprq2{\*\panose 02010600030101010101}@SimSun;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
|
||||
{\fdbmajor\f31501\fbidi \fswiss\fcharset128\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt \'91\'76\'91\'cc};}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
|
||||
{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
|
||||
{\fdbminor\f31505\fbidi \fswiss\fcharset128\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt \'91\'76\'91\'cc};}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}
|
||||
{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f40\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f41\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\f43\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f44\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f45\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f46\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
||||
{\f47\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f48\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f50\fbidi \fswiss\fcharset238\fprq2 Arial CE;}{\f51\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}
|
||||
{\f53\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f54\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f55\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f56\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}
|
||||
{\f57\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f58\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f172\fbidi \fswiss\fcharset0\fprq2 SimSun Western{\*\falt \'91\'76\'91\'cc};}
|
||||
{\f170\fbidi \fswiss\fcharset238\fprq2 SimSun CE{\*\falt \'91\'76\'91\'cc};}{\f171\fbidi \fswiss\fcharset204\fprq2 SimSun Cyr{\*\falt \'91\'76\'91\'cc};}{\f173\fbidi \fswiss\fcharset161\fprq2 SimSun Greek{\*\falt \'91\'76\'91\'cc};}
|
||||
{\f174\fbidi \fswiss\fcharset162\fprq2 SimSun Tur{\*\falt \'91\'76\'91\'cc};}{\f176\fbidi \fswiss\fcharset178\fprq2 SimSun (Arabic){\*\falt \'91\'76\'91\'cc};}{\f177\fbidi \fswiss\fcharset186\fprq2 SimSun Baltic{\*\falt \'91\'76\'91\'cc};}
|
||||
{\f178\fbidi \fswiss\fcharset163\fprq2 SimSun (Vietnamese){\*\falt \'91\'76\'91\'cc};}{\f432\fbidi \fswiss\fcharset0\fprq2 @SimSun Western;}{\f430\fbidi \fswiss\fcharset238\fprq2 @SimSun CE;}{\f431\fbidi \fswiss\fcharset204\fprq2 @SimSun Cyr;}
|
||||
{\f433\fbidi \fswiss\fcharset161\fprq2 @SimSun Greek;}{\f434\fbidi \fswiss\fcharset162\fprq2 @SimSun Tur;}{\f436\fbidi \fswiss\fcharset178\fprq2 @SimSun (Arabic);}{\f437\fbidi \fswiss\fcharset186\fprq2 @SimSun Baltic;}
|
||||
{\f438\fbidi \fswiss\fcharset163\fprq2 @SimSun (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
|
||||
{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
|
||||
{\fdbmajor\f31520\fbidi \fswiss\fcharset0\fprq2 SimSun Western{\*\falt \'91\'76\'91\'cc};}{\fdbmajor\f31518\fbidi \fswiss\fcharset238\fprq2 SimSun CE{\*\falt \'91\'76\'91\'cc};}
|
||||
{\fdbmajor\f31519\fbidi \fswiss\fcharset204\fprq2 SimSun Cyr{\*\falt \'91\'76\'91\'cc};}{\fdbmajor\f31521\fbidi \fswiss\fcharset161\fprq2 SimSun Greek{\*\falt \'91\'76\'91\'cc};}
|
||||
{\fdbmajor\f31522\fbidi \fswiss\fcharset162\fprq2 SimSun Tur{\*\falt \'91\'76\'91\'cc};}{\fdbmajor\f31524\fbidi \fswiss\fcharset178\fprq2 SimSun (Arabic){\*\falt \'91\'76\'91\'cc};}
|
||||
{\fdbmajor\f31525\fbidi \fswiss\fcharset186\fprq2 SimSun Baltic{\*\falt \'91\'76\'91\'cc};}{\fdbmajor\f31526\fbidi \fswiss\fcharset163\fprq2 SimSun (Vietnamese){\*\falt \'91\'76\'91\'cc};}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}
|
||||
{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
|
||||
{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
|
||||
{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
|
||||
{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
|
||||
{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
||||
{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbminor\f31560\fbidi \fswiss\fcharset0\fprq2 SimSun Western{\*\falt \'91\'76\'91\'cc};}
|
||||
{\fdbminor\f31558\fbidi \fswiss\fcharset238\fprq2 SimSun CE{\*\falt \'91\'76\'91\'cc};}{\fdbminor\f31559\fbidi \fswiss\fcharset204\fprq2 SimSun Cyr{\*\falt \'91\'76\'91\'cc};}
|
||||
{\fdbminor\f31561\fbidi \fswiss\fcharset161\fprq2 SimSun Greek{\*\falt \'91\'76\'91\'cc};}{\fdbminor\f31562\fbidi \fswiss\fcharset162\fprq2 SimSun Tur{\*\falt \'91\'76\'91\'cc};}
|
||||
{\fdbminor\f31564\fbidi \fswiss\fcharset178\fprq2 SimSun (Arabic){\*\falt \'91\'76\'91\'cc};}{\fdbminor\f31565\fbidi \fswiss\fcharset186\fprq2 SimSun Baltic{\*\falt \'91\'76\'91\'cc};}
|
||||
{\fdbminor\f31566\fbidi \fswiss\fcharset163\fprq2 SimSun (Vietnamese){\*\falt \'91\'76\'91\'cc};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
|
||||
{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
|
||||
{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
|
||||
{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
||||
{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;
|
||||
\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;
|
||||
\red192\green192\blue192;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{
|
||||
\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
|
||||
\snext0 \sqformat \spriority0 Normal;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
|
||||
\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
|
||||
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
|
||||
\snext11 \ssemihidden \sunhideused \sqformat Normal Table;}}{\*\rsidtbl \rsid7544407\rsid12919964}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator Lule}
|
||||
{\creatim\yr2010\mo3\dy3\hr17\min18}{\revtim\yr2010\mo3\dy3\hr17\min19}{\version3}{\edmins1}{\nofpages1}{\nofwords181}{\nofchars1071}{\nofcharsws1250}{\vern32771}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
|
||||
\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
|
||||
\widowctrl\ftnbj\aenddoc\trackmoves1\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120\dghorigin1701
|
||||
\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\rsidroot12919964 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2
|
||||
\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6
|
||||
\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang
|
||||
{\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\af31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 {
|
||||
\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 Application:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 DWGFamilyCreation\line }{\rtlch\fcs1 \ab\af1\afs20
|
||||
\ltrch\fcs0 \b\f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 Revit Platform:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 All\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7544407
|
||||
\hich\af1\dbch\af31505\loch\f1 Revit Version:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 2011.0\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1
|
||||
First Released For:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 2010.0\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 Programming Language:}{
|
||||
\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 C#\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 Skill Level:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0
|
||||
\f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 Beginning\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 Category:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407
|
||||
\hich\af1\dbch\af31505\loch\f1 Families, Data Exchange\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 Type:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1
|
||||
ExternalCommand\line \line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 Subject:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1
|
||||
Import dwg file into family document.\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 Summary:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 \line
|
||||
This sample shows how to import a dwg file into a family document and add parameters to the family through Revit API.}{\rtlch\fcs1 \ai\af0\afs20 \ltrch\fcs0 \i\f0\fs20\insrsid7544407
|
||||
\par }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7544407
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 Classes:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1
|
||||
\par }\pard \ltrpar\ql \fi180\li180\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin180\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\lang1036\langfe2052\langnp1036\insrsid12919964\charrsid12919964 \hich\af1\dbch\af31505\loch\f1
|
||||
Autodesk.Revit.UI.IExternalCommand}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\lang1036\langfe2052\langnp1036\insrsid12919964
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\lang1036\langfe2052\langnp1036\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\lang1036\langfe2052\langnp1036\insrsid12919964
|
||||
\hich\af1\dbch\af31505\loch\f1 DB}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\lang1036\langfe2052\langnp1036\insrsid7544407
|
||||
\par
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 Project Files:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407
|
||||
\hich\af1\dbch\af31505\loch\f1 }{\rtlch\fcs1 \ai\af1\afs20 \ltrch\fcs0 \i\f1\fs20\insrsid7544407
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 Command.cs}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7544407
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\lang1036\langfe2052\langnp1036\insrsid7544407 \hich\af1\dbch\af31505\loch\f1
|
||||
It contains the class Command which inherits from interface IExternalCommand and implements the Execute method.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\lang1036\langfe2052\langnp1036\insrsid7544407
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f0\fs20\insrsid7544407
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 Description:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\insrsid7544407
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 This sample provides following functionalities.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7544407
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\tx360\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7544407 -\tab }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1
|
||||
Let user import a dwg file into a Revit family document}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7544407 .
|
||||
\par -\tab }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 Let user add paramet\hich\af1\dbch\af31505\loch\f1 ers to the imported instance. }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7544407
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7544407
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 Instructions:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\cf2\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\cf2\insrsid7544407
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 1. Put the provided desk.dwg file and dll file of the sample under same folder.}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407\charrsid7544407
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 2}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 \hich\f1
|
||||
. Open Revit application, create a new family with the provided family template file \'93\loch\f1 \hich\f1 Furniture.rft\'94\loch\f1 \hich\f1 or open the provided family file \'93\loch\f1 Furnit\hich\af1\dbch\af31505\loch\f1 \hich\f1 ure.rfa\'94.
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 3}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7544407 \hich\af1\dbch\af31505\loch\f1 . Execute the command.
|
||||
\par \hich\af1\dbch\af31505\loch\f1 \hich\f1 Expected result: The provided dwg file \'93\loch\f1 \hich\f1 Desk.dwg\'94\loch\f1 \hich\f1 is imported into the family document and two type parameters are added to the famiy - \'93\loch\f1 \hich\f1 DWGFileName\'94
|
||||
\loch\f1 \hich\f1 with the value of the dwg file name and \'93\loch\f1 \hich\f1 ImportTime\'94\loch\f1 of import time.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7544407
|
||||
\par
|
||||
\par
|
||||
\par }{\*\themedata 504b030414000600080000002100828abc13fa0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb6ac3301045f785fe83d0b6d8
|
||||
72ba28a5d8cea249777d2cd20f18e4b12d6a8f843409c9df77ecb850ba082d74231062ce997b55ae8fe3a00e1893f354e9555e6885647de3a8abf4fbee29bbd7
|
||||
2a3150038327acf409935ed7d757e5ee14302999a654e99e393c18936c8f23a4dc072479697d1c81e51a3b13c07e4087e6b628ee8cf5c4489cf1c4d075f92a0b
|
||||
44d7a07a83c82f308ac7b0a0f0fbf90c2480980b58abc733615aa2d210c2e02cb04430076a7ee833dfb6ce62e3ed7e14693e8317d8cd0433bf5c60f53fea2fe7
|
||||
065bd80facb647e9e25c7fc421fd2ddb526b2e9373fed4bb902e182e97b7b461e6bfad3f010000ffff0300504b030414000600080000002100a5d6a7e7c00000
|
||||
00360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4fc7060abb08
|
||||
84a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b63095120f88d94fbc
|
||||
52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462a1a82fe353
|
||||
bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f7468656d652f7468
|
||||
656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b4b0d592c9c
|
||||
070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b4757e8d3f7
|
||||
29e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f7468656d65
|
||||
312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87615b8116d8
|
||||
a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad79482a9c04
|
||||
98f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b5d8a314d3c
|
||||
94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab999fb7b471
|
||||
7509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9699640f671
|
||||
9e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd5868b37a088d1
|
||||
e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d60cf03ac1a5
|
||||
193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f9e7ef3f2d1
|
||||
17d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be15c308d3f2
|
||||
8acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a99793849c26ae6
|
||||
6252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d32a423279a
|
||||
668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2af074481847
|
||||
bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86e877f0034e
|
||||
16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb44f95d843b
|
||||
5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a6409fb44d0
|
||||
8741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c3d9058edf2
|
||||
c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db02565e85f3b966
|
||||
0d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276b9f7dec44b
|
||||
7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8c33585b5fb
|
||||
9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e51440ca2e0
|
||||
088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95b21be5ceaf
|
||||
8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff6dce591a26
|
||||
ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec69ffb9e65d0
|
||||
28d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239b75a5bb1e6
|
||||
345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a44959d366ad93
|
||||
b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e82db8df9f30
|
||||
254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f74
|
||||
68656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f24
|
||||
51eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e3198
|
||||
720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528
|
||||
a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100828abc13fa0000001c0200001300000000000000000000000000
|
||||
000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b000000000000000000000000
|
||||
002b0100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c00000000000000000000000000140200007468
|
||||
656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b000016000000000000000000
|
||||
00000000d10200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b010000270000000000
|
||||
00000000000000009b0900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000960a00000000}
|
||||
{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
|
||||
617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
|
||||
6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
|
||||
656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
|
||||
{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
|
||||
\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
|
||||
\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
|
||||
\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
|
||||
4d73786d6c322e534158584d4c5265616465722e352e3000000000000000000000060000
|
||||
d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffffec69d9888b8b3d4c859eaf6cd158be0f0000000000000000000000004088
|
||||
e199b2baca01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000105000000000000}}
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,415 +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 System.Diagnostics;
|
||||
using System.IO;
|
||||
using Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
namespace Revit.SDK.Samples.GenericModelCreation.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// A class inherits IExternalCommand interface.
|
||||
/// This class show how to create Generic Model Family by Revit API.
|
||||
/// </summary>
|
||||
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
|
||||
[Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
|
||||
[Autodesk.Revit.Attributes.Journaling(Autodesk.Revit.Attributes.JournalingMode.NoCommandData)]
|
||||
public class Command : IExternalCommand
|
||||
{
|
||||
#region Class Memeber Variables
|
||||
// Application of Revit
|
||||
private Autodesk.Revit.ApplicationServices.Application m_revit;
|
||||
// the document to create generic model family
|
||||
private Autodesk.Revit.DB.Document m_familyDocument;
|
||||
// FamilyItemFactory used to create family
|
||||
private Autodesk.Revit.Creation.FamilyItemFactory m_creationFamily = null;
|
||||
// Count error numbers
|
||||
private int m_errCount = 0;
|
||||
// Error information
|
||||
private string m_errorInfo = "";
|
||||
#endregion
|
||||
|
||||
#region Class Interface Implementation
|
||||
/// <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>
|
||||
public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData,
|
||||
ref string message,
|
||||
ElementSet elements)
|
||||
{
|
||||
try
|
||||
{
|
||||
m_revit = commandData.Application.Application;
|
||||
m_familyDocument = commandData.Application.ActiveUIDocument.Document;
|
||||
// create new family document if active document is not a family document
|
||||
if (!m_familyDocument.IsFamilyDocument)
|
||||
{
|
||||
m_familyDocument = m_revit.NewFamilyDocument("Generic Model.rft");
|
||||
if (null == m_familyDocument)
|
||||
{
|
||||
message = "Cannot open family document";
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
}
|
||||
m_creationFamily = m_familyDocument.FamilyCreate;
|
||||
// create generic model family in the document
|
||||
CreateGenericModel();
|
||||
if (0 == m_errCount)
|
||||
{
|
||||
return Autodesk.Revit.UI.Result.Succeeded;
|
||||
}
|
||||
else
|
||||
{
|
||||
message = m_errorInfo;
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
message = e.ToString();
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Class Implementation
|
||||
|
||||
/// <summary>
|
||||
/// Examples for form creation in generic model families.
|
||||
/// Create extrusion, blend, revolution, sweep, swept blend
|
||||
/// </summary>
|
||||
public void CreateGenericModel()
|
||||
{
|
||||
// use transaction if the family document is not active document
|
||||
Transaction transaction = new Transaction(m_familyDocument, "CreateGenericModel");
|
||||
transaction.Start();
|
||||
CreateExtrusion();
|
||||
CreateBlend();
|
||||
CreateRevolution();
|
||||
CreateSweep();
|
||||
CreateSweptBlend();
|
||||
transaction.Commit();
|
||||
return;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create one rectangular extrusion
|
||||
/// </summary>
|
||||
private void CreateExtrusion()
|
||||
{
|
||||
try
|
||||
{
|
||||
#region Create rectangle profile
|
||||
CurveArrArray curveArrArray = new CurveArrArray();
|
||||
CurveArray curveArray1 = new CurveArray();
|
||||
|
||||
Autodesk.Revit.DB.XYZ normal = Autodesk.Revit.DB.XYZ.BasisZ;
|
||||
SketchPlane sketchPlane = CreateSketchPlane(normal, Autodesk.Revit.DB.XYZ.Zero);
|
||||
|
||||
// create one rectangular extrusion
|
||||
Autodesk.Revit.DB.XYZ p0 = Autodesk.Revit.DB.XYZ.Zero;
|
||||
Autodesk.Revit.DB.XYZ p1 = new Autodesk.Revit.DB.XYZ(10, 0, 0);
|
||||
Autodesk.Revit.DB.XYZ p2 = new Autodesk.Revit.DB.XYZ(10, 10, 0);
|
||||
Autodesk.Revit.DB.XYZ p3 = new Autodesk.Revit.DB.XYZ(0, 10, 0);
|
||||
Line line1 = Line.CreateBound(p0, p1);
|
||||
Line line2 = Line.CreateBound(p1, p2);
|
||||
Line line3 = Line.CreateBound(p2, p3);
|
||||
Line line4 = Line.CreateBound(p3, p0);
|
||||
curveArray1.Append(line1);
|
||||
curveArray1.Append(line2);
|
||||
curveArray1.Append(line3);
|
||||
curveArray1.Append(line4);
|
||||
|
||||
curveArrArray.Append(curveArray1);
|
||||
#endregion
|
||||
// here create rectangular extrusion
|
||||
Extrusion rectExtrusion = m_creationFamily.NewExtrusion(true, curveArrArray, sketchPlane, 10);
|
||||
// move to proper place
|
||||
Autodesk.Revit.DB.XYZ transPoint1 = new Autodesk.Revit.DB.XYZ(-16, 0, 0);
|
||||
ElementTransformUtils.MoveElement(m_familyDocument, rectExtrusion.Id, transPoint1);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_errCount++;
|
||||
m_errorInfo += "Unexpected exceptions occur in CreateExtrusion: " + e.ToString() + "\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create one blend
|
||||
/// </summary>
|
||||
private void CreateBlend()
|
||||
{
|
||||
try
|
||||
{
|
||||
#region Create top and base profiles
|
||||
CurveArray topProfile = new CurveArray();
|
||||
CurveArray baseProfile = new CurveArray();
|
||||
|
||||
Autodesk.Revit.DB.XYZ normal = Autodesk.Revit.DB.XYZ.BasisZ;
|
||||
SketchPlane sketchPlane = CreateSketchPlane(normal, Autodesk.Revit.DB.XYZ.Zero);
|
||||
|
||||
// create one blend
|
||||
Autodesk.Revit.DB.XYZ p00 = Autodesk.Revit.DB.XYZ.Zero;
|
||||
Autodesk.Revit.DB.XYZ p01 = new Autodesk.Revit.DB.XYZ(10, 0, 0);
|
||||
Autodesk.Revit.DB.XYZ p02 = new Autodesk.Revit.DB.XYZ(10, 10, 0);
|
||||
Autodesk.Revit.DB.XYZ p03 = new Autodesk.Revit.DB.XYZ(0, 10, 0);
|
||||
Line line01 = Line.CreateBound(p00, p01);
|
||||
Line line02 = Line.CreateBound(p01, p02);
|
||||
Line line03 = Line.CreateBound(p02, p03);
|
||||
Line line04 = Line.CreateBound(p03, p00);
|
||||
|
||||
baseProfile.Append(line01);
|
||||
baseProfile.Append(line02);
|
||||
baseProfile.Append(line03);
|
||||
baseProfile.Append(line04);
|
||||
|
||||
Autodesk.Revit.DB.XYZ p10 = new Autodesk.Revit.DB.XYZ(5, 2, 10);
|
||||
Autodesk.Revit.DB.XYZ p11 = new Autodesk.Revit.DB.XYZ(8, 5, 10);
|
||||
Autodesk.Revit.DB.XYZ p12 = new Autodesk.Revit.DB.XYZ(5, 8, 10);
|
||||
Autodesk.Revit.DB.XYZ p13 = new Autodesk.Revit.DB.XYZ(2, 5, 10);
|
||||
Line line11 = Line.CreateBound(p10, p11);
|
||||
Line line12 = Line.CreateBound(p11, p12);
|
||||
Line line13 = Line.CreateBound(p12, p13);
|
||||
Line line14 = Line.CreateBound(p13, p10);
|
||||
|
||||
topProfile.Append(line11);
|
||||
topProfile.Append(line12);
|
||||
topProfile.Append(line13);
|
||||
topProfile.Append(line14);
|
||||
#endregion
|
||||
// here create one blend
|
||||
Blend blend = m_creationFamily.NewBlend(true, topProfile, baseProfile, sketchPlane);
|
||||
// move to proper place
|
||||
Autodesk.Revit.DB.XYZ transPoint1 = new Autodesk.Revit.DB.XYZ(0, 11, 0);
|
||||
ElementTransformUtils.MoveElement(m_familyDocument, blend.Id, transPoint1);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_errCount++;
|
||||
m_errorInfo += "Unexpected exceptions occur in CreateBlend: " + e.ToString() + "\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create one rectangular profile revolution
|
||||
/// </summary>
|
||||
private void CreateRevolution()
|
||||
{
|
||||
try
|
||||
{
|
||||
#region Create rectangular profile
|
||||
CurveArrArray curveArrArray = new CurveArrArray();
|
||||
CurveArray curveArray = new CurveArray();
|
||||
|
||||
Autodesk.Revit.DB.XYZ normal = Autodesk.Revit.DB.XYZ.BasisZ;
|
||||
SketchPlane sketchPlane = CreateSketchPlane(normal, Autodesk.Revit.DB.XYZ.Zero);
|
||||
|
||||
// create one rectangular profile revolution
|
||||
Autodesk.Revit.DB.XYZ p0 = Autodesk.Revit.DB.XYZ.Zero;
|
||||
Autodesk.Revit.DB.XYZ p1 = new Autodesk.Revit.DB.XYZ(10, 0, 0);
|
||||
Autodesk.Revit.DB.XYZ p2 = new Autodesk.Revit.DB.XYZ(10, 10, 0);
|
||||
Autodesk.Revit.DB.XYZ p3 = new Autodesk.Revit.DB.XYZ(0, 10, 0);
|
||||
Line line1 = Line.CreateBound(p0, p1);
|
||||
Line line2 = Line.CreateBound(p1, p2);
|
||||
Line line3 = Line.CreateBound(p2, p3);
|
||||
Line line4 = Line.CreateBound(p3, p0);
|
||||
|
||||
Autodesk.Revit.DB.XYZ pp = new Autodesk.Revit.DB.XYZ(1, -1, 0);
|
||||
Line axis1 = Line.CreateBound(Autodesk.Revit.DB.XYZ.Zero, pp);
|
||||
curveArray.Append(line1);
|
||||
curveArray.Append(line2);
|
||||
curveArray.Append(line3);
|
||||
curveArray.Append(line4);
|
||||
|
||||
curveArrArray.Append(curveArray);
|
||||
#endregion
|
||||
// here create rectangular profile revolution
|
||||
Revolution revolution1 = m_creationFamily.NewRevolution(true, curveArrArray, sketchPlane, axis1, -Math.PI, 0);
|
||||
// move to proper place
|
||||
Autodesk.Revit.DB.XYZ transPoint1 = new Autodesk.Revit.DB.XYZ(0, 32, 0);
|
||||
ElementTransformUtils.MoveElement(m_familyDocument, revolution1.Id, transPoint1);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_errCount++;
|
||||
m_errorInfo += "Unexpected exceptions occur in CreateRevolution: " + e.ToString() + "\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create one sweep
|
||||
/// </summary>
|
||||
private void CreateSweep()
|
||||
{
|
||||
try
|
||||
{
|
||||
#region Create rectangular profile and path curve
|
||||
CurveArrArray arrarr = new CurveArrArray();
|
||||
CurveArray arr = new CurveArray();
|
||||
|
||||
Autodesk.Revit.DB.XYZ normal = Autodesk.Revit.DB.XYZ.BasisZ;
|
||||
SketchPlane sketchPlane = CreateSketchPlane(normal, Autodesk.Revit.DB.XYZ.Zero);
|
||||
|
||||
Autodesk.Revit.DB.XYZ pnt1 = new Autodesk.Revit.DB.XYZ(0, 0, 0);
|
||||
Autodesk.Revit.DB.XYZ pnt2 = new Autodesk.Revit.DB.XYZ(2, 0, 0);
|
||||
Autodesk.Revit.DB.XYZ pnt3 = new Autodesk.Revit.DB.XYZ(1, 1, 0);
|
||||
arr.Append(Arc.Create(pnt2, 1.0d, 0.0d, 180.0d, Autodesk.Revit.DB.XYZ.BasisX, Autodesk.Revit.DB.XYZ.BasisY));
|
||||
arr.Append(Arc.Create(pnt1, pnt3, pnt2));
|
||||
arrarr.Append(arr);
|
||||
SweepProfile profile = m_revit.Create.NewCurveLoopsProfile(arrarr);
|
||||
|
||||
Autodesk.Revit.DB.XYZ pnt4 = new Autodesk.Revit.DB.XYZ(10, 0, 0);
|
||||
Autodesk.Revit.DB.XYZ pnt5 = new Autodesk.Revit.DB.XYZ(0, 10, 0);
|
||||
Curve curve = Line.CreateBound(pnt4, pnt5);
|
||||
|
||||
CurveArray curves = new CurveArray();
|
||||
curves.Append(curve);
|
||||
#endregion
|
||||
// here create one sweep with two arcs formed the profile
|
||||
Sweep sweep1 = m_creationFamily.NewSweep(true, curves, sketchPlane, profile, 0, ProfilePlaneLocation.Start);
|
||||
// move to proper place
|
||||
Autodesk.Revit.DB.XYZ transPoint1 = new Autodesk.Revit.DB.XYZ(11, 0, 0);
|
||||
ElementTransformUtils.MoveElement(m_familyDocument, sweep1.Id, transPoint1);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_errCount++;
|
||||
m_errorInfo += "Unexpected exceptions occur in CreateSweep: " + e.ToString() + "\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create one SweptBlend
|
||||
/// </summary>
|
||||
private void CreateSweptBlend()
|
||||
{
|
||||
try
|
||||
{
|
||||
#region Create top and bottom profiles and path curve
|
||||
Autodesk.Revit.DB.XYZ pnt1 = new Autodesk.Revit.DB.XYZ(0, 0, 0);
|
||||
Autodesk.Revit.DB.XYZ pnt2 = new Autodesk.Revit.DB.XYZ(1, 0, 0);
|
||||
Autodesk.Revit.DB.XYZ pnt3 = new Autodesk.Revit.DB.XYZ(1, 1, 0);
|
||||
Autodesk.Revit.DB.XYZ pnt4 = new Autodesk.Revit.DB.XYZ(0, 1, 0);
|
||||
Autodesk.Revit.DB.XYZ pnt5 = new Autodesk.Revit.DB.XYZ(0, 0, 1);
|
||||
|
||||
CurveArrArray arrarr1 = new CurveArrArray();
|
||||
CurveArray arr1 = new CurveArray();
|
||||
arr1.Append(Line.CreateBound(pnt1, pnt2));
|
||||
arr1.Append(Line.CreateBound(pnt2, pnt3));
|
||||
arr1.Append(Line.CreateBound(pnt3, pnt4));
|
||||
arr1.Append(Line.CreateBound(pnt4, pnt1));
|
||||
arrarr1.Append(arr1);
|
||||
|
||||
Autodesk.Revit.DB.XYZ pnt6 = new Autodesk.Revit.DB.XYZ(0.5, 0, 0);
|
||||
Autodesk.Revit.DB.XYZ pnt7 = new Autodesk.Revit.DB.XYZ(1, 0.5, 0);
|
||||
Autodesk.Revit.DB.XYZ pnt8 = new Autodesk.Revit.DB.XYZ(0.5, 1, 0);
|
||||
Autodesk.Revit.DB.XYZ pnt9 = new Autodesk.Revit.DB.XYZ(0, 0.5, 0);
|
||||
CurveArrArray arrarr2 = new CurveArrArray();
|
||||
CurveArray arr2 = new CurveArray();
|
||||
arr2.Append(Line.CreateBound(pnt6, pnt7));
|
||||
arr2.Append(Line.CreateBound(pnt7, pnt8));
|
||||
arr2.Append(Line.CreateBound(pnt8, pnt9));
|
||||
arr2.Append(Line.CreateBound(pnt9, pnt6));
|
||||
arrarr2.Append(arr2);
|
||||
|
||||
SweepProfile bottomProfile = m_revit.Create.NewCurveLoopsProfile(arrarr1);
|
||||
SweepProfile topProfile = m_revit.Create.NewCurveLoopsProfile(arrarr2);
|
||||
|
||||
Autodesk.Revit.DB.XYZ pnt10 = new Autodesk.Revit.DB.XYZ(5, 0, 0);
|
||||
Autodesk.Revit.DB.XYZ pnt11 = new Autodesk.Revit.DB.XYZ(0, 20, 0);
|
||||
Curve curve = Line.CreateBound(pnt10, pnt11);
|
||||
|
||||
Autodesk.Revit.DB.XYZ normal = Autodesk.Revit.DB.XYZ.BasisZ;
|
||||
SketchPlane sketchPlane = CreateSketchPlane(normal, Autodesk.Revit.DB.XYZ.Zero);
|
||||
#endregion
|
||||
// here create one swept blend
|
||||
SweptBlend newSweptBlend1 = m_creationFamily.NewSweptBlend(true, curve, sketchPlane, bottomProfile, topProfile);
|
||||
// move to proper place
|
||||
Autodesk.Revit.DB.XYZ transPoint1 = new Autodesk.Revit.DB.XYZ(11, 32, 0);
|
||||
ElementTransformUtils.MoveElement(m_familyDocument, newSweptBlend1.Id, transPoint1);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_errCount++;
|
||||
m_errorInfo += "Unexpected exceptions occur in CreateSweptBlend: " + e.ToString() + "\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get element by its id
|
||||
/// </summary>
|
||||
private T GetElement<T>(int eid) where T : Autodesk.Revit.DB.Element
|
||||
{
|
||||
Autodesk.Revit.DB.ElementId elementId = new ElementId(eid);
|
||||
return m_familyDocument.GetElement(elementId) as T;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create sketch plane for generic model profile
|
||||
/// </summary>
|
||||
/// <param name="normal">plane normal</param>
|
||||
/// <param name="origin">origin point</param>
|
||||
/// <returns></returns>
|
||||
internal SketchPlane CreateSketchPlane(Autodesk.Revit.DB.XYZ normal, Autodesk.Revit.DB.XYZ origin)
|
||||
{
|
||||
// First create a Geometry.Plane which need in NewSketchPlane() method
|
||||
Plane geometryPlane = Plane.CreateByNormalAndOrigin(normal, origin);
|
||||
if (null == geometryPlane) // assert the creation is successful
|
||||
{
|
||||
throw new Exception("Create the geometry plane failed.");
|
||||
}
|
||||
// Then create a sketch plane using the Geometry.Plane
|
||||
SketchPlane plane = SketchPlane.Create(m_familyDocument, geometryPlane);
|
||||
// throw exception if creation failed
|
||||
if (null == plane)
|
||||
{
|
||||
throw new Exception("Create the sketch plane failed.");
|
||||
}
|
||||
return plane;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RevitAddIns>
|
||||
<AddIn Type="Command">
|
||||
<Assembly>GenericModelCreation.dll</Assembly>
|
||||
<ClientId>50567fc8-e907-429f-b34c-32e1bd0d8cc1</ClientId>
|
||||
<FullClassName>Revit.SDK.Samples.GenericModelCreation.CS.Command</FullClassName>
|
||||
<Text>GenericModelCreation</Text>
|
||||
<Description>The sample show how to create Generic Model family at family document.</Description>
|
||||
<VisibilityMode>AlwaysVisible</VisibilityMode>
|
||||
<VendorId>ADSK</VendorId>
|
||||
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
|
||||
</AddIn>
|
||||
</RevitAddIns>
|
||||
@@ -1,133 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{185F7159-ADCC-4459-BBC4-2C39EB64FCFF}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Revit.SDK.Samples.GenericModelCreation.CS</RootNamespace>
|
||||
<AssemblyName>GenericModelCreation</AssemblyName>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<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>
|
||||
</DocumentationFile>
|
||||
<RunCodeAnalysis>false</RunCodeAnalysis>
|
||||
</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="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Command.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</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>
|
||||
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
|
||||
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,57 +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.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("GenericModelCreation")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Autodesk")]
|
||||
[assembly: AssemblyProduct("GenericModelCreation")]
|
||||
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2009")]
|
||||
[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("5857aef0-d6e4-40a0-9672-4743669289a2")]
|
||||
|
||||
// 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 Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -1,196 +0,0 @@
|
||||
{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
|
||||
{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
|
||||
{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
|
||||
{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
|
||||
{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}
|
||||
{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f41\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f42\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\f44\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f45\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f46\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f47\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
||||
{\f48\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f49\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f51\fbidi \fswiss\fcharset238\fprq2 Arial CE;}{\f52\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}
|
||||
{\f54\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f55\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f56\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f57\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}
|
||||
{\f58\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f59\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f381\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f382\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}
|
||||
{\f384\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f385\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f388\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
|
||||
{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
|
||||
{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
|
||||
{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
|
||||
{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
|
||||
{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
|
||||
{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
|
||||
{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
|
||||
{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
|
||||
{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
||||
{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
|
||||
{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
|
||||
{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
|
||||
{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
|
||||
{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
|
||||
{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
|
||||
{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
||||
{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;
|
||||
\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;
|
||||
\red192\green192\blue192;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{
|
||||
\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
|
||||
\snext0 \sqformat \spriority0 Normal;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
|
||||
\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
|
||||
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
|
||||
\snext11 \ssemihidden \sunhideused \sqformat Normal Table;}}{\*\rsidtbl \rsid7213339\rsid15749271}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator Lule}
|
||||
{\creatim\yr2010\mo3\dy3\hr15\min44}{\revtim\yr2010\mo3\dy4\hr15\min26}{\version3}{\edmins1}{\nofpages1}{\nofwords203}{\nofchars1158}{\nofcharsws1359}{\vern32771}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
|
||||
\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
|
||||
\widowctrl\ftnbj\aenddoc\trackmoves1\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120\dghorigin1701
|
||||
\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\rsidroot7213339 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2
|
||||
\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6
|
||||
\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang
|
||||
{\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\af31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 {
|
||||
\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 Application:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 GenericModelCreation\line }{\rtlch\fcs1 \ab\af1\afs20
|
||||
\ltrch\fcs0 \b\f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 Revit Platform:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 All\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7213339
|
||||
\hich\af1\dbch\af31505\loch\f1 Revit Version:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 2011.0\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1
|
||||
First Released For:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 2010.0\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 Programming Language:}{
|
||||
\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 C#\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 Skill Level:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0
|
||||
\f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 Medium\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 Category:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7213339
|
||||
\hich\af1\dbch\af31505\loch\f1 Families\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 Type:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1
|
||||
ExternalCommand
|
||||
\par }{\rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f0\fs20\insrsid7213339
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 Subject: Create Generic Model}{\rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f0\fs20\insrsid7213339
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 Summary:
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 This sample shows how to create Generic Model through Revit API}{\rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f0\fs20\insrsid7213339
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7213339
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Classes: }{\rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f0\fs20\insrsid7213339
|
||||
\par }\pard \ltrpar\ql \fi360\li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.UI.IExternalCommand
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.DB.Document
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.\hich\af1\dbch\af31505\loch\f1 DB.ElementSet
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.DB.GeometryObject
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.Creation.{\*\bkmkstart OLE_LINK1}{\*\bkmkstart OLE_LINK2}\hich\af1\dbch\af31505\loch\f1 FamilyItemFactory}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7213339 {\*\bkmkend OLE_LINK1}{\*\bkmkend OLE_LINK2
|
||||
}
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f0\fs20\insrsid7213339
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 Project Files:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Command.cs}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7213339
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1
|
||||
This file contains the class Command that inherits from IExternalCommand. The class implements the Exec\hich\af1\dbch\af31505\loch\f1 ute method and be used to create family in Revit}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7213339 .
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7213339
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 Description:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1
|
||||
\par \hich\af1\dbch\af31505\loch\f1 This sample mostly uses the FamilyItemFactory class for implementing the functionality: creating Extrusion/ Blend/ Revolution/ Sweep/ SweptBlend elements}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7213339 .
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\tx360\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7213339 -\tab \hich\af1\dbch\af31505\loch\f1 To get a SketchPlane, use CreateSk\hich\af1\dbch\af31505\loch\f1
|
||||
etchPlane()}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7213339 .
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7213339 -\tab \hich\af1\dbch\af31505\loch\f1
|
||||
To get a Curve, use Autodesk.Revit.Creation.Application.Create.NewLineBound () and Append it to a CurveArray to get the array.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7213339
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7213339 -\tab \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.Creation.FamilyItemFactory.NewXXXX() create families.
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7213339
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 Instructions:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\cf2\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\cf2\insrsid7213339
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\tx360\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 1.\tab \hich\af1\dbch\af31505\loch\f1
|
||||
In order to create a family, user should manually create a family document by a template document (Generic Model wall based.rft is attached).}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7213339
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid7213339 \hich\af1\dbch\af31505\loch\f1 2.\tab
|
||||
Click the extern command, five Generic Model elements should be created as Extrusion/ Blend/ Revolution/ Sweep/\hich\af1\dbch\af31505\loch\f1 SweptBlend}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7213339 .
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid7213339
|
||||
\par
|
||||
\par }{\*\themedata 504b030414000600080000002100828abc13fa0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb6ac3301045f785fe83d0b6d8
|
||||
72ba28a5d8cea249777d2cd20f18e4b12d6a8f843409c9df77ecb850ba082d74231062ce997b55ae8fe3a00e1893f354e9555e6885647de3a8abf4fbee29bbd7
|
||||
2a3150038327acf409935ed7d757e5ee14302999a654e99e393c18936c8f23a4dc072479697d1c81e51a3b13c07e4087e6b628ee8cf5c4489cf1c4d075f92a0b
|
||||
44d7a07a83c82f308ac7b0a0f0fbf90c2480980b58abc733615aa2d210c2e02cb04430076a7ee833dfb6ce62e3ed7e14693e8317d8cd0433bf5c60f53fea2fe7
|
||||
065bd80facb647e9e25c7fc421fd2ddb526b2e9373fed4bb902e182e97b7b461e6bfad3f010000ffff0300504b030414000600080000002100a5d6a7e7c00000
|
||||
00360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4fc7060abb08
|
||||
84a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b63095120f88d94fbc
|
||||
52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462a1a82fe353
|
||||
bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f7468656d652f7468
|
||||
656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b4b0d592c9c
|
||||
070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b4757e8d3f7
|
||||
29e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f7468656d65
|
||||
312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87615b8116d8
|
||||
a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad79482a9c04
|
||||
98f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b5d8a314d3c
|
||||
94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab999fb7b471
|
||||
7509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9699640f671
|
||||
9e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd5868b37a088d1
|
||||
e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d60cf03ac1a5
|
||||
193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f9e7ef3f2d1
|
||||
17d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be15c308d3f2
|
||||
8acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a99793849c26ae6
|
||||
6252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d32a423279a
|
||||
668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2af074481847
|
||||
bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86e877f0034e
|
||||
16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb44f95d843b
|
||||
5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a6409fb44d0
|
||||
8741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c3d9058edf2
|
||||
c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db02565e85f3b966
|
||||
0d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276b9f7dec44b
|
||||
7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8c33585b5fb
|
||||
9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e51440ca2e0
|
||||
088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95b21be5ceaf
|
||||
8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff6dce591a26
|
||||
ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec69ffb9e65d0
|
||||
28d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239b75a5bb1e6
|
||||
345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a44959d366ad93
|
||||
b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e82db8df9f30
|
||||
254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f74
|
||||
68656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f24
|
||||
51eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e3198
|
||||
720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528
|
||||
a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100828abc13fa0000001c0200001300000000000000000000000000
|
||||
000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b000000000000000000000000
|
||||
002b0100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c00000000000000000000000000140200007468
|
||||
656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b000016000000000000000000
|
||||
00000000d10200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b010000270000000000
|
||||
00000000000000009b0900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000960a00000000}
|
||||
{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
|
||||
617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
|
||||
6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
|
||||
656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
|
||||
{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
|
||||
\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
|
||||
\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
|
||||
\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
|
||||
4d73786d6c322e534158584d4c5265616465722e352e3000000000000000000000060000
|
||||
d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffffec69d9888b8b3d4c859eaf6cd158be0f000000000000000000000000d051
|
||||
ebfe6bbbca01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000105000000000000}}
|
||||
@@ -1,177 +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 Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Revit.SDK.Samples.TypeRegeneration.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// A class inherits IExternalCommand interface.
|
||||
/// this class controls the class which subscribes handle events and the events' information UI.
|
||||
/// like a bridge between them.
|
||||
/// </summary>
|
||||
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
|
||||
[Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
|
||||
[Autodesk.Revit.Attributes.Journaling(Autodesk.Revit.Attributes.JournalingMode.NoCommandData)]
|
||||
public class Command : IExternalCommand
|
||||
{
|
||||
#region Class Memeber Variables
|
||||
/// <summary>
|
||||
/// store family manager
|
||||
/// </summary>
|
||||
FamilyManager m_familyManager;
|
||||
|
||||
/// <summary>
|
||||
/// store the log file name
|
||||
/// </summary>
|
||||
string m_logFileName;
|
||||
#endregion
|
||||
|
||||
#region Class Interface Implementation
|
||||
/// <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>
|
||||
public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData,
|
||||
ref string message,
|
||||
ElementSet elements)
|
||||
{
|
||||
Document document;
|
||||
string assemblyPath;
|
||||
document = commandData.Application.ActiveUIDocument.Document;
|
||||
assemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
m_logFileName = assemblyPath + "\\RegenerationLog.txt";
|
||||
//only a family document can retrieve family manager
|
||||
if (document.IsFamilyDocument)
|
||||
{
|
||||
m_familyManager = document.FamilyManager;
|
||||
//create regeneration log file
|
||||
StreamWriter writer = File.CreateText(m_logFileName);
|
||||
writer.WriteLine("Family Type Result");
|
||||
writer.WriteLine("-------------------------");
|
||||
writer.Close();
|
||||
using(MessageForm msgForm=new MessageForm())
|
||||
{
|
||||
msgForm.StartPosition = FormStartPosition.Manual;
|
||||
CheckTypeRegeneration(msgForm);
|
||||
return Autodesk.Revit.UI.Result.Succeeded;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "please make sure you have opened a family document!";
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Class Implementation
|
||||
/// <summary>
|
||||
/// After setting CurrentType property, the CurrentType has changed to the new one,the Revit model will change along with the current type
|
||||
/// </summary>
|
||||
/// <param name="msgForm">the form is used to show the regeneration result</param>
|
||||
public void CheckTypeRegeneration(MessageForm msgForm)
|
||||
{
|
||||
//the list to record the error messages
|
||||
List<string> errorInfo = new List<string>();
|
||||
try
|
||||
{
|
||||
foreach (FamilyType type in m_familyManager.Types)
|
||||
{
|
||||
if (!(type.Name.ToString().Trim()==""))
|
||||
{
|
||||
try
|
||||
{
|
||||
m_familyManager.CurrentType = type;
|
||||
msgForm.AddMessage(type.Name+" Successful\n",true);
|
||||
WriteLog(type.Name + " Successful");
|
||||
}
|
||||
catch
|
||||
{
|
||||
errorInfo.Add(type.Name);
|
||||
msgForm.AddMessage(type.Name+" Failed \n",true);
|
||||
WriteLog(type.Name + " Failed");
|
||||
}
|
||||
msgForm.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
//add a conclusion regeneration result
|
||||
string resMsg;
|
||||
if (errorInfo.Count > 0)
|
||||
{
|
||||
resMsg = "\nResult: " + errorInfo.Count + " family types regeneration failed!";
|
||||
foreach (string error in errorInfo)
|
||||
{
|
||||
resMsg += "\n " + error;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
resMsg = "\nResult: All types in the family can regenerate successfully.";
|
||||
}
|
||||
WriteLog(resMsg.ToString());
|
||||
resMsg += "\nIf you want to know the detail regeneration result please get log file at "+m_logFileName;
|
||||
msgForm.AddMessage(resMsg,false);
|
||||
msgForm.ShowDialog();
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
WriteLog("There is some problem when regeneration:" + ex.ToString());
|
||||
msgForm.AddMessage("There is some problem when regeneration:"+ex.ToString(),true);
|
||||
msgForm.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The method to write line to log file
|
||||
/// </summary>
|
||||
/// <param name="logStr">the log string</param>
|
||||
private void WriteLog(string logStr)
|
||||
{
|
||||
StreamWriter writer = null;
|
||||
writer = File.AppendText(m_logFileName);
|
||||
writer.WriteLine(logStr);
|
||||
writer.Close();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -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.
|
||||
//
|
||||
|
||||
namespace Revit.SDK.Samples.TypeRegeneration.CS
|
||||
{
|
||||
partial class MessageForm
|
||||
{
|
||||
/// <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.messageRichTextBox = new System.Windows.Forms.RichTextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// messageRichTextBox
|
||||
//
|
||||
this.messageRichTextBox.BackColor = System.Drawing.SystemColors.Info;
|
||||
this.messageRichTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.messageRichTextBox.EnableAutoDragDrop = true;
|
||||
this.messageRichTextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.messageRichTextBox.ForeColor = System.Drawing.SystemColors.InfoText;
|
||||
this.messageRichTextBox.Location = new System.Drawing.Point(0, 0);
|
||||
this.messageRichTextBox.Name = "messageRichTextBox";
|
||||
this.messageRichTextBox.Size = new System.Drawing.Size(313, 186);
|
||||
this.messageRichTextBox.TabIndex = 1;
|
||||
this.messageRichTextBox.Text = "";
|
||||
//
|
||||
// MessageForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(313, 186);
|
||||
this.Controls.Add(this.messageRichTextBox);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "MessageForm";
|
||||
this.ShowInTaskbar = false;
|
||||
this.Text = "MessageForm";
|
||||
this.ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.RichTextBox messageRichTextBox;
|
||||
}
|
||||
}
|
||||
@@ -1,80 +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.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Revit.SDK.Samples.TypeRegeneration.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// The form is used to show the result
|
||||
/// </summary>
|
||||
public partial class MessageForm : System.Windows.Forms.Form
|
||||
{
|
||||
/// <summary>
|
||||
/// new a Timer,set the interval 2 seconds
|
||||
/// </summary>
|
||||
System.Timers.Timer timer = new System.Timers.Timer(2000);
|
||||
|
||||
/// <summary>
|
||||
/// construction of MessageForm
|
||||
/// </summary>
|
||||
public MessageForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Text = "Type Regeneration Message Form";
|
||||
//set the timer elapsed event
|
||||
timer.Elapsed += new System.Timers.ElapsedEventHandler(onTimeOut);//Set the executed event when time is out
|
||||
timer.Enabled = false;
|
||||
CheckForIllegalCrossThreadCalls = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// add text to the richtextbox and set time enable is true, then timer starts timing
|
||||
/// </summary>
|
||||
/// <param name="message">message from the regeneration</param>
|
||||
/// <param name="enableTimer">enable or disable the timer elapsed event</param>
|
||||
public void AddMessage(string message,bool enableTimer)
|
||||
{
|
||||
messageRichTextBox.AppendText(message);
|
||||
timer.Enabled = enableTimer;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// the method is executed when time is out, and set the timer enabled false,then timer stop timing
|
||||
/// </summary>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="e">time elapsed event args</param>
|
||||
private void onTimeOut(object source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
timer.Enabled = false;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.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("TypeRegeneration")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Autodesk, Inc.")]
|
||||
[assembly: AssemblyProduct("TypeRegeneration")]
|
||||
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2009")]
|
||||
[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("a74cebac-84a8-435e-a0a5-e9d4f31dffb5")]
|
||||
|
||||
// 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")]
|
||||
Binary file not shown.
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RevitAddIns>
|
||||
<AddIn Type="Command">
|
||||
<Assembly>TypeRegeneration.dll</Assembly>
|
||||
<ClientId>74177539-f9ef-4d2b-83c0-2403640699a5</ClientId>
|
||||
<FullClassName>Revit.SDK.Samples.TypeRegeneration.CS.Command</FullClassName>
|
||||
<Text>TypeRegeneration</Text>
|
||||
<Description>The command check every type regeneration without any error</Description>
|
||||
<VisibilityMode>AlwaysVisible</VisibilityMode>
|
||||
<VendorId>ADSK</VendorId>
|
||||
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
|
||||
</AddIn>
|
||||
</RevitAddIns>
|
||||
@@ -1,103 +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>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{17799695-A334-4ACD-AD5E-2869DF5743FE}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>TypeRegeneration</RootNamespace>
|
||||
<AssemblyName>TypeRegeneration</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<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>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<DocumentationFile>bin\Debug\TypeRegeneration.XML</DocumentationFile>
|
||||
</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>
|
||||
<DocumentationFile>bin\Release\TypeRegeneration.XML</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DocumentationFile>bin\Debug\TypeRegeneration.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>
|
||||
<DocumentationFile>bin\Release\TypeRegeneration.XML</DocumentationFile>
|
||||
<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.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Command.cs" />
|
||||
<Compile Include="MessageForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MessageForm.Designer.cs">
|
||||
<DependentUpon>MessageForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="MessageForm.resx">
|
||||
<DependentUpon>MessageForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</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>
|
||||
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
|
||||
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,142 +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 System.Windows.Forms;
|
||||
|
||||
using Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using Autodesk.Revit.ApplicationServices;
|
||||
|
||||
namespace Revit.SDK.Samples.ValidateParameters.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// A class inherits IExternalApplication interface to add an event to the document saving,
|
||||
/// which will be called when the document is being saved.
|
||||
/// </summary>
|
||||
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
|
||||
[Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
|
||||
[Autodesk.Revit.Attributes.Journaling(Autodesk.Revit.Attributes.JournalingMode.NoCommandData)]
|
||||
class Application: IExternalApplication
|
||||
{
|
||||
#region IExternalApplication Members
|
||||
/// <summary>
|
||||
/// 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 Autodesk.Revit.UI.Result OnStartup(UIControlledApplication application)
|
||||
{
|
||||
try
|
||||
{
|
||||
application.ControlledApplication.DocumentSaving += new EventHandler<Autodesk.Revit.DB.Events.DocumentSavingEventArgs>(application_DocumentSaving);
|
||||
application.ControlledApplication.DocumentSavingAs += new EventHandler<Autodesk.Revit.DB.Events.DocumentSavingAsEventArgs>(application_DocumentSavingAs);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
return Autodesk.Revit.UI.Result.Succeeded;
|
||||
}
|
||||
|
||||
/// <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 Autodesk.Revit.UI.Result OnShutdown(UIControlledApplication application)
|
||||
{
|
||||
try
|
||||
{
|
||||
application.ControlledApplication.DocumentSaving -= new EventHandler<Autodesk.Revit.DB.Events.DocumentSavingEventArgs>(application_DocumentSaving);
|
||||
application.ControlledApplication.DocumentSavingAs -= new EventHandler<Autodesk.Revit.DB.Events.DocumentSavingAsEventArgs>(application_DocumentSavingAs);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
return Autodesk.Revit.UI.Result.Succeeded;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Subscribe to the DocumentSaving event to be notified when Revit is just about to save the document.
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">The event argument used by DocumentSaving event. </param>
|
||||
private void application_DocumentSaving(Object sender, Autodesk.Revit.DB.Events.DocumentSavingEventArgs e)
|
||||
{
|
||||
validateParameters(e.Document);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Subscribe to the DocumentSavingAs event to be notified when Revit is just about to save the document with a new file name.
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">The event argument used by DocumentSavingAs event.</param>
|
||||
private void application_DocumentSavingAs(Object sender, Autodesk.Revit.DB.Events.DocumentSavingAsEventArgs e)
|
||||
{
|
||||
validateParameters(e.Document);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The method is to validate parameters via FamilyParameter and FamilyType
|
||||
/// </summary>
|
||||
/// <param name="doc">the document which need to validate parameters</param>
|
||||
private void validateParameters(Document doc)
|
||||
{
|
||||
List<string> errorInfo = new List<string>();
|
||||
FamilyManager familyManager;
|
||||
if (doc.IsFamilyDocument)
|
||||
{
|
||||
familyManager = doc.FamilyManager;
|
||||
errorInfo = Command.ValidateParameters(familyManager);
|
||||
}
|
||||
else
|
||||
{
|
||||
errorInfo.Add("The current document isn't a family document, so the validation doesn't work correctly!");
|
||||
}
|
||||
using (MessageForm msgForm = new MessageForm(errorInfo.ToArray()))
|
||||
{
|
||||
msgForm.StartPosition = FormStartPosition.CenterParent;
|
||||
msgForm.ShowDialog();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,158 +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.Windows.Forms;
|
||||
using Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
namespace Revit.SDK.Samples.ValidateParameters.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// A class inherits IExternalCommand interface.
|
||||
/// this class controls the class which subscribes handle events and the events' information UI.
|
||||
/// like a bridge between them.
|
||||
/// </summary>
|
||||
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
|
||||
[Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
|
||||
[Autodesk.Revit.Attributes.Journaling(Autodesk.Revit.Attributes.JournalingMode.NoCommandData)]
|
||||
public class Command:IExternalCommand
|
||||
{
|
||||
#region Class Memeber Variables
|
||||
/// <summary>
|
||||
/// store the family manager
|
||||
/// </summary>
|
||||
FamilyManager m_familyManager;
|
||||
#endregion
|
||||
|
||||
#region Class Interface Implementation
|
||||
/// <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>
|
||||
public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData,
|
||||
ref string message,
|
||||
ElementSet elements)
|
||||
{
|
||||
Document document;
|
||||
document = commandData.Application.ActiveUIDocument.Document;
|
||||
// only a family document can retrieve family manager
|
||||
if (document.IsFamilyDocument)
|
||||
{
|
||||
m_familyManager = document.FamilyManager;
|
||||
List<string> errorMessages = ValidateParameters(m_familyManager);
|
||||
using(MessageForm msgForm = new MessageForm(errorMessages.ToArray()))
|
||||
{
|
||||
msgForm.StartPosition = FormStartPosition.CenterParent;
|
||||
msgForm.ShowDialog();
|
||||
return Autodesk.Revit.UI.Result.Succeeded;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "please make sure you have opened a family document!";
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Class Implementation
|
||||
/// <summary>
|
||||
/// implementation of validate parameters, get all family types and parameters,
|
||||
/// use the function FamilyType.HasValue() to make sure if the parameter needs to
|
||||
/// validate. Then along to the storage type to validate the parameters.
|
||||
/// </summary>
|
||||
/// <returns>error information list</returns>
|
||||
public static List<string> ValidateParameters(FamilyManager familyManager)
|
||||
{
|
||||
List<string> errorInfo = new List<string>();
|
||||
// go though all parameters
|
||||
foreach (FamilyType type in familyManager.Types)
|
||||
{
|
||||
bool right = true;
|
||||
foreach (FamilyParameter para in familyManager.Parameters)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (type.HasValue(para))
|
||||
{
|
||||
switch (para.StorageType)
|
||||
{
|
||||
case StorageType.Double:
|
||||
if (!(type.AsDouble(para) is double))
|
||||
right = false;
|
||||
break;
|
||||
case StorageType.ElementId:
|
||||
try
|
||||
{
|
||||
Autodesk.Revit.DB.ElementId elemId=type.AsElementId(para);
|
||||
}
|
||||
catch
|
||||
{
|
||||
right = false;
|
||||
}
|
||||
break;
|
||||
case StorageType.Integer:
|
||||
if (!(type.AsInteger(para) is int))
|
||||
right = false;
|
||||
break;
|
||||
case StorageType.String:
|
||||
if (!(type.AsString(para) is string))
|
||||
right = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// output the parameters which failed during validating.
|
||||
catch
|
||||
{
|
||||
errorInfo.Add("Family Type:" + type.Name + " Family Parameter:"
|
||||
+ para.Definition.Name + " validating failed!");
|
||||
}
|
||||
if (!right)
|
||||
{
|
||||
errorInfo.Add("Family Type:" + type.Name + " Family Parameter:"
|
||||
+ para.Definition.Name + " validating failed!");
|
||||
}
|
||||
}
|
||||
}
|
||||
return errorInfo;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -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.
|
||||
//
|
||||
|
||||
namespace Revit.SDK.Samples.ValidateParameters.CS
|
||||
{
|
||||
partial class MessageForm
|
||||
{
|
||||
/// <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.messageRichTextBox = new System.Windows.Forms.RichTextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// messageRichTextBox
|
||||
//
|
||||
this.messageRichTextBox.BackColor = System.Drawing.SystemColors.Info;
|
||||
this.messageRichTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.messageRichTextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.messageRichTextBox.ForeColor = System.Drawing.SystemColors.InfoText;
|
||||
this.messageRichTextBox.Location = new System.Drawing.Point(0, 0);
|
||||
this.messageRichTextBox.Name = "messageRichTextBox";
|
||||
this.messageRichTextBox.Size = new System.Drawing.Size(415, 216);
|
||||
this.messageRichTextBox.TabIndex = 0;
|
||||
this.messageRichTextBox.Text = "";
|
||||
//
|
||||
// MessageForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(415, 216);
|
||||
this.Controls.Add(this.messageRichTextBox);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "MessageForm";
|
||||
this.ShowInTaskbar = false;
|
||||
this.Text = "MessageForm";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.RichTextBox messageRichTextBox;
|
||||
}
|
||||
}
|
||||
@@ -1,104 +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.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Revit.SDK.Samples.ValidateParameters.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// The form is used to show the result
|
||||
/// </summary>
|
||||
public partial class MessageForm : System.Windows.Forms.Form
|
||||
{
|
||||
/// <summary>
|
||||
/// store the log file name
|
||||
/// </summary>
|
||||
string m_logFileName;
|
||||
|
||||
/// <summary>
|
||||
/// construction of form
|
||||
/// </summary>
|
||||
public MessageForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
/// <summary>
|
||||
/// construction method with parameter
|
||||
/// </summary>
|
||||
/// <param name="messages">messages</param>
|
||||
public MessageForm(string[] messages)
|
||||
: this()
|
||||
{
|
||||
string msgText = "";
|
||||
//If the size of error messages is 0, means the validate parameters is successful
|
||||
this.Text = "Validate Parameters Message Form";
|
||||
//create regeneration log file
|
||||
string assemblyPath;
|
||||
assemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
m_logFileName = assemblyPath + "\\ValidateParametersLog.txt";
|
||||
StreamWriter writer = File.CreateText(m_logFileName);
|
||||
writer.Close();
|
||||
if (messages.Length == 0)
|
||||
{
|
||||
msgText = "All types and parameters passed the validation for API";
|
||||
WriteLog(msgText);
|
||||
messageRichTextBox.Text = msgText;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (string row in messages)
|
||||
{
|
||||
if (row == null) continue;
|
||||
else
|
||||
{
|
||||
WriteLog(row);
|
||||
msgText += row + "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
msgText += "\n\nIf you want to know the validating parameters result, please get the log file at \n"+m_logFileName;
|
||||
messageRichTextBox.Text = msgText;
|
||||
this.StartPosition = FormStartPosition.CenterParent;
|
||||
CheckForIllegalCrossThreadCalls = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The method is used to write line to log file
|
||||
/// </summary>
|
||||
/// <param name="logStr">the log string</param>
|
||||
private void WriteLog(string logStr)
|
||||
{
|
||||
StreamWriter writer = null;
|
||||
writer = File.AppendText(m_logFileName);
|
||||
writer.WriteLine(logStr);
|
||||
writer.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.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("ValidateParameters")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Autodesk, Inc.")]
|
||||
[assembly: AssemblyProduct("ValidateParameters")]
|
||||
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2009")]
|
||||
[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("f9489145-9514-427d-b6ce-8dcb564cc12d")]
|
||||
|
||||
// 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")]
|
||||
@@ -1,244 +0,0 @@
|
||||
{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe2052\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
|
||||
{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt \'cb\'ce\'cc\'e5};}{\f34\fbidi \froman\fcharset1\fprq2{\*\panose 02040503050406030204}Cambria Math;}
|
||||
{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f39\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@SimSun;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
|
||||
{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt \'cb\'ce\'cc\'e5};}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
|
||||
{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
|
||||
{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt \'cb\'ce\'cc\'e5};}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}
|
||||
{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f40\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f41\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\f43\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f44\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f45\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f46\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
||||
{\f47\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f48\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f50\fbidi \fswiss\fcharset238\fprq2 Arial CE;}{\f51\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}
|
||||
{\f53\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f54\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f55\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f56\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}
|
||||
{\f57\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f58\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f172\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt \'cb\'ce\'cc\'e5};}{\f420\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}
|
||||
{\f421\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f423\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f424\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}{\f425\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}
|
||||
{\f426\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f427\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f428\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}{\f429\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}
|
||||
{\f432\fbidi \fnil\fcharset0\fprq2 @SimSun Western;}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
|
||||
{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
|
||||
{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt \'cb\'ce\'cc\'e5};}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}
|
||||
{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}
|
||||
{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
|
||||
{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
|
||||
{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
|
||||
{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
||||
{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt \'cb\'ce\'cc\'e5};}
|
||||
{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}
|
||||
{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
|
||||
{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
|
||||
{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
|
||||
{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;
|
||||
\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\*\defchp
|
||||
\fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sa200\sl276\slmult1
|
||||
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext0 \sqformat \spriority0 Normal;}
|
||||
{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
|
||||
\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
|
||||
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
|
||||
\snext11 \ssemihidden \sunhideused \sqformat Normal Table;}{\s15\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0
|
||||
\fs16\lang1033\langfe2052\loch\f38\hich\af38\dbch\af31505\cgrid\langnp1033\langfenp2052 \sbasedon0 \snext15 \slink16 \ssemihidden \sunhideused \styrsid1508528 Document Map;}{\*\cs16 \additive \rtlch\fcs1 \af38\afs16 \ltrch\fcs0 \f38\fs16
|
||||
\sbasedon10 \slink15 \slocked \ssemihidden \styrsid1508528 Document Map Char;}}{\*\rsidtbl \rsid1508528}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info
|
||||
{\operator Aaron Lu}{\creatim\yr2010\mo8\dy11\hr16\min43}{\revtim\yr2010\mo8\dy11\hr16\min43}{\version2}{\edmins0}{\nofpages2}{\nofwords479}{\nofchars2733}{\nofcharsws3206}{\vern32771}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wo
|
||||
rdml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
|
||||
\widowctrl\ftnbj\aenddoc\trackmoves1\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120\dghorigin1701
|
||||
\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\rsidroot1508528 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2
|
||||
\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6
|
||||
\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang
|
||||
{\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0\pararsid1508528 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0
|
||||
\fs22\lang1033\langfe2052\loch\af31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Application:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0
|
||||
\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 ValidateParameters}{\rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f0\fs20\insrsid1508528
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Revit Platform:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528
|
||||
\hich\af1\dbch\af31505\loch\f1 All\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Revit Version:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 2011.0
|
||||
\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 First Released For:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 2010.0\line }{\rtlch\fcs1 \ab\af1\afs20
|
||||
\ltrch\fcs0 \b\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Programming Language:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 C#\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0
|
||||
\b\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Skill Level:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Beginning\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid1508528
|
||||
\hich\af1\dbch\af31505\loch\f1 Category:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Families\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Type:}{
|
||||
\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 ExternalCommand}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 , }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0
|
||||
\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 ExternalApplication}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528
|
||||
\par
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Subject:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Validate Parameters}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\insrsid1508528
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Summary:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1
|
||||
This sample will demonstrate if every type has valid values for certain parameters.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0\pararsid1508528 {\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Classes:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0
|
||||
\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528
|
||||
\par }\pard \ltrpar\ql \fi360\li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0\pararsid1508528 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.UI.IExternalCommand
|
||||
\par }\pard \ltrpar\ql \fi360\li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.UI.IExternalApplication
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.UI.UIDocument
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.DB.Element
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.DB.FamilyManage\hich\af1\dbch\af31505\loch\f1 r
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.DB.ParameterSet
|
||||
\par }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0\pararsid1508528 {\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Project Files:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0
|
||||
\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Command.cs}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1
|
||||
This file contains a class Command which implements IExternalCommmand interface. The function of the class is to call API FamilyType.HasValue and methods FamilyType.AsDouble (Parameter), AsElemen\hich\af1\dbch\af31505\loch\f1
|
||||
tId(Parameter) to validate parameters}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528 .
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0\pararsid1508528 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\lang1024\langfe1024\noproof\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Application.cs
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 This file contains a class }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0
|
||||
\f1\fs20\cf1\lang1024\langfe1024\noproof\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Application}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1
|
||||
which implements IExternalApplcation interface. The OnStartUp method will register DocumentSaving, DocumentSavingAs events when Revit starts. The pre-event handler\hich\af1\dbch\af31505\loch\f1
|
||||
will validate parameters when document is saving; the post-event handler will validate parameters when document is saving as another file. The OnShutdown method will get rid of the two events when Revit shuts down}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\insrsid1508528 .
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0\pararsid1508528 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 MessageForm.cs
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 This file contains a wind\hich\af1\dbch\af31505\loch\f1
|
||||
ows form, which shows the parameters validation result to user.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0\pararsid1508528 {\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Description:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0
|
||||
\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1
|
||||
This sample only can be used in family. The sample implements IExternalApplication interface and subscribes DocumentSaving, DocumentSavingAs, events in OnStartUp method; the registered event handlers will validate parameters when events are raised}{
|
||||
\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528 .}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 It can \hich\af1\dbch\af31505\loch\f1
|
||||
also be launched by external command. If there is any parameter which cannot pass the validation, one warning message will show and list the invalid type and parameter}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528 .}{\rtlch\fcs1 \af1\afs20
|
||||
\ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 There is one log file that stores all information displayed in the form.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\tx360\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 -\tab \hich\af1\dbch\af31505\loch\f1 To register \hich\af1\dbch\af31505\loch\f1
|
||||
events to the application, use the event handler DocumentSaving and DocumentSavingAs of Controlled Application}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528 .
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 -\tab \hich\af1\dbch\af31505\loch\f1 To get the family types, use the property FamilyManager}{\rtlch\fcs1
|
||||
\af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528 .}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Types}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528 .
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\tx360\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 -\tab \hich\af1\dbch\af31505\loch\f1 To get the family parameters, use the property FamilyManager}{
|
||||
\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528 .}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Parameters}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528 .
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 -\tab \hich\af1\dbch\af31505\loch\f1 To\hich\af1\dbch\af31505\loch\f1 check whether the type has value for certain parameter, use the method FamilyType.HasValue (FamilyParameter)}{\rtlch\fcs1
|
||||
\af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528 .
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 -\tab \hich\af1\dbch\af31505\loch\f1 To check the Parameter\hich\f1 \rquote \loch\f1
|
||||
s storage type, use the property Parameter}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528 .}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 StorageType}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\insrsid1508528 .
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 -\tab \hich\af1\dbch\af31505\loch\f1 To retrieve the parameter value, use the methods FamilyType.As\hich\af1\dbch\af31505\loch\f1 Double (Parameter), AsElementId(Parameter) etc.}{\rtlch\fcs1
|
||||
\af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin0\itap0\pararsid1508528 {\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 Instructions:}{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0
|
||||
\b\f1\fs20\cf2\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 }{\rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f0\fs20\cf2\insrsid1508528
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\tx360\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 1.\tab Update your Revit.ini by following lines: }{\rtlch\fcs1
|
||||
\af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 [ExternalApplications]
|
||||
\par \hich\af1\dbch\af31505\loch\f1 EACount = 1
|
||||
\par
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\outlinelevel0\rin0\lin360\itap0\pararsid1508528 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1
|
||||
EAClassName1=Revit.SDK.Samples.ValidateParameters.CS.Application}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 EAAssembly1 = }{\rtlch\fcs1 \ai\af1\afs20 \ltrch\fcs0 \i\f1\fs20\insrsid1508528
|
||||
\hich\af1\dbch\af31505\loch\f1 <your path>}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528 \\}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 ValidateParameters.dll
|
||||
\par \hich\af1\dbch\af31505\loch\f1 [ExternalCommands]
|
||||
\par \hich\af1\dbch\af31505\loch\f1 ECCount = 1
|
||||
\par \hich\af1\dbch\af31505\loch\f1 ECName1= Validate Parameters
|
||||
\par \hich\af1\dbch\af31505\loch\f1 ECClassName1 = Revit.SDK.Samples.ValidateParameters.CS.Command}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 ECAssembly1 = }{\rtlch\fcs1 \ai\af1\afs20 \ltrch\fcs0 \i\f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 <your path>}{\rtlch\fcs1 \ai\af0\afs20
|
||||
\ltrch\fcs0 \i\f0\fs20\insrsid1508528 \\}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 ValidateParameters.dll
|
||||
\par \hich\af1\dbch\af31505\loch\f1 ECDescription1 = Validate every type has valid values for certain parameters.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528
|
||||
\par }\pard \ltrpar\ql \fi-420\li420\ri0\nowidctlpar\tx360\wrapdefault\faauto\rin0\lin420\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 2.\tab
|
||||
Start Revit, DocumentSaving and DocumentSavingAs events will be registered automatically.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528
|
||||
\par }\pard \ltrpar\ql \fi-420\li420\ri0\nowidctlpar\tx420\wrapdefault\faauto\rin0\lin420\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 3.\tab
|
||||
In order to use a family, user should manually open a family document.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528
|
||||
\par }\pard \ltrpar\ql \fi-420\li420\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin420\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 4.\tab Run th\hich\af1\dbch\af31505\loch\f1 e extern command }{\rtlch\fcs1
|
||||
\af1\afs20 \ltrch\fcs0 \f1\fs20\lang1024\langfe1024\noproof\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 ValidateParameters}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528 .
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 5.\tab Raise Save event by UI menu File\\Save}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528 .
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid1508528 \hich\af1\dbch\af31505\loch\f1 6.\tab Raise SaveAs event by UI menu File\\SaveAs.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid1508528
|
||||
\par }{\*\themedata 504b030414000600080000002100828abc13fa0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb6ac3301045f785fe83d0b6d8
|
||||
72ba28a5d8cea249777d2cd20f18e4b12d6a8f843409c9df77ecb850ba082d74231062ce997b55ae8fe3a00e1893f354e9555e6885647de3a8abf4fbee29bbd7
|
||||
2a3150038327acf409935ed7d757e5ee14302999a654e99e393c18936c8f23a4dc072479697d1c81e51a3b13c07e4087e6b628ee8cf5c4489cf1c4d075f92a0b
|
||||
44d7a07a83c82f308ac7b0a0f0fbf90c2480980b58abc733615aa2d210c2e02cb04430076a7ee833dfb6ce62e3ed7e14693e8317d8cd0433bf5c60f53fea2fe7
|
||||
065bd80facb647e9e25c7fc421fd2ddb526b2e9373fed4bb902e182e97b7b461e6bfad3f010000ffff0300504b030414000600080000002100a5d6a7e7c00000
|
||||
00360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4fc7060abb08
|
||||
84a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b63095120f88d94fbc
|
||||
52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462a1a82fe353
|
||||
bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f7468656d652f7468
|
||||
656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b4b0d592c9c
|
||||
070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b4757e8d3f7
|
||||
29e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f7468656d65
|
||||
312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87615b8116d8
|
||||
a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad79482a9c04
|
||||
98f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b5d8a314d3c
|
||||
94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab999fb7b471
|
||||
7509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9699640f671
|
||||
9e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd5868b37a088d1
|
||||
e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d60cf03ac1a5
|
||||
193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f9e7ef3f2d1
|
||||
17d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be15c308d3f2
|
||||
8acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a99793849c26ae6
|
||||
6252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d32a423279a
|
||||
668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2af074481847
|
||||
bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86e877f0034e
|
||||
16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb44f95d843b
|
||||
5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a6409fb44d0
|
||||
8741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c3d9058edf2
|
||||
c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db02565e85f3b966
|
||||
0d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276b9f7dec44b
|
||||
7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8c33585b5fb
|
||||
9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e51440ca2e0
|
||||
088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95b21be5ceaf
|
||||
8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff6dce591a26
|
||||
ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec69ffb9e65d0
|
||||
28d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239b75a5bb1e6
|
||||
345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a44959d366ad93
|
||||
b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e82db8df9f30
|
||||
254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f74
|
||||
68656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f24
|
||||
51eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e3198
|
||||
720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528
|
||||
a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100828abc13fa0000001c0200001300000000000000000000000000
|
||||
000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b000000000000000000000000
|
||||
002b0100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c00000000000000000000000000140200007468
|
||||
656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b000016000000000000000000
|
||||
00000000d10200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b010000270000000000
|
||||
00000000000000009b0900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000960a00000000}
|
||||
{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
|
||||
617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
|
||||
6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
|
||||
656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
|
||||
{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
|
||||
\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
|
||||
\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
|
||||
\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
|
||||
4d73786d6c322e534158584d4c5265616465722e352e3000000000000000000000060000
|
||||
d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffffec69d9888b8b3d4c859eaf6cd158be0f000000000000000000000000d021
|
||||
05403139cb01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000105000000000000}}
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RevitAddIns>
|
||||
<AddIn Type="Application">
|
||||
<Name>External Tool</Name>
|
||||
<Assembly>ValidateParameters.dll</Assembly>
|
||||
<ClientId>b557782a-d0a0-4347-a847-5c8770a40603</ClientId>
|
||||
<FullClassName>Revit.SDK.Samples.ValidateParameters.CS.Application</FullClassName>
|
||||
<VendorId>ADSK</VendorId>
|
||||
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
|
||||
</AddIn>
|
||||
<AddIn Type="Command">
|
||||
<Assembly>ValidateParameters.dll</Assembly>
|
||||
<ClientId>95cb6d1f-ac0e-4bcc-89df-471bb6e69117</ClientId>
|
||||
<FullClassName>Revit.SDK.Samples.ValidateParameters.CS.Command</FullClassName>
|
||||
<Text>ValidateParameters</Text>
|
||||
<Description>This command will validate if every type has valid values for certain parameter</Description>
|
||||
<VisibilityMode>AlwaysVisible</VisibilityMode>
|
||||
<VendorId>ADSK</VendorId>
|
||||
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
|
||||
</AddIn>
|
||||
</RevitAddIns>
|
||||
@@ -1,104 +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>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{946EF9FD-9591-4C0A-9F2B-082130915255}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ValidateParameters</RootNamespace>
|
||||
<AssemblyName>ValidateParameters</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<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>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<DocumentationFile>bin\Debug\ValidateParameters.XML</DocumentationFile>
|
||||
</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>
|
||||
<DocumentationFile>bin\Release\ValidateParameters.XML</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DocumentationFile>bin\Debug\ValidateParameters.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>
|
||||
<DocumentationFile>bin\Release\ValidateParameters.XML</DocumentationFile>
|
||||
<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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Command.cs" />
|
||||
<Compile Include="Application.cs" />
|
||||
<Compile Include="MessageForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MessageForm.Designer.cs">
|
||||
<DependentUpon>MessageForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="MessageForm.resx">
|
||||
<DependentUpon>MessageForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</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>
|
||||
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
|
||||
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,99 +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.Diagnostics;
|
||||
using Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
namespace Revit.SDK.Samples.WindowWizard.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// A class inherits IExternalCommand interface.
|
||||
/// this class controls the class which subscribes handle events and the events' information UI.
|
||||
/// like a bridge between them.
|
||||
/// </summary>
|
||||
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
|
||||
[Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)]
|
||||
[Autodesk.Revit.Attributes.Journaling(Autodesk.Revit.Attributes.JournalingMode.NoCommandData)]
|
||||
public class Command : IExternalCommand
|
||||
{
|
||||
#region Class Interface Implementation
|
||||
/// <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>
|
||||
public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData,
|
||||
ref string message,
|
||||
ElementSet elements)
|
||||
{
|
||||
Document doc = commandData.Application.ActiveUIDocument.Document;
|
||||
//only a family document can retrieve family manager
|
||||
if (doc.IsFamilyDocument)
|
||||
{
|
||||
if (null != doc.OwnerFamily && null != doc.OwnerFamily.FamilyCategory
|
||||
&& doc.OwnerFamily.FamilyCategory.Name != doc.Settings.Categories.get_Item(BuiltInCategory.OST_Windows).Name)
|
||||
// FamilyCategory.Name is not "Windows".
|
||||
{
|
||||
message = "Please make sure you opened a template of Window.";
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
WindowWizard wizard = new WindowWizard(commandData);
|
||||
int result = wizard.RunWizard();
|
||||
if (1 == result)
|
||||
{
|
||||
return Autodesk.Revit.UI.Result.Succeeded;
|
||||
}
|
||||
else if (0 == result)
|
||||
{
|
||||
message = "Window Creation was cancelled.";
|
||||
return Autodesk.Revit.UI.Result.Cancelled;
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "Window Creation failed, please check your template and inputs then try again.";
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "please make sure you have opened a family document!";
|
||||
return Autodesk.Revit.UI.Result.Failed;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,81 +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 Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
|
||||
namespace Revit.SDK.Samples.WindowWizard.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// The class allows users to create alignment
|
||||
/// </summary>
|
||||
class CreateAlignment
|
||||
{
|
||||
#region Class Memeber Variables
|
||||
/// <summary>
|
||||
/// store the document
|
||||
/// </summary>
|
||||
Document m_document;
|
||||
|
||||
/// <summary>
|
||||
/// store the family item factory of creation
|
||||
/// </summary>
|
||||
Autodesk.Revit.Creation.FamilyItemFactory m_familyCreator;
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// The constructor of CreateAlignment class
|
||||
/// </summary>
|
||||
/// <param name="doc">the document</param>
|
||||
public CreateAlignment(Document doc)
|
||||
{
|
||||
m_document = doc;
|
||||
m_familyCreator = m_document.FamilyCreate;
|
||||
}
|
||||
|
||||
#region Class Implementation
|
||||
/// <summary>
|
||||
/// The method is used to create alignment between two faces
|
||||
/// </summary>
|
||||
/// <param name="view">the view</param>
|
||||
/// <param name="face1">face1</param>
|
||||
/// <param name="face2">face2</param>
|
||||
public void AddAlignment(View view, Face face1, Face face2)
|
||||
{
|
||||
PlanarFace pFace1 = null;
|
||||
PlanarFace pFace2 = null;
|
||||
if (face1 is PlanarFace)
|
||||
pFace1 = face1 as PlanarFace;
|
||||
if (face2 is PlanarFace)
|
||||
pFace2 = face2 as PlanarFace;
|
||||
if (pFace1 != null && pFace2 != null)
|
||||
{
|
||||
SubTransaction subTransaction = new SubTransaction(m_document);
|
||||
subTransaction.Start();
|
||||
m_familyCreator.NewAlignment(view, pFace1.Reference, pFace2.Reference);
|
||||
subTransaction.Commit();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,166 +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 Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.ApplicationServices;
|
||||
|
||||
namespace Revit.SDK.Samples.WindowWizard.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// The class allows users to create dimension using Document.FamilyCreate.NewDimension() function
|
||||
/// </summary>
|
||||
class CreateDimension
|
||||
{
|
||||
#region Class Memeber Variables
|
||||
/// <summary>
|
||||
/// store the document
|
||||
/// </summary>
|
||||
Document m_document;
|
||||
|
||||
/// <summary>
|
||||
/// store the application
|
||||
/// </summary>
|
||||
Application m_application;
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// constructor of CreateDimension class
|
||||
/// </summary>
|
||||
/// <param name="app">the application</param>
|
||||
/// <param name="doc">the document</param>
|
||||
public CreateDimension(Application app, Document doc)
|
||||
{
|
||||
m_application = app;
|
||||
m_document = doc;
|
||||
}
|
||||
|
||||
#region Class Implementation
|
||||
/// <summary>
|
||||
/// This method is used to create dimension among three reference planes
|
||||
/// </summary>
|
||||
/// <param name="view">the view</param>
|
||||
/// <param name="refPlane1">the first reference plane</param>
|
||||
/// <param name="refPlane2">the second reference plane</param>
|
||||
/// <param name="refPlane">the middle reference plane</param>
|
||||
/// <returns>the new dimension</returns>
|
||||
public Dimension AddDimension(View view, ReferencePlane refPlane1, ReferencePlane refPlane2, ReferencePlane refPlane)
|
||||
{
|
||||
Dimension dim;
|
||||
Autodesk.Revit.DB.XYZ startPoint = new Autodesk.Revit.DB.XYZ();
|
||||
Autodesk.Revit.DB.XYZ endPoint = new Autodesk.Revit.DB.XYZ();
|
||||
Line line;
|
||||
Reference ref1;
|
||||
Reference ref2;
|
||||
Reference ref3;
|
||||
ReferenceArray refArray = new ReferenceArray();
|
||||
ref1 = refPlane1.GetReference();
|
||||
ref2 = refPlane2.GetReference();
|
||||
ref3 = refPlane.GetReference();
|
||||
startPoint = refPlane1.FreeEnd;
|
||||
endPoint = refPlane2.FreeEnd;
|
||||
line = Line.CreateBound(startPoint, endPoint);
|
||||
if (null != ref1 && null != ref2 && null != ref3)
|
||||
{
|
||||
refArray.Append(ref1);
|
||||
refArray.Append(ref3);
|
||||
refArray.Append(ref2);
|
||||
}
|
||||
SubTransaction subTransaction = new SubTransaction(m_document);
|
||||
subTransaction.Start();
|
||||
dim = m_document.FamilyCreate.NewDimension(view, line, refArray);
|
||||
subTransaction.Commit();
|
||||
return dim;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The method is used to create dimension between referenceplane and face
|
||||
/// </summary>
|
||||
/// <param name="view">the view in which the dimension is created</param>
|
||||
/// <param name="refPlane">the reference plane</param>
|
||||
/// <param name="face">the face</param>
|
||||
/// <returns>the new dimension</returns>
|
||||
public Dimension AddDimension(View view, ReferencePlane refPlane, Face face)
|
||||
{
|
||||
Dimension dim;
|
||||
Autodesk.Revit.DB.XYZ startPoint = new Autodesk.Revit.DB.XYZ();
|
||||
Autodesk.Revit.DB.XYZ endPoint = new Autodesk.Revit.DB.XYZ();
|
||||
Line line;
|
||||
Reference ref1;
|
||||
Reference ref2;
|
||||
ReferenceArray refArray = new ReferenceArray();
|
||||
ref1 = refPlane.GetReference();
|
||||
PlanarFace pFace = face as PlanarFace;
|
||||
ref2 = pFace.Reference;
|
||||
if (null != ref1 && null != ref2)
|
||||
{
|
||||
refArray.Append(ref1);
|
||||
refArray.Append(ref2);
|
||||
}
|
||||
startPoint = refPlane.FreeEnd;
|
||||
endPoint = new Autodesk.Revit.DB.XYZ(startPoint.X, pFace.Origin.Y, startPoint.Z);
|
||||
SubTransaction subTransaction = new SubTransaction(m_document);
|
||||
subTransaction.Start();
|
||||
line = Line.CreateBound(startPoint, endPoint);
|
||||
dim = m_document.FamilyCreate.NewDimension(view, line, refArray);
|
||||
subTransaction.Commit();
|
||||
return dim;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The method is used to create dimension between two faces
|
||||
/// </summary>
|
||||
/// <param name="view">the view</param>
|
||||
/// <param name="face1">the first face</param>
|
||||
/// <param name="face2">the second face</param>
|
||||
/// <returns>the new dimension</returns>
|
||||
public Dimension AddDimension(View view, Face face1, Face face2)
|
||||
{
|
||||
Dimension dim;
|
||||
Autodesk.Revit.DB.XYZ startPoint = new Autodesk.Revit.DB.XYZ();
|
||||
Autodesk.Revit.DB.XYZ endPoint = new Autodesk.Revit.DB.XYZ();
|
||||
Line line;
|
||||
Reference ref1;
|
||||
Reference ref2;
|
||||
ReferenceArray refArray = new ReferenceArray();
|
||||
PlanarFace pFace1 = face1 as PlanarFace;
|
||||
ref1 = pFace1.Reference;
|
||||
PlanarFace pFace2 = face2 as PlanarFace;
|
||||
ref2 = pFace2.Reference;
|
||||
if (null != ref1 && null != ref2)
|
||||
{
|
||||
refArray.Append(ref1);
|
||||
refArray.Append(ref2);
|
||||
}
|
||||
startPoint = pFace1.Origin;
|
||||
endPoint = new Autodesk.Revit.DB.XYZ(startPoint.X, pFace2.Origin.Y, startPoint.Z);
|
||||
SubTransaction subTransaction = new SubTransaction(m_document);
|
||||
subTransaction.Start();
|
||||
line = Line.CreateBound(startPoint, endPoint);
|
||||
dim = m_document.FamilyCreate.NewDimension(view, line, refArray);
|
||||
subTransaction.Commit();
|
||||
return dim;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,182 +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 Autodesk.Revit.DB;
|
||||
using Autodesk.Revit;
|
||||
using Autodesk.Revit.ApplicationServices;
|
||||
|
||||
namespace Revit.SDK.Samples.WindowWizard.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// The class is used to create solid extrusion
|
||||
/// </summary>
|
||||
class CreateExtrusion
|
||||
{
|
||||
#region Class Memeber Variables
|
||||
/// <summary>
|
||||
/// store the document
|
||||
/// </summary>
|
||||
Document m_document;
|
||||
|
||||
/// <summary>
|
||||
/// store the application of creation
|
||||
/// </summary>
|
||||
Autodesk.Revit.Creation.Application m_appCreator;
|
||||
|
||||
/// <summary>
|
||||
/// store the FamilyItemFactory of creation
|
||||
/// </summary>
|
||||
Autodesk.Revit.Creation.FamilyItemFactory m_familyCreator;
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// The constructor of CreateExtrusion
|
||||
/// </summary>
|
||||
/// <param name="app">the application</param>
|
||||
/// <param name="doc">the document</param>
|
||||
public CreateExtrusion(Application app, Document doc)
|
||||
{
|
||||
m_document = doc;
|
||||
m_appCreator = app.Create;
|
||||
m_familyCreator = doc.FamilyCreate;
|
||||
}
|
||||
|
||||
#region Class Implementation
|
||||
/// <summary>
|
||||
/// The method is used to create a CurveArray with four double parameters and one y coordinate value
|
||||
/// </summary>
|
||||
/// <param name="left">the left value</param>
|
||||
/// <param name="right">the right value</param>
|
||||
/// <param name="top">the top value</param>
|
||||
/// <param name="bottom">the bottom value</param>
|
||||
/// <param name="y_coordinate">the y_coordinate value</param>
|
||||
/// <returns>CurveArray</returns>
|
||||
public CurveArray CreateRectangle(double left, double right, double top, double bottom, double y_coordinate)
|
||||
{
|
||||
CurveArray curveArray = m_appCreator.NewCurveArray();
|
||||
try
|
||||
{
|
||||
Autodesk.Revit.DB.XYZ p0 = new Autodesk.Revit.DB.XYZ(left, y_coordinate, top);
|
||||
Autodesk.Revit.DB.XYZ p1 = new Autodesk.Revit.DB.XYZ(right, y_coordinate, top);
|
||||
Autodesk.Revit.DB.XYZ p2 = new Autodesk.Revit.DB.XYZ(right, y_coordinate, bottom);
|
||||
Autodesk.Revit.DB.XYZ p3 = new Autodesk.Revit.DB.XYZ(left, y_coordinate, bottom);
|
||||
Line line1 = Line.CreateBound(p0, p1);
|
||||
Line line2 = Line.CreateBound(p1, p2);
|
||||
Line line3 = Line.CreateBound(p2, p3);
|
||||
Line line4 = Line.CreateBound(p3, p0);
|
||||
curveArray.Append(line1);
|
||||
curveArray.Append(line2);
|
||||
curveArray.Append(line3);
|
||||
curveArray.Append(line4);
|
||||
return curveArray;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(e.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The method is used to create a CurveArray along to an origin CurveArray and an offset value
|
||||
/// </summary>
|
||||
/// <param name="origin">the original CurveArray</param>
|
||||
/// <param name="offset">the offset value</param>
|
||||
/// <returns>CurveArray</returns>
|
||||
public CurveArray CreateCurveArrayByOffset(CurveArray origin, double offset)
|
||||
{
|
||||
Line line;
|
||||
Line temp;
|
||||
int counter = 0;
|
||||
CurveArray curveArr = m_appCreator.NewCurveArray();
|
||||
Autodesk.Revit.DB.XYZ offsetx = new Autodesk.Revit.DB.XYZ(offset, 0, 0);
|
||||
Autodesk.Revit.DB.XYZ offsetz = new Autodesk.Revit.DB.XYZ(0, 0, offset);
|
||||
Autodesk.Revit.DB.XYZ p0 = new Autodesk.Revit.DB.XYZ();
|
||||
Autodesk.Revit.DB.XYZ p1 = new Autodesk.Revit.DB.XYZ(); ;
|
||||
Autodesk.Revit.DB.XYZ p2 = new Autodesk.Revit.DB.XYZ();
|
||||
Autodesk.Revit.DB.XYZ p3 = new Autodesk.Revit.DB.XYZ();
|
||||
foreach (Curve curve in origin)
|
||||
{
|
||||
temp = curve as Line;
|
||||
if (temp != null)
|
||||
{
|
||||
if (counter == 0)
|
||||
{
|
||||
p0 = temp.GetEndPoint(0).Subtract(offsetz).Subtract(offsetx);
|
||||
}
|
||||
else if (counter == 1)
|
||||
{
|
||||
p1 = temp.GetEndPoint(0).Subtract(offsetz).Add(offsetx);
|
||||
}
|
||||
else if (counter == 2)
|
||||
{
|
||||
p2 = temp.GetEndPoint(0).Add(offsetx).Add(offsetz);
|
||||
}
|
||||
else
|
||||
{
|
||||
p3 = temp.GetEndPoint(0).Subtract(offsetx).Add(offsetz);
|
||||
}
|
||||
}
|
||||
counter++;
|
||||
}
|
||||
line = Line.CreateBound(p0, p1);
|
||||
curveArr.Append(line);
|
||||
line = Line.CreateBound(p1, p2);
|
||||
curveArr.Append(line);
|
||||
line = Line.CreateBound(p2, p3);
|
||||
curveArr.Append(line);
|
||||
line = Line.CreateBound(p3, p0);
|
||||
curveArr.Append(line);
|
||||
return curveArr;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The method is used to create extrusion using FamilyItemFactory.NewExtrusion()
|
||||
/// </summary>
|
||||
/// <param name="curveArrArray">the CurveArrArray parameter</param>
|
||||
/// <param name="workPlane">the reference plane is used to create SketchPlane</param>
|
||||
/// <param name="startOffset">the extrusion's StartOffset property</param>
|
||||
/// <param name="endOffset">the extrusion's EndOffset property</param>
|
||||
/// <returns>the new extrusion</returns>
|
||||
public Extrusion NewExtrusion(CurveArrArray curveArrArray, ReferencePlane workPlane, double startOffset, double endOffset)
|
||||
{
|
||||
Extrusion rectExtrusion = null;
|
||||
try
|
||||
{
|
||||
SubTransaction subTransaction = new SubTransaction(m_document);
|
||||
subTransaction.Start();
|
||||
SketchPlane sketch = SketchPlane.Create(m_document, workPlane.GetPlane());
|
||||
rectExtrusion = m_familyCreator.NewExtrusion(true, curveArrArray, sketch, Math.Abs(endOffset - startOffset));
|
||||
rectExtrusion.StartOffset = startOffset;
|
||||
rectExtrusion.EndOffset = endOffset;
|
||||
subTransaction.Commit();
|
||||
return rectExtrusion;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,72 +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 Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
|
||||
namespace Revit.SDK.Samples.WindowWizard.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// The class is used to create ReferencePlane
|
||||
/// </summary>
|
||||
class CreateRefPlane
|
||||
{
|
||||
#region Class Implementation
|
||||
/// <summary>
|
||||
/// This method is used to create ReferencePlane along to a host referenceplane with a offset parameter
|
||||
/// </summary>
|
||||
/// <param name="doc">the document</param>
|
||||
/// <param name="host">the host ReferencePlane</param>
|
||||
/// <param name="view">the view</param>
|
||||
/// <param name="offSet">the offset of the host</param>
|
||||
/// <param name="cutVec">the cutVec of the ReferencePlane</param>
|
||||
/// <param name="name">the name of the ReferencePlane</param>
|
||||
/// <returns>ReferencePlane</returns>
|
||||
public ReferencePlane Create(Document doc, ReferencePlane host, View view, Autodesk.Revit.DB.XYZ offSet, Autodesk.Revit.DB.XYZ cutVec, string name)
|
||||
{
|
||||
Autodesk.Revit.DB.XYZ bubbleEnd = new Autodesk.Revit.DB.XYZ ();
|
||||
Autodesk.Revit.DB.XYZ freeEnd = new Autodesk.Revit.DB.XYZ ();
|
||||
ReferencePlane refPlane;
|
||||
try
|
||||
{
|
||||
refPlane = host as ReferencePlane;
|
||||
if (refPlane != null)
|
||||
{
|
||||
bubbleEnd = refPlane.BubbleEnd.Add(offSet);
|
||||
freeEnd = refPlane.FreeEnd.Add(offSet);
|
||||
SubTransaction subTransaction = new SubTransaction(doc);
|
||||
subTransaction.Start();
|
||||
refPlane = doc.FamilyCreate.NewReferencePlane(bubbleEnd, freeEnd, cutVec, view);
|
||||
refPlane.Name = name;
|
||||
subTransaction.Commit();
|
||||
}
|
||||
return refPlane;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,679 +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.IO;
|
||||
using System.Collections.Generic;
|
||||
using Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using Autodesk.Revit.ApplicationServices;
|
||||
|
||||
namespace Revit.SDK.Samples.WindowWizard.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Inherited from WindowCreation class
|
||||
/// </summary>
|
||||
class DoubleHungWinCreation : WindowCreation
|
||||
{
|
||||
#region Class Memeber Variables
|
||||
/// <summary>
|
||||
/// store the Application
|
||||
/// </summary>
|
||||
private UIApplication m_application;
|
||||
|
||||
/// <summary>
|
||||
/// store the document
|
||||
/// </summary>
|
||||
private Document m_document;
|
||||
|
||||
/// <summary>
|
||||
/// store the FamilyManager
|
||||
/// </summary>
|
||||
private FamilyManager m_familyManager;
|
||||
|
||||
/// <summary>
|
||||
/// store the CreateDimension instance
|
||||
/// </summary>
|
||||
CreateDimension m_dimensionCreator;
|
||||
|
||||
/// <summary>
|
||||
/// store the CreateExtrusion instance
|
||||
/// </summary>
|
||||
CreateExtrusion m_extrusionCreator;
|
||||
|
||||
/// <summary>
|
||||
/// store the sash referenceplane
|
||||
/// </summary>
|
||||
ReferencePlane m_sashPlane;
|
||||
|
||||
/// <summary>
|
||||
/// store the center referenceplane
|
||||
/// </summary>
|
||||
ReferencePlane m_centerPlane;
|
||||
|
||||
/// <summary>
|
||||
/// store the exterior referenceplane
|
||||
/// </summary>
|
||||
ReferencePlane m_exteriorPlane;
|
||||
|
||||
/// <summary>
|
||||
/// store the top referenceplane
|
||||
/// </summary>
|
||||
ReferencePlane m_topPlane;
|
||||
|
||||
/// <summary>
|
||||
/// store the sill referenceplane
|
||||
/// </summary>
|
||||
ReferencePlane m_sillPlane;
|
||||
|
||||
/// <summary>
|
||||
/// store the right view of the document
|
||||
/// </summary>
|
||||
Autodesk.Revit.DB.View m_rightView;
|
||||
|
||||
/// <summary>
|
||||
/// store the frame category
|
||||
/// </summary>
|
||||
Category m_frameCat;
|
||||
|
||||
/// <summary>
|
||||
/// store the glass category
|
||||
/// </summary>
|
||||
Category m_glassCat;
|
||||
|
||||
/// <summary>
|
||||
/// store the thickness parameter of wall
|
||||
/// </summary>
|
||||
double m_wallThickness;
|
||||
|
||||
/// <summary>
|
||||
/// store the height parameter of wall
|
||||
/// </summary>
|
||||
double m_height;
|
||||
|
||||
/// <summary>
|
||||
/// store the width parameter of wall
|
||||
/// </summary>
|
||||
double m_width;
|
||||
|
||||
/// <summary>
|
||||
/// store the sillheight parameter of wall
|
||||
/// </summary>
|
||||
double m_sillHeight;
|
||||
|
||||
/// <summary>
|
||||
/// store the windowInset parameter of wall
|
||||
/// </summary>
|
||||
double m_windowInset;
|
||||
|
||||
/// <summary>
|
||||
/// Store the height value of wall
|
||||
/// </summary>
|
||||
double m_wallHeight;
|
||||
|
||||
/// <summary>
|
||||
/// Store the width value of wall
|
||||
/// </summary>
|
||||
double m_wallWidth;
|
||||
|
||||
/// <summary>
|
||||
/// store the glass material ID
|
||||
/// </summary>
|
||||
int m_glassMatID;
|
||||
|
||||
/// <summary>
|
||||
/// store the sash material ID
|
||||
/// </summary>
|
||||
int m_sashMatID;
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// constructor of DoubleHungWinCreation
|
||||
/// </summary>
|
||||
/// <param name="para">WizardParameter</param>
|
||||
/// <param name="commandData">ExternalCommandData</param>
|
||||
public DoubleHungWinCreation(WizardParameter para, ExternalCommandData commandData)
|
||||
: base(para)
|
||||
{
|
||||
m_application = commandData.Application;
|
||||
m_document = commandData.Application.ActiveUIDocument.Document;
|
||||
m_familyManager = m_document.FamilyManager;
|
||||
|
||||
using (Transaction tran = new Transaction(m_document, "InitializeWindowWizard"))
|
||||
{
|
||||
tran.Start();
|
||||
|
||||
CollectTemplateInfo();
|
||||
para.Validator = new ValidateWindowParameter(m_wallHeight, m_wallWidth);
|
||||
switch (m_document.DisplayUnitSystem)
|
||||
{
|
||||
case Autodesk.Revit.DB.DisplayUnit.METRIC:
|
||||
para.Validator.IsMetric = true;
|
||||
break;
|
||||
case Autodesk.Revit.DB.DisplayUnit.IMPERIAL:
|
||||
para.Validator.IsMetric = false;
|
||||
break;
|
||||
}
|
||||
para.PathName = Path.GetDirectoryName(para.PathName) + "Double Hung.rfa";
|
||||
|
||||
CreateCommon();
|
||||
|
||||
tran.Commit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#region Class Implementation
|
||||
/// <summary>
|
||||
/// The implementation of CreateFrame()
|
||||
/// </summary>
|
||||
public override void CreateFrame()
|
||||
{
|
||||
SubTransaction subTransaction = new SubTransaction(m_document);
|
||||
subTransaction.Start();
|
||||
|
||||
//create sash referenceplane and exterior referenceplane
|
||||
CreateRefPlane refPlaneCreator = new CreateRefPlane();
|
||||
if (m_sashPlane == null)
|
||||
m_sashPlane = refPlaneCreator.Create(m_document, m_centerPlane, m_rightView, new Autodesk.Revit.DB.XYZ(0, m_wallThickness / 2 - m_windowInset, 0), new Autodesk.Revit.DB.XYZ(0, 0, 1), "Sash");
|
||||
if (m_exteriorPlane == null)
|
||||
m_exteriorPlane = refPlaneCreator.Create(m_document, m_centerPlane, m_rightView, new Autodesk.Revit.DB.XYZ(0, m_wallThickness / 2, 0), new Autodesk.Revit.DB.XYZ(0, 0, 1), "MyExterior");
|
||||
m_document.Regenerate();
|
||||
|
||||
//get the wall in the document and retrieve the exterior face
|
||||
List<Wall> walls = Utility.GetElements<Wall>(m_application, m_document);
|
||||
Face exteriorWallFace = GeoHelper.GetWallFace(walls[0], m_rightView, true);
|
||||
if (exteriorWallFace == null)
|
||||
return;
|
||||
|
||||
//add dimension between sash reference plane and wall face,and add parameter "Window Inset",label the dimension with window-inset parameter
|
||||
Dimension windowInsetDimension = m_dimensionCreator.AddDimension(m_rightView, m_sashPlane, exteriorWallFace);
|
||||
FamilyParameter windowInsetPara = m_familyManager.AddParameter("Window Inset", BuiltInParameterGroup.INVALID, ParameterType.Length, false);
|
||||
m_familyManager.Set(windowInsetPara, m_windowInset);
|
||||
windowInsetDimension.FamilyLabel = windowInsetPara;
|
||||
|
||||
//create the exterior frame
|
||||
double frameCurveOffset1 = 0.075;
|
||||
CurveArray curveArr1 = m_extrusionCreator.CreateRectangle(m_width / 2, -m_width / 2, m_sillHeight + m_height, m_sillHeight, 0);
|
||||
CurveArray curveArr2 = m_extrusionCreator.CreateCurveArrayByOffset(curveArr1, frameCurveOffset1);
|
||||
CurveArrArray curveArrArray1 = new CurveArrArray();
|
||||
curveArrArray1.Append(curveArr1);
|
||||
curveArrArray1.Append(curveArr2);
|
||||
Extrusion extFrame = m_extrusionCreator.NewExtrusion(curveArrArray1, m_sashPlane, m_wallThickness / 2 + m_wallThickness / 12, -m_windowInset);
|
||||
extFrame.SetVisibility(CreateVisibility());
|
||||
m_document.Regenerate();
|
||||
|
||||
//add alignment between wall face and exterior frame face
|
||||
exteriorWallFace = GeoHelper.GetWallFace(walls[0], m_rightView, true); // Get the face again as the document is regenerated.
|
||||
Face exteriorExtrusionFace1 = GeoHelper.GetExtrusionFace(extFrame, m_rightView, true);
|
||||
Face interiorExtrusionFace1 = GeoHelper.GetExtrusionFace(extFrame, m_rightView, false);
|
||||
CreateAlignment alignmentCreator = new CreateAlignment(m_document);
|
||||
alignmentCreator.AddAlignment(m_rightView, exteriorWallFace, exteriorExtrusionFace1);
|
||||
|
||||
//add dimension between sash referenceplane and exterior frame face and lock the dimension
|
||||
Dimension extFrameWithSashPlane = m_dimensionCreator.AddDimension(m_rightView, m_sashPlane, interiorExtrusionFace1);
|
||||
extFrameWithSashPlane.IsLocked = true;
|
||||
m_document.Regenerate();
|
||||
|
||||
//create the interior frame
|
||||
double frameCurveOffset2 = 0.125;
|
||||
CurveArray curveArr3 = m_extrusionCreator.CreateRectangle(m_width / 2, -m_width / 2, m_sillHeight + m_height, m_sillHeight, 0);
|
||||
CurveArray curveArr4 = m_extrusionCreator.CreateCurveArrayByOffset(curveArr3, frameCurveOffset2);
|
||||
m_document.Regenerate();
|
||||
|
||||
CurveArrArray curveArrArray2 = new CurveArrArray();
|
||||
curveArrArray2.Append(curveArr3);
|
||||
curveArrArray2.Append(curveArr4);
|
||||
Extrusion intFrame = m_extrusionCreator.NewExtrusion(curveArrArray2, m_sashPlane, m_wallThickness - m_windowInset, m_wallThickness / 2 + m_wallThickness / 12);
|
||||
intFrame.SetVisibility(CreateVisibility());
|
||||
m_document.Regenerate();
|
||||
|
||||
//add alignment between interior face of wall and interior frame face
|
||||
Face interiorWallFace = GeoHelper.GetWallFace(walls[0], m_rightView, false);
|
||||
Face interiorExtrusionFace2 = GeoHelper.GetExtrusionFace(intFrame, m_rightView, false);
|
||||
Face exteriorExtrusionFace2 = GeoHelper.GetExtrusionFace(intFrame, m_rightView, true);
|
||||
alignmentCreator.AddAlignment(m_rightView, interiorWallFace, interiorExtrusionFace2);
|
||||
|
||||
//add dimension between sash referenceplane and interior frame face and lock the dimension
|
||||
Dimension intFrameWithSashPlane = m_dimensionCreator.AddDimension(m_rightView, m_sashPlane, exteriorExtrusionFace2);
|
||||
intFrameWithSashPlane.IsLocked = true;
|
||||
|
||||
//create the sill frame
|
||||
CurveArray sillCurs = m_extrusionCreator.CreateRectangle(m_width / 2, -m_width / 2, m_sillHeight + frameCurveOffset1, m_sillHeight, 0);
|
||||
CurveArrArray sillCurveArray = new CurveArrArray();
|
||||
sillCurveArray.Append(sillCurs);
|
||||
Extrusion sillFrame = m_extrusionCreator.NewExtrusion(sillCurveArray, m_sashPlane, -m_windowInset, -m_windowInset - 0.1);
|
||||
m_document.Regenerate();
|
||||
|
||||
//add alignment between wall face and sill frame face
|
||||
exteriorWallFace = GeoHelper.GetWallFace(walls[0], m_rightView, true); // Get the face again as the document is regenerated.
|
||||
Face sillExtFace = GeoHelper.GetExtrusionFace(sillFrame, m_rightView, false);
|
||||
alignmentCreator.AddAlignment(m_rightView, sillExtFace, exteriorWallFace);
|
||||
m_document.Regenerate();
|
||||
|
||||
//set subcategories of the frames
|
||||
if (m_frameCat != null)
|
||||
{
|
||||
extFrame.Subcategory = m_frameCat;
|
||||
intFrame.Subcategory = m_frameCat;
|
||||
sillFrame.Subcategory = m_frameCat;
|
||||
}
|
||||
subTransaction.Commit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The implementation of CreateSash(),and creating the Window Sash Solid Geometry
|
||||
/// </summary>
|
||||
public override void CreateSash()
|
||||
{
|
||||
double frameCurveOffset1 = 0.075;
|
||||
double frameDepth = 7 * m_wallThickness / 12 + m_windowInset;
|
||||
double sashCurveOffset = 0.075;
|
||||
double sashDepth = (frameDepth - m_windowInset) / 2;
|
||||
|
||||
//get the exterior view and sash referenceplane which are used in this process
|
||||
Autodesk.Revit.DB.View exteriorView = Utility.GetViewByName("Exterior", m_application, m_document);
|
||||
SubTransaction subTransaction = new SubTransaction(m_document);
|
||||
subTransaction.Start();
|
||||
|
||||
//add a middle reference plane between the top referenceplane and sill referenceplane
|
||||
CreateRefPlane refPlaneCreator = new CreateRefPlane();
|
||||
ReferencePlane middlePlane = refPlaneCreator.Create(m_document, m_topPlane, exteriorView, new Autodesk.Revit.DB.XYZ(0, 0, -m_height / 2), new Autodesk.Revit.DB.XYZ(0, -1, 0), "tempmiddle");
|
||||
m_document.Regenerate();
|
||||
|
||||
//add dimension between top, sill, and middle reference plane, make the dimension segment equal
|
||||
Dimension dim = m_dimensionCreator.AddDimension(exteriorView, m_topPlane, m_sillPlane, middlePlane);
|
||||
dim.AreSegmentsEqual = true;
|
||||
|
||||
//create first sash
|
||||
CurveArray curveArr5 = m_extrusionCreator.CreateRectangle(m_width / 2 - frameCurveOffset1, -m_width / 2 + frameCurveOffset1, m_sillHeight + m_height / 2 + sashCurveOffset / 2, m_sillHeight + frameCurveOffset1, 0);
|
||||
CurveArray curveArr6 = m_extrusionCreator.CreateCurveArrayByOffset(curveArr5, sashCurveOffset);
|
||||
m_document.Regenerate();
|
||||
|
||||
CurveArrArray curveArrArray3 = new CurveArrArray();
|
||||
curveArrArray3.Append(curveArr5);
|
||||
curveArrArray3.Append(curveArr6);
|
||||
Extrusion sash1 = m_extrusionCreator.NewExtrusion(curveArrArray3, m_sashPlane, 2 * sashDepth, sashDepth);
|
||||
m_document.Regenerate();
|
||||
|
||||
Face esashFace1 = GeoHelper.GetExtrusionFace(sash1, m_rightView, true);
|
||||
Face isashFace1 = GeoHelper.GetExtrusionFace(sash1, m_rightView, false);
|
||||
Dimension sashDim1 = m_dimensionCreator.AddDimension(m_rightView, esashFace1, isashFace1);
|
||||
sashDim1.IsLocked = true;
|
||||
Dimension sashWithPlane1 = m_dimensionCreator.AddDimension(m_rightView, m_sashPlane, isashFace1);
|
||||
sashWithPlane1.IsLocked = true;
|
||||
sash1.SetVisibility(CreateVisibility());
|
||||
|
||||
//create second sash
|
||||
CurveArray curveArr7 = m_extrusionCreator.CreateRectangle(m_width / 2 - frameCurveOffset1, -m_width / 2 + frameCurveOffset1, m_sillHeight + m_height - frameCurveOffset1, m_sillHeight + m_height / 2 - sashCurveOffset / 2, 0);
|
||||
CurveArray curveArr8 = m_extrusionCreator.CreateCurveArrayByOffset(curveArr7, sashCurveOffset);
|
||||
m_document.Regenerate();
|
||||
|
||||
CurveArrArray curveArrArray4 = new CurveArrArray();
|
||||
curveArrArray4.Append(curveArr7);
|
||||
curveArrArray4.Append(curveArr8);
|
||||
Extrusion sash2 = m_extrusionCreator.NewExtrusion(curveArrArray4, m_sashPlane, sashDepth, 0);
|
||||
sash2.SetVisibility(CreateVisibility());
|
||||
m_document.Regenerate();
|
||||
|
||||
Face esashFace2 = GeoHelper.GetExtrusionFace(sash2, m_rightView, true);
|
||||
Face isashFace2 = GeoHelper.GetExtrusionFace(sash2, m_rightView, false);
|
||||
Dimension sashDim2 = m_dimensionCreator.AddDimension(m_rightView, esashFace2, isashFace2);
|
||||
sashDim2.IsLocked = true;
|
||||
Dimension sashWithPlane2 = m_dimensionCreator.AddDimension(m_rightView, m_sashPlane, isashFace2);
|
||||
m_document.Regenerate();
|
||||
sashWithPlane2.IsLocked = true;
|
||||
|
||||
//set category of the sash extrusions
|
||||
if (m_frameCat != null)
|
||||
{
|
||||
sash1.Subcategory = m_frameCat;
|
||||
sash2.Subcategory = m_frameCat;
|
||||
}
|
||||
Autodesk.Revit.DB.ElementId id = new ElementId(m_sashMatID);
|
||||
sash1.get_Parameter(BuiltInParameter.MATERIAL_ID_PARAM).Set(id);
|
||||
sash2.get_Parameter(BuiltInParameter.MATERIAL_ID_PARAM).Set(id);
|
||||
subTransaction.Commit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The implementation of CreateGlass(), creating the Window Glass Solid Geometry
|
||||
/// </summary>
|
||||
public override void CreateGlass()
|
||||
{
|
||||
double frameCurveOffset1 = 0.075;
|
||||
double frameDepth = m_wallThickness - 0.15;
|
||||
double sashCurveOffset = 0.075;
|
||||
double sashDepth = (frameDepth - m_windowInset) / 2;
|
||||
double glassDepth = 0.05;
|
||||
double glassOffsetSash = 0.05; //from the exterior of the sash
|
||||
|
||||
//create first glass
|
||||
SubTransaction subTransaction = new SubTransaction(m_document);
|
||||
subTransaction.Start();
|
||||
CurveArray curveArr9 = m_extrusionCreator.CreateRectangle(m_width / 2 - frameCurveOffset1 - sashCurveOffset, -m_width / 2 + frameCurveOffset1 + sashCurveOffset, m_sillHeight + m_height / 2 - sashCurveOffset / 2, m_sillHeight + frameCurveOffset1 + sashCurveOffset, 0);
|
||||
m_document.Regenerate();
|
||||
|
||||
CurveArrArray curveArrArray5 = new CurveArrArray();
|
||||
curveArrArray5.Append(curveArr9);
|
||||
Extrusion glass1 = m_extrusionCreator.NewExtrusion(curveArrArray5, m_sashPlane, sashDepth + glassOffsetSash + glassDepth, sashDepth + glassOffsetSash);
|
||||
m_document.Regenerate();
|
||||
glass1.SetVisibility(CreateVisibility());
|
||||
m_document.Regenerate();
|
||||
Face eglassFace1 = GeoHelper.GetExtrusionFace(glass1, m_rightView, true);
|
||||
Face iglassFace1 = GeoHelper.GetExtrusionFace(glass1, m_rightView, false);
|
||||
Dimension glassDim1 = m_dimensionCreator.AddDimension(m_rightView, eglassFace1, iglassFace1);
|
||||
glassDim1.IsLocked = true;
|
||||
Dimension glass1WithSashPlane = m_dimensionCreator.AddDimension(m_rightView, m_sashPlane, eglassFace1);
|
||||
glass1WithSashPlane.IsLocked = true;
|
||||
|
||||
//create the second glass
|
||||
CurveArray curveArr10 = m_extrusionCreator.CreateRectangle(m_width / 2 - frameCurveOffset1 - sashCurveOffset, -m_width / 2 + frameCurveOffset1 + sashCurveOffset, m_sillHeight + m_height - frameCurveOffset1 - sashCurveOffset, m_sillHeight + m_height / 2 + sashCurveOffset / 2, 0);
|
||||
CurveArrArray curveArrArray6 = new CurveArrArray();
|
||||
curveArrArray6.Append(curveArr10);
|
||||
Extrusion glass2 = m_extrusionCreator.NewExtrusion(curveArrArray6, m_sashPlane, glassOffsetSash + glassDepth, glassOffsetSash);
|
||||
m_document.Regenerate();
|
||||
glass2.SetVisibility(CreateVisibility());
|
||||
m_document.Regenerate();
|
||||
Face eglassFace2 = GeoHelper.GetExtrusionFace(glass2, m_rightView, true);
|
||||
Face iglassFace2 = GeoHelper.GetExtrusionFace(glass2, m_rightView, false);
|
||||
Dimension glassDim2 = m_dimensionCreator.AddDimension(m_rightView, eglassFace2, iglassFace2);
|
||||
glassDim2.IsLocked = true;
|
||||
Dimension glass2WithSashPlane = m_dimensionCreator.AddDimension(m_rightView, m_sashPlane, eglassFace2);
|
||||
glass2WithSashPlane.IsLocked = true;
|
||||
|
||||
//set category
|
||||
if (null != m_glassCat)
|
||||
{
|
||||
glass1.Subcategory = m_glassCat;
|
||||
glass2.Subcategory = m_glassCat;
|
||||
}
|
||||
Autodesk.Revit.DB.ElementId id = new ElementId(m_glassMatID);
|
||||
|
||||
glass1.get_Parameter(BuiltInParameter.MATERIAL_ID_PARAM).Set(id);
|
||||
glass2.get_Parameter(BuiltInParameter.MATERIAL_ID_PARAM).Set(id);
|
||||
subTransaction.Commit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The implementation of CreateMaterial()
|
||||
/// </summary>
|
||||
public override void CreateMaterial()
|
||||
{
|
||||
SubTransaction subTransaction = new SubTransaction(m_document);
|
||||
subTransaction.Start();
|
||||
|
||||
FilteredElementCollector elementCollector = new FilteredElementCollector(m_document);
|
||||
elementCollector.WherePasses(new ElementClassFilter(typeof(Material)));
|
||||
IList<Element> materials = elementCollector.ToElements();
|
||||
|
||||
foreach (Element materialElement in materials)
|
||||
{
|
||||
Material material = materialElement as Material;
|
||||
if (0 == material.Name.CompareTo(m_para.SashMat))
|
||||
{
|
||||
m_sashMatID = material.Id.IntegerValue;
|
||||
}
|
||||
|
||||
if (0 == material.Name.CompareTo(m_para.GlassMat))
|
||||
{
|
||||
m_glassMatID = material.Id.IntegerValue;
|
||||
}
|
||||
}
|
||||
subTransaction.Commit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The implementation of CombineAndBuild() ,defining New Window Types
|
||||
/// </summary>
|
||||
public override void CombineAndBuild()
|
||||
{
|
||||
SubTransaction subTransaction = new SubTransaction(m_document);
|
||||
subTransaction.Start();
|
||||
foreach (String type in m_para.WinParaTab.Keys)
|
||||
{
|
||||
WindowParameter para = m_para.WinParaTab[type] as WindowParameter;
|
||||
|
||||
newFamilyType(para);
|
||||
}
|
||||
|
||||
subTransaction.Commit();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The implementation of Creation(), defining the way to do the whole creation.
|
||||
/// </summary>
|
||||
public override bool Creation()
|
||||
{
|
||||
using (Autodesk.Revit.DB.Transaction trans = new Transaction(m_document, "FinishWindowWizard"))
|
||||
{
|
||||
try
|
||||
{
|
||||
trans.Start();
|
||||
this.CreateMaterial();
|
||||
this.CreateFrame();
|
||||
this.CreateSash();
|
||||
this.CreateGlass();
|
||||
this.CombineAndBuild();
|
||||
trans.Commit();
|
||||
}
|
||||
catch (Exception ee)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(ee.Message);
|
||||
System.Diagnostics.Debug.WriteLine(ee.StackTrace);
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (trans.HasStarted())
|
||||
trans.RollBack();
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (File.Exists(m_para.PathName))
|
||||
File.Delete(m_para.PathName);
|
||||
m_document.SaveAs(m_para.PathName);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("Write to " + m_para.PathName + " Failed");
|
||||
System.Diagnostics.Debug.WriteLine(e.Message);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The method is used to collect template information, specifying the New Window Parameters
|
||||
/// </summary>
|
||||
private void CollectTemplateInfo()
|
||||
{
|
||||
List<Wall> walls = Utility.GetElements<Wall>(m_application, m_document);
|
||||
m_wallThickness = walls[0].Width;
|
||||
ParameterMap paraMap = walls[0].ParametersMap;
|
||||
Parameter wallheightPara = walls[0].get_Parameter(BuiltInParameter.WALL_USER_HEIGHT_PARAM);//paraMap.get_Item("Unconnected Height");
|
||||
if (wallheightPara != null)
|
||||
{
|
||||
m_wallHeight = wallheightPara.AsDouble();
|
||||
}
|
||||
|
||||
LocationCurve location = walls[0].Location as LocationCurve;
|
||||
m_wallWidth = location.Curve.Length;
|
||||
|
||||
m_windowInset = m_wallThickness / 10;
|
||||
FamilyType type = m_familyManager.CurrentType;
|
||||
FamilyParameter heightPara = m_familyManager.get_Parameter(BuiltInParameter.WINDOW_HEIGHT);
|
||||
FamilyParameter widthPara = m_familyManager.get_Parameter(BuiltInParameter.WINDOW_WIDTH);
|
||||
FamilyParameter sillHeightPara = m_familyManager.get_Parameter("Default Sill Height");
|
||||
if (type.HasValue(heightPara))
|
||||
{
|
||||
switch (heightPara.StorageType)
|
||||
{
|
||||
case StorageType.Double:
|
||||
m_height = type.AsDouble(heightPara).Value;
|
||||
break;
|
||||
case StorageType.Integer:
|
||||
m_height = type.AsInteger(heightPara).Value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (type.HasValue(widthPara))
|
||||
{
|
||||
switch (widthPara.StorageType)
|
||||
{
|
||||
case StorageType.Double:
|
||||
m_width = type.AsDouble(widthPara).Value;
|
||||
break;
|
||||
case StorageType.Integer:
|
||||
m_width = type.AsDouble(widthPara).Value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (type.HasValue(sillHeightPara))
|
||||
{
|
||||
switch (sillHeightPara.StorageType)
|
||||
{
|
||||
case StorageType.Double:
|
||||
m_sillHeight = type.AsDouble(sillHeightPara).Value;
|
||||
break;
|
||||
case StorageType.Integer:
|
||||
m_sillHeight = type.AsDouble(sillHeightPara).Value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//set the height,width and sillheight parameter of the opening
|
||||
m_familyManager.Set(m_familyManager.get_Parameter(BuiltInParameter.WINDOW_HEIGHT),
|
||||
m_height);
|
||||
m_familyManager.Set(m_familyManager.get_Parameter(BuiltInParameter.WINDOW_WIDTH),
|
||||
m_width);
|
||||
m_familyManager.Set(m_familyManager.get_Parameter("Default Sill Height"), m_sillHeight);
|
||||
|
||||
//get materials
|
||||
|
||||
FilteredElementCollector elementCollector = new FilteredElementCollector(m_document);
|
||||
elementCollector.WherePasses(new ElementClassFilter(typeof(Material)));
|
||||
IList<Element> materials = elementCollector.ToElements();
|
||||
|
||||
foreach (Element materialElement in materials)
|
||||
{
|
||||
Material material = materialElement as Material;
|
||||
m_para.GlassMaterials.Add(material.Name);
|
||||
m_para.FrameMaterials.Add(material.Name);
|
||||
}
|
||||
|
||||
//get categories
|
||||
Categories categories = m_document.Settings.Categories;
|
||||
Category category = categories.get_Item(BuiltInCategory.OST_Windows);
|
||||
CategoryNameMap cnm = category.SubCategories;
|
||||
|
||||
m_frameCat = categories.get_Item(BuiltInCategory.OST_WindowsFrameMullionProjection);
|
||||
m_glassCat = categories.get_Item(BuiltInCategory.OST_WindowsGlassProjection);
|
||||
|
||||
//get referenceplanes
|
||||
List<ReferencePlane> planes = Utility.GetElements<ReferencePlane>(m_application, m_document);
|
||||
foreach (ReferencePlane p in planes)
|
||||
{
|
||||
if (p.Name.Equals("Sash"))
|
||||
m_sashPlane = p;
|
||||
if (p.Name.Equals("Exterior"))
|
||||
m_exteriorPlane = p;
|
||||
if (p.Name.Equals("Center (Front/Back)"))
|
||||
m_centerPlane = p;
|
||||
if (p.Name.Equals("Top") || p.Name.Equals("Head"))
|
||||
m_topPlane = p;
|
||||
if (p.Name.Equals("Sill") || p.Name.Equals("Bottom"))
|
||||
m_sillPlane = p;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// the method is used to create new family type
|
||||
/// </summary>
|
||||
/// <param name="para">WindowParameter</param>
|
||||
/// <returns>indicate whether the NewType is successful</returns>
|
||||
private bool newFamilyType(WindowParameter para)//string typeName, double height, double width, double sillHeight)
|
||||
{
|
||||
DoubleHungWinPara dbhungPara = para as DoubleHungWinPara;
|
||||
string typeName = dbhungPara.Type;
|
||||
double height = dbhungPara.Height;
|
||||
double width = dbhungPara.Width;
|
||||
double sillHeight = dbhungPara.SillHeight;
|
||||
double windowInset = dbhungPara.Inset;
|
||||
switch (m_document.DisplayUnitSystem)
|
||||
{
|
||||
case Autodesk.Revit.DB.DisplayUnit.METRIC:
|
||||
height = Utility.MetricToImperial(height);
|
||||
width = Utility.MetricToImperial(width);
|
||||
sillHeight = Utility.MetricToImperial(sillHeight);
|
||||
windowInset = Utility.MetricToImperial(windowInset);
|
||||
break;
|
||||
}
|
||||
try
|
||||
{
|
||||
FamilyType type = m_familyManager.NewType(typeName);
|
||||
m_familyManager.CurrentType = type;
|
||||
m_familyManager.Set(m_familyManager.get_Parameter(BuiltInParameter.WINDOW_HEIGHT), height);
|
||||
m_familyManager.Set(m_familyManager.get_Parameter(BuiltInParameter.WINDOW_WIDTH), width);
|
||||
m_familyManager.Set(m_familyManager.get_Parameter("Default Sill Height"), sillHeight);
|
||||
m_familyManager.Set(m_familyManager.get_Parameter("Window Inset"), windowInset);
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine(e.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The method is used to create a FamilyElementVisibility instance
|
||||
/// </summary>
|
||||
/// <returns>FamilyElementVisibility instance</returns>
|
||||
private FamilyElementVisibility CreateVisibility()
|
||||
{
|
||||
FamilyElementVisibility familyElemVisibility = new FamilyElementVisibility(FamilyElementVisibilityType.Model);
|
||||
familyElemVisibility.IsShownInCoarse = true;
|
||||
familyElemVisibility.IsShownInFine = true;
|
||||
familyElemVisibility.IsShownInMedium = true;
|
||||
familyElemVisibility.IsShownInFrontBack = true;
|
||||
familyElemVisibility.IsShownInLeftRight = true;
|
||||
familyElemVisibility.IsShownInPlanRCPCut = false;
|
||||
return familyElemVisibility;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The method is used to create common class variables in this class
|
||||
/// </summary>
|
||||
private void CreateCommon()
|
||||
{
|
||||
//create common
|
||||
m_dimensionCreator = new CreateDimension(m_application.Application, m_document);
|
||||
m_extrusionCreator = new CreateExtrusion(m_application.Application, m_document);
|
||||
m_rightView = Utility.GetViewByName("Right", m_application, m_document);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,242 +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 Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
using Element = Autodesk.Revit.DB.Element;
|
||||
using GElement = Autodesk.Revit.DB.GeometryElement;
|
||||
|
||||
namespace Revit.SDK.Samples.WindowWizard.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// A object to help locating with geometry data.
|
||||
/// </summary>
|
||||
public class GeoHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// store the const precision
|
||||
/// </summary>
|
||||
private const double Precision = 0.0001;
|
||||
|
||||
/// <summary>
|
||||
/// The method is used to get the wall face along the specified parameters
|
||||
/// </summary>
|
||||
/// <param name="wall">the wall</param>
|
||||
/// <param name="view">the options view</param>
|
||||
/// <param name="ExtOrInt">if true indicate that get exterior wall face, else false get the interior wall face</param>
|
||||
/// <returns>the face</returns>
|
||||
static public Face GetWallFace(Wall wall, View view, bool ExtOrInt)
|
||||
{
|
||||
FaceArray faces = null;
|
||||
Face face = null;
|
||||
Options options = new Options();
|
||||
options.ComputeReferences = true;
|
||||
options.View = view;
|
||||
if (wall != null)
|
||||
{
|
||||
//GeometryObjectArray geoArr = wall.get_Geometry(options).Objects;
|
||||
IEnumerator<GeometryObject> Objects = wall.get_Geometry(options).GetEnumerator();
|
||||
//foreach (GeometryObject geoObj in geoArr)
|
||||
while (Objects.MoveNext())
|
||||
{
|
||||
GeometryObject geoObj = Objects.Current;
|
||||
|
||||
if (geoObj is Solid)
|
||||
{
|
||||
Solid s = geoObj as Solid;
|
||||
faces = s.Faces;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ExtOrInt)
|
||||
face = GetExteriorFace(faces);
|
||||
else
|
||||
face = GetInteriorFace(faces);
|
||||
return face;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The method is used to get extrusion's face along to the specified parameters
|
||||
/// </summary>
|
||||
/// <param name="extrusion">the extrusion</param>
|
||||
/// <param name="view">options view</param>
|
||||
/// <param name="ExtOrInt">If true indicate getting exterior extrusion face, else getting interior extrusion face</param>
|
||||
/// <returns>the face</returns>
|
||||
static public Face GetExtrusionFace(Extrusion extrusion, View view, bool ExtOrInt)
|
||||
{
|
||||
Face face = null;
|
||||
FaceArray faces = null;
|
||||
if (extrusion.IsSolid)
|
||||
{
|
||||
Options options = new Options();
|
||||
options.ComputeReferences = true;
|
||||
options.View = view;
|
||||
//GeometryObjectArray geoArr = extrusion.get_Geometry(options).Objects;
|
||||
IEnumerator<GeometryObject> Objects = extrusion.get_Geometry(options).GetEnumerator();
|
||||
//foreach (GeometryObject geoObj in geoArr)
|
||||
while (Objects.MoveNext())
|
||||
{
|
||||
GeometryObject geoObj = Objects.Current;
|
||||
|
||||
if (geoObj is Solid)
|
||||
{
|
||||
Solid s = geoObj as Solid;
|
||||
faces = s.Faces;
|
||||
}
|
||||
}
|
||||
if (ExtOrInt)
|
||||
face = GetExteriorFace(faces);
|
||||
else
|
||||
face = GetInteriorFace(faces);
|
||||
}
|
||||
return face;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The assistant method is used for getting wall face and getting extrusion face
|
||||
/// </summary>
|
||||
/// <param name="faces">faces array</param>
|
||||
/// <returns>the face</returns>
|
||||
static private Face GetExteriorFace(FaceArray faces)
|
||||
{
|
||||
double elevation = 0;
|
||||
double tempElevation = 0;
|
||||
Mesh mesh = null;
|
||||
Face face = null;
|
||||
foreach (Face f in faces)
|
||||
{
|
||||
tempElevation = 0;
|
||||
mesh = f.Triangulate();
|
||||
foreach (Autodesk.Revit.DB.XYZ xyz in mesh.Vertices)
|
||||
{
|
||||
tempElevation = tempElevation + xyz.Y;
|
||||
}
|
||||
tempElevation = tempElevation / mesh.Vertices.Count;
|
||||
if (elevation < tempElevation || null == face)
|
||||
{
|
||||
face = f;
|
||||
elevation = tempElevation;
|
||||
}
|
||||
}
|
||||
return face;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The assistant method is used for getting wall face and getting extrusion face
|
||||
/// </summary>
|
||||
/// <param name="faces">faces array</param>
|
||||
/// <returns>the face</returns>
|
||||
static private Face GetInteriorFace(FaceArray faces)
|
||||
{
|
||||
double elevation = 0;
|
||||
double tempElevation = 0;
|
||||
Mesh mesh = null;
|
||||
Face face = null;
|
||||
foreach (Face f in faces)
|
||||
{
|
||||
tempElevation = 0;
|
||||
mesh = f.Triangulate();
|
||||
foreach (Autodesk.Revit.DB.XYZ xyz in mesh.Vertices)
|
||||
{
|
||||
tempElevation = tempElevation + xyz.Y;
|
||||
}
|
||||
tempElevation = tempElevation / mesh.Vertices.Count;
|
||||
if (elevation > tempElevation || null == face)
|
||||
{
|
||||
face = f;
|
||||
elevation = tempElevation;
|
||||
}
|
||||
}
|
||||
return face;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find out the three points which made of a plane.
|
||||
/// </summary>
|
||||
/// <param name="mesh">A mesh contains many points.</param>
|
||||
/// <param name="startPoint">Create a new instance of ReferencePlane.</param>
|
||||
/// <param name="endPoint">The free end apply to reference plane.</param>
|
||||
/// <param name="thirdPnt">A third point needed to define the reference plane.</param>
|
||||
static public void Distribute(Mesh mesh, ref Autodesk.Revit.DB.XYZ startPoint, ref Autodesk.Revit.DB.XYZ endPoint, ref Autodesk.Revit.DB.XYZ thirdPnt)
|
||||
{
|
||||
int count = mesh.Vertices.Count;
|
||||
startPoint = mesh.Vertices[0];
|
||||
endPoint = mesh.Vertices[(int)(count / 3)];
|
||||
thirdPnt = mesh.Vertices[(int)(count / 3 * 2)];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether a edge is vertical.
|
||||
/// </summary>
|
||||
/// <param name="edge">The edge to be determined.</param>
|
||||
/// <returns>Return true if this edge is vertical, or else return false.</returns>
|
||||
static public bool IsVerticalEdge(Edge edge)
|
||||
{
|
||||
List<XYZ> polyline = edge.Tessellate() as List<XYZ>;
|
||||
Autodesk.Revit.DB.XYZ verticalVct = new Autodesk.Revit.DB.XYZ(0, 0, 1);
|
||||
Autodesk.Revit.DB.XYZ pointBuffer = polyline[0];
|
||||
|
||||
for (int i = 1; i < polyline.Count; i = i + 1)
|
||||
{
|
||||
Autodesk.Revit.DB.XYZ temp = polyline[i];
|
||||
Autodesk.Revit.DB.XYZ vector = GetVector(pointBuffer, temp);
|
||||
if (Equal(vector, verticalVct))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the vector between two points.
|
||||
/// </summary>
|
||||
/// <param name="startPoint">The start point.</param>
|
||||
/// <param name="endPoint">The end point.</param>
|
||||
/// <returns>The vector between two points.</returns>
|
||||
static public Autodesk.Revit.DB.XYZ GetVector(Autodesk.Revit.DB.XYZ startPoint, Autodesk.Revit.DB.XYZ endPoint)
|
||||
{
|
||||
return new Autodesk.Revit.DB.XYZ(endPoint.X - startPoint.X,
|
||||
endPoint.Y - startPoint.Y, endPoint.Z - startPoint.Z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether two vector are equal in x and y axis.
|
||||
/// </summary>
|
||||
/// <param name="vectorA">The vector A.</param>
|
||||
/// <param name="vectorB">The vector B.</param>
|
||||
/// <returns>Return true if two vector are equals, or else return false.</returns>
|
||||
static public bool Equal(Autodesk.Revit.DB.XYZ vectorA, Autodesk.Revit.DB.XYZ vectorB)
|
||||
{
|
||||
bool isNotEqual = (Precision < Math.Abs(vectorA.X - vectorB.X)) ||
|
||||
(Precision < Math.Abs(vectorA.Y - vectorB.Y));
|
||||
return isNotEqual ? false : true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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("TypeRegeneration")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Autodesk, Inc.")]
|
||||
[assembly: AssemblyProduct("TypeRegeneration")]
|
||||
[assembly: AssemblyCopyright("Copyright © Autodesk, Inc. 2009")]
|
||||
[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("a74cebac-84a8-435e-a0a5-e9d4f31dffb5")]
|
||||
|
||||
// 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")]
|
||||
@@ -1,299 +0,0 @@
|
||||
{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe2052\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
|
||||
{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
|
||||
{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
|
||||
{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
|
||||
{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}
|
||||
{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
||||
{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f55\fbidi \fswiss\fcharset238\fprq2 Arial CE;}{\f56\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}
|
||||
{\f58\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f59\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f60\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f61\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}
|
||||
{\f62\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f63\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f55\fbidi \fswiss\fcharset238\fprq2 Arial CE;}{\f56\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}
|
||||
{\f58\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f59\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f60\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f61\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}
|
||||
{\f62\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f63\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
|
||||
{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
|
||||
{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
|
||||
{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
||||
{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}
|
||||
{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
|
||||
{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
|
||||
{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
|
||||
{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
|
||||
{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
|
||||
{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
|
||||
{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
|
||||
{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
||||
{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}
|
||||
{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}
|
||||
{\fhiminor\f31573\fbidi \fswiss\fcharset177\fprq2 Calibri (Hebrew);}{\fhiminor\f31574\fbidi \fswiss\fcharset178\fprq2 Calibri (Arabic);}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
|
||||
{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
|
||||
{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
|
||||
{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
|
||||
\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1
|
||||
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0
|
||||
\fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext0 \sqformat \spriority0 Normal;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
|
||||
\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
|
||||
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext11 \ssemihidden \sunhideused
|
||||
Normal Table;}}{\*\rsidtbl \rsid6057036\rsid12980045}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\author duans}{\operator Jennifer (Xue) Li}
|
||||
{\creatim\yr2011\mo3\dy28\hr16\min48}{\revtim\yr2018\mo1\dy12\hr14\min37}{\version3}{\edmins4400}{\nofpages2}{\nofwords652}{\nofchars3719}{\nofcharsws4363}{\vern37}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
|
||||
\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
|
||||
\widowctrl\ftnbj\aenddoc\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120\dghorigin1701
|
||||
\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\rsidroot6057036 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2
|
||||
\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6
|
||||
\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang
|
||||
{\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\af31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 {\rtlch\fcs1
|
||||
\ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Application:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 WindowWizard}{\rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0
|
||||
\b\f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Revit Platform:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid12980045 \hich\af1\dbch\af31505\loch\f1 \hich\af1\dbch\af31505\loch\f1 All}{\rtlch\fcs1
|
||||
\af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Revit Version:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036
|
||||
\hich\af1\dbch\af31505\loch\f1 2011.0\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 First Released For:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1
|
||||
2010.0\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Programming Language:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 C#\line }{\rtlch\fcs1
|
||||
\ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Skill Level:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0
|
||||
\f1\fs20\insrsid6057036\charrsid12980045 \hich\af1\dbch\af31505\loch\f1 Beginning}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Category:}
|
||||
{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Families\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Type:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0
|
||||
\f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 ExternalCommand}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Subject:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Windows Wizard}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Summary:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1
|
||||
This sample will demonstrate how to create a window family via wizard.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Classes:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\insrsid6057036
|
||||
\par }\pard \ltrpar\ql \fi360\li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.UI.IExternalCommand}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.UI.IExternalApplication}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.UI.UIDocument
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.DB.E\hich\af1\dbch\af31505\loch\f1 lement}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036 .}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036
|
||||
\hich\af1\dbch\af31505\loch\f1 DB.}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\lang1024\langfe1024\noproof\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 FamilyManager}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\lang1024\langfe1024\noproof\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\lang1024\langfe1024\noproof\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.DB.ParameterSet}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\lang1024\langfe1024\noproof\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.DB.GeometryElement}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Project Files:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036
|
||||
\hich\af1\dbch\af31505\loch\f1
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Command.cs}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1
|
||||
This file contains a class Command which implements IExternalCommand interface. The function of the class is to create an in\hich\af1\dbch\af31505\loch\f1 stance of WindowWizard and call the method Run to execute}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\insrsid6057036 .
|
||||
\par
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 WindowWizard.cs
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1
|
||||
This file contains a class WindowWizard which stores ExternalCommandData, creates DoubleHungWinCreation instance, and also has method to create WizardForm instance}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036 .}{\rtlch\fcs1 \af1\afs20
|
||||
\ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036 \tab
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 WindowParameter.cs
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1
|
||||
This file contains three classes: one is WizardParameter which stores the wizard parameters. The other is WindowParameter which store the common window parameters. Another is DoubleHungWinPara which inherits from WindowParameter stores t
|
||||
\hich\af1\dbch\af31505\loch\f1 he parameters of double hung window.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 ValidateWindowParameter.cs
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1
|
||||
This file contains a class ValidateWindowParameter which validates the window parameters.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 WindowCreation.cs
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1
|
||||
This file contains an abstract class WindowCreation which has abstract method to c\hich\af1\dbch\af31505\loch\f1 reate the window family step by step.
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 DoubleHungWinCreation.cs
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1
|
||||
This file contains a class DoubleHungWinCreation which implements WindowCreation and creates a double hung window family step by step.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036 \tab
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 CreateExtrusion.cs
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 This file contains a class CreateExt\hich\af1\dbch\af31505\loch\f1
|
||||
rusion which has methods to create CurveArray and solid extrusion.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 CreateDimension.cs
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1
|
||||
This file contains a class CreateDimension which has methods to add dimension between ReferencePlanes, Faces, or a face and a ReferencePlane.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 CreateReferencePlane.cs
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Th\hich\af1\dbch\af31505\loch\f1
|
||||
is file contains a class CreateRefPlane which creates ReferencePlane according to a host ReferencePlane and a double offset.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 CreateAlignment.cs}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1
|
||||
This file contains a class CreateAlignment which adds an alignment dimension between two faces.
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Utility.cs
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1
|
||||
This file contains a class Utility which has static methods to allow getting common element.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 GeoHelper.cs
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 This file contains a class GeoHelper which helps locating with geometry data.}{
|
||||
\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx720\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 WizardUI.cs
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 This file contains a window form which allows user to do U
|
||||
\hich\af1\dbch\af31505\loch\f1 I input and selection.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Description:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1
|
||||
\par \hich\af1\dbch\af31505\loch\f1 The sample implements IExternalCommand interface and allows user to create window family via wizard. User should create a family with window family template, and then user can input dimensions for window parameters, sp
|
||||
\hich\af1\dbch\af31505\loch\f1 ecify the materials, and save family file locally. }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\tx360\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 -\tab \hich\af1\dbch\af31505\loch\f1
|
||||
To create Extrusion, use the method NewExtrusion of FamilyItemFactory}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036 .
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 -\tab \hich\af1\dbch\af31505\loch\f1 To create Alignment, use the method NewAlignment of FamilyItemFactory}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036 .
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 -\tab \hich\af1\dbch\af31505\loch\f1 To create Dimension, use the method NewDimension of Fami\hich\af1\dbch\af31505\loch\f1 lyItemFactory}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\insrsid6057036 .
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 -\tab \hich\af1\dbch\af31505\loch\f1
|
||||
To create ReferencePlane, use the method NewReferencePlane of FamilyItemFactory}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036 .
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 -\tab \hich\af1\dbch\af31505\loch\f1 To create family type, use the method NewType of FamilyItemFactory}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\tx360\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 -\tab \hich\af1\dbch\af31505\loch\f1
|
||||
To get the materials, use the property Settings.Materials of document}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036 .
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 -\tab \hich\af1\dbch\af31505\loch\f1 To get the Categories, use the property Settings.Categories of document}{
|
||||
\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036 .
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 Instructions:}{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\cf2\insrsid6057036
|
||||
\hich\af1\dbch\af31505\loch\f1 }{\rtlch\fcs1 \ab\af0\afs20 \ltrch\fcs0 \b\f0\fs20\cf2\insrsid6057036
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\tx360\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 1.\tab Update your Revit.ini by following lines: }{\rtlch\fcs1
|
||||
\af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 [ExternalCommands]
|
||||
\par \hich\af1\dbch\af31505\loch\f1 ECCount = 1 }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 ECName1=WindowWizard
|
||||
\par \hich\af1\dbch\af31505\loch\f1 ECClassName1=Revit.SDK.Samples.WindowWizard.CS
|
||||
\par \hich\af1\dbch\af31505\loch\f1 ECAssembly1 = }{\rtlch\fcs1 \ai\af1\afs20 \ltrch\fcs0 \i\f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 <your path>}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036 \\}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0
|
||||
\f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 WindowWizard.dll
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\tx360\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 2.\tab Start Revit}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\insrsid6057036 .
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 3.\tab
|
||||
In order to use the wizard, users should manually create a family document with window template(like Window.rft)}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036 .}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036
|
||||
\hich\af1\dbch\af31505\loch\f1 If the template is not right, the command will fail.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 4.\tab Launch WindowWizard via the external \hich\af1\dbch\af31505\loch\f1 command menu}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036 .
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 5.\tab Input the window dimensions including type name, Height, Width, Inset and Sill Height}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036 .}{
|
||||
\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 You can click the new or duplicate\hich\af1\dbch\af31505\loch\f1
|
||||
button to create a new family type and input its dimensions; User can also select the family type and modify corresponding dimensions. Click Next button.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 6.\tab Select Material for Glass Pane and Sash. Click back button to modify dimensions or next button to \hich\af1\dbch\af31505\loch\f1 next step.}{\rtlch\fcs1
|
||||
\af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1 7.\tab View all window types created before}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid6057036 ,}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0
|
||||
\f1\fs20\insrsid6057036 \hich\af1\dbch\af31505\loch\f1
|
||||
you can go back do further modification on these types. Click the file button then choose a path to store the family file. Click Finish button, Revit will create one window family automatically for you}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\insrsid6057036 .
|
||||
\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
|
||||
9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
|
||||
5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
|
||||
b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
|
||||
0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
|
||||
a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
|
||||
c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
|
||||
0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
|
||||
a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
|
||||
6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
|
||||
4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
|
||||
4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f
|
||||
7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
|
||||
615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
|
||||
79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
|
||||
5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
|
||||
999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
|
||||
699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
|
||||
8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
|
||||
0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
|
||||
9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
|
||||
15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
|
||||
3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
|
||||
32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
|
||||
f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
|
||||
e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb
|
||||
44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a
|
||||
6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c
|
||||
3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256
|
||||
5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276
|
||||
b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8
|
||||
c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e
|
||||
51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95
|
||||
b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff
|
||||
6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6
|
||||
9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239
|
||||
b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449
|
||||
59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8
|
||||
2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468
|
||||
656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4
|
||||
350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624
|
||||
52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141
|
||||
73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000
|
||||
0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000
|
||||
000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019
|
||||
0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000
|
||||
000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027
|
||||
00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000}
|
||||
{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
|
||||
617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
|
||||
6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
|
||||
656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
|
||||
{\*\latentstyles\lsdstimax375\lsdlockeddef0\lsdsemihiddendef0\lsdunhideuseddef0\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;
|
||||
\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
|
||||
\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;
|
||||
\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 1;
|
||||
\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 2;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 3;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 4;
|
||||
\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 5;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 6;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 7;
|
||||
\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 8;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 9;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority35 \lsdlocked0 caption;
|
||||
\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 macro;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number;\lsdqformat1 \lsdpriority10 \lsdlocked0 Title;
|
||||
\lsdsemihidden1 \lsdunhideused1 \lsdpriority1 \lsdlocked0 Default Paragraph Font;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 4;
|
||||
\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Message Header;\lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;
|
||||
\lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Web 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Balloon Text;\lsdsemihidden1 \lsdunhideused1 \lsdpriority59 \lsdlocked0 Table Grid;
|
||||
\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Theme;\lsdsemihidden1 \lsdlocked0 Placeholder Text;\lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;\lsdpriority60 \lsdlocked0 Light Shading;\lsdpriority61 \lsdlocked0 Light List;
|
||||
\lsdpriority62 \lsdlocked0 Light Grid;\lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdpriority65 \lsdlocked0 Medium List 1;\lsdpriority66 \lsdlocked0 Medium List 2;\lsdpriority67 \lsdlocked0 Medium Grid 1;
|
||||
\lsdpriority68 \lsdlocked0 Medium Grid 2;\lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdpriority70 \lsdlocked0 Dark List;\lsdpriority71 \lsdlocked0 Colorful Shading;\lsdpriority72 \lsdlocked0 Colorful List;\lsdpriority73 \lsdlocked0 Colorful Grid;
|
||||
\lsdpriority60 \lsdlocked0 Light Shading Accent 1;\lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;
|
||||
\lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdsemihidden1 \lsdlocked0 Revision;\lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
|
||||
\lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdpriority70 \lsdlocked0 Dark List Accent 1;
|
||||
\lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;\lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdpriority60 \lsdlocked0 Light Shading Accent 2;\lsdpriority61 \lsdlocked0 Light List Accent 2;
|
||||
\lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
|
||||
\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;\lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;
|
||||
\lsdpriority72 \lsdlocked0 Colorful List Accent 2;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdpriority61 \lsdlocked0 Light List Accent 3;\lsdpriority62 \lsdlocked0 Light Grid Accent 3;
|
||||
\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;
|
||||
\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdpriority70 \lsdlocked0 Dark List Accent 3;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;
|
||||
\lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;\lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdpriority62 \lsdlocked0 Light Grid Accent 4;
|
||||
\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;
|
||||
\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
|
||||
\lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdpriority60 \lsdlocked0 Light Shading Accent 5;\lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdpriority62 \lsdlocked0 Light Grid Accent 5;
|
||||
\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
|
||||
\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;\lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;
|
||||
\lsdpriority72 \lsdlocked0 Colorful List Accent 5;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdpriority61 \lsdlocked0 Light List Accent 6;\lsdpriority62 \lsdlocked0 Light Grid Accent 6;
|
||||
\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;
|
||||
\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdpriority70 \lsdlocked0 Dark List Accent 6;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;
|
||||
\lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;\lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
|
||||
\lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;\lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdsemihidden1 \lsdunhideused1 \lsdpriority37 \lsdlocked0 Bibliography;
|
||||
\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;\lsdpriority41 \lsdlocked0 Plain Table 1;\lsdpriority42 \lsdlocked0 Plain Table 2;\lsdpriority43 \lsdlocked0 Plain Table 3;\lsdpriority44 \lsdlocked0 Plain Table 4;
|
||||
\lsdpriority45 \lsdlocked0 Plain Table 5;\lsdpriority40 \lsdlocked0 Grid Table Light;\lsdpriority46 \lsdlocked0 Grid Table 1 Light;\lsdpriority47 \lsdlocked0 Grid Table 2;\lsdpriority48 \lsdlocked0 Grid Table 3;\lsdpriority49 \lsdlocked0 Grid Table 4;
|
||||
\lsdpriority50 \lsdlocked0 Grid Table 5 Dark;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 1;
|
||||
\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 1;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 1;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 1;
|
||||
\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 1;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 2;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 2;
|
||||
\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 2;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 2;
|
||||
\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 3;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 3;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 3;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 3;
|
||||
\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 3;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 4;
|
||||
\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 4;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 4;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 4;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 4;
|
||||
\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 4;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 5;
|
||||
\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 5;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 5;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 5;
|
||||
\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 5;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 6;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 6;
|
||||
\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 6;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 6;
|
||||
\lsdpriority46 \lsdlocked0 List Table 1 Light;\lsdpriority47 \lsdlocked0 List Table 2;\lsdpriority48 \lsdlocked0 List Table 3;\lsdpriority49 \lsdlocked0 List Table 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark;
|
||||
\lsdpriority51 \lsdlocked0 List Table 6 Colorful;\lsdpriority52 \lsdlocked0 List Table 7 Colorful;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 List Table 2 Accent 1;\lsdpriority48 \lsdlocked0 List Table 3 Accent 1;
|
||||
\lsdpriority49 \lsdlocked0 List Table 4 Accent 1;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 1;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 1;
|
||||
\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 List Table 2 Accent 2;\lsdpriority48 \lsdlocked0 List Table 3 Accent 2;\lsdpriority49 \lsdlocked0 List Table 4 Accent 2;
|
||||
\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 2;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 3;
|
||||
\lsdpriority47 \lsdlocked0 List Table 2 Accent 3;\lsdpriority48 \lsdlocked0 List Table 3 Accent 3;\lsdpriority49 \lsdlocked0 List Table 4 Accent 3;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 3;
|
||||
\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 4;\lsdpriority47 \lsdlocked0 List Table 2 Accent 4;
|
||||
\lsdpriority48 \lsdlocked0 List Table 3 Accent 4;\lsdpriority49 \lsdlocked0 List Table 4 Accent 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 4;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 4;
|
||||
\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 List Table 2 Accent 5;\lsdpriority48 \lsdlocked0 List Table 3 Accent 5;
|
||||
\lsdpriority49 \lsdlocked0 List Table 4 Accent 5;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 5;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 5;
|
||||
\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 List Table 2 Accent 6;\lsdpriority48 \lsdlocked0 List Table 3 Accent 6;\lsdpriority49 \lsdlocked0 List Table 4 Accent 6;
|
||||
\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Mention;
|
||||
\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Smart Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hashtag;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Unresolved Mention;}}{\*\datastore 010500000200000018000000
|
||||
4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000
|
||||
d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000f0c8
|
||||
a8d76f8bd301feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000105000000000000}}
|
||||
@@ -1,133 +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 Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using Autodesk.Revit.ApplicationServices;
|
||||
|
||||
namespace Revit.SDK.Samples.WindowWizard.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// A common class for users to get some specified element
|
||||
/// </summary>
|
||||
class Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// This method is used to allow user to get reference plane by name,if there is no proper reference plane,will return null
|
||||
/// </summary>
|
||||
/// <param name="name">the name property of reference plane</param>
|
||||
/// <param name="app">the application</param>
|
||||
/// <param name="doc">the document</param>
|
||||
/// <returns>the reference plane or null</returns>
|
||||
public static ReferencePlane GetRefPlaneByName(string name, UIApplication app,Document doc)
|
||||
{
|
||||
ReferencePlane r = null;
|
||||
FilteredElementCollector collector = new FilteredElementCollector(app.ActiveUIDocument.Document);
|
||||
collector.OfClass(typeof(ReferencePlane));
|
||||
FilteredElementIterator eit = collector.GetElementIterator();
|
||||
eit.Reset();
|
||||
while (eit.MoveNext())
|
||||
{
|
||||
r = eit.Current as ReferencePlane;
|
||||
if (r.Name.Equals(name))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method allows user to get view by name
|
||||
/// </summary>
|
||||
/// <param name="name">the name property of view</param>
|
||||
/// <param name="app">the application</param>
|
||||
/// <param name="doc">the document</param>
|
||||
/// <returns>the view or null</returns>
|
||||
public static View GetViewByName(string name,UIApplication app,Document doc)
|
||||
{
|
||||
View v = null;
|
||||
FilteredElementCollector collector = new FilteredElementCollector(app.ActiveUIDocument.Document);
|
||||
collector.OfClass(typeof(View));
|
||||
FilteredElementIterator eit = collector.GetElementIterator();
|
||||
eit.Reset();
|
||||
while (eit.MoveNext())
|
||||
{
|
||||
v = eit.Current as View;
|
||||
if (v.Name.Equals(name))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is used to get elements by type filter
|
||||
/// </summary>
|
||||
/// <typeparam name="T">the type</typeparam>
|
||||
/// <param name="app">the application</param>
|
||||
/// <param name="doc">the document</param>
|
||||
/// <returns>the list of elements</returns>
|
||||
public static List<T> GetElements<T>(UIApplication app,Document doc) where T : Autodesk.Revit.DB.Element
|
||||
{
|
||||
List<T> elements = new List<T>();
|
||||
|
||||
FilteredElementCollector collector = new FilteredElementCollector(app.ActiveUIDocument.Document);
|
||||
collector.OfClass(typeof(T));
|
||||
FilteredElementIterator eit = collector.GetElementIterator();
|
||||
eit.Reset();
|
||||
while (eit.MoveNext())
|
||||
{
|
||||
T element = eit.Current as T;
|
||||
if (element != null)
|
||||
{
|
||||
elements.Add(element);
|
||||
}
|
||||
}
|
||||
return elements;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This function is used to convert from metric to imperial
|
||||
/// </summary>
|
||||
/// <param name="value">the metric value</param>
|
||||
/// <returns>the result</returns>
|
||||
public static double MetricToImperial(double value)
|
||||
{
|
||||
return value / 304.8; //* 0.00328;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This function is used to convert from imperial to metric
|
||||
/// </summary>
|
||||
/// <param name="value">the imperial value</param>
|
||||
/// <returns>the result</returns>
|
||||
public static double ImperialToMetric(double value)
|
||||
{
|
||||
return value*304.8;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,174 +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;
|
||||
|
||||
namespace Revit.SDK.Samples.WindowWizard.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// class is used to validate window parameters
|
||||
/// </summary>
|
||||
public class ValidateWindowParameter
|
||||
{
|
||||
#region Class Memeber Variables
|
||||
/// <summary>
|
||||
/// store the wall's height
|
||||
/// </summary>
|
||||
private double m_wallHeight=10;
|
||||
|
||||
/// <summary>
|
||||
/// store the wall's width
|
||||
/// </summary>
|
||||
private double m_wallWidth=10;
|
||||
|
||||
/// <summary>
|
||||
/// indicate the template file is metric or not
|
||||
/// </summary>
|
||||
public bool IsMetric;
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// constructor of ValidateWindowParameter
|
||||
/// </summary>
|
||||
/// <param name="wallHeight">wall height parameter</param>
|
||||
/// <param name="wallWidth">wall width parameter</param>
|
||||
public ValidateWindowParameter(double wallHeight, double wallWidth)
|
||||
{
|
||||
if (wallHeight >= 0)
|
||||
{
|
||||
m_wallHeight = wallHeight;
|
||||
}
|
||||
if (wallWidth >= 0)
|
||||
{
|
||||
m_wallWidth = wallWidth;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#region Class Implementation
|
||||
/// <summary>
|
||||
/// This method is used to check whether a value string is double type
|
||||
/// </summary>
|
||||
/// <param name="value">>the string value</param>
|
||||
/// <param name="result">the double result</param>
|
||||
/// <returns>the validation result message</returns>
|
||||
public string IsDouble(string value, ref double result)
|
||||
{
|
||||
if (Double.TryParse("0" + value, out result))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Please input a double value.";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is used to check whether the width value is out of range
|
||||
/// </summary>
|
||||
/// <param name="value">the string value</param>
|
||||
/// <returns>the validation result message</returns>
|
||||
public string IsWidthInRange(double value)
|
||||
{
|
||||
if (IsMetric)
|
||||
{
|
||||
value = Utility.MetricToImperial(value);
|
||||
if (value >= 0.23 && value < m_wallWidth)
|
||||
return string.Empty;
|
||||
else
|
||||
return "The width should be between 69 and " + Convert.ToInt32(Utility.ImperialToMetric(m_wallWidth));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (value >= 0.4 && value < m_wallWidth)
|
||||
return string.Empty;
|
||||
else
|
||||
return "The width should be between 0.4 and " + m_wallWidth;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is used to check whether the height value is out of range
|
||||
/// </summary>
|
||||
/// <param name="value">the string value</param>
|
||||
/// <returns>the validation result message</returns>
|
||||
public string IsHeightInRange(double value)
|
||||
{
|
||||
if (IsMetric)
|
||||
{
|
||||
value = Utility.MetricToImperial(value);
|
||||
if (value >= 0.23)
|
||||
return string.Empty;
|
||||
else
|
||||
return "The height should > 69";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (value >= 0.4)
|
||||
return string.Empty;
|
||||
else
|
||||
return "The height should > 0.4";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is used to check whether the inset value is out of range
|
||||
/// </summary>
|
||||
/// <param name="value">the string value</param>
|
||||
/// <returns>the validation result message</returns>
|
||||
public string IsInsetInRange(double value)
|
||||
{
|
||||
if (IsMetric)
|
||||
value = Utility.MetricToImperial(value);
|
||||
if (value >= 0)
|
||||
return string.Empty;
|
||||
else
|
||||
return "The Inset should > 0";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is used to check whether the sillheight value is out of range
|
||||
/// </summary>
|
||||
/// <param name="value">the string value</param>
|
||||
/// <returns>the validation result message</returns>
|
||||
public string IsSillHeightInRange(double value)
|
||||
{
|
||||
if (IsMetric)
|
||||
{
|
||||
value = Utility.MetricToImperial(value);
|
||||
if (value < m_wallHeight)
|
||||
return string.Empty;
|
||||
else
|
||||
return "The sillheight should be < " + Convert.ToInt32(Utility.ImperialToMetric(m_wallHeight));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (value < m_wallHeight)
|
||||
return string.Empty;
|
||||
else
|
||||
return "The sillheight should be < " + m_wallHeight;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,76 +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;
|
||||
|
||||
namespace Revit.SDK.Samples.WindowWizard.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// This class is used for window creation
|
||||
/// </summary>
|
||||
abstract class WindowCreation
|
||||
{
|
||||
/// <summary>
|
||||
/// The parameter of Window wizard
|
||||
/// </summary>
|
||||
public WizardParameter m_para;
|
||||
|
||||
/// <summary>
|
||||
/// The constructor of WindowCreation
|
||||
/// </summary>
|
||||
/// <param name="parameter">WizardParameter</param>
|
||||
public WindowCreation(WizardParameter parameter)
|
||||
{
|
||||
m_para = parameter;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The function is used to create frame
|
||||
/// </summary>
|
||||
public abstract void CreateFrame();
|
||||
|
||||
/// <summary>
|
||||
/// The function is used to create sash
|
||||
/// </summary>
|
||||
public abstract void CreateSash();
|
||||
|
||||
/// <summary>
|
||||
/// The function is used to create glass
|
||||
/// </summary>
|
||||
public abstract void CreateGlass();
|
||||
|
||||
/// <summary>
|
||||
/// The function is used to create material
|
||||
/// </summary>
|
||||
public abstract void CreateMaterial();
|
||||
|
||||
/// <summary>
|
||||
/// The function is used to combine and build the window family
|
||||
/// </summary>
|
||||
public abstract void CombineAndBuild();
|
||||
|
||||
/// <summary>
|
||||
/// The function is used to do the whole creation work.
|
||||
/// </summary>
|
||||
public abstract bool Creation();
|
||||
}
|
||||
}
|
||||
@@ -1,384 +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;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Revit.SDK.Samples.WindowWizard.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// This class will deal with all parameters related to window creation
|
||||
/// </summary>
|
||||
public class WindowParameter
|
||||
{
|
||||
/// <summary>
|
||||
///store the family type name
|
||||
/// </summary>
|
||||
String m_type = String.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// store the height of opening
|
||||
/// </summary>
|
||||
double m_height = 0.0;
|
||||
|
||||
/// <summary>
|
||||
/// store the width of opening
|
||||
/// </summary>
|
||||
double m_width = 0.0;
|
||||
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// get/set the Type property
|
||||
/// </summary>
|
||||
public String Type
|
||||
{
|
||||
set
|
||||
{
|
||||
m_type = value;
|
||||
}
|
||||
get
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get/set the Height property
|
||||
/// </summary>
|
||||
public double Height
|
||||
{
|
||||
set
|
||||
{
|
||||
m_height = value;
|
||||
}
|
||||
get
|
||||
{
|
||||
return m_height;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get/set the Width property
|
||||
/// </summary>
|
||||
public double Width
|
||||
{
|
||||
set
|
||||
{
|
||||
m_width = value;
|
||||
}
|
||||
get
|
||||
{
|
||||
return m_width;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// constructor of WindowParameter
|
||||
/// </summary>
|
||||
/// <param name="isMetric">indicate whether the template is metric or imperial</param>
|
||||
public WindowParameter(bool isMetric)
|
||||
{
|
||||
if (isMetric)
|
||||
{
|
||||
m_type = "NewType";
|
||||
m_height = 1000;
|
||||
m_width = 500;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_type = "NewType";
|
||||
m_height = 4.0;
|
||||
m_width = 2.0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// construcion of WindowParameter
|
||||
/// </summary>
|
||||
/// <param name="para">the WindowParameter</param>
|
||||
public WindowParameter(WindowParameter para)
|
||||
{
|
||||
if (String.IsNullOrEmpty(para.m_type))
|
||||
{
|
||||
m_type = "NewType";
|
||||
}
|
||||
m_type = para.Type + "1";
|
||||
m_height = para.Height;
|
||||
m_width = para.Width;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class is used to deal with wizard parameters
|
||||
/// </summary>
|
||||
public class WizardParameter
|
||||
{
|
||||
// ToDo add properties for them
|
||||
|
||||
/// <summary>
|
||||
/// store the template name
|
||||
/// </summary>
|
||||
public String m_template = String.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// store the current WindowParameter
|
||||
/// </summary>
|
||||
private WindowParameter m_curPara = new WindowParameter(true);
|
||||
|
||||
/// <summary>
|
||||
/// store the windowparameter hashtable
|
||||
/// </summary>
|
||||
Hashtable m_winParas = new Hashtable();
|
||||
|
||||
/// <summary>
|
||||
/// store the frame material list
|
||||
/// </summary>
|
||||
private List<String> m_frameMats = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// store the glass material list
|
||||
/// </summary>
|
||||
private List<String> m_GlassMats = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// store the glass material
|
||||
/// </summary>
|
||||
String m_glassMat = String.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// store the sash material
|
||||
/// </summary>
|
||||
String m_sashMat = String.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// store the ValidateWindowParameter
|
||||
/// </summary>
|
||||
private ValidateWindowParameter m_validator = new ValidateWindowParameter(10, 10);
|
||||
|
||||
/// <summary>
|
||||
/// store the temp path
|
||||
/// </summary>
|
||||
private String m_pathName = System.IO.Path.GetTempPath();
|
||||
|
||||
#region
|
||||
/// <summary>
|
||||
/// get/set Validator property
|
||||
/// </summary>
|
||||
public ValidateWindowParameter Validator
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_validator;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_validator = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get/set FrameMaterials property
|
||||
/// </summary>
|
||||
public List<String> FrameMaterials
|
||||
{
|
||||
set
|
||||
{
|
||||
m_frameMats = value;
|
||||
}
|
||||
get
|
||||
{
|
||||
return m_frameMats;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get/set GlassMaterials property
|
||||
/// </summary>
|
||||
public List<String> GlassMaterials
|
||||
{
|
||||
set
|
||||
{
|
||||
m_GlassMats = value;
|
||||
}
|
||||
get
|
||||
{
|
||||
return m_GlassMats;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get/set GlassMat property
|
||||
/// </summary>
|
||||
public String GlassMat
|
||||
{
|
||||
set
|
||||
{
|
||||
m_glassMat = value;
|
||||
}
|
||||
get
|
||||
{
|
||||
return m_glassMat;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get/set SashMat property
|
||||
/// </summary>
|
||||
public String SashMat
|
||||
{
|
||||
set
|
||||
{
|
||||
m_sashMat = value;
|
||||
}
|
||||
get
|
||||
{
|
||||
return m_sashMat;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get/set WinParaTab property
|
||||
/// </summary>
|
||||
public Hashtable WinParaTab
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_winParas;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_winParas = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get/set CurrentPara property
|
||||
/// </summary>
|
||||
public WindowParameter CurrentPara
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_curPara;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_curPara = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get/set PathName property
|
||||
/// </summary>
|
||||
public String PathName
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_pathName;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_pathName = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class inherits from WindowParameter
|
||||
/// </summary>
|
||||
public class DoubleHungWinPara : WindowParameter
|
||||
{
|
||||
/// <summary>
|
||||
/// store the m_inset
|
||||
/// </summary>
|
||||
double m_inset = 0.0;
|
||||
|
||||
/// <summary>
|
||||
/// store the m_sillHeight
|
||||
/// </summary>
|
||||
double m_sillHeight = 0.0;
|
||||
|
||||
#region
|
||||
/// <summary>
|
||||
/// set/get Inset property
|
||||
/// </summary>
|
||||
public double Inset
|
||||
{
|
||||
set
|
||||
{
|
||||
m_inset = value;
|
||||
}
|
||||
get
|
||||
{
|
||||
return m_inset;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// set/get SillHeight property
|
||||
/// </summary>
|
||||
public double SillHeight
|
||||
{
|
||||
set
|
||||
{
|
||||
m_sillHeight = value;
|
||||
}
|
||||
get
|
||||
{
|
||||
return m_sillHeight;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// constructor of DoubleHungWinPara
|
||||
/// </summary>
|
||||
/// <param name="isMetric">indicate whether the template is metric of imperial</param>
|
||||
public DoubleHungWinPara(bool isMetric)
|
||||
: base(isMetric)
|
||||
{
|
||||
if (isMetric)
|
||||
{
|
||||
m_inset = 20;
|
||||
m_sillHeight = 800;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_inset = 0.05;
|
||||
m_sillHeight = 3;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// constructor of DoubleHungWinPara
|
||||
/// </summary>
|
||||
/// <param name="dbhungPara">DoubleHungWinPara</param>
|
||||
public DoubleHungWinPara(DoubleHungWinPara dbhungPara)
|
||||
: base(dbhungPara)
|
||||
{
|
||||
m_inset = dbhungPara.Inset;
|
||||
m_sillHeight = dbhungPara.SillHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RevitAddIns>
|
||||
<AddIn Type="Command">
|
||||
<Assembly>WindowWizard.dll</Assembly>
|
||||
<ClientId>c903482e-5d62-4323-8908-f6acfc66c767</ClientId>
|
||||
<FullClassName>Revit.SDK.Samples.WindowWizard.CS.Command</FullClassName>
|
||||
<Text>WindowWizard</Text>
|
||||
<Description>This command is to create window family via wizard</Description>
|
||||
<VisibilityMode>AlwaysVisible</VisibilityMode>
|
||||
<VendorId>ADSK</VendorId>
|
||||
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
|
||||
</AddIn>
|
||||
</RevitAddIns>
|
||||
@@ -1,103 +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.Windows.Forms;
|
||||
using Autodesk.Revit;
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
namespace Revit.SDK.Samples.WindowWizard.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// The class is used to create window wizard form
|
||||
/// </summary>
|
||||
public class WindowWizard
|
||||
{
|
||||
/// <summary>
|
||||
/// store the WizardParameter
|
||||
/// </summary>
|
||||
private WizardParameter m_para;
|
||||
|
||||
/// <summary>
|
||||
/// store the WindowCreation
|
||||
/// </summary>
|
||||
private WindowCreation m_winCreator;
|
||||
|
||||
/// <summary>
|
||||
/// store the ExternalCommandData
|
||||
/// </summary>
|
||||
private ExternalCommandData m_commandData;
|
||||
|
||||
/// <summary>
|
||||
/// constructor of WindowWizard
|
||||
/// </summary>
|
||||
/// <param name="commandData">the ExternalCommandData parameter</param>
|
||||
public WindowWizard(ExternalCommandData commandData)
|
||||
{
|
||||
m_commandData = commandData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// the method is used to show wizard form and do the creation
|
||||
/// </summary>
|
||||
/// <returns>the process result</returns>
|
||||
public int RunWizard()
|
||||
{
|
||||
int result = 0;
|
||||
m_para = new WizardParameter();
|
||||
m_para.m_template = "DoubleHung";
|
||||
if (m_para.m_template == "DoubleHung")
|
||||
{
|
||||
m_winCreator = new DoubleHungWinCreation(m_para, m_commandData);
|
||||
}
|
||||
using (WizardForm form = new WizardForm(m_para))
|
||||
{
|
||||
switch(form.ShowDialog())
|
||||
{
|
||||
case DialogResult.Cancel:
|
||||
result=0;
|
||||
break;
|
||||
case DialogResult.OK:
|
||||
if (Creation())
|
||||
result = 1;
|
||||
else
|
||||
result = -1;
|
||||
break;
|
||||
default :
|
||||
result=-1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The window creation process
|
||||
/// </summary>
|
||||
/// <returns>the result</returns>
|
||||
private bool Creation()
|
||||
{
|
||||
return m_winCreator.Creation();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,113 +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>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{4E7A12AC-56C6-4A73-8F03-404FAB98CC06}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>WindowWizard</RootNamespace>
|
||||
<AssemblyName>WindowWizard</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkSubset>
|
||||
</TargetFrameworkSubset>
|
||||
<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>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<DocumentationFile>bin\Debug\WindowWizard.XML</DocumentationFile>
|
||||
</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>
|
||||
<DocumentationFile>bin\Debug\WindowWizard.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.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Command.cs" />
|
||||
<Compile Include="CreatAlignment.cs" />
|
||||
<Compile Include="CreateDimension.cs" />
|
||||
<Compile Include="CreateExtrusion.cs" />
|
||||
<Compile Include="DoubleHungWinCreation.cs" />
|
||||
<Compile Include="GeoHelper.cs" />
|
||||
<Compile Include="CreateReferencePlane.cs" />
|
||||
<Compile Include="Utility.cs" />
|
||||
<Compile Include="ValidateWindowParameter.cs" />
|
||||
<Compile Include="WindowCreation.cs" />
|
||||
<Compile Include="WindowParameter.cs" />
|
||||
<Compile Include="WindowWizard.cs" />
|
||||
<Compile Include="WizardUI.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="WizardUI.Designer.cs">
|
||||
<DependentUpon>WizardUI.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="WizardUI.resx">
|
||||
<DependentUpon>WizardUI.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</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>
|
||||
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
|
||||
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,506 +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.
|
||||
//
|
||||
|
||||
namespace Revit.SDK.Samples.WindowWizard.CS
|
||||
{
|
||||
partial class WizardForm
|
||||
{
|
||||
/// <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.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WizardForm));
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.Step3_MemberSizes = new System.Windows.Forms.GroupBox();
|
||||
this.Step3_DiagonalsLable = new System.Windows.Forms.Label();
|
||||
this.Step3_TopChordLable = new System.Windows.Forms.Label();
|
||||
this.m_WinType = new System.Windows.Forms.ComboBox();
|
||||
this.m_unitSys = new System.Windows.Forms.ComboBox();
|
||||
this.Step1_Steps = new System.Windows.Forms.GroupBox();
|
||||
this.InputPathLabel = new System.Windows.Forms.Label();
|
||||
this.WindowPropertyLabel = new System.Windows.Forms.Label();
|
||||
this.InputDimensionLabel = new System.Windows.Forms.Label();
|
||||
this.Step1_HelpLable = new System.Windows.Forms.Label();
|
||||
this.Step1_HelpButton = new System.Windows.Forms.Button();
|
||||
this.SelectTypeLabel = new System.Windows.Forms.Label();
|
||||
this.Step1_NextButton = new System.Windows.Forms.Button();
|
||||
this.Step1_BackButton = new System.Windows.Forms.Button();
|
||||
this.Step1_CancelButton = new System.Windows.Forms.Button();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.m_comboType = new System.Windows.Forms.ComboBox();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.button_duplicateType = new System.Windows.Forms.Button();
|
||||
this.button_newType = new System.Windows.Forms.Button();
|
||||
this.m_sillHeight = new System.Windows.Forms.TextBox();
|
||||
this.m_inset = new System.Windows.Forms.TextBox();
|
||||
this.m_width = new System.Windows.Forms.TextBox();
|
||||
this.m_height = new System.Windows.Forms.TextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.panel3 = new System.Windows.Forms.Panel();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.m_sashMat = new System.Windows.Forms.ComboBox();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
this.m_glassMat = new System.Windows.Forms.ComboBox();
|
||||
this.panel4 = new System.Windows.Forms.Panel();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.m_buttonBrowser = new System.Windows.Forms.Button();
|
||||
this.m_pathName = new System.Windows.Forms.TextBox();
|
||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||
this.panel1.SuspendLayout();
|
||||
this.Step3_MemberSizes.SuspendLayout();
|
||||
this.Step1_Steps.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.panel3.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.panel4.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.Step3_MemberSizes);
|
||||
resources.ApplyResources(this.panel1, "panel1");
|
||||
this.panel1.Name = "panel1";
|
||||
//
|
||||
// Step3_MemberSizes
|
||||
//
|
||||
this.Step3_MemberSizes.Controls.Add(this.Step3_DiagonalsLable);
|
||||
this.Step3_MemberSizes.Controls.Add(this.Step3_TopChordLable);
|
||||
this.Step3_MemberSizes.Controls.Add(this.m_WinType);
|
||||
this.Step3_MemberSizes.Controls.Add(this.m_unitSys);
|
||||
this.Step3_MemberSizes.ForeColor = System.Drawing.Color.Blue;
|
||||
resources.ApplyResources(this.Step3_MemberSizes, "Step3_MemberSizes");
|
||||
this.Step3_MemberSizes.Name = "Step3_MemberSizes";
|
||||
this.Step3_MemberSizes.TabStop = false;
|
||||
//
|
||||
// Step3_DiagonalsLable
|
||||
//
|
||||
resources.ApplyResources(this.Step3_DiagonalsLable, "Step3_DiagonalsLable");
|
||||
this.Step3_DiagonalsLable.ForeColor = System.Drawing.Color.Blue;
|
||||
this.Step3_DiagonalsLable.Name = "Step3_DiagonalsLable";
|
||||
//
|
||||
// Step3_TopChordLable
|
||||
//
|
||||
resources.ApplyResources(this.Step3_TopChordLable, "Step3_TopChordLable");
|
||||
this.Step3_TopChordLable.ForeColor = System.Drawing.Color.Blue;
|
||||
this.Step3_TopChordLable.Name = "Step3_TopChordLable";
|
||||
//
|
||||
// m_WinType
|
||||
//
|
||||
this.m_WinType.FormattingEnabled = true;
|
||||
this.m_WinType.Items.AddRange(new object[] {
|
||||
resources.GetString("m_WinType.Items"),
|
||||
resources.GetString("m_WinType.Items1")});
|
||||
resources.ApplyResources(this.m_WinType, "m_WinType");
|
||||
this.m_WinType.Name = "m_WinType";
|
||||
//
|
||||
// m_unitSys
|
||||
//
|
||||
this.m_unitSys.FormattingEnabled = true;
|
||||
this.m_unitSys.Items.AddRange(new object[] {
|
||||
resources.GetString("m_unitSys.Items"),
|
||||
resources.GetString("m_unitSys.Items1")});
|
||||
resources.ApplyResources(this.m_unitSys, "m_unitSys");
|
||||
this.m_unitSys.Name = "m_unitSys";
|
||||
this.m_unitSys.Tag = "";
|
||||
//
|
||||
// Step1_Steps
|
||||
//
|
||||
this.Step1_Steps.Controls.Add(this.InputPathLabel);
|
||||
this.Step1_Steps.Controls.Add(this.WindowPropertyLabel);
|
||||
this.Step1_Steps.Controls.Add(this.InputDimensionLabel);
|
||||
this.Step1_Steps.Controls.Add(this.Step1_HelpLable);
|
||||
this.Step1_Steps.Controls.Add(this.Step1_HelpButton);
|
||||
this.Step1_Steps.Controls.Add(this.SelectTypeLabel);
|
||||
this.Step1_Steps.ForeColor = System.Drawing.Color.Blue;
|
||||
resources.ApplyResources(this.Step1_Steps, "Step1_Steps");
|
||||
this.Step1_Steps.Name = "Step1_Steps";
|
||||
this.Step1_Steps.TabStop = false;
|
||||
//
|
||||
// InputPathLabel
|
||||
//
|
||||
resources.ApplyResources(this.InputPathLabel, "InputPathLabel");
|
||||
this.InputPathLabel.ForeColor = System.Drawing.Color.Gray;
|
||||
this.InputPathLabel.Name = "InputPathLabel";
|
||||
//
|
||||
// WindowPropertyLabel
|
||||
//
|
||||
resources.ApplyResources(this.WindowPropertyLabel, "WindowPropertyLabel");
|
||||
this.WindowPropertyLabel.ForeColor = System.Drawing.Color.Gray;
|
||||
this.WindowPropertyLabel.Name = "WindowPropertyLabel";
|
||||
//
|
||||
// InputDimensionLabel
|
||||
//
|
||||
resources.ApplyResources(this.InputDimensionLabel, "InputDimensionLabel");
|
||||
this.InputDimensionLabel.ForeColor = System.Drawing.Color.Black;
|
||||
this.InputDimensionLabel.Name = "InputDimensionLabel";
|
||||
//
|
||||
// Step1_HelpLable
|
||||
//
|
||||
resources.ApplyResources(this.Step1_HelpLable, "Step1_HelpLable");
|
||||
this.Step1_HelpLable.ForeColor = System.Drawing.Color.Black;
|
||||
this.Step1_HelpLable.Name = "Step1_HelpLable";
|
||||
//
|
||||
// Step1_HelpButton
|
||||
//
|
||||
resources.ApplyResources(this.Step1_HelpButton, "Step1_HelpButton");
|
||||
this.Step1_HelpButton.Name = "Step1_HelpButton";
|
||||
this.Step1_HelpButton.UseVisualStyleBackColor = true;
|
||||
this.Step1_HelpButton.Click += new System.EventHandler(this.Step1_HelpButton_Click);
|
||||
//
|
||||
// SelectTypeLabel
|
||||
//
|
||||
resources.ApplyResources(this.SelectTypeLabel, "SelectTypeLabel");
|
||||
this.SelectTypeLabel.ForeColor = System.Drawing.Color.Black;
|
||||
this.SelectTypeLabel.Name = "SelectTypeLabel";
|
||||
//
|
||||
// Step1_NextButton
|
||||
//
|
||||
resources.ApplyResources(this.Step1_NextButton, "Step1_NextButton");
|
||||
this.Step1_NextButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.Step1_NextButton.Name = "Step1_NextButton";
|
||||
this.Step1_NextButton.UseVisualStyleBackColor = true;
|
||||
this.Step1_NextButton.Click += new System.EventHandler(this.Step1_NextButton_Click);
|
||||
//
|
||||
// Step1_BackButton
|
||||
//
|
||||
resources.ApplyResources(this.Step1_BackButton, "Step1_BackButton");
|
||||
this.Step1_BackButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.Step1_BackButton.Name = "Step1_BackButton";
|
||||
this.Step1_BackButton.UseVisualStyleBackColor = true;
|
||||
this.Step1_BackButton.Click += new System.EventHandler(this.Step1_BackButton_Click);
|
||||
//
|
||||
// Step1_CancelButton
|
||||
//
|
||||
resources.ApplyResources(this.Step1_CancelButton, "Step1_CancelButton");
|
||||
this.Step1_CancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.Step1_CancelButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.Step1_CancelButton.Name = "Step1_CancelButton";
|
||||
this.Step1_CancelButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
resources.ApplyResources(this.label2, "label2");
|
||||
this.label2.ForeColor = System.Drawing.Color.Blue;
|
||||
this.label2.Name = "label2";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
resources.ApplyResources(this.label3, "label3");
|
||||
this.label3.ForeColor = System.Drawing.Color.Blue;
|
||||
this.label3.Name = "label3";
|
||||
//
|
||||
// m_comboType
|
||||
//
|
||||
this.m_comboType.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.m_comboType, "m_comboType");
|
||||
this.m_comboType.Name = "m_comboType";
|
||||
this.m_comboType.SelectedIndexChanged += new System.EventHandler(this.m_comboType_SelectedIndexChanged);
|
||||
this.m_comboType.Leave += new System.EventHandler(this.m_comboType_Leave);
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.Controls.Add(this.groupBox1);
|
||||
resources.ApplyResources(this.panel2, "panel2");
|
||||
this.panel2.Name = "panel2";
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.button_duplicateType);
|
||||
this.groupBox1.Controls.Add(this.button_newType);
|
||||
this.groupBox1.Controls.Add(this.m_sillHeight);
|
||||
this.groupBox1.Controls.Add(this.m_inset);
|
||||
this.groupBox1.Controls.Add(this.m_width);
|
||||
this.groupBox1.Controls.Add(this.m_height);
|
||||
this.groupBox1.Controls.Add(this.label6);
|
||||
this.groupBox1.Controls.Add(this.label5);
|
||||
this.groupBox1.Controls.Add(this.label4);
|
||||
this.groupBox1.Controls.Add(this.label2);
|
||||
this.groupBox1.Controls.Add(this.label3);
|
||||
this.groupBox1.Controls.Add(this.m_comboType);
|
||||
this.groupBox1.ForeColor = System.Drawing.Color.Blue;
|
||||
resources.ApplyResources(this.groupBox1, "groupBox1");
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.TabStop = false;
|
||||
//
|
||||
// button_duplicateType
|
||||
//
|
||||
this.button_duplicateType.BackColor = System.Drawing.SystemColors.Control;
|
||||
resources.ApplyResources(this.button_duplicateType, "button_duplicateType");
|
||||
this.button_duplicateType.ForeColor = System.Drawing.SystemColors.GradientActiveCaption;
|
||||
this.button_duplicateType.Name = "button_duplicateType";
|
||||
this.button_duplicateType.Tag = "";
|
||||
this.button_duplicateType.UseVisualStyleBackColor = false;
|
||||
this.button_duplicateType.Click += new System.EventHandler(this.button_duplicateType_Click);
|
||||
//
|
||||
// button_newType
|
||||
//
|
||||
resources.ApplyResources(this.button_newType, "button_newType");
|
||||
this.button_newType.ForeColor = System.Drawing.SystemColors.GradientActiveCaption;
|
||||
this.button_newType.Name = "button_newType";
|
||||
this.button_newType.UseVisualStyleBackColor = false;
|
||||
this.button_newType.Click += new System.EventHandler(this.button_newType_Click);
|
||||
//
|
||||
// m_sillHeight
|
||||
//
|
||||
resources.ApplyResources(this.m_sillHeight, "m_sillHeight");
|
||||
this.m_sillHeight.Name = "m_sillHeight";
|
||||
this.m_sillHeight.TextChanged += new System.EventHandler(this.m_sillHeight_TextChanged);
|
||||
this.m_sillHeight.Leave += new System.EventHandler(this.m_sillHeight_Leave);
|
||||
//
|
||||
// m_inset
|
||||
//
|
||||
resources.ApplyResources(this.m_inset, "m_inset");
|
||||
this.m_inset.Name = "m_inset";
|
||||
this.m_inset.TextChanged += new System.EventHandler(this.m_inset_TextChanged);
|
||||
this.m_inset.Leave += new System.EventHandler(this.m_inset_Leave);
|
||||
//
|
||||
// m_width
|
||||
//
|
||||
resources.ApplyResources(this.m_width, "m_width");
|
||||
this.m_width.Name = "m_width";
|
||||
this.m_width.TextChanged += new System.EventHandler(this.m_width_TextChanged);
|
||||
this.m_width.Leave += new System.EventHandler(this.m_width_Leave);
|
||||
//
|
||||
// m_height
|
||||
//
|
||||
resources.ApplyResources(this.m_height, "m_height");
|
||||
this.m_height.Name = "m_height";
|
||||
this.m_height.TextChanged += new System.EventHandler(this.m_height_TextChanged);
|
||||
this.m_height.Leave += new System.EventHandler(this.m_height_Leave);
|
||||
//
|
||||
// label6
|
||||
//
|
||||
resources.ApplyResources(this.label6, "label6");
|
||||
this.label6.ForeColor = System.Drawing.Color.Blue;
|
||||
this.label6.Name = "label6";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
resources.ApplyResources(this.label5, "label5");
|
||||
this.label5.ForeColor = System.Drawing.Color.Blue;
|
||||
this.label5.Name = "label5";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
resources.ApplyResources(this.label4, "label4");
|
||||
this.label4.ForeColor = System.Drawing.Color.Blue;
|
||||
this.label4.Name = "label4";
|
||||
//
|
||||
// panel3
|
||||
//
|
||||
this.panel3.Controls.Add(this.groupBox2);
|
||||
resources.ApplyResources(this.panel3, "panel3");
|
||||
this.panel3.Name = "panel3";
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.label7);
|
||||
this.groupBox2.Controls.Add(this.m_sashMat);
|
||||
this.groupBox2.Controls.Add(this.label11);
|
||||
this.groupBox2.Controls.Add(this.m_glassMat);
|
||||
this.groupBox2.ForeColor = System.Drawing.Color.Blue;
|
||||
resources.ApplyResources(this.groupBox2, "groupBox2");
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.TabStop = false;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
resources.ApplyResources(this.label7, "label7");
|
||||
this.label7.ForeColor = System.Drawing.Color.Blue;
|
||||
this.label7.Name = "label7";
|
||||
//
|
||||
// m_sashMat
|
||||
//
|
||||
this.m_sashMat.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.m_sashMat, "m_sashMat");
|
||||
this.m_sashMat.Name = "m_sashMat";
|
||||
this.m_sashMat.SelectedIndexChanged += new System.EventHandler(this.m_sashMat_SelectedIndexChanged);
|
||||
//
|
||||
// label11
|
||||
//
|
||||
resources.ApplyResources(this.label11, "label11");
|
||||
this.label11.ForeColor = System.Drawing.Color.Blue;
|
||||
this.label11.Name = "label11";
|
||||
//
|
||||
// m_glassMat
|
||||
//
|
||||
this.m_glassMat.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.m_glassMat, "m_glassMat");
|
||||
this.m_glassMat.Name = "m_glassMat";
|
||||
this.m_glassMat.SelectedIndexChanged += new System.EventHandler(this.m_glassMat_SelectedIndexChanged);
|
||||
//
|
||||
// panel4
|
||||
//
|
||||
this.panel4.Controls.Add(this.groupBox3);
|
||||
resources.ApplyResources(this.panel4, "panel4");
|
||||
this.panel4.Name = "panel4";
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.m_buttonBrowser);
|
||||
this.groupBox3.Controls.Add(this.m_pathName);
|
||||
this.groupBox3.Controls.Add(this.dataGridView1);
|
||||
this.groupBox3.ForeColor = System.Drawing.Color.Blue;
|
||||
resources.ApplyResources(this.groupBox3, "groupBox3");
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.TabStop = false;
|
||||
//
|
||||
// m_buttonBrowser
|
||||
//
|
||||
this.m_buttonBrowser.ForeColor = System.Drawing.Color.Black;
|
||||
resources.ApplyResources(this.m_buttonBrowser, "m_buttonBrowser");
|
||||
this.m_buttonBrowser.Name = "m_buttonBrowser";
|
||||
this.m_buttonBrowser.UseVisualStyleBackColor = true;
|
||||
this.m_buttonBrowser.Click += new System.EventHandler(this.m_buttonBrowser_Click);
|
||||
//
|
||||
// m_pathName
|
||||
//
|
||||
resources.ApplyResources(this.m_pathName, "m_pathName");
|
||||
this.m_pathName.Name = "m_pathName";
|
||||
//
|
||||
// dataGridView1
|
||||
//
|
||||
this.dataGridView1.AllowUserToResizeRows = false;
|
||||
this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells;
|
||||
this.dataGridView1.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells;
|
||||
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
|
||||
resources.ApplyResources(this.dataGridView1, "dataGridView1");
|
||||
this.dataGridView1.MultiSelect = false;
|
||||
this.dataGridView1.Name = "dataGridView1";
|
||||
this.dataGridView1.ReadOnly = true;
|
||||
this.dataGridView1.RowHeadersVisible = false;
|
||||
this.dataGridView1.RowTemplate.Height = 24;
|
||||
//
|
||||
// WizardForm
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
|
||||
this.CancelButton = this.Step1_CancelButton;
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.Controls.Add(this.Step1_NextButton);
|
||||
this.Controls.Add(this.Step1_BackButton);
|
||||
this.Controls.Add(this.Step1_Steps);
|
||||
this.Controls.Add(this.Step1_CancelButton);
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Controls.Add(this.panel3);
|
||||
this.Controls.Add(this.panel4);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "WizardForm";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.Step3_MemberSizes.ResumeLayout(false);
|
||||
this.Step3_MemberSizes.PerformLayout();
|
||||
this.Step1_Steps.ResumeLayout(false);
|
||||
this.Step1_Steps.PerformLayout();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.panel3.ResumeLayout(false);
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.panel4.ResumeLayout(false);
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox3.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.GroupBox Step1_Steps;
|
||||
private System.Windows.Forms.Label Step1_HelpLable;
|
||||
private System.Windows.Forms.Button Step1_HelpButton;
|
||||
private System.Windows.Forms.Label WindowPropertyLabel;
|
||||
private System.Windows.Forms.Label InputDimensionLabel;
|
||||
private System.Windows.Forms.Label SelectTypeLabel;
|
||||
private System.Windows.Forms.Button Step1_NextButton;
|
||||
private System.Windows.Forms.Label InputPathLabel;
|
||||
private System.Windows.Forms.Button Step1_BackButton;
|
||||
private System.Windows.Forms.Button Step1_CancelButton;
|
||||
private System.Windows.Forms.GroupBox Step3_MemberSizes;
|
||||
private System.Windows.Forms.Label Step3_DiagonalsLable;
|
||||
private System.Windows.Forms.Label Step3_TopChordLable;
|
||||
private System.Windows.Forms.ComboBox m_WinType;
|
||||
private System.Windows.Forms.ComboBox m_unitSys;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.ComboBox m_comboType;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.TextBox m_sillHeight;
|
||||
private System.Windows.Forms.TextBox m_inset;
|
||||
private System.Windows.Forms.TextBox m_width;
|
||||
private System.Windows.Forms.TextBox m_height;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Panel panel3;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.ComboBox m_sashMat;
|
||||
private System.Windows.Forms.Label label11;
|
||||
private System.Windows.Forms.ComboBox m_glassMat;
|
||||
private System.Windows.Forms.Button button_newType;
|
||||
private System.Windows.Forms.Button button_duplicateType;
|
||||
private System.Windows.Forms.Panel panel4;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.DataGridView dataGridView1;
|
||||
private System.Windows.Forms.Button m_buttonBrowser;
|
||||
private System.Windows.Forms.TextBox m_pathName;
|
||||
}
|
||||
}
|
||||
@@ -1,550 +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.Drawing;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Revit.SDK.Samples.WindowWizard.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// The wizard form
|
||||
/// </summary>
|
||||
public partial class WizardForm : System.Windows.Forms.Form
|
||||
{
|
||||
#region Class Memeber Variables
|
||||
/// <summary>
|
||||
/// store the wizard parameter
|
||||
/// </summary>
|
||||
WizardParameter m_para;
|
||||
|
||||
/// <summary>
|
||||
/// store the family types list
|
||||
/// </summary>
|
||||
List<String> m_types = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// store the bindSource
|
||||
/// </summary>
|
||||
BindingSource bindSource = new BindingSource();
|
||||
|
||||
/// <summary>
|
||||
/// store the new type button tooltip
|
||||
/// </summary>
|
||||
ToolTip m_newTip = new ToolTip();
|
||||
|
||||
/// <summary>
|
||||
/// store the copy type button tooltip
|
||||
/// </summary>
|
||||
ToolTip m_copyTip = new ToolTip();
|
||||
|
||||
/// <summary>
|
||||
/// store the error tooltip
|
||||
/// </summary>
|
||||
ToolTip m_errorTip = new ToolTip();
|
||||
|
||||
/// <summary>
|
||||
/// store the font
|
||||
/// </summary>
|
||||
Font m_highFont, m_commonFont;
|
||||
|
||||
/// <summary>
|
||||
/// store DoubleHungWinPara list
|
||||
/// </summary>
|
||||
BindingList<DoubleHungWinPara> paraList = new BindingList<DoubleHungWinPara>();
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// constructor of WizardForm
|
||||
/// </summary>
|
||||
/// <param name="para">the WizardParameter</param>
|
||||
public WizardForm(WizardParameter para)
|
||||
{
|
||||
m_para = para;
|
||||
InitializeComponent();
|
||||
InitializePara();
|
||||
m_newTip.SetToolTip(button_newType, "Add new type");
|
||||
m_copyTip.SetToolTip(button_duplicateType, "Duplicate the type");
|
||||
m_errorTip.ShowAlways = false;
|
||||
m_highFont = InputDimensionLabel.Font;
|
||||
m_commonFont = WindowPropertyLabel.Font;
|
||||
SetPanelVisibility(2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The nextbutton click function
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void Step1_NextButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.panel1.Visible)
|
||||
{
|
||||
InitializePara();
|
||||
SetPanelVisibility(2);
|
||||
}
|
||||
else if (this.panel2.Visible)
|
||||
{
|
||||
transforData();
|
||||
SetPanelVisibility(3);
|
||||
}
|
||||
else if (this.panel3.Visible)
|
||||
{
|
||||
SetPanelVisibility(4);
|
||||
SetGridData();
|
||||
}
|
||||
else if (this.panel4.Visible)
|
||||
{
|
||||
m_para.PathName = this.m_pathName.Text;
|
||||
this.DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// set panel visibility
|
||||
/// </summary>
|
||||
/// <param name="panelNum">panel number</param>
|
||||
private void SetPanelVisibility(int panelNum)
|
||||
{
|
||||
switch (panelNum)
|
||||
{
|
||||
case 1:
|
||||
this.panel1.Visible = true;
|
||||
this.panel2.Visible = false;
|
||||
this.panel3.Visible = false;
|
||||
this.panel4.Visible = false;
|
||||
this.Step1_BackButton.Enabled = false;
|
||||
break;
|
||||
case 2:
|
||||
this.panel1.Visible = false;
|
||||
this.panel2.Visible = true;
|
||||
this.panel3.Visible = false;
|
||||
this.panel4.Visible = false;
|
||||
this.Step1_BackButton.Enabled = false;
|
||||
this.InputDimensionLabel.ForeColor = System.Drawing.Color.Black;
|
||||
this.InputDimensionLabel.Font = m_highFont;
|
||||
this.WindowPropertyLabel.ForeColor = System.Drawing.Color.Gray;
|
||||
this.WindowPropertyLabel.Font = m_commonFont;
|
||||
this.InputPathLabel.ForeColor = System.Drawing.Color.Gray;
|
||||
this.InputPathLabel.Font = m_commonFont;
|
||||
break;
|
||||
case 3:
|
||||
this.panel3.Visible = true;
|
||||
this.panel1.Visible = false;
|
||||
this.panel2.Visible = false;
|
||||
this.panel4.Visible = false;
|
||||
this.Step1_BackButton.Enabled = true;
|
||||
this.Step1_NextButton.Text = "Next >";
|
||||
this.InputPathLabel.ForeColor = System.Drawing.Color.Gray;
|
||||
this.InputDimensionLabel.Font = m_commonFont;
|
||||
this.WindowPropertyLabel.ForeColor = System.Drawing.Color.Black;
|
||||
this.WindowPropertyLabel.Font = m_highFont;
|
||||
this.InputPathLabel.ForeColor = System.Drawing.Color.Gray;
|
||||
this.InputPathLabel.Font = m_commonFont;
|
||||
break;
|
||||
case 4:
|
||||
this.panel1.Visible = false;
|
||||
this.panel2.Visible = false;
|
||||
this.panel3.Visible = false;
|
||||
this.panel4.Visible = true;
|
||||
this.Step1_BackButton.Enabled = true;
|
||||
this.Step1_NextButton.Text = "Finish";
|
||||
this.InputPathLabel.ForeColor = System.Drawing.Color.Gray;
|
||||
this.InputDimensionLabel.Font = m_commonFont;
|
||||
this.WindowPropertyLabel.ForeColor = System.Drawing.Color.Gray;
|
||||
this.WindowPropertyLabel.Font = m_commonFont;
|
||||
this.InputPathLabel.ForeColor = System.Drawing.Color.Black;
|
||||
this.InputPathLabel.Font = m_highFont;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// the backbutton click function
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void Step1_BackButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.panel2.Visible)
|
||||
{
|
||||
SetPanelVisibility(1);
|
||||
}
|
||||
else if (this.panel3.Visible)
|
||||
{
|
||||
SetPanelVisibility(2);
|
||||
}
|
||||
else if (this.panel4.Visible)
|
||||
{
|
||||
SetPanelVisibility(3);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// transfer data
|
||||
/// </summary>
|
||||
private void transforData()
|
||||
{
|
||||
if (m_para.m_template == "DoubleHung")
|
||||
{
|
||||
DoubleHungWinPara dbhungPara = new DoubleHungWinPara(m_para.Validator.IsMetric);
|
||||
dbhungPara.Height = Convert.ToDouble(m_height.Text);
|
||||
dbhungPara.Width = Convert.ToDouble(m_width.Text);
|
||||
dbhungPara.Inset = Convert.ToDouble(m_inset.Text);
|
||||
dbhungPara.SillHeight = Convert.ToDouble(m_sillHeight.Text);
|
||||
dbhungPara.Type = m_comboType.Text;
|
||||
m_para.CurrentPara = dbhungPara;
|
||||
if (!m_para.WinParaTab.Contains(dbhungPara.Type))
|
||||
{
|
||||
m_para.WinParaTab.Add(dbhungPara.Type, dbhungPara);
|
||||
m_comboType.Items.Add(dbhungPara.Type);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_para.WinParaTab[dbhungPara.Type] = dbhungPara;
|
||||
}
|
||||
}
|
||||
Update();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize data
|
||||
/// </summary>
|
||||
private void InitializePara()
|
||||
{
|
||||
DoubleHungWinPara dbhungPara = new DoubleHungWinPara(m_para.Validator.IsMetric);
|
||||
if (!m_para.WinParaTab.Contains(dbhungPara.Type))
|
||||
{
|
||||
m_para.WinParaTab.Add(dbhungPara.Type, dbhungPara);
|
||||
m_types.Add(dbhungPara.Type);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_para.WinParaTab[dbhungPara.Type] = dbhungPara;
|
||||
}
|
||||
bindSource.DataSource = m_types;
|
||||
this.m_comboType.Items.Add(m_para.CurrentPara.Type);
|
||||
this.m_comboType.SelectedIndex = 0;
|
||||
this.m_glassMat.DataSource = m_para.GlassMaterials;
|
||||
this.m_sashMat.DataSource = m_para.FrameMaterials;
|
||||
this.m_pathName.Text = m_para.PathName;
|
||||
SetParaText(dbhungPara);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The newtype button click function
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void button_newType_Click(object sender, EventArgs e)
|
||||
{
|
||||
transforData();
|
||||
DoubleHungWinPara newPara = new DoubleHungWinPara(m_para.Validator.IsMetric);
|
||||
SetParaText(newPara);
|
||||
this.m_comboType.Focus();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The duplicatebutton click function
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void button_duplicateType_Click(object sender, EventArgs e)
|
||||
{
|
||||
transforData();
|
||||
DoubleHungWinPara copyPara = new DoubleHungWinPara((DoubleHungWinPara)m_para.CurrentPara);
|
||||
SetParaText(copyPara);
|
||||
this.m_comboType.Focus();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// set WindowParameter text
|
||||
/// </summary>
|
||||
/// <param name="para">the WindowParameter</param>
|
||||
private void SetParaText(WindowParameter para)
|
||||
{
|
||||
DoubleHungWinPara dbhungPara = para as DoubleHungWinPara;
|
||||
m_sillHeight.Text = dbhungPara.SillHeight.ToString();
|
||||
m_width.Text = dbhungPara.Width.ToString();
|
||||
m_height.Text = dbhungPara.Height.ToString();
|
||||
m_inset.Text = dbhungPara.Inset.ToString();
|
||||
m_comboType.Text = dbhungPara.Type;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// set grid data
|
||||
/// </summary>
|
||||
private void SetGridData()
|
||||
{
|
||||
paraList.Clear();
|
||||
foreach (String key in m_para.WinParaTab.Keys)
|
||||
{
|
||||
DoubleHungWinPara para = m_para.WinParaTab[key] as DoubleHungWinPara;
|
||||
if (null == para)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
paraList.Add(para);
|
||||
}
|
||||
this.dataGridView1.DataSource = paraList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// m_height textbox's text changed event
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void m_height_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
ValidateInput(m_height);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// m_width textbox's text changed event
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void m_width_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
ValidateInput(m_width);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// m_inset textbox's text changed event
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void m_inset_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
ValidateInput(m_inset);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// m_sillHeight textbox's text changed event
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void m_sillHeight_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
ValidateInput(m_sillHeight);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// m_comboType SelectedIndexChanged event
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void m_comboType_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
m_para.CurrentPara = m_para.WinParaTab[m_comboType.SelectedItem.ToString()] as WindowParameter;
|
||||
SetParaText(m_para.CurrentPara);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// m_glassMat SelectedIndexChanged event
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void m_glassMat_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
m_para.GlassMat = m_glassMat.SelectedItem.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// m_sashMat SelectedIndexChanged event
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void m_sashMat_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
m_para.SashMat = m_sashMat.SelectedItem.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// validate control input value
|
||||
/// </summary>
|
||||
/// <param name="control">the control</param>
|
||||
private bool ValidateInput(Control control)
|
||||
{
|
||||
if (null == control)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (String.IsNullOrEmpty(control.Text))
|
||||
{
|
||||
this.Step1_NextButton.Enabled = false;
|
||||
return false;
|
||||
}
|
||||
TextBox textbox = control as TextBox;
|
||||
if (null == textbox)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
double value = 0.0;
|
||||
String result = m_para.Validator.IsDouble(textbox.Text, ref value);
|
||||
if (!String.IsNullOrEmpty(result))
|
||||
{
|
||||
m_errorTip.SetToolTip(textbox, result);
|
||||
textbox.Text = String.Empty;
|
||||
this.Step1_NextButton.Enabled = false;
|
||||
return false;
|
||||
}
|
||||
m_errorTip.RemoveAll();
|
||||
switch (textbox.Name)
|
||||
{
|
||||
case "m_height":
|
||||
result = m_para.Validator.IsHeightInRange(value);
|
||||
break;
|
||||
case "m_width":
|
||||
result = m_para.Validator.IsWidthInRange(value);
|
||||
break;
|
||||
case "m_inset":
|
||||
result = m_para.Validator.IsInsetInRange(value);
|
||||
break;
|
||||
case "m_sillHeight":
|
||||
result = m_para.Validator.IsSillHeightInRange(value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (!String.IsNullOrEmpty(result))
|
||||
{
|
||||
m_errorTip.SetToolTip(textbox, result);
|
||||
this.Step1_NextButton.Enabled = false;
|
||||
return false;
|
||||
}
|
||||
m_errorTip.RemoveAll();
|
||||
this.Step1_NextButton.Enabled = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// m_buttonBrowser click event
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void m_buttonBrowser_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveFileDialog saveDialog = new SaveFileDialog();
|
||||
saveDialog.CheckPathExists = true;
|
||||
saveDialog.SupportMultiDottedExtensions = true;
|
||||
saveDialog.OverwritePrompt = true;
|
||||
saveDialog.ValidateNames = true;
|
||||
saveDialog.Filter = "Family file(*.rfa)|*.rfa|All files(*.*)|*.*";
|
||||
saveDialog.FilterIndex = 2;
|
||||
if (DialogResult.OK == saveDialog.ShowDialog())
|
||||
{
|
||||
if (!String.IsNullOrEmpty(saveDialog.FileName))
|
||||
{
|
||||
m_pathName.Text = saveDialog.FileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// m_height leave event
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void m_height_Leave(object sender, EventArgs e)
|
||||
{
|
||||
CheckValue(m_height);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// check input
|
||||
/// </summary>
|
||||
/// <param name="control">the host control</param>
|
||||
private void CheckValue(Control control)
|
||||
{
|
||||
if (String.IsNullOrEmpty(control.Text))
|
||||
{
|
||||
control.Focus();
|
||||
m_errorTip.SetToolTip(control, "Please input a valid value");
|
||||
}
|
||||
if (!ValidateInput(control))
|
||||
{
|
||||
control.Focus();
|
||||
control.Text = String.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// m_width leave event
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void m_width_Leave(object sender, EventArgs e)
|
||||
{
|
||||
CheckValue(m_width);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// m_inset leave event
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void m_inset_Leave(object sender, EventArgs e)
|
||||
{
|
||||
CheckValue(m_inset);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// m_sillHeight leave event
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void m_sillHeight_Leave(object sender, EventArgs e)
|
||||
{
|
||||
CheckValue(m_sillHeight);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// m_comboType leave event
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void m_comboType_Leave(object sender, EventArgs e)
|
||||
{
|
||||
CheckValue(m_comboType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Step1_HelpButton click event to open the help document
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void Step1_HelpButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
char sp = System.IO.Path.DirectorySeparatorChar;//{'\\'};
|
||||
path = path.Substring(0, path.LastIndexOf(sp));
|
||||
path = path.Substring(0, path.LastIndexOf(sp)) + sp + "ReadMe_WindowWizard.rtf";
|
||||
System.Diagnostics.Process.Start(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Reference in New Issue
Block a user