- modifiche per export del 3dm per la macchina

This commit is contained in:
Emmanuele Sassi
2023-12-19 14:57:46 +01:00
parent 27a54b0034
commit 12081cec28
3 changed files with 43 additions and 4 deletions
+13
View File
@@ -688,6 +688,19 @@ Public Class MySceneHostVM
MainController.SetDefaultFilterForExport(EEX_FLT.MODE_HIDDEN + EEX_FLT.MODE_STD + EEX_FLT.STAT_ON + EEX_FLT.STAT_OFF + EEX_FLT.LEV_TEMP)
Return MainController.ExportGeomId(Map.refTopPanelVM.SelPart.nPartId, sFilePath, False)
End Function
Public Function ExportProjectForMachine(sDirPath As String, b3dm As Boolean, ByRef sFilePath As String) As Boolean
sFilePath = sDirPath & "\ProjectSlice" & If(b3dm, ".3dm", ".3mf")
' Reset controller e scena
MainController.ResetStatus()
MainController.SetDefaultFilterForExport(EEX_FLT.MODE_HIDDEN + EEX_FLT.MODE_STD + EEX_FLT.STAT_ON + EEX_FLT.STAT_OFF + EEX_FLT.LEV_TEMP)
Dim nExportGeomId As Integer = 0
If b3dm Then
If Not ExecPrepare3dmExport(nExportGeomId) Then Return False
Else
nExportGeomId = Map.refTopPanelVM.SelPart.nPartId
End If
Return MainController.ExportGeomId(nExportGeomId, sFilePath, False)
End Function
Public Overrides Function ExecScript(sFilePath As String) As Boolean
Dim bOk As Boolean = False
+16 -4
View File
@@ -775,12 +775,24 @@ Public Class SliceManagerVM
If IsNothing(SolidCheck.bIsVisible) OrElse Not SolidCheck.bIsVisible Then
SolidCheck.bIsVisible = True
End If
' esporto file 3mf
Dim s3mfPath As String = sExportTempFolderPath & "\ProjectSlice.3mf"
If Not Map.refSceneHostVM.ExportProjectForMachine(s3mfPath) Then
' esporto file progetto
Dim sFileExtension As String
If True Then
sFileExtension = ".3dm"
Else
sFileExtension = ".3mf"
End If
Dim s3dFilePath As String = ""
If Not Map.refSceneHostVM.ExportProjectForMachine(sExportTempFolderPath, True, s3dFilePath) Then
EgtOutLog("Error! Impossible exporting 3mf file!")
Return False
End If
'' esporto file 3mf
'Dim s3mfPath As String = sExportTempFolderPath & "\ProjectSlice.3mf"
'If Not Map.refSceneHostVM.ExportProjectForMachine(s3mfPath) Then
' EgtOutLog("Error! Impossible exporting 3mf file!")
' Return False
'End If
' creo file json
Dim sProjName As String = ""
EgtGetCurrFilePath(sProjName)
@@ -812,7 +824,7 @@ Public Class SliceManagerVM
' aggiungo file Iso
zip.AddItem(sIsoFilePath, "").FileName = "ProjectSlice" & Path.GetExtension(sIsoFilePath)
' aggiungo file 3mf
zip.AddItem(s3mfPath, "")
zip.AddItem(s3dFilePath, "")
' aggiungo json
zip.AddItem(sJsonPath, "")
' aggiungo immagine preview
+14
View File
@@ -115,4 +115,18 @@ Module LuaExec
Return bOk
End Function
Friend Function ExecPrepare3dmExport(ByRef nExportGeomId As Integer) As Boolean
Dim bOk As Boolean = True
EgtLuaCreateGlobTable("PRINT")
EgtLuaSetGlobStringVar("PRINT.BASEDIR", Map.refMainWindowVM.MainWindowM.s3dPrintingDir)
bOk = EgtLuaExecFile(Map.refMainWindowVM.MainWindowM.s3dPrintingDir & "\PrepareExport.lua")
If bOk Then
EgtLuaGetGlobIntVar("PRINT.EXPORTLAYER", nExportGeomId)
End If
' Cancello tavola globale
EgtLuaResetGlobVar("PRINT")
Return bOk
End Function
End Module