User login


You are here

please help in debugging this

please tell me the errors in this programme please


from abaqus import *
from abaqusConstants import *
import __main__

def Macro2():
    import section
    import regionToolset
    import displayGroupMdbToolset as dgm
    import part
    import material
    import assembly
    import step
    import interaction
    import load
    import mesh
    import job
    import sketch
    import visualization
    import xyPlot
    import displayGroupOdbToolset as dgo
    import connectorBehavior

    myList = [[]]
    angelList = [0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81]
    zList = [-0.291,-0.291,-0.282,-0.276,-0.252,-0.224,-0.184,-0.145,-0.114,-0.084,-0.054,-0.027,0.001,0.029,0.051,0.074,0.101,0.127,0.157,0.188,0.214,0.24,0.264,0.288,0.311,0.333,0.355,0.375]
    outrad = 6.692
    pitchList = [-0.291,0.009,0.007,0.024,0.028,0.04,0.04,0.031,0.03,0.03,0.027,0.028,0.028,0.023,0.023,0.027,0.026,0.03,0.031,0.026,0.026,0.024,0.024,0.024,0.021,0.022,0.02,0.019]
    for i in range(27):

        myList += [[angelList[i],zList[i], pitchList[i]]]


    for i in range(27):

        s1 = mdb.models['Model-1'].ConstrainedSketch(name='__profile__',
        g, v, d, c = s1.geometry, s1.vertices, s1.dimensions, s1.constraints
        s1.ConstructionLine(point1=(0.0, -100.0), point2=(0.0, 100.0))
        s1.CircleByCenterPerimeter(center=((-outrad - 0.8)*cos(radians(angelList[i])),(-outrad - 0.8)*cos(radians(angelList[i])), pitchList[i]), point1=(-outrad*cos(radians(angelList[i])),-outrad*sin(radians(angelList[i]),- pitchList[i]))
        p = mdb.models['Model-1'].Part(name='Part-1', dimensionality=THREE_D,
        p = mdb.models['Model-1'].parts['Part-1']
        p.BaseSolidRevolve(sketch=s1, angle=angelList[i], flipRevolveDirection=OFF,
            pitch=pitchList[i], flipPitchDirection=OFF, moveSketchNormalToPath=OFF)
        p = mdb.models['Model-1'].parts['Part-1']
        session.viewports['Viewport: 1'].setValues(displayedObject=p)
        del mdb.models['Model-1'].sketches['__profile__']




1) Pitch cannot be negative

2) Circle is 2D object, i.e., center=(x1, y1) and not (x1, y1, z1)

3) Brackets are mismatched and not closed

hey thanks for reply,

 i need to define my revolution points i.e. the circle by x.y.z. coordinates and i dont know how to do that.

 if that is not possible please tell me how can i change the system to cyclindrical coordinates please.

 i have to draw a spring and for that i know the points in cylindrical system. i cant define in 2d as for less than 90 degree it will not be in xz or you know like that plane. it will also be helful to define plane if i can.

like how it chooses f1[1] sketch plane and all, and can i change that by changing coordinates how please help.



Subscribe to Comments for "please help in debugging this"

Recent comments

More comments


Subscribe to Syndicate