# Custom Concrete material \[SOLVED\]

**URL:** <https://femdesign.discourse.group/t/custom-concrete-material-solved/394>\
**Category:** Grasshopper\
**Tags:** solved\
**Created:** [31 October 2024 10:09 UTC](https://femdesign.discourse.group/t/custom-concrete-material-solved/394 "2024-10-31T10:09:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RJRJ](https://avatars.discourse-cdn.com/v4/letter/r/82dd89/32.png) [@RJRJ](https://femdesign.discourse.group/u/RJRJ)\
**Post date:** [31 October 2024 10:09 UTC](https://femdesign.discourse.group/t/custom-concrete-material-solved/394/1 "2024-10-31T10:09:52Z")

</div>

My question is regarding grasshopper component ‘CustomMaterial’. I want to create a custom concrete class with same strength as C45/55 but a modified density to match a specific geometry. However in the CustomMaterial component I do not get to insert the compressive strengths. I notice that a custom material created with this component appears under the category ‘General’ in the FEM model created with the script.  
Could you help me to create this custom concrete class right?

---

<div class="post-metadata">

**Author:** ![MarcoPelle](https://dub1.discourse-cdn.com/flex017/user_avatar/femdesign.discourse.group/marcopelle/32/6_2.png) [@MarcoPelle](https://femdesign.discourse.group/u/MarcoPelle)\
**Post date:** [31 October 2024 11:05 UTC](https://femdesign.discourse.group/t/custom-concrete-material-solved/394/2 "2024-10-31T11:05:37Z")

</div>

The easies and quick way to modify properties of an object is using a simple python script component.

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/femdesign_api/original/1X/95ae09ed7ec3bc0b126caeab47eb17dd81859ff4.png)

If you open a .struxml file format, the following code will look familiar as the material object follow what you see in the .struxml.

```python
import System.Guid
import copy

newConcrete = copy.deepcopy(x)
newConcrete.Concrete.Mass = mass
newConcrete.Guid = System.Guid("{53635D15-5696-47F2-9084-B63C7A00F970}")

```

[concreteMaterial.gh](https://femdesign.discourse.group/uploads/short-url/asvtvOjqbN5iRT3hgQutK9mq1Iu.gh) (52.5 KB)

---

<div class="post-metadata">

**Author:** ![RJRJ](https://avatars.discourse-cdn.com/v4/letter/r/82dd89/32.png) [@RJRJ](https://femdesign.discourse.group/u/RJRJ)\
**Post date:** [1 November 2024 14:44 UTC](https://femdesign.discourse.group/t/custom-concrete-material-solved/394/3 "2024-11-01T14:44:13Z")

</div>

Hi,

Could you let me know what the last line in the code does and where you get that GUID from? Also, this code seems to replace the original material in the library. Is there a way to save this new material as a custom made?

Thanks.

---

<div class="post-metadata">

**Author:** ![MarcoPelle](https://dub1.discourse-cdn.com/flex017/user_avatar/femdesign.discourse.group/marcopelle/32/6_2.png) [@MarcoPelle](https://femdesign.discourse.group/u/MarcoPelle)\
**Post date:** [1 November 2024 15:00 UTC](https://femdesign.discourse.group/t/custom-concrete-material-solved/394/4 "2024-11-01T15:00:33Z")

</div>

Sure @RJRJ !

Every material required a GUID (Global unique identifier) and I have generated one using an online tool. It is basically a random generated text.

If the material is being overwritten, try to specify a new name.

Example:

`newConcrete.Name = “C40/50_mass=0”`

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/femdesign_api/original/1X/17fc784a7857ebf342d11138fd9e19164083a3ef.png)

[concreteMaterial\_Rev1.gh](https://femdesign.discourse.group/uploads/short-url/9oLbenH7XH60lY1FQTovWf2JbRw.gh) (52.6 KB)

---

<div class="post-metadata">

**Author:** ![MarcoPelle](https://dub1.discourse-cdn.com/flex017/user_avatar/femdesign.discourse.group/marcopelle/32/6_2.png) [@MarcoPelle](https://femdesign.discourse.group/u/MarcoPelle)\
**Post date:** [5 November 2024 09:32 UTC](https://femdesign.discourse.group/t/custom-concrete-material-solved/394/5 "2024-11-05T09:32:18Z")

</div>

Navigating through a FEM-Design object is pretty simple as it reflects the .struxml data structure.

Assuming you are using a `material` as input in `x`, you can do:  
`x.Concrete.Gamma` to set the gamma values.

The intellisense should give you a preview of which properties you can set using the `dot` notation.

```xml
		<material guid="81b7ca1c-1b1a-4f4c-8ec0-cce7bbc8743d" last_change="2013-07-19T09:34:55.000" action="added" standard="EC" country="DK" name="C12/15">
			<concrete mass="2.54842" E_0="0" E_1="0" E_2="0" nu_0="0" nu_1="0" nu_2="0" alfa_0="0" alfa_1="0" alfa_2="0" G_0="0" G_1="0" G_2="0" Fck="12" Fck_cube="15" Fctk="1.1" Fctm="1.6" Ecm="27000" gammaC_0="1.5" gammaC_1="1.2" gammaCE="1.2" gammaS_0="1.15" gammaS_1="1.15" alfaCc="1" alfaCt="1" Fcd_0="0" Fcd_1="10" Fctd_0="0" Fctd_1="0.916666666666667" Ecd_0="0" Ecd_1="22500" Epsc2="0.002" Epscu2="0.0035" Epsc3="0.00175" Epscu3="0.0035" environment="0" creep="0" shrinkage="0" nu="0.2" alfa="0.00001">
				<plastic_analysis_data>
					<U elasto_plastic_behaviour="false" plastic_hardening="true" concrete_crushing="true" concrete_crushing_option="Prager" tension_strength="true" tension_stiffening="true" tension_stiffening_option="Hinton" tension_stiffening_param="0.5" reduced_compression_strength="true" reduced_compression_strength_option="Vecchio 1" reduced_compression_strength_param="0.55" reduced_transverse_shear_stiffnes="false" ultimate_strain="true"></U>
					<Sq elasto_plastic_behaviour="false" plastic_hardening="true" concrete_crushing="true" concrete_crushing_option="Prager" tension_strength="true" tension_stiffening="true" tension_stiffening_option="Hinton" tension_stiffening_param="0.5" reduced_compression_strength="true" reduced_compression_strength_option="Vecchio 1" reduced_compression_strength_param="0.55" reduced_transverse_shear_stiffnes="false" ultimate_strain="true"></Sq>
					<Sf elasto_plastic_behaviour="false" plastic_hardening="true" concrete_crushing="true" concrete_crushing_option="Prager" tension_strength="true" tension_stiffening="true" tension_stiffening_option="Hinton" tension_stiffening_param="0.5" reduced_compression_strength="true" reduced_compression_strength_option="Vecchio 1" reduced_compression_strength_param="0.55" reduced_transverse_shear_stiffnes="false" ultimate_strain="true"></Sf>
					<Sc elasto_plastic_behaviour="false" plastic_hardening="true" concrete_crushing="true" concrete_crushing_option="Prager" tension_strength="true" tension_stiffening="true" tension_stiffening_option="Hinton" tension_stiffening_param="0.5" reduced_compression_strength="true" reduced_compression_strength_option="Vecchio 1" reduced_compression_strength_param="0.55" reduced_transverse_shear_stiffnes="false" ultimate_strain="true"></Sc>
				</plastic_analysis_data>
			</concrete>
		</material>

```
