简体   繁体   English

节点使用python命令协调零件

[英]Nodal coordinate a part using python command

在此处输入图片说明 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. 我已经导入了一个孤立的网格,当我在CAE中使用查询选项并请求节点坐标时,我得到了所需的corordinates。 However when I request the same thing using a python command, I get some different coordinates. 但是,当我使用python命令请求相同的内容时,会得到一些不同的坐标。 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 节点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) mdb.models ['Model-4']。parts ['Bio_Mech1_2']。nodes [69]。坐标(-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) mdb.models ['Model-4']。rootAssembly.instances ['Bio_Mech1_2-1']。nodes [69]。坐标(-1.37620043754578,-3.04504609107971,1.26058506965637)

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 . 但是,部分节点集合中该确切节点的索引可能是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. 这应该告诉您节点标签和坐标,因此您可以验证您是否确实在访问正确的节点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM