Free Support Forum - aspose.com

Exception loading DXF into scene and then saving as FBX or GLB

Floorplan.zip (28.2 KB)

When I open the attached DXF file into a scene, then try to save that scene down as either FBX or GLB, I get an exception on save.

Code:
static void Main(string[] args)
{
Console.WriteLine(“Setting license”);
Aspose.ThreeD.License license = new Aspose.ThreeD.License();
license.SetLicense(“Aspose.3D.lic”);

		System.Reflection.Assembly asm = System.Reflection.Assembly.GetAssembly(typeof(Aspose.ThreeD.Scene));
		Console.WriteLine("Aspose.3d Version: " + asm.FullName);

		asm = System.Reflection.Assembly.GetAssembly(typeof(System.Int32));
		Console.WriteLine(".Net Core Version: " + asm.FullName);
		//TestGlbToFbx();
		//TestAddInfoToGLTF();

		ReadDXF();

	}

	private static void ReadDXF()
	{
		try
		{
			//string fileName = "First Floor.dxf";
			string fileName = "Floorplan.dxf";
			Console.WriteLine("Reading " + fileName);
			var scene = new Scene(fileName);
			Console.WriteLine("Done!");

			var saveOpts = new GLTFSaveOptions(FileFormat.GLTF2_Binary)
			{
				EmbedAssets = true,
				SaveExtras = true
			};
			scene.Save(fileName + ".glb", saveOpts);

			/*				
			var saveOpts = new FBXSaveOptions(FileFormat.FBX7500Binary);
			scene.Save(fileName+".fbx", saveOpts);
			*/
			Console.WriteLine("Saved!");
		}
		catch (Exception ex)
		{
			Console.WriteLine(ex.ToString());
		}
	}

output:

Setting license
Aspose.3d Version: Aspose.3D, Version=20.6.0.0, Culture=neutral, PublicKeyToken=f071c641d0b4582b
.Net Core Version: System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
Reading Floorplan.dxf
Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.1\System.Threading.Tasks.dll’. Skipped loading symbols. Module is optimized and the debugger option ‘Just My Code’ is enabled.
Done!
Exception thrown: ‘Aspose.ThreeD.ExportException’ in Aspose.3D.dll
Aspose.ThreeD.ExportException: Index was outside the bounds of the array.
at #=z32iZkSmwy3kMGgVyx1OURsA=.#=z5K_sjYk=(Scene #=zm80AxcI=, Stream #=zjB0naWY=, SaveOptions #=zyYz2LBg=, CancellationToken #=zVuHt_Aw=)
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=zmrEgXOt381z1gKYAfLYAsdU=(Object #=ztH9x5Sc=)
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=z8fncnd7qK4Jm3DWWkEgueA8=(MethodBase #=ztH9x5Sc=, Boolean #=zcR_K_UE=)
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=zkIJUvB_m5zH8SOEAAwq$XgQeSalk9UPZfNzdHeQ=(#=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc= #=ztH9x5Sc=, #=qPSXNICED2IJq3RchYggMCRrp7AqfltIRTCJhRGQGYW0= #=zcR_K_UE=)
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=zfHbgyZzj84qsdTCpaHQ0r9UnDqHZYYxWnwZw1CM=()
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=z2JyXpHSlm3dNLFziJ7zjaBk=(Boolean #=ztH9x5Sc=)
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=zmrEgXOt381z1gKYAfLYAsdU=(Object #=ztH9x5Sc=)
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=zFVC5ESZNmaKb6YCDd3JdwAU=()
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=zyOiu_uMCnbsHqadQ3sFkoQI=(Object #=ztH9x5Sc=, UInt32 #=zcR_K_UE=)
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=z2JyXpHSlm3dNLFziJ7zjaBk=(Boolean #=ztH9x5Sc=)
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=zhB1u6WXA575g0I0EJDpwq40CFn6zsbv9qRlRjxk=()
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=zwKvKvW7dwFMYfrbrObG3G1$eeGoUez77eGyzgr5mkb1R(Object[] #=ztH9x5Sc=, Type[] #=zcR_K_UE=, Type[] #=z$4vmEHE=, Object[] #=ztr42_T4=)
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=zAnW9ethtuNhiRwi05TH9O2wU6ww_FCSeEteo8$c=(Stream #=ztH9x5Sc=, Int32 #=zcR_K_UE=, Object[] #=z$4vmEHE=, Type[] #=ztr42_T4=, Type[] #=zwAVnpd4=, Object[] #=zpjS4L88=)
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=z$Dx6LYNqtuCiUjcesFr2K0_QBO4mr_Ffbg==(Int32 #=ztH9x5Sc=, Type[] #=zcR_K_UE=, Type[] #=z$4vmEHE=, Boolean #=ztr42_T4=)
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=zJd9pdjIan7Jpq0WfMdjXnKB27tzq(#=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc= #=ztH9x5Sc=, #=qPSXNICED2IJq3RchYggMCRrp7AqfltIRTCJhRGQGYW0= #=zcR_K_UE=)
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=zfHbgyZzj84qsdTCpaHQ0r9UnDqHZYYxWnwZw1CM=()
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=z2JyXpHSlm3dNLFziJ7zjaBk=(Boolean #=ztH9x5Sc=)
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc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q40CFn6zsbv9qRlRjxk=()
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=zwKvKvW7dwFMYfrbrObG3G1$eeGoUez77eGyzgr5mkb1R(Object[] #=ztH9x5Sc=, Type[] #=zcR_K_UE=, Type[] #=z$4vmEHE=, Object[] #=ztr42_T4=)
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=zsj8qRR0XPCaALL4rRS7ELRg=(Stream #=ztH9x5Sc=, String #=zcR_K_UE=, Object[] #=z$4vmEHE=, Type[] #=ztr42_T4=, Type[] #=zwAVnpd4=, Object[] #=zpjS4L88=)
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=zagvkw4ud1ZefR$JME0cC1BwmCx$u(Stream #=ztH9x5Sc=, String #=zcR_K_UE=, Object[] #=z$4vmEHE=)
at #=q2e4S1Bw3EJjc0D91VPHhciFrrc6lRBgLNjizuc6V_Hc=.#=z0n_AH7P0UQQ1olQ1wLXB6yc=(Stream #=ztH9x5Sc=, String #=zcR_K_UE=, Object[] #=z$4vmEHE=)
at Aspose.ThreeD.Scene.Save(String fileName, SaveOptions options, CancellationToken cancellationToken)
at Aspose3dTest.Program.ReadDXF() in D:\Projects\Aspose3dTest\Program.cs:line 49

@OBCad

We were able to notice the issue in our environment while testing the scenario using Aspose.3D for .NET 20.6. We have logged it as THREEDNET-691 in our issue tracking system. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

@OBCad

We would like to share with you that earlier logged ticket has been resolved in hotfix Aspose.3D for .NET 20.6.1. Please try using shared version of the API and in case you face any issue, please feel free to let us know.

The issues you have found earlier (filed as THREEDNET-691) have been fixed in Aspose.3D for Java 20.7.