Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone! I have been able to find some resources on renaming components with the API, but no luck finding anything for renaming bodies. Is this possible? The Add-On our team is working on creates a new body via a 0mm offset and then a 3mm thicken, but the body is named something arbitrary like 'body456' - is there any way to choose what this name will be, or edit it after creating?
Thank you so much in advance for your help / insight!
'''
Offset Feature
'''
# Create input entities for offset feature
inputEntities = adsk.core.ObjectCollection.create()
for face in faces:
inputEntities.add(face)
# Distance for offset feature
distance = adsk.core.ValueInput.createByString('0 mm')
# Create an input for offset feature
offsetFeatures = features.offsetFeatures
offsetInput = offsetFeatures.createInput(
inputEntities, distance, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
# Create the offset feature
# offsetFeatures.add(offsetInput)
offsetBody = offsetFeatures.add(offsetInput)
'''
Thicken Feature
'''
# Create the thicken feature
thickenFeatures = features.thickenFeatures
inputSurfaces = adsk.core.ObjectCollection.create()
thickenFaces = offsetBody.faces
for face in thickenFaces:
inputSurfaces.add(face)
thickness = adsk.core.ValueInput.createByString('3 mm')
thickenInput = thickenFeatures.createInput(
inputSurfaces, thickness, False, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
thickenedBody = thickenFeatures.add(thickenInput)
Solved! Go to Solution.