C# Class Revit.SDK.Samples.BeamAndSlabNewParameter.CS.Command

Inheritance: IExternalCommand
Show file Open project: AMEE/revit

Public Methods

Method Description
Execute ( Autodesk revit, string &message, ElementSet elements ) : Autodesk.Revit.UI.Result

Implement this method as an external command for Revit.

FindElement ( string UniqueIdValue ) : void

found the element which using the GUID that was assigned to the shared parameter in the shared parameters file.

SendValueToListBox ( ) : ArrayList

Display the value of Unique ID parameter in a list box

SetNewParameterToBeamsAndSlabs ( ) : bool

Add a new parameter, "Unique ID", to the beams and slabs The following process should be followed: Open the shared parameters file, via the Document.OpenSharedParameterFile method. Access an existing group or create a new group, via the DefinitionFile.Groups property. Access an existing or create a new external parameter definition, via the DefinitionGroup.Definitions property. Create a new Binding with the categories to which the parameter will be bound using an InstanceBinding or a TypeBinding. Finally add the binding and definition to the document using the Document.ParameterBindings object.

SetValueToUniqueIDParameter ( ) : void

Set value(uuid) to Unique ID parameter

Private Methods

Method Description
AccessOrCreateExternalSharedParameterFile ( ) : DefinitionFile

Access an existing or create a new shared parameters file

Method Details

Execute() public method

Implement this method as an external command for Revit.
public Execute ( Autodesk revit, string &message, ElementSet elements ) : Autodesk.Revit.UI.Result
revit Autodesk An object that is passed to the external application /// which contains data related to the command, /// such as the application object and active view.
message string 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.
elements ElementSet A set of elements to which the external application /// can add elements that are to be highlighted in case of failure or cancellation.
return Autodesk.Revit.UI.Result

FindElement() public method

found the element which using the GUID that was assigned to the shared parameter in the shared parameters file.
public FindElement ( string UniqueIdValue ) : void
UniqueIdValue string
return void

SendValueToListBox() public method

Display the value of Unique ID parameter in a list box
public SendValueToListBox ( ) : ArrayList
return System.Collections.ArrayList

SetNewParameterToBeamsAndSlabs() public method

Add a new parameter, "Unique ID", to the beams and slabs The following process should be followed: Open the shared parameters file, via the Document.OpenSharedParameterFile method. Access an existing group or create a new group, via the DefinitionFile.Groups property. Access an existing or create a new external parameter definition, via the DefinitionGroup.Definitions property. Create a new Binding with the categories to which the parameter will be bound using an InstanceBinding or a TypeBinding. Finally add the binding and definition to the document using the Document.ParameterBindings object.
public SetNewParameterToBeamsAndSlabs ( ) : bool
return bool

SetValueToUniqueIDParameter() public method

Set value(uuid) to Unique ID parameter
public SetValueToUniqueIDParameter ( ) : void
return void