How to get the bevel diameter then remove bevel or extruded value on curve with a script addon?

I have a scene with many objects including some cables made with bezier curve type poly with bevel. The curves are cables with the proper diameter and length, the cable's Diam is done with the bevel depth.

So I started a script for getting all curves and for each curve I made a copy.

Now how do I get the data from the copied object?

First I need to get the size or diameter of the bevel, then remove the bevel on the curve, and after that I can convert to a mesh line and find the length.

Here is beginning of script for this

for  i in obj_sel:

    if i.type=='CURVE':
        print ('name = ', i.name,'Type',i.type )

        ob = i.copy()
        ob.location.x = 10
        ob.data = ob.data.copy()
        print ('new ob name new curve =', ob.name)

                # get diameter of bevel for that curve and save it 
        # Make a copy of the curve then    ?????
        # Remove the bevel 

            # convert curve to mesh

        bpy.ops.object.convert( target='MESH')
        print ('new ob name new mesh line =', ob.name)

        MESHNAME = ob.name


for more details see following thread


If a file sample is needed let me know on that thread and I can upload one

thanks for any help happy blendering


You can get curve Bevel depth with bpy.context.object.data.bevel_depth

or set it with bpy.context.object.data.bevel_depth = 0.1 (replace 0.1 with desired value)

  • $\begingroup$ i found another way using the curve data $\endgroup$
    – Ricky
    Nov 29 '17 at 2:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.