Python code for ABAQUS to create helix
<p>I have this code I have found online that creates a helix when run in ABAQUS. I am trying to understand the logic behind it to perhaps customize it to the size of my helix.</p>

<p>I have added comments above the line of codes I understand.</p>

<pre><code>#######################
# Imports controls from abaqus
   from abaqus import *
   from abaqusConstants import *

# Defining helix dimensions
   width  = 20.0
   height = 0.05
   origin = (15.0, 0.0)
   pitch = 50.0
   numTurns = 1.0

# Creating sketch in abaqus under name 'rect' and sheetsize of 200
   s = mdb.models['Model-1'].ConstrainedSketch(name='rect', sheetSize=200.0)

# No idea. What does .geometry return?
   g = s.geometry

# No idea
   s.setPrimaryObject(option=STANDALONE)

# Creating a line from point1 to point2, why not use .Line?
   cl = s.ConstructionLine(point1=(0.0, -100.0), point2=(0.0, 100.0))

# No idea as I don't know what is stored in g (adding constraints but where?
   s.FixedConstraint(entity=g[2])
   s.FixedConstraint(entity=g[cl.id])

# Creating rectangle from point1 to point2 
   s.rectangle(point1=(origin[0], origin[1]), point2=(origin[0]+width, origin[1]+height))

# Creating Part-1 3D Deformable
   p = mdb.models['Model-1'].Part(name='Part-1', dimensionality=THREE_D, 
    type=DEFORMABLE_BODY)
   p = mdb.models['Model-1'].parts['Part-1']

p.BaseSolidRevolve(sketch=s, angle=numTurns*360.0, flipRevolveDirection=OFF, 
    pitch=pitch, flipPitchDirection=OFF, moveSketchNormalToPath=OFF) 
    #In above command try changing the following member: moveSketchNormalToPath=ON

s.unsetPrimaryObject()

session.viewports['Viewport: 1'].setValues(displayedObject=p)
</code></pre>

<p>Could someone elaborate the logic behind this?</p>

<p>This code creates a Construction(!!) line from point1 to point2, around this line your helix will construct:</p>

<p><code>cl = s.ConstructionLine(point1=(0.0, -100.0), point2=(0.0, 100.0))</code></p>

<p>This code revolves your sketch(rectange) around your construction line with defined pitch and number of turns:</p>

<p><code>p.BaseSolidRevolve(sketch=s, angle=numTurns*360.0, flipRevolveDirection=OFF, 
    pitch=pitch, flipPitchDirection=OFF, moveSketchNormalToPath=OFF)</code></p>

python abaqus