Looking for automatically Circular Offset

Looking for automatically Circular Offset

SphaeroX
Participant Participant
367 Views
4 Replies
Message 1 of 5

Looking for automatically Circular Offset

SphaeroX
Participant
Participant

Is there a way to make it easier if you have, for example, over 50 circles? Or do you have to do it manually?

I was thinking of some kind of automatic arrangement or at least that you can create a macro that automatically makes an offset 50x and always increases the offset value by 2mm.

 
Heres the link to the Screenscast (currently pending) https://autode.sk/3LQ5hW6
 
I cant add the Screencast directly because i got this error: Your post has been changed because invalid HTML was found in the message body. The invalid HTML has been removed. Please review the message and submit the message when you are satisfied.
 
 
0 Likes
Accepted solutions (1)
368 Views
4 Replies
Replies (4)
Message 2 of 5

etfrench
Mentor
Mentor
Accepted solution

You can do it using the API.  It's best to ask on the API forum.

ETFrench

EESignature

0 Likes
Message 3 of 5

hamid.sh.
Advisor
Advisor

This comes into my mind:

 

Concentric.gif

 

But note that in regard to number of  it is not parametric.

Also maybe it can be modified to be more streamlined.

Hamid
0 Likes
Message 4 of 5

SphaeroX
Participant
Participant

i wrote i little simple script for that, thanks for help!

 

#Author-SphaeroX
#Description-creates multiple circles around a base circle with a defined spacing

import adsk.core, adsk.fusion, adsk.cam, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface
        #ui.messageBox('Hello script 1')
        
        #doc = app.documents.add(adsk.core.DocumentTypes.FusionDesignDocumentType)
        circleBase = ui.inputBox("Basis Durchmesser eingeben: ", "Basis Durchmesser")
        circleBase = float(circleBase[0])
        circleBase = (circleBase / 10) / 2
        #ui.messageBox(circleBase)

        circleCount = ui.inputBox("Anzahl der Kreise: ", "Kreisanzahl")
        circleCount = int(circleCount[0])
        circleCount = circleCount - 1

        circleDistance = ui.inputBox("Abstand der Kreise: ", "Kreis Abstand")
        circleDistance = int(circleDistance[0])
        circleDistance = circleDistance / 10

        design = app.activeProduct

        # Get the root component of the active design.
        rootComp = design.rootComponent

        # Create a new sketch on the xy plane.
        sketches = rootComp.sketches
        xyPlane = rootComp.xYConstructionPlane
        sketch = sketches.add(xyPlane)

        # Draw some circles.
        circles = sketch.sketchCurves.sketchCircles

        circle1 = circles.addByCenterRadius(adsk.core.Point3D.create(0, 0, 0), circleBase)

        for x in range(circleCount):
            circleBase = circleBase + circleDistance
            circles.addByCenterRadius(adsk.core.Point3D.create(0, 0, 0), circleBase)


    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
0 Likes
Message 5 of 5

g-andresen
Consultant
Consultant

Hi,

For a flat construction you could also do it like this

Screencast

 

günther

0 Likes