@tig said:
This is old code.
It's for DCs only.
It was posted as an example, for you to edit as you wish.
To add a 'header' simply create the first line before the other rows.
Then adjust the units to report in feet and change the code to report the instance count rather than material...
So from line#40 change it to read like this:
data=["Name#{sep}Width#{sep}Depth#{sep}Height#{sep}Quantity"]
> insts.each{|inst|
> defn=inst.definition
> name=defn.name.tr(sep, "_")
> lenx=defn.get_attribute("dynamic_attributes", "lenx", 0).to_f.to_feet.to_s
> leny=defn.get_attribute("dynamic_attributes", "leny", 0).to_f.to_feet.to_s
> lenz=defn.get_attribute("dynamic_attributes", "lenz", 0).to_f.to_feet.to_s
> quan=defn.instances.length.to_s
> dat = "#{name}#{sep}#{lenx}#{sep}#{leny}#{sep}#{lenz}#{sep}#{quan}"
> data << dat
> }
>
Thanks a lot this worked perfectly fine.