Nodal使用python命令协调一个部分(Nodal coordinate a part using python command)

编程入门 行业动态 更新时间:2024-10-11 09:20:14
Nodal使用python命令协调一个部分(Nodal coordinate a part using python command)

我需要访问特定节点的坐标。 我导入了一个孤立网格,当我在CAE中使用查询选项并请求节点坐标时,我得到了所需的corrdinates。 但是当我使用python命令请求相同的东西时,我会得到一些不同的坐标。 我不确定我的命令中有什么不对,为什么会有这样的差异。

这是我在请求图中提到的查询时得到的

节点69的坐标:3.732E-03,-3.118594,1.189815

当我使用以下命令时,我得到一个不同的值

mdb.models ['Model-4'] .parts ['Bio_Mech1_2']。nodes [69] .coordinates(-1.37620043754578,-3.04504609107971,1.26058506965637)

或者即使我从程序集中调用节点

mdb.models ['Model-4']。rootAssembly.instances ['Bio_Mech1_2-1']。nodes [69] .coordinates(-1.37620043754578,-3.04504609107971,1.26058506965637)

I need to access coordinates of a particular node. I have imported an orphan mesh and when I use query option in CAE and request the nodal coordinates, I get the required corrdinates. However when I request the same thing using a python command, I get some different coordinates. I am not sure what is incorrect in my command and why is there such a difference.

This is what I get when I request a query as mentioned in the fig

Coordinates of node 69 :3.732E-03,-3.118594,1.189815

And when I use the following command, I get a different value

mdb.models['Model-4'].parts['Bio_Mech1_2'].nodes[69].coordinates (-1.37620043754578, -3.04504609107971, 1.26058506965637)

or even if I call the node from the assembly

mdb.models['Model-4'].rootAssembly.instances['Bio_Mech1_2-1'].nodes[69].coordinates (-1.37620043754578, -3.04504609107971, 1.26058506965637)

最满意答案

当您访问某个集合中的节点时,例如示例中的部分节点,该集合中节点的索引与其标签不同。

查询工具返回节点的标签和坐标。 但是,部分节点集合中的确切节点的索引可能是68 。 尝试从节点集合中打印出该位置的节点,看看是否是这种情况。

print mdb.models['Model-4'].rootAssembly.instances['Bio_Mech1_2-1'].nodes[68]

这应该告诉您节点标签和坐标,因此您可以验证您是否真正访问了正确的节点。

When you're accessing nodes in a certain collection, for example part nodes as in your example, the index of the node in that collection is not the same as its label.

Query tool returns node's label and coordinates. However, the index of that exact node in a collection of part nodes is probably 68. Try printing out the node at that location from node collection to see if that's the case.

print mdb.models['Model-4'].rootAssembly.instances['Bio_Mech1_2-1'].nodes[68]

This should tell you both the node label and the coordinates, so you could verify if you're really accessing the correct node.

更多推荐

本文发布于:2023-07-14 19:03:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1106726.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:命令   python   Nodal   command   part

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!