---
title: "import"
excerpt: "Import a CAD file."
layout: manual
---

Import a CAD file.

For formats lacking unit data (such as STL, OBJ, or PLY files), the default unit of measurement is millimeters. Alternatively you may specify the unit by passing your desired measurement unit in the options parameter. When importing a GLTF file, the bin file will be imported as well. Import paths are relative to the current project directory.
Note: The import command currently only works when using the native Modeling App.

```js
import(file_path: String, options?: ImportFormat) -> ImportedGeometry
```

### Examples

```js
const model = import("tests/inputs/cube.obj")
```

![Rendered example of import 0](data:image/png;base64,[encoded data, 86120 characters])

```js
const model = import("tests/inputs/cube.obj", { type: "obj", units: "m" })
```

![Rendered example of import 1](data:image/png;base64,[encoded data, 86124 characters])

```js
const model = import("tests/inputs/cube.gltf")
```

![Rendered example of import 2](data:image/png;base64,[encoded data, 86120 characters])

```js
const model = import("tests/inputs/cube.sldprt")
```

![Rendered example of import 3](data:image/png;base64,[encoded data, 101388 characters])

```js
const model = import("tests/inputs/cube.step")
```

![Rendered example of import 4](data:image/png;base64,[encoded data, 102092 characters])

### Arguments

* `file_path`: `String` (REQUIRED)
* `options`: `ImportFormat` - Import format specifier (OPTIONAL)
```js
{
	type: "fbx",
} |
{
	type: "gltf",
} |
{
	// Co-ordinate system of input data. Defaults to the [KittyCAD co-ordinate system.
	coords: {
	// Axis the front face of a model looks along.
	forward: {
	// Axis specifier.
	axis: "y" | "z",
	// Specifies which direction the axis is pointing.
	direction: "positive" | "negative",
},
	// Axis pointing up and away from a model.
	up: {
	// Axis specifier.
	axis: "y" | "z",
	// Specifies which direction the axis is pointing.
	direction: "positive" | "negative",
},
},
	type: "obj",
	// The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc. Defaults to millimeters.
	units: "cm" | "ft" | "in" | "m" | "mm" | "yd",
} |
{
	// Co-ordinate system of input data. Defaults to the [KittyCAD co-ordinate system.
	coords: {
	// Axis the front face of a model looks along.
	forward: {
	// Axis specifier.
	axis: "y" | "z",
	// Specifies which direction the axis is pointing.
	direction: "positive" | "negative",
},
	// Axis pointing up and away from a model.
	up: {
	// Axis specifier.
	axis: "y" | "z",
	// Specifies which direction the axis is pointing.
	direction: "positive" | "negative",
},
},
	type: "ply",
	// The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc. Defaults to millimeters.
	units: "cm" | "ft" | "in" | "m" | "mm" | "yd",
} |
{
	type: "sldprt",
} |
{
	type: "step",
} |
{
	// Co-ordinate system of input data. Defaults to the [KittyCAD co-ordinate system.
	coords: {
	// Axis the front face of a model looks along.
	forward: {
	// Axis specifier.
	axis: "y" | "z",
	// Specifies which direction the axis is pointing.
	direction: "positive" | "negative",
},
	// Axis pointing up and away from a model.
	up: {
	// Axis specifier.
	axis: "y" | "z",
	// Specifies which direction the axis is pointing.
	direction: "positive" | "negative",
},
},
	type: "stl",
	// The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc. Defaults to millimeters.
	units: "cm" | "ft" | "in" | "m" | "mm" | "yd",
}
```

### Returns

`ImportedGeometry` - Data for an imported geometry.
```js
{
	// The ID of the imported geometry.
	id: uuid,
	// The original file paths.
	value: [string],
}
```



