Want to get volume using 3dprint addon but get Problem From blender Console Problem in Console
Error: Traceback (most recent call last):
  File &quot;\Text&quot;, line 51, in invoke   
  File &quot;\Text&quot;, line 51, in &lt;genexpr&gt;
  File &quot;\Text&quot;, line 43, in calc_volume
NameError: name 'mesh_helpers' is not defined
location: &lt;unknown location&gt;:-1

import bpy, os
from bpy.types import Panel
from bpy.utils import register_class, unregister_class

import math

import bpy
from bpy.types import Operator
from bpy.props import (
    IntProperty,
    FloatProperty,
)
import bmesh

class View3DPrintPanel:
    bl_category = &quot;3D-Print&quot;
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'

    @classmethod
    def poll(cls, context):
        obj = context.active_object
        return obj is not None and obj.type == 'MESH' and obj.mode in {'OBJECT', 'EDIT'}
class VIEW3D_PT_print3d_transform(View3DPrintPanel, Panel):
    bl_label = &quot;Transform&quot;
    bl_options = {&quot;DEFAULT_CLOSED&quot;}

    def draw(self, context):
        layout = self.layout

        layout.label(text=&quot;Scale &quot;)
        row = layout.row(align=True)
        row.operator(&quot;mesh.print3d_scale_to_volume&quot;, text=&quot;Volume&quot;) 

class MESH_OT_print3d_scale_to_volume(Operator):
    bl_idname = &quot;mesh.print3d_scale_to_volume&quot;
    bl_label = &quot;Scale to Volume&quot;
    bl_description = &quot;Scale edit-mesh or selected-objects to a set volume&quot;
    bl_options = {'REGISTER', 'UNDO'}

    volume_init: FloatProperty(
        options={'HIDDEN'},
    )
    volume: FloatProperty(
        name=&quot;Volume&quot;,
        unit='VOLUME',
        min=0.0,
        max=100000.0,
    )

    def execute(self, context):
        scale = math.pow(self.volume, 1 / 3) / math.pow(self.volume_init, 1 / 3)
        scale_fmt = clean_float(f&quot;{scale:.6f}&quot;)
        self.report({'INFO'}, f&quot;Scaled by {scale_fmt}&quot;)
        _scale(scale, self.report)
        return {'FINISHED'}

    def invoke(self, context, event): 
        def calc_volume(obj):
            bm = mesh_helpers.bmesh_copy_from_object(obj, apply_modifiers=True)
            volume = bm.calc_volume(signed=True)
            bm.free()
            return volume

        if context.mode == 'EDIT_MESH':
            volume = calc_volume(context.edit_object)
        else:
            volume = sum(calc_volume(obj) for obj in context.selected_editable_objects if obj.type == 'MESH')

        if volume == 0.0:
            self.report({'WARNING'}, &quot;Object has zero volume&quot;)
            return {'CANCELLED'}

        self.volume_init = self.volume = abs(volume)

        wm = context.window_manager
        return wm.invoke_props_dialog(self)

 



 

def register():
     register_class(VIEW3D_PT_print3d_transform)
 
def unregister():
     unregister_class(VIEW3D_PT_print3d_transform)
if __name__ == '__main__':
    register()
```
Python NameError
The error occurs on this line.
bm = mesh_helpers.bmesh_copy_from_object(obj, apply_modifiers=True)
      

and is informing you that mesh_helpers is not defined.
Assume you are doing a bit of copy paste to and from the 3D print addon, where no doubt mesh_helpers is imported and available, whereas you missed it. It  can be imported from the 3D print toolbox
from object_print3d_utils import mesh_helpers

may find similar issues with clean_float and _scale.