How to Use command to remove lines between physical models?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
季
el 4 de Jun. de 2025
Comentada: 季
el 7 de Jul. de 2025
Hi,
I want to use commands to delete this line, but 'delete_line' always results err, saying "Invalid Simulink object name: 'Battery_Cell6/1'."
Could anyone help me, pls?

3 comentarios
Respuesta aceptada
Javier Gazzarri
el 30 de Jun. de 2025
Editada: Javier Gazzarri
el 30 de Jun. de 2025
Hello 季,
I am investigating the proper way to get a proper handle to the connection line you want to delete and I'll get back to you as soon as possible. In the meantime, would you kindly try this workaround and let me know if it works for you?
Best regards,
Javier
pos = get_param(gcs+"/Bat+","Position");
ori = get_param(gcs+"/Bat+","Orientation");
delete_block(gcs+"/Bat+")
delete_line(find_system(gcs, 'FindAll', 'on', 'Type', 'line', 'Connected', 'off'))
add_block("nesl_utility/Connection Port",gcs+"/Bat+", "Position", pos, "Orientation", ori)
Más respuestas (0)
Ver también
Categorías
Más información sobre Programmatic Model Editing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!