> For the complete documentation index, see [llms.txt](https://docs.openbrim.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openbrim.org/developers/paramml-developer-guide/core-objects/base-core-object/extends.md).

# Extends

The "Extends" object allows to import and use an object created in the Library into another object. It does not facilitate communication between objects, but instead places all elements of the imported object directly into the object that it is extending.

The imported object must be a Group type and it has mandatory parameter names that are defined in the code of the object. If these parameters are not defined, they will be given a default value, which is the value defined in the main project.

This means that an object can inherit the properties and behavior of another object, allowing you to reuse code and create more organized and modular designs.

The child object (the one that extends another object) can inherit all the properties and behavior of the parent object, and it can also add, modify or override certain properties and behavior as needed. This helps to promote code reusability, reduces duplication, and makes it easier to maintain and update your code.

Additionally, another use of “Extends” is to eliminate the repetitive lines of code in different objects such as the same enumeration groups or Role=”Input” parameters. This is achieved by calling the object which contains the common parameter/object sets in the first line of the project using “Extends”. This feature supports the extension of more than one object in the first line.

**Example:**

```xml
<O N="Extends_Object1" T="Project" Category="Core Objects">
    <!-- created by ParamML Examples on 30.01.2023 -->
    <O N="Support_Condition_Inputs" T="Group" Label="degree of freedom">
        <P N="Tx" V="0" D="[Free=0/Fixed=1]Tx" Role="Input" Category="Support_Condition_Inputs" />
        <P N="Ty" V="1" D="[Free=0/Fixed=1]Ty" Role="Input" Category="Support_Condition_Inputs" />
        <P N="Tz" V="0" D="[Free=0/Fixed=1]Tz" Role="Input" Category="Support_Condition_Inputs" />
        <P N="Rx" V="1" D="[Free=0/Fixed=1]Rx" Role="Input" Category="Support_Condition_Inputs" />
        <P N="Ry" V="1" D="[Free=0/Fixed=1]Ry" Role="Input" Category="Support_Condition_Inputs" />
        <P N="Rz" V="1" D="[Free=0/Fixed=1]Rz" Role="Input" Category="Support_Condition_Inputs" />
    </O>
    <O T="Document">
        <O T="DocDesignCode" Obj="Support_Condition_Inputs" />
    </O>
</O>
```

We have an object that defines the "degrees of freedom" of the support components, and we require the parameters from this object in another component. By using the "Extends" object, we were able to access and utilize the required parameters.

```xml
<O N="Extends_Object2" T="Project" TransAlignRule="Right" Category="Core Objects">
    <!-- created by ParamML Examples on 30.01.2023 -->
    <O N="Internal" T="Unit" Length="Inch" Force="Kip" Angle="Degrees" Temperature="Fahrenheit" Time="Sec" />
    <O N="Geometry" T="Unit" Length="Feet" Force="Kip" Angle="Degrees" Temperature="Fahrenheit" Time="Sec" />
    <O N="Support_Inputs" T="Group">
        <P N="Support_Location" V="120" Role="Input" Category="Support_Inputs" />
        <P N="Support_length" V="24" Role="Input" Category="Support_Inputs" />
        <P N="Support_width" V="48" Role="Input" Category="Support_Inputs" />
        <P N="Support_thickness" V="36" Role="Input" Category="Support_Inputs" />
    </O>
    <O N="E_O" T="Group" Extends="Extends_Object1" Override="1">
        <P N="Tx" V="0" D="[Free=0/Fixed=1]Tx" />
        <P N="Ty" V="1" D="[Free=0/Fixed=1]Ty" />
        <P N="Tz" V="0" D="[Free=0/Fixed=1]Tz" />
        <P N="Rx" V="1" D="[Free=0/Fixed=1]Rx" />
        <P N="Ry" V="1" D="[Free=0/Fixed=1]Ry" />
        <P N="Rz" V="1" D="[Free=0/Fixed=1]Rz" />
    </O>
</O>
```

When we use the "Extends" object, we have the option to modify any aspect of the object being extended. This is done by using the "Override" keyword.

To view this example in the library, see (Extends\_Object1 → <https://openbrim.org/platform/?application=inc&author=ParamML_Examples_OpenBrIM+Platform&obj=objid1x81i7ubgb5y99lybsu8j&folder=Core+Objects> , Extends\_Object2 → <https://openbrim.org/platform/?application=inc&author=ParamML_Examples_OpenBrIM+Platform&obj=objidj7c8xf1grdpe30szf9czb&folder=Core+Objects>)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.openbrim.org/developers/paramml-developer-guide/core-objects/base-core-object/extends.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
