Updating the material name

Moderator: GiD Team

Post Reply
fcdiass
Posts: 16
Joined: Fri Nov 08, 2019 8:04 pm

Updating the material name

Post by fcdiass »

Hello,

I am developing a problem type with customlib. It is based on the 'cmas2d_customlib' example and inherited a problem with updating the material name.
For example, in the 'cmas2d_customlib' problem type:
  • When applying a 'Shells' condition, you need to choose a material in the list and apply it to a group:
    'Shells' condition
    'Shells' condition
    001.png (17.07 KiB) Viewed 2558 times
  • The resulting data tree is the following:
    Data tree after applying 'Shells' condition
    Data tree after applying 'Shells' condition
    002.png (44.26 KiB) Viewed 2558 times
  • But, if you change the name of the material after that, the 'Shells' condition does not automatically update:
    Data tree after changing the material name
    Data tree after changing the material name
    003.png (52.52 KiB) Viewed 2558 times
  • To update the material name in the 'Shells' condition, it is necessary to open 'Shells' and select the material again in the list:
    Choosing again the material name in the list
    Choosing again the material name in the list
    004.png (17.15 KiB) Viewed 2558 times
  • And only after that, the data tree is correct again:
    Finally the correct data tree with updated material name
    Finally the correct data tree with updated material name
    005.png (51.56 KiB) Viewed 2558 times
The same issue is found in the Kratos problem type, with the 'Parts' condition and the materials, but in this case, it is worse because the parameters are not updated too.
There is a more elegant way to update the 'Shells' condition automatically with the changes made in the materials?
There is a way to adapt the *.spd file (maybe with some help of TCL) to avoid this behavior?

Regards,
Francisco Dias
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: Updating the material name

Post by escolano »

Probably this better behaviour could be implemented in the problemtype with some dependency...

But it is not so common to rename an existing material that has been assigned.
e.g.
if you assign as 'concrete' an entity, and this 'concrete' is renamed to 'steel' and its properties are changed to steel values,
probably the user don't wanted this entity being like steel.

The common way is to create a new material, copying another (click the rigth-button-mouse over the material and select copy)
and then set the name an properties you want, and assign it to entities.

but I agree that renaming something the 'pointing' uses must be updated, if possible.
Post Reply