Submitted by zest on Thu, 11/01/2018 - 03:05
Forums:
Hallo there,
I would like to get the value of the length of all lines which are at the specific layer. Then, when is possible to get the data in the table in a drawing.
i.e.
L251=3875mm
L252=5620mm
Thanks,
zest
re: line lengths
You can iterate through all the lines in a part via the .Lines collection. You can check the .Layer of each line and use .GetLength to find the length and add it to a running total.
Below is some pseudocode:
Dim lineLengths(256) as double
for each tempLine as Line in myPart.Lines
linelengths(templine.Layer) += tempLine.GetLength
next
After the code completes, lineLengths(1) will hold the sum total length of lines on layer 1, lineLengths(2) will hold the total for layer 2, etc.