2027 Method
Changes 7
M

GenericZone.CreateSpaceBased

Description:
Creates a new instance of a generic zone using a set of spaces and adds it to the document.
public static GenericZone CreateSpaceBased(
	Document doc,
	ElementId typeId,
	string name,
	GenericZoneDomainData domainData,
	ElementId levelId,
	ISet<ElementId> spaceIds
)
  • doc
    The document where the element will be created and added.
  • typeId
    The space-based element type for the new generic zone.
  • String
    name
    The name of the generic zone to be created.
  • domainData
    The specific domain requirements for the generic zone.
  • levelId
    The base level on which the generic zone will be created.
  • ISet<ElementId>
    spaceIds
    The associated spaces for the zone.
Return Value GenericZone The newly created generic zone.
  • The element type is not a valid space-based type for this generic zone. -or- name is an empty string. -or- name cannot include prohibited characters, such as "{, }, [, ], |, ;, less-than sign, greater-than sign, ?, `, ~". -or- The ElementId levelId is not a Level. -or- The ElementIdSet spaceIds must be all MEP Spaces, and associated with the same level as levelId.
  • A non-optional argument was null
  • The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements).
  • The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document is being loaded, or is in the midst of another sensitive process.
  • The document has no open transaction.