How to create a rotation surface from a sketch and an axis-line

How to create a rotation surface from a sketch and an axis-line

maurizio_manzi
Advocate Advocate
509 Views
2 Replies
Message 1 of 3

How to create a rotation surface from a sketch and an axis-line

maurizio_manzi
Advocate
Advocate

Hello,
I have a sketch1 with a simply profile (only an arc). This ist my profile for the surface.
And a sketch2 with a line (this is the rotation axis).

How can I create a rotation surface form the sketch1 (my Arc) around the sketch2 (the rotation line) ?

Best regards

Maurizio

20-03-_2023_15-36-55.png20-03-_2023_15-39-41.png

0 Likes
Accepted solutions (1)
510 Views
2 Replies
Replies (2)
Message 2 of 3

JelteDeJong
Mentor
Mentor
Accepted solution

Try something like this:

 

app = adsk.core.Application.get()
ui  = app.userInterface

doc = app.activeDocument
rootComp = doc.design.rootComponent
sketches = rootComp.sketches

sketch1 = sketches.itemByName("Sketch1")
sketch2 = sketches.itemByName("Sketch2")

axis = sketch1.sketchCurves.sketchLines.item(0)
profile = rootComp.createOpenProfile(sketch2.sketchCurves.item(0), True)

revolves = rootComp.features.revolveFeatures
revInput = revolves.createInput(profile, axis, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
angle = adsk.core.ValueInput.createByReal(math.pi*2)
revInput.setAngleExtent(False, angle)
revInput.isSolid = False
ext = revolves.add(revInput)

 

Sketch 1 and 2 might be reversed in your situation.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 3

maurizio_manzi
Advocate
Advocate

Thank you very much. It works fine

0 Likes