Well... Here I am again!
I know that it's not allowed to import both GUI and kernel scripts in one file, but I also know that to get passed this, the commandgetKernelInitializationCommand should be able to help me get passed it. However, I don't seem to get it to work properly.
So, I've started to modify Abaqus to a small extent and added a new menu option "Materials" with one submenu "New Material" where a form pops up if pressed. Now, when I'm done with the form and press "OK", it should call a kernel script to perform some actions. Now, I figured that thegetKernal command above should be able to help me.
My thoughts were that, since I created a "modifiedCanvasToolsetGui.py" file, where the extra menu option is added and from which I activate the form, it should also be in this file where I define the command
def getKernelInitializationCommand(self): return 'import testKernel'(where testKernel is the kernel script.)
to let the form import the kernel script. However, this just results in "AttributeError: 'module' object has no attribute 'createMaterial' " when the line
self.cmd = AFXGuiCommand(self, 'createMaterial', 'testKernel') is executed. I've tried to put function definition in various script file used, but with the same results every time. Moreover, I do not define the issueCommands() method manually, as I merely want it to use the sendCommandString() anyway. However, IF I do define the method myself, I get another error - ValueError: invalid value specified, even though I've checked to see that it sends the correct amount of arguments and makes the right method call. .
I'm starting to get out of ideas, and even though I understand that it probably is quite difficult to help me in this case, I thought I would give it a shot! The Abaqus GUI user manual has not been able to help me here.
Regards,
Ola
