|
|
|
|
|
The APIs to create
and edit rebar shape have undergone considerable changes.
|
|
|
|
First change is
the steps to create Rebar shape
|
|
In 2011, the steps
were:
|
|
Create a
RebarShape inside the Document.
|
|
Create a
RebarShapeDefinition inside the RebarShape.
|
|
Add data to the
RebarShapeDefinition.
|
|
Commit the
RebarShape.
|
|
In 2012, the steps
are:
|
|
Create a
RebarShapeDefinition. (It refers to the Document, but is not inside
the document.)
|
|
Add data to the
RebarShapeDefinition.
|
|
Create a
RebarShape inside the Document based on the RebarShapeDefinition. (Only now
is the document modified.)
|
|
|
|
The second changes
are the changes of methods.
|
|
the following
methods are removed:
|
|
Autodesk.Revit.Creation.Document.NewRebarShape()
|
|
RebarShape.NewDefinitionBySegments()
|
|
RebarShape.NewDefinitionByArc()
|
|
and replaced by:
|
|
RebarShape.Create(Document,
RebarShapeDefinition, ... )
|
|
The
RebarShapeDefinitionBySegments constructor.
|
|
The
RebarShapeDefinitionByArc constructors.
|
|
|
|
In Revit 2011,
Shared parameter is used in the methods to define the rebar definition shape.
Now ElementId of the shared parameter is used in those methods.
RebarShapeParameters class provides method to obtain ElementId the
corresponding shared parameter.
|
|
|
|
Because of these
big changes, the main work of RST plug-ins is for rebar shape creation. The
code have to be updated according to these changes. For anything about the
code migration, please Search the What’s New section in RevitAPI.chm file. It
explains the reason.
|
|
|
|
The minor changes
related rebar are the method to create the rebar hook type is a static method
RebarHookType class, and the method is renamed to Create. Overloaded methods
to create rebar are moved to be static
member methods of Rebar class and we now have exclusive methods called
CreateFromCurves and CreateFromRebarShape to create new rebars. They no
longer return null for invalid arguments, and they no longer regenerate the
document.
|