Lukáš Záruba
17.04.2019, 09:41
Zdravím,Mám pravidlo které mi pomocí funkce if, ElseIf zjistí jaký je použitý materiál a podle toho vybere zkratku materiálu a napíše jí do Ivlastností - Custom "MAT". Pravidlo jen s pár materiály přikládám níže. Je možné toto pravidlo upravit tak aby se podívalo do excelovské tabulky? z důvodu jednodušího přidávání zkratek.Dim oParams As Parameters
Dim oPartDoc As PartDocument = ThisDoc.Document
Dim oPartCompDef As PartComponentDefinition = oPartDoc.ComponentDefinition
oParams = oPartCompDef.Parameters
Dim oUserParams As UserParameters = oParams.UserParameters
Try
p = Parameter("MAT")
Catch
oUserParams.AddByValue("MAT","Neni", UnitsTypeEnum.kTextUnits)
End Try
If iProperties.Material = "Hlin�k 6061" Then
iProperties.Value("Custom", "MAT") = "AL"
Parameter("MAT")=iProperties.Value("Custom", "MAT")
ElseIf iProperties.Material = "Hlin�k 6061 - PROTISKLUZ" Then
iProperties.Value("Custom", "MAT") = "AL-Pr."
Parameter("MAT")=iProperties.Value("Custom", "MAT")
ElseIf iProperties.Material = "Hlin�k 6061 - B�L� ( RAL 9010 )" Then
iProperties.Value("Custom", "MAT") = "AL-(B)"
Parameter("MAT")=iProperties.Value("Custom", "MAT")
ElseIf iProperties.Material = "NEREZ (�sn 17 240 AISI 304 )" Then
iProperties.Value("Custom", "MAT") = "NE"
Parameter("MAT")=iProperties.Value("Custom", "MAT")
End If
MultiValue.UpdateAfterChange = True
'MessageBox.Show(Parameter("MAT"), "Kontrola Materi�lu", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1)
Myslím tím že bych měl materiál ve sloupci A a zkratku ve sloupci B:A BHliník 6061 ALNEREZ NE....
Dim oPartDoc As PartDocument = ThisDoc.Document
Dim oPartCompDef As PartComponentDefinition = oPartDoc.ComponentDefinition
oParams = oPartCompDef.Parameters
Dim oUserParams As UserParameters = oParams.UserParameters
Try
p = Parameter("MAT")
Catch
oUserParams.AddByValue("MAT","Neni", UnitsTypeEnum.kTextUnits)
End Try
If iProperties.Material = "Hlin�k 6061" Then
iProperties.Value("Custom", "MAT") = "AL"
Parameter("MAT")=iProperties.Value("Custom", "MAT")
ElseIf iProperties.Material = "Hlin�k 6061 - PROTISKLUZ" Then
iProperties.Value("Custom", "MAT") = "AL-Pr."
Parameter("MAT")=iProperties.Value("Custom", "MAT")
ElseIf iProperties.Material = "Hlin�k 6061 - B�L� ( RAL 9010 )" Then
iProperties.Value("Custom", "MAT") = "AL-(B)"
Parameter("MAT")=iProperties.Value("Custom", "MAT")
ElseIf iProperties.Material = "NEREZ (�sn 17 240 AISI 304 )" Then
iProperties.Value("Custom", "MAT") = "NE"
Parameter("MAT")=iProperties.Value("Custom", "MAT")
End If
MultiValue.UpdateAfterChange = True
'MessageBox.Show(Parameter("MAT"), "Kontrola Materi�lu", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1)
Myslím tím že bych měl materiál ve sloupci A a zkratku ve sloupci B:A BHliník 6061 ALNEREZ NE....