How to measure the sum of the length of all edges of an object?

Okay here we go. Mucho big improvements. Like, a whole buttload of them. Give it a whirl.

Install the attached .py file as an Add-on. Edit > Preferences > Add-ons tab > Install > browse to .py file and accept. Don’t forget to enable it after installing. No need to copy/paste and run from the Script Editor.

  • No more hard-coded file names or file paths! party.gif
  • By default the script will output a .csv file in the same directory as the currently opened .blend file using the file’s name. e.g. If you open ‘filename.blend’ and run the script it will save ‘filename.csv’ in the same folder.
  • User can uncheck those checkboxes and manually supply an output directory or output file name if they wish. (fragile? May not work with more than one period in a file name; may or may not work with special characters or accents; only tested on Windows 10 in English)
  • Script will now process every mesh in the opened file automatically (I haven’t yet added a filter to match “cross-section_xxxx” so it just grabs everything). You don’t have to select meshes anymore. Just open the file and press the button.
  • Script will ignore the scale reference object if the user supplies the name. Script defaults to “SCALE 4.2x6.3” (without the quotes) if a name is not manually provided.
  • Any mesh that possibly has an error will now be flagged in the console output and left selected at the end of the operation.
  • Meshes with possible errors WILL NOT be added to the .csv output. All the good meshes will still be written to the .csv file.

I see in the example file you attached that cross section 285 has a tiny hole in it, which is why the error happens. Is there a scenario where there is a real (valid) hole in a cross section? Like a cavity or void inside? Or are the slices supposed to always be one outer perimeter with a solid inside? If there are cases where a real hole is supposed to exist then the script in its current state will probably error on them every time (false positive error), which I would want to fix for you (a simple fix, in theory).

Measure_Tools_v_0_0_2.py (10.0 KB)

1 Like