Assigning matterials from AfterAssignMaterial
Posted: Thu Sep 10, 2015 9:13 am
Hello there,
I tried to use the AfterAssignMaterial function to create a new material entry and assign it then. This might sound a little strange, but I would like to give the user the ability to define a material having some basic properties and leave some properties "variable". With "variable" it is ment, that the user can change the propertie befor assigning the material, save the changed material under its old name and assign the material. The AfterAssignMaterial routine should then create a new material incorporating the "variable" propertie in the materials name (the new material is in a book hidden from the user) and assign the new material to the volume. The reason for that is, that the propertie is changed very often and always creating a new material manually is time consuming and there will be just to many materials. Unfortunately it seams impossible to use the "GiD_Process Mescape Data Materials AssignMaterial..." from within AfterAssignMaterial. Of course using it this way can lead into an infinity loop, but this should be managable. Is it possible to somehow enable the usage of AssignMaterial inside AfterAssignMaterial? Otherwise I think working with conditions might be best?
Thanks for your reply,
barnacle
I tried to use the AfterAssignMaterial function to create a new material entry and assign it then. This might sound a little strange, but I would like to give the user the ability to define a material having some basic properties and leave some properties "variable". With "variable" it is ment, that the user can change the propertie befor assigning the material, save the changed material under its old name and assign the material. The AfterAssignMaterial routine should then create a new material incorporating the "variable" propertie in the materials name (the new material is in a book hidden from the user) and assign the new material to the volume. The reason for that is, that the propertie is changed very often and always creating a new material manually is time consuming and there will be just to many materials. Unfortunately it seams impossible to use the "GiD_Process Mescape Data Materials AssignMaterial..." from within AfterAssignMaterial. Of course using it this way can lead into an infinity loop, but this should be managable. Is it possible to somehow enable the usage of AssignMaterial inside AfterAssignMaterial? Otherwise I think working with conditions might be best?
Thanks for your reply,
barnacle