Path: GetSectionLength
Called to get the length of a given section.
Function
Number GetSectionLength(sectionId: Integer)
Parameters
Name | Type | Description |
---|---|---|
sectionId | Integer | The id of the section whose length we are to retrieve. One based. |
Return Value
The length of the requested section, such that a call to MoveAlongSectionWithDistance given the value as the distance parameter would move the object to the end. The returned value is in the units of the project (metric or imperial). If the section is invalid, a length less than zero is returned.
Example
let path = GetComponentByNameAndType("Path1", "Path");
let len = path.GetSectionLength(1);
if (len < 0.0) {
throw new Error("Could not find section length.");
}
LogDebug(`The first section of Path1's length is ${len} units.`);