diff --git a/Icarus/MaterialDb/Material.vb b/Icarus/MaterialDb/Material.vb index d14cd41..e5a5eb0 100644 --- a/Icarus/MaterialDb/Material.vb +++ b/Icarus/MaterialDb/Material.vb @@ -215,6 +215,7 @@ Public Class MaterialIndex Friend Function GetSelMaterialData(Param As MaterialParam.Params) As Double Dim sParamKey As String = "" + Dim dDefault As Double = 0 Select Case Param Case MaterialParam.Params.T1 sParamKey = MAT_T1 @@ -228,8 +229,10 @@ Public Class MaterialIndex sParamKey = MAT_T5 Case MaterialParam.Params.K_EXTRUSION sParamKey = MAT_KEXTRUSION + dDefault = 100 Case MaterialParam.Params.K_LAY_TIME sParamKey = MAT_KLAYERTIME + dDefault = 100 Case MaterialParam.Params.C1 sParamKey = MAT_C1 Case MaterialParam.Params.C2 @@ -255,7 +258,7 @@ Public Class MaterialIndex Case MaterialParam.Params.KN sParamKey = MAT_KN End Select - Return ReadMaterialParamDouble(m_nIndex, sParamKey, 0) + Return ReadMaterialParamDouble(m_nIndex, sParamKey, dDefault) End Function End Class diff --git a/Icarus/SceneHost/MySceneHostVM.vb b/Icarus/SceneHost/MySceneHostVM.vb index ce7caa2..7d0d6a9 100644 --- a/Icarus/SceneHost/MySceneHostVM.vb +++ b/Icarus/SceneHost/MySceneHostVM.vb @@ -508,8 +508,8 @@ Public Class MySceneHostVM .Title = "Export", .Filter = "Stereolithography (*.stl)|*.stl" & "|3D Manufacturing format (*.3mf)|*.3mf", - .FilterIndex = 0, - .FileName = Path.ChangeExtension(MainController.GetCurrFile(), "stl") + .FilterIndex = 1, + .FileName = Path.ChangeExtension(MainController.GetCurrFile(), "3mf") } Dim DialogResult As Boolean? = SaveFileDialog.ShowDialog If IsNothing(DialogResult) OrElse Not DialogResult Then Return diff --git a/Icarus/Utility/LuaExec.vb b/Icarus/Utility/LuaExec.vb index c1d3340..76cc0f3 100644 --- a/Icarus/Utility/LuaExec.vb +++ b/Icarus/Utility/LuaExec.vb @@ -10,6 +10,7 @@ Module LuaExec If bSlice Then EgtLuaCreateGlobTable("PRINT") EgtLuaSetGlobIntVar("PRINT.PROGRAM", 1) + EgtLuaSetGlobStringVar("PRINT.BASEDIR", Map.refMainWindowVM.MainWindowM.s3dPrintingDir) bOk = bOk AndAlso EgtLuaExecFile(Map.refMainWindowVM.MainWindowM.s3dPrintingDir & "\Slicing.lua") ' Cancello tavola globale EgtLuaResetGlobVar("PRINT") @@ -29,6 +30,9 @@ Module LuaExec dMachiningConstant = MachiningConstant.dValue End If End If + EgtLuaCreateGlobTable("PRINT") + EgtLuaSetGlobIntVar("PRINT.PROGRAM", 1) + EgtLuaSetGlobStringVar("PRINT.BASEDIR", Map.refMainWindowVM.MainWindowM.s3dPrintingDir) EgtLuaCreateGlobTable("MACHINING") EgtLuaSetGlobNumVar("MACHINING.K", dMachiningConstant) EgtLuaCreateGlobTable("MATERIAL") @@ -49,17 +53,14 @@ Module LuaExec ' Eseguo lo script If EgtLuaExecFile(sExecPath) Then bOk = True - '' Recupero i risultati - 'Dim nErr As Integer = 999 - 'EgtLuaGetGlobIntVar("MATERIAL.ERR", nErr) - 'bOk = (nErr <= 0) - 'If Not bOk Then EgtOutLog("ExecSlice Err=" & nErr.ToString()) Else EgtOutLog("Error executing Slice Exec script " & sExecPath) bOk = False End If ' Cancello tavola globale EgtLuaResetGlobVar("MATERIAL") + EgtLuaResetGlobVar("MACHINING") + EgtLuaResetGlobVar("PRINT") Return bOk End Function @@ -68,6 +69,7 @@ Module LuaExec ' eseguo generazione EgtLuaCreateGlobTable("PRINT") EgtLuaSetGlobIntVar("PRINT.PROGRAM", 1) + EgtLuaSetGlobStringVar("PRINT.BASEDIR", Map.refMainWindowVM.MainWindowM.s3dPrintingDir) Dim sIsoFilePath As String = "" Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE) If nTabPartId <> GDB_ID.NULL Then @@ -98,6 +100,8 @@ Module LuaExec EgtOutLog("-- Start ExecSolid --") ' eseguo generazione EgtLuaCreateGlobTable("PRINT") + EgtLuaSetGlobIntVar("PRINT.PROGRAM", 1) + EgtLuaSetGlobStringVar("PRINT.BASEDIR", Map.refMainWindowVM.MainWindowM.s3dPrintingDir) Dim bOk As Boolean = EgtLuaExecFile(Map.refMainWindowVM.MainWindowM.s3dPrintingDir & "\CalcSolids.lua") If bOk Then Dim nErr As Integer = 999