How can I integrate AMT Controller in Conventional 2-wheeler vehicle model, what should be the logic behind it?
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Im facing problem with designing a amt controller for 2-wheeler bike, what should be the input for the blocks and from where the data for shift schedule of gear postion should be uploaded?
0 commentaires
Réponses (1)
Aditya
le 29 Sep 2025
Hi Mandar,
The issue arises because, right after opening a project in Ansys HFSS via MATLAB’s COM interface, there may not be an active design set, causing oProject.GetActiveDesign() to fail. This is why running the script step-by-step works—the COM server has time to update, but running it as a script does not. Instead of hardcoding a design name or relying on GetActiveDesign() immediately, a more robust approach is to programmatically retrieve the list of available designs in the project, set the first one as active, and then proceed. This avoids the need for prior knowledge of the design name and makes your script more reliable across different projects.
oProject = invoke(oDesktop,'OpenProject',full_path_name);
oDesktop.SetActiveProject(oProject.GetName());
designNames = oProject.GetDesigns();
if ~isempty(designNames)
oProject.SetActiveDesign(designNames{1});
oDesign = oProject.GetActiveDesign();
oEditor = oDesign.SetActiveEditor('3D Modeler');
else
error('No designs found in the project.');
end
This approach ensures that a valid design is always set as active before proceeding, making your automation more robust.
0 commentaires
Voir également
Catégories
En savoir plus sur Nonlinear Control dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!