ExtensionDir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(ExtensionDir)

clr.AddReferenceToFileAndPath(os.path.join(ExtensionDir,r'MechanicalTools.dll'))
from MechanicalTools import SimulationDataAccess

def CanInsertHydrostaticPressure():
    return False
#    simulationaccess = SimulationDataAccess(ExtAPI)
#    return simulationaccess.FirstActiveObjectIsEnvironment


def CanInsertBearingLoad():
    return False
    
def CanInsertCompressionSupport():
    return False

def CanInsertElasticSupport():
    return False

def Show():
    return True

def CanInsertRemoteForce():
    return False

def CanInsertBoltPretension():
    return False


def CanInsertFixedCylindrically():
    return False

def NoShow():
    return False

def CanUseSolveHandlers():
    return False

def ShowIfEnvironmentIsActive():
    simulationaccess = SimulationDataAccess(ExtAPI)
    #return simulationaccess.FirstActiveObjectIsEnvironment
    return simulationaccess.FirstActiveObjectIsEnvironementOrChild

def CanWriteInputFile():
    return False
    
def CanInsertJoint():
    return True
    
def CanInsertJointContextMenu():
    simulationaccess = SimulationDataAccess(ExtAPI)
    return simulationaccess.FirstActiveObjectIsContactGroupOrChild

def CanInsertSpringContextMenu():
    simulationaccess = SimulationDataAccess(ExtAPI)
    return simulationaccess.FirstActiveObjectIsContactGroupOrChild
    
def CannotInsertIfProbe():
    simulationaccess = SimulationDataAccess(ExtAPI)
    return  not simulationaccess.FirstActiveObjectIsAnswerSet