robot-structural-mcp 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ *.rtd
5
+ *.log
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,351 @@
1
+ Metadata-Version: 2.5
2
+ Name: robot-structural-mcp
3
+ Version: 0.1.0
4
+ Summary: MCP server for Autodesk Robot Structural Analysis: model, results, NEC-15 checks and ACI 318 reinforcement
5
+ Project-URL: Repository, https://github.com/brdz4/robot-mcp
6
+ Project-URL: Issues, https://github.com/brdz4/robot-mcp/issues
7
+ Author: brdz4
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Keywords: aci 318,autodesk,mcp,nec,robot structural analysis,structural engineering
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Operating System :: Microsoft :: Windows
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Topic :: Scientific/Engineering
15
+ Requires-Python: >=3.12
16
+ Requires-Dist: mcp<3,>=2.3
17
+ Requires-Dist: pythonnet>=3.0.3
18
+ Description-Content-Type: text/markdown
19
+
20
+ # robot-structural-mcp
21
+
22
+ <!-- mcp-name: io.github.brdz4/robot-mcp -->
23
+
24
+ Servidor MCP para Autodesk Robot Structural Analysis. Se conecta por COM (RobotOM) al Robot
25
+ que tengas abierto y deja que Claude lea el modelo activo y sus resultados, y que lo modifique
26
+ con ensayo previo (crear, asignar y, con permiso expreso, borrar).
27
+
28
+ > **Estado: en pruebas, pero funciona.** Lo he probado en copias de proyectos reales con NEC-15
29
+ > y ACI 318-19 y pasan todas sus pruebas (162 comprobaciones, 156 de ellas contra Robot), pero
30
+ > aún no se ha usado fuera de mi equipo. Trabaja siempre sobre una copia del modelo, revisa el ensayo (`dry_run`) antes de
31
+ > aplicar y comprueba los resultados de diseño a mano. Se agradecen issues y PR.
32
+
33
+ Probado con Robot 2026 (39.0.1) en español, Python 3.12, `mcp` 2.3.0 y `pythonnet` 3.2.1,
34
+ contra un pórtico de prueba y la copia de un edificio real.
35
+
36
+ *English:* MCP server for Autodesk Robot Structural Analysis (Windows, COM API). It lets Claude
37
+ read the open model and its results, run Ecuadorian seismic code checks (NEC-SE-DS), size
38
+ reinforcement per ACI 318-19 and make guarded edits (every write is a dry run first). Status:
39
+ in testing but working. Tool descriptions and messages are in Spanish. Apache-2.0 license.
40
+ Contributions welcome: see [CONTRIBUTING.md](CONTRIBUTING.md).
41
+
42
+ ## Instalación
43
+
44
+ Requiere Windows, Robot Structural Analysis instalado con licencia y Python 3.12 o superior.
45
+ La forma más simple es dejar que `uv` lo instale desde PyPI al registrarlo
46
+ (`.mcp.json` en la carpeta del proyecto de Claude Code):
47
+
48
+ ```json
49
+ {
50
+ "mcpServers": {
51
+ "robot": {
52
+ "command": "uvx",
53
+ "args": ["robot-structural-mcp"]
54
+ }
55
+ }
56
+ }
57
+ ```
58
+
59
+ Sin `uv`: `pip install robot-structural-mcp` y usa `"command": "robot-structural-mcp"`.
60
+
61
+ Desde el código, para desarrollar:
62
+
63
+ ```bash
64
+ git clone https://github.com/brdz4/robot-mcp.git
65
+ cd robot-mcp
66
+ python -m venv .venv
67
+ .venv\Scripts\python.exe -m pip install -e .
68
+ ```
69
+
70
+ y en `.mcp.json`, `"command": "C:/ruta/robot-mcp/.venv/Scripts/robot-structural-mcp.exe"`.
71
+
72
+ ## Herramientas
73
+
74
+ | Herramienta | Qué devuelve |
75
+ |---|---|
76
+ | `robot_health` | Si Robot está abierto, versión, proyecto activo, estado de resultados |
77
+ | `robot_get_project_info` | Nombre, archivo, tipo de estructura y conteos |
78
+ | `robot_list_nodes` | Nudos: coordenadas (m) y apoyo |
79
+ | `robot_list_bars` | Barras: nudos, longitud, sección, material. Filtros: selección, sección, piso, columna o viga |
80
+ | `robot_list_panels` | Paneles: espesor, material y modelo de cálculo (elementos finitos o solo reparto de cargas, diafragma) |
81
+ | `robot_list_storeys` | Pisos: niveles y alturas |
82
+ | `robot_list_sections` | Secciones: b, h, área, inercias, coeficientes de inercia agrietada |
83
+ | `robot_list_materials` | Materiales: E, ν, peso unitario, resistencia y dónde se usan |
84
+ | `robot_list_thicknesses` | Espesores de panel: homogéneos (cm) u ortótropos (tipo y dimensiones) |
85
+ | `robot_list_supports` | Tipos de apoyo, grados de libertad fijos y nudos asignados |
86
+ | `robot_list_load_cases` | Casos: naturaleza y tipo de análisis |
87
+ | `robot_list_combinations` | Combinaciones manuales con sus factores |
88
+ | `robot_list_loads` | Cargas de un caso simple: tipo, elementos y valores (kN, kN/m, kN/m²), para auditarlo |
89
+
90
+ Resultados (`results.py`; requieren el modelo calculado):
91
+
92
+ | Herramienta | Qué devuelve |
93
+ |---|---|
94
+ | `robot_get_reactions` | Reacciones por nudo apoyado y caso, y suma por caso (peso, cortante basal) |
95
+ | `robot_get_node_displacements` | Desplazamientos y giros de nudos por caso |
96
+ | `robot_get_bar_forces` | Esfuerzos N, V, M, T por barra, caso y estación |
97
+ | `robot_get_result_extremes` | Máximo y mínimo de esfuerzos, reacciones o desplazamientos, con ubicación (barra, piso, sección, caso) |
98
+ | `robot_get_modal_results` | Periodos, masas participantes, acumulados y modo en que se alcanza el 90 % |
99
+ | `robot_get_storey_results` | Tabla de pisos: desplazamientos, derivas, cortantes, masa y centros |
100
+ | `robot_get_bar_deflections` | Flecha máxima de cada barra respecto a su cuerda, L/flecha y, si se pide, si cumple L/n |
101
+ | `robot_get_panel_forces` | Máximo y mínimo de MXX, MYY, MXY, NXX… en paneles con elementos finitos, con su nudo |
102
+
103
+ Verificaciones NEC-SE-DS 2015 (`checks.py`; solo lectura, también en modo `ROBOT_MCP_READ_ONLY`):
104
+
105
+ | Herramienta | Qué verifica |
106
+ |---|---|
107
+ | `robot_check_drifts` | Deriva inelástica ΔM = 0.75·R·ΔE por piso frente al límite (§6.3.9), con la tabla de pisos y con la peor línea de pórtico (la que gobierna sin diafragma rígido) |
108
+ | `robot_check_p_delta` | Índice de estabilidad Qi = Pi·Δi/(Vi·hi) por piso (§6.3.8) |
109
+ | `robot_check_base_shear` | Cortante dinámico ≥ 80 % u 85 % del estático, y factor de ajuste (§6.2.2) |
110
+ | `robot_check_irregularities` | Irregularidad torsional, piso flexible y masa (§5.2) |
111
+ | `robot_check_rc_members` | Cuantías ACI 318-19 de vigas y columnas rectangulares de hormigón (`design.py`): As superior e inferior, ρ de columna por flexocompresión biaxial y Av/s de estribos |
112
+
113
+ En `robot_check_rc_members` se pasan las combinaciones últimas, y f'c y fy son datos del
114
+ proyecto. Las columnas se resuelven por compatibilidad de deformaciones con las barras
115
+ repartidas en el perímetro y la flexión biaxial por el contorno lineal Mx/φMnx + My/φMny ≤ 1,
116
+ que es conservador. Los momentos se toman en los nudos, no a la cara del apoyo. No incluye
117
+ diseño por capacidad (cortante por momentos probables, columna fuerte-viga débil) ni esbeltez.
118
+ Las secciones que no son rectangulares de hormigón, como las dobles T prefabricadas, se omiten.
119
+
120
+ R, los factores de escala de cada caso sísmico y el cortante estático (o su coeficiente) son
121
+ datos del proyecto que aporta quien llama: las herramientas aplican la fórmula, no eligen esos
122
+ valores. No sustituyen la revisión de un ingeniero responsable.
123
+
124
+ Escritura (`writes.py`):
125
+
126
+ | Herramienta | Qué hace |
127
+ |---|---|
128
+ | `robot_create_nodes` | Crea nudos por coordenadas; no duplica los coincidentes |
129
+ | `robot_create_bars` | Crea barras entre nudos existentes, con sección opcional |
130
+ | `robot_define_concrete_section` | Crea o redefine una sección rectangular de hormigón con inercia agrietada |
131
+ | `robot_assign_section` | Asigna una sección a barras |
132
+ | `robot_define_support` | Crea o redefine un tipo de apoyo rígido |
133
+ | `robot_assign_support` | Asigna un apoyo a nudos |
134
+ | `robot_create_load_case` | Crea un caso simple estático |
135
+ | `robot_add_loads` | Añade peso propio, fuerzas en nudos, cargas repartidas en barras o cargas superficiales en paneles |
136
+ | `robot_create_combinations` | Crea combinaciones manuales con sus factores |
137
+ | `robot_create_nec_combinations` | Genera y crea las combinaciones LRFD de la NEC-SE-CG §3.4.3 (y D+L de servicio) a partir de los casos D, L, Lr, W, Ex y Ey; `seismic_scale_x/y` aplica la escala del espectro cuando va en las combinaciones (p. ej. I·g/R) |
138
+ | `robot_create_panel` | Crea un panel plano por su contorno, con espesor y modelo de cálculo existentes |
139
+ | `robot_delete_elements` | Borra barras, nudos, paneles o casos y combinaciones |
140
+ | `robot_delete_loads` | Borra cargas de un caso por su índice en `robot_list_loads` |
141
+ | `robot_run_calculation` | Lanza el cálculo y espera |
142
+ | `robot_save_project` | Guarda o «guarda como» |
143
+
144
+ Reglas de toda escritura:
145
+
146
+ 1. `dry_run=true` por defecto: valida y devuelve el plan sin tocar el modelo. Se aplica con
147
+ `dry_run=false`.
148
+ 2. Si el modelo tiene resultados vigentes y el cambio los invalida, hace falta además
149
+ `discard_results=true`. Las combinaciones no invalidan resultados; todo lo demás sí.
150
+ 3. Se valida antes de escribir y se relee lo escrito. Si algo no cuadra, la herramienta falla.
151
+ 4. No hay deshacer: guarda antes de cambios grandes. El borrado se niega a dejar el modelo
152
+ incoherente: no borra nudos que usan barras, casos que usa una combinación que se queda, ni
153
+ las cargas que Robot genera al repartir paneles.
154
+
155
+ No incluye: casos modales o espectrales (el espectro se define en Robot), espesores ni
156
+ modelos de cálculo de panel nuevos, ni secciones que no sean rectangulares de hormigón. Eso se
157
+ hace en Robot.
158
+
159
+ Unidades: m, cm, cm², cm⁴, MPa, kN/m³; resultados y cargas en kN, kN/m, kN·m, mm, rad y t.
160
+ Las listas largas están paginadas (`limit`, `offset`).
161
+
162
+ ## Variables de entorno
163
+
164
+ | Variable | Efecto |
165
+ |---|---|
166
+ | `ROBOT_INTEROP_DLL` | Ruta de `Interop.RobotOM.dll` si no está en la instalación estándar |
167
+ | `ROBOT_MCP_AUTOSTART=1` | El servidor arranca Robot si no está abierto (por defecto no lo hace) |
168
+ | `ROBOT_MCP_READ_ONLY=1` | No registra las herramientas de escritura, cálculo ni guardado (quedan 26) |
169
+ | `ROBOT_MCP_TIMEOUT` | Segundos de espera por llamada (120) |
170
+ | `ROBOT_MCP_STARTUP_GRACE` | Segundos que debe llevar abierto Robot antes de conectar (40) |
171
+
172
+ ## Pruebas
173
+
174
+ ```bash
175
+ .venv\Scripts\python.exe tests\smoke_test.py
176
+ ```
177
+
178
+ Con Robot cerrado comprueba el arranque y los errores; con un modelo abierto muestra datos reales
179
+ (solo lectura).
180
+
181
+ ```bash
182
+ .venv\Scripts\python.exe tests\state_test.py
183
+ ```
184
+
185
+ Prueba de estados, con Robot **cerrado**: abre su propio Robot, crea un pórtico de 2 pisos, lo
186
+ calcula y contrasta reacciones con el peso calculado a mano, lo desactualiza, cierra y reabre
187
+ Robot con el servidor en marcha, y al final lo cierra sin guardar (31 comprobaciones, ~3 min).
188
+ No requiere tocar nada: verifica que Robot no haga ninguna pregunta. Se niega a empezar si ya hay
189
+ un Robot abierto.
190
+
191
+ ```bash
192
+ .venv\Scripts\python.exe tests\write_test.py
193
+ ```
194
+
195
+ Prueba de escritura, también con Robot **cerrado**: construye el mismo pórtico solo con las
196
+ herramientas MCP, lo carga, combina y calcula, contrasta con la cuenta a mano y comprueba los
197
+ rechazos (duplicados, números existentes, resultados vigentes) y que Robot no pregunte nada
198
+ (58 comprobaciones, ~2 min).
199
+
200
+ ```bash
201
+ .venv\Scripts\python.exe tests\checks_test.py
202
+ ```
203
+
204
+ Prueba de las verificaciones NEC, con Robot **cerrado**: añade al pórtico dos casos laterales
205
+ de valor conocido (uno asimétrico, que provoca torsión) y compara cada verificación con la
206
+ misma cuenta hecha a partir de las herramientas de lectura (26 comprobaciones, ~1 min).
207
+
208
+ `tests\make_fixture.py` crea ese pórtico en el Robot abierto, pero **reemplaza el proyecto
209
+ activo**: no lo ejecutes con un modelo real sin guardar.
210
+
211
+ ```bash
212
+ .venv\Scripts\python.exe tests\offline_test.py
213
+ ```
214
+
215
+ Prueba sin Robot del marcador de modo no interactivo (incluida la escritura simultánea desde
216
+ otro chat), del hilo COM ocupado tras un plazo vencido, de la validación estricta de casos, del
217
+ filtro de cargas generadas, del generador de combinaciones NEC y de las fórmulas ACI contra
218
+ cálculos a mano (6 pruebas, segundos).
219
+
220
+ ```bash
221
+ .venv\Scripts\python.exe tests\panel_test.py
222
+ ```
223
+
224
+ Prueba de paneles, con Robot **cerrado**: convierte la losa del pórtico en panel de reparto,
225
+ le pone 2 kN/m², calcula y comprueba el modelo de cálculo del panel, la lectura de la carga
226
+ superficial, las 4 cargas trapezoidales que Robot genera en las vigas (suman los 40 kN de la
227
+ losa) y la reacción total de 400 kN (8 comprobaciones, ~1 min).
228
+
229
+ ```bash
230
+ .venv\Scripts\python.exe tests\design_test.py
231
+ ```
232
+
233
+ Prueba de las herramientas añadidas el 2026-11-12, con Robot **cerrado**, sobre el pórtico con
234
+ su losa de elementos finitos. Crea las combinaciones NEC y las relee. Comprueba:
235
+
236
+ - La flecha de D+L es la suma de las de D y L.
237
+ - Los momentos de la losa salen con ambos signos.
238
+ - El As de la viga coincide con el cálculo a mano a partir de `robot_get_bar_forces`.
239
+ - La columna queda con la cuantía mínima.
240
+ - Un panel nuevo con 3 kN/m² eleva la reacción a 420 kN.
241
+ - Cada borrado y cada rechazo funcionan (33 comprobaciones, ~2 min).
242
+
243
+ ## Evaluación
244
+
245
+ El 2026-11-10 un subagente (Sonnet) resolvió a ciegas 10 preguntas de solo lectura sobre una copia
246
+ de un edificio real: 10 de 10 con 20 llamadas. De sus críticas salieron el filtro
247
+ `structural_type` y el contexto de barra en los extremos. Ese juego de preguntas y el guion de
248
+ la skill `mcp-builder` se retiraron el 2026-11-12 porque el modelo cambió y sus respuestas ya no
249
+ valían; si se quiere repetir, hay que generar preguntas nuevas sobre el estado actual del modelo.
250
+
251
+ ## Cosas que no son obvias
252
+
253
+ - **Selecciones e idioma.** La sintaxis de selección de Robot depende del idioma: `1to4` en inglés
254
+ es `1A4` en español, y en español `1to4` selecciona *todo*. El servidor acepta `1to10`, `1A10`,
255
+ `1to20By2` y los traduce (`Session._from_text`). No llames a `FromText` directamente.
256
+ - **Conexión.** `RobotApplicationClass()` tumba el proceso con pythonnet 3. Se instancia por
257
+ ProgID (`create_application`).
258
+ - **Un solo hilo.** Toda llamada COM pasa por `on_robot`; el SDK ejecuta las herramientas en un pool.
259
+ - **stdout es del protocolo.** Los logs van a stderr; no uses `print` en el servidor.
260
+ - **Inercia agrietada: la inercia que reporta la API no dice si la reducción se aplica.**
261
+ Hay dos mediciones que no encajan entre sí y el mecanismo interno de Robot no está aclarado:
262
+ - *Secciones creadas por API* (experimento del 2026-11-11, ya retirado: voladizos contrastados con
263
+ PL³/3EI, en proyectos FRAME_3D y BUILDING, barras tipadas o no): el análisis sigue el valor
264
+ de `GetValue(I_BSDV_IY)`. Coeficiente 0.5 con ese valor reducido da el doble de flecha; el
265
+ mismo coeficiente con ese valor forzado a la inercia bruta da la flecha sin reducir.
266
+ - *Edificio real definido en la interfaz* (una sección de viga con coeficiente 0.5 y
267
+ `GetValue` igual a la inercia bruta): el análisis SÍ usa la inercia reducida. Comprobado tres
268
+ veces sobre una copia: recalcular tal cual y redefinirla con `robot_define_concrete_section`
269
+ y 0.5 dan exactamente el mismo T1; quitarle el coeficiente lo baja un 17 %.
270
+ Consecuencias: `i*_stored_over_gross` es solo informativo y no debe usarse para afirmar que
271
+ falta la reducción; `robot_define_concrete_section` deja la sección en un estado que analiza
272
+ con la reducción aplicada una sola vez en ambos casos; y la única verificación fiable es
273
+ comparar períodos o flechas con y sin coeficiente, en una copia.
274
+ - **Etiquetas.** `Labels.GetMany` no devuelve todas (omite espesores ortótropos y su material).
275
+ Usa `_labels()`, que une `GetMany` con `GetAvailableNames` y filtra con `Exist` / `IsUsed`.
276
+ - **Pisos.** `CreateByStorey` es fiable para barras; para nudos devuelve números sin sentido.
277
+ - **Varias instancias de Robot.** COM se engancha a una sola; trabaja con una abierta.
278
+ - **Resultados: unidades y signos.** La API devuelve N, N·m, m, rad y kg. `FX > 0` en barras es
279
+ compresión. En casos espectrales el signo no es físico.
280
+ - **Resultados: velocidad.** Cada lectura (`Forces.Value`, `Reactions.Value`…) cuesta unos 10 ms
281
+ por COM, así que cada llamada está limitada a 600 lecturas (`MAX_READS`). Para envolventes se usa
282
+ `Results.Extremes`, que busca dentro de Robot (~50 ms por componente) y coincide con la lectura
283
+ valor a valor.
284
+ - **Derivas.** `robot_get_storey_results` devuelve el `dr` de la tabla de pisos de Robot, sin
285
+ amplificar; los factores de norma (0.75·R en NEC) y el de reducción del espectro los aplica quien
286
+ consulta.
287
+ - **Resultados desactualizados.** Con estado `OUT_OF_DATE` la API no entrega resultados
288
+ (`Results.Available` es falso); las herramientas lo dicen y piden recalcular.
289
+ - **Arranque de Robot.** Si se pide `Robot.Application` mientras Robot arranca (medido a los 2, 5 y
290
+ ~15 s; a los 45 s ya no), Windows abre otra instancia oculta que se queda viva. Por eso el
291
+ servidor no conecta con un Robot abierto hace menos de `ROBOT_MCP_STARTUP_GRACE` segundos
292
+ (`robot_health` responde `ready: false`). Como red de seguridad, si una conexión hace aparecer
293
+ un proceso `robot.exe` nuevo y sin título, lo cierra y pide reintentar.
294
+ - **Diálogos al modificar.** Con `Interactive = 1` (lo normal cuando el usuario trabaja en
295
+ Robot), modificar por API un modelo calculado abre el diálogo «Los resultados de cálculos
296
+ pueden desactualizarse. ¿Desea continuar?» y la llamada COM queda bloqueada hasta que alguien
297
+ responde. Con `Interactive = 0` no pregunta y devuelve al instante. Por eso toda escritura y
298
+ el cálculo pasan por `non_interactive()`, que lo restaura al salir y deja un archivo marcador
299
+ en la carpeta temporal para repararlo si el servidor muere a mitad. Cerrar con
300
+ `Quit(I_QO_DISCARD_CHANGES)` no pregunta. `tests\dialog_watch.py` registra estos diálogos.
301
+ - **La API de Robot no valida.** Medido: `Nodes.Create` con un número existente **cambia las
302
+ coordenadas** de ese nudo; `Bars.Create` admite barras duplicadas e ignora en silencio las que
303
+ usan nudos inexistentes; `CaseFactors.New` acepta casos que no existen. `Bars.FindWithNodes` y
304
+ `Nodes.GetConnectedBars` devuelven vacío, así que los duplicados se detectan recorriendo las
305
+ barras. Toda validación está en `writes.py`, antes de escribir.
306
+ - **Qué invalida resultados.** Nudos, barras, secciones o apoyos en uso, casos y cargas dejan el
307
+ estado en `OUT_OF_DATE`. Las combinaciones y las etiquetas sin usar no. Tras calcular, Robot
308
+ congela los resultados (`ResultsFreeze`), pero una escritura no interactiva los descongela sola.
309
+ - **Masa de piso.** `Results.Storeys.Values(piso, caso).Mass` depende del caso cuando el modelo
310
+ no tiene masas dinámicas: en el pórtico de prueba da la masa del peso propio para ese caso y
311
+ cero para una combinación. Con análisis modal es la misma para todos los casos. Por eso
312
+ `robot_check_irregularities` lee la masa del caso modal, o del que se indique en `mass_case`, y
313
+ `robot_get_storey_results` también la lee del caso modal si existe.
314
+ - **Torsión en casos espectrales.** La deriva de cada borde se aproxima como diferencia de
315
+ desplazamientos ya combinados (CQC), no como combinación de derivas modales; la herramienta lo
316
+ marca con `approximate`. Para una comprobación exacta hace falta un caso estático.
317
+ - **P-Δ.** Δ y V salen del mismo caso sísmico, así que el factor de escala no altera Qi.
318
+ - **Cargas generadas por Robot.** Con paneles de reparto (modelo de cálculo sin elementos
319
+ finitos, `I_LT_PANEL_CALC_MODEL`), Robot crea al calcular un registro por viga con la carga del
320
+ panel ya repartida (`BAR_UNIFORM` o `BAR_TRAPEZOIDALE`) y lo marca `IsAutoGenerated`
321
+ (`IRobotLoadRecordCommon`). En un edificio real son casi todos los registros de cada caso. No salen en la
322
+ tabla de cargas de Robot, y sumarlos a la carga del panel la cuenta dos veces;
323
+ `robot_list_loads` y `robot_list_load_cases` los separan. Aparecen un momento después de
324
+ `CalculateEx`: leídos en la misma sesión COM justo al terminar, aún no estaban.
325
+ - **Cargas trapezoidales.** `GetValue` devuelve 0 en `PX1..PZ2`; la forma se lee por puntos con
326
+ `IRobotLoadRecordBarTrapezoidal.PointCount` y `GetPoint(i, px, py, pz, x)`.
327
+ - **Cargas de casos espectrales.** El único registro de un caso sísmico espectral es su espectro
328
+ (tipo 48, sin nombre en la API, con el nombre del espectro en `Description`); pedirle
329
+ `ObjectType` u `Objects` da `E_FAIL`. `robot_list_loads` lo lista con `objects: null`.
330
+ - **Paneles sin material.** Un espesor sin material deja pasar la creación del panel, pero una
331
+ losa de elementos finitos así no supera la verificación del cálculo (`FAILED_VERIFICATION`).
332
+ Los paneles de solo reparto sí calculan. `robot_create_panel` avisa en el ensayo.
333
+ - **Extremos de paneles.** `IRobotFeExtremeValue.Panel` devuelve 0; el nudo y el elemento sí
334
+ vienen. Por eso `robot_get_panel_forces` no dice el panel.
335
+ - **Barras sin tipo estructural.** Las barras creadas por la API no son `BEAM` ni `COLUMN`;
336
+ `robot_check_rc_members` las clasifica por geometría y los filtros `structural_type` no las
337
+ encuentran. Los modelos que vienen de Revit sí traen el tipo.
338
+ - **Mensajes de cálculo.** Si el cálculo deja avisos, Robot abre la ventana «Mensajes de
339
+ cálculo». No bloquea, pero queda abierta.
340
+ - **Sin verificar:** área de paneles (`CalcArea` devolvió 0 en la prueba, por eso no se expone);
341
+ la red de seguridad del arranque y la reparación del modo no interactivo tras un fallo, que no
342
+ llegaron a dispararse; un cálculo que falle o tarde mucho; y la escritura sobre un modelo
343
+ grande (crear barras recorre todas las existentes, ~4 ms por barra). La escritura solo se ha
344
+ probado sobre el pórtico de prueba, nunca sobre un modelo real.
345
+
346
+ ## Siguientes fases
347
+
348
+ 1. Resultados que faltan: tensiones; flecha diferida (ACI 24.2.4).
349
+ 2. Escritura que falta: espectro y casos sísmicos, espesores y modelos de cálculo de panel.
350
+ 3. Diseño: cortante por capacidad y nudo columna fuerte-viga débil (ACI 18), secciones
351
+ prefabricadas (dobles T).