DWG to GLB

Hi,

is there a way to preserve layer colours when exporting dwg to glb? The glb that I create is always in greyscale.

Thanks in advance,
Vukas

@vpajic,
Hello.
Please try if this is helpful:

using (Image cadImage = Aspose.CAD.Image.Load(fileName))
{
     CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
     rasterizationOptions.DrawType = CadDrawTypeMode.UseObjectColor;

     rasterizationOptions.PageWidth = 1600;
     rasterizationOptions.PageHeight = 1600;

     GlbOptions glbOptions = new GlbOptions();
     glbOptions.VectorRasterizationOptions = rasterizationOptions;

     cadImage.Save(outPath, glbOptions);
}

Hi @oleksii.gorokhovatskyi,

thanks for your quick reply!

Those were the same settings I used, but unfortunately the colours are only preserved when exporting to .pdf or .svg. When I inspect the output .glb file, it appears there is only one mesh that represents the entire drawing.

For reference, the test file I’m using is here: https://files.graebert.com/Marketing/Sample%20drawings/2019/Mechanical%20and%20Annotative.dwg

@vpajic,
we have created investigation issue CADNET-9826, will look what’s going on there during export.

1 Like

@vpajic,
we can confirm the issue with colors for saving to GLB, and will work on the implementation of this feature.

1 Like