Hello Johnson Shiue,
Thank you for your response.
Actually my requirement is to generate Thumbnails for all document types in structure files.
I got some piece of code from Online articles. But in below code I am able to generate Thumbnails only Part and Assemblies. I am not able to generate the Drawings(IDW) files.
Can you please suggest how to generate Thumbnails for Drawings(IDW) files.
string fileNameImage = "thumbnail.bmp";
string documentFolder = System.IO.Path.GetDirectoryName(document.FullFileName);
string imageFilename = System.IO.Path.Combine(documentFolder, fileNameImage);
if (document.DocumentType == DocumentTypeEnum.kPartDocumentObject)
{
Camera camera = m_server.TransientObjects.CreateCamera();
camera.SceneObject = (document as PartDocument).ComponentDefinition;
camera.ViewOrientationType = ViewOrientationTypeEnum.kIsoTopRightViewOrientation;
camera.Fit();
camera.ApplyWithoutTransition();
Color backgroundColor = m_server.TransientObjects.CreateColor(0xEC, 0xEC, 0xEC, 0.0);
camera.SaveAsBitmap(imageFilename, 512, 512, backgroundColor, backgroundColor);
}
if (document.DocumentType == DocumentTypeEnum.kAssemblyDocumentObject)
{
Camera camera = m_server.TransientObjects.CreateCamera();
camera.SceneObject = (document as AssemblyDocument).ComponentDefinition;
camera.ViewOrientationType = ViewOrientationTypeEnum.kIsoTopRightViewOrientation;
camera.Fit();
camera.ApplyWithoutTransition();
Color backgroundColor = m_server.TransientObjects.CreateColor(0xEC, 0xEC, 0xEC, 0.0);
camera.SaveAsBitmap(imageFilename, 512, 512, backgroundColor, backgroundColor);
}