- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I recently started using API. I was about to create a porous structure by randomly generating spheres.
I was able to create a circle and its axis, but I face problem while I try to revolve it. Seems like sketch.profiles.item() is selecting profiles in no defined order. As a result, this is what I get.
r = random.randint(2,6)/10
circle1 = circles.addByCenterRadius(adsk.core.Point3D.create(x[i], y[i], z[i]), r)
p1 = adsk.core.Point3D.create(x[i], y[i]-r, z[i])
p2 = adsk.core.Point3D.create(x[i], y[i]+r, z[i])
axis = sketchLines.addByTwoPoints(p1, p2)
prof = sketch.profiles.item(0)
revInput = revolves.createInput(prof, axis, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
angle = adsk.core.ValueInput.createByReal(2*math.pi)
revInput.setAngleExtent(False, angle)
ext = revolves.add(revInput)
Thanks
Solved! Go to Solution.