# SetSelectedDrawing(ReadOnlySpan<PhysicsJoint>, bool)

> Set the selected drawing state on a batch of joints.

## Definition

* **Type:** Method
* **Namespace:** [Unity.U2D.Physics](/engine/6000.7/script-reference/unity/u2d/physics.md)
* **Assembly:** UnityEngine.PhysicsCore2DModule

```csharp
public static int SetSelectedDrawing(ReadOnlySpan<PhysicsJoint> joints, bool selected)
```

### Parameters

**** (\[ReadOnlySpan\<PhysicsJoint>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The joints to set the selected drawing state on.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): The selected drawing state to set on every joint.

### Returns

| Type                                                       | Description                                                                                                                      |
| ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The number of joints that were ignored (not set because the joint was invalid). A single warning is logged when any are ignored. |

### Remarks

The joints can belong to different worlds; the world of each joint is locked only when it changes across the batch, so joints should be ordered by world for the fewest locks. Any invalid joint in the batch is ignored. See [\_selectedDrawing](/engine/6000.7/script-reference/unity/u2d/physics/physicsjoint/selecteddrawing.md) for what the state controls.
