# Blocks

Here is all you need to know about **using** and **creating blocks.**

### **Creating blocks**

In Rayon, **blocks allow grouping elements** and **saving them into your block library.** \
Once saved, you can create as many instances as you would like: each instance will remain tied to its definition, such that editing any block will affect all block instances in your model.

{% embed url="<https://player.vimeo.com/video/1028234092?autoplay=1&controls=0&loop=1&muted=1>" %}

To create a **new block**...

* **Select the elements** you want to save as a block.
* Click on the **`Block`** button (**`CMD`** + **`B`**) in the toolbar.
* Your **new block was added to your block library,** in the left-side panel.
* Click on the block name to **rename** it!
* **You can now drag and drop the block on your canvas** to insert as many instances as you want.

Alternatively, blocks can be created **through the import of DWG/DXF files**, as Rayon can detect AutoCAD blocks, and turn them automatically into Rayon blocks.

### Editing vs overriding blocks

Blocks can be either **edited** or **overridden**.

<figure><img src="https://2112124689-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FngVHKyaUSSJPTFck3wkz%2Fuploads%2FkgIYAanDxqMhLsgknHsP%2FFrame%201818%20(1).png?alt=media&#x26;token=8d43b82b-b737-41ff-84ee-32da8d626329" alt=""><figcaption></figcaption></figure>

**Editing** a block means editing its underlying block definition.&#x20;

* Any changes done in edit mode will be applied to all instances of that block in your model.&#x20;
* Editing can be accessed in the edit bar, through double-click on a block instance, or through hitting **`CMD`** + **`E`**.

**Overriding** a block means tuning the aspect (styles, text, and visibility) of a single block instance.&#x20;

* Any overrides applied to an instance will be carried by this instance, and only this one, while it will keep its tie to its definition.
* &#x20;Overriding can be accessed in the edit bar, or through hitting **`CMD`** + **`O`**.
* At any point, all overrides on a block can be reset, by hitting **`Reset all overrides`** (in the right click), or by hitting **`CMD`** + **`OPT`** + **`O`**.

**Making unique** a block means converting into its own definition.

* In other words, at any point, a block instance can be detached from its definition, and turned into its own, unique definition.
* The **`Make unique`** option can be accessed in the right click on block, or through hitting **`CMD`** + **`U`**

### Using the block panel

The block panel works with 2 tabs:

* **`In model blocks`** : this tab is where blocks stored in your current model, and that you have created are displayed
* **`Libraries`** : this tab gives you access to blocks contained in libraries you have created, or contained in Rayon libraries.&#x20;

**`In model blocks`** will display everything in your model. Any block stored there is called a block *definition*. It is the parent of all similar blocks (called instances) inserted on the canvas. Changing a definition (its geometry, its properties, etc) will affect all instances on the canvas.&#x20;

At any point, a definition can drag-dropped on the canvas to create **a block instance. Also, an instance can be swapped** for a different block from the **`definition`** property of the block section.&#x20;

{% embed url="<https://player.vimeo.com/video/1028234108?autoplay=1&controls=0&loop=1&muted=1>" %}

In the **`Libraries`** tab of the Block panel, typing (almost) any item name will return blocks out of Rayon's libraries or that of your organization. Rayon has built today more than 10k blocks, for all types of programs. All of them are accessible to you.

{% embed url="<https://player.vimeo.com/video/1028234119?autoplay=1&controls=0&loop=1&muted=1>" %}

In both tabs, you are also able to filter what appears, by using the filter feature in the panel header.

<figure><img src="https://2112124689-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FngVHKyaUSSJPTFck3wkz%2Fuploads%2FsA2mIHf4gJQ1OFsmelej%2FVincent-F-7%20(3).png?alt=media&#x26;token=afe937e8-f754-4e93-885c-a5400d220487" alt=""><figcaption></figcaption></figure>

### Block families <a href="#h_bc50d77b6b" id="h_bc50d77b6b"></a>

**Blocks can be grouped in Rayon, to gather blocks that belong together.** In Rayon's libraries, for instance, the different views of the same block are grouped as a family together.&#x20;

<figure><img src="https://2112124689-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FngVHKyaUSSJPTFck3wkz%2Fuploads%2FrH1TwQiyN3hnBrxBH7IT%2FVincent-F-7%20(18).png?alt=media&#x26;token=c6801e15-d7ec-4aa7-98ab-16b97b83cf3a" alt=""><figcaption></figcaption></figure>

In fact, **you can create your own families**. To create a block family, simply...

* Select any block definition, and in its option, click on **`Create family`**
* Now that a family is created, to add a new child to it, in the option of any other block, choose the option **`Add to family`**
* &#x20;Select the family to add to

{% embed url="<https://player.vimeo.com/video/1135706423?autoplay=1&controls=0&loop=1&muted=1>" %}

### Hosted blocks <a href="#h_bc50d77b6b" id="h_bc50d77b6b"></a>

**Blocks can also be hosted into walls**. \
A hosted block uses an **insertion line**, to specify how it should get inserted into a wall.&#x20;

To create a hosted block...

* **Select the elements** you want to save as a block.
* Click on the **`Block`** button (**`CTRL`** + **`B`**) in the toolbar.
* **Click on the block** and then on the **`Edit`** (**`E`**) button; now, **you will notice** **a white dot** in the middle of the block (this dot is its insertion point to the model).
* **Swap the dot with a line on the top right panel**, and click on **`Done`**.

That's it! Your opening block will now **punch a hole/snap on Rayon walls.**

{% embed url="<https://player.vimeo.com/video/1028234102?autoplay=1&controls=0&loop=1&muted=1>" %}

### Block's Bounding box controls <a href="#h_bc50d77b6b" id="h_bc50d77b6b"></a>

**Blocks** can have a fully functional **bounding box,** that allows for non-uniform resizing from the sides and uniform resizing from the corners. In  some cases it can be useful to hide those controls, for example with parametric blocks, which have specific grips to interact with the block in the intended way only.

In the right panel, when editing a block, under "Box corners" :

* You can choose to **show** or **hide** those controls.
* **Auto** will automatically hide the controls if the block is [parametric](https://docs.rayon.design/documentation/design/parametric-blocks).

<figure><img src="https://2112124689-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FngVHKyaUSSJPTFck3wkz%2Fuploads%2Feq8wS7ZgcMZ7c12yUmi2%2FVincent-F-7%20(1).png?alt=media&#x26;token=18dc4c3b-7188-4b88-85eb-9a5d50de8d89" alt=""><figcaption></figcaption></figure>

### Tutorial

For more step-by-step information, watch our tutorial about how to use and create blocks in Rayon:

{% embed url="<https://www.youtube.com/watch?v=OACQWvmFwSQ>" %}

***

### We are always available

Book a demo with our team, [right here](https://b1kzip68v9f.typeform.com/to/Hgr0eQ4k#source=docs).\
To get some support, reach out to us through our **in-app support chat**. \
More about [our support policy right here](https://docs.rayon.design/other-resources/others/support).
