diff --git a/Controller.vb b/Controller.vb index 24421a9..ae87e8e 100644 --- a/Controller.vb +++ b/Controller.vb @@ -4129,9 +4129,9 @@ Public Class Controller Dim nId As Integer = EgtGetLastSelectedObj() EnableCommandLog() EgtSplitCurveAtPoint(nId, m_ptLast.Loc(GDB_ID.GRID), GDB_RT.GRID) + EgtDeselectObj(nId) DisableCommandLog() ' reset stato scena - EgtDeselectObj(nId) m_Scene.ResetStatus() ' aggiorno stato m_nStep = 0 @@ -4159,9 +4159,9 @@ Public Class Controller Dim nId As Integer = EgtGetLastSelectedObj() EnableCommandLog() EgtSplitCurve(nId, m_nLast) + EgtDeselectObj(nId) DisableCommandLog() ' reset stato scena - EgtDeselectObj(nId) m_Scene.ResetStatus() ' aggiorno stato m_nStep = 0 @@ -4245,9 +4245,9 @@ Public Class Controller Dim nId As Integer = EgtGetLastSelectedObj() EnableCommandLog() EgtChangeClosedCurveStartPoint(nId, m_ptLast.Loc(GDB_ID.GRID), GDB_RT.GRID) + EgtDeselectObj(nId) DisableCommandLog() ' reset stato scena - EgtDeselectObj(nId) m_Scene.ResetStatus() ' aggiorno stato m_nStep = 0 @@ -4977,16 +4977,17 @@ Public Class Controller ' reset stato scena m_Scene.ResetStatus(False) EnableCommandLog() - ' eseguo copia e offset + ' eseguo offset con copia + Dim nCount As Integer If m_bLast Then - Dim nId As Integer = EgtCopyGlob(EgtGetLastSelectedObj(), GetCurrLayer()) - If Not EgtOffsetCurve(nId, m_dLast, m_nLast) Then - EgtErase(nId) - End If + EgtOffsetCurveAdv(EgtGetLastSelectedObj(), m_dLast, m_nLast, nCount) ' altrimenti solo offset Else Dim nId As Integer = EgtGetLastSelectedObj() - Dim bOk = EgtOffsetCurve(nId, m_dLast, m_nLast) + Dim bOk = EgtOffsetCurveAdv(nId, m_dLast, m_nLast, nCount) + If nCount > 0 Then + EgtErase(nId) + End If End If DisableCommandLog() EgtDraw() @@ -5009,10 +5010,12 @@ Public Class Controller PrepareTransform(False) ' eseguo offset Dim nId As Integer = EgtGetFirstInGroup(m_Scene.GetDragGroup()) - Dim bOk = EgtOffsetCurve(nId, m_dLast, m_nLast) - If Not bOk Then + Dim nCount As Integer + EgtOffsetCurveAdv(nId, m_dLast, m_nLast, nCount) + If nCount <= 0 Then RaiseEvent OutputInfo(Me, EgtMsg(2056)) ' Distance too big Else + EgtErase(nId) RaiseEvent OutputInfo(Me, "") End If EgtDraw() diff --git a/EgtInterface.vb b/EgtInterface.vb index 2ec0847..11bfd02 100644 --- a/EgtInterface.vb +++ b/EgtInterface.vb @@ -2466,6 +2466,20 @@ Public Function EgtOffsetCurve(ByVal nId As Integer, ByVal dDist As Double, ByVa End If End Function + +Private Function EgtOffsetCurveAdv_32(ByVal nId As Integer, ByVal dDist As Double, ByVal nType As OFF_TYPE, ByRef nCount As Integer) As Integer +End Function + +Private Function EgtOffsetCurveAdv_64(ByVal nId As Integer, ByVal dDist As Double, ByVal nType As OFF_TYPE, ByRef nCount As Integer) As Integer +End Function +Public Function EgtOffsetCurveAdv(ByVal nId As Integer, ByVal dDist As Double, ByVal nType As OFF_TYPE, ByRef nCount As Integer) As Integer + If IntPtr.Size = 4 Then + Return EgtOffsetCurveAdv_32(nId, dDist, nType, nCount) + Else + Return EgtOffsetCurveAdv_64(nId, dDist, nType, nCount) + End If +End Function + Private Function EgtApproxCurve_32(ByVal nId As Integer, ByVal nApprType As Integer, ByVal dLinTol As Double) As Boolean End Function diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index d4b800c..2dba191 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -46,5 +46,5 @@ Imports System.Runtime.InteropServices ' utilizzando l'asterisco (*) come descritto di seguito: ' - - + +