Home > All Other Interfaces > IAttachment > AttachTo
The AttachTo() method attaches an object to another object by using the other object’s ID which is given in the first argument (the latter object is referred to as the leading object). When attaching two objects, the attached object follows the leader object at the given offsets. This method can be used to create a formation of objects that move in a group using the path of the leading object as their path. Passing an empty string detaches the object from the object it is attached to.
JavaScript |
|
AttachTo( TerrainObjectID, DeltaX, DeltaY, DeltaAltitude) |
C# |
|
void AttachTo( string TerrainObjectID, double DeltaX, double DeltaY, double DeltaAltitude) |
C++ |
|
HRESULT AttachTo( [in] BSTR TerrainObjectID, [in] double DeltaX, [in] double DeltaY, [in] double DeltaAltitude) |
Parameters
TerrainObjectID
The ID of the object that the current object attaches to. Passing an empty string detaches the object from the object it is attached to.
DeltaX
The distance between the x-coordinates of the attached objects. This number stays consistent while the objects are attached. A positive DeltaX places this object to the left of the leading object.
DeltaY
The distance between the y-coordinates of the attached objects. This number stays consistent while the objects are attached. A positive DeltaY places this object behind the leading object.
DeltaAltitude
The distance between the heights of the attached objects. This number stays consistent while the objects are attached. A positive DeltaAltitude places this object above the leading object.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.