Revit 2014 发布, Revit 2014 API新功能


Revit 2014 SDK 下载地址:

http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=2484975


Major changesand renovations to the Revit API

Document APIs

Document.Save()

Several modifications have been made to the Document.Save()methods.

·        The methods now return void instead of boolean.

·        Failures are signaled with specified documented exceptions.

·        The new property SaveOptions.Compact allows the caller tospecify if the OS should eliminate all dead data from the file on disk.

Document.SaveAs()

Several modifications have been made to the Document.SaveAs()functions.

·        The methods now return void instead of boolean.

·        Failures are signaled with specified documented exceptions.

·        The new property SaveAsOptions.MaximumBackups identifies themaximum number of backups to keep on disk.

·        The new property SaveAsOptions.Compact allows the caller tospecify if the OS should eliminate all dead data from the file on disk.

·        The new property SaveAsOptions.WorksharingOptions offers optionsspecific to workshared files:

·        WorksharingSaveAsOptions.SaveAsCentral

·        WorksharingSaveAsOptions.OpenWorksetsDefault

·        WorksharingSaveAsOptions.ClearTransmitted

·        The property SaveAsOptions.Rename has been obsoleted.  Theproperty previously had no effect, use of SaveAs will always modify thedocument in memory.

In addition, a new version of SaveAs() taking a ModelPath andSaveAsOptions has been introduced.  This offers capabilities similar inbehavior to SaveAs(string, SaveAsOptions).

OpenOptions

New options are available in this class:

·        OpenOptions.Audit

This boolean option specifies whether to expand all elements, tocheck for corruption.  Defaults to false.

·        OpenOptions.AllowOpeningLocalByWrongUser

This boolean option specifies whether a local file is allowed tobe opened ReadOnly by a user other than its owner.

·        OpenOptions.GetOpenWorksetsConfiguration()

·        OpenOptions.SetOpenWorksetsConfiguration()

These methods access the WorksetConfiguration.   Thisclass specifies which user-created worksets should be opened/closed when thedocument is opened.  Once an instance of this class is created, it can befurther modified by calling available methods in any order.  It is aspecification of a setting for model open; the methods of this class justadjust the specification, and do not themselves open or close worksets.

Only user-created worksets can be specified to be opened orclosed.  All system worksets are automatically open.  An open worksetallows its elements can be expanded and displayed. For a closed workset, Revittries to not expand its elements, and to that end, does not display them. Thisis intended to help with performance by reducing Revit's memory footprint.

An application can determine how to populate this class bylooking at workset information from a closed document.  This is done bycalling

·        WorksharingUtil.GetUserWorksetInfo()

This method returns a collection of WorksetPreview classes containingthe workset id, unique id, owner, name and whether or not the workset isdefault.

Application.OpenDocumentFile(ModelPath,OpenOptions)

This method has been reimplemented.  While the signaturehas not changed, there are new options available to be set inOpenOptions. 

Failures are now signaled with specific documented exceptions.

Application.OpenDocumentFile(String)

This method has been reimplemented.  While the signaturehas not changed, failures are now signaled with specific documented exceptions.

UIApplication.OpenAndActivateDocument(ModelPath,OpenOptionsForUI)

The signature and the implementation of this method has changed.

·        The class OpenOptionsForUI has been removed.

·        The new signature is (ModelPath, OpenOptions, BooleandetachAndPrompt). 

If you wish to let the user answer interactively the prompt ofwhether to preserve or discard worksets when opening the documented detachedfrom central, set the following values:

·        OpenOptions.DetachFromCentralOption = DoNotDetach

·        Boolean argment "detachAndPrompt" = true.

Failures are now signaled with specific documented exceptions.

UIApplication.OpenAndActivateDocument(String)

This method has been reimplemented.  Failures are nowsignaled with specific documented exceptions.

FilteredElementCollector

Iterationand element deletion

When an element is deleted active iterations over the document(via FilteredElementCollector) are now stopped. A new InvalidOperationExceptionis thrown.  The iterator cannot proceed due to changes made to the Elementtable in Revit's database (typically, this can be the result of an Elementdeletion). This affects the use of FilteredElementIterator,FilteredElementIdIterator, and foreach loops over a FilteredElementCollector.

The exception can be triggered by direct calls to Document.Delete(),but also by other Revit APIs which change the document resulting in an elementbeing deleted. In general it is best not to make any changes to the documentwhile an iterator is running over the document.

The simplest workaround to fix existing code which encountersthis error is to use one of:

·        FilteredElementCollector.ToElements()

·        FilteredElementCollector.ToElementIds()

·        FilteredElementCollector.ToList() (LINQ method)

to get a standalone collection, then iterate thatcollection.  Even if elements are deleted from the document, the iterationof the already fetched collection can proceed.

Geometry APIs

Curvecreation

New curve creation methods have been added as statics on theassociated curve type:

·        Curve.CreateTransformed()

·        Line.CreateBound()

·        Line.CreateUnbound()

·        Arc.Create()

·        Ellipse.Create()

·        NurbSpline.Create()

·        HermiteSpline.Create()

The older curve creation properties and methods are nowobsolete:

·        Curve.Transformed

·        Line.Bound

·        Line.Unbound

·        Autodesk.Revit.Creation.Application.NewLine()

·        Autodesk.Revit.Creation.Application.NewLineBound()

·        Autodesk.Revit.Creation.Application.NewLineUnbound()

·        Autodesk.Revit.Creation.Application.NewArc()

·        Autodesk.Revit.Creation.Application.NewEllipse()

·        Autodesk.Revit.Creation.Application.NewNurbSpline()

·        Autodesk.Revit.Creation.Application.NewHermiteSpline()

Both the old and new curve creation routines are updated toconsistently prevent creation of curves smaller than Revit's tolerance. Thisvalue is now exposed via:

·        Application.ShortCurveTolerance

Some other adjustments have been made to the validation onspecific curve creation routines, consult the documentation for details.

Curveutilities

The new methods:

·        GetEndPoint()

·        GetEndParameter()

·        GetEndPointReference()

replace the indexed property utilities on Curve:

·        EndPoint

·        EndParameter

·        EndPointReference

The setter for EndParameter is deprecated and code should beadjusted to call MakeBound(double, double) instead.

Edgeutilities

The new methods:

·        Edge.GetFace()

·        Edge.GetEndPointReference()

replace:

·        Edge.Face (property)

·        Edge.EndPointReference (property)

Transforminitialization

The new methods:

·        Transform.CreateTranslation()

·        Transform.CreateRotation()

·        Transform.CreateRotationAtPoint()

·        Transform.CreateReflection()

replace:

·        Transform.Translation (property)

·        Transform.Rotation (property)

·        Transform.Reflection (property)

SketchPlane creation

The SketchPlane creation methods ofAutodesk.Revit.Creation.ItemFactoryBase have been replaced.

·        SketchPlane.Create(Document, Plane) replacesItemFactoryBase.NewSketchPlane(Plane)

·        SketchPlane.Create(Document, Reference) replacesItemFactoryBase.NewSketchPlane(Reference)

·        Either method may be appropriate to replace calls toItemFactoryBase.NewSketchPlane(PlanarFace), depending on whether the goal is asketch plane tied to a Revit geometric reference, or a sketch plane fixed inspace to a given plane.

A new SketchPlane creation has been added:

·        SketchPlane.Create(ElementId)

This creates a SketchPlane from a grid, reference plane, orlevel.

SketchPlane also now has two more methods to get relatedproperties of the SketchPlane element.

·        SketchPlane.GetPlane() Returns the corresponding Plane.

·        SketchPlane.GetPlaneReference()  Returns a referenceto this element as a plane.

 

BeamSystem creation

The BeamSystem creation methods of Autodesk.Revit.Creation.Documenthave been replaced:

·        BeamSystem.Create(Document, IList, SketchPlane,int) replaces Document.NewBeamSystem(CurveArray, SketchPlane)

·        BeamSystem.Create(Document, IList, SketchPlane,XYZ, bool) replaces Document.NewBeamSystem(CurveArray, SketchPlane, XYZ, bool)

·        BeamSystem.Create(Document, IList, Level, int,bool) replaces Document.NewBeamSystem(CurveArray, Level)

·        BeamSystem.Create(Document, IList, Level, XYZ,bool) replaces Document.NewBeamSystem(CurveArray, Level, XYZ, bool)

Truss creation

The Truss creation method of Autodesk.Revit.Creation.Documenthave been replaced.

·        Truss.Create(Document, ElementId, ElementId, Curve) replacesDocument.NewTruss(TrussType, SketchPlane, Curve)

Family Symbol API

Family symbols that are not used in the document are nowinactive until they are used.  A symbol's geometry will be empty andshould not be accessed until it is active.  To test if a symbol is active,use

·        FamilySymbol.IsActive()

To activate an inactive family symbol, use

·        FamilySymbol.Activate()

Units API

The API for Units in Revit has been expanded and changed. Themethods

·        Document.GetUnits()

·        Document.SetUnits()

allow interaction with the units of a document.  The Unitsclass provides access to data such as

·        DecimalSymbol

·        DigitGroupingAmount

·        DigitGroupingSymbol

·        FormatOptions

TheFormatOptions class provides access to data including:
 

·        Rounding

·        Accuracy

·        DisplayUnits

·        SuppressLeadingZeros

·        SuppressTrailingZeros

·        SuppressSpaces

LabelUtils.GetLabelFor() has been enhanced so that it can nowreturn the user-visible name for a UnitSymbolType.

UnitFormatting and Parsing

The methods:

·        UnitFormatUtils.FormatValueToString()

·        UnitFormatUtils.TryParse()

provide the ability to format a value into a string based onformatting options and to parse a formatted string (including units) intoa value if possible.

UnitConversion

The new class UnitUtils contains methods to convert between unittypes:

·        UnitUtils.Convert() - Converts a value from one unit typeto another, such as square feet to square meters.

·        UnitUtils.ConvertFromInternalUnits() - Converts a valuefrom Revit's internal unit type.

·        UnitUtils.ConvertToInternalUnits() - Converts a value toRevit's internal unit type.

View API changes

Viewport.Createbehavioral change

The method

·        Viewport.Create()

previously did not consistently align the center of the Viewportwith the point supplied.  This has been changed, and now the center willbe aligned with the input point.  This should allow easier alignment ofmultiple viewports on the same sheet.

View.ViewNameobsolete

The property

·        View.ViewName

is now obsolete.  View.Name can be used.

View.SetVisibility()

The name of this method has now been correctly capitalized.

ViewSchedulechanges

ViewSchedule is now a child of TableView.   Allpreviously existing ViewSchedule API is still valid, but TableView also bringsin a set of APIs related to:

·        Table sections (header and body)

·        Table formatting

·        The contents of individual table cells

There are methods on TableView (and its constituent TableDataand TableSectionData class) that are useful for Electrical Panel Schedules andsome varieties of specialized schedules but forbidden for use with standardRevit tabular schedules generated from Revit content (e.g. InsertRow(), RemoveRow()).  Use of these functions on standard Revit schedules will result in an exception.

Some new members were introduced on schedule related classes:

·        ScheduleField.SetStyle()

·        ScheduleField.GetStyle()

·        ScheduleField.IsOverridden

·        ScheduleField.ResetOverrides()

·        ScheduleField.GetFormatOptions()

·        ScheduleField.SetFormatOptions()

relate to the style and formatting applied to schedule columns,and:

·        ScheduleField.IsCalculatedField

·        ScheduleField.IsCombinedParameterField

·        ScheduleField.HasSchedulableField

relate to information about the type of a field.

The new members:

·        ViewSchedule.GetFontId()

·        ViewSchedule.AddFontId()

provide access to fonts stored in the table and applied tocells.

The new members:

·        ViewSchedule.GroupHeaders()

·        ViewSchedule.UngroupHeaders()

·        ViewSchedule.CanGroupHeaders()

·        ViewSchedule.CanUngroupHeaders()

affect header grouping in the schedule.

The new method:

·        ViewSchedule.GetTableData()

returns the object which provides access to the sections of thetable.

Materials API changes

Applyingvisual materials

The method

·        Material.SetRenderAppearance()

has been deprecated.  The Render appearance propertiesshould be set via the related ApperanceAssetElement. 

Use the new property:

·        Material.AppearanceAssetId

to assign the element to the material.

AppearanceAssetElements can be found via element filtering -they expose the following members:

·        AppearanceAssetElement.Create() - creates a new asset elementfor a given rendering Asset and name.

·        AppearanceAssetElement.GetAppearanceAssetElementByName() - getsan asset element handle given the name.

·        AppearanceAssetElement.SetRenderingAsset() - Sets the renderingAsset to the element

AssetPropertychanges

AssetPropertyno longer inherits from APIObject. 

New subclasses of AssetProperty are exposed:

·        AssetPropertyList - a property consisting of a list ofAssetProperty members. 

·        AssetPropertyFloatArray - a property consisting of an arrayof float values.

·        AssetPropertyUInt64 - a property of UInt64 value.

·        AssetPropertyInt64 - a property of Int64 value.


Some of the return values of AssetProperty.GetTypeName() have been changed asshown in the following form:

Input argument

old return

new return

APT_Double

"Double1"

"Double"

APT_DoubleArray2d

"Double2"

"DoubleArray2d"

APT_DoubleArray3d

"Double3"

"DoubleArray3d"

APT_DoubleArray4d

"Double4"

"DoubleArray4d"

APT_Asset

"RenderingAsset"

"Asset"

APT_FloatArray

"Float3"

"FloatArray"

 

UI API changes

Externalcommands now supported from Project Browser as active view

API commands and macros are now enabled when the Revit activeview is the Project Browser.  

·        If there are actively selected elements in the Project Browser,these will be returned from UIDocument.Selection

·        However, add-ins cannot prompt for interactive selection whenthe Project Browser is the active view.

·        The enumerated type ViewType now has separate entries forProjectBrowser and SystemBrowser to allow applications to deal with situationswhere the Project Browser is active.  These view types used to be returnedas ViewType.Internal, so code which keys of off ViewType.Internal may need tobe updated to also deal with these new types.

Note that API commands are still disabled when the active viewis the MEP system browser. 

 


 

Beam and Brace Parameters changes

Revit 2014 includes several changes to control the position ofstructural framing members like beams and braces.  These changes do notaffect the API members but can be accessed via parameters. 

Start/End Extension & Cutback

There are new extension and cutback parameters assigned to Beamand Brace elements.

·        BuiltInParameter.START_EXTENSION

·        BuiltInParameter.END_EXTENSION

·        BuiltInParameter.START_JOIN_CUTBACK

·        BuiltInParameter.END_JOIN_CUTBACK

Note: In some families “Start Extension” and “End Extension” familyparameters may also exist but it is recommended to use instead new the newbuilt-in parameters.

These parameters work as follows:

·        If the Beam or Brace element end doesn’t belong to a join Revituses the new parameters “Start Extension" or "End Extension”. Assigning positive values to these parameters lengthens the element).

·        If the Beam or Brace element belongs to a join Revit uses theparameters “Start Join Cutback" or "End Join Cutback”. Assigning positive values to these parameters shortens the element).

In certain cases it may be difficult to detect if an elementnode belongs to join or not. Therefore, it may be advisable to set both groupsof parameters via the API. With both groups of parameters will be set forelement, Revit automatically detects which should be applied to the structuralelement.

Justifications

There are new justification parameters assigned to Beam andBrace elements. The new set of parameters provides more options to manipulatethe physical element in relation to its analytical curve.

Parameter

Permitted values

BuiltInParameter.YZ_JUSTIFICATION

YZJustificationOption.Uniform

YZJustificationOption.Independent

BuiltInParameter.Y_JUSTIFICATION

YJustification.Left

YJustification.Center

YJustification.Origin

YJustification.Right

BuiltInParameter.Y_OFFSET_VALUE

double

BuiltInParameter.Z_JUSTIFICATION

ZJustification.Top

ZJustification.Center

ZJustification.Origin

ZJustification.Bottom

BuiltInParameter.Z_OFFSET_VALUE

double

BuiltInParameter.START_Y_JUSTIFICATION

YJustification.Left

YJustification.Center

YJustification.Origin

YJustification.Right

BuiltInParameter.START_Y_OFFSET_VALUE

double

BuiltInParameter.START_Z_JUSTIFICATION

ZJustification.Top

ZJustification.Center

ZJustification.Origin

ZJustification.Bottom

BuiltInParameter.START_Z_OFFSET_VALUE

double

BuiltInParameter.END_Y_JUSTIFICATION

YJustification.Left

YJustification.Center

YJustification.Origin

YJustification.Right

BuiltInParameter.END_Y_OFFSET_VALUE

double

BuiltInParameter.END_Z_JUSTIFICATION

ZJustification.Top

ZJustification.Center

ZJustification.Origin

ZJustification.Bottom

BuiltInParameter.END_Z_OFFSET_VALUE

double

 

Previously only Beam elements had any justificationparameters. 

In Revit 2014, Beams as well as Braces share this set ofbuilt-in justification parameters.

The following table shows a mapping from old justificationparameters to new ones:

Deprecated parameter

New parameter

BEAM_H_JUSTIFICATION

Y_JUSTIFICATION

BEAM_V_JUSTIFICATION

Z_JUSTIFICATION

BEAM_V_JUSTIFICATION_OTHER_VALUE ( valid only for Other value set to BEAM_V_JUSTIFICATION )

Z_OFFSET_VALUE ( valid for all Z_JUSTIFICATION values )

 

Old beam parameters can still be used.  When set, they willbe used to recalculate the new parameters.  It is strongly recommended touse new justification parameters instead of old ones, because in some cases theold parameters may be not sufficient to correctly describe the element position(for example, when justification is set independently on either end of themember).


 

Divided surface changes

Divided SurfaceAPI

The class DividedSurfaceData and the associated methodElement.GetDividedSurfaceData() have been replaced.  The new methods toaccess DividedSurfaces applied to elements are:

·        DividedSurface.GetReferencesWithDividedSurface()

·        DividedSurface.GetDividedSurfaceForReference()

The method:

·        Autodesk.Revit.Creation.Document.NewDividedSurface()

has been replaced by:

·        DividedSurface.Create()

 


 

Point clouds

Revit 2014 includes a new point cloud engine.  This newengine supports .rcp and .rcs file formats.  The introduction of this newengine has led to several changes in the client API around Point Cloudelements.

PointCloudType.Create()

The method

  • PointCloudType.Create()

no longer supports input of .pcg files to directly create a newPointCloudType.  .pcg files can be indexed to create matching .rcs files,but this does not happen automatically when using this method.

This method does support creation of PointCloudTypes from .rcpor .rcs files, or from custom formats supplied by the Point Cloud Engine API.

PointCloudInstance.GetPoints()

The method

  • PointCloudInstance.GetPoints(PointCloudFilter filter, int numPoints)

has been deprecated and replaced by

  • PointCloudInstance.GetPoints(PointCloudFilter filter, double averageDistance, int numPoints)

The new averageDistance argument is the desired average distancebetween "adjacent" cloud points (in Revit units of length).  Thesmaller the averageDistance the larger number of points will be returned up tothe numPoints limit.  Specifying this parameter makes the actual number ofpoints returned for a given filter independent of the density of coverageproduced by the scanner.  This averagedistance parameter is only used when extracting points from .rcs or .rcp pointclouds, and is not used when extracting from .pcg point clouds or custom pointclouds from the Point Cloud Engine API.

Point cloud overrides

The classes

  • PointCloudOverrides
  • PointCloudOverrideSettings
  • PointCloudColorSettings

allow read and write access to point cloud override settingsassigned to a given view.  Overrides can be applied to an entire pointcloud instance, or to specific scans within that instance.  Options for the overrides include making thecloud non-visible, setting it to a fixed color, or to color gradients based onelevation, normals, or intensity.

The property

  • PointCloudInstance.SupportsOverrides

identifies point clouds which support override settings (cloudswhich are based on .rcp or .rcs files).

 

Point cloud scans

The method

  • PointCloudInstance.GetScans()

returns a list of scans contained within the .rcp pointcloud.  Scan names can be used to set visibility and fixed color overridesindependently for each scan in the PointCloudInstance.

 

 

IFC API changes

IFCexport now External Service

The capability to override IFC export is now managed as anExternal Service.  As such, the explicit interfaces in ExporterIFCRegistryare no longer needed and have been marked obsolete.  It is now possible toregister more than one external IFC export implementation in the same session,and manage the active implementation using the methods of theSingleServerService wrapper to IFC export.

IFC APIsmoved to new assembly

Most IFC API classes have been moved from RevitAPI.dll to a newassembly: RevitAPIIFC.dll. The classes moved include all members of theAutodesk.Revit.DB.IFC namespace which enable development of a custom IFCexporter.

Any Add-In using any of the migrated APIs needs to reference thenew DLL and rebuild to work in Revit 2014.

Note that the APIs to invoke an IFC export and import:

·        Document.Export(String, String, IFCExportOptions)

·        Application.OpenIFCDocument(String)

and the related options class have not moved. Applications whichexport or import IFC files but do not provide custom implementations do notneed to make changes.

PrintParameters

The property HideUnreferencedViewTages was renamedto HideUnreferencedViewTags. 

 


 


 

Obsolete API Removal

API classes and methods previously marked Obsolete in Revit 2013or earlier have been removed from the API.

Classesremoved

·        CurtainCellSetIterator and CurtainCellSet - Use generic .NETcollection classes instead.

·        PipeMaterialType - replaced by Material

·        Batch creation argument class types - batch creation is notneeded with changes to Revit API regeneration

·        ProfiledWallCreationData

·        RectangularWallCreationData

·        RoomCreationData

·        TextNoteCreationData

·        Subclasses of ConnectorElement have been removed, access theseelements through the parent class

·        ElectricalConnector

·        ElectricalConnector.SystemType - query the parameterRBS_ELEC_CIRCUIT_TYPE on ConnectorElement and cast to ElectricalSystemType

·        DuctConnector

·        DuctConnector.LinkedConnector - replaced byConnectorElement.GetLinkedConnectorElement() andConnectorElement.SetLinkedConnectorElement()

·        DuctConnector.SystemType - query the parameterRBS_DUCT_CONNECTOR_SYSTEM_CLASSIFICATION_PARAM on ConnectorElement and cast toDuctSystemType

·        PipeConnector

·        PipeConnector.LinkedConnector replaced byConnectorElement.GetLinkedConnectorElement() andConnectorElement.SetLinkedConnectorElement()

·        PipeConnector.SystemType - query the parameterRBS_PIPE_CONNECTOR_SYSTEM_CLASSIFICATION_PARAM on ConnectorElement and cast toPipeSystemType

Methodsand Properties removed

Autodesk.Revit.Creation namespace

Application

·        NewMaterialSet() - replaced by .net Generic collection classes

·        NewElementArray() - replaced by .net Generic collection classes

Document

·        NewAnnotationSymbol(XYZ ,AnnotationSymbolType ,View) - replacedby NewFamilyInstance(XYZ, FamilySymbol, View)

·        NewAreaViewPlan(String,Level,AreaElemType) - replaced byViewPlan.CreateAreaPlan()

·        NewCurtainSystem(ReferenceArray,CurtainSystemType) - replaced byNewCurtainSystem2(ReferenceArray, CurtainSystemType)

·        NewElectricalSystem(ElementSet,ElectricalSystemType) - replacedby NewElectricalSystem(ICollection, ElectricalSystemType)

·        NewFamilyInstances(List) -replaced by NewFamilyInstances2(List)

·        NewGroup(ElementSet) - replaced byNewGroup(System.Collections.Generic.ICollection)

·        NewRooms(Phase, Int32) - replaced by NewRooms2(Phase, Int32)

·        NewRooms(Level,Phase) - replaced by NewRooms2(Level, Phase)

·        NewRooms(Level) - replaced by NewRooms2(Level)

·        NewRooms(List) - there is no singleequivalent that creates multiple rooms, this is not needed with Revit APIcontrol over regeneration

·        NewSpaces(Phase,Int32) - replaced by NewSpaces2(Phase, Int32)

·        NewSpaces(Level,Phase,View) - replaced by NewSpaces2(Level,Phase, View)

·        NewTextNotes(List) - replaced byNewTextNote()

·        NewViewPlan(String,Level,ViewPlanType) - replaced byViewPlan.Create(Document, ElementId, ElementId)

·        NewView3D(XYZ) - replaced by View3D.CreateIsometric(Document,ElementId)

·        NewViewSection(BoundingBoxXYZ) - replaced byViewSection.CreateDetail()

·        All Wall creation methods replaced by equivalent Wall.Create()methods:

·        NewWall(CurveArray,WallType,Level,Boolean,XYZ)

·        NewWall(CurveArray,WallType,Level,Boolean)

·        NewWall(CurveArray,Boolean)

·        NewWall(Curve,WallType,Level,Double,Double,Boolean,Boolean)

·        NewWall(Curve,Level,Boolean)

·        NewWalls(List dataList) - thereis no single equivalent that creates multiple walls, this is not needed withRevit API control over regeneration

·        NewWalls(List dataList) - thereis no single equivalent that creates multiple walls, this is not needed withRevit API control over regeneration

FamilyItemFactory

·        NewDuctConnector(Reference,DuctSystemType) - replaced byConnectorElement.CreateDuctConnector()

·        NewPipeConnector(Reference,PipeSystemType) - replaced byConnectorElement.CreatePipeConnector()

·        NewElectricalConnector(Reference,ElectricalSystemType) -replaced by ConnectorElement.CreateElectricalConnector()

 

 

Autodesk.Revit.DB namespace

BaseArray

·        CopyMembers - replaced by GetCopiedMemberIds()

·        OrigMembers - replaced by GetOriginalMemberIds()

CurtainGrid

·        UnlockedMullions - replaced by GetUnlockedMullionIds()

·        Mullions - replaced by GetMullionIds()

·        Cells - replaced by GetCurtainCells()

·        UnlockedPanels - replaced by GetUnlockedPanelIds()

·        Panels - replaced by GetPanelIds()

·        VGridLines - replaced by GetVGridLineIds()

·        UGridLines - replaced by GetUGridLineIds()

CurveElement

·        LineStyles - replaced by GetLineStyleIds()

Document

·        Delete(ElementSet elements) - replaced by Delete(System.Collections.Generic.ICollectionelementIds)

·        WorksharingCentralFilename - replaced byModelPathUtils.ConvertModelPathToUserVisiblePath(Document.GetWorksharingCentralModelPath())

·        PrintSettings - replaced by GetPrintSettingIds()

·        Element/get_Element - replaced by GetElement method

Element

·        PhaseDemolished - replaced by DemolishedPhaseId

·        PhaseCreated - replaced by CreatedPhaseId

FamilyInstance

·        GetCopings() - replaced by GetCopingIds()

·        SetCopings(ElementSet) - replaced by SetCopingIds(ICollection cutters)

·        SubComponents - replaced by GetSubComponentIds()

Floor

·        SpanDirectionSymbols - replaced by GetSpanDirectionSymbolIds()

GeometryElement

·        Objects - replaced by GetEnumerator()

Group

·        Ungroup() - replaced by UngroupMembers()

·        Members - replaced by GetMemberIds()

LinearArray

·        CopyMembers - replaced by GetCopiedMemberIds()

·        OrigMembers - replaced by GetOriginalMemberIds()

Material

·        GetMaterialAspectPropertySet(MaterialAspect) - replaced byGetStructuralAssetId() and GetThermalAssetId()

·        SetMaterialAspect(MaterialAspect,ElementId,Boolean) - replacedby SetStructuralAssetId() and SetThermalAssetId()

·        SetMaterialAspectToIndependent(MaterialAspect) - replaced bySetStructuralAssetId() and SetThermalAssetId()

MEPSystem

·        Remove(ElementSet) - replaced byRemove(ICollection)

Part

·        ParentDividedElementId - no replacement, concept is removed fromRevit

·        OriginalDividedElementId - no replacement, concept is removedfrom Revit

·        GetDividedParents() - no replacement, concept is removed fromRevit

PartMaker

·        IsElementDivided(ElementId elemId) - replaced byIsSourceElement(ElementId)

·        GetDividedElementIds() - replaced by GetSourceElementIds()

·        SetDividedElementIds(ICollection) - replaced bySetSourceElementIds(ICollection)

PartUtils

·        AreElementsValidForDivide(Document,ICollection) - replaced by ArePartsValidForDivide(Document,ICollection)

·        AreElementsValidIntersectingReferences(Document,ICollection) - replaced by PartMakerMethodToDivideVolumes.AreElementsValidIntersectingReferences(Document,ICollection)

·        IsValidSketchPlane(Document, ElementId) - replaced byPartMakerMethodToDivideVolumes.IsValidSketchPlane(Document, ElementId)

·        SetOffsetForIntersectingReference() - replaced by PartMakerMethodToDivideVolumes.SetOffsetForIntersectingReference()

·        GetOffsetForIntersectingReference() - replaced byPartMakerMethodToDivideVolumes.GetOffsetForIntersectingReference()

·        PartMakerUsesReference() - replaced byPartMakerMethodToDivideVolumes.PartMakerUsesReference()

·        IsMaxDivisionDepthReached(Document, ElementId) - no replacement,concept is removed from Revit

·        GetDividedParents(Part) - no replacement, concept isremoved from Revit

·        PlanTopology

·        Rooms - replaced by GetRoomIds()

PropertySetElement

·        Create(Document, MaterialAspect) - replaced by Create(Document,StructuralAsset)

RadialArray

·        CopyMembers - replaced by GetCopiedMemberIds()

·        OrigMembers - replaced by GetOriginalMemberIds()

SpatialFieldManager

·        UpdateSpatialFieldPrimitive(Int32,FieldDomainPoints,FieldValues)- replaced by UpdateSpatialFieldPrimitive(Int32, FieldDomainPoints,FieldValues, Int32)

·        SetUnits(IList, IList) - replaced byAnalysisResultSchema.SetUnits() and SetResultSchema()

View

·        ApplyTemplate(View viewTemplate) - replaced byViewTemplateId/ApplyViewTemplateParameters(View viewTemplate)

·        Hide(ElementSet elemSet) - replaced byHideElements(System::Collections::Generic::ICollection^elementIdSet)

·        Unhide(ElementSet elemSet) - replaced byUnhideElements(System::Collections::Generic::ICollection^elementIdSet)

View3D

·        EyePosition - replaced byViewOrientation3D.EyePosition/View.Origin

·        ViewSheet

·        AddView(View,UV) - replaced by Viewport.Create(Document,ElementId, ElementId, XYZ)

Autodesk.Revit.DB.Plumbing namespace

 

PipeType

·        Roughness - replaced by Segment.Roughness

·        Material - replaced by PipeSegment.MaterialId

Autodesk.Revit.DB.Structure namespace

 

AnalyticalModel

·        CanDisable() - no replacement, concept removed from Revit

·        IsValidAnalyticalProjectionType(AnalyticalDirection,AnalyticalProjectionType)- replaced by IsValidProjectionType(AnalyticalElementSelector,AnalyticalDirection, AnalyticalProjectionType)

AreaReinforcement

·        NumBarDescriptions - replaced by GetRebarInSystemIds()

·        BarDescription - replaced GetRebarInSystemIds()

·        Curves - replaced by GetCurveElementIds()

BeamSystem

·        GetAllBeams() - replaced by GetBeamIds()

PathReinforcement

·        BarDescription - replaced by GetRebarInSystemIds()

·        Curves - replaced by GetCurveElementIds()

Rebar

·        GetCenterlineCurves(Boolean) - replaced byGetCenterlineCurves(Boolean,Boolean,Boolean)

·        DistributionPath - replaced by GetDistributionPath()

·        RebarShape - replaced by RebarShapeId

·        Host - replaced by Rebar.GetHostId() and SetHostId(Document,ElementId)

·        BarType - replaced by Element.GetTypeId() andElement.ChangeTypeId(ElementId)


 

Majorenhancements to the Revit API

Worksharing API enhancements

ReloadLatest

The method:

·        Document.ReloadLatest()

Fetches changes from central (due to one or moresynchronizations with central and merges them into the current session. Afterthis call finishes, use

·        Document.HasAllChangesFromCentral()

to confirm that there were no Synchronizations with Centralperformed during execution of ReloadLatest.

Synchronizewith Central

The method:

·        Document.SynchronizeWithCentral()

 performs a reload latest until the model in the currentsession is up to date and then saves changes back to central.  A save tocentral is performed even if no changes were made.

Elementownership

The following methods affect element and workset ownership:

·        WorksharingUtils.CheckoutElements - Obtains ownership for thecurrent user of as many specified elements as possible.

·        WorksharingUtils.CheckoutWorksets - Obtains ownership for thecurrent user of as many specified worksets as possible.

·        WorksharingUtils.RelinquishOwnership - Relinquishes ownership bythe current user of as many specified elements and worksets as possible, andgrants element ownership requested by other users on a first come, first servedbasis.

Createnew local

The new method:

·        WorksharingUtil.CreateNewLocal()

takes a path to a central model and copies the model into a newlocal file for the current user.

EnableWorksharing

The new method Document.EnableWorksharing will enableworksharing in a project.

Enhancements to interactions withlinks

Several improvements have been made to increase APIfunctionality when working with RVT links.

Identifyinglinks

The property:

·        Document.IsLinked

identifies if a document is in session because it is a linkedRevit file.

Obtaininglinked documents

The method:

·        RevitLinkInstance.GetLinkedDocument()

gets the document that corresponds to an Revit Link instance.

Linkcreation

Two functions have been added to RevitLinkOptions, used tospecify options for RevitLinkType.Create. 

·        RevitLinkOptions.GetWorksetConfiguration()

·        RevitLinkOptions.SetWorksetConfiguration()

This allows the user to specify which worksets should be openedwhen creating and loading a new Revit link.

Link loadand unload

The methods

·        RevitLinkType.Load()

·        RevitLinkType.LoadFrom()

·        RevitLinkType.Unload()

allow a link to be loaded or unloaded, or to be loaded from anew location.   These methods regenerate the document.  Thedocument's Undo history will be cleared by these methods.  As a result,this function and others executed before it cannot be undone.  Alltransaction phases (e.g. transactions, transaction groups and sub-transactions)that were explicitly started must be finished prior to calling this method.

Link shared coordinates

The methods:

·        RevitLinkType.SavePositions()

·        RevitLinkType.HasSharedCoordinatesChanges()

support save of shared coordinates changes back to the linkeddocument. While this operation does not clear the document's undo history, youwill not be able to undo this specific action, since it saves the link's sharedcoordinates changes to disk.

Link pathtype

The property:

·        RevitLinkType.PathType

allows read and modification of the path type associated with alink. 

Conversionof geometric references

The new APIs:

·        Reference.LinkedElementId

·        Reference.CreateLinkReference(RevitLinkInstance)

·        Reference.CreateReferenceInLink()

allow conversion between Reference objects which reference onlythe contents of the link and Reference objects which reference the host. Thisallows an application, for example, to look at the geometry in the link, findthe needed face, and convert the reference to that face into a reference in thehost suitable for use to place a face-based instance. Also, they would allowyou to obtain a reference in the host (e.g. from a dimension or family) andconvert it to a reference in the link, suitable for use inElement.GetGeometryObjectFromReference().

Room tagcreation from linked rooms

The new method:

·        NewRoomTag(LinkElementId roomId, UV point, ElementId viewId)

can create room tags in Revit Links.

Pickingin links

PickObject() and PickObjects() now allow selection of elementsin RVT Links.


 

Views & Display

GraphicDisplay options

These new members expose read and write of graphic displayoptions:

·        View.GetBackground()

·        View.SetBackground()

·        View.ShadowIntensity

·        View.SunlightIntensity

·        View.SurfaceTransparency

·        View.ShowEdges

·        View.ShowSilhouettes

·        View.SilhouetteLineStyleId

Categoryclasses override

Display of category classes may be overridden by the user. The new properties:

·        View.AreModelCategoriesHidden

·        View.AreAnnotationCategoriesHidden

·        View.AreAnalyticalModelCategoriesHidden

·        View.AreImportCategoriesHidden

allow an application to determine if a class of categories hasbeen completely hidden.  Note that Category.Visible[View] andView.GetVisibility(Category) does not look to the category classes when itreturns the individual visibility status.

Categoryoverride

Display of categories can be overridden. This can be done withthe new class OverrideGraphicSettings and the new View methods:

·        SetCategoryOverrides

·        GetCategoryOverrides

·        IsOverrideValidForCategory

·        IsCategoryOverridable

ElementOverride

Display of elements can be overridden with the new methods:

·        View.GetElementOverrides

·        View.SetElementOverrides.

ViewFilters

A new set of methods on the View class allow getting, setting,adding, and removing filters. Filters can be created usingthe ParameterFilterElement class and its Create method which existed inprevious versions of the Revit API.

Non-rectangularcrop region

Views can now be assigned a crop region which isnon-rectangular.  The new View members:

·        View.GetCropRegionShapeManager()

·        View.GetCropRegionShapeManagerForReferenceCallout()

·        View.GetReferenceCallouts()

provide access to a ViewCropRegionShapeManager for the view orfor a displayed reference callout.

This class allows access and modification of the crop regionshape:

·        ViewCropRegionShapeManager.GetCropRegionShape()

·        ViewCropRegionShapeManager.SetCropRegionShape()

·        ViewCropRegionShapeManager.IsCropRegionShapeValid()

·        ViewCropRegionShapeManager.RemoveCropRegionShape()

·        ViewCropRegionShapeManager.ShapeSet

·        ViewCropRegionShapeManager.Valid

The properties:

·        View.CropBoxActive

·        View.CropBoxVisible

also apply to non-rectangular crop regions which may be assignedto a given view.

Viewport

The new property

·        Viewport.Rotation

controls the rotation of the viewport on the sheet.

The new method

·        Viewport.MoveCenterTo() 

moves the viewport so that the center of the box outline(excluding the viewport label) is at a given point.

The new method

·        Viewport.GetBoxCenter()

returns the center of the outline of the viewport on the sheet,excluding the viewport label.

ExplodedViews

The new DisplacementElement class can be used to cause elementsto appear displaced from their actual location to create views such as this onewhere the roof has been moved in the positive Z direction. The DisplacementPathclass creates an annotation that depicts the movement of the element from itsactual location to its displaced location.

Revisionson sheets

The new methods:

  • ViewSheet.GetAllProjectRevisionIds()
  • ViewSheet.GetAdditionalProjectRevisionIds()
  • ViewSheet.SetAdditionalProjectRevisionIds()

provide access to the ids of project revision elementsassociated to a particular sheet.  GetAllProjectRevisionIds() returnsproject revisions ordered from lowest to highest by project revision sequencenumber.  The results include revisions associated to a revision cloudvisible on the sheet and revisions that have been additionally included usingthe Revisions On Sheet parameter.   GetAdditionalProjectRevisionIds()and SetAdditionalProjectRevisionIds() access specifically the additionalrevisions added using the Revisions On Sheet parameter.

Note that there is no special class for project revisionelements, but that they can be accessed as Elements by filtering on categoryBuiltInCategory.OST_Revisions.

 

User interface customization

UIView

Zoom operations

The new methods:

·        UIView.ZoomToFit()

·        UIView.ZoomSheetSize()

·        UIView.Zoom(double zoomFactor)

provide shortcuts to quickly adjust the zoom of the graphicalview window.

Close view

The new method:

·        UIView.Close()

closes a visible view window. Note that the last open view for agiven document cannot be closed by this method.

PreviewControl

The new property:

·        PreviewControl.UIView

returns a UIView handle to the preview view. This allows anapplication to manipulate the zoom and pan settings of the preview view.

The new property:

·        PreviewControl.ScrollbarVisibility

accesses the visibility setting for the preview view scrollbars.

CommandAPI

Command event

The event

·        AddInCommand.BeforeExecuted

occurs before the command associated with an AddInCommandBindingexecutes.  This event is read-only, an application can react to this eventbut cannot make changes to documents, or affect the invocation of the commandin any way.

Command posting

The method

·        UIApplication.PostCommand()

posts a command to Revit.  Revit will invoke it when controlreturns from the current API context.   Only certain commands can beposted using this method:

1.    Commands listed in the Autodesk.Revit.UI.PostableCommandenumerated type

2.    External commands created by any add-in

This restriction prevents posting of contextual commands(because Revit's command framework cannot directly access the accessibility ofsome contextual commands).

Note that only one command may be posted to Revit at a giventime.  If a second command is posted from any API application, the methodthrows an InvalidOperationException.

The command must be accessible to be executed.  This isdetermined only at the point where Revit returns from the API context, andtherefore a failure to execute the command because the command is not currentlyaccessible will not be reported directly back to the application that postedthe command.

To use this API, the application must obtain a RevitCommandIdhandle for the command.  This can be done using either

·        RevitAddInCommand.LookupCommandId(String)

·        RevitAddInCommand.LookupPostableCommandId(PostableCommand)

The method

·        UIApplication.CanPostCommand

identifies if the given command can ever be posted (that is, itis a member of PostableCommand or an external command).  It does notidentify the command can be posted at the given timeframe (that is, it will notattempt to determine if the command is currently accessible). 

 

DockableDialog Panes

Revit now allows addins to register WPF dialogs to dock into thetop, left, right, and bottom of the main Revit window, as well as to be addedas a tab to an existing system pane, such as the project browser.  Dialogscan be registered with UIApplication.RegisterDockablePane and auser-implementation of the IDockablePaneProvider interface.  Dockablepanes can later be retrieved, shown, and hidden throughUIApplication.GetDockablePane() and DockablePane.Show() and Hide().

Dimensions & annotations API

Multi-referenceannotations for rebar

Revit now supports annotations pointing to more than onereference, consisting of a dimension and associated tag  These annotations can be used to label anddimension Rebar elements, and are labeled in the user interface as “Multi-rebarannotations.”

 The API exposes thisthrough:

·        MultiReferenceAnnotation - the annotation object instance.  This class includes a reference to theassociated dimension and tag element.

·        MultiReferenceAnnotationType - the annotation type.   The type specifies the tag anddimension types to be used in the multi-reference annotation, as well asassociated display settings.

·        MultiReferenceAnnotationOptions - an options class used tocreate a new MultiReferenceAnnotation, including specification of theassociated elements and options for the dimension and tag placement.

·        IndependentTag.MultiReferenceAnnotationId  - returns  the ElementId of the MultiReferenceAnnotationthat owns a tag.

·        Dimension.MultiReferenceAnnotationId - returns the ElementId ofthe MultiReferenceAnnotation that owns a dimension.

Dimensionalternate units

New properties of DimensionStyle provide access to alternateunits settings:

·        DimensionStyle.AlternateUnits

·        DimensionStyle.GetAlternateUnitsFormatOptions()

·        DimensionStyle.SetAlternateUnitsFormatOptions()

·        DimensionStyle.AlternateUnitsPrefix

·        DimensionStyle.AlternateUnitsSuffix

Dimensionunit type

The property:

·        DimensionStyle.UnitType

returns the type of units supported by this dimension style(length, angle, or slope).

Add-ins and macros

Automaticload of add-ins without restarting Revit

Revit now automatically loads addins from newly added .addin manifestfiles without restarting Revit.  

After placing a new .addin manifest file into one of thededicated addins folders, the running Revit session will attempt to load thecorresponding addin.  Loaded ExternalCommands will be added to theExternal Tools pulldown menu.  ExternalApplication andExternalDBApplication OnStartup methods will be executed upon loading.  Anaddin's installer may leverage this feature - but it must do so by creating thenew .addin file at the end of installation to the dedicated Revit addin folders(the installer must ensure that the addin's assembly is already deployed tothe target machine and the assembly path can be resolved in the add-inmanifest file). 

Add-ins may decline the ability for Revit to load the .addin inthe middle of a session.  To decline this options, add an tag (set to false) in the add-in manifestfile. 

Note that when Revit starts an add-in in the middle of thesession, some add-in logic may not function identically because of thedifferent interactions with the session.  Specifically:

·        If the application's goal is to prevent something fromhappening, the application may not be able to handle the fact that thisactivity has already happened in the existing session.

·        If the application's goal is to manage external information insynch with documents loaded in the session, the application may not be able tohandle documents that were loaded before the application started.

·         If the application's logic depends on the ApplicationInitializedevent, this event has already been called before the add-in was loaded.

Also, some add-ins may not be able to fully initialize whenloading in the middle of the session.  This is because some activitiesmust take place at the start of the Revit session:

·        Creation of custom failure definitions

·        Establishment of a system-wide IFailureProcessor to handle allfailures.

·        Registering ExternalServices.

Revit also offers a new UI API method

·        UIApplication.LoadAddIn()

to programmatically load the add-in(s) listed in the providedadd-in manifest file.   Typically, this API would not be neededbecause Revit is already loading new .addin files automatically.

MacroManagerAPI

Revit now support an API for listing, creating, removing,editing, debugging, and running macros through several supporting classes andenums

·        MacroManager

·        Available at the DB.Document or ApplicationServices.Applicationlevel; manages the querying, creation, and removal of macro modules

·        UIMacroManager

·        Available at the UIDocument or UIAppliciation level, managesadding, removing, and editing UI-level modules.

·        MacroModule

·        Manages the querying, creation, removal, and running of specificmacro methods

·        ModuleSettings

·        A collection of top-level properties of a MacroModule

·        Macro

·        Represents a single, runnable macro method.

·        UIDocumentMacroOptions

·        Represents security options for UIDocument-level macros.

·        DocumentMacroOptions

·        Represents security options for DB.Document-level macros.

·        ApplicationMacroOptions

·        Represents security options for Application-level macros

·        MacroLanguageType

·        Represents the language of a given macro, C#, VB.NET, Ruby, orPython

·        MacroLevel

·        Represents whether a macro is associated with a document theRevit application

·        ModuleStatus

·        Represents the compiled, loaded, or built status of aMacroModule.

 The MacroManager APIs are all in theAutodesk.Revit.DB.Macros namespace and are available in RevitAPIMacros.dll andRevitAPIUIMacros.dll

MacroAttributes

The attributes  

·        Autodesk.Revit.UI.Macros.AddinAttribute

·        Autodesk.Revit.UI.Macros.VendorIdAttribute

and the interface 

·        Autodesk.Revit.UI.Macros.IEntryPoint

have been moved to the namespace Autodesk.Revit.DB.Macros.


 

Parameters

Sharedparameter - create with specified GUID

The new method

·        Definitions.Create(String, ParameterType, bool,GUID)

supports creation of newExternalDefinition objects (shared parameter definitions) which use thedesignated GUID instead of a random GUID. This allows an application to programmatically create consistentdefinitions for shared parameters without a shared parameter file or copyingelements from one project to another.

Dimension.Label

The property

·        Dimension.Label

Has been replaced by a newproperty

·        Dimension.FamilyLabel

As this label applies only todimension in families and their corresponding family parameter.

FamilyParameters

The new property

·        FamilyParameter.IsShared

identifies if the family parameter is a shared parameter.

Geometry APIs

JoinGeometryUtils

Revit now supports APIs for joining, unjoining, querying joinstate, and changing join order of elements in a model through theJoinGeometryUtils class.

Extensible Storage

ExtensibleStorageAPI changes

The method

·        Element.GetEntitySchemaGuids()

returns the Schema Guids of any Entities present on an Element.

The methods

·        Schema.GetField()

·        Schema.ListFields()

are now restricted based on the read permission defined inthe Schema.

ExtensibleStorageFilter

An ExtensibleStorageFilter is a new ElementQuickFilter forfinding elements that contain an extensible storage entity of a given SchemaGuid.

Translation

Export toNavisworks

The new function:

·        Document.Export(String, String, NavisworksExportOptions)

exports a Revit project to the Navisworks .nwc format. Note that in order to use this function,you must have a compatible Navisworksexporter add-in registered with your session of Revit.  If there is nocompatible exporter registered, the function will throwOptionalFunctionalityNotAvailableException.  Use

·        OptionalFunctionalityUtils.IsNavisworksExporterAvailable()

to check if there is an exporter registered.

Import/LinkSAT

The functions:

·        Document.Import(String, SATImportOptions, View)

·        Document.Link(String, SATImportOptions, View)

import or link an SAT file into the document.

Import/LinkSketchUp

The functions:

·        Document.Import(String, SKPImportOptions, View)

·        Document.Link(String, SKPImportOptions, View)

import or link an SKP file into the document.

ImportDWF Markups

The function:

·        Document.Import(String, DWFImportOptions)

imports DWF markups into the document.

Exporttables

The new classes

·        ExportLayerTable

·        ExportLinetypeTable

·        ExportPatternTable

·        ExportFontTable

·        ExportLineweightTable

expose read and write access to the tables used for mapping onexport to various formats such as DWG, IFC and DGN.

Site

Editing aTopographySurface

Editing the points in a TopographySurface now requiresestablishment of an edit scope. The class

·        TopographyEditScope

allows an application to create and maintain an editing sessionfor a TopographySurface. Start and end of a TopographyEditScope will also startand end a transaction group. After the TopographyEditScope is started, anapplication can start transactions and edit the topography surface. Individualtransactions the application creates inside TopographyEditScope will not appearin the undo menu.  All transactions committed during the edit mode will bemerged into a single one which will bear the given name passed intoTopographyEditScope constructor.

The method:

·        TopographySurface.AddPoints()

has been modified to operate with the edit scope, and thuscannot be called outside of an edit scope.  The function no longerregenerates the document.

The new methods:

·        TopographySurface.DeletePoints()

·        TopographySurface.MovePoint()

·        TopographySurface.MovePoints()

·        TopographySurface.ChangePointElevation()

·        TopographySurface.ChangePointsElevation()

provide the ability to modify and delete existing points in theTopographySurface.  Multiple calls to these functions can be included inthe same edit scope.

Readingpoints from a TopographySurface

The new method:

·        TopographySurface.ReadPoints()

returns a list of the points stored in the surface.

The method:

·        TopographySurface.FindPoints()

filters and returns only the points of the topography surfacewhich lie within the input bounding box.

The method:

·        TopographySurface.ContainsPoint()

identifies if the input point is found in points stored in thesurface.

The methods:

·        TopographySurface.GetBoundaryPoints()

·        TopographySurface.IsBoundaryPoint()

identify points which are a part of the boundary of the surface.

Validation

Several new validation methods have been added to theTopographySurface class:

·        IsValidRegion() - Identifies whether the points can construct avalid region for a topography surface.

·        ArePointsDistinct() - Identifies whether the input points aredistinct in XY location.

These methods are newly used in AddPoints() to preventproblematic inputs from causing issues.

SiteSubRegion

The class SiteSubRegion represents a proxy class exposingthe interfaces needed to access details of a subregion.   In theRevit database, both TopographySurface elements and subregion elements arerepresented by the same TopographySurface element subclass, however, in theRevit API, this SiteSubRegion class exists to separate the interfaces forsubregions from those of topography surfaces.  The SiteSubRegion classoffers these APIs:

·        SiteSubRegion.Create() - creates a new subregion given aboundary consisting of one or more curve loops.

·        SiteSubRegion.IsValidBoundary() - validates the input boundaryfor a new subregion

·        SiteSubRegion.GetBoundary() - returns the boundary curves

·        SiteSubRegion.SetBoundary() - sets the boundary for thesubregion

·        SiteSubRegion.TopographySurface - the TopographySurface elementwhich this subregion represents

·        SiteSubRegion.HostId - the identifier of the topography surfacehosting this subregion

BuildingPad

The class BuildingPad represents a building pad element inRevit.  It inherits from CeilingAndFloor and thus offers inheritedcapabilities from HostObject as well. The API exposes the following specificcapabilities around BuildingPads:

·        BuildingPad.Create() - Creates a new BuildingPad given aboundary, type and level.

·        BuildingPad.GetBoundary() - Returns the sketched boundarycurves.

·        BuildingPad.SetBoundary() - Assigns a new boundary to theBuildingPad.

·        BuildingPad.HostId - The element id of the topography surfacehosting this BuildingPad.

The type of the building pad is represented byBuildingPadType.  This inherits from HostObjAttributes and offersinherited capabilities from this parent, including access to theCompoundStructure of the type.  The API exposes these new capabilities forBuildingPadTypes:

·        BuildingPadType.CreateDefault() - Creates a new defaultBuildingPadType in the document.

 

MEP

ExternalizedCalculations

Several new interfaces and classes based on external servicesare supported for pipe and duct calculations.

·        Several new interfaces deriving from IExternalServer to supportfriction, flow, and pressure drop for pipes and ducts have been added.

·        IPipePlumbingFixtureFlowServer

·        IPipePressureDropServer

·        IDuctPressureDropServer

·        IDuctFittingAndAccessoryPressureDropServer

·        IPipeFittingAndAccessoryPressureDropServer

·        IDuctFittingAndAccessoryPressureDropUIServer

·        IPipeFittingAndAccessoryPressureDropUIServer

·        Several new classes implementing IExternalData to supportfriction, flow, and pressure drop for pipes and ducts have been added.

·        PipePlumbingFixtureFlowData

·        PipePressureDropData

·        DuctPressureDropData

·        DuctFittingAndAccessoryConnectorData

·        PipeFittingAndAccessoryConnectorData  

·        Several new classes implementing ISingleServerService to supportfriction, flow, and pressure drop for pipes and ducts have been added.


·        PipePlumbingFixtureFlowService

·        PipePressureDropService

·        DuctPressureDropService

·        DuctFittingAndAccessoryPressureDropService

·        PipeFittingAndAccessoryPressureDropService

·        DuctFittingAndAccessoryPressureDropUIService

·        PipeFittingAndAccessoryPressureDropUIService

ElectricalLoadClassificationData

ElectricalLoadClassificationData has several new stringproperties corresponding to the load classification section of the electricalpanel schedule.

·        LoadSummaryDemandFactorLabel

·        PanelConnectedLabel

·        PanelEstimatedLabel

·        PanelConnectedCurrentLabel

·        PanelEstimatedCurrentLabel

·        ActualElecricalLoadNameLabel

CSVFitting Parameter Removal

Because CSV files are no longer used to drive MEP fittingparameters, Revit supports a new set of APIs to manage fitting parametersthrough several classes

·        FamilySizeTableManager - manages importing and exporting oflegacy CSV data and size tables.

·        FamilySizeTable - manages specific sizes of fittings.

·        FamilySizeTableColumn - manages a specific dimension of a givensize in a size table

·        FamilySizeTableErrorInfo - reports any errors when importing anfile with CSV size table into a FamilySizeTable

FittingAngle Settings

The members:

·        DuctSettings.FittingAngleUsage

·        DuctSettings.GetSpecificFittingAngles()

·        DuctSettings.GetSpecificFittingAngleStatus()

·        DuctSettings.SetSpecificFittingAngleStatus()

·        PipeSettings.FittingAngleUsage

·        PipeSettings.GetSpecificFittingAngles()

·        PipeSettings.GetSpecificFittingAngleStatus()

·        PipeSettings.SetSpecificFittingAngleStatus()

·        ElectricalSetting.FittingAngleUsage

·        ElectricalSetting.GetSpecificFittingAngles()

·        ElectricalSetting.GetSpecificFittingAngleStatus()

·        ElectricalSetting.SetSpecificFittingAngleStatus()

provide access to fitting angle usage settings for ducts, pipes,cable trays and conduits.

DuctSettings

Duct settings for size prefixes and suffixes, annotations, and air density and viscosity may now be set through the DuctSettings class.

Curve Creation

Pipes, Ducts,  FlexPipes, and FlexDucts can now be createdwith a  Pipe, Duct, FlexPipe, or FlexDuct SystemTypeId as a parameter ontheir respective static Create() methods.

ConnectorElement

The methods

·        ConnectorElement.CreatePipeConnector(Document, Document,PipeSystemType, Reference, Edge)

·        ConnectorElement.CreateDuctConnector(Document, DuctSystemType,ConnectorProfileType, Reference, Edge)

·        ConnectorElement.CreateElectricalConnector(Document,ElectricalSystemType, Reference, Edge)

·        ConnectorElement.CreateConduitConnector(Document, Reference,Edge)

·        ConnectorElement.CreateCableTrayConnector(Document, Reference,Edge)

allow creation of connector elements in families on centered oninternal loops of a given face.

The property

·        ConnectorElement.SystemType

accesses the MEPSystemType of the connector

The members:

·        ConnectorElement.Direction

·        ConnectorElement.FlipDirection()

access the direction of the connector.

ConnectAir Terminal to Duct

The new method:

  • MechanicalUtils.ConnectAirTerminalOnDuct()

connects an air terminal to a ductdirectly (without the need for a tee or takeoff). The current location of theair terminal will be projected to the duct centerline, and if the point can besuccessfully projected, the air terminal will be placed on the most suitableface of the duct. 

 

General

·        CableTray.CurveNormal returns the "up" directionvector of a cable tray segment.

·        RoutingPreferenceGroup now supports a new rule type for Capfittings.

·        Caps can be automatically be placed on all open connections of apipe with PlumbingUtils.PlaceCapOnOpenEnds(Document, ElementId, ElementId)

Reinforcement API 

There are many new reinforcement and rebar-related methods andclasses in Revit 2014.

AreaReinforcement has several new methods and properties.

·        AreaReinforcement.Create – creates a new AreaReinforcementobject from curves.

·        AreaReinforcement.IsUnobscuredInView - checks if AreaReinforcement is shown unobscured in a view.

·        AreaReinforcement.SetUnobscuredInView - sets AreaReinforcement to be shown unobscured in a view.

PathReinforcement has several new methods and properties.

·        PathReinforcement .Create – creates a newPathReinforcement object from curves.

·        PathReinforcement .AdditionalOffset - gets and setslength offset.

·        PathReinforcement .IsUnobscuredInView - checks ifPathReinforcement is shown unobscured in a view.

·        PathReinforcement .SetUnobscuredInView - setsPathReinforcement to be shown unobscured in a view.

FabricArea has several new methods and properties.

·        FabricArea.Create - now supports an origin point of directionparameter.

·        FabricArea.GetReinforcementRoundingManager - returns anobject for managing reinforcement rounding override settings.

FabricSheet has several new methods and properties.

·        FabricSheet.Create() - new static factory method for creation.

·        FabricSheet.GetLocalCoordinateSystem()

·        FabricSheet.SetLocalCoordinateSystem()

·        FabricSheet.PlaceInHost()

·        FabricSheet.GetReinforcementRoundingManager() - returnsan object for managing reinforcement rounding override settings.

·        FabricSheet.HostId

·        FabricSheet.FabricLocation - the FabricSheet location inthe host.

·        FabricSheet.CoverOffset - the additional cover offset ofthe FabricSheet.

·        FabricSheet.IsCoverOffsetValid() - identifies if thespecified value is valid for use as a cover offset.

FabricSheetType 

·        FabricSheetType.GetReinforcementRoundingManager() - returnsan object for managing reinforcement rounding override settings.

Rebar has several new methods and properties.

·        Rebar.ComputeDrivingCurves() - compute the driving curves.

·        Rebar.GetRebarConstraintsManager() - returns an object formanaging the external constraints on the Rebar element.

·        Rebar.GetReinforcementRoundingManager()  - returns anobject for managing reinforcement rounding override settings.

·        Rebar.HookAngleMatchesRebarShapeDefinition() - checks thatthe hook angle of the specified RebarHookType matches the hook angle used inthe Rebar's RebarShape at the specified end of the bar.

·        Rebar.CanUseHookType - checks if the specifiedRebarHookType id is of a valid RebarHookType for the Rebar's RebarBarType.

·        Rebar.ConstraintsCanBeEdited - returns true, if the Rebarelement's external constraints are available for editing.

·        Rebar.GetHookOrientation() - returns the orientation of thehook plane at the start or at the end of the rebar with respect to theorientation of the first or the last curve and the plane normal.

·        Rebar.SetHookOrientation() - defines the orientation of thehook plane at the start or at the end of the rebar with respect to theorientation of the first or the last curve and the plane normal.

RebarType has several new methods and properties.

·        RebarType.SetHookTangentLength() - identifies the hook tangentlength for a hook type.

·        RebarType.GetReinforcementRoundingManager() - returns anobject for managing reinforcement rounding override settings.

RebarBendData

·        RebarBendData – new constructor to specify hookorientation.

RebarHandleType - a new enum to represent  the varioustypes of handles on a Rebar instance that can be joined to References.

RebarConstrainedHandle  - a new class to represent ahandle on a Rebar that can be joined to a reference.

RebarConstraintType  - a new enum to representthe various types of constraints that can be applied to aRebarConstrainedHandle.

RebarConstraintTargetHostFaceType - a new enum to identify the individual face on a host element to which a Rebarhandle is constrained.

RebarConstraint - a new class representing a constraint onthe position of a Rebar Element or one of its handles.

RebarConstraintsManager -a  new class used to obtaininformation about the constrained shape handles (RebarConstrainedHandles)on a Rebar element.

RebarDeformationType - new enum representing the type ofdeformation of rebar.

RebarHookType.HookAngleInDegrees - a new property representingthe angle of a rebar hook.

RebarInSystem

·        RebarInSystem.getReinforcementRoundingManager - returns anobject for managing reinforcement rounding override settings.

·        RebarInSystem.setUnobscuredInView - sets the element to beshown unobscured in a view.

RebarShape

·        RebarShape.GetDefaultHookAngle - get the hook angle,expressed as an integral number of degrees (common values are 0, 90, 135, and180).

·        RebarShape.GetDefaultHookOrientation - gets the default rebarhook orientation.

ReinforcementRoundingSource - a new enum listing thepossible sources for reinforcement rounding overrides.

ReinforcementRoundingManager - a new class providing access toreinforcement rounding overrides for structural elements.

RebarRoundingManager - new class providing access toelement reinforcement roundings overrides.

FabricRoundingManager - a new class providing access toelement reinforcement roundings overrides.

ReinforcementSettings

·        ReinforcementSettings.GetRebarRoundingManager - returns anobject for managing reinforcement rounding override settings used by RebarBarTypes,Rebar and RebarInSystem elements.

·        ReinforcementSettings.GetFabricRoundingManager -returns anobject for managing reinforcement rounding override settings used byFabricSheetType and FabricSheet elements.

 

Custom Export

The Custom Export API provides access to the rendering outputpipeline through which Revit sends a processed model (its graphics 3Drepresentation) to an output device. In the case of Custom Export, the"device" is represented by a context object that could be any kind ofa device, even a file (in the most common case, actually.) A client of CustomExport provides a context and invokes rendering of a model, upon which Revitstarts processing the model and sends graphic data out via methods of thecontext. The data describes the model exactly as it would have appeared inRevit when the model is rendered. The data includes all geometry and materialproperties.

The following classes have been made available so far:

CustomExporter

A class that allows exporting 3D views via a custom exportcontext. The Export method of this class triggers standard rendering process inRevit, but instead of displaying the result on screen or printer, the output ischanneled through the given custom context that handles processing thegeometric as well as non-geometric information.

IExportContext

An interface of which interface is used in a custom export of aRevit model. The instance of this class is passed in as a parameter of aCustomExporter. The methods are then called by Revit at times of exportingentities of the model.

RenderNode Classes

Classes of which instance are sent to an export context during acustom export.

·        RenderNode - base class for all output nodes

·        ViewNode - represents a View

·        GroupNode - base class for family and link instances

·        InstanceNode - represents an instance of a family

·        LinkNode - represents an external link

·        ContentNode - base class from RPC, Light, and Daylight nodes

·        RPCNode - represents an RPC object

·        DaylightPortalNode - represents a daylight portal

·        LightNode - represents a light

·        MaterialNode - represents a material change

 

CameraInfo

A class that describes information about projection mapping of a3D view to a rendered image. An instance of this class can be obtained via aproperty of ViewNode.

Paint API

The paint tool is now supported in the API

·        Document.Paint

·        Document.RemovePaint

·        Document.IsPainted

·        Document.GetPaintedMaterial

Component repeater API

Component repeaters can be used to replicate (repeat) elementshosted on repeating references. The result of the repeating operation is acollection of slots. Each slot contains one repeated component. TheComponentRepeater class provides the repeating functionality and access to theslots.

Each repeating reference is capable of hosting one point of anadaptive component. An initial pattern can be created by populating one or morerepeating references with such points. Component repeaters can then be used toreplicate the pattern to fill the rest of the repeating references in theparticular repeating reference source.

The repeating references in repeating reference source arearranged in one or two dimensional arrays, allowing for different kinds ofrepeating:

·        One dimensional source allows for repeating along a path.

·        Two dimensional source allows for repeating across a grid.

·        It is also possible to host a point on a zero dimensionalreference (a point). This point will be shared by all slots. A zero dimensionalsource allows for repeating around a single point. It should not be used alone,but together with at least one other repeating reference source (typically onedimensional.) The point hosted on the zero dimensional source serves as acentral point around which other points can be repeated on their respectiverepeating reference sources.

Multiple adaptive components may be hosted on one repeatingreference source, and different points of one adaptive component may be hostedon different repeating reference sources, effectively allowing different pointsof an adaptive component to be repeated using different patterns.

The following classes provide access to the functionality ofComponent repeaters:

·        Autodesk.Revit.DB.RepeatingReferenceSource

·        Autodesk.Revit.DB.RepeaterBounds

·        Autodesk.Revit.DB.RepeaterCoordinates

·        Autodesk.Revit.DB.ComponentRepeater

·        Autodesk.Revit.DB.ComponentRepeaterSlot

Smallenhancements & API interface changes

API validation

Notransactions from outside threads

Calling into the Revit API from outside threads and outsidemodeless dialogs has never been supported, but it was not strictly prohibited,meaning there would be no immediate exceptions when someone tries to modifymodel from outside of the supported API workflows. That has been changed. It isno longer possible to start a transaction unless the caller is inside alegitimate API call, such as an external command, event, updater, call-back,etc. An exception will be thrown if such attempt is made.

IsValidObjectproperty

If a Revit native object contained within an API wrapper isdestroyed, or creation of the corresponding native object is undone, themanaged API object containing it is no longer valid. API methods cannot becalled on invalidated wrapper objects. The property IsValidObject (added tomany API classes) can be used to identify if the corresponding native objecthas gone out of scope.

Enumeratedtype validation

Automatic validation has been introduced for enumerated typeinputs to API methods and properties. If an value is improperly cast to an enumand is not a valid member of that enum, an ArgumentOutOfRangeException will bethrown.


 

Elements

Copy& paste elements

The new methods:

·        ElementTransformUtils.CopyElements(Document,ICollection, Document, Transform)

·        ElementTransformUtils.CopyElements(View,ICollection, View, Transform)

·        Transform ElementTransformUtils.GetTransformFromViewToView(View,View)

support copy and paste of arbitrary elements.  The firstoverload supports copy within documents, or from document to document. The second overload also support copying within one document or between two documents,but specifically supports copy and paste of view-specific elements.

Materials

Materials applied with the Paint tool and their areas can befound by specifying "true" for the 'usePaintMaterial' argumement inElement.GetMaterialIds and Element.GetMaterialArea

Geometry

FreeFormelement

A FreeFormElement is a form sub-type that containsnon-parametric geometry created from an input solid outline. The element can beadded to families, and can participate in joins and void cuts with othercombinable elements.  Planar faces of the element can be offsetinteractively and programmatically in the face normal direction.

·        FreeFormElement.Create() - creates a new FreeForm element.

·        FreeFormElement.SetFaceOffset() - offsets a planar face acertain distance in the face normal direction.

Solid& curve intersection

The new method

·        Solid.IntersectWithCurve()

calculates the intersection between a closed volume Solid and acurve. There is an option to return details about the segments inside thevolume, or outside. Both the curve segments and the parameters of the segmentsare available in the results.


 

Face/FaceIntersection

The method

  • Face.Intersect()

calculates the intersection of theinput face with this face and returns the intersection results.  Themethod can output the intersection geometry if the intersection consists of asingle curve.

ReferenceIntersector& RVT Links

The new option findReferencesInRevitLinks allowsReferenceIntersector to find geometry in RVT links.

Rulingsof RuledFace

The new method

·        RuledFace.RulingsAreParallel

determines if the rulings of the ruled surface areparallel.

Detail elements

Detailelement draw order

The class

·        DetailElementOrderUtils

now includes routines to BringToFront, BringForward, SendToBack,SendBackward multiple detail members.  The draw order of the members doesnot change relative to one another.

Stairs

StairsRunJustification

New values LeftExterior and RightExterior have been added tothis enum to support jusitification to the left and right supports.

StairsLanding

The new members:

·        CreateAutomaticLanding(Document, ElementId, ElementId)

·        CanCreateAutomaticLanding(Document, ElementId, ElementId)

provide automatic landing(s) creation and creation validationbetween two stairs runs.

StairsRun

The new properties:

·        StairsRun.ExtensionBelowRiserBase

·        StairsRun.ExtensionBelowTreadBase

represent the extension/trim value for the run, depending uponwhether the run begins with a riser or tread.

These replace the deprecated property:

·        StairsRun.ExtensionBelowBase

which now accesses whichever property listed above depending onthe run's configuration.

StairsComponentConnection

The new methods:

·        StairsRun.GetConnections()

·        StairsLanding.GetConnections()

provide information about connections among stairs components(run to run, or run to landing).

Parameters & filters

Parameter.AsValueString()

This method previously was implemented for only Integer andDouble values. It now can also be used with Enums and ElementIds. Optionally itcan accept a FormatOptions object to specify units formatting of the returnedstring.

Parameter.Definition.UnitType

This new property provides access to the UnitType of a parameterdefinition.

Parametervariance among group instances

The new members:

·        InternalDefinition.VariesAmongGroups

·        InternalDefinition.SetVariesAmongGroups(Document)

support read and write to the option that the parameter valuecan vary across groups.  This can be changed only for non-built-inparameters.

FilterCategoryRule

The new class FilterCategoryRule can be used in the definitionof a ParameterFilterElement.   It represents a filter rule thatmatches elements of a set of categories.

The related method:

·        ParameterFilterElement.AllCategoriesFilterable()

has been replaced by

·        FilterCategoryRule.AllCategoriesFilterable()

Miscellaneous

ThermalAsset.SpecificHeat

This new property provides the specific heat value of a thermalasset in feet per Kelvin, squared-second.

AreaVolumeSettings

This new class provides access to settings related to volume andarea computations. The old VolumeCalculationSetting class is obsolete. 

Document.Delete()

This method previously returned null if the element or elementscould not be deleted. It now will throw an exception in this situation.

Documentlevel updaters

The new methods:

·        UpdaterRegistry.IsUpdaterRegister(UpdaterId, Document)

·        UpdaterRegistry.UnregisterUpdater(UpdaterId, Document)

provide the ability to inquire about and to unregister updatersthat are associated to specific documents. 

UIThemeManager

The static properties of UIThemeManager provide access to thecurrent UI theme and the default theme.

Families & content

Familycategory

The property

·        FamilyBase.FamilyCategory

can now be set.  This allows the category of an familybeing edited to be changed.

SpatialElementCalculationLocation

The class SpatialElementCalculationLocation is used to specifythe room or space where an element should be considered as placed.


This is a base class with currently subtypes of calculation location:

·        SpatialElementCalculationPoint

·        SpatialElementFromToCalculationPoints

A SpatialElementCalculationLocation can be added to the familyby turning on the family's ROOM_CALCULATION_POINT parameter.   Once thelocation has been added, you can access the marker position using theMarkerPosition property. 

Note that the MarkerPosition property is no longer settable -this position is determined automatically.

SpatialElementFromToCalculationPoints

SpatialElementFromToCalculationPoints is a subclass ofSpatialElementCalculationLocation used to specify the search points for afamily instance that connects two rooms or spaces, such as a door or window.The points determine which room or space is considered the "from" andwhich is considered the "to".    The propertiesToPosition and FromPosition govern the coordinates for these points.

Arcthrough points

The method

·        CurveByPointsUtils.CreateArcThroughPoints()

creates an arc curve through three input ReferencePoints.

Events

DocumentChangedEventArgs

For the methods GetAddedElementIds()/GetModifiedElementIds() -internal Revit element ids that are not visible to UI and API are now excludedfrom the return set.

GetAddElementIds(ElementFilter)/GetModifiedElementIds(ElementFilter)

The new methods:

·        DocumentChangedEventArgs.GetAddedElementIds(ElementFilter)

·        DocumentChangedEventArgs.GetModifiedElementIds(ElementFilter)

only return ElementIds that pass the input element filter. Thishelps applications detect only specific changes of interest.

 

Reinforcement API

ReinforcementLength Tolerance

The new classes:

·        RebarRoundingManager

·        FabricRoundingManager

contain settings for rounding tolerance for rebar and fabricreinforcement elements.  They can be assigned at the element instancelevel (Rebar, RebarInSystem, FabricArea, FabricSheet), at the type level(RebarType, FabricSheetType), or at the ReinforcementSettingslevel.   Lower level settings override the setting of higherlevels. 

 

 

你可能感兴趣的:(Revit,Revit,二次开发中级技术,海报)