M

CableType.GetCableTypeId

Description:
Gets the Cable Type id by given cable type name.
public static ElementId GetCableTypeId(
	Document document,
	string name
)
  • document
    The document.
  • String
    name
    The Cable Type name.
Return Value ElementId The Cable Type id. InvalidElementId will be returned if no Cable Type by given name.
  • document is not a project document. -or- name cannot include prohibited characters, such as "{, }, [, ], |, ;, less-than sign, greater-than sign, ?, `, ~". -or- name is an empty string.
  • 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).