diff --git a/Component.vb b/Component.vb index a472b53..f36bc6a 100644 --- a/Component.vb +++ b/Component.vb @@ -311,7 +311,7 @@ Public Class Component ' Ne recupero l'Id Dim nId2 As Integer = EgtGetLastPart() ' Lo posiziono in ordine - EgtPackPart(nId2, 0, 0, PACK_MAX_X, PACK_OFFS) + EgtPackPart(nId2, 0, 0, PACK_MAX_X, PACK_MAX_Y, PACK_OFFS, True) Next ' disabilito registrazione EgtDisableCommandLogger() diff --git a/ConstGen.vb b/ConstGen.vb index d0f3e75..d890154 100644 --- a/ConstGen.vb +++ b/ConstGen.vb @@ -40,6 +40,7 @@ Public Const MACHINES_DFL_DIR As String = "Machines" ' Costanti per Pack dei pezzi in Special Public Const PACK_MAX_X As Double = 2500 +Public Const PACK_MAX_Y As Double = INFINITO Public Const PACK_OFFS As Double = 20 End Module diff --git a/EgtInterface.vb b/EgtInterface.vb index 2bcdbdf..7089734 100644 --- a/EgtInterface.vb +++ b/EgtInterface.vb @@ -3225,11 +3225,11 @@ Public Function EgtGetPrevName(ByVal nId As Integer, ByVal sName As String) As I End Function -Public Function EgtGetBBox_32(ByVal nId As Integer, ByVal nFlag As Integer, +Private Function EgtGetBBox_32(ByVal nId As Integer, ByVal nFlag As Integer, ByRef PtMin As Point3d, ByRef PtMax As Point3d) As Boolean End Function -Public Function EgtGetBBox_64(ByVal nId As Integer, ByVal nFlag As Integer, +Private Function EgtGetBBox_64(ByVal nId As Integer, ByVal nFlag As Integer, ByRef PtMin As Point3d, ByRef PtMax As Point3d) As Boolean End Function Public Function EgtGetBBox(ByVal nId As Integer, ByVal nFlag As Integer, @@ -3242,11 +3242,11 @@ Public Function EgtGetBBox(ByVal nId As Integer, ByVal nFlag As Integer, End Function -Public Function EgtGetBBoxGlob_32(ByVal nId As Integer, ByVal nFlag As Integer, - ByRef PtMin As Point3d, ByRef PtMax As Point3d) As Boolean +Private Function EgtGetBBoxGlob_32(ByVal nId As Integer, ByVal nFlag As Integer, + ByRef PtMin As Point3d, ByRef PtMax As Point3d) As Boolean End Function -Public Function EgtGetBBoxGlob_64(ByVal nId As Integer, ByVal nFlag As Integer, +Private Function EgtGetBBoxGlob_64(ByVal nId As Integer, ByVal nFlag As Integer, ByRef PtMin As Point3d, ByRef PtMax As Point3d) As Boolean End Function Public Function EgtGetBBoxGlob(ByVal nId As Integer, ByVal nFlag As Integer, @@ -4762,18 +4762,101 @@ End Function Private Function EgtPackPart_32(ByVal nId As Integer, ByVal dXmin As Double, ByVal dYmin As Double, - ByVal dXmax As Double, ByVal dOffs As Double) As Boolean + ByVal dXmax As Double, ByVal dYmax As Double, ByVal dOffs As Double, ByVal bBottomUp As Boolean) As Boolean End Function Private Function EgtPackPart_64(ByVal nId As Integer, ByVal dXmin As Double, ByVal dYmin As Double, - ByVal dXmax As Double, ByVal dOffs As Double) As Boolean + ByVal dXmax As Double, ByVal dYmax As Double, ByVal dOffs As Double, ByVal bBottomUp As Boolean) As Boolean End Function Public Function EgtPackPart(ByVal nId As Integer, ByVal dXmin As Double, ByVal dYmin As Double, - ByVal dXmax As Double, ByVal dOffs As Double) As Boolean + ByVal dXmax As Double, ByVal dYmax As Double, ByVal dOffs As Double, ByVal bBottomUp As Boolean) As Boolean If IntPtr.Size = 4 Then - Return EgtPackPart_32(nId, dXmin, dYmin, dXmax, dOffs) + Return EgtPackPart_32(nId, dXmin, dYmin, dXmax, dYmax, dOffs, bBottomUp) Else - Return EgtPackPart_64(nId, dXmin, dYmin, dXmax, dOffs) + Return EgtPackPart_64(nId, dXmin, dYmin, dXmax, dYmax, dOffs, bBottomUp) + End If +End Function + + +Private Function EgtPackCluster_32(ByVal vId As Integer(), ByVal nCount As Integer, ByVal dXmin As Double, ByVal dYmin As Double, + ByVal dXmax As Double, ByVal dYmax As Double, ByVal dOffs As Double, ByVal bBottomUp As Boolean) As Boolean +End Function + +Private Function EgtPackCluster_64(ByVal vId As Integer(), ByVal nCount As Integer, ByVal dXmin As Double, ByVal dYmin As Double, + ByVal dXmax As Double, ByVal dYmax As Double, ByVal dOffs As Double, ByVal bBottomUp As Boolean) As Boolean +End Function +Public Function EgtPackCluster(ByVal vId As Integer(), ByVal dXmin As Double, ByVal dYmin As Double, + ByVal dXmax As Double, ByVal dYmax As Double, ByVal dOffs As Double, ByVal bBottomUp As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtPackCluster_32(vId, vId.Count(), dXmin, dYmin, dXmax, dYmax, dOffs, bBottomUp) + Else + Return EgtPackCluster_64(vId, vId.Count(), dXmin, dYmin, dXmax, dYmax, dOffs, bBottomUp) + End If +End Function +Public Function EgtPackSelectedCluster(ByVal dXmin As Double, ByVal dYmin As Double, + ByVal dXmax As Double, ByVal dYmax As Double, ByVal dOffs As Double, ByVal bBottomUp As Boolean) As Boolean + Dim vId(1) As Integer + vId(0) = GDB_ID.SEL + If IntPtr.Size = 4 Then + Return EgtPackCluster_32(vId, 1, dXmin, dYmin, dXmax, dYmax, dOffs, bBottomUp) + Else + Return EgtPackCluster_64(vId, 1, dXmin, dYmin, dXmax, dYmax, dOffs, bBottomUp) + End If +End Function + + +Private Function EgtGetClusterBBoxGlob_32(ByVal vId As Integer(), ByVal nCount As Integer, + ByRef PtMin As Point3d, ByRef PtMax As Point3d) As Boolean +End Function + +Private Function EgtGetClusterBBoxGlob_64(ByVal vId As Integer(), ByVal nCount As Integer, + ByRef PtMin As Point3d, ByRef PtMax As Point3d) As Boolean +End Function +Public Function EgtGetClusterBBoxGlob(ByVal vId As Integer(), + ByRef PtMin As Point3d, ByRef PtMax As Point3d) As Boolean + If IntPtr.Size = 4 Then + Return EgtGetClusterBBoxGlob_32(vId, vId.Count(), PtMin, PtMax) + Else + Return EgtGetClusterBBoxGlob_64(vId, vId.Count(), PtMin, PtMax) + End If +End Function +Public Function EgtGetSelectedClusterBBoxGlob(ByRef PtMin As Point3d, ByRef PtMax As Point3d) As Boolean + Dim vId(1) As Integer + vId(0) = GDB_ID.SEL + If IntPtr.Size = 4 Then + Return EgtGetClusterBBoxGlob_32(vId, 1, PtMin, PtMax) + Else + Return EgtGetClusterBBoxGlob_64(vId, 1, PtMin, PtMax) + End If +End Function + + +Private Function EgtMoveCluster_32(ByVal vId As Integer(), ByVal nCount As Integer, ByRef vtMove As Vector3d, + ByVal dXmin As Double, ByVal dYmin As Double, + ByVal dXmax As Double, ByVal dYmax As Double, ByVal dOffs As Double) As Boolean +End Function + +Private Function EgtMoveCluster_64(ByVal vId As Integer(), ByVal nCount As Integer, ByRef vtMove As Vector3d, + ByVal dXmin As Double, ByVal dYmin As Double, + ByVal dXmax As Double, ByVal dYmax As Double, ByVal dOffs As Double) As Boolean +End Function +Public Function EgtMoveCluster(ByVal vId As Integer(), ByRef vtMove As Vector3d, + ByVal dXmin As Double, ByVal dYmin As Double, + ByVal dXmax As Double, ByVal dYmax As Double, ByVal dOffs As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtMoveCluster_32(vId, vId.Count(), vtMove, dXmin, dYmin, dXmax, dYmax, dOffs) + Else + Return EgtMoveCluster_64(vId, vId.Count(), vtMove, dXmin, dYmin, dXmax, dYmax, dOffs) + End If +End Function +Public Function EgtMoveSelectedCluster(ByRef vtMove As Vector3d, ByVal dXmin As Double, ByVal dYmin As Double, + ByVal dXmax As Double, ByVal dYmax As Double, ByVal dOffs As Double) As Boolean + Dim vId(1) As Integer + vId(0) = GDB_ID.SEL + If IntPtr.Size = 4 Then + Return EgtMoveCluster_32(vId, 1, vtMove, dXmin, dYmin, dXmax, dYmax, dOffs) + Else + Return EgtMoveCluster_64(vId, 1, vtMove, dXmin, dYmin, dXmax, dYmax, dOffs) End If End Function @@ -5643,11 +5726,11 @@ Private Function EgtVectorLocToLoc(ByRef X As Double, ByRef Y As Double, ByRef Z End Function -Public Function EgtGetVectorRotation_32(ByRef VtS As Vector3d, ByRef VtE As Vector3d, ByRef VtAx As Vector3d, +Private Function EgtGetVectorRotation_32(ByRef VtS As Vector3d, ByRef VtE As Vector3d, ByRef VtAx As Vector3d, ByRef dAngRotDeg As Double, ByRef bDet As Boolean) As Boolean End Function -Public Function EgtGetVectorRotation_64(ByRef VtS As Vector3d, ByRef VtE As Vector3d, ByRef VtAx As Vector3d, +Private Function EgtGetVectorRotation_64(ByRef VtS As Vector3d, ByRef VtE As Vector3d, ByRef VtAx As Vector3d, ByRef dAngRotDeg As Double, ByRef bDet As Boolean) As Boolean End Function Public Function EgtGetVectorRotation(ByRef VtS As Vector3d, ByRef VtE As Vector3d, ByRef VtAx As Vector3d, @@ -6012,11 +6095,11 @@ End Function '---------- Costanti ----------------------------------------------------------- 'Costanti : GEOMETRIA Public Const ONEMM As Double = 1.0 -Public Const ONEINCH As Double = 25.4 +Public Const ONEINCH As Double = 25.399999999999999 Public Const EPS_SMALL As Double = 0.001 -Public Const EPS_ZERO As Double = 0.0000001 +Public Const EPS_ZERO As Double = 0.000000099999999999999995 Public Const INFINITO As Double = 10000000000.0 -Public Const EPS_STM As Double = 0.05 +Public Const EPS_STM As Double = 0.050000000000000003 Public Const EPS_STM_DRAG As Double = 0.5 'Costanti : TIPO DI FILE Public Enum FT As Integer diff --git a/FlatParts.vb b/FlatParts.vb index c099864..2e1dff8 100644 --- a/FlatParts.vb +++ b/FlatParts.vb @@ -301,7 +301,7 @@ Public Class FlatParts ' Ne recupero l'Id Dim nId2 As Integer = EgtGetLastPart() ' Lo posiziono in ordine - EgtPackPart(nId2, 0, 0, PACK_MAX_X, PACK_OFFS) + EgtPackPart(nId2, 0, 0, PACK_MAX_X, PACK_MAX_Y, PACK_OFFS, True) ' Cancello il file My.Computer.FileSystem.DeleteFile(sTmpfile) End If diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 41773a8..10172fa 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: ' - - + +