From 205253d1cc6ef09aedbf0c537bf2ed866a2fb036 Mon Sep 17 00:00:00 2001 From: Daniele Bariletti Date: Fri, 21 Feb 2025 12:17:04 +0100 Subject: [PATCH] - gestite le info da scrivere su un part creato da template. --- CreateSOLID_FromPartsInPark.lua | 3 +++ TemplateTool.lua | 20 +++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CreateSOLID_FromPartsInPark.lua b/CreateSOLID_FromPartsInPark.lua index 3588626..ebd918e 100644 --- a/CreateSOLID_FromPartsInPark.lua +++ b/CreateSOLID_FromPartsInPark.lua @@ -314,6 +314,9 @@ local function CreateSolid() IdEnt_Part = nIdTrimTot SLD.CurrPartSolid = IdP_SOLID SLD.CurrSrfTmId = nIdTrimTot + + --scrivo l'info dello spessore nel part + EgtSetInfo(IdFP, "Th", EgtNumToString(SLD.THICK)) end -- diff --git a/TemplateTool.lua b/TemplateTool.lua index 917ab27..9dc1a33 100644 --- a/TemplateTool.lua +++ b/TemplateTool.lua @@ -4,7 +4,7 @@ -- Intestazioni require( 'EgtBase') _ENV = EgtProtectGlobal() -EgtEnableDebug( false) +EgtEnableDebug( true) ------------------------------------------------------------------------------------------------------------------------- -- FUNZIONI BASE PER GENERARE I COMPO SOLID INIZIO @@ -95,6 +95,19 @@ function TOOL.GetNewUUID() TOOL.UUID = EgtGetUUID() end +function TOOL.RenameNewPart() + if not TOOL.nId or TOOL.nId == GDB_ID.NULL then return end + local sCurrName = EgtGetName(TOOL.nId) + TOOL.GetNewUUID() + local sNewName = TOOL.UUID + if not sCurrName or sCurrName == "" then + sNewName = sNewName.."Part" + else + sNewName = sNewName..sCurrName + end + EgtSetName(TOOL.nId,sNewName) +end + local function FindEdges(nLay, tbInfo) -- crea una tabella con gli indici degli elementi nel Layer passato (nLay) e -- trova l'indice del lato tbInfo.nEdgeId, 1 based, restituito in tbInfo.nEdge @@ -231,6 +244,11 @@ function TOOL.FindLayers( IdPart) tbLayer['OutLoop'] = EgtGetFirstNameInGroup(IdPart, 'OutLoop') tbLayer['Region'] = EgtGetFirstNameInGroup(IdPart, 'Region') tbLayer['Ref'] = EgtGetFirstNameInGroup(IdPart, 'Ref') + -- se non esiste il layer ref, lo creo + if not tbLayer['Ref'] then + tbLayer['Ref'] = EgtGroup(IdPart) + EgtSetName(tbLayer['Ref'], 'Ref') + end tbLayer['Labels'] = EgtGetFirstNameInGroup(IdPart, 'Labels') tbLayer['Aux'] = EgtGetFirstNameInGroup(IdPart, 'Aux') local nInLoopLay = EgtGetFirstNameInGroup(IdPart, 'InLoop')