abaqus \ python脚本-Edges.findat带有预定义的全局坐标

发布于 2025-01-27 07:57:11 字数 1756 浏览 2 评论 0原文

我是Abaqus-Python脚本的新手。我的目标是在圆形部分之间进行脚本阁楼操作。圆形部分是根据工程问题预定义的。

根据使用Abaqus接口手册中的.jnl文件(用于选择两个圆形截面),语法如下;

mdb.models['Model-1'].parts['strut defected'].SolidLoft(endCondition=NONE, 
    loftsections=((mdb.models['Model-1'].parts['strut defected'].edges.findAt((
    0.012, 0.26, 0.15), ), ), (
    mdb.models['Model-1'].parts['strut defected'].edges.findAt((0.012, 0.25, 
    0.2), ), )), startCondition=NONE)

我知道它可以形成为;

mdb.models['Model-1'].parts['strut defected'].SolidLoft(endCondition=NONE, 
    loftsections=(mytuple1), startCondition=NONE)

其中mytupple1是;

mytuple1 = (mdb.models['Model-1'].parts['strut defected'].edges.findAt(mytuple2), )

其中myTuple2是;

mytuple2 = ((0.012, 0.26, 0.15), )

我不确定如何使用循环操作实现全局坐标值(myTuple2)。

到目前为止,我已经尝试创建MyTupple1数据如下。

division = 3

mytuple1 = ('m','d','b','.','m','o','d','e','l','s','[',"'",'M','o','d','e','l','-','1',"'",
            ']','.','p','a','r','t','s','[',"'",'d','e','f','e','c','t','e','d',' ','s','t','r',
            'u','t',"'",']','.','e','d','g','e','s','.','f','i','n','d','A','t','(')

str1 = ''.join(mytuple1)

mylist1 = [str1] * division

mytuple2 = (',',' ',')')

str2 = ''.join(mytuple2)

mylist2 = [str2] * division

section_edge_coords_abq = ((0,0,0),(1,1,1),(2,2,2)) % random coords

for ii in range(0,3):

 loft_section_tuple = ((str(mylist1[ii]) + str(section_edge_coords_abq[ii]) + str(mylist2[ii])),)

此循环操作如下所示;

mdb.models['Model-1'].parts['defected strut'].edges.findAt((2, 2, 2), )

它仅为最后一个坐标创建一个图板数据。我想传递与语法兼容的坐标,但我无法管理。如果您帮助我解决Abaqus的这一自动化过程,我将非常感谢。

I am a quite new to Abaqus-Python scripting. My goal is to script loft operation between circular sections. Circular sections are predefined based on the engineering problem.

According to .jnl file from manual using of Abaqus interface (for selecting two circular sections), the syntax is as follow;

mdb.models['Model-1'].parts['strut defected'].SolidLoft(endCondition=NONE, 
    loftsections=((mdb.models['Model-1'].parts['strut defected'].edges.findAt((
    0.012, 0.26, 0.15), ), ), (
    mdb.models['Model-1'].parts['strut defected'].edges.findAt((0.012, 0.25, 
    0.2), ), )), startCondition=NONE)

I understand that it can be formed as;

mdb.models['Model-1'].parts['strut defected'].SolidLoft(endCondition=NONE, 
    loftsections=(mytuple1), startCondition=NONE)

where mytupple1 is;

mytuple1 = (mdb.models['Model-1'].parts['strut defected'].edges.findAt(mytuple2), )

where mytuple2 is;

mytuple2 = ((0.012, 0.26, 0.15), )

I am not sure how to implement global coordinate values (mytuple2) by using loop operations.

So far I have tried to create mytupple1 data as below;

division = 3

mytuple1 = ('m','d','b','.','m','o','d','e','l','s','[',"'",'M','o','d','e','l','-','1',"'",
            ']','.','p','a','r','t','s','[',"'",'d','e','f','e','c','t','e','d',' ','s','t','r',
            'u','t',"'",']','.','e','d','g','e','s','.','f','i','n','d','A','t','(')

str1 = ''.join(mytuple1)

mylist1 = [str1] * division

mytuple2 = (',',' ',')')

str2 = ''.join(mytuple2)

mylist2 = [str2] * division

section_edge_coords_abq = ((0,0,0),(1,1,1),(2,2,2)) % random coords

for ii in range(0,3):

 loft_section_tuple = ((str(mylist1[ii]) + str(section_edge_coords_abq[ii]) + str(mylist2[ii])),)

This loop operation results in as follow;

mdb.models['Model-1'].parts['defected strut'].edges.findAt((2, 2, 2), )

It creates only one tupple data for the last coordinates. I want to pass the coordinates compatible to syntax but I can not manage it. I would be really appreciate if you help me to solve this automated lofting process in Abaqus.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

魔法唧唧 2025-02-03 07:57:11

实际上,findat(...)命令的参数是序列的序列。这意味着您将元组作为一个论点。在这里,每个元组代表一组坐标,以选择一个边缘(或任何相关实体 - 此处 - 边缘)。
因此,按照您实施问题的方式:

points = (0,0,0),(1,1,1),(2,2,2) # random data points
tuple_points = tuple([(ii,) for ii in points]) # creating a tuple of tuple
# ==> tuple_points => (((0, 0, 0),), ((1, 1, 1),), ((2, 2, 2),))


myEdges = mdb.models['Model-1'].parts['strut defected'].edges.findAt(*tuple_points)
# ==> the argument must be tuple of tuple as below
# ((0, 0, 0),), ((1, 1, 1),), ((2, 2, 2),) ==> hence we must remove the outer tuple.
# ==> hence, we passed the argument with '*' sign which takes care of this.

mdb.models['Model-1'].parts['strut defected'].SolidLoft(endCondition=NONE, 
    loftsections=myEdges, startCondition=NONE)

Actually, the argument for the findAt(...) command is a sequence of sequence. This means that you provide tuple of tuple as a argument. Here, each tuple represents a single set of coordinates to select an edge (or any related entity - here edge).
So, following way you implement your problem:

points = (0,0,0),(1,1,1),(2,2,2) # random data points
tuple_points = tuple([(ii,) for ii in points]) # creating a tuple of tuple
# ==> tuple_points => (((0, 0, 0),), ((1, 1, 1),), ((2, 2, 2),))


myEdges = mdb.models['Model-1'].parts['strut defected'].edges.findAt(*tuple_points)
# ==> the argument must be tuple of tuple as below
# ((0, 0, 0),), ((1, 1, 1),), ((2, 2, 2),) ==> hence we must remove the outer tuple.
# ==> hence, we passed the argument with '*' sign which takes care of this.

mdb.models['Model-1'].parts['strut defected'].SolidLoft(endCondition=NONE, 
    loftsections=myEdges, startCondition=NONE)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文