Author Topic: Output of python code generation..  (Read 4731 times)

KalpakD

  • EA User
  • **
  • Posts: 62
  • Karma: +0/-0
    • View Profile
Output of python code generation..
« on: May 16, 2021, 09:25:52 pm »
Generated code from "basic python model" the Class A code is:
Code: [Select]
import ClassC
import ClassB

class ClassA:
    classC= ClassC()

    classB= ClassB()

    def OperationA(ParameterOne : int, ParameterTwo : int) -> int:
        pass

    def OperationB(ParameterOne : int, ParameterTwo : int) -> int:
        pass
The attributes have not generated any code.
Any other setting required?

Takeshi K

  • EA User
  • **
  • Posts: 593
  • Karma: +39/-1
    • View Profile
Re: Output of python code generation..
« Reply #1 on: May 17, 2021, 10:26:58 am »
Hello KalpakD,

To generate Python attributes, you need to assign initial values.

Press Ctrl+5 to open the Feature window, then select the ClassA and enter some value to the Initial field. Then, generate source code again.

HTH,
--
t-kouno

KalpakD

  • EA User
  • **
  • Posts: 62
  • Karma: +0/-0
    • View Profile
Re: Output of python code generation..
« Reply #2 on: May 17, 2021, 03:10:53 pm »
Dear Takeshi,
   That worked.
But is there a way to do model syntax check before generating code?
Thanks,