- in batchProcess modifiche per lettura part offset da btl
This commit is contained in:
+62
-1
@@ -241,7 +241,11 @@ if bToProcess then
|
||||
EgtEraseFile( sNgeFile)
|
||||
-- eseguo import
|
||||
EgtNewFile()
|
||||
if not EgtImportBtl( BEAM.FILE, EIB_FL.TS3_POS + EIB_FL.USEUATTR) then
|
||||
local nBtlFlag = EIB_FL.TS3_POS + EIB_FL.USEUATTR
|
||||
if BD.USE_PART_OFFSET then
|
||||
nBtlFlag = nBtlFlag + EIB_FL.PARTOFFSET
|
||||
end
|
||||
if not EgtImportBtl( BEAM.FILE, nBtlFlag) then
|
||||
BEAM.ERR = 13
|
||||
BEAM.MSG = 'Error importing BTL file : ' .. BEAM.FILE
|
||||
WriteErrToLogFile( BEAM.ERR, BEAM.MSG)
|
||||
@@ -392,6 +396,63 @@ if bToProcess then
|
||||
return
|
||||
end
|
||||
|
||||
-- Se presente offset da btl, verifico se offset uguale per tutti i pezzi
|
||||
if BD.USE_PART_OFFSET then
|
||||
vBeamErr = {}
|
||||
local sPartOffset = EgtGetInfo( vBeam[1].Id, 'PARTOFFSET', 's') or ''
|
||||
local vPartOffset = EgtSplitString( sPartOffset)
|
||||
local dRotAng = EgtGetInfo( vBeam[1].Id, 'ROTATED_OK', 'd') or 0
|
||||
|
||||
for i = 2, #vBeam do
|
||||
local sPartOffsetCurrent = EgtGetInfo( vBeam[i].Id, 'PARTOFFSET', 's') or ''
|
||||
local vPartOffsetCurrent = EgtSplitString( sPartOffsetCurrent)
|
||||
local dRotAngCurrent = EgtGetInfo( vBeam[i].Id, 'ROTATED_OK', 'd') or 0
|
||||
local dRotAngDelta = abs( dRotAngCurrent - dRotAng)
|
||||
if ( #vPartOffset == 5) and ( #vPartOffsetCurrent == 5) then
|
||||
if dRotAngDelta < GEO.EPS_ANG_SMALL then
|
||||
if ( vPartOffsetCurrent[2] ~= vPartOffsetCurrent[2])
|
||||
or ( vPartOffsetCurrent[3] ~= vPartOffset[3])
|
||||
or ( vPartOffsetCurrent[4] ~= vPartOffset[4])
|
||||
or ( vPartOffsetCurrent[5] ~= vPartOffset[5]) then
|
||||
|
||||
table.insert( vBeamErr, i)
|
||||
end
|
||||
elseif dRotAngDelta - 180 < GEO.EPS_ANG_SMALL then
|
||||
if ( vPartOffsetCurrent[2] ~= vPartOffsetCurrent[4])
|
||||
or ( vPartOffsetCurrent[3] ~= vPartOffset[5])
|
||||
or ( vPartOffsetCurrent[4] ~= vPartOffset[2])
|
||||
or ( vPartOffsetCurrent[5] ~= vPartOffset[3]) then
|
||||
|
||||
table.insert( vBeamErr, i)
|
||||
end
|
||||
-- se pezzo ruotato di 90deg rispetto al principale, al momento si dà sempre errore
|
||||
else
|
||||
table.insert( vBeamErr, i)
|
||||
end
|
||||
else
|
||||
if sPartOffsetCurrent ~= sPartOffset then
|
||||
table.insert( vBeamErr, i)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if #vBeamErr > 0 then
|
||||
local sOut = 'Part offset not consistent in beam(s) : '
|
||||
for i = #vBeamErr, 1, -1 do
|
||||
local sSeparator = ', '
|
||||
if i == 1 then
|
||||
sSeparator = ''
|
||||
end
|
||||
sOut = sOut .. vBeam[vBeamErr[i]].Name .. sSeparator
|
||||
end
|
||||
BEAM.ERR = 17
|
||||
BEAM.MSG = sOut
|
||||
WriteErrToLogFile( BEAM.ERR, BEAM.MSG)
|
||||
PostErrView( BEAM.ERR, BEAM.MSG)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- Lunghezza della barra
|
||||
local dRawL = ( EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL, 'BARLEN', 'd') or 12000) + 0.1
|
||||
-- Sovramateriale di testa
|
||||
|
||||
Reference in New Issue
Block a user