# *************************Context Sensitive Help **************************************
#---------------------------------------------------------------------------------------

proc ContextDEZHelp {helpset} { 
   global vPort normal_help_launched
   global env SessionID

   if {[info exist env(AI_ENV_PRODUCT_HELP_CMD)] && \
               ([info command $env(AI_ENV_PRODUCT_HELP_CMD)] != "")} {
      if [catch {$env(AI_ENV_PRODUCT_HELP_CMD) $helpset} error_code] {
         mess "$error_code\n" red
      }
      return
   }

   if ![info exist vPort] { 
        startHlpEngine
        if {$vPort == "-1"} return
        startNormalHelp $helpset
   } elseif ![info exist normal_help_launched] { 
        startNormalHelp
   } else {
        if { [catch {hlp_sendcommand ICM:$helpset} error_code]} { mess "$error_code\n" red }
	}
} 

#-----------------------------------------------------------------------------------------
proc va_book {} {
   global vPort va_help_launched
   global env

   if ![info exist vPort] {
     startHlpEngine
     if {$vPort == "-1"} return
     startVaHelp
   } else {
      if ![info exist va_help_launched] { startVaHelp }
   }
   set helpset $env(VA_HELP)

   if { [catch {hlp_sendcommand $helpset} error_code]} {mess "$error_code\n" red}

}
#
proc help_book_old {} {
   global vPort normal_help_launched helpset_global

   busy 1
   if [info exist helpset_global] {
     if {$helpset_global == "hexa"} {
        onlaunchHexaDEZHelp
     } elseif {$helpset_global == "scrib"} {
        BSMmanual_book
     } elseif {$helpset_global == "visual3p"} {
        onlaunchVisual3PDEZHelp
     }
   } else {
     set helpset "icem_help_book"
     ContextDEZHelp $helpset
    }
    busy 0 
}
proc help_book {} {
   global vPort normal_help_launched helpset_global
   global env

   if ![info exist vPort] {
		startHlpEngine
		if {$vPort == "-1"} return
		startNormalHelp
   } elseif ![info exist normal_help_launched] {
		startNormalHelp
   } else {
		set helpset ICM:icemcfd_mainmenu
		if { [catch {hlp_sendcommand $helpset} error_code]} {mess "$error_code\n" red}
   }
}

proc tutorial_book {} {
   global vPort tutorial_help_launched
   global env

   if ![info exist vPort] {
		startHlpEngine
		if {$vPort == "-1"} return
		startTutorialHelp
   } elseif ![info exist tutorial_help_launched] {
		startTutorialHelp
   } else {
		set helpset ICM:icmtut_hexa_2dpipe
		if { [catch {hlp_sendcommand $helpset} error_code]} {mess "$error_code\n" red}
	}
}

proc usermanual_book {} {
   global vPort usermanual_help_launched
   global env

   if ![info exist vPort] {
		startHlpEngine
		if {$vPort == "-1"} return
		startUserManualHelp
   } elseif ![info exist usermanual_help_launched] {
		startUserManualHelp
   } else {
		set helpset ICM:iuser_intro
		if { [catch {hlp_sendcommand $helpset} error_code]} {mess "$error_code\n" red}
   }
}

proc installationmanual_book {} {
   global vPort releasenotes_help_launched
   global env

   if ![info exist vPort] {
		startHlpEngine
		if {$vPort == "-1"} return
		startReleaseNotes
   } elseif ![info exist releasenotes_help_launched] {
		startReleaseNotes
   } else {
		set helpset "ICM:icm_new_improve"
		if { [catch {hlp_sendcommand $helpset} error_code]} {mess "$error_code\n" red}
   }
}

proc programmer_book {} {
   global vPort programmer_guide_launched
   global env

   if ![info exist vPort] {
		startHlpEngine
		if {$vPort == "-1"} return
		startProgrammersGuide
   } elseif ![info exist programmers_guide_launched] {
		startProgrammersGuide
   } else {
		set helpset ICM:ipguide_convention
		if { [catch {hlp_sendcommand $helpset} error_code]} {mess "$error_code\n" red}
   }
}

proc install_book {} {
   global vPort install_guide_launched
   global env

   if ![info exist vPort] {
		startHlpEngine
		if {$vPort == "-1"} return
		startInstallGuide
   } elseif ![info exist programmers_guide_launched] {
		startInstallGuide
   } else {
		set helpset ICM:installlic_set
		if { [catch {hlp_sendcommand $helpset} error_code]} {mess "$error_code\n" red}
	}
}

proc BSMmanual_book {} {
   global vPort BSMmanual_help_launched

   if ![info exist vPort] {
     startHlpEngine
     if {$vPort == "-1"} return
     startBSMManualHelp
   } else {
      if ![info exist BSMmanual_help_launched] { startBSMManualHelp }
   }
   set helpset "BSMManual"
   if { [catch {hlp_sendcommand $helpset} error_code]} {mess "$error_code\n" red}
}

proc legalnotice_book {} {
   global vPort legalnotice_help_launched
   global env

   if ![info exist vPort] {
		startHlpEngine
		if {$vPort == "-1"} return
		startLegalNoticeHelp
   } elseif ![info exist legalnotice_help_launched] {
		startLegalNoticeHelp
   } else {
		set helpset "icem_set"
		if { [catch {hlp_sendcommand $helpset} error_code]} {mess "$error_code\n" red}
	}
}

proc output_interfaces_book {} {
    global env is_win

    if $is_win {
        set path $env(ICEM_ACN)
        set path [ic_win_shortname $path]
        if {[catch { eval exec start "file:$path/help/output/toc.htm" } error_code]} { mess "$error_code\n" red }
    } else {
        set found 0
        foreach p "firefox opera chrome mozilla" {
            set exe [get_path $p]
            if {[file exists $exe] && [file executable $exe]} {
                set found 1
                break
            }
        }
        if $found {
            set path $env(ICEM_ACN)
            if {[catch { exec $exe "file:$path/help/output/toc.htm" } error_code]} { mess "$error_code\n" red }
        }
    }
}

# ********************Context Sensitive Help for MainMenu*******************************
#---------------------------------------------------------------------------------------

# for Catia Import
proc ongeoImportCatiaDEZHelp {} { 
     set helpset "imm_importcatiav4" 
     ContextDEZHelp $helpset
} 

# for GEMS Import
proc ongeoImportGemsDEZHelp {} { 
     set helpset "imm_importgems" 
     ContextDEZHelp $helpset
} 

# for IDI Import
proc ongeoImportIDIDEZHelp {} { 
     set helpset "imm_importidi" 
     ContextDEZHelp $helpset
} 

# for ProE Import
proc ongeoImportProeDEZHelp {} { 
     set helpset "imm_importlegacy" 
     ContextDEZHelp $helpset
} 

# for Parasolid Import
proc ongeoImportParasolidDEZHelp {} { 
     set helpset "imm_importparasolid" 
     ContextDEZHelp $helpset
} 
# for Import Rihno 3D
proc ongeoImport3DMDEZHelp {} { 
     set helpset "imm_importrhino" 
     ContextDEZHelp $helpset
} 
# for STEP/IGES Import
proc ongeoImportStepDEZHelp {} { 
     set helpset "imm_importstep" 
     ContextDEZHelp $helpset
} 

# for UG Import
proc ongeoImportUGDEZHelp {} { 
     set helpset "imm_importgeom" 
     ContextDEZHelp $helpset
} 

# for WorkbenchReaders
proc ongeoImportWBDEZHelp {} { 
     set helpset "imm_import_model" 
     ContextDEZHelp $helpset
} 

# for Formatted Point Data Import
proc ongeoImportINPUTDEZHelp {} { 
     set helpset "imm_importformattedpoint" 
     ContextDEZHelp $helpset
} 

# for Export IGES
proc ongeoExportIgesDEZHelp {} { 
     set helpset "imm_exportgeom" 
     ContextDEZHelp $helpset
} 

# for Export Rihno 3D
proc ongeoExport3DMDEZHelp {} { 
     set helpset "imm_export3dm" 
     ContextDEZHelp $helpset
} 
# for Import Mesh fron Nastran 
proc onimportNastranDEZHelp {} { 
     set helpset "imm_importnastran" 
     ContextDEZHelp $helpset
} 

# for Import Mesh fron LS-Dyna 
proc onimportLsdynaDEZHelp {} { 
     set helpset "imm_importlsdyna" 
     ContextDEZHelp $helpset
} 

# for Export Mesh to LS-Dyna 
proc onmeshExportLSDynaDEZHelp {} { 
     set helpset "imm_exportmesh" 
     ContextDEZHelp $helpset
} 
# for Export Mesh to ANSYS 
proc onmeshExportANSYSDEZHelp {} { 
     set helpset "imm_exportmesh"
     ContextDEZHelp $helpset
} 
# for Export Mesh to FE Modeler 
proc onwriteFeModelerDEZHelp {} { 
     set helpset "imm_exportfemodeler"
     ContextDEZHelp $helpset
}
proc onexportSpectralElementsDEZHelp {} { 
     set helpset "imm_spectralelem"
     ContextDEZHelp $helpset
} 

# for Save Image
proc onhardcopyDEZHelp {} { 
     set helpset "icm_mm_savehardcopy" 
     ContextDEZHelp $helpset
} 
# for Save Image
proc onreplicateDEZHelp {} { 
     set helpset "icm_mm_mirror" 
     ContextDEZHelp $helpset
} 

# for Cut Plane
proc oncutPlaneDEZHelp {} { 
     set helpset "icm_mm_meshcutplane" 
     ContextDEZHelp $helpset
} 
# for Mesh Quality Report 
proc onmeshReportDEZHelp {} { 
     set helpset "icm_mm_meshreport" 
     ContextDEZHelp $helpset
}
 
# for Info - Variable 
proc oncreateVidDEZHelp {} {
     set helpset "icm_mm_variables"
     ContextDEZHelp $helpset
}

# for Settings - General
proc onsetGeneralDEZHelp {} {
     set helpset "icm_mm_general"
     ContextDEZHelp $helpset
}

# for Settings - Product 
proc onsetProductDEZHelp {} {
     set helpset "icm_mm_product"
     ContextDEZHelp $helpset
}

# for Solver setup
proc onsetSolverDEZHelp {} {
     set helpset "iout_solver"
     ContextDEZHelp $helpset
}

# for Settings->Solver

proc onsetSolverSettingsDEZHelp {} {
     set helpset "icm_mm_solver"
     ContextDEZHelp $helpset
}

# for Display settings
proc onsetDisplayDEZHelp {} {
     set helpset "icm_mm_display"
     ContextDEZHelp $helpset
}

# Lighting
proc onsetLightingDEZHelp {} {
     set helpset "icm_mm_lighting" 
     ContextDEZHelp $helpset
}

# Background Style
proc onsetBackgroundStyleDEZHelp {} {
     set helpset "icm_mm_backgroundstyle" 
     ContextDEZHelp $helpset
}

# Mouse bindings
proc onsetMouseBindingDEZHelp {} {
     set helpset "icm_mm_mousebinding" 
     ContextDEZHelp $helpset
}


# for Selection settings
proc onsetSelectDEZHelp {} {
     set helpset "icm_mm_selection"
     ContextDEZHelp $helpset
}

# for Memory settings
proc onsetMemoryDEZHelp {} {
     set helpset "icm_mm_memory"
     ContextDEZHelp $helpset
}

# for Remote settings
proc onsetRemoteDEZHelp {} {
     set helpset "icm_mm_remote"
     ContextDEZHelp $helpset
}

# for Speed settings
proc onsetSpeedDEZHelp {} {
     set helpset "icm_mm_speed"
     ContextDEZHelp $helpset
}

# for Model settings
proc onsetModelOptionsDEZHelp {} {
     set helpset "icm_mm_model"
     ContextDEZHelp $helpset
}

# for Model> Geometry units
proc onunitsGeometryDEZHelp {} {
     set helpset "idisp_model"
     ContextDEZHelp $helpset
}

# for Geometry tree > Rename entity
proc onrename_geometryDEZHelp {} {
     set helpset "idisp_geom"
     ContextDEZHelp $helpset
}

# for Geometry Options settings
proc onsetGOptionsDEZHelp {} {
     set helpset "icm_mm_geomoptions"
     ContextDEZHelp $helpset
}

# for Import Model Options 
proc onsetImportModelOptionsDEZHelp {} {
     set helpset "icm_mm_set_importmodel"
     ContextDEZHelp $helpset
}

# for Hexa Meshing Options 
proc onhexMeshOptsDEZHelp {} {
     set helpset "icm_mm_hexamixed"
     ContextDEZHelp $helpset
}

# for Meshing Quality Info 
proc onsetQualityInfoDEZHelp {} {
     set helpset "imm_qualityinfo"
     ContextDEZHelp $helpset
}

# for Workbench input settings 
proc onsetWorkbenchInputDEZHelp {} {
     set helpset "iuser_wb_settingparameters"
     ContextDEZHelp $helpset
}

# for Workbench output settings 
proc onsetWorkbenchOutputDEZHelp {} {
     set helpset "iuser_wb_settingparameters"
     ContextDEZHelp $helpset
}

# For LCS
proc oncreateLCSDEZHelp {} { 
     set helpset "imm_lcs"
     ContextDEZHelp $helpset
}

# ********************Context Sensitive Help for Geometry*******************************
#---------------------------------------------------------------------------------------

# for Point creation
proc onCreatePointsDEZHelp {} { 
     set helpset "igeom_createpoint" 
     ContextDEZHelp $helpset
} 

# for create/modify curves 
proc onCreateCurvesDEZHelp {} {
     set helpset "igeom_createcurve" 
     ContextDEZHelp $helpset
}

# for Create/Modify Surface 
proc onCreateSurfsDEZHelp {} {
     set helpset "igeom_createsurf" 
     ContextDEZHelp $helpset
}

# for Body creation
proc onCreateBodyDEZHelp {} {
     set helpset "igeom_createbody" 
     ContextDEZHelp $helpset
}

# for Repair Geometry
proc oncreateFacetedDEZHelp {} {
     set helpset "igeom_createfaceted" 
     ContextDEZHelp $helpset
}
# for Repair Geometry
proc onrepairGeomDEZHelp {} {
     set helpset "igeom_repairgeom" 
     ContextDEZHelp $helpset
}

# for Transformation Tools
proc ontransformSurfsToolsDEZHelp {} {
     set helpset "igeom_transform"
     ContextDEZHelp $helpset
}
# for Restore Dormant Entities
proc onrestoreEntityDEZHelp {} {
     set helpset "igeom_restoredormant" 
     ContextDEZHelp $helpset
}

# for Delete points
proc onDeletePointsDEZHelp {} {
     set helpset "igeom_deletept" 
     ContextDEZHelp $helpset
}

# for Delete curves
proc onDeleteCurveDEZHelp {} {
     set helpset "igeom_deletecurve" 
     ContextDEZHelp $helpset
}

# for Delete surfaces
proc onDeleteSurfDEZHelp {} {
     set helpset "igeom_deletesurf" 
     ContextDEZHelp $helpset
}

# for Delete body
proc ondeleteBodyDEZHelp {} {
     set helpset "igeom_deletebody" 
     ContextDEZHelp $helpset
}

# for Delete entity
proc ondeleteEntityDEZHelp {} {
     set helpset "igeom_deleteany" 
     ContextDEZHelp $helpset
}

# ********************Context Sensitive Help for Blocking*******************************

# for Create Block 
proc oncreateBlockDEZHelp {} {
   set helpset "iblock_createblock" 
     ContextDEZHelp $helpset
}
# for Split Block 
proc onsplitBlkDEZHelp {} {
   set helpset "iblock_splitblock"
     ContextDEZHelp $helpset
}
# for Merge Vertices 
proc onmergeBVertexDEZHelp {} {
   set helpset "iblock_mergevert" 
     ContextDEZHelp $helpset
}
# for Edit Block 
proc oneditBlockMenuDEZHelp {} {
   set helpset "iblock_editblock"
     ContextDEZHelp $helpset
}
# for Association 
proc oneditProjDEZHelp {} {
  set helpset "iblock_assoc" 
     ContextDEZHelp $helpset
}
# for Move Vertex 
proc onmoveBVertexDEZHelp {} {
   set helpset "iblock_movevertex" 
     ContextDEZHelp $helpset
}
# for Transform Blocks 
proc ontransformBlocksToolsDEZHelp {} {
   set helpset "iblock_transform" 
     ContextDEZHelp $helpset
}
# for Edit Edge 
proc oneditEdgeMenuDEZHelp {} {
   set helpset "iblock_editedge" 
     ContextDEZHelp $helpset
}
# for PreMesh Params 
proc onmParamsDEZHelp {} {
   set helpset "iblock_premeshparams" 
     ContextDEZHelp $helpset
}
# for PreMesh Quality 
proc onhexQualityDEZHelp {} {
   set helpset "iblock_premeshqual" 
     ContextDEZHelp $helpset
}
# for Pre-Mesh Smooth 
proc onhexSmoothDEZHelp {} {
   set helpset "iblock_premeshsmooth" 
     ContextDEZHelp $helpset
}
# for Block Checks 
proc oncheckBlockDEZHelp {} {
   set helpset "iblock_checks" 
     ContextDEZHelp $helpset
}
# for Delete Block 
proc ondeleteBlockDEZHelp {} {
   set helpset "iblock_deleteblock" 
     ContextDEZHelp $helpset
}

# for Create Pipe Blocking 
proc onpipesFromFileDEZHelp {} {
   set helpset "imm_create_pipe_blocking" 
   ContextDEZHelp $helpset
}

# ********************Context Sensitive Help for Mesh*******************************
#---------------------------------------------------------------------------------------


# For Curve Mesh Setup
proc onmszCurveDEZHelp {} { 
   set helpset "imesh_curvemeshsetup" 
     ContextDEZHelp $helpset
}

# For Surface Mesh Setup
proc onmszSurfDEZHelp {} { 
   set helpset "imesh_surfacemeshsetup" 
     ContextDEZHelp $helpset
}

# For Global Mesh Setup
proc onmszGlobalDEZHelp {} { 
   set helpset "imesh_globalmeshsetup" 
     ContextDEZHelp $helpset
}

# For Mesh Density 
proc oncreateDensityDEZHelp {} { 
   set helpset "imesh_createdensity" 
     ContextDEZHelp $helpset
}
# For Modify Density 
proc onmodifyDensityDEZHelp {} { 
   set helpset "idisp_geomdens" 
     ContextDEZHelp $helpset
}
# For Delete Density 
proc ondeleteDensityDEZHelp {} { 
   set helpset "idisp_geomdens" 
     ContextDEZHelp $helpset
}
# For Mesh Diagnostics
proc onshellDiagnosticsDEZHelp {} { 
   set helpset "idisp_mesh_diagnostic" 
     ContextDEZHelp $helpset
}
# For Connectors
proc ondefineConnectorsDEZHelp {} { 
   set helpset "imesh_connectors" 
     ContextDEZHelp $helpset
}

# For Mesh Curve 
proc onmeshLineDEZHelp {} { 
   set helpset "imesh_meshcurve"
     ContextDEZHelp $helpset
}

# For Compute Mesh
proc onmeshAutoDEZHelp {} { 
   set helpset "imesh_computemesh"
     ContextDEZHelp $helpset
}

# For Tetra Meshing
#proc onmeshTetDEZHelp {} { 
#   set helpset "imesh_volmesh"
#     ContextDEZHelp $helpset
#}

# For Prism Meshing
#proc onmeshPrismDEZHelp {} { 
#   set helpset "imesh_meshprism"
#      ContextDEZHelp $helpset
#}

# For Global Cartesian Meshing
#proc onmeshGlobalDEZHelp {} { 
#     set helpset "imesh_globalcart" 
#     ContextDEZHelp $helpset
#}
# For Global Cartesian Meshing
#proc onmeshGlobalDEZHelp {} { 
#   set helpset "imesh_globalcart" 
#     ContextDEZHelp $helpset
#}

# proc onlaunchBSMDEZHelp {} { 
#      set helpset "Help-3_8_" 
#      ContextDEZHelp $helpset
# }

# For Extrusion
proc onextrudeMeshDEZHelp {} { 
   set helpset "imesh_extrudemesh"
     ContextDEZHelp $helpset
}

# ********************Context Sensitive Help for CART3D*******************************
#---------------------------------------------------------------------------------------
#
proc onmeshCart3dDEZHelp {} { 
   set helpset "icart_cart3dmesher" 
     ContextDEZHelp $helpset
}
# For FlowCart Solver 
proc onsolRunDEZHelp {} { 
   set helpset "icart_runsolver" 
     ContextDEZHelp $helpset
}
# For Integrate Cp 
proc onsolPostDEZHelp {} { 
   set helpset "icart_integratecp" 
     ContextDEZHelp $helpset
}

# For Run Trials 
proc onsolTrialsDEZHelp {} { 
   set helpset "icart_runtrials" 
     ContextDEZHelp $helpset
}

# For 6DOF 
proc onsol6DOFDEZHelp {} { 
   set helpset "icart_run6dof" 
     ContextDEZHelp $helpset
}
#
#
#
# ********************Context Sensitive Help for Edit Mesh*******************************
#---------------------------------------------------------------------------------------


# For Create Elements
proc oncreateElemsDEZHelp {} { 
   set helpset "iedit_createelem" 
     ContextDEZHelp $helpset
}

# For Extrusion
proc onextrudeMeshDEZHelp {} { 
   set helpset "iedit_extrudemesh"
     ContextDEZHelp $helpset
}

# For Create Mid-side nodes for Quadratic elements
proc oncreateMidSideDEZHelp {} { 
   set helpset "Help-6_2_" 
     ContextDEZHelp $helpset
}

# For Check Mesh
proc oncheckMeshDEZHelp {} { 
   set helpset "iedit_checkmesh" 
     ContextDEZHelp $helpset
}

# For Quality Metrics
proc onqualityMetricsDEZHelp {} { 
   set helpset "iedit_meshquality" 
     ContextDEZHelp $helpset
}

# For Smooth Mesh
proc onsmoothDEZHelp {} { 
   set helpset "iedit_smoothmeshglobally" 
     ContextDEZHelp $helpset
}
# For Smooth Hexahedral Mesh
proc onsmoothSOEDEZHelp {} { 
  set helpset "iedit_smoothhexameshortho" 
     ContextDEZHelp $helpset
}

# For Repair Mesh
proc onrepairMeshDEZHelp {} { 
   set helpset "iedit_repairmesh" 
     ContextDEZHelp $helpset
}

# For Merge Nodes
proc onmergeNodesDEZHelp {} { 
   set helpset "iedit_mergenodes" 
     ContextDEZHelp $helpset
}

# For Split Mesh
proc onsplitMeshDEZHelp {} { 
   set helpset "iedit_splitmesh" 
     ContextDEZHelp $helpset
}

# For Move Nodes
proc onmoveNodesDEZHelp {} { 
   set helpset "iedit_movenodes" 
     ContextDEZHelp $helpset
}
# For Offset Mesh 
proc onoffsetMeshDEZHelp {} { 
   set helpset "iedit_offsetmesh" 
     ContextDEZHelp $helpset
}

# For Transform Mesh
proc ontransformElemsToolsDEZHelp {} { 
   set helpset "iedit_transformmesh" 
     ContextDEZHelp $helpset
}

# For Convert Mesh Type
proc onconvertMeshTypeDEZHelp {} { 
   set helpset "iedit_convertmeshtype" 
     ContextDEZHelp $helpset
}

# For Coarsening/Refinement
proc onadjustMeshDEZHelp {} { 
   set helpset "iedit_adjustmeshdensity" 
     ContextDEZHelp $helpset
}

# For Renumbering
proc onrenumberMeshDEZHelp {} { 
   set helpset "iedit_renumbermesh" 
     ContextDEZHelp $helpset
}
# For Mesh Thickness 
proc onthicknessMeshDEZHelp {} { 
   set helpset "iedit_assignmeshthick" 
     ContextDEZHelp $helpset
}

# For ReOrient Mesh
proc onreorientMeshDEZHelp {} { 
   set helpset "iedit_reorient" 
     ContextDEZHelp $helpset
}

# For Delete Mid Side Nodes 
proc ondeleteMidNodesDEZHelp {} { 
   set helpset "iedit_deletemidside" 
     ContextDEZHelp $helpset
}

# For Delete Nodes 
proc ondeleteNodesDEZHelp {} { 
   set helpset "iedit_deletenodes" 
     ContextDEZHelp $helpset
}

# For Delete Elements
proc ondeleteElemsDEZHelp {} { 
   set helpset "iedit_deleteelem" 
     ContextDEZHelp $helpset
}

# ********************Context Sensitive Help for Properties*******************************
#---------------------------------------------------------------------------------------

# Create Material
proc oncreateMatDEZHelp {} { 
   set helpset "iprop_creatematprop" 
     ContextDEZHelp $helpset
}

# Create Material Table
proc oncreateTblDEZHelp {} { 
   set helpset "iprop_createtable" 
     ContextDEZHelp $helpset
}

# Create Node Element Property
proc oncreate0DElePropDEZHelp {} { 
   set helpset "iprop_define0d" 
     ContextDEZHelp $helpset
}

# Create Bar Element Property
proc oncreate1DElePropDEZHelp {} { 
   set helpset "iprop_define1d" 
     ContextDEZHelp $helpset
}

# Create Shell Element Property
proc oncreate2DElePropDEZHelp {} { 
  set helpset "iprop_define2d" 
     ContextDEZHelp $helpset
}

# Create Volume Element Property
proc oncreate3DElePropDEZHelp {} { 
   set helpset "iprop_define3d" 
     ContextDEZHelp $helpset
}


# ********************Context Sensitive Help for Constraints*******************************
#---------------------------------------------------------------------------------------

# Create Constraint or Displacement
proc oncreateSingledisplacementDEZHelp {} { 
   set helpset "iconst_createconstraint" 
     ContextDEZHelp $helpset
}

# Create Imposed Displacement on Point
proc oncreatePointImpdispDEZHelp {} { 
   set helpset "iconst_disppt" 
     ContextDEZHelp $helpset
}
# Modify Constraint points
proc oncreateExistingImpdispDEZHelp {} { 
   set helpset "idisp_constrainednodes" 
     ContextDEZHelp $helpset
}
# Create Imposed Displacement on Curve
proc oncreateCurveImpdispDEZHelp {} { 
   set helpset "iconst_dispcurve" 
     ContextDEZHelp $helpset
}

# Create Imposed Displacement on Surface
proc oncreateSurfImpdispDEZHelp {} { 
   set helpset "iconst_dispsurf" 
     ContextDEZHelp $helpset
}

# Create Imposed Displacement on Subset
proc oncreateSubsetImpdispDEZHelp {} { 
   set helpset "iconst_dispsubset" 
     ContextDEZHelp $helpset
}

# Create Constraint Equation
proc oncreateMultipledisplacementDEZHelp {} { 
   set helpset "iconst_createconstrainteqn" 
     ContextDEZHelp $helpset
}
# Define Constrained Node Set 
proc oncreateConstrainedNodesDEZHelp {} { 
   set helpset "iconst_defineconstnodesets" 
     ContextDEZHelp $helpset
}

# Define Contacts
proc oncreateContactDEZHelp {} { 
   set helpset "iconst_definecontact" 
     ContextDEZHelp $helpset
}
# Modify Contacts
proc oncreateExistingContactDEZHelp {} { 
   set helpset "idisp_contacts" 
     ContextDEZHelp $helpset
}
# Define Contacts
proc oncreateSingleContactDEZHelp {} { 
   set helpset "iconst_definesinglecont" 
     ContextDEZHelp $helpset
}
# Modify Constraint Equation
proc oncreateExistingMpcdispDEZHelp {} { 
   set helpset "idisp_displace" 
     ContextDEZHelp $helpset
}
# Modify Constrainted Nodes
proc oncreateExistingConstrainedNodesDEZHelp {} { 
   set helpset "idisp_constrainednodes" 
     ContextDEZHelp $helpset
}
# Modify Single Surface Contact
proc oncreateExistingSingleContactDEZHelp {} { 
   set helpset "idisp_single_surf_contact" 
     ContextDEZHelp $helpset
}
# Modify Initial Velocity Parameters
proc oncreateExistingVelocityDEZHelp {} { 
   set helpset "idisp_vel" 
     ContextDEZHelp $helpset
}
# Modify Planer Rigid Wall
proc oncreateExistingRigidwallDEZHelp {} { 
   set helpset "idisp_rigidwalls" 
     ContextDEZHelp $helpset
}
# Modify Force
proc oncreateExistingForceDEZHelp {} { 
   set helpset "idisp_loads" 
     ContextDEZHelp $helpset
}
# Modify Force
proc oncreateExistingPresDEZHelp {} { 
   set helpset "idisp_loads" 
     ContextDEZHelp $helpset
}
# Modify Force
proc oncreateExistingTmpDEZHelp {} { 
   set helpset "idisp_temp" 
     ContextDEZHelp $helpset
}
# Modify Surface-to-Surface Contact Parameters
#proc oncreateExistingContactDEZHelp {} { 
#   set helpset "iconst_definesinglecont" 
#     ContextDEZHelp $helpset
#  }
     
# Define Constrained Node sets
#proc oncreateConstrainedNodesDEZHelp {} { 
#   set helpset "iconst_defineconstnodesets" 
#     ContextDEZHelp $helpset
#  }

# Define Initial Velocity
proc oncreateVelocityDEZHelp {} { 
   set helpset "iconst_definevel" 
     ContextDEZHelp $helpset
}

# Define Multiple Rigid Wall
proc oncreateRigidwallDEZHelp {} { 
   set helpset "iconst_defineplanar" 
     ContextDEZHelp $helpset
}

# ********************Context Sensitive Help for Loads*******************************
#---------------------------------------------------------------------------------------

# Create Force
proc oncreateForceDEZHelp {} { 
   set helpset "iload_createforce"
     ContextDEZHelp $helpset
}

# Define Force on Point
proc oncreatePointForceDEZHelp {} { 
   set helpset "iload_forcept" 
     ContextDEZHelp $helpset
}

# Define Force on Curve
proc oncreateCurveForceDEZHelp {} { 
   set helpset "iload_forcecurve" 
     ContextDEZHelp $helpset
}

# Define Force on Surface
proc oncreateSurfForceDEZHelp {} { 
   set helpset "iload_forcesurf" 
     ContextDEZHelp $helpset
}

# Define Force on Subset
proc oncreateSubsetForceDEZHelp {} { 
   set helpset "iload_forcesubset" 
     ContextDEZHelp $helpset
}


# Place Pressure
proc oncreatePressureDEZHelp {} { 
   set helpset "iload_placepressure"
     ContextDEZHelp $helpset
}

# Define Pressure on Surface
proc oncreateSurfPresDEZHelp {} { 
   set helpset "iload_presssurf" 
     ContextDEZHelp $helpset
}

# Define Pressure on Subset
proc oncreateSubsetPresDEZHelp {} { 
   set helpset "iload_presssubset" 
     ContextDEZHelp $helpset
}

# Create Temperature Boundary Condition
proc oncreateTemperatureDEZHelp {} { 
   set helpset "iload_createtemp"
     ContextDEZHelp $helpset
}

# Define Temperature on Point
proc oncreatePointTmpDEZHelp {} { 
   set helpset "iload_temppt" 
     ContextDEZHelp $helpset
}

# Define Temperature on Curve
proc oncreateCurveTmpDEZHelp {} { 
   set helpset "iload_tempcurve" 
     ContextDEZHelp $helpset
}

# Define Temperature on Surface
proc oncreateSurfTmpDEZHelp {} { 
   set helpset "iload_tempsurf" 
     ContextDEZHelp $helpset
}

# Define Temperature on Body
proc oncreateBodyTmpDEZHelp {} { 
   set helpset "iload_tempbody" 
     ContextDEZHelp $helpset
}

# Define Temperature on Subset
proc oncreateSubsetTmpDEZHelp {} { 
   set helpset "iload_tempsubset" 
     ContextDEZHelp $helpset
}

# Define Temperature on Gravity
proc onsetGravityDEZHelp {} { 
   set helpset "iload_gravity" 
     ContextDEZHelp $helpset
}


# ********************Context Sensitive Help for Solve Options*******************************
#---------------------------------------------------------------------------------------

# Setup Analysis Type 
proc onsetupNastranRunDEZHelp {} { 

  set helpset "isolve_nastran_setupanalysis"
  set solver_format [setupNastranRunDEZ get solve_format4]
  if {$solver_format == 0} { set helpset "isolve_nastran_setupanalysis" }
  if {$solver_format == 1} { set helpset "isolve_ansys_setupanalysis" }
  if {$solver_format == 2} { set helpset "isolve_lsdyna_setupanalysis" }
  if {$solver_format == 3} { set helpset "isolve_abaqus_setupanalysis" }
  if {$solver_format == 4} { set helpset "isolve_setup_analysis" }  
  ContextDEZHelp $helpset
}

# Define Solver Parameters
proc onsetupSolverParamDEZHelp {} { 

  set helpset "isolve_nastran_setupparams"
  set solver_format [setupSolverParamDEZ get solve_format_param]
  if {$solver_format == 0} { set helpset "isolve_nastran_setupparams" }
  if {$solver_format == 1} { set helpset "isolve_ansys_setupparams" }
  if {$solver_format == 2} { set helpset "isolve_lsdyna_setupparams" }
  if {$solver_format == 3} { set helpset "isolve_set_solver_params" }
  if {$solver_format == 4} { set helpset "isolve_set_solver_params" }  
  ContextDEZHelp $helpset
}

# Define Subcases
proc onsubcaseDEZHelp {} { 

  set helpset "isolve_nastran_subcase"
  set solver_format [subcaseDEZ get solve_format5]
  if {$solver_format == 0} { set helpset "isolve_nastran_subcase" }
  if {$solver_format == 1} { set helpset "isolve_ansys_subcase" }
  if {$solver_format == 2} { set helpset "isolve_set_subcase" }
  if {$solver_format == 3} { set helpset "isolve_abaqus_subcase" }
  if {$solver_format == 4} { set helpset "isolve_set_subcase" }  
  ContextDEZHelp $helpset
}

# Define Solver Writeup
proc onwriteNastranDEZHelp {} { 

  set helpset "isolve_write_view_input"
  set solver_format [writeNastranDEZ get solve_format]
  if {$solver_format == 0} { set helpset "isolve_Nastran_writeviewinput" }
  if {$solver_format == 1} { set helpset "isolve_ansys_writeviewinput" }
  if {$solver_format == 2} { set helpset "isolve_lsdyna_writeviewinput" }
  if {$solver_format == 3} { set helpset "isolve_abaqus_writeviewinput" }
  if {$solver_format == 4} { set helpset "isolve_autodyn_writeviewinput" }
  ContextDEZHelp $helpset
}

# Run solver
proc onsolveNastranDEZHelp {} { 

  set helpset "isolve_Nastran_submitrun"
  set solver_format [solveNastranDEZ get solve_format2]
  if {$solver_format == 0} { set helpset "isolve_Nastran_submitrun" }
  if {$solver_format == 1} { set helpset "isolve_ansys_submitrun" }
  if {$solver_format == 2} { set helpset "isolve_lsdyna_submitrun" }
  if {$solver_format == 3} { set helpset "isolve_submit_run" } 
  if {$solver_format == 4} { set helpset "isolve_submit_run" }   
  ContextDEZHelp $helpset
}

# Postprocess Results
proc onpostNastranDEZHelp {} { 

  set helpset "isolve_postproc"
  set solver_format [postNastranDEZ get solve_format3]
  if {$solver_format == 0} { set helpset "isolve_postproc" }
  if {$solver_format == 1} { set helpset "isolve_ansyspostproc" }
  if {$solver_format == 2} { set helpset "isolve_lsdynapostproc" }
  if {$solver_format == 3} { set helpset "isolve_abaquspostproc" }
  ContextDEZHelp $helpset
}

# ********************Context Sensitive Help for Visual3p *******************************
#---------------------------------------------------------------------------------------

# Launch Result Variables
proc onv3VarsGDEZHelp {} { 
     set helpset "ipost_var" 
     ContextDEZHelp $helpset
}
# Launch Transient Step 
proc onv3TransTimeIDEZHelp {} { 
     set helpset "ipost_time" 
     ContextDEZHelp $helpset
}
# Launch Dynamic Cut Plane 
proc onv3DynamicCutPDEZHelp {} { 
     set helpset "ipost_cutplane" 
     ContextDEZHelp $helpset
}
# Launch Dynamic iso surface 
proc onv3DynamicIsoDEZHelp {} { 
     set helpset "ipost_isosurf" 
     ContextDEZHelp $helpset
}
# Launch Dynamic iso surface 
proc onv3ProbePtDEZHelp {} { 
     set helpset "ipost_ptprobe" 
     ContextDEZHelp $helpset
}

# Launch Dynamic iso surface 
proc onv3ImportSfDEZHelp {} { 
     set helpset "ipost_import" 
     ContextDEZHelp $helpset
}
# Launch Dynamic iso surface 
proc onv3CreateStrmDEZHelp {} { 
     set helpset "ipost_streams" 
     ContextDEZHelp $helpset
}
# Launch Dynamic iso surface 
proc onv3AnimateDEZHelp {} { 
     set helpset "ipost_animate" 
     ContextDEZHelp $helpset
}
# Launch Dynamic iso surface 
proc onannotationDEZHelp {} { 
     set helpset "imm_annoteaddinwin" 
     ContextDEZHelp $helpset
}
# Launch Create 1D Window 
proc ononedWinDEZHelp {} { 
     set helpset "ipost_create1Dwindow" 
     ContextDEZHelp $helpset
}

# Modify Selected Surfaces' Plotting Properties
proc onv3SurfacePropertyDEZHelp {} {
   set helpset "ipost_modifydwgprop"
   ContextDEZHelp $helpset
}

#Get Selected Surfaces' Integal Values
proc onv3SurfIntegalDEZHelp {} {
   set helpset "ipost_calcintegrals"
   ContextDEZHelp $helpset
}

#Compute A Surface's 2D Surface-Flow
proc onv3SurfFlowDEZHelp {} {
   set helpset "ipost_computesurfflow"
   ContextDEZHelp $helpset
}

#Set A Surface's specific scalar and vector variables
proc v3SurfVarSVDEZHelp {} {
   set helpset "ipost_surfvar"
   ContextDEZHelp $helpset
}

#Set A Surface's specific scalar variable
proc onv3SurfSVarDEZHelp {} {
   set helpset "ipost_scalarvar"
   ContextDEZHelp $helpset
}

#Set A Surface's specific vector variable
proc onv3SurfVVarDEZHelp {} {
   set helpset "ipost_vectorvar"
   ContextDEZHelp $helpset
}

#Modify A Stream Group's Plotting Propertes
proc onv3StrmPropertiesDEZHelp {} {
   set helpset "ipost_group0"
   ContextDEZHelp $helpset
}

#Select Result Format
proc onv3StartupDEZHelp {} {
   set helpset "imm_openresults"
   ContextDEZHelp $helpset
}

#Select NastranVariables
proc onv3NastranVarsDEZHelp {} {
   set helpset "ipost_nastranvar"
   ContextDEZHelp $helpset
}

#Select AnsysVariables
proc onv3AnsysVarsDEZHelp {} {
   set helpset "ipost_ansysvar"
   ContextDEZHelp $helpset
}

#Select LS-Dyna Variables
proc onv3LsDynaVarsDEZHelp {} {
   set helpset "ipost_lsdynavar"
   ContextDEZHelp $helpset
}

#Make LS-Dyna XY Plots
proc onv3LsDynaXYpDEZHelp {} {
   set helpset "ipost_modifylsdynaxy"
   ContextDEZHelp $helpset
}

#Modify Colormap
proc onvpColorMapDEZHelp {} {
   set helpset "ipost_colormapmodifyentries"
   ContextDEZHelp $helpset
}

#Modify VFrame
proc onannoModifyVframeDEZHelp {} {
   set helpset "ipost_modifyvframe"
   ContextDEZHelp $helpset
}

#Modify Colormap Bar Annotation
proc onannoModifyCmapDEZHelp {} {
   set helpset "ipost_colormapmodifydisp"
   ContextDEZHelp $helpset
}

#Create A Line
proc ononedLineDEZHelp {} {
   set helpset "ipost_create1Dline"
   ContextDEZHelp $helpset
}

#Interpolate to surface defined by points
proc onv3InterpFileDEZHelp {} {
   set helpset "ipost_interpFile"
   ContextDEZHelp $helpset
}

#Modify Current XY Plot
proc ononedPlotDEZZHelp {} {
   set helpset "ipost_modifycurrentxy"
   ContextDEZHelp $helpset
}

#Modify Legend
proc ononedLegendDEZHelp {} {
   set helpset "ipost_legend"
   ContextDEZHelp $helpset
}

#Modify X Axis
proc ononedAxisXDEZHelp {} {
   set helpset "ipost_xaxis"
   ContextDEZHelp $helpset
}

#Modify Y Axis
proc ononedAxisYDEZHelp {} {
   set helpset "ipost_yaxis"
   ContextDEZHelp $helpset
}

#Modify Polar Arc
proc ononedAxisADEZHelp {} {
   set helpset "ipost_arc"
   ContextDEZHelp $helpset
}

#Modify Text Annotation
proc onannoModifyTextDEZHelp {} {
   set helpset "ipost_modifytextann"
   ContextDEZHelp $helpset
}

#Modify Pixmap
proc onannoModifyPixmapDEZHelp {} {
   set helpset "ipost_modifypixmapann"
   ContextDEZHelp $helpset
}

#Modify Line Annotation
proc onannoModifyLineDEZHelp {} {
   set helpset "ipost_modifylineann"
   ContextDEZHelp $helpset
}

#Modify Circle Annotation
proc onannoModifyCircleDEZHelp {} {
   set helpset "ipost_modifycircleann"
   ContextDEZHelp $helpset
}

#Modify Box Annotation
proc onannoModifyBoxDEZHelp {} {
   set helpset "ipost_modifyboxann"
   ContextDEZHelp $helpset
}

#Modify Polygon Annotation
proc onannoModifyPolygonDEZHelp {} {
   set helpset "ipost_modifypolygonann"
   ContextDEZHelp $helpset
}

#Modify Mark/Symbol Annotation
proc onannoModifyMarkDEZHelp {} {
   set helpset "ipost_modifymarkann"
   ContextDEZHelp $helpset
}

#Modify Utf Text Annotation
proc onannoModifyUtftextDEZHelp {} {
   set helpset "ipost_modifyutfann"
   ContextDEZHelp $helpset
}


#Generate Report --- for flowmatch only
proc onv3ReportDEZHelp {} {
   set helpset "ipost_v3Report"
   ContextDEZHelp $helpset
}


# ********************Context Sensitive Help for Display Tree*******************************
#---------------------------------------------------------------------------------------

# Create part
proc oncreatePartDEZHelp {} { 
     set helpset "idisp_parts" 
     ContextDEZHelp $helpset
}

# Modify part
proc onmodifyPartDEZHelp {} { 
     set helpset "idisp_morepartdisplayoptions" 
     ContextDEZHelp $helpset
}

# Create Geometry subset
proc oncreateGeomSubsetDEZHelp {} { 
     set helpset "idisp_geomsubsets" 
     ContextDEZHelp $helpset
}

# Modify Geom subset
proc onmodifyGeomSubsetDEZHelp {} { 
     set helpset "idisp_modifygeomsubsets" 
     ContextDEZHelp $helpset
}

# Create Mesh subset
proc oncreateMeshSubsetDEZHelp {} { 
     set helpset "idisp_meshsubsets" 
     ContextDEZHelp $helpset
}

# Modify Mesh subset
proc onmodifyMeshSubsetDEZHelp {} { 
     set helpset "idisp_meshsubsetmodify" 
     ContextDEZHelp $helpset
}

# Modify Mesh subset
proc oncreateAssemDEZHelp {} { 
     set helpset "idisp_createassembly" 
     ContextDEZHelp $helpset
}

# Edit Distributed Attribute
proc onmodifyDistributedDEZHelp {} { 
     set helpset "iedit_editdistribattrib" 
     ContextDEZHelp $helpset
}
# Settings - Edge Info
proc onsetDetailInfoDEZHelp {} { 
     set helpset "imm_edgeinfo" 
     ContextDEZHelp $helpset
}
# Display Tree - Blocking - Subset
proc oncreateBlockSubsetDEZHelp {} { 
     set helpset "idisp_blocksubsets" 
     ContextDEZHelp $helpset
}
# Display Tree - Blocking - Subset - Modify
proc onmodifyBlockSubsetDEZHelp {} { 
     set helpset "idisp_blocksubsetmodify" 
     ContextDEZHelp $helpset
}
# Display Tree - Blocking - Premesh - Cut plane
proc onhexcutPlaneDEZHelp {} { 
     set helpset "idisp_premesh_cutplane" 
     ContextDEZHelp $helpset
}
#med GUI Help
proc med_context_help {w} {
    set helpset Help     
    switch $w {
        .histo_replot {
    	    set helpset "iedit_qualitymetrichistogram"
	}
    }
    ContextDEZHelp $helpset
}

#sub item specific DEZ help set
proc aie_get_sub_helpset {helpset} {
	global toolBarInfo

	set dez $::AIEnv::GUIManagement::ActiveDEZ
	if { $dez == "NULL" } {
	 	return $helpset
	}

	if [info exists toolBarInfo(activeWin)] {
	    set tb $toolBarInfo(activeWin)
	    if {$tb != ""} {
		set button toolBarInfo($tb-current)
		set helptext [$button cget -helptext]
		regsub -all {\ } $helptext "_" sub
		set helpset "$helpset-$sub"	
	    }
	}

	return $helpset
}



