mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-08-15 18:14:02 +00:00
added Revit 2022 SDK minus except *rvt and *rfa
This commit is contained in:
@@ -0,0 +1,357 @@
|
||||
//
|
||||
// (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.ApplicationServices;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using Autodesk.Revit.DB.Analysis;
|
||||
|
||||
namespace Revit.SDK.Samples.ProjectInfo.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Implements the Revit add-in interface IExternalCommand
|
||||
/// </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 IExternalCommand Members
|
||||
|
||||
/// <summary>
|
||||
/// Implement this method as an external command for Revit.
|
||||
/// </summary>
|
||||
/// <param name="commandData">An object that is passed to the external application
|
||||
/// which contains data related to the command,
|
||||
/// such as the application object and active view.</param>
|
||||
/// <param name="message">A message that can be set by the external application
|
||||
/// which will be displayed if a failure or cancellation is returned by
|
||||
/// the external command.</param>
|
||||
/// <param name="elements">A set of elements to which the external application
|
||||
/// can add elements that are to be highlighted in case of failure or cancellation.</param>
|
||||
/// <returns>Return the status of the external command.
|
||||
/// A result of Succeeded means that the API external method functioned as expected.
|
||||
/// Cancelled can be used to signify that the user cancelled the external operation
|
||||
/// at some point. Failure should be returned if the application is unable to proceed with
|
||||
/// the operation.</returns>
|
||||
public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements)
|
||||
{
|
||||
// initialize global information
|
||||
RevitStartInfo.RevitApp = commandData.Application.Application;
|
||||
RevitStartInfo.RevitDoc = commandData.Application.ActiveUIDocument.Document;
|
||||
RevitStartInfo.RevitProduct = commandData.Application.Application.Product;
|
||||
|
||||
Transaction transaction = new Transaction(RevitStartInfo.RevitDoc, "ProjectInfo");
|
||||
try
|
||||
{
|
||||
// Start transaction
|
||||
transaction.Start();
|
||||
|
||||
// get current project information
|
||||
Autodesk.Revit.DB.ProjectInfo pi = commandData.Application.ActiveUIDocument.Document.ProjectInformation;
|
||||
|
||||
// show main form
|
||||
using (ProjectInfoForm pif = new ProjectInfoForm(new ProjectInfoWrapper(pi)))
|
||||
{
|
||||
pif.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
if (pif.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
{
|
||||
transaction.Commit();
|
||||
return Result.Succeeded;
|
||||
}
|
||||
else
|
||||
{
|
||||
transaction.RollBack();
|
||||
return Result.Cancelled;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
transaction.RollBack();
|
||||
message = ex.ToString();
|
||||
return Result.Failed;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Preserves global information
|
||||
/// </summary>
|
||||
public static class RevitStartInfo
|
||||
{
|
||||
#region Fields
|
||||
/// <summary>
|
||||
/// Current Revit application
|
||||
/// </summary>
|
||||
public static Application RevitApp;
|
||||
|
||||
/// <summary>
|
||||
/// Active Revit document
|
||||
/// </summary>
|
||||
public static Document RevitDoc;
|
||||
|
||||
/// <summary>
|
||||
/// Current Revit Product
|
||||
/// </summary>
|
||||
public static ProductType RevitProduct;
|
||||
|
||||
/// <summary>
|
||||
/// Time Zone Array
|
||||
/// </summary>
|
||||
public static string[] TimeZones;
|
||||
|
||||
/// <summary>
|
||||
/// BuildingType and its display string map.
|
||||
/// </summary>
|
||||
public static Dictionary<object, string> BuildingTypeMap;
|
||||
|
||||
/// <summary>
|
||||
/// ServiceType and its display string map.
|
||||
/// </summary>
|
||||
public static Dictionary<object, string> ServiceTypeMap;
|
||||
|
||||
/// <summary>
|
||||
/// ExportComplexity and its display string map.
|
||||
/// </summary>
|
||||
public static Dictionary<object, string> ExportComplexityMap;
|
||||
|
||||
/// <summary>
|
||||
/// HVACLoadLoadsReportType and its display string map.
|
||||
/// </summary>
|
||||
public static Dictionary<object, string> HVACLoadLoadsReportTypeMap;
|
||||
|
||||
/// <summary>
|
||||
/// HVACLoadConstructionClass and its display string map.
|
||||
/// </summary>
|
||||
public static Dictionary<object, string> HVACLoadConstructionClassMap;
|
||||
|
||||
/// <summary>
|
||||
/// Initialize some static members
|
||||
/// </summary>
|
||||
static RevitStartInfo()
|
||||
{
|
||||
#region TimeZones
|
||||
TimeZones = new string[]{
|
||||
"(GMT-12:00) International Date Line West",
|
||||
"(GMT-11:00) Midway Island, Samoa",
|
||||
"(GMT-10:00) Hawaii",
|
||||
"(GMT-09:00) Alaska",
|
||||
"(GMT-08:00) Pacific Time (US/Canada)",
|
||||
"(GMT-08:00) Tijuana, Baja California",
|
||||
"(GMT-07:00) Arizona",
|
||||
"(GMT-07:00) Chihuahua, La Paz, Mazatlan - New",
|
||||
"(GMT-07:00) Chihuahua, La Paz, Mazatlan - Old",
|
||||
"(GMT-07:00) Mountain Time (US/Canada)",
|
||||
"(GMT-06:00) Central America",
|
||||
"(GMT-06:00) Central Time (US/Canada)",
|
||||
"(GMT-06:00) Guadalajara, Mexico City, Monterrey - New",
|
||||
"(GMT-06:00) Guadalajara, Mexico City, Monterrey - Old",
|
||||
"(GMT-06:00) Saskatchewan",
|
||||
"(GMT-05:00) Bogota, Lima, Quito, Rio Branco",
|
||||
"(GMT-05:00) Eastern Time (US/Canada)",
|
||||
"(GMT-05:00) Indiana (East)",
|
||||
"(GMT-04:00) Atlantic Time (Canada)",
|
||||
"(GMT-04:00) Caracas, La Paz",
|
||||
"(GMT-04:00) Santiago",
|
||||
"(GMT-03:30) Newfoundland",
|
||||
"(GMT-03:00) Brazilia",
|
||||
"(GMT-03:00) Buanos Aires, Georgetown",
|
||||
"(GMT-03:00) Greenland",
|
||||
"(GMT-03:00) Montevideo",
|
||||
"(GMT-02:00) Mid-Atlantic",
|
||||
"(GMT-01:00) Azores",
|
||||
"(GMT-01:00) Cape Verde Is.",
|
||||
"(GMT) Casablanca, Monrovia,Reykjavik",
|
||||
"(GMT) Greenwich Time: Dublin, Edinburgh, Lisbon, London",
|
||||
"(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",
|
||||
"(GMT+01:00) Belgrade, Brastislava, Budapest, Ljubljana, Prague",
|
||||
"(GMT+01:00) Brussels, Copenhagen, Madrid, Paris",
|
||||
"(GMT+01:00) Sarajevo, Skopje, Sofija, Vilnus, Warsaw, Zagreb",
|
||||
"(GMT+01:00) West Central Africa",
|
||||
"(GMT+02:00) Amman",
|
||||
"(GMT+02:00) Athens, Bucharest, Istanbul",
|
||||
"(GMT+02:00) Beirut",
|
||||
"(GMT+02:00) Cairo",
|
||||
"(GMT+02:00) Harare, Pretoria",
|
||||
"(GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",
|
||||
"(GMT+02:00) Jerusalem",
|
||||
"(GMT+02:00) Minsk",
|
||||
"(GMT+02:00) Windhoek",
|
||||
"(GMT+03:00) Baghdad",
|
||||
"(GMT+03:00) Kuwait, Riyadh",
|
||||
"(GMT+03:00) Moscow, St. Petersburg, Volgograd",
|
||||
"(GMT+03:00) Nairobi",
|
||||
"(GMT+03:00) Tbilisi",
|
||||
"(GMT+03:00) Tehran",
|
||||
"(GMT+04:00) Abu Dhabi, Muscat",
|
||||
"(GMT+04:00) Baku",
|
||||
"(GMT+04:00) Yerevan",
|
||||
"(GMT+04:30) Kabul",
|
||||
"(GMT+05:00) Ekaterinburg",
|
||||
"(GMT+05:00) Islamabad, Karachi, Tashkent",
|
||||
"(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi",
|
||||
"(GMT+05:30) Sri Jayawardenepura",
|
||||
"(GMT+05:45) Kathmandu ",
|
||||
"(GMT+06:00) Almaty, Novosibirsk",
|
||||
"(GMT+06:00) Astana, Dhaka",
|
||||
"(GMT+06:30) Yangon (Rangoon)",
|
||||
"(GMT+07:00) Bangkok, Hanoi, Jakarta ",
|
||||
"(GMT+07:00) Krasnoyarsk ",
|
||||
"(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi ",
|
||||
"(GMT+08:00) Irkutsk, Ulaan Bataar ",
|
||||
"(GMT+08:00) Kuala Lumpur, Singapore ",
|
||||
"(GMT+08:00) Perth",
|
||||
"(GMT+08:00) Taipei",
|
||||
"(GMT+09:00) Osaka, Sapporo, Tokyo",
|
||||
"(GMT+09:00) Seoul",
|
||||
"(GMT+09:00) Yakutsk",
|
||||
"(GMT+09:30) Adelaide",
|
||||
"(GMT+09:30) Darwin",
|
||||
"(GMT+10:00) Brisbane",
|
||||
"(GMT+10:00) Canberra, Melbourne, Sydney",
|
||||
"(GMT+10:00) Guam, Port Moresby",
|
||||
"(GMT+10:00) Hobart",
|
||||
"(GMT+10:00) Vladivostok",
|
||||
"(GMT+11:00) Magadan, Solomon Is., New Caledonia ",
|
||||
"(GMT+12:00) Aukland, Wellington ",
|
||||
"(GMT+12:00) Fiji, Kamchatka, Marshall Is.",
|
||||
"(GMT+13:00) Nubu'alofa" };
|
||||
#endregion
|
||||
|
||||
#region BuildingTypeMap
|
||||
BuildingTypeMap = new Dictionary<object, string>();
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.AutomotiveFacility, "Automotive Facility");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.ConventionCenter, "Convention Center");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.Courthouse, "Courthouse");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.DiningBarLoungeOrLeisure, "Dining Bar Lounge or Leisure");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.DiningCafeteriaFastFood, "Dining Cafeteria Fast Food");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.DiningFamily, "Dining Family");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.Dormitory, "Dormitory");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.ExerciseCenter, "Exercise Center");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.FireStation, "Fire Station");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.Gymnasium, "Gymnasium");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.HospitalOrHealthcare, "Hospital or Healthcare");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.Hotel, "Hotel");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.Library, "Library");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.Manufacturing, "Manufacturing");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.Motel, "Motel");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.MotionPictureTheatre, "Motion Picture Theatre");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.MultiFamily, "Multi Family");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.Museum, "Museum");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.NoOfBuildingTypes, "None");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.Office, "Office");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.ParkingGarage, "Parking Garage");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.Penitentiary, "Penitentiary");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.PerformingArtsTheater, "Performing Arts Theater");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.PoliceStation, "Police Station");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.PostOffice, "Post Office");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.ReligiousBuilding, "Religious Building");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.Retail, "Retail");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.SchoolOrUniversity, "School or University");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.SingleFamily, "Single Family");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.SportsArena, "Sports Arena");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.TownHall, "Town Hall");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.Transportation, "Transportation");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.Warehouse, "Warehouse");
|
||||
BuildingTypeMap.Add(gbXMLBuildingType.Workshop, "Workshop");
|
||||
#endregion
|
||||
|
||||
#region ServiceTypeMap
|
||||
ServiceTypeMap = new Dictionary<object, string>();
|
||||
ServiceTypeMap.Add(gbXMLServiceType.ActiveChilledBeams, "Active Chilled Beams");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.CentralHeatingConvectors, "Central Heating: Convectors");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.CentralHeatingHotAir, "Central Heating: Hot Air");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.CentralHeatingRadiantFloor, "Central Heating: Radiant Floor");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.CentralHeatingRadiators, "Central Heating: Radiators");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.ConstantVolumeDualDuct, "Constant Volume - Dual Duct");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.ConstantVolumeFixedOA, "Constant Volume - Fixed OA");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.ConstantVolumeTerminalReheat, "Constant Volume - Terminal Reheat");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.ConstantVolumeVariableOA, "Constant Volume - Variable OA");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.FanCoilSystem, "Fan Coil System");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.ForcedConvectionHeaterFlue, "Forced Convection Heater - Flue");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.ForcedConvectionHeaterNoFlue, "Forced Convection Heater - No Flue");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.InductionSystem, "Induction System");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.MultizoneHotDeckColdDeck, "Multi-zone - Hot Deck / Cold Deck");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.NoServiceType, "None");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.OtherRoomHeater, "Other Room Heater");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.RadiantCooledCeilings, "Radiant Cooled Ceilings");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.RadiantHeaterFlue, "Radiant Heater - Flue");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.RadiantHeaterMultiburner, "Radiant Heater - Multi-burner");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.RadiantHeaterNoFlue, "Radiant Heater - No Flue");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.SplitSystemsWithMechanicalVentilation, "Split System(s) with Mechanical Ventilation");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.SplitSystemsWithMechanicalVentilationWithCooling, "Split System(s) with Mechanical Ventilation with Cooling");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.SplitSystemsWithNaturalVentilation, "Split System(s) with Natural Ventilation");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.VariableRefrigerantFlow, "Variable Refrigerant Flow");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.VAVDualDuct, "VAV - Dual Duct");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.VAVIndoorPackagedCabinet, "VAV - Indoor Packaged Cabinet");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.VAVSingleDuct, "VAV - Single Duct");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.VAVTerminalReheat, "VAV - Terminal Reheat");
|
||||
ServiceTypeMap.Add(gbXMLServiceType.WaterLoopHeatPump, "Water Loop Heat Pump");
|
||||
#endregion
|
||||
|
||||
#region ExportComplexityMap
|
||||
ExportComplexityMap = new Dictionary<object, string>();
|
||||
ExportComplexityMap.Add(gbXMLExportComplexity.Complex, "Complex");
|
||||
ExportComplexityMap.Add(gbXMLExportComplexity.ComplexWithMullionsAndShadingSurfaces, "Complex With Mullions And Shading Surfaces");
|
||||
ExportComplexityMap.Add(gbXMLExportComplexity.ComplexWithShadingSurfaces, "Complex With Shading Surfaces");
|
||||
ExportComplexityMap.Add(gbXMLExportComplexity.Simple, "Simple");
|
||||
ExportComplexityMap.Add(gbXMLExportComplexity.SimpleWithShadingSurfaces, "Simple With Shading Surfaces");
|
||||
#endregion
|
||||
|
||||
#region HVACLoadLoadsReportTypeMap
|
||||
HVACLoadLoadsReportTypeMap = new Dictionary<object, string>();
|
||||
HVACLoadLoadsReportTypeMap.Add(HVACLoadLoadsReportType.DetailedReport, "Detailed");
|
||||
HVACLoadLoadsReportTypeMap.Add(HVACLoadLoadsReportType.NoReport, "No");
|
||||
HVACLoadLoadsReportTypeMap.Add(HVACLoadLoadsReportType.SimpleReport, "Simple");
|
||||
HVACLoadLoadsReportTypeMap.Add(HVACLoadLoadsReportType.StandardReport, "Standard");
|
||||
#endregion
|
||||
|
||||
#region HVACLoadConstructionClassMap
|
||||
HVACLoadConstructionClassMap = new Dictionary<object, string>();
|
||||
HVACLoadConstructionClassMap.Add(HVACLoadConstructionClass.LooseConstruction, "Loose");
|
||||
HVACLoadConstructionClassMap.Add(HVACLoadConstructionClass.NoneConstruction, "None");
|
||||
HVACLoadConstructionClassMap.Add(HVACLoadConstructionClass.MediumConstruction, "Medium");
|
||||
HVACLoadConstructionClassMap.Add(HVACLoadConstructionClass.TightConstruction, "Tight");
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
public static Element GetElement(ElementId elementId)
|
||||
{
|
||||
return RevitDoc.GetElement(elementId);
|
||||
}
|
||||
public static Element GetElement(int elementId)
|
||||
{
|
||||
return GetElement(new ElementId(elementId));
|
||||
}
|
||||
#endregion
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Revit.SDK.Samples.ProjectInfo.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts angle with string
|
||||
/// </summary>
|
||||
public class AngleConverter : TypeConverter
|
||||
{
|
||||
#region Methods
|
||||
/// <summary>
|
||||
/// Converts from string.
|
||||
/// </summary>
|
||||
/// <returns>Converted string</returns>
|
||||
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
|
||||
{
|
||||
return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType);
|
||||
}
|
||||
/// <summary>
|
||||
/// Converts to string.
|
||||
/// </summary>
|
||||
/// <returns>Converted string</returns>
|
||||
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
|
||||
{
|
||||
return destinationType.Equals(typeof(string)) || base.CanConvertTo(context, destinationType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts from string.
|
||||
/// </summary>
|
||||
/// <param name="context">An System.ComponentModel.ITypeDescriptorContext
|
||||
/// that provides a format context.</param>
|
||||
/// <param name="culture">An optional System.Globalization.CultureInfo.
|
||||
/// If not supplied, the current culture is assumed.</param>
|
||||
/// <param name="value">string to be converted to an element</param>
|
||||
/// <returns>An element if the element exists, otherwise null</returns>
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
|
||||
{
|
||||
string text = value as string;
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
return AngleString2Double(text);
|
||||
}
|
||||
return base.ConvertFrom(context, culture, value);
|
||||
}
|
||||
/// <summary>
|
||||
/// Converts to string.
|
||||
/// </summary>
|
||||
/// <param name="context">An ITypeDescriptorContext that provides a format context. </param>
|
||||
/// <param name="culture">A CultureInfo. If null is passed, the current culture is assumed. </param>
|
||||
/// <param name="value">The Object to convert. </param>
|
||||
/// <param name="destinationType">The Type to convert the value parameter to. </param>
|
||||
/// <returns>Converted string</returns>
|
||||
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (destinationType == null)
|
||||
{
|
||||
throw new ArgumentNullException("destinationType");
|
||||
}
|
||||
if (destinationType == typeof(string))
|
||||
{
|
||||
if (value == null) return string.Empty;
|
||||
double angle = (double) value;
|
||||
return Double2AngleString(angle);
|
||||
}
|
||||
return base.ConvertTo(context, culture, value, destinationType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert angle string to double value
|
||||
/// </summary>
|
||||
/// <param name="value">Angle string</param>
|
||||
/// <returns>Double value</returns>
|
||||
private static double AngleString2Double(string value)
|
||||
{
|
||||
int n = value.Length - 1;
|
||||
if (!char.IsDigit(value[n]))
|
||||
{
|
||||
value = value.Substring(0, n);
|
||||
}
|
||||
return Double.Parse(value) * 0.0174532925199433;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert double value to angle string
|
||||
/// </summary>
|
||||
/// <param name="value">Angle value</param>
|
||||
/// <returns>Angle string, the unit is degree.</returns>
|
||||
private static string Double2AngleString(Double value)
|
||||
{
|
||||
// 0xb0 is ASCII for unit flag of "degree"
|
||||
return ((object)Math.Round(value / 0.0174532925199433, 3)).ToString() + (char)0xb0;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using Autodesk.Revit.DB;
|
||||
|
||||
namespace Revit.SDK.Samples.ProjectInfo.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts City with string
|
||||
/// </summary>
|
||||
public class CityConverter : TypeConverter
|
||||
{
|
||||
|
||||
public static List<City> Cities;
|
||||
public const string UserDefined = "User Defined";
|
||||
|
||||
static CityConverter()
|
||||
{
|
||||
Cities = new List<City>();
|
||||
foreach (City city in RevitStartInfo.RevitApp.Cities)
|
||||
{
|
||||
Cities.Add(city);
|
||||
}
|
||||
}
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether this object supports a standard set of values that can be
|
||||
/// picked from a list, using the specified context.
|
||||
/// </summary>
|
||||
/// <returns>true</returns>
|
||||
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether the collection of standard values returned from System.ComponentModel.TypeConverter.GetStandardValues()
|
||||
/// is an exclusive list.
|
||||
/// </summary>
|
||||
/// <returns>true</returns>
|
||||
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a collection of standard values from the default context for the
|
||||
/// data type this type converter is designed for.
|
||||
/// </summary>
|
||||
/// <returns>Element collection retrieved through filtering current Revit document elements</returns>
|
||||
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
|
||||
{
|
||||
return new StandardValuesCollection(Cities);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts from string.
|
||||
/// </summary>
|
||||
/// <returns>Converted string</returns>
|
||||
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
|
||||
{
|
||||
return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType);
|
||||
}
|
||||
/// <summary>
|
||||
/// Converts to string.
|
||||
/// </summary>
|
||||
/// <returns>Converted string</returns>
|
||||
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
|
||||
{
|
||||
return destinationType.Equals(typeof(string)) || base.CanConvertTo(context, destinationType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an element from a string contains its id
|
||||
/// </summary>
|
||||
/// <param name="context">An System.ComponentModel.ITypeDescriptorContext
|
||||
/// that provides a format context.</param>
|
||||
/// <param name="culture">An optional System.Globalization.CultureInfo.
|
||||
/// If not supplied, the current culture is assumed.</param>
|
||||
/// <param name="value">string to be converted to an element</param>
|
||||
/// <returns>An element if the element exists, otherwise null</returns>
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
|
||||
{
|
||||
string text = value as string;
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
foreach (City city in Cities)
|
||||
{
|
||||
if (city.Name == text)
|
||||
return city;
|
||||
}
|
||||
}
|
||||
return base.ConvertFrom(context, culture, value);
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns element name.
|
||||
/// returns empty string if value is null or Element.Name throws an exception.
|
||||
/// </summary>
|
||||
/// <param name="context">An ITypeDescriptorContext that provides a format context. </param>
|
||||
/// <param name="culture">A CultureInfo. If null is passed, the current culture is assumed. </param>
|
||||
/// <param name="value">The Object to convert. </param>
|
||||
/// <param name="destinationType">The Type to convert the value parameter to. </param>
|
||||
/// <returns>Converted string</returns>
|
||||
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (destinationType == null)
|
||||
{
|
||||
throw new ArgumentNullException("destinationType");
|
||||
}
|
||||
if (destinationType == typeof(string))
|
||||
{
|
||||
if (value == null) return UserDefined;
|
||||
City city = value as City;
|
||||
if (city != null)
|
||||
return city.Name;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
return base.ConvertTo(context, culture, value, destinationType);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using Autodesk.Revit.DB;
|
||||
using ConstructionType = Autodesk.Revit.DB.Analysis.ConstructionType;
|
||||
|
||||
namespace Revit.SDK.Samples.ProjectInfo.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Converter for ConstructionWrapper
|
||||
/// </summary>
|
||||
public class ConstructionWrapperConverter : TypeConverter
|
||||
{
|
||||
#region Methods
|
||||
/// <summary>
|
||||
/// Returns whether this object supports a standard set of values that can be
|
||||
/// picked from a list, using the specified context.
|
||||
/// </summary>
|
||||
/// <returns>true</returns>
|
||||
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether the collection of standard values returned from System.ComponentModel.TypeConverter.GetStandardValues()
|
||||
/// is an exclusive list.
|
||||
/// </summary>
|
||||
/// <returns>true</returns>
|
||||
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a collection of standard values from the default context for the
|
||||
/// data type this type converter is designed for.
|
||||
/// </summary>
|
||||
/// <returns>ConstructionWrapper collection depends on current context</returns>
|
||||
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
|
||||
{
|
||||
List<ConstructionWrapper> list = new List<ConstructionWrapper>();
|
||||
// convert property name to ConstructionType
|
||||
ConstructionType constructionType = (ConstructionType)Enum.Parse(typeof(ConstructionType), context.PropertyDescriptor.Name);
|
||||
|
||||
// convert instance to MEPBuildingConstructionWrapper
|
||||
MEPBuildingConstructionWrapper mEPBuildingConstruction = context.Instance as MEPBuildingConstructionWrapper;
|
||||
|
||||
// get all Constructions from MEPBuildingConstructionWrapper and add them to a list
|
||||
foreach (Construction con in mEPBuildingConstruction.GetConstructions(constructionType))
|
||||
{
|
||||
list.Add(new ConstructionWrapper(con));
|
||||
}
|
||||
|
||||
// sort the list
|
||||
list.Sort();
|
||||
return new StandardValuesCollection(list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Can convert from string
|
||||
/// </summary>
|
||||
/// <param name="context">An ITypeDescriptorContext that provides a format context. </param>
|
||||
/// <param name="sourceType">A Type that represents the type you want to convert from. </param>
|
||||
/// <returns>true if sourceType is string, otherwise false</returns>
|
||||
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
|
||||
{
|
||||
return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Can be converted to string
|
||||
/// </summary>
|
||||
/// <returns>true if destinationType is string, otherwise false</returns>
|
||||
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
|
||||
{
|
||||
return destinationType.Equals(typeof(System.String)) || base.CanConvertTo(context, destinationType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a ConstructionWrapper from a string
|
||||
/// </summary>
|
||||
/// <param name="context">An System.ComponentModel.ITypeDescriptorContext
|
||||
/// that provides a format context.</param>
|
||||
/// <param name="culture">An optional System.Globalization.CultureInfo.
|
||||
/// If not supplied, the current culture is assumed.</param>
|
||||
/// <param name="value">string to be converted to</param>
|
||||
/// <returns>A ConstructionWrapper from the StandardValues</returns>
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
|
||||
{
|
||||
string text = value as string;
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
foreach (ConstructionWrapper con in this.GetStandardValues(context))
|
||||
{
|
||||
if (con.Name == text)
|
||||
{
|
||||
return con;
|
||||
}
|
||||
}
|
||||
}
|
||||
return base.ConvertFrom(context, culture, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert object to string
|
||||
/// </summary>
|
||||
/// <param name="context">An ITypeDescriptorContext that provides a format context. </param>
|
||||
/// <param name="culture">A CultureInfo. If null is passed, the current culture is assumed. </param>
|
||||
/// <param name="value">The Object to convert. </param>
|
||||
/// <param name="destinationType">The Type to convert the value parameter to. </param>
|
||||
/// <returns>empty string if current construction is null, otherwise construction name</returns>
|
||||
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (destinationType == null)
|
||||
{
|
||||
throw new ArgumentNullException("destinationType");
|
||||
}
|
||||
if (destinationType == typeof(string))
|
||||
{
|
||||
if (value == null) return string.Empty;
|
||||
ConstructionWrapper construction = value as ConstructionWrapper;
|
||||
if (construction != null)
|
||||
{
|
||||
return construction.Name;
|
||||
}
|
||||
}
|
||||
return base.ConvertTo(context, culture, value, destinationType);
|
||||
}
|
||||
#endregion
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// (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.ComponentModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Autodesk.Revit;
|
||||
|
||||
namespace Revit.SDK.Samples.ProjectInfo.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Type converter for wrapper classes
|
||||
/// </summary>
|
||||
public class WrapperConverter : ExpandableObjectConverter
|
||||
{
|
||||
#region Methods
|
||||
/// <summary>
|
||||
/// Can be converted to string
|
||||
/// </summary>
|
||||
/// <returns>true if destinationType is string, otherwise false</returns>
|
||||
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
|
||||
{
|
||||
return destinationType.Equals(typeof(System.String)) || base.CanConvertTo(context, destinationType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts to string. If value is null, convert it to "(null)".
|
||||
/// if value has a "Name" property, returns its name. otherwise, returns "(...)".
|
||||
/// </summary>
|
||||
/// <returns>Converted string</returns>
|
||||
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (destinationType == null)
|
||||
{
|
||||
throw new ArgumentNullException("destinationType");
|
||||
}
|
||||
if (destinationType == typeof(string))
|
||||
{
|
||||
if (value == null) return "(null)";
|
||||
|
||||
// get its name
|
||||
Type type = value.GetType();
|
||||
string wrapperType = type.ToString();
|
||||
MethodInfo mi = type.GetMethod("get_Name", new Type[0]);
|
||||
if (mi != null)
|
||||
{
|
||||
return mi.Invoke(value, new object[0]).ToString();
|
||||
}
|
||||
|
||||
// if no name
|
||||
return "(...)";
|
||||
}
|
||||
return base.ConvertTo(context, culture, value, destinationType);
|
||||
}
|
||||
#endregion
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using Autodesk.Revit.DB;
|
||||
|
||||
namespace Revit.SDK.Samples.ProjectInfo.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Convert ElementIds with string
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Element Type</typeparam>
|
||||
public class ElementIdConverter<T> : TypeConverter where T: Element
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns whether this object supports a standard set of values that can be
|
||||
/// picked from a list, using the specified context.
|
||||
/// </summary>
|
||||
/// <returns>true</returns>
|
||||
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether the collection of standard values returned from System.ComponentModel.TypeConverter.GetStandardValues()
|
||||
/// is an exclusive list.
|
||||
/// </summary>
|
||||
/// <returns>true</returns>
|
||||
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a collection of standard values from the default context for the
|
||||
/// data type this type converter is designed for.
|
||||
/// </summary>
|
||||
/// <returns>Element collection retrieved through filtering current Revit document elements</returns>
|
||||
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
|
||||
{
|
||||
// using type filter to get the target type objects
|
||||
//Autodesk.Revit.DB.TypeFilter typeFilter = RevitStartInfo.RevitApp.Create.Filter.NewTypeFilter(targetType, true);
|
||||
//ElementIterator elementIterator = RevitStartInfo.RevitDoc.get_Elements(typeFilter);
|
||||
|
||||
//// create a list
|
||||
//List<Element> list = new List<Element>();
|
||||
//elementIterator.Reset();
|
||||
//while (elementIterator.MoveNext())
|
||||
//{
|
||||
// list.Add(elementIterator.Current as Element);
|
||||
//}
|
||||
var list = new FilteredElementCollector(RevitStartInfo.RevitDoc).OfClass(typeof(T));
|
||||
|
||||
return new StandardValuesCollection(list.ToElementIds().ToList());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts from string.
|
||||
/// </summary>
|
||||
/// <returns>Converted string</returns>
|
||||
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
|
||||
{
|
||||
return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType);
|
||||
}
|
||||
/// <summary>
|
||||
/// Converts to string.
|
||||
/// </summary>
|
||||
/// <returns>Converted string</returns>
|
||||
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
|
||||
{
|
||||
return destinationType.Equals(typeof(string)) || base.CanConvertTo(context, destinationType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an element from a string contains its id
|
||||
/// </summary>
|
||||
/// <param name="context">An System.ComponentModel.ITypeDescriptorContext
|
||||
/// that provides a format context.</param>
|
||||
/// <param name="culture">An optional System.Globalization.CultureInfo.
|
||||
/// If not supplied, the current culture is assumed.</param>
|
||||
/// <param name="value">string to be converted to an element</param>
|
||||
/// <returns>An element if the element exists, otherwise null</returns>
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
|
||||
{
|
||||
string text = value as string;
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
StandardValuesCollection svc = GetStandardValues(context);
|
||||
foreach (ElementId elementId in svc)
|
||||
{
|
||||
Element element = RevitStartInfo.GetElement(elementId);
|
||||
if (element.Name == text)
|
||||
return element.Id;
|
||||
}
|
||||
}
|
||||
return base.ConvertFrom(context, culture, value);
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns element name.
|
||||
/// returns empty string if value is null or Element.Name throws an exception.
|
||||
/// </summary>
|
||||
/// <param name="context">An ITypeDescriptorContext that provides a format context. </param>
|
||||
/// <param name="culture">A CultureInfo. If null is passed, the current culture is assumed. </param>
|
||||
/// <param name="value">The Object to convert. </param>
|
||||
/// <param name="destinationType">The Type to convert the value parameter to. </param>
|
||||
/// <returns>Converted string</returns>
|
||||
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (destinationType == null)
|
||||
{
|
||||
throw new ArgumentNullException("destinationType");
|
||||
}
|
||||
if (destinationType == typeof(string))
|
||||
{
|
||||
if (value == null) return string.Empty;
|
||||
ElementId elementId = value as ElementId;
|
||||
if (elementId != null)
|
||||
{
|
||||
Element element = RevitStartInfo.GetElement(elementId);
|
||||
if (element != null)
|
||||
{
|
||||
string elementName = string.Empty;
|
||||
try
|
||||
{
|
||||
elementName = element.Name;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return elementName;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return base.ConvertTo(context, culture, value, destinationType);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using Autodesk.Revit.DB;
|
||||
|
||||
namespace Revit.SDK.Samples.ProjectInfo.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts ProjectLocation with string
|
||||
/// </summary>
|
||||
public class ProjectLocationConverter: TypeConverter
|
||||
{
|
||||
/// <summary>
|
||||
/// All project locations in current document
|
||||
/// </summary>
|
||||
public static List<ProjectLocation> ProjectLocations;
|
||||
/// <summary>
|
||||
/// User defined location
|
||||
/// </summary>
|
||||
public const string UserDefined = "User Defined";
|
||||
|
||||
/// <summary>
|
||||
/// Initialize ProjectLocations
|
||||
/// </summary>
|
||||
static ProjectLocationConverter()
|
||||
{
|
||||
ProjectLocations = new List<ProjectLocation>();
|
||||
foreach (ProjectLocation city in RevitStartInfo.RevitDoc.ProjectLocations)
|
||||
{
|
||||
ProjectLocations.Add(city);
|
||||
}
|
||||
}
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether this object supports a standard set of values that can be
|
||||
/// picked from a list, using the specified context.
|
||||
/// </summary>
|
||||
/// <returns>true</returns>
|
||||
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether the collection of standard values returned from System.ComponentModel.TypeConverter.GetStandardValues()
|
||||
/// is an exclusive list.
|
||||
/// </summary>
|
||||
/// <returns>true</returns>
|
||||
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a collection of standard values from the default context for the
|
||||
/// data type this type converter is designed for.
|
||||
/// </summary>
|
||||
/// <returns>Element collection retrieved through filtering current Revit document elements</returns>
|
||||
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
|
||||
{
|
||||
return new StandardValuesCollection(ProjectLocations);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts from string.
|
||||
/// </summary>
|
||||
/// <returns>Converted string</returns>
|
||||
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
|
||||
{
|
||||
return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType);
|
||||
}
|
||||
/// <summary>
|
||||
/// Converts to string.
|
||||
/// </summary>
|
||||
/// <returns>Converted string</returns>
|
||||
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
|
||||
{
|
||||
return destinationType.Equals(typeof(string)) || base.CanConvertTo(context, destinationType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts from string.
|
||||
/// </summary>
|
||||
/// <param name="context">An System.ComponentModel.ITypeDescriptorContext
|
||||
/// that provides a format context.</param>
|
||||
/// <param name="culture">An optional System.Globalization.CultureInfo.
|
||||
/// If not supplied, the current culture is assumed.</param>
|
||||
/// <param name="value">string to be converted to an element</param>
|
||||
/// <returns>An element if the element exists, otherwise null</returns>
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
|
||||
{
|
||||
string text = value as string;
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
foreach (ProjectLocation projectLocation in ProjectLocations)
|
||||
{
|
||||
if (projectLocation.Name == text)
|
||||
return projectLocation;
|
||||
}
|
||||
}
|
||||
return base.ConvertFrom(context, culture, value);
|
||||
}
|
||||
/// <summary>
|
||||
/// Converts to string.
|
||||
/// </summary>
|
||||
/// <param name="context">An ITypeDescriptorContext that provides a format context. </param>
|
||||
/// <param name="culture">A CultureInfo. If null is passed, the current culture is assumed. </param>
|
||||
/// <param name="value">The Object to convert. </param>
|
||||
/// <param name="destinationType">The Type to convert the value parameter to. </param>
|
||||
/// <returns>Converted string</returns>
|
||||
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (destinationType == null)
|
||||
{
|
||||
throw new ArgumentNullException("destinationType");
|
||||
}
|
||||
if (destinationType == typeof(string))
|
||||
{
|
||||
if (value == null) return UserDefined;
|
||||
ProjectLocation projectLocation = value as ProjectLocation;
|
||||
if (projectLocation != null)
|
||||
return projectLocation.Name;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
return base.ConvertTo(context, culture, value, destinationType);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,227 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Revit.SDK.Samples.ProjectInfo.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Converter for Enumeration types of RevitAPI
|
||||
/// </summary>
|
||||
public abstract class RevitEnumConverter : EnumConverter
|
||||
{
|
||||
#region Fields
|
||||
/// <summary>
|
||||
/// Dictionary contains enum and string map
|
||||
/// </summary>
|
||||
Dictionary<object, string> m_map = null;
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Gets the enum-string map
|
||||
/// </summary>
|
||||
protected abstract Dictionary<object, string> EnumMap
|
||||
{
|
||||
get;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
/// <summary>
|
||||
/// Initialize private variables
|
||||
/// </summary>
|
||||
/// <param name="type">Enumeration type</param>
|
||||
public RevitEnumConverter(Type type)
|
||||
: base(type)
|
||||
{
|
||||
m_map = EnumMap;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
/// <summary>
|
||||
/// Returns a collection of standard values from the default context for the
|
||||
/// data type this type converter is designed for.
|
||||
/// </summary>
|
||||
/// <returns>All enum items</returns>
|
||||
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
|
||||
{
|
||||
return new StandardValuesCollection(m_map.Keys);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an enum item from a string
|
||||
/// </summary>
|
||||
/// <param name="context">An System.ComponentModel.ITypeDescriptorContext
|
||||
/// that provides a format context.</param>
|
||||
/// <param name="culture">An optional System.Globalization.CultureInfo.
|
||||
/// If not supplied, the current culture is assumed.</param>
|
||||
/// <param name="value">string to be converted to</param>
|
||||
/// <returns>An enum item</returns>
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
|
||||
{
|
||||
object enumValue = value;
|
||||
string valueText = value.ToString();
|
||||
foreach (KeyValuePair<object, string> pair in m_map)
|
||||
{
|
||||
if (pair.Value == valueText)
|
||||
{
|
||||
enumValue = pair.Key.ToString();
|
||||
}
|
||||
}
|
||||
return base.ConvertFrom(context, culture, enumValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert enum item to string
|
||||
/// </summary>
|
||||
/// <param name="context">An ITypeDescriptorContext that provides a format context. </param>
|
||||
/// <param name="culture">A CultureInfo. If null is passed, the current culture is assumed. </param>
|
||||
/// <param name="value">The Object to convert. </param>
|
||||
/// <param name="destinationType">The Type to convert the value parameter to. </param>
|
||||
/// <returns>Corresponding string related with the enum item</returns>
|
||||
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
object enumValue = base.ConvertTo(context, culture, value, destinationType);
|
||||
object enumObject = Enum.Parse(this.EnumType, enumValue.ToString());
|
||||
return m_map[enumObject];
|
||||
}
|
||||
#endregion
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Converter for BuildingType
|
||||
/// </summary>
|
||||
public class BuildingTypeConverter : RevitEnumConverter
|
||||
{
|
||||
#region Constructors
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="type">enumeration type</param>
|
||||
public BuildingTypeConverter(Type type) : base(type) { }
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Gets the enum-string map
|
||||
/// </summary>
|
||||
protected override Dictionary<object, string> EnumMap
|
||||
{
|
||||
get
|
||||
{
|
||||
return RevitStartInfo.BuildingTypeMap;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Converter for ExportComplexityConverter
|
||||
/// </summary>
|
||||
public class ExportComplexityConverter : RevitEnumConverter
|
||||
{
|
||||
#region Constructors
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="type">enumeration type</param>
|
||||
public ExportComplexityConverter(Type type) : base(type) { }
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Gets the enum-string map
|
||||
/// </summary>
|
||||
protected override Dictionary<object, string> EnumMap
|
||||
{
|
||||
get
|
||||
{
|
||||
return RevitStartInfo.ExportComplexityMap;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Converter for ServiceType
|
||||
/// </summary>
|
||||
public class ServiceTypeConverter : RevitEnumConverter
|
||||
{
|
||||
#region Constructors
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="type">enumeration type</param>
|
||||
public ServiceTypeConverter(Type type) : base(type) { }
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Gets the enum-string map
|
||||
/// </summary>
|
||||
protected override Dictionary<object, string> EnumMap
|
||||
{
|
||||
get
|
||||
{
|
||||
return RevitStartInfo.ServiceTypeMap;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Converter for HVACLoadLoadsReportType
|
||||
/// </summary>
|
||||
public class HVACLoadLoadsReportTypeConverter : RevitEnumConverter
|
||||
{
|
||||
#region Constructors
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="type">enumeration type</param>
|
||||
public HVACLoadLoadsReportTypeConverter(Type type) : base(type) { }
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Gets the enum-string map
|
||||
/// </summary>
|
||||
protected override Dictionary<object, string> EnumMap
|
||||
{
|
||||
get
|
||||
{
|
||||
return RevitStartInfo.HVACLoadLoadsReportTypeMap;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Converter for HVACLoadConstructionClass
|
||||
/// </summary>
|
||||
public class HVACLoadConstructionClassConverter : RevitEnumConverter
|
||||
{
|
||||
#region Constructors
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="type">enumeration type</param>
|
||||
public HVACLoadConstructionClassConverter(Type type) : base(type) { }
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Gets the enum-string map
|
||||
/// </summary>
|
||||
protected override Dictionary<object, string> EnumMap
|
||||
{
|
||||
get
|
||||
{
|
||||
return RevitStartInfo.HVACLoadConstructionClassMap;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
};
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Revit.SDK.Samples.ProjectInfo.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Converter used to convert TimeZone
|
||||
/// </summary>
|
||||
public class TimeZoneConverter : TypeConverter
|
||||
{
|
||||
#region Methods
|
||||
/// <summary>
|
||||
/// Returns whether this object supports a standard set of values that can be
|
||||
/// picked from a list, using the specified context.
|
||||
/// </summary>
|
||||
/// <returns>true</returns>
|
||||
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether the collection of standard values returned from System.ComponentModel.TypeConverter.GetStandardValues()
|
||||
/// is an exclusive list.
|
||||
/// </summary>
|
||||
/// <returns>true</returns>
|
||||
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a collection of standard values from the default context for the
|
||||
/// data type this type converter is designed for.
|
||||
/// </summary>
|
||||
/// <returns>Element collection retrieved through filtering current Revit document elements</returns>
|
||||
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
|
||||
{
|
||||
return new StandardValuesCollection(RevitStartInfo.TimeZones);
|
||||
}
|
||||
#endregion
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RevitAddIns>
|
||||
<AddIn Type="Command">
|
||||
<Assembly>ProjectInfo.dll</Assembly>
|
||||
<ClientId>2b019102-4688-4d9c-9e16-c36c1240ebc7</ClientId>
|
||||
<FullClassName>Revit.SDK.Samples.ProjectInfo.CS.Command</FullClassName>
|
||||
<Text>Project Information</Text>
|
||||
<Description>Project Information.</Description>
|
||||
<VisibilityMode>AlwaysVisible</VisibilityMode>
|
||||
<VendorId>ADSK</VendorId>
|
||||
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
|
||||
</AddIn>
|
||||
</RevitAddIns>
|
||||
@@ -0,0 +1,121 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{E832481F-F7F5-4E40-841C-1A7A6D21F576}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ProjectInfo</RootNamespace>
|
||||
<AssemblyName>ProjectInfo</AssemblyName>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Command.cs" />
|
||||
<Compile Include="Converters\ConstructionWrapperConverter.cs" />
|
||||
<Compile Include="Converters\ElementIdConverter.cs" />
|
||||
<Compile Include="Converters\RevitEnumConverter.cs" />
|
||||
<Compile Include="Converters\TimeZoneConverter.cs" />
|
||||
<Compile Include="Converters\AngleConverter.cs" />
|
||||
<Compile Include="Converters\CityConverter.cs" />
|
||||
<Compile Include="Wrappers\ConstructionWrapper.cs" />
|
||||
<Compile Include="Converters\Converters.cs" />
|
||||
<Compile Include="Wrappers\EnergyDataSettingsWrapper.cs" />
|
||||
<Compile Include="Wrappers\MEPBuildingConstructionWrapper.cs" />
|
||||
<Compile Include="ProjectInfoForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ProjectInfoForm.Designer.cs">
|
||||
<DependentUpon>ProjectInfoForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Wrappers\ProjectInfoWrapper.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RevitVersionAttribute.cs" />
|
||||
<Compile Include="Converters\ProjectLocationConverter.cs" />
|
||||
<Compile Include="Wrappers\SiteLocationWrapper.cs" />
|
||||
<Compile Include="Wrappers\WrapperCustomDescriptor.cs" />
|
||||
<Compile Include="Wrappers\Wrappers.cs" />
|
||||
<EmbeddedResource Include="ProjectInfoForm.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>ProjectInfoForm.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>
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
//
|
||||
// (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.ProjectInfo.CS
|
||||
{
|
||||
partial class ProjectInfoForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.okButton = new System.Windows.Forms.Button();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.okButton.Location = new System.Drawing.Point(265, 384);
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.okButton.TabIndex = 0;
|
||||
this.okButton.Text = "&OK";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancelButton.Location = new System.Drawing.Point(346, 384);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(75, 23);
|
||||
this.cancelButton.TabIndex = 1;
|
||||
this.cancelButton.Text = "&Cancel";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// propertyGrid1
|
||||
//
|
||||
this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.propertyGrid1.HelpVisible = false;
|
||||
this.propertyGrid1.Location = new System.Drawing.Point(12, 12);
|
||||
this.propertyGrid1.Name = "propertyGrid1";
|
||||
this.propertyGrid1.Size = new System.Drawing.Size(409, 366);
|
||||
this.propertyGrid1.TabIndex = 2;
|
||||
//
|
||||
// ProjectInfoForm
|
||||
//
|
||||
this.AcceptButton = this.okButton;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.CancelButton = this.cancelButton;
|
||||
this.ClientSize = new System.Drawing.Size(433, 419);
|
||||
this.Controls.Add(this.propertyGrid1);
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.okButton);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ProjectInfoForm";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.Text = "Project Information";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button okButton;
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
private System.Windows.Forms.PropertyGrid propertyGrid1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// (C) Copyright 2003-2019 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Revit.SDK.Samples.ProjectInfo.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Form used to display project information
|
||||
/// </summary>
|
||||
public partial class ProjectInfoForm : System.Windows.Forms.Form
|
||||
{
|
||||
#region Fields
|
||||
/// <summary>
|
||||
/// Wrapper for ProjectInfo
|
||||
/// </summary>
|
||||
ProjectInfoWrapper m_projectInfoWrapper = null;
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
/// <summary>
|
||||
/// Initialize component
|
||||
/// </summary>
|
||||
public ProjectInfoForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize PropertyGrid
|
||||
/// </summary>
|
||||
/// <param name="projectInfoWrapper">ProjectInfo wrapper</param>
|
||||
public ProjectInfoForm(ProjectInfoWrapper projectInfoWrapper)
|
||||
:this()
|
||||
{
|
||||
m_projectInfoWrapper = projectInfoWrapper;
|
||||
|
||||
// Initialize propertyGrid with CustomDescriptor
|
||||
propertyGrid1.SelectedObject = new WrapperCustomDescriptor(m_projectInfoWrapper);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// (C) Copyright 2003-2019 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("ProjectInfo")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ProjectInfo2")]
|
||||
[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("00c92e2a-a5d7-40d3-844e-4b83a534c941")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,240 @@
|
||||
{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe2052\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
|
||||
{\f13\fbidi \fswiss\fcharset128\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt \'91\'76\'91\'cc};}{\f34\fbidi \froman\fcharset1\fprq2{\*\panose 02040503050406030204}Cambria Math;}
|
||||
{\f39\fbidi \fswiss\fcharset128\fprq2{\*\panose 02010600030101010101}@SimSun;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
|
||||
{\fdbmajor\f31501\fbidi \fswiss\fcharset128\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt \'91\'76\'91\'cc};}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
|
||||
{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
|
||||
{\fdbminor\f31505\fbidi \fswiss\fcharset128\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt \'91\'76\'91\'cc};}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}
|
||||
{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f40\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f41\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\f43\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f44\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f45\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f46\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
||||
{\f47\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f48\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f50\fbidi \fswiss\fcharset238\fprq2 Arial CE;}{\f51\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}
|
||||
{\f53\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f54\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f55\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f56\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}
|
||||
{\f57\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f58\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f172\fbidi \fswiss\fcharset0\fprq2 SimSun Western{\*\falt \'91\'76\'91\'cc};}
|
||||
{\f170\fbidi \fswiss\fcharset238\fprq2 SimSun CE{\*\falt \'91\'76\'91\'cc};}{\f171\fbidi \fswiss\fcharset204\fprq2 SimSun Cyr{\*\falt \'91\'76\'91\'cc};}{\f173\fbidi \fswiss\fcharset161\fprq2 SimSun Greek{\*\falt \'91\'76\'91\'cc};}
|
||||
{\f174\fbidi \fswiss\fcharset162\fprq2 SimSun Tur{\*\falt \'91\'76\'91\'cc};}{\f176\fbidi \fswiss\fcharset178\fprq2 SimSun (Arabic){\*\falt \'91\'76\'91\'cc};}{\f177\fbidi \fswiss\fcharset186\fprq2 SimSun Baltic{\*\falt \'91\'76\'91\'cc};}
|
||||
{\f178\fbidi \fswiss\fcharset163\fprq2 SimSun (Vietnamese){\*\falt \'91\'76\'91\'cc};}{\f432\fbidi \fswiss\fcharset0\fprq2 @SimSun Western;}{\f430\fbidi \fswiss\fcharset238\fprq2 @SimSun CE;}{\f431\fbidi \fswiss\fcharset204\fprq2 @SimSun Cyr;}
|
||||
{\f433\fbidi \fswiss\fcharset161\fprq2 @SimSun Greek;}{\f434\fbidi \fswiss\fcharset162\fprq2 @SimSun Tur;}{\f436\fbidi \fswiss\fcharset178\fprq2 @SimSun (Arabic);}{\f437\fbidi \fswiss\fcharset186\fprq2 @SimSun Baltic;}
|
||||
{\f438\fbidi \fswiss\fcharset163\fprq2 @SimSun (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
|
||||
{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
|
||||
{\fdbmajor\f31520\fbidi \fswiss\fcharset0\fprq2 SimSun Western{\*\falt \'91\'76\'91\'cc};}{\fdbmajor\f31518\fbidi \fswiss\fcharset238\fprq2 SimSun CE{\*\falt \'91\'76\'91\'cc};}
|
||||
{\fdbmajor\f31519\fbidi \fswiss\fcharset204\fprq2 SimSun Cyr{\*\falt \'91\'76\'91\'cc};}{\fdbmajor\f31521\fbidi \fswiss\fcharset161\fprq2 SimSun Greek{\*\falt \'91\'76\'91\'cc};}
|
||||
{\fdbmajor\f31522\fbidi \fswiss\fcharset162\fprq2 SimSun Tur{\*\falt \'91\'76\'91\'cc};}{\fdbmajor\f31524\fbidi \fswiss\fcharset178\fprq2 SimSun (Arabic){\*\falt \'91\'76\'91\'cc};}
|
||||
{\fdbmajor\f31525\fbidi \fswiss\fcharset186\fprq2 SimSun Baltic{\*\falt \'91\'76\'91\'cc};}{\fdbmajor\f31526\fbidi \fswiss\fcharset163\fprq2 SimSun (Vietnamese){\*\falt \'91\'76\'91\'cc};}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}
|
||||
{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
|
||||
{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
|
||||
{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
|
||||
{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
|
||||
{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
||||
{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbminor\f31560\fbidi \fswiss\fcharset0\fprq2 SimSun Western{\*\falt \'91\'76\'91\'cc};}
|
||||
{\fdbminor\f31558\fbidi \fswiss\fcharset238\fprq2 SimSun CE{\*\falt \'91\'76\'91\'cc};}{\fdbminor\f31559\fbidi \fswiss\fcharset204\fprq2 SimSun Cyr{\*\falt \'91\'76\'91\'cc};}
|
||||
{\fdbminor\f31561\fbidi \fswiss\fcharset161\fprq2 SimSun Greek{\*\falt \'91\'76\'91\'cc};}{\fdbminor\f31562\fbidi \fswiss\fcharset162\fprq2 SimSun Tur{\*\falt \'91\'76\'91\'cc};}
|
||||
{\fdbminor\f31564\fbidi \fswiss\fcharset178\fprq2 SimSun (Arabic){\*\falt \'91\'76\'91\'cc};}{\fdbminor\f31565\fbidi \fswiss\fcharset186\fprq2 SimSun Baltic{\*\falt \'91\'76\'91\'cc};}
|
||||
{\fdbminor\f31566\fbidi \fswiss\fcharset163\fprq2 SimSun (Vietnamese){\*\falt \'91\'76\'91\'cc};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
|
||||
{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
|
||||
{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
|
||||
{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
||||
{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;
|
||||
\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;
|
||||
\red192\green192\blue192;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{
|
||||
\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
|
||||
\snext0 \sqformat \spriority0 Normal;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
|
||||
\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
|
||||
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052
|
||||
\snext11 \ssemihidden \sunhideused \sqformat Normal Table;}}{\*\rsidtbl \rsid9663275}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator Lule}
|
||||
{\creatim\yr2010\mo3\dy4\hr15\min28}{\revtim\yr2010\mo3\dy4\hr15\min28}{\version2}{\edmins0}{\nofpages2}{\nofwords291}{\nofchars2424}{\nofcharsws2710}{\vern32771}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
|
||||
\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
|
||||
\widowctrl\ftnbj\aenddoc\trackmoves1\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120\dghorigin1701
|
||||
\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\rsidroot9663275 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2
|
||||
\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6
|
||||
\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang
|
||||
{\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\af31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 {
|
||||
\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Application:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 ProjectInfo\line }{\rtlch\fcs1 \ab\af1\afs20
|
||||
\ltrch\fcs0 \b\f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Revit Platform:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 All\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid9663275
|
||||
\hich\af1\dbch\af31505\loch\f1 Revit Version:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 2011.0\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1
|
||||
First Released For:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 2008.0\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Programming Language:}{
|
||||
\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 C#\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Skill Level:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0
|
||||
\f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Beginning\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Category:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275
|
||||
\hich\af1\dbch\af31505\loch\f1 Basics\line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Type:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 ExternalCommand
|
||||
\line \line }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Subject:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Display project information.\line }{
|
||||
\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Summary:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 \line Demonstrates how to manipulate project information.}{
|
||||
\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Classes:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\insrsid9663275
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.DB.Element}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.DB.ProjectInfo}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.DB.Analysis.EnergyDataSettings}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.DB.BuiltInParameter}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.DB.Analysis.gbXMLBuildingType}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.DB.Mechanical.MEPBuildingConstruction}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.DB.Analysis.gbXMLServiceType}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.DB.ProjectLocation
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.DB.ProjectPosition
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Autodesk.Revit.DB.Construction
|
||||
\par }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Project Files:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275
|
||||
\hich\af1\dbch\af31505\loch\f1
|
||||
\par \hich\af1\dbch\af31505\loch\f1 Command.cs}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 This file contains the class Command which inherits from IExternalCommand.}{
|
||||
\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Wrappers folder}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 This file contains interface IWrapper and its subclasses}{\rtlch\fcs1 \af0\afs20
|
||||
\ltrch\fcs0 \f0\fs20\insrsid9663275 .}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Those classes are the wrappers of class ProjectInfo, EnergyDataSettings, Construction etc.}{\rtlch\fcs1 \af0\afs20
|
||||
\ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 P\hich\af1\dbch\af31505\loch\f1 rojectInfoForm.cs}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\insrsid9663275
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 This file contains a Form class ProjectInfoForm which consists of ok}{\rtlch\fcs1
|
||||
\af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275 ,}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 cancel buttons and a PropertyGrid which will show the project information}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\insrsid9663275 .
|
||||
\par
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Converters folder
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 This file contains TypeConverters for PropertyGrid usage}{\rtlch\fcs1 \af0\afs20
|
||||
\ltrch\fcs0 \f0\fs20\insrsid9663275 .
|
||||
\par
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 WrapperCustomDescriptor.cs}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
|
||||
\par }\pard \ltrpar\ql \li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1
|
||||
This file contains a custom descriptor which is used with RevitVersionAttribute to control the visibility of properties in different Revit platform.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Description:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\insrsid9663275
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 \hich\f1 This sample is to show the same function as clicking Revit menu \'93\hich\af1\dbch\af31505\loch\f1 \hich\f1 Settings->Project Information\'85\'94\loch\f1
|
||||
that different platform of Revit will show different information.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\tx360\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 -\tab \hich\af1\dbch\af31505\loch\f1
|
||||
To get the project information of a document, use Document.ProjectInformation property}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275 .
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 -\tab \hich\af1\dbch\af31505\loch\f1 \hich\f1 To get the \'93\loch\f1 \hich\f1 Energy Data\'94\loch\f1 use EnergyDataSettings.GetFromDocument(Do\hich\af1\dbch\af31505\loch\f1 cument)}{
|
||||
\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 -\tab \hich\af1\dbch\af31505\loch\f1 To get SiteLocation, using Document.SiteLocation
|
||||
\par -\tab \hich\af1\dbch\af31505\loch\f1 To get all cities, using Application.Cities
|
||||
\par -\tab \hich\af1\dbch\af31505\loch\f1 To get SiteLocation, using Document.SiteLocation
|
||||
\par -\tab \hich\af1\dbch\af31505\loch\f1 To get ProjectLocation, using Document.ActiveProjectLocation
|
||||
\par -\tab \hich\af1\dbch\af31505\loch\f1 To get all ProjectLocations, using \hich\af1\dbch\af31505\loch\f1 Document.ProjectLocations
|
||||
\par -\tab \hich\af1\dbch\af31505\loch\f1 To get all BuildingConstruction, using EnergyDataSettings.GetBuildingConstructionSetElementId
|
||||
\par -\tab \hich\af1\dbch\af31505\loch\f1 To get Construction, using BuildingConstruction.GetBuildingConstruction(ConstructionType)}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275 .
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 -\tab \hich\af1\dbch\af31505\loch\f1 To get all Constructions, using MEPBuil\hich\af1\dbch\af31505\loch\f1 dingConstruction.GetConstructions(ConstructionType)}{\rtlch\fcs1 \af0\afs20
|
||||
\ltrch\fcs0 \f0\fs20\insrsid9663275 .
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 -\tab \hich\af1\dbch\af31505\loch\f1
|
||||
Using TypeConverterAttribute and DisplayNameAttribute to control the display of properties, using BrowsableAttribute and RevitVersionAttribute to control the visibility.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par }{\rtlch\fcs1 \ab\af1\afs20 \ltrch\fcs0 \b\f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 Instructions:}{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\cf2\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0
|
||||
\f0\fs20\cf2\insrsid9663275
|
||||
\par }\pard \ltrpar\ql \fi-360\li360\ri0\nowidctlpar\tx360\wrapdefault\faauto\rin0\lin360\itap0 {\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 1.\tab \hich\af1\dbch\af31505\loch\f1
|
||||
Run the command, there shows a form.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 2.\tab \hich\f1 Modify some information in the PropertyGrid, then click \'93\loch\f1 \hich\f1 OK\'94\loch\f1 button to save the changes}{\rtlch\fcs1 \af0\afs20
|
||||
\ltrch\fcs0 \f0\fs20\insrsid9663275 .
|
||||
\par }{\rtlch\fcs1 \af1\afs20 \ltrch\fcs0 \f1\fs20\insrsid9663275 \hich\af1\dbch\af31505\loch\f1 3.\tab Run the sample in different Revit prouduct (Architecture, Structure, MEP), you will see differe\hich\af1\dbch\af31505\loch\f1
|
||||
nt information in the property grid.}{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\insrsid9663275
|
||||
\par }{\*\themedata 504b030414000600080000002100828abc13fa0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb6ac3301045f785fe83d0b6d8
|
||||
72ba28a5d8cea249777d2cd20f18e4b12d6a8f843409c9df77ecb850ba082d74231062ce997b55ae8fe3a00e1893f354e9555e6885647de3a8abf4fbee29bbd7
|
||||
2a3150038327acf409935ed7d757e5ee14302999a654e99e393c18936c8f23a4dc072479697d1c81e51a3b13c07e4087e6b628ee8cf5c4489cf1c4d075f92a0b
|
||||
44d7a07a83c82f308ac7b0a0f0fbf90c2480980b58abc733615aa2d210c2e02cb04430076a7ee833dfb6ce62e3ed7e14693e8317d8cd0433bf5c60f53fea2fe7
|
||||
065bd80facb647e9e25c7fc421fd2ddb526b2e9373fed4bb902e182e97b7b461e6bfad3f010000ffff0300504b030414000600080000002100a5d6a7e7c00000
|
||||
00360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4fc7060abb08
|
||||
84a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b63095120f88d94fbc
|
||||
52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462a1a82fe353
|
||||
bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f7468656d652f7468
|
||||
656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b4b0d592c9c
|
||||
070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b4757e8d3f7
|
||||
29e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f7468656d65
|
||||
312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87615b8116d8
|
||||
a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad79482a9c04
|
||||
98f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b5d8a314d3c
|
||||
94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab999fb7b471
|
||||
7509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9699640f671
|
||||
9e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd5868b37a088d1
|
||||
e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d60cf03ac1a5
|
||||
193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f9e7ef3f2d1
|
||||
17d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be15c308d3f2
|
||||
8acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a99793849c26ae6
|
||||
6252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d32a423279a
|
||||
668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2af074481847
|
||||
bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86e877f0034e
|
||||
16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb44f95d843b
|
||||
5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a6409fb44d0
|
||||
8741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c3d9058edf2
|
||||
c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db02565e85f3b966
|
||||
0d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276b9f7dec44b
|
||||
7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8c33585b5fb
|
||||
9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e51440ca2e0
|
||||
088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95b21be5ceaf
|
||||
8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff6dce591a26
|
||||
ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec69ffb9e65d0
|
||||
28d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239b75a5bb1e6
|
||||
345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a44959d366ad93
|
||||
b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e82db8df9f30
|
||||
254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f74
|
||||
68656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f24
|
||||
51eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e3198
|
||||
720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528
|
||||
a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100828abc13fa0000001c0200001300000000000000000000000000
|
||||
000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b000000000000000000000000
|
||||
002b0100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c00000000000000000000000000140200007468
|
||||
656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b000016000000000000000000
|
||||
00000000d10200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b010000270000000000
|
||||
00000000000000009b0900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000960a00000000}
|
||||
{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
|
||||
617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
|
||||
6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
|
||||
656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
|
||||
{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
|
||||
\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
|
||||
\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
|
||||
\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
|
||||
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
|
||||
4d73786d6c322e534158584d4c5265616465722e352e3000000000000000000000060000
|
||||
d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||
ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffffec69d9888b8b3d4c859eaf6cd158be0f0000000000000000000000008047
|
||||
d7536cbbca01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000105000000000000}}
|
||||
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// (C) Copyright 2003-2019 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Collections.ObjectModel;
|
||||
using Autodesk.Revit.ApplicationServices;
|
||||
|
||||
namespace Revit.SDK.Samples.ProjectInfo.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Attribute which designates Revit version names
|
||||
/// </summary>
|
||||
public sealed class RevitVersionAttribute : Attribute
|
||||
{
|
||||
#region Fields
|
||||
/// <summary>
|
||||
/// Revit version name array
|
||||
/// </summary>
|
||||
List<ProductType> m_products = new List<ProductType>();
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Gets Revit version names
|
||||
/// </summary>
|
||||
public ReadOnlyCollection<ProductType> Names
|
||||
{
|
||||
get { return m_products.AsReadOnly(); }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
/// <summary>
|
||||
/// Initializes Revit version name array
|
||||
/// </summary>
|
||||
/// <param name="names"></param>
|
||||
public RevitVersionAttribute(params ProductType[] names)
|
||||
{
|
||||
m_products.AddRange(names);
|
||||
}
|
||||
#endregion
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using Autodesk.Revit.DB;
|
||||
|
||||
namespace Revit.SDK.Samples.ProjectInfo.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Wrapper class for Construction
|
||||
/// </summary>
|
||||
[TypeConverter(typeof(ConstructionWrapperConverter))]
|
||||
public class ConstructionWrapper : IComparable, IWrapper
|
||||
{
|
||||
#region Fields
|
||||
/// <summary>
|
||||
/// Construction
|
||||
/// </summary>
|
||||
private Construction m_construction;
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
/// <summary>
|
||||
/// Initializes private variables.
|
||||
/// </summary>
|
||||
/// <param name="construction">Construction</param>
|
||||
public ConstructionWrapper(Construction construction)
|
||||
{
|
||||
m_construction = construction;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
#region IComparable Members
|
||||
|
||||
/// <summary>
|
||||
/// Compares the names of Constructions.
|
||||
/// </summary>
|
||||
/// <param name="obj">ConstructionWrapper used to compare</param>
|
||||
/// <returns>A 32-bit signed integer that indicates the relative order of the objects
|
||||
/// being compared. The return value has these meanings:
|
||||
/// Value Condition Less than zero This instance is less than value.
|
||||
/// Zero This instance is equal to value. Greater than zero This instance is
|
||||
/// greater than value.-or- value is null.</returns>
|
||||
public int CompareTo(object obj)
|
||||
{
|
||||
ConstructionWrapper wrapper = obj as ConstructionWrapper;
|
||||
if (wrapper != null)
|
||||
{
|
||||
return this.Name.CompareTo(wrapper.Name);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IWrapper Members
|
||||
|
||||
/// <summary>
|
||||
/// Gets the handle object.
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public object Handle
|
||||
{
|
||||
get { return m_construction; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the handle.
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public String Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_construction.Name;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,271 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using Autodesk.Revit.ApplicationServices;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.Analysis;
|
||||
using Autodesk.Revit.DB.Mechanical;
|
||||
|
||||
namespace Revit.SDK.Samples.ProjectInfo.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Wrapper class for gbXMLParamElem
|
||||
/// </summary>
|
||||
public class EnergyDataSettingsWrapper : IWrapper
|
||||
{
|
||||
#region Fields
|
||||
/// <summary>
|
||||
/// gbXMLParamElem
|
||||
/// </summary>
|
||||
private EnergyDataSettings m_energyDataSettings;
|
||||
/// <summary>
|
||||
/// Revit Document
|
||||
/// </summary>
|
||||
private Document m_document;
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
/// <summary>
|
||||
/// Initializes private variables.
|
||||
/// </summary>
|
||||
/// <param name="gbXMLParamElem">gbXMLParamElem</param>
|
||||
public EnergyDataSettingsWrapper(Document document)
|
||||
{
|
||||
m_document = document;
|
||||
m_energyDataSettings = EnergyDataSettings.GetFromDocument(document);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Building Type
|
||||
/// </summary>
|
||||
[Category("Common"), DisplayName("Building Type")]
|
||||
[TypeConverter(typeof(BuildingTypeConverter))]
|
||||
public gbXMLBuildingType BuildingType
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_energyDataSettings.BuildingType;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_energyDataSettings.BuildingType = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Ground Plane
|
||||
/// </summary>
|
||||
[Category("Common"), DisplayName("Ground Plane")]
|
||||
[TypeConverter(typeof(ElementIdConverter<Level>))]
|
||||
public ElementId GroundPlane
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_energyDataSettings.GroundPlane;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_energyDataSettings.GroundPlane = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Building Service
|
||||
/// </summary>
|
||||
[Category("Detailed Model"), DisplayName("Building Service")]
|
||||
[TypeConverter(typeof(ServiceTypeConverter))]
|
||||
[RevitVersion(ProductType.MEP)]
|
||||
public gbXMLServiceType BuildingService
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_energyDataSettings.ServiceType;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_energyDataSettings.ServiceType = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets Building Construction
|
||||
/// </summary>
|
||||
[Category("Detailed Model"), DisplayName("Building Construction"), TypeConverter(typeof(WrapperConverter)), RevitVersion(ProductType.MEP)]
|
||||
public MEPBuildingConstructionWrapper BuildingConstruction
|
||||
{
|
||||
get
|
||||
{
|
||||
ElementId eid = EnergyDataSettings.GetBuildingConstructionSetElementId(m_document);
|
||||
MEPBuildingConstruction mEPBuildingConstruction = RevitStartInfo.GetElement(eid) as MEPBuildingConstruction;
|
||||
//MEPBuildingConstruction mEPBuildingConstruction = RevitStartInfo.GetElement(m_energyDataSettings.ConstructionSetElementId) as MEPBuildingConstruction;
|
||||
if(mEPBuildingConstruction != null)
|
||||
return new MEPBuildingConstructionWrapper(mEPBuildingConstruction);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets and Sets BuildingConstructionClass
|
||||
/// </summary>
|
||||
[Category("Detailed Model"), DisplayName("Building Infiltration Class")]
|
||||
[TypeConverter(typeof(HVACLoadConstructionClassConverter))]
|
||||
[RevitVersion(ProductType.MEP)]
|
||||
public HVACLoadConstructionClass BuildingConstructionClass
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_energyDataSettings.BuildingConstructionClass;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_energyDataSettings.BuildingConstructionClass = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Project Phase
|
||||
/// </summary>
|
||||
[Category("Detailed Model"), DisplayName("Project Phase")]
|
||||
[TypeConverter(typeof(ElementIdConverter<Phase>))]
|
||||
public ElementId ProjectPhase
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_energyDataSettings.ProjectPhase;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_energyDataSettings.ProjectPhase = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Sliver Space Tolerance
|
||||
/// </summary>
|
||||
[Category("Detailed Model"), DisplayName("Sliver Space Tolerance")]
|
||||
public Double SliverSpaceTolerance
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_energyDataSettings.SliverSpaceTolerance;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_energyDataSettings.SliverSpaceTolerance = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Export Complexity
|
||||
/// </summary>
|
||||
[Category("Detailed Model"), DisplayName("Export Complexity")]
|
||||
[TypeConverter(typeof(ExportComplexityConverter))]
|
||||
public gbXMLExportComplexity ExportComplexity
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_energyDataSettings.ExportComplexity;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_energyDataSettings.ExportComplexity = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Export Default Values
|
||||
/// </summary>
|
||||
[Category("Detailed Model"), DisplayName("Export Default Values")]
|
||||
[RevitVersion(ProductType.MEP)]
|
||||
public bool ExportDefaultValues
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_energyDataSettings.ExportDefaults;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_energyDataSettings.ExportDefaults = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets and Sets ProjectReportType
|
||||
/// </summary>
|
||||
[Category("Detailed Model"), DisplayName("Report Type")]
|
||||
[TypeConverter(typeof(HVACLoadLoadsReportTypeConverter))]
|
||||
[RevitVersion(ProductType.MEP)]
|
||||
public HVACLoadLoadsReportType ProjectReportType
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_energyDataSettings.ProjectReportType;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_energyDataSettings.ProjectReportType = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets Project Location
|
||||
/// </summary>
|
||||
[DisplayName("Project Location"), TypeConverter(typeof(ProjectLocationConverter)), RevitVersion(ProductType.MEP, ProductType.Architecture)]
|
||||
public ProjectLocation ProjectLocation
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_document.ActiveProjectLocation;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_document.ActiveProjectLocation = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets Site Location
|
||||
/// </summary>
|
||||
[DisplayName("Site Location"), TypeConverter(typeof(WrapperConverter)), RevitVersion(ProductType.MEP, ProductType.Architecture)]
|
||||
public SiteLocationWrapper SiteLocation
|
||||
{
|
||||
get
|
||||
{
|
||||
return new SiteLocationWrapper(m_document.SiteLocation);
|
||||
}
|
||||
}
|
||||
|
||||
#region IWrapper Members
|
||||
|
||||
/// <summary>
|
||||
/// Gets the handle object.
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public object Handle
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_energyDataSettings;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the handle.
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "";
|
||||
}
|
||||
set
|
||||
{
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,237 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.Mechanical;
|
||||
using ConstructionType = Autodesk.Revit.DB.Analysis.ConstructionType;
|
||||
|
||||
namespace Revit.SDK.Samples.ProjectInfo.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Wrapper class for MEPBuildingConstruction
|
||||
/// </summary>
|
||||
public class MEPBuildingConstructionWrapper : IWrapper
|
||||
{
|
||||
#region Fields
|
||||
/// <summary>
|
||||
/// MEPBuildingConstruction
|
||||
/// </summary>
|
||||
private MEPBuildingConstruction m_mEPBuildingConstruction;
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
/// <summary>
|
||||
/// Initializes private variables.
|
||||
/// </summary>
|
||||
/// <param name="mEPBuildingConstruction">MEPBuildingConstruction</param>
|
||||
public MEPBuildingConstructionWrapper(MEPBuildingConstruction mEPBuildingConstruction)
|
||||
{
|
||||
m_mEPBuildingConstruction = mEPBuildingConstruction;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Gets or sets Roofs
|
||||
/// </summary>
|
||||
[DisplayName("Roofs")]
|
||||
public ConstructionWrapper Roof
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ConstructionWrapper(m_mEPBuildingConstruction.GetBuildingConstruction(ConstructionType.Roof));
|
||||
}
|
||||
set
|
||||
{
|
||||
m_mEPBuildingConstruction.SetBuildingConstruction(ConstructionType.Roof, value.Handle as Construction);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Exterior Walls
|
||||
/// </summary>
|
||||
[DisplayName("Exterior Walls")]
|
||||
public ConstructionWrapper ExteriorWall
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ConstructionWrapper(m_mEPBuildingConstruction.GetBuildingConstruction(ConstructionType.ExteriorWall));
|
||||
}
|
||||
set
|
||||
{
|
||||
m_mEPBuildingConstruction.SetBuildingConstruction(ConstructionType.ExteriorWall, value.Handle as Construction);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Interior Walls
|
||||
/// </summary>
|
||||
[DisplayName("Interior Walls")]
|
||||
public ConstructionWrapper InteriorWall
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ConstructionWrapper(m_mEPBuildingConstruction.GetBuildingConstruction(ConstructionType.InteriorWall));
|
||||
}
|
||||
set
|
||||
{
|
||||
m_mEPBuildingConstruction.SetBuildingConstruction(ConstructionType.InteriorWall, value.Handle as Construction);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Ceilings
|
||||
/// </summary>
|
||||
[DisplayName("Ceilings")]
|
||||
public ConstructionWrapper Ceiling
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ConstructionWrapper(m_mEPBuildingConstruction.GetBuildingConstruction(ConstructionType.Ceiling));
|
||||
}
|
||||
set
|
||||
{
|
||||
m_mEPBuildingConstruction.SetBuildingConstruction(ConstructionType.Ceiling, value.Handle as Construction);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Doors
|
||||
/// </summary>
|
||||
[DisplayName("Doors")]
|
||||
public ConstructionWrapper Door
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ConstructionWrapper(m_mEPBuildingConstruction.GetBuildingConstruction(ConstructionType.Door));
|
||||
}
|
||||
set
|
||||
{
|
||||
m_mEPBuildingConstruction.SetBuildingConstruction(ConstructionType.Door, value.Handle as Construction);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Slabs
|
||||
/// </summary>
|
||||
[DisplayName("Slabs")]
|
||||
public ConstructionWrapper Slab
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ConstructionWrapper(m_mEPBuildingConstruction.GetBuildingConstruction(ConstructionType.Slab));
|
||||
}
|
||||
set
|
||||
{
|
||||
m_mEPBuildingConstruction.SetBuildingConstruction(ConstructionType.Slab, value.Handle as Construction);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Floors
|
||||
/// </summary>
|
||||
[DisplayName("Floors")]
|
||||
public ConstructionWrapper Floor
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ConstructionWrapper(m_mEPBuildingConstruction.GetBuildingConstruction(ConstructionType.Floor));
|
||||
}
|
||||
set
|
||||
{
|
||||
m_mEPBuildingConstruction.SetBuildingConstruction(ConstructionType.Floor, value.Handle as Construction);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Exterior Windows
|
||||
/// </summary>
|
||||
[DisplayName("Exterior Windows")]
|
||||
public ConstructionWrapper ExteriorWindow
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ConstructionWrapper(m_mEPBuildingConstruction.GetBuildingConstruction(ConstructionType.ExteriorWindow));
|
||||
}
|
||||
set
|
||||
{
|
||||
m_mEPBuildingConstruction.SetBuildingConstruction(ConstructionType.ExteriorWindow, value.Handle as Construction);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Interior Windows
|
||||
/// </summary>
|
||||
[DisplayName("Interior Windows")]
|
||||
public ConstructionWrapper InteriorWindow
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ConstructionWrapper(m_mEPBuildingConstruction.GetBuildingConstruction(ConstructionType.ExteriorWindow));
|
||||
}
|
||||
set
|
||||
{
|
||||
m_mEPBuildingConstruction.SetBuildingConstruction(ConstructionType.ExteriorWindow, value.Handle as Construction);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Skylights
|
||||
/// </summary>
|
||||
[DisplayName("Skylights")]
|
||||
public ConstructionWrapper Skylight
|
||||
{
|
||||
get
|
||||
{
|
||||
return new ConstructionWrapper(m_mEPBuildingConstruction.GetBuildingConstruction(ConstructionType.Skylight));
|
||||
}
|
||||
set
|
||||
{
|
||||
m_mEPBuildingConstruction.SetBuildingConstruction(ConstructionType.Skylight, value.Handle as Construction);
|
||||
}
|
||||
}
|
||||
|
||||
#region IWrapper Members
|
||||
|
||||
/// <summary>
|
||||
/// Gets the handle object.
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public object Handle
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_mEPBuildingConstruction;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the handle.
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_mEPBuildingConstruction.Name;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_mEPBuildingConstruction.Name = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
/// <summary>
|
||||
/// Get constructions
|
||||
/// </summary>
|
||||
/// <param name="constructionType">ConstructionType</param>
|
||||
/// <returns>Related Constructions specified by constructionTypes</returns>
|
||||
public ICollection<Construction> GetConstructions(ConstructionType constructionType)
|
||||
{
|
||||
return m_mEPBuildingConstruction.GetConstructions(constructionType);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using Autodesk.Revit.ApplicationServices;
|
||||
|
||||
namespace Revit.SDK.Samples.ProjectInfo.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Wrapper class for ProjectInfo
|
||||
/// </summary>
|
||||
public class ProjectInfoWrapper : IWrapper
|
||||
{
|
||||
#region Fields
|
||||
/// <summary>
|
||||
/// ProjectInfo
|
||||
/// </summary>
|
||||
private Autodesk.Revit.DB.ProjectInfo m_projectInfo;
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
/// <summary>
|
||||
/// Initializes private variables.
|
||||
/// </summary>
|
||||
/// <param name="projectInfo">ProjectInfo</param>
|
||||
public ProjectInfoWrapper(Autodesk.Revit.DB.ProjectInfo projectInfo)
|
||||
{
|
||||
m_projectInfo = projectInfo;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Gets gbXMLSettings
|
||||
/// </summary>
|
||||
[Category("Energy Analysis"), DisplayName("Energy Settings")]
|
||||
[TypeConverter(typeof(WrapperConverter))]
|
||||
[RevitVersion(ProductType.MEP, ProductType.Architecture)]
|
||||
public ICustomTypeDescriptor EnergyDataSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
return new WrapperCustomDescriptor(new EnergyDataSettingsWrapper(m_projectInfo.Document));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Project Issue Data
|
||||
/// </summary>
|
||||
[Category("Other"), DisplayName("Project Issue Data")]
|
||||
public String IssueDate
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_projectInfo.IssueDate;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_projectInfo.IssueDate = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Project Status
|
||||
/// </summary>
|
||||
[Category("Other"), DisplayName("Project Status")]
|
||||
public String Status
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_projectInfo.Status;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_projectInfo.Status = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Client Name
|
||||
/// </summary>
|
||||
[Category("Other"), DisplayName("Client Name")]
|
||||
public String ClientName
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_projectInfo.ClientName;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_projectInfo.ClientName = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Project Address
|
||||
/// </summary>
|
||||
[Category("Other"), DisplayName("Project Address")]
|
||||
public String Address
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_projectInfo.Address;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_projectInfo.Address = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Project Number
|
||||
/// </summary>
|
||||
[Category("Other"), DisplayName("Project Number")]
|
||||
public String Number
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_projectInfo.Number;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_projectInfo.Number = value;
|
||||
}
|
||||
}
|
||||
|
||||
#region IWrapper Members
|
||||
|
||||
/// <summary>
|
||||
/// Gets the handle object.
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public object Handle
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_projectInfo;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the handle.
|
||||
/// </summary>
|
||||
[Category("Other"), DisplayName("Project Name")]
|
||||
public String Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_projectInfo.Name;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_projectInfo.Name = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using Autodesk.Revit.DB;
|
||||
|
||||
namespace Revit.SDK.Samples.ProjectInfo.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// Wrapper class for SiteLocation
|
||||
/// </summary>
|
||||
public class SiteLocationWrapper : IWrapper
|
||||
{
|
||||
#region Fields
|
||||
/// <summary>
|
||||
/// SiteLocation
|
||||
/// </summary>
|
||||
private SiteLocation m_siteLocation;
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
/// <summary>
|
||||
/// Initializes private variables.
|
||||
/// </summary>
|
||||
/// <param name="siteLocation"></param>
|
||||
public SiteLocationWrapper(SiteLocation siteLocation)
|
||||
{
|
||||
m_siteLocation = siteLocation;
|
||||
//m_citys = RevitStartInfo.RevitApp.Cities;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Gets or sets TimeZone
|
||||
/// </summary>
|
||||
[DisplayName("Time Zone"), TypeConverter(typeof(TimeZoneConverter))]
|
||||
public String TimeZone
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetTimeZoneFromDouble(m_siteLocation.TimeZone);
|
||||
}
|
||||
//set
|
||||
//{
|
||||
// m_siteLocation.TimeZone = GetTimeZoneFromString(value);
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Longitude
|
||||
/// </summary>
|
||||
[DisplayName("Longitude"), TypeConverter(typeof(AngleConverter))]
|
||||
public double Longitude
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_siteLocation.Longitude;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_siteLocation.Longitude = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Latitude
|
||||
/// </summary>
|
||||
[DisplayName("Latitude"), TypeConverter(typeof(AngleConverter))]
|
||||
public double Latitude
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_siteLocation.Latitude;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_siteLocation.Latitude = value;
|
||||
}
|
||||
}
|
||||
|
||||
[DisplayName("City"), TypeConverter(typeof(CityConverter))]
|
||||
public City City
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetCityFromPosition(Latitude, Longitude);
|
||||
}
|
||||
set
|
||||
{
|
||||
m_siteLocation.Latitude = value.Latitude;
|
||||
m_siteLocation.Longitude = value.Longitude;
|
||||
m_siteLocation.TimeZone = value.TimeZone;
|
||||
}
|
||||
}
|
||||
|
||||
private City GetCityFromPosition(double latitude, double longitude)
|
||||
{
|
||||
foreach (City city in RevitStartInfo.RevitApp.Cities)
|
||||
{
|
||||
if (DoubleEquals(city.Latitude, latitude) && DoubleEquals(city.Longitude, longitude))
|
||||
return city;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static bool DoubleEquals(double x, double y)
|
||||
{
|
||||
return Math.Abs(x - y) < 1E-9;
|
||||
}
|
||||
|
||||
#region IWrapper Members
|
||||
|
||||
/// <summary>
|
||||
/// Gets the handle object.
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public object Handle
|
||||
{
|
||||
get { return m_siteLocation; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the handle.
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public String Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_siteLocation.Name;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_siteLocation.Name = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Get time zone double value from time zone string
|
||||
/// </summary>
|
||||
/// <param name="value">time zone string</param>
|
||||
/// <returns>the value of time zone</returns>
|
||||
private double GetTimeZoneFromString(string value)
|
||||
{
|
||||
//i.e. convert "(GMT-12:00) International Date Line West" to 12.0
|
||||
//i.e. convert "(GMT-03:30) Newfoundland" to 3.30
|
||||
string timeZoneDouble = value.Substring(4, value.IndexOf(')') - 4).Replace(':', '.').Trim();
|
||||
if (string.IsNullOrEmpty(timeZoneDouble))
|
||||
return 0d;
|
||||
else
|
||||
return Double.Parse(timeZoneDouble);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get time zone display string from time zone value
|
||||
/// </summary>
|
||||
/// <param name="timeZone">zone value</param>
|
||||
/// <returns>display string</returns>
|
||||
private string GetTimeZoneFromDouble(double timeZone)
|
||||
{
|
||||
// e.g. get "(GMT-04:00) Santiago" from double number 4.0
|
||||
// should find the last one who matches the time zone
|
||||
string lastTimeZone = null;
|
||||
foreach (string tmpTimeZone in RevitStartInfo.TimeZones)
|
||||
{
|
||||
object tmpZone = this.GetTimeZoneFromString(tmpTimeZone);
|
||||
if ((double)tmpZone == timeZone)
|
||||
lastTimeZone = tmpTimeZone;
|
||||
}
|
||||
return lastTimeZone;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
//
|
||||
// (C) Copyright 2003-2019 by Autodesk, Inc.
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software in
|
||||
// object code form for any purpose and without fee is hereby granted,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both that copyright notice and the limited warranty and
|
||||
// restricted rights notice below appear in all supporting
|
||||
// documentation.
|
||||
//
|
||||
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
|
||||
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
|
||||
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
|
||||
// UNINTERRUPTED OR ERROR FREE.
|
||||
//
|
||||
// Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
// restrictions set forth in FAR 52.227-19 (Commercial Computer
|
||||
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
|
||||
// (Rights in Technical Data and Computer Software), as applicable.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Revit.SDK.Samples.ProjectInfo.CS
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class WrapperCustomDescriptor : ICustomTypeDescriptor, IWrapper
|
||||
{
|
||||
#region Fields
|
||||
/// <summary>
|
||||
/// Handle object
|
||||
/// </summary>
|
||||
object m_handle = null;
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
/// <summary>
|
||||
/// Initializes handle object
|
||||
/// </summary>
|
||||
/// <param name="handle">Handle object</param>
|
||||
public WrapperCustomDescriptor(object handle)
|
||||
{
|
||||
m_handle = handle;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets handle object
|
||||
/// </summary>
|
||||
public object Handle
|
||||
{
|
||||
get { return m_handle; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the handle object if it has the Name property,
|
||||
/// otherwise returns Handle.ToString().
|
||||
/// </summary>
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
MethodInfo mi = this.Handle.GetType().GetMethod("get_Name", new Type[0]);
|
||||
if (mi != null)
|
||||
{
|
||||
object name = mi.Invoke(this.Handle, new object[0]);
|
||||
if (name != null)
|
||||
{
|
||||
return name.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
return Handle.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
#region ICustomTypeDescriptor Members
|
||||
|
||||
/// <summary>
|
||||
/// Returns a collection of custom attributes for this instance of a component.
|
||||
/// </summary>
|
||||
/// <returns>Handle's attributes</returns>
|
||||
public AttributeCollection GetAttributes()
|
||||
{
|
||||
return TypeDescriptor.GetAttributes(m_handle, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the class name of this instance of a component.
|
||||
/// </summary>
|
||||
/// <returns>Handle's class name</returns>
|
||||
public string GetClassName()
|
||||
{
|
||||
return TypeDescriptor.GetClassName(m_handle, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the name of this instance of a component.
|
||||
/// </summary>
|
||||
/// <returns>The name of handle object</returns>
|
||||
public string GetComponentName()
|
||||
{
|
||||
return TypeDescriptor.GetComponentName(m_handle, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a type converter for this instance of a component.
|
||||
/// </summary>
|
||||
/// <returns>The converter of the handle</returns>
|
||||
public TypeConverter GetConverter()
|
||||
{
|
||||
return TypeDescriptor.GetConverter(m_handle, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the default event for this instance of a component.
|
||||
/// </summary>
|
||||
/// <returns>An EventDescriptor that represents the default event for this object,
|
||||
/// or null if this object does not have events.</returns>
|
||||
public EventDescriptor GetDefaultEvent()
|
||||
{
|
||||
return TypeDescriptor.GetDefaultEvent(m_handle, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the default property for this instance of a component.
|
||||
/// </summary>
|
||||
/// <returns>A PropertyDescriptor that represents the default property for this object,
|
||||
/// or null if this object does not have properties.</returns>
|
||||
public PropertyDescriptor GetDefaultProperty()
|
||||
{
|
||||
return TypeDescriptor.GetDefaultProperty(m_handle, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an editor of the specified type for this instance of a component.
|
||||
/// </summary>
|
||||
/// <param name="editorBaseType">A Type that represents the editor for this object. </param>
|
||||
/// <returns>An Object of the specified type that is the editor for this object,
|
||||
/// or null if the editor cannot be found.</returns>
|
||||
public object GetEditor(Type editorBaseType)
|
||||
{
|
||||
return TypeDescriptor.GetEditor(m_handle, editorBaseType, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the events for this instance of a component using the specified attribute array as a filter.
|
||||
/// </summary>
|
||||
/// <param name="attributes">An array of type Attribute that is used as a filter. </param>
|
||||
/// <returns>An EventDescriptorCollection that represents the filtered events for this component instance.</returns>
|
||||
public EventDescriptorCollection GetEvents(Attribute[] attributes)
|
||||
{
|
||||
return TypeDescriptor.GetEvents(m_handle, attributes, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the events for this instance of a component.
|
||||
/// </summary>
|
||||
/// <returns>An EventDescriptorCollection that represents the events for this component instance.</returns>
|
||||
public EventDescriptorCollection GetEvents()
|
||||
{
|
||||
return TypeDescriptor.GetEvents(m_handle, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the properties for this instance of a component using the attribute array as a filter.
|
||||
/// </summary>
|
||||
/// <param name="attributes">An array of type Attribute that is used as a filter.</param>
|
||||
/// <returns>A PropertyDescriptorCollection that
|
||||
/// represents the filtered properties for this component instance.</returns>
|
||||
public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
|
||||
{
|
||||
// get handle's properties
|
||||
PropertyDescriptorCollection collection = TypeDescriptor.GetProperties(m_handle, attributes, false);
|
||||
// create empty collection
|
||||
PropertyDescriptorCollection collection2 = new PropertyDescriptorCollection(new PropertyDescriptor[0]);
|
||||
|
||||
// filter properties by RevitVersionAttribute.
|
||||
// if there is RevitVersionAttribute specified and the designated names does not
|
||||
// contain current Revit version, the property will not be exposed.
|
||||
foreach (PropertyDescriptor pd in collection)
|
||||
{
|
||||
bool matchRevitVersion = true;
|
||||
foreach (Attribute att in pd.Attributes)
|
||||
{
|
||||
RevitVersionAttribute pfa = att as RevitVersionAttribute;
|
||||
if (pfa != null)
|
||||
{
|
||||
if (!pfa.Names.Contains(RevitStartInfo.RevitProduct))
|
||||
matchRevitVersion = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (matchRevitVersion)
|
||||
collection2.Add(pd);
|
||||
}
|
||||
return collection2;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the properties for this instance of a component.
|
||||
/// </summary>
|
||||
/// <returns>A PropertyDescriptorCollection that represents the properties
|
||||
/// for this component instance.</returns>
|
||||
public PropertyDescriptorCollection GetProperties()
|
||||
{
|
||||
return TypeDescriptor.GetProperties(m_handle, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an object that contains the property described by the specified property descriptor.
|
||||
/// </summary>
|
||||
/// <param name="pd">A PropertyDescriptor that represents the property whose owner is to be found. </param>
|
||||
/// <returns>Handle object</returns>
|
||||
public object GetPropertyOwner(PropertyDescriptor pd)
|
||||
{
|
||||
return m_handle;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// overrides ToString method
|
||||
/// </summary>
|
||||
/// <returns>The name of the handle object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return this.Name;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// (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.Text;
|
||||
|
||||
using Autodesk.Revit;
|
||||
|
||||
namespace Revit.SDK.Samples.ProjectInfo.CS
|
||||
{
|
||||
/// <summary>
|
||||
/// wrapper interface
|
||||
/// </summary>
|
||||
public interface IWrapper
|
||||
{
|
||||
#region Properties
|
||||
/// <summary>
|
||||
/// Gets the handle object.
|
||||
/// </summary>
|
||||
object Handle
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the handle.
|
||||
/// </summary>
|
||||
string Name
|
||||
{
|
||||
get;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user