How to Use command to remove lines between physical models?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Javier Gazzarri
am 30 Jun. 2025
Bearbeitet: Javier Gazzarri
am 30 Jun. 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)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Programmatic Model Editing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!