Posted 4 months ago by Kim Jiho - Ansys
Version: 22.1.3
Avatar

I pre-defined the function and imported it.

For example

def DM(a,b):
    return False;

And when I write a code that calls a function, I see an error like the image on the link.

DM("BD_01/CM","BD_02/CM")

screenshot

 
How can I fix it?
 
 

[Modified 4 months ago]

Comments (2)

Posted 4 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

That's odd, I tried pasting that text in an editor using the Python Language Add-on and can't reproduce the error.  Can you tell us exactly how to reproduce this in one of our samples, such as our Python demo?


Actipro Software Support

Posted 4 months ago by Kim Jiho - Ansys
Avatar

Hello,

It's my mistake. I did it like this.

from Displacement import *
from Acceleration import *DM("BD_01/CM","BD_02/CM")

I didn't know what the problem was because I set the "from import" to the header text.

I solved the problem by adding new line at the end of import.

from Displacement import *
from Acceleration import *
DM("BD_01/CM","BD_02/CM")

Thank you for your help.

 
The latest build of this product (v22.1.4) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.