Consider a method with minimum formula and maximum reuse. For the frame, one DC is used for all the parts.
Assume material is Pine and this cuboid is used for plates, studs, noggins, trim, etc
The Component is called Pine, and its instances are named frame parts. You will note changing the instance name changes the attribute and option headers. (instance change is initiated after insert, does not work within its created file)
By keeping the same axis, painted materials orientation is same, lengths in report same…
at this point start building the report
The next step is to move, place and scale to form the elements of the frame.
The outside elements, end studs, top and bottom plates if placed with their axis facing inward will naturally hold their positions, no need for formula!
More to come, but first can you upload these extensions as mentioned in
Bugsplat when loading a dynamic component - Technical Problems / SketchUp - SketchUp Community
Plus if have not, try OCL for takeoffs as simpler to use


