create_beam_elements_linear
Batch-create beam elements by connecting nodes in the exact order returned from node creation, with geometric validation that prevents invalid folded-back models.
Instructions
Batch-create frame elements chaining nodes along a girder
(批量创建沿主梁方向连接相邻节点的梁单元).
PREFERRED: pass node_ids — the exact ID sequence reported by
create_nodes_linear. Elements chain them in the order given:
node_ids[0]→[1], [1]→[2], …
(首选:直接传 create_nodes_linear 回报的编号序列,按给定顺序连接)
Do NOT assume node IDs are consecutive. The backend assigns numbering in
an order that is NOT predictable from the request — measured on qtmodel
2.6.3, one batch came back [1104,1103,1102,1101,1100] (reversed) and
another [1201,1200,1204,1203,1202] (neither ascending nor reversed).
Chaining by ID arithmetic on such a batch silently produces folded-back
geometry: elements of wrong length and direction that the solver accepts
without error, yielding a model that computes the wrong bridge.
(后端编号顺序不可预测,按编号递推会静默建出折返几何,求解器不会报错)
Node coordinates are checked before writing: if the chain is not
geometrically monotonic, the call fails instead of building a bad model.
Args:
mat_id: Material ID for all elements (所有梁单元的材料编号)
sec_id: Section ID for all elements (所有梁单元的截面编号)
node_ids: Node IDs in girder order, as reported by create_nodes_linear
(节点编号序列,按主梁走向排列). Creates len(node_ids)-1 elements.
node_id_start: LEGACY fallback, only when node_ids is omitted — assumes
IDs run consecutively from here (旧式用法,假设编号连续)
count: Number of elements, only with node_id_start (单元数量)
element_id_start: ID assigned to the first element, then auto-incremented
(第一个单元的编号,后续自动递增)
beta_angle: Beta angle in degrees, same for all elements (贝塔角,度)
ele_type: 1=Beam(梁), 2=Truss(杆), 3=Cable(索)
Examples:
# Preferred — chain the IDs create_nodes_linear actually returned:
create_beam_elements_linear(mat_id=1, sec_id=1,
node_ids=[5, 501, 500, 502])
# Legacy — only safe when the nodes are known to be consecutive:
create_beam_elements_linear(mat_id=1, sec_id=1,
node_id_start=1, count=100)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | ||
| mat_id | Yes | ||
| sec_id | Yes | ||
| ele_type | No | ||
| node_ids | No | ||
| beta_angle | No | ||
| node_id_start | No | ||
| element_id_start | No |