def loadChecks(): checkDescriptions = list() documentedModules = list() for modulePath in glob.glob( os.path.join(util.getPathChecks(), CHECK_PATTERN)): moduleName = os.path.splitext(os.path.basename(modulePath))[0] ansa.ImportCode(modulePath) currentModule = globals()[moduleName] try: print('Loading: %s.' % currentModule.checkOptions['name']) except AttributeError as e: print('No checkDescription object found in: %s' % modulePath) continue if currentModule.__doc__ is not None: checkDocString = currentModule.__doc__ documentedModules.append(moduleName) saveModuleDoc(moduleName, checkDocString) checkDescription = currentModule.checkDescription checkDescriptions.append(checkDescription) is_saved = base.CheckDescription.save( checkDescriptions, os.path.join(util.getPlistPath(), PLIST_NAME)) print('%s checks loaded.' % is_saved) saveGeneralDoc(documentedModules)
import os import sys import ansa from ansa import base, guitk, constants # ============================================================================== PATH_SELF = os.path.dirname(os.path.realpath(__file__)) PATH_BIN = os.path.dirname(PATH_SELF) ansa.ImportCode(os.path.join(PATH_SELF, 'base_widgets.py')) ansa.ImportCode(os.path.join(PATH_BIN, 'domain', 'util.py')) ansa.ImportCode(os.path.join(PATH_BIN, 'domain', 'comp_items.py')) # ============================================================================== class MirrorClipPage(base_widgets.BasePage): TITLE = 'Mirror clip' DESCRIPTION = 'Do you want to mirror created clip?' INFO = '' def initiateData(self): ''' This is a space for the code where underlying data structure can be initialised. ''' self.stepFinished()
''' import os, ansa from ansa import base, constants # ============================================================================== DEBUG = 0 if DEBUG: PATH_SELF = '/data/fem/+software/SKRIPTY/tools/python/ansaTools/checks/general_check/default' # PATH_SELF = os.path.dirname(os.path.realpath(__file__)) else: PATH_SELF = os.path.join(os.environ['ANSA_TOOLS'], 'checks', 'general_check', 'default') ansa.ImportCode(os.path.join(PATH_SELF, 'check_base_items.py')) ansa.ImportCode(os.path.join(PATH_SELF, 'check_PAM_materials_ex_fix.py')) exe = check_PAM_materials_ex_fix.exe fix = check_PAM_materials_ex_fix.fix # ============================================================================== class CheckItem(check_base_items.BaseEntityCheckItem): SOLVER_TYPE = constants.PAMCRASH ENTITY_TYPES = ['SHELL', 'MEMBRANE', 'SOLID'] # ==============================================================================
import os, ansa, re, getpass from ansa import base, constants from datetime import date # ============================================================================== DEBUG = 0 if DEBUG: PATH_SELF = '/data/fem/+software/SKRIPTY/tools/python/ansaTools/checks/general_check/default' # PATH_SELF = os.path.dirname(os.path.realpath(__file__)) else: PATH_SELF = os.path.join(os.environ['ANSA_TOOLS'], 'checks', 'general_check', 'default') ansa.ImportCode(os.path.join(PATH_SELF, 'check_base_items.py')) # ============================================================================== class CheckItem(check_base_items.BaseEntityCheckItem): SOLVER_TYPE = constants.PAMCRASH ENTITY_TYPES = ['CNTAC'] # ============================================================================== class include_comment: def __init__(self): self.entity = None
DEBUG = 1 #============================================================================== import os import sys from traceback import format_exc import tempfile import ansa from ansa import base, guitk, constants, utils PATH_SELF = os.path.dirname(os.path.realpath(__file__)) ansa.ImportCode(os.path.join(PATH_SELF, 'domain', 'util.py')) #============================================================================== class SetDefinition(object): ID_OFFSET = 100 def __init__(self, parentApplication, attributes): self.parentApplication = parentApplication self._attributes = attributes self.id = self._attributes['id'] self.setEntity = None self.content = list()
''' import os, ansa from ansa import base, constants # ============================================================================== DEBUG = False if DEBUG: PATH_SELF = '/data/fem/+software/SKRIPTY/tools/python/ansaTools/checks/general_check/default' # PATH_SELF = os.path.dirname(os.path.realpath(__file__)) else: PATH_SELF = os.path.join(os.environ['ANSA_TOOLS'], 'checks', 'general_check', 'default') ansa.ImportCode(os.path.join(PATH_SELF, 'check_base_items.py')) # ============================================================================== class CheckItem(check_base_items.BaseEntityCheckItem): SOLVER_TYPE = constants.ABAQUS ENTITY_TYPES = ['CONTACT_PAIR'] # ============================================================================== ansa.ImportCode(os.path.join(PATH_SELF, 'check_ABA_el_ex_fix_tied.py')) exe = check_ABA_el_ex_fix_tied.exe fix = check_ABA_el_ex_fix_tied.fix
import os import sys import ansa from ansa import base, guitk, constants PATH_SELF = os.path.dirname(os.path.realpath(__file__)) PATH_MAIN = os.path.dirname(PATH_SELF) PATH_BIN = os.path.dirname(PATH_MAIN) PATH_RES = os.path.join(PATH_BIN, 'res') ansa.ImportCode(os.path.join(PATH_SELF, 'base_widgets.py')) ansa.ImportCode(os.path.join(PATH_MAIN, 'domain', 'base_items.py')) # ============================================================================== class SelectConPage(base_widgets.BasePage): TITLE = 'Select CON' DESCRIPTION = 'Select the guiding clip edge - CON' INFO = '' def initiateData(self): ''' This is a space for the code where underlying data structure can be initialised. ''' self.coordSystem = self.smartClip().geomType().coordSystem #-------------------------------------------------------------------------
import sys from traceback import format_exc import ansa from ansa import base, guitk, constants # ============================================================================== # in case of running from remote simlink in windows #if 'win' in sys.platform: # toolName = os.path.splitext(os.path.basename(__file__))[0].replace('tool_', '') # PATH_SELF = os.path.join(os.environ['ANSA_TOOLS'], toolName, 'default', 'bin') #else: PATH_SELF = os.path.dirname(os.path.realpath(__file__)) ansa.ImportCode(os.path.join(PATH_SELF, 'domain', 'util.py')) ansa.ImportCode(os.path.join(PATH_SELF, 'domain', 'comp_items.py')) ansa.ImportCode(os.path.join(PATH_SELF, 'presentation', 'page_selectCon.py')) ansa.ImportCode(os.path.join(PATH_SELF, 'presentation', 'page_clipType.py')) ansa.ImportCode( os.path.join(PATH_SELF, 'presentation', 'page_connectorStop.py')) ansa.ImportCode( os.path.join(PATH_SELF, 'presentation', 'page_connectorNodes.py')) ansa.ImportCode(os.path.join(PATH_SELF, 'presentation', 'page_mirrorClip.py')) # ============================================================================== DEBUG = 0 # ==============================================================================