OmagOFFICE 2.1c2 :
- riportate modifiche di OmagCUT 2.1c2 (nesting con tagli inclinati, compo con tagli inclinati paralleli con misure come Trf).
This commit is contained in:
@@ -716,9 +716,11 @@ Public Class SideEntityControlVM
|
||||
' Scrivo nuovo angolo nelle info
|
||||
If dSideAngle <> 0 Then
|
||||
EgtSetInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE, dSideAngle)
|
||||
EgtSetInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE, dSideAngle)
|
||||
' Cancello inclinazione nell'apposito campo info
|
||||
Else
|
||||
EgtRemoveInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE)
|
||||
EgtRemoveInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE)
|
||||
End If
|
||||
' Aggiorno lista entità con nuova inclinazione
|
||||
CurrEntity.dSideAngle = dSideAngle
|
||||
@@ -836,6 +838,10 @@ Public Class SideEntityControlVM
|
||||
EgtSetCurrentContext(nCtx)
|
||||
Dim PartId As Integer = EgtGetFirstPart()
|
||||
While PartId <> GDB_ID.NULL
|
||||
' Se richiesti lati paralleli con misura sul top come in TRF, verifico e aggiusto
|
||||
If GetMainPrivateProfileInt( S_SIDES, K_PARSIDE_AS_TRF, 0) <> 0 Then
|
||||
AdjustAsTrfParSides( PartId)
|
||||
End If
|
||||
' Elimino eventuale precedente layer per testi
|
||||
EgtErase(EgtGetFirstNameInGroup(PartId, SIDE_ANGLE_LAYER))
|
||||
' Creo layer per testi nesting
|
||||
@@ -854,6 +860,49 @@ Public Class SideEntityControlVM
|
||||
End While
|
||||
End Sub
|
||||
|
||||
Shared Function AdjustAsTrfParSides( PartId As Integer) As Boolean
|
||||
' Recupero il loop esterno
|
||||
Dim LoopId As Integer = EgtGetFirstNameInGroup(PartId, NAME_OUTLOOP)
|
||||
If LoopId = GDB_ID.NULL Then Return False
|
||||
' Scansiono i lati
|
||||
Dim LineId As Integer = EgtGetFirstInGroup(LoopId)
|
||||
While LineId <> GDB_ID.NULL
|
||||
' Se non è linea con singolo angolo, vado oltre
|
||||
If Not EgtExistsInfo(LineId, INFO_SIDE_ANGLE) OrElse
|
||||
EgtExistsInfo(LineId, INFO_SIDE_ANGLE2) OrElse
|
||||
EgtExistsInfo(LineId, INFO_HEEL) Then
|
||||
LineId = EgtGetNext(LineId)
|
||||
Continue While
|
||||
End If
|
||||
' Recupero angolo di fianco e direzione
|
||||
Dim dSideAng As Double = 0 : EgtGetInfo( LineId, INFO_SIDE_ANGLE, dSideAng)
|
||||
Dim vtDir As new Vector3d : EgtStartVector( LineId, GDB_ID.ROOT, vtDir)
|
||||
' Confronto con le linee successive
|
||||
Dim OthLId As Integer = EgtGetNext(LineId)
|
||||
While OthLId <> GDB_ID.NULL
|
||||
' Se non è linea con singolo angolo, vado oltre
|
||||
If Not EgtExistsInfo(OthLId, INFO_SIDE_ANGLE) OrElse
|
||||
EgtExistsInfo(OthLId, INFO_SIDE_ANGLE2) OrElse
|
||||
EgtExistsInfo(OthLId, INFO_HEEL) Then
|
||||
OthLId = EgtGetNext(OthLId)
|
||||
Continue While
|
||||
End If
|
||||
' Recupero angolo di fianco e direzione
|
||||
Dim dOthSAng As Double = 0 : EgtGetInfo( OthLId, INFO_SIDE_ANGLE, dOthSAng)
|
||||
Dim vtOthDir As new Vector3d : EgtStartVector( OthLId, GDB_ID.ROOT, vtOthDir)
|
||||
' Se gli angoli sono opposti e le due linee sono controverse
|
||||
If Math.Abs( dSideAng + dOthSAng) < 10 * EPS_ANG_SMALL AndAlso (vtDir + vtOthDir).IsSmall() Then
|
||||
EgtSetInfo( LineId, INFO_SIDE_FIXED, 1)
|
||||
EgtSetInfo( OthLId, INFO_SIDE_FIXED, 1)
|
||||
Exit While
|
||||
End If
|
||||
OthLId = EgtGetNext(OthLId)
|
||||
End While
|
||||
LineId = EgtGetNext(LineId)
|
||||
End While
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Shared Function WriteSideAngleOnLoop(LoopId As Integer, TextLayId As Integer) As Boolean
|
||||
' Verifiche
|
||||
If LoopId = GDB_ID.NULL Or TextLayId = GDB_ID.NULL Then Return False
|
||||
@@ -887,8 +936,6 @@ Public Class SideEntityControlVM
|
||||
sText = DoubleToString(dSideAngle2, 1) & "°" & "; " & sText
|
||||
End If
|
||||
SideEntityControlVM.AddTextToLine(sText, TextLayId, LineId, 15, dBBoxRad, False, True)
|
||||
' Imposto angolo originale
|
||||
EgtSetInfo(LineId, INFO_ORIG_SIDE_ANGLE, dSideAngle)
|
||||
End If
|
||||
LineId = EgtGetNext(LineId)
|
||||
End While
|
||||
|
||||
Reference in New Issue
Block a user