Message 1 of 2
How to get an extrusion name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I made a script to do an extrusion and define a name of "Tubo ..."
profile = sketch.profiles.item(1)
extent_distance = adsk.core.ValueInput.createByReal(ExtrusionLengthSelect)
extrudes = root_comp.features.extrudeFeatures
extrude1 = extrudes.addSimple(profile, extent_distance,
adsk.fusion.FeatureOperations.NewComponentFeatureOperation)
extrude1.name="Tubo "+str(float(fHeight))+"x"+str(float(fWidth))+"x"+str(float(wallThick))
Now I want a way to get the extrusion name. But I couldn't do it.
My code
extname = root.features #.extrudeFeatures
bBox2: adsk.core.BoundingBox3D = root.preciseBoundingBox #str(extrudes.item(0).name)
if extname.count > 0:
ext=extname.item(0)
#fun_dict = {t.__name__: t for t in extname}
flatSize2 = [
str(ext),
round(abs(bBox2.maxPoint.x - bBox2.minPoint.x)*10,2),
round(abs(bBox2.maxPoint.y - bBox2.minPoint.y)*10,2),
round(abs(bBox2.maxPoint.z - bBox2.minPoint.z)*10,2),
]