Reference
Reference in revit is the geometric reference object of the model element ,it is often used when inserting a new face-base instance of a family , or when creating the demensions.
The following is an introduction to some of the methods used to obtain the reference.
Reference Type
Enum | Representation | StableRepresentation Comment |
---|---|---|
REFERENCE_TYPE_NONE | ||
REFERENCE_TYPE_LINEAR | LINEAR | endpoints of segment:LINEAR/0,LINEAR/1 |
REFERENCE_TYPE_SURFACE | SURFACE | |
REFERENCE_TYPE_FOREIGN | FOREIGN | |
REFERENCE_TYPE_INSTANCE | INSTANCE | |
REFERENCE_TYPE_CUT_EDGE | CUT_EDGE | cut/join between elements:CUT_EDGE/{index} |
REFERENCE_TYPE_MESH | MESH | |
REFERENCE_TYPE_SUBELEMENT | SUBELEMENT |
Normal way
In general, we can get the reference directly by getting the geometry object.
- GeometryObject(When using the
Element.Geometry(Options)
methodComputeReferences
needs to be Ture):- Curve、Face:
Reference
property - EndPoints:
Curve.GetEndPointReference()
method
- Curve、Face:
- Reference Plane/Line In FamilyInstance
familyInstance.GetReferences(FamilyInstanceReferenceType)
method(API only available after 2018 version)
FamilyInstanceReferenceType Enum |
---|
Left |
CenterLeftRight |
Right |
Front |
CenterFrontBack |
Back |
Bottom |
CenterElevation |
Top |
StrongReference |
WeakReference |
NotAReference |
StableRepresentation
Revit also provides Reference.ParseFromStableRepresentation()
methods for us to use string to get the reference.You can use the ConvertToStableRepresentation
method to get the description string for the reference.
The following section describes an unusual way to obtain a reference by manually combining strings.
System Type
Walls, columns, etc.
- {element uniqueID}:{index}:{type}
- Face:
2a85534d-cd7e-40de-8971-44f7bf707fd5-00000a58:5:SURFACE
- Segment:
2a85534d-cd7e-40de-8971-44f7bf707fd5-000009ad:0:LINEAR
- Endpoint:
2a85534d-cd7e-40de-8971-44f7bf707fd5-000009cd:0:LINEAR/0
- Cut Edge:
2a85534d-cd7e-40de-8971-44f7bf707fd5-000009cd:0:CUT_EDGE/10
- Intersection:No open api
- Compound Structure:{element uniqueID}:-9999:{CompoundStructureLayerID+}:907bc2cc-4e2b-46dd-a585-3304705f2899-00000a09:-9999:2
- Face:
Loadable Family
- {FamilyInsatnce uniqueID}:{index(Generally zero)}:INSTANCE:{FamilySymbol uniqueID}:{index}:{type}
- Face:
2a85534d-cd7e-40de-8971-44f7bf707fd5-00001495:0:INSTANCE:2a85534d-cd7e-40de-8971-44f7bf707fd5-00001481:109:SURFACE
- Segment:
2a85534d-cd7e-40de-8971-44f7bf707fd5-00001495:0:INSTANCE:2a85534d-cd7e-40de-8971-44f7bf707fd5-00001481:156:LINEAR
- Endpoint:
2a85534d-cd7e-40de-8971-44f7bf707fd5-00001495:0:INSTANCE:2a85534d-cd7e-40de-8971-44f7bf707fd5-00001481:156:LINEAR/1
- Face:
- MEP Connector
- {FamilyInsatnce uniqueID}:{ID incremented from 3001}:
2a85534d-cd7e-40de-8971-44f7bf707fd5-00001495:3001
- {FamilyInsatnce uniqueID}:{ID incremented from 3001}:
RevitLink
- System Type
- {LinkInstance uniqueID}:{index(Generally zero)}:REVITLINK:{original Element Id in link document}:{index}:{type}:
2a85534d-cd7e-40de-8971-44f7bf707fd5-00002b68:0:RVTLINK:2492:5:SURFACE
- {LinkInstance uniqueID}:{index(Generally zero)}:REVITLINK:{original Element Id in link document}:{index}:{type}:
- Loadable Family
- {LinkInstance uniqueID}:{index(Generally zero)}:REVITLINK:{original FamilyInsatnce Id in link document}:{index(Generally zero)}:INSTANCE:{original FamilySymbol Id in link document}:{index}:{type}:
2a85534d-cd7e-40de-8971-44f7bf707fd5-00002b68:0:RVTLINK:4685:0:INSTANCE:3539:156:LINEAR
- {LinkInstance uniqueID}:{index(Generally zero)}:REVITLINK:{original FamilyInsatnce Id in link document}:{index(Generally zero)}:INSTANCE:{original FamilySymbol Id in link document}:{index}:{type}:
- MEP Connector
- {LinkInstance uniqueID}:{index(Generally zero)}:REVITLINK:{original FamilyInsatnce Id in link document}:{ID incremented from 3001}:
2a85534d-cd7e-40de-8971-44f7bf707fd5-00002b68:0:RVTLINK:4685:3001
- {LinkInstance uniqueID}:{index(Generally zero)}:REVITLINK:{original FamilyInsatnce Id in link document}:{ID incremented from 3001}: