# Convert .dwg to .obj with javascript

**URL:** <https://discourse.threejs.org/t/convert-dwg-to-obj-with-javascript/3808>\
**Category:** Questions\
**Tags:** obj-format, dwg-format, loaders\
**Created:** [August 16, 2018, 3:41pm UTC](https://discourse.threejs.org/t/convert-dwg-to-obj-with-javascript/3808 "2018-08-16T15:41:13Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sofia\_Ribeiro](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Sofia\_Ribeiro](https://discourse.threejs.org/u/Sofia_Ribeiro)\
**Post date:** [August 16, 2018, 3:41pm UTC](https://discourse.threejs.org/t/convert-dwg-to-obj-with-javascript/3808/1 "2018-08-16T15:41:13Z")

</div>

Hello,

I want to load a .dwg file to three.js. But since three.js can’t load those files, I was trying to convert to .obj in javascript, how can I do it?

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [August 16, 2018, 3:54pm UTC](https://discourse.threejs.org/t/convert-dwg-to-obj-with-javascript/3808/2 "2018-08-16T15:54:13Z")

</div>

3ds Max is able to import `DWG` files. You can then perform an export to `OBJ`.

> **[Importing the DWG File | 3ds Max | Autodesk Knowledge Network](https://knowledge.autodesk.com/support/3ds-max/getting-started/caas/CloudHelp/cloudhelp/2015/ENU/3DSMax-Tutorial/files/GUID-607F5AFB-DACF-42D7-A506-019EC7223D01-htm.html)**
>
> You are now ready to import the AutoCAD file into 3ds Max and use it to create the general structure of the 3D room. Set up the units: The AutoCAD file you are importing is measured in feet and inches. It is best to use the same units setting in 3ds...

---

<div class="post-metadata">

**Author:** ![Sofia\_Ribeiro](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Sofia\_Ribeiro](https://discourse.threejs.org/u/Sofia_Ribeiro)\
**Post date:** [August 16, 2018, 4:01pm UTC](https://discourse.threejs.org/t/convert-dwg-to-obj-with-javascript/3808/3 "2018-08-16T16:01:48Z")

</div>

Sorry, I forgot to say, I’m trying to do this with javascript 😕 @Mugen87

---

<div class="post-metadata">

**Author:** ![pailhead](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/pailhead/32/85_2.png) [@pailhead](https://discourse.threejs.org/u/pailhead)\
**Post date:** [August 16, 2018, 5:15pm UTC](https://discourse.threejs.org/t/convert-dwg-to-obj-with-javascript/3808/4 "2018-08-16T17:15:28Z")

</div>

3ds max used to cost around $4000, but I think nowadays you can subscribe to it.

Either way it might be too much $$$ to convert some file to be used with some open source library. I don’t think that @Mugen87 advice is feasible for this.

. Dwg is a closed format I think, you need to search for some utilities that can convert it or try to save to something else (dxf for example).

---

<div class="post-metadata">

**Author:** ![pailhead](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/pailhead/32/85_2.png) [@pailhead](https://discourse.threejs.org/u/pailhead)\
**Post date:** [August 16, 2018, 5:17pm UTC](https://discourse.threejs.org/t/convert-dwg-to-obj-with-javascript/3808/5 "2018-08-16T17:17:39Z")

</div>

> **[LibreCAD/LibreCAD](https://github.com/LibreCAD/LibreCAD)**
>
> LibreCAD is a cross-platform 2D CAD program written in C++11 using the Qt framework. It can read DXF and DWG files and can write DXF, PDF and SVG files. The user interface is highly customizable, a...

Something like this perhaps, seems like it could maybe convert it to svg. It does not cost $4000.

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [August 16, 2018, 5:47pm UTC](https://discourse.threejs.org/t/convert-dwg-to-obj-with-javascript/3808/6 "2018-08-16T17:47:59Z")

</div>

There is a free trial version of 3ds Max. If you just need to convert files once, it might be worth to give it a try.

> [@Sofia\_Ribeiro](#):
>
> Sorry, I forgot to say, I’m trying to do this with javascript

Parsing CAD files is very complicated. There are no loaders for other popular CAD formats like STEP or IGES because of this. I highly recommend to convert such files with a tool in advance.

---

<div class="post-metadata">

**Author:** ![Sofia\_Ribeiro](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Sofia\_Ribeiro](https://discourse.threejs.org/u/Sofia_Ribeiro)\
**Post date:** [August 17, 2018, 2:48pm UTC](https://discourse.threejs.org/t/convert-dwg-to-obj-with-javascript/3808/7 "2018-08-17T14:48:13Z")

</div>

I’d like to do that, I have 3DsMax so that’s no a problem. The thing is I’m developing a react app and I’m using three.js to show the 3D object that comes from an API in a zip with a dwg file. That’s the reason why I can’t just use a tool @Mugen87 @pailhead

---

<div class="post-metadata">

**Author:** ![Andrii\_Halashevskyi](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/andrii_halashevskyi/32/5900_2.png) [@Andrii\_Halashevskyi](https://discourse.threejs.org/u/Andrii_Halashevskyi)\
**Post date:** [October 1, 2019, 9:43am UTC](https://discourse.threejs.org/t/convert-dwg-to-obj-with-javascript/3808/8 "2019-10-01T09:43:32Z")

</div>

Hi! I am creating a react app too. My application will convert CAD files with models to an arcGis map. Did you find a solution with exporting CAD in threejs friendly formats? I would be very grateful for the advice)

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [October 1, 2019, 9:44am UTC](https://discourse.threejs.org/t/convert-dwg-to-obj-with-javascript/3808/9 "2019-10-01T09:44:27Z")

</div>

I’m not aware of a JavaScript solution for converting DWG to OBJ.

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [May 31, 2021, 8:03am UTC](https://discourse.threejs.org/t/convert-dwg-to-obj-with-javascript/3808/11 "2021-05-31T08:03:32Z")

</div>

No sorry. I have never worked with Forge or DWG.

---

<div class="post-metadata">

**Author:** ![Parisa\_Shahbazi](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/parisa_shahbazi/32/43776_2.png) [@Parisa\_Shahbazi](https://discourse.threejs.org/u/Parisa_Shahbazi)\
**Post date:** [June 30, 2024, 5:19am UTC](https://discourse.threejs.org/t/convert-dwg-to-obj-with-javascript/3808/12 "2024-06-30T05:19:29Z")

</div>

Hi  
Did you find any way?
