nope..still not working...not sure how to solve this..i did try so many way to get the area value..
here are my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.ApplicationServices;
namespace Revit_DialogBox
{
[Transaction(TransactionMode.Automatic)]
public class Class1 : IExternalCommand
{
public Result Execute(ExternalCommandData commandData,
ref string message, ElementSet elements)
{
//Get the application and document from external data.
Application app = commandData.Application.Application;
Document activedoc = commandData.Application.ActiveUIDocument.Document;
//DimensionTypeSet param = commandData.Data.get_Item(Floor);
//Create a Revit task dialog to communicate information to the user.
TaskDialog mainDialog = new TaskDialog("Hello, Revit");
mainDialog.MainInstruction = "Hello, Revit";
mainDialog.MainContent = "This sample shows how to use a Revit task dialog to communicate with the user."
+ "The command links below open additional task dialogs with more information.";
//Add commandLink option to task dialog
mainDialog.AddCommandLink(TaskDialogCommandLinkId.CommandLink1,
"View information about the Revit Installation");
mainDialog.AddCommandLink(TaskDialogCommandLinkId.CommandLink2,
"View information about the active document");
//Set common buttons and default button. if no CommandButton or CommandLink is added,
//task dialog will show a Close button by default.
mainDialog.CommonButtons = TaskDialogCommonButtons.Close;
mainDialog.DefaultButton = TaskDialogResult.Close;
//Set footer text. Footer text is usually used to link to the help document.
mainDialog.FooterText = "<a href=\"http://usa.autodesk.com/\">"
+ "Click here for the Revit API Developer Center</a>";
TaskDialogResult tResult = mainDialog.Show();
//if the user clicks the first command link, a simple Task Dialog
//with only a close button shows information about the Revit installation.
if (TaskDialogResult.CommandLink1 == tResult)
{
TaskDialog dialog_CommandLink1 = new TaskDialog("Revit Build Information");
dialog_CommandLink1.MainInstruction = "Revit Version is: " + app.VersionName + "\n"
+ "Revit Version Number is: " + app.VersionNumber + "\n"
+ "Revit Version Build is: " + app.VersionBuild;
dialog_CommandLink1.Show();
}
//if the user clicks the second command link, a simple Task Dialog
//created by static method shows information about the active document
else if (TaskDialogResult.CommandLink2 == tResult)
{
BuiltInParameter area = BuiltInParameter.MASS_GROSS_AREA;
BuiltInParameter area3 = BuiltInParameter.ZONE_AREA;
BuiltInParameter area4 = BuiltInParameter.LEVEL_DATA_FLOOR_PERIMETER;
BuiltInParameterGroup area5 = BuiltInParameterGroup.PG_AREA;
BuiltInParameter area6 = BuiltInParameter.LEVEL_DATA_FLOOR_AREA;
AreaElemType area1 = AreaElemType.BOMAArea;
ParameterType area2 = ParameterType.Area;
BuiltInParameter area7 = BuiltInParameter.ROOM_AREA;
int iarea = (int)area;
int iarea3 = (int)area3;
int iarea5 = (int)area5;
int iarea6 = (int)area6;
int iarea7 = (int)area7;
Int64 iarea2 = (Int64)area2;
Int64 iarea1 = (Int64)area1;
TaskDialog.Show("Active Document Information",
"Active document: " + activedoc.Title + "\n"
+ "Active view name: " + activedoc.ActiveView.Name + "\n"
+ "Floor Area: " + activedoc.ActiveView.Level + "\n"
+ "Floor Area: " + activedoc.FloorTypes.Size + "\n"
+ "Floor Area: " + iarea1 + "\n"
+ "Floor Area: " + iarea2 + "\n"
+ "Floor Area: " + iarea3 + "\n"
+ "Floor Area: " + area4 + "\n"
+ "Floor Area: " + iarea5 + "\n"
+ "Floor Area: " + iarea6 + "\n"
+ "Floor Area: " + iarea7 + "\n"
+ "Floor Area: " + iarea);
}
return Result.Succeeded;
}
}
}
this is what i get:

not sure what the numbers mean...
thx in advanced
-nik-