Application: MeasurePanelArea
Revit Platform: All
Revit Version: 2011.0
First Released For: 2010.0
Programming Language: C#
Skill Level: Beginning
Category: Geometry
Type: ExternalCommand

Subject: Divided surface panel measurement and modification

Summary: 
Measure the area of curtain panels in divided surfaces. Identify panels with area greater than and less than user-specified values. A text file is created in the same folder as the sample DLL file listing the area and element ID of every panel.

Classes: 
	Autodesk.Revit.UI.IExternalCommand
	Autodesk.Revit.DB.DividedSurface
	Autodesk.Revit.DB.Panel

Project Files:

Command.cs
	This file contains the MeasurePanelArea class and is invoked when the external command runs

FormPanelArea.cs
	Creates the user interface and computes the areas in the btnCompute_Click event.

Description: 
1.	Find panel families loaded into the massing family
2.	Create a List containing the selected DividedSurface elements. If no DividedSurface elements are selected, include all DividedSurface elements in the model.
3.	Find all panels in the DividedSurface elements. The panels are FamilyInstance elements returned by the DividedSurface.GetTileFamilyInstance(GridNode, tileIndex) method.
4.	Get the area of each panel using FamilyInstance.get_Geometry(opt)
a.	For partial border panels, get_Geometry returns the panel geometry in a Solid object
b.	For uncut panels, their geometry is found through Instance.SymbolGeometry.Objects
5.	Change the FamilyInstance.Symbol based on the panel area relative to the range specified by the user in the dialog box.

Instructions: 
1.	Create one or more massing forms with divided surface(s) and panels applied to these surfaces
2.	If you don't want to analyze all divided surfaces in the model, select the surfaces of interest.
3.	Run this command
4.	Enter maximum and minimum values to define the range of allowable panel area
5.	Select the panel types to be used to identify panels that are below, above, and within the range.
6.	Push "Compute"