Posted 2 years 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 2 years ago]

Comments (2)

Posted 2 years 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 2 years 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 (v24.1.2) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.