3D设计

3D设计

Spaceclaim ACT 中报错Cannot import name GetAllBodies

    • maruidiyi2
      Subscriber

      当我在spaceclaim中建立一个script,它是可以正常运行的。但是当我尝试建立一个wizard来封装script时,程序无法运行。在log文件中显示

      Error when invoking function 'QFN'.
      Traceback (most recent call last): 
      File "D:\0插件库\spaceclaim\ACT\SoledrjointGen\SoledrjointGen\SolderjointGen_main.py", line 717, in QFN 
      StandardError: Exception has been thrown by the target of an invocation.
      Traceback (most recent call last): 
      File "D:\0插件库\spaceclaim\ACT\SoledrjointGen\SoledrjointGen\SolderjointGen_main.py", line 717, in QFN 
      ImportError: Cannot import name GetAllBodies

      我已经在py文件的开头进行以下声明
      import os, sys
      clr.AddReference("Ans.Utilities")
      from Ansys.Utilities import ApplicationConfiguration
      version = ApplicationConfiguration.DefaultConfiguration.VersionInfo.VersionString
       
      sys.path.append(os.environ["AWP_ROOT"+version]+"/scdm/Scripting")
      clr.AddReference("SpaceClaim.Api.V20".format(version))
      clr.AddReference("SpaceClaim.Api.V20.Scripting".format(version))
      exec('from LoadSCDMAPITypesV20 import *'.format(version))
      exec('from UtilitiesOnLoadV20 import *'.format(version))
      有人知道为什么吗?

Viewing 0 reply threads
  • 您必须登录才能回复此主题。