@Anonymous
Based on your rule only, I am trying to provide you a solution, I am not in front of the Inventor now.
I would suggest you a different approach for this, Currently, you are trying to access material of component from a drawing which will give you an error, for that case you can create a Text parameter (e.g. TitleBlock) in the assembly that will be placed on the drawing and use the same rule in that assembly, see below an example.
If iProperties.MaterialOfComponent("Part-1") = "AISI 316"
Parameter("TitleBlock") = "ISO" ' the values must exactly match with your title block e.g. ISO or IMS_commerciale etc.
Else If iProperties.MaterialOfComponent("Part-1") = "AISI 304"
Parameter("TitleBlock") = "IMS_commerciale"
End If
RuleParametersOutput()
InventorVb.DocumentUpdate()
iLogicVb.UpdateWhenDone = True
Once you have your rule set here in assembly what you can do is in drawing you can create a rule like below. That will access the parameter in the assembly that you have created (TitleBlock) and update it.
modelName = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)
ActiveSheet.TitleBlock = Parameter(modelName & ".TitleBlock")
Another tip from my end, whenever you are working with iLogic, please not try to use default names, for example, in your rule you are using
iProperties.MaterialOfComponent("part1:1")
Please note that when you do copy design/ create a new assembly with different part names this name will change and iLogic will fail, so I would suggest you change the name of components you see in the assembly browser, for example instead of "part1:1", rename it to "Part-1" (i.e. remove :1, :2 that you see), by doing this your iLogic will never fail even if you copy this assembly with child parts and change their filenames.
Hope you will find this helpful.
If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!
Regards,
Dutt Thakar
LinkedIn