Path: GetSectionCoordinates
Return the coordinates of the points from a Path section.
🔁 Function
Array GetSectionCoordinates(sectionId: Integer)
⚙️ Parameters
| Name | Type | Description |
|---|---|---|
SectionId |
Integer | 1-based section identifier. |
↩️ Return Value
Returns an array of point objects for the specified section, or null if the section is not found. If the section exists but contains no points, an empty array is returned.
| Name | Type | Description |
|---|---|---|
Index |
Integer | 1-based section identifier. |
X |
Number | X coordinate of the point. |
Y |
Number | Y coordinate of the point. |
Z |
Number | Z coordinate (elevation) of the point. |
Bulge |
Number | Arc bulge for the segment starting at this vertex. |
A JavaScript array with point data:
[{ "Index": 0, "X": 1, "Y": 2, "Z": 0.5, "Bulge": 0.445 }, { "Index": 1, "X": 3, "Y": 2, "Z": 0.5, "Bulge": 0.2 }]
📝 Example
const path = GetComponentByNameAndType("Path1", "Path");
const pts = path.GetSectionCoordinates(1);
if (pts === null) {
LogDebug("Section 1 not found.");
} else if (pts.length === 0) {
LogDebug("Section 1 exists but has no points.");
} else {
LogDebug(`Path1 P1 -> x:${pts[0].X}, y:${pts[0].Y}, z:${pts[0].Z}, bulge:${pts[0].Bulge}`);
LogDebug(`Path1 P2 -> x:${pts[1].X}, y:${pts[1].Y}, z:${pts[1].Z}, bulge:${pts[1].Bulge}`);
}