Relative Content

Tag Archive for pythonctypespython-3.11

TypeError: unsupported operand type(s) for *: ‘c_char_Array_32’ and ‘int’

import comtypes.client from ctypes import byref, c_int, c_double, create_string_buffer, cast, POINTER, c_char_p try: SapObject = comtypes.client.GetActiveObject(“CSI.SAP2000.API.SapObject”) except (OSError, comtypes.COMError): SapObject = comtypes.client.CreateObject(“CSI.SAP2000.API.SapObject”) SapObject.ApplicationStart() SapModel = SapObject.SapModel ret = SapModel.SelectObj.GetSelected() if ret[0] > 0: frame_name = ret[1][0] NumberResults = c_int() NumResults = 100 ** # Define array types Obj = (create_string_buffer(32) * NumResults)() Elm = (create_string_buffer(32) […]