I try to create a new Ansys.UI.Toolkit.GridViewTextCell Class and set the new init defination, but there is one problem occur.
import clr
clr.AddReference("Ans.UI.Toolkit")
clr.AddReference("Ans.UI.Toolkit.Base")
import Ansys.UI.Toolkit
import Ansys.UI.Toolkit.Base
from Ansys.UI.Toolkit import *
from Ansys.UI.Toolkit.Base import *
class TextCell(Ansys.UI.Toolkit.GridViewTextCell):
def __init__(self, Value, ReadOnly):
self.TextAlignment = Alignment.MiddleCenter
self.TextWrap = TextWrap.Word
self.ReadOnly = ReadOnly
self.Text = Value
a = TextCell('1',False)
The error is:
Traceback (most recent call last): TypeError: TextCell() takes at most 2 arguments (3 given)
It seems the new TextCell class init function don't work. I don't why.