added Revit 2022 SDK minus except *rvt and *rfa

This commit is contained in:
Jeremy Tammik
2021-04-20 11:36:21 +02:00
parent 1133a82dc5
commit 7e327986e8
3034 changed files with 1245318 additions and 0 deletions
@@ -0,0 +1,99 @@
//
// (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
}
}
@@ -0,0 +1,81 @@
//
// (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
}
}
@@ -0,0 +1,166 @@
//
// (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
}
}
@@ -0,0 +1,182 @@
//
// (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
}
}
@@ -0,0 +1,72 @@
//
// (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
}
}
@@ -0,0 +1,679 @@
//
// (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", new ForgeTypeId(), SpecTypeId.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
}
}
@@ -0,0 +1,242 @@
//
// (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;
}
}
}
@@ -0,0 +1,36 @@
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")]
@@ -0,0 +1,299 @@
{\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}}
@@ -0,0 +1,133 @@
//
// (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;
}
}
}
@@ -0,0 +1,174 @@
//
// (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
}
}
@@ -0,0 +1,76 @@
//
// (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();
}
}
@@ -0,0 +1,384 @@
//
// (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;
}
}
}
@@ -0,0 +1,13 @@
<?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>
@@ -0,0 +1,103 @@
//
// (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();
}
}
}
@@ -0,0 +1,113 @@
<?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>
@@ -0,0 +1,506 @@
//
// (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;
}
}
@@ -0,0 +1,550 @@
//
// (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.