Formulas de exemplo para Legendas e Listas
FORMULAS APLICAVEIS A LISTAS E LEGENDAS
ESTE FICHEIRO CONTEM INFORMAÇÃO UTIL AOS UTILIZADORES, sobre configuração de templates e reports
1. Exemplos: Value Field Properties
TAMANHO DA FOLHA
Esta formula compara o tamanho da folha e se for igual ao "texto" depois mostra o seguinte "texto"
Content type: DRAWING
if (GetValue("SIZE") == "1189x841") then "A0"
else
if (GetValue("SIZE") == "841x594") then "A1"
else
if (GetValue("SIZE") == "594x420") then "A2"
else
if (GetValue("SIZE") == "420x297") then "A3"
else
if (GetValue("SIZE") == "297x210") then "A4"
else ""
endif
endif
endif
endif
endif
REVISÃO ZERO IGUAL A 0, diferente coloca MARCA A, B, C
Esta formula verifica se a revisão é a ZERO ou diferente. Caso seja igual a ZERO coloca o Texto "0", se for diferente vai buscar a Marca.
Content type: DRAWING
if (GetValue("REVISION.NUMBER") == "0") then "00"
else
if (GetValue("REVISION.NUMBER") != "") then GetValue("REVISION.MARK")
else ""
endif
endif
TEXTO ESPECIFICO PELO NUMERO DE DESENHO
Esta formula copia o campo "SEC" dos UDAS do desenho e se for igual aos texto "x" e copia o value field "y"
(*)"SEC" = sector definido no object.inp - drawing UDA
Content type: DRAWING
if (CopyField("SEC") == "ARN00") then CopyField("arn1")
else
if (CopyField("SEC") == "HIP10") then CopyField("hip1")
else
if (CopyField("SEC") == "HIP12") then CopyField("hip4")
else ""
endif
endif
PEÇA DE CONJUNTO | PEÇA SOLTA
Se o tipo de desenho for G não coloca "texto"
Se o tipo de desenho for A copia o campo "resultado_A"
Se o tipo de desenho for W copia o campo "resultado_W"
O campo Resultado A e W definem se é peça solda ou de conjunto
Content type: DRAWING
if (GetValue("TYPE") == "G") then ""
else
if (GetValue("TYPE") == "A") then CopyField("RESULTADO_A")
else
if (GetValue("TYPE") == "W") then CopyField("RESULTADO_W")
else ""
endif
endif
endif
RESULTADO_A
CopyField("LOOSE_PART_A")
LOOSE_PART_A
if GetValue("WEIGHT")!=GetValue("MAINPART.WEIGHT") then "FINAL" else "OF ASSEMBLY / DE CONJUNTO" endif
Content type:ASSEMBLY
RESULTADO_W
CopyField("LOOSE_PART_W")
LOOSE_PART_W
if GetValue("ASSEMBLY.WEIGHT")==GetValue("ASSEMBLY.MAINPART.WEIGHT") then "FINAL" else "OF ASSEMBLY / DE CONJUNTO" endif
Content type: PART
2. Exemplos: Row Properties
COLOCAR UM CAMPO VISIVEL OU OCULTO
Esta formula compara O Value filed copiado com o "texto" e seguidamente compara o proximo value com outro texto, se os dois forem coecidentes a row fica visivel.
Content type: DRAWING
if ((CopyField("STD_value") == "ESTRUTURA METÁLICA") && (CopyField("SEC") == "ARN00"))
|| ((CopyField("STD_value") == "ESTRUTURA METÁLICA") && (CopyField("SEC") == "HIP10"))
then
Output()
else
StepOver()
endif
SE O TIPO DE DESENHO FOR "A" O CAMPO FICA VISIVEL
Esta formula verifica o tipo de desenho, se for igual a A, na Row fica visivel.
Content type: DRAWING
if (GetFieldFormula("TYPE")=="A") then
Output()
else
endif
3.3 Utilizar o atributo tipo de texto nos calculos
Mudar texto para formato numerico
double (GetValue("ASSEMBLY_TOP_LEVEL"))
Mudar para o formato correcto para calculos (double=decimals)
format (double(GetValue(ASSEMBLY_TOP_LEVEL")),"Length", "mm", 1)
Adicionar tudo o que está acima na fórmula de cálculo
format (double(GetValue(ASSEMBLY_TOP_LEVEL")),"Length", "mm", 1)+15000
Outro exemplo para a mesma elevação da peça
(double(GetValue("TOP_LEVEL"))-(double(GetValue("BOTTOM_LEVEL"))))*1000