loft a surface from 3d splines

loft a surface from 3d splines

franck.gressier
Enthusiast Enthusiast
452 Views
0 Replies
Message 1 of 1

loft a surface from 3d splines

franck.gressier
Enthusiast
Enthusiast

Hello,

I am trying with the API to make a surface using the loft feature.

I have a sketc3dSplines where I have a bunch of 3d splines.

 

If this is in the root component then this peace of script works:

import adsk.core, adsk.fusion, traceback

def run(context):
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
design = app.activeProduct
comp = design.activeComponent
# ui.messageBox(comp.name)
sketches = comp.sketches
splines3d = sketches[0].sketchCurves.sketchFittedSplines

features = comp.features
loftFeats = features.loftFeatures
loftInput = loftFeats.createInput(adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
loftInput.isSolid = False
loftSectionsObj = loftInput.loftSections

for courbe in splines3d:
openProfile = adsk.fusion.Path.create(courbe, adsk.fusion.ChainedCurveOptions.noChainedCurves)
loftSectionsObj.add(openProfile)

# Create loft feature
loftFeats.add(loftInput)



except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

but if it is in a separate component then the adsk.fusion.Path.create fails.

It says InternelValidationError:utils::getObjectPath ...

Bug ?

can you help ?

 

453 Views
0 Replies
Replies (0)