Hello,
This is pretty simple and someone has probably already done this, but I am looking for help on creating a custom attribute on a dynamic component. The component is just a simple path (multiple edges) and all I’m trying to do is report the path length.
I know entity info already provides this when you select the line but how can you get this info to report as a custom attribute if you make a path a dynamic component. Ultimately my goal is to generate a report with the path length of components. It’s easy to calculate a single edge length using LenX, LenY, LenZ, but how do you accomplish this for multiple connected edges?
Thanks for any help on this,
Chris
There are no builtin iterator functions for the Dynamic Components.
So for example there is no EACHEDGES()
function that allows iterating a DC’s edges, nor any EDGELENGTHS()
function to sum the ungrouped edge lengths. (Strange as there is a FACEAREA()
function to sum ungrouped face areas.)
I do not know if it is yet ultimately possible, but just brainstorming…
Each “segment” would likely need to be a dynamic subcomponent, that has an edge, and a nested DC segment.
The outermost “ancestor” DC would need attribute:

Segments
as the number of segments in the path.

TotalLength
as the total cumulative length.
Each “segment’s” instance “dynamic_attributes” dictionary has:

Index
as it’s segment number in the set of Parent!Segments

X
,Y
,Z
is the “segment’s” origin (in relation to the outer parent DC’s origin.)

RotY
& RotZ
is the direction pointing toward the next copy’s origin.

LenX
the length of the “segment”.
Each segment could reference it parent length via =Parent!LenX
and set a cumulative path length into a local (instance) attribute like:
PathLen: =LenX+Parent!LenX
Now if the last nested segment does not have a inner child segment perhaps it might be able to pass the cumulative length up to the outermost “ancestor” segment, if you know it’s name. (Let’s call it “OuterMost”), ie:
=SET("OuterMost!TotalLength",PathLen)
But I am unsure if you can set another component’s attribute this way, or if you can skip up multiple levels.