Forum
Important Notice for New User Registrations
To combat an increasing number of spam and bot registrations, we now manually approve all new user registrations. While this may cause a delay until your account is approved, this step is essential to ensure the quality and security of this forum.
To help us verify your registration as legitimate, please use a clear name as user name or an official email address (such as a work, university, or similar address). If you’re concerned that we may not recognize your registration as non-spam, feel free to email us at with a request to approve your username.
Plotting graphs from the SIL
Quote from Alex54 on 29. November 2024, 11:59Hi,
I am an aeronautics student looking to use the QBlade SIL library to help complete my individual project on wind powered vehicles. The main output I am looking to obtain from the python script is a Cp and Ct vs TSR graph similar to the BEM rotor analysis. When attempting to produce the graph using matplotlib.pyplot within the same python script, I get the following error:
“AttributeError: ‘QBladeLibrary’ object has no attribute ‘createInstance'”
When I remove the import for the plotting library, the error disappears. I have been able to find a work around of running the plotting script separately but it would be useful if I didn’t have to do this.
I am using VS code as my IDE running on a Windows 11 device with QBlade 2.0.7.7 and Python 3.9.12. Please let me know if you need any more information.
Thanks for the help,
Alex
Hi,
I am an aeronautics student looking to use the QBlade SIL library to help complete my individual project on wind powered vehicles. The main output I am looking to obtain from the python script is a Cp and Ct vs TSR graph similar to the BEM rotor analysis. When attempting to produce the graph using matplotlib.pyplot within the same python script, I get the following error:
“AttributeError: ‘QBladeLibrary’ object has no attribute ‘createInstance'”
When I remove the import for the plotting library, the error disappears. I have been able to find a work around of running the plotting script separately but it would be useful if I didn’t have to do this.
I am using VS code as my IDE running on a Windows 11 device with QBlade 2.0.7.7 and Python 3.9.12. Please let me know if you need any more information.
Thanks for the help,
Alex
Quote from David on 29. November 2024, 18:49Hi Alex,
this seems like an unusual issue you are having. I have tested matplotlib with QBlade’s SIL and never encountered any issues. Maybe importing matplotlib causes a change in your python environment or folder structure? The issue you are getting points in the direction that the QBlade library file (.dll or .so) cannot be found. However, its hard to say how this is related to matplotlib without any further information. Would you mind sharing the contents of your script, or a mimimum working example that highlights the issue you are having?
BR,
David
Hi Alex,
this seems like an unusual issue you are having. I have tested matplotlib with QBlade’s SIL and never encountered any issues. Maybe importing matplotlib causes a change in your python environment or folder structure? The issue you are getting points in the direction that the QBlade library file (.dll or .so) cannot be found. However, its hard to say how this is related to matplotlib without any further information. Would you mind sharing the contents of your script, or a mimimum working example that highlights the issue you are having?
BR,
David
Quote from Alex54 on 2. December 2024, 18:25Hi David,
Thanks for the fast reply, I have attached screenshots of the script where I am getting this error. Before I add line 7 with the matplotlib.pyplot import, the code runs as intended. I do not even have to call matplotlib before I get the error. I am also able to run matplotlib in a separate script which does not use QBlade but is hosted in the same folder location.
Kind regards,
Alex
Hi David,
Thanks for the fast reply, I have attached screenshots of the script where I am getting this error. Before I add line 7 with the matplotlib.pyplot import, the code runs as intended. I do not even have to call matplotlib before I get the error. I am also able to run matplotlib in a separate script which does not use QBlade but is hosted in the same folder location.
Kind regards,
Alex
Uploaded files:
- You need to login to have access to uploads.
Quote from David on 3. December 2024, 13:01Hi Alex,
I tested your imports and the order of imports, and the script runs fine on my end without any issues.
Regarding the “Generation” import you’re using, I’m not familiar with it, but everything else appears to be working as expected.
Based on the error message, it seems that the QBLadeLibrary object cannot be initialized. I suspect this might be due to the script being unable to locate the DLL file specified. To troubleshoot, I recommend adding some debug statements to check the environment and folder structure where the script is being executed. This will help to make sure that the filepath to the QBlade library is valid.
Alternatively, you could also manually input the filepath to the QBlade library when initializing the QBladeLibrary object, like so:
- QBLIB = QBladeLibrary(dll_file_path)
BR,
David
Hi Alex,
I tested your imports and the order of imports, and the script runs fine on my end without any issues.
Regarding the “Generation” import you’re using, I’m not familiar with it, but everything else appears to be working as expected.
Based on the error message, it seems that the QBLadeLibrary object cannot be initialized. I suspect this might be due to the script being unable to locate the DLL file specified. To troubleshoot, I recommend adding some debug statements to check the environment and folder structure where the script is being executed. This will help to make sure that the filepath to the QBlade library is valid.
Alternatively, you could also manually input the filepath to the QBlade library when initializing the QBladeLibrary object, like so:
- QBLIB = QBladeLibrary(dll_file_path)
BR,
David