Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
maurizio_manzi
155 Views, 2 Replies

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

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

2 REPLIES 2
Message 2 of 3

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

Thank you very much. It works fine

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report