- in NestProcess aggiunte eventuali rotazioni/inversioni duplo nella barra
This commit is contained in:
@@ -8,6 +8,7 @@ EgtEnableDebug( false)
|
||||
|
||||
-- Include
|
||||
local BeamData = require( 'BeamDataNew')
|
||||
local BeamLib = require( 'BeamLib')
|
||||
|
||||
-- Imposto direttorio libreria specializzata per Travi
|
||||
EgtAddToPackagePath( NEST.BASEDIR .. '\\LuaLibs\\?.lua')
|
||||
@@ -594,12 +595,25 @@ for i = 1, #RawInventory.ActiveBeams do
|
||||
local nIndex = 1
|
||||
for j = #Beam.NestedParts, 1, -1 do
|
||||
local Part = Beam.NestedParts[j]
|
||||
local nInitialPosition = EgtGetInfo( Part.id, 'INITIALPOSITION', 'i')
|
||||
|
||||
-- spostamento verso la testa della barra
|
||||
local dPosX = Part.dPosX - Beam.dResidualLength + dStartOffset
|
||||
|
||||
-- copia del pezzo (aggiunta duplo)
|
||||
local idDuplo = EgtDuploNew( Part.id)
|
||||
local Duplo = { id = idDuplo, idRaw = EgtGetRawPartFromPart( idDuplo)}
|
||||
|
||||
-- eventuale inversione
|
||||
if EgtEndsWith( Part.sState, 'INV') then
|
||||
BeamLib.InvertRawPart( Duplo, 2)
|
||||
end
|
||||
|
||||
-- eventuale rotazione
|
||||
if ( EgtStartsWith( Part.sState, '0010') and nInitialPosition == 1)
|
||||
or ( EgtStartsWith( Part.sState, '1000') and nInitialPosition == 3) then
|
||||
BeamLib.RotateRawPart( Duplo, 2)
|
||||
end
|
||||
|
||||
-- assegnazione info
|
||||
EgtSetInfo( idMachGroup, "PART" .. nIndex, idDuplo .. "," .. dPosX)
|
||||
|
||||
Reference in New Issue
Block a user