How to register user-oriented commands in cubit

I have implemented a user-oriented function in Python. I want to use it from cubit (aprepro), as well because sometimes it is easier in that way. Are there some ways to register such user-oriented commands in cubit?

Hi @ksugahar,
there are a few ways to run your user method in cubit.
One way would be to use the custom toolbar to call your python script.

If you want to “load” your python methods on startup. You can add it as argument when you start up cubit, like in this post 2024.3 and 2024.8 generate cubitXYZ.jou if Python script is a command line parameter - #2 by pmarty
After that you can access the methods with

#!python
your_method()

like you probably already did.

If you want to add commands that you can use like normal cubit commands without switching into python mode. You will have to create a c++ plugin that gets loaded on startup.

1 Like