i am trying to create a simple 3d space in unity where a user is able to import a dxf file, the dxf will have a coordinate system so it will also be useful for the camera to go where the dxf is located. for now i only got the script onclick to browse the user's PC but i have no idea how to update the unity 3d space to import external dxf files
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
public class importDtm : MonoBehaviour, IPointerClickHandler
{
public void OnPointerClick(PointerEventData eventData)
{
string path = EditorUtility.OpenFilePanel("insert pit shell", "", "dxf");
}
}
On the Unity3d community page you can find the following sample code of el anónimo. It shows how to import an .obj file in the game. ObjImporter
Unity also supports other formats like .fbx, .dae, .3ds and .dxf. But it is not recommended to load these formats in the game. See entry of Programmer Dealing with autocad objects in Unity.