Application: InPlaceMembers
Revit Platform: Structure
Revit Version: 2011.0
First Released For: 9.0
Programming Language: C#
Skill Level: Medium
Category: Families
Type: ExternalCommand

Subject: Display In-place Familyinstance properties.
Summary: 
 This sample demonstrates how to get the In-place Family instance and its properties in the current document of Revit.

Classes: 
Autodesk.Revit.UI.IExternalCommand 
Autodesk.Revit.DB.FamilyInstance
Autodesk.Revit.DB.Structure.AnalyticalModel
Autodesk.Revit.DB.Curve

Project Files: 
Command.cs
This file contains a class Command that implements the IExternalCommand, the function of this class is to Retrieve values of an In-place Family instance’s properties and send the data to UI.

GraphicsData.cs
This file contains a class GraphicsData, the function of this class is to store the AnalyticalModel’s curve points and implements some functionality to operate the Geometry: such as Rotate, Move, etc.

GraphicsDataFactory.cs
This file contains a class GraphicsDataFactory. The class just has a static method CreateGraphicsData to create a GraphicsData object.

PictureBox3D.cs
This file contains a class PictureBox3D, the functionality of this class is to paint the geometry curves of the analytical model contained in a GraphicsData object.

Properties.cs
This file contains a class Properties, this class stores all the properties’ values of FamilyInstance object.
	
InPlaceMembersForm.cs
This file contains a class InPlaceMembersForm, the class inherits from Form and ImessageFilter. It uses a PictureBox3D to paint the analytical model’s curves and a PropertyGrid to show the properties of selected FamilyInstance.

Description:
This sample retrieves the properties’ values of an In-place FamilyInstance, paints the analytical model of FamilyInstance in a PictureBox and shows other properties in a Property Grid. We can get the AnalyticalModel’s profile via Curves property.
	
Instructions: 

1.	Open or new a Revit project and make sure at least one in-place FamilyInstance which contains AnalyticalModel is placed. A sample project file InPlaceMembers.rvt is available in the sample’s folder.
2.	Select an in-place FamilyInstance which contains AnalyticalModel.
3.	Run the command.
4.	The Form will show the AnalyticalModel of the selected FamilyInstance. The geometry can be rotated, moved and scaled via keys: 
-    Rotate (Left, Right, Up, Down, PageUp, PageDown)
-    Move (S, W, A, D) 
-    Scale (Home, End).