We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
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))
      有人知道为什么吗?

    • Ashish Khemka
      Forum Moderator

      Hi, 

      I am not an expert but saw similar error on another forum post. Try running Ansys as admin and see if that helps: ACT Wizard: Machine Toolkit Error

      Regards,

      Ashish Khemka

    • George Karnos
      Ansys Employee

       

      also, try using a directory that is only ASCII characters, English language.

       

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