Face area - DC or ruby ?
-
Hello all,
Thanks for all the great resources they have been very helpful as I start to learn the world of ruby and dynamic components. I was wondering how to best approach a problem - whether through dynamic components or rubyscript...I have seen several examples of face area calculators but have yet to see one that digs into components. End goal: generate a report that summarizes face area according to material in each component (sensitive to scaling). Can this be done in DC? I noticed that the facearea function does not adjust if the component is scaled. Or am I better off trying to loop through components expanding on one of the ruby script snippets posted on this forum? any help would be much appreciated!
mv -
Hi Mike,
Start with plain Ruby. Then you can re-use the code in a custom DC function, if desired.
Just in case your search did not turn up Adam's solution for finding face area in nested components, while accounting for scale, see this post.
-
Vanderlm
I think there exist some plugins that do area computation (among other things).
Just in case, here is a ruby for computing areas recursively in the selection, by component and by material, with choice of units and CSV generation.
to drop into the Sketchup plugins directoryIf this is to embed within a plugin of yours, feel free to take inspiration from the code.
Fredo
-
Fredo and Jim -Thanks - very useful info and links! - I will explore and feedback
mike -
wow - just tried out the rb and it was exactly what I was looking for! I will follow up with any extensions I can incorporate from the suggested post - hugely helpful starting points!
-
@vanderlm said:
wow - just tried out the rb and it was exactly what I was looking for! I will follow up with any extensions I can incorporate from the suggested post - hugely helpful starting points!
It is also possible to generate a HTML report, via a Web dialog or in a file.
Fredo
Advertisement