EgtCAM5 2.1b2 :
- utensili custom con quotatura punto di lavoro e possibilità di adattamento a diverse dimensioni - tolto da salvataggio di lavorazioni in DB controllo carateeri non più vietati (*?/|\...).
This commit is contained in:
@@ -112,9 +112,7 @@ Public Class ToolTreeViewItem
|
||||
m_NewTool = False
|
||||
m_Name = m_Name.Trim()
|
||||
WriteToolName()
|
||||
If IsUUID(Path.GetFileNameWithoutExtension(m_Draw)) Then
|
||||
SaveToolDraw()
|
||||
End If
|
||||
SaveToolDraw()
|
||||
EgtTdbSaveCurrTool()
|
||||
Case MsgBoxResult.No
|
||||
If m_NewTool Then
|
||||
@@ -1207,7 +1205,6 @@ Public Class ToolTreeViewItem
|
||||
Private Sub UpdateSceneToolDraw()
|
||||
' Azzero errori
|
||||
m_nDrawingError = 0
|
||||
|
||||
' Se utensile con disegno automatico
|
||||
If String.IsNullOrEmpty(m_Draw) OrElse IsUUID(Path.GetFileNameWithoutExtension(m_Draw)) Then
|
||||
CreateToolDraw()
|
||||
@@ -1216,6 +1213,7 @@ Public Class ToolTreeViewItem
|
||||
EgtSetCurrentContext(IniFile.m_ToolsDbSceneContext)
|
||||
If Path.GetExtension(m_Draw).ToLower = ".nge" Then
|
||||
If EgtOpenFile(IniFile.m_sCurrMachToolsDirPath & "\" & m_Draw) Then
|
||||
UpdateCustomToolDraw()
|
||||
EgtSetView(VT.TOP, False)
|
||||
EgtZoom(ZM.ALL)
|
||||
Else
|
||||
@@ -1273,18 +1271,63 @@ Public Class ToolTreeViewItem
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateCustomToolDraw()
|
||||
' Solo per frese
|
||||
If m_Type <> MCH_TY.MILL_STD And m_Type <> MCH_TY.MILL_NOTIP Then return
|
||||
' Imposto contesto disegno utensili
|
||||
EgtSetCurrentContext(IniFile.m_ToolsDbSceneContext)
|
||||
' Acquisisco file lua
|
||||
If Not EgtLuaExecFile(IniFile.m_sToolMakersDir & "\ToolAdjust.lua") Then
|
||||
EgtOutLog( "Error on UpdateCustomToolDraw : missing ToolAdjust.lua")
|
||||
Return
|
||||
End If
|
||||
' Imposto dati per creazione utensile
|
||||
Dim dLen As double = 0
|
||||
StringToLen(m_Len, dLen)
|
||||
EgtLuaSetGlobNumVar("TOOL.LEN", dLen)
|
||||
Dim dDiam As double = 0
|
||||
StringToLen(m_Diam, dDiam)
|
||||
EgtLuaSetGlobNumVar("TOOL.DIAM", dDiam)
|
||||
' Eseguo aggiornamento utensile
|
||||
EgtLuaCallFunction("AdjustCustomTool")
|
||||
' Recupero errore
|
||||
Dim nErr As Integer = 999
|
||||
EgtLuaGetGlobIntVar("TOOL.ERR", nErr)
|
||||
m_nDrawingError = nErr
|
||||
End Sub
|
||||
|
||||
Friend Function SaveToolDraw() As Boolean
|
||||
' Imposto dati per salvataggio utensile
|
||||
ToolDraw.nToolContext = IniFile.m_ToolsDbSceneContext
|
||||
ToolDraw.nType = m_Type
|
||||
' Eseguo salvataggio
|
||||
Dim sName As String = Uuid & ".nge"
|
||||
If Not ToolDraw.Save(sName) Then Return False
|
||||
' Salvo nome del disegno utensile
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.DRAW, sName)
|
||||
EgtTdbSaveCurrTool()
|
||||
Return True
|
||||
' Se utensile con disegno automatico
|
||||
If IsUUID(Path.GetFileNameWithoutExtension(m_Draw)) Then
|
||||
' Imposto dati per salvataggio utensile
|
||||
ToolDraw.nToolContext = IniFile.m_ToolsDbSceneContext
|
||||
ToolDraw.nType = m_Type
|
||||
' Eseguo salvataggio
|
||||
Dim sName As String = Uuid & ".nge"
|
||||
If Not ToolDraw.Save(sName) Then Return False
|
||||
' Salvo nome del disegno utensile
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.DRAW, sName)
|
||||
EgtTdbSaveCurrTool()
|
||||
Return True
|
||||
' altrimenti utensile con disegno assegnato
|
||||
Else
|
||||
' Solo per frese
|
||||
If m_Type <> MCH_TY.MILL_STD And m_Type <> MCH_TY.MILL_NOTIP Then Return true
|
||||
' Imposto contesto disegno utensili
|
||||
EgtSetCurrentContext(IniFile.m_ToolsDbSceneContext)
|
||||
' Nascondo layer quotature
|
||||
Dim nDimsId As Integer = GDB_ID.NULL
|
||||
nDimsId = EgtGetFirstNameInGroup(EgtGetFirstGroupInGroup(GDB_ID.ROOT), "DIMS")
|
||||
EgtSetStatus(nDimsId, GDB_ST.OFF)
|
||||
' Salvo il modello
|
||||
Dim bOk As Boolean = EgtSaveFile(IniFile.m_sCurrMachToolsDirPath & "\" & m_Draw, NGE.CMPTEXT)
|
||||
' ripristino visualizzazione layer aux
|
||||
EgtSetStatus(nDimsId, GDB_ST.ON_)
|
||||
' ripristino contesto per DB utensili
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Return bOk
|
||||
End If
|
||||
End Function
|
||||
|
||||
#End Region ' ToolSceneUpdate
|
||||
|
||||
Reference in New Issue
Block a user