Example of resolving UIThread Error: case of returning an object
Pernelle Marone-Hitz
Member, Moderator, Employee Posts: 871
✭✭✭✭
Example of resolving UIThread Error: case of returning an object after calling function in UIThread.
Tagged:
0
Answers
-
The following code can be used:
def GetModelAnalysisType(ExtAPI): """ Keyword arguments: ExtAPI -- ExtAPI entry point """ res = "" args = [res] ExtAPI.Application.InvokeUIThread(internalGetModelAnalysisType,args) # call internalGetModelAnalysisType in a different thread return args[0] # return the model analysis type def internalGetModelAnalysisType(args): args[0] = ExtAPI.DataModel.Project.Model.Geometry.AnalysisType # Get the model analysis type info available in the advanced geometry options of the geometry object
6