ICimDocument::SavePicture2

Use this method to capture the current document picture as a JPG file or PNG file (similar to taking a screenshot of current screen). The API defaults to JPG if no file extension is provided. 

Compatibility

Cimatron 2025 or later

Syntax

void SavePicture2(string iPath, int iWhiteBackground, double iImageQuality);

def SavePicture2(iPath : string, iWhiteBackground : int, iImageQuality : double)-> None

Return Type

Return: void  
   

Input Type

Input: string

iPath—Path and name of the picture 

Input: int

iWhiteBackground

  • 0—Use current background

  • 1—White background

Input: double

iImageQuality

  • 1—low

  • 2—medium

  • 3—high

Remarks

None

Example

interop.CimAppAccess.AppAccess aAppAccess = new interop.CimAppAccess.AppAccess();
interop.CimatronE.IApplication CimApp = (interop.CimatronE.IApplication)aAppAccess.GetApplication();
interop.CimatronE.ICimDocument aDocument = CimApp.GetActiveDoc();
int aWhiteBackground = 1;
double aImageQuality = 1;
if (aDocument != null)
{
aDocument.SavePicture2(@"C:\temp\part2.jpg", aWhiteBackground, aImageQuality);
}

import clr
#Adding references of required interop dlls
clr.AddReference("interop.CimAppAccess")
clr.AddReference("interop.CimatronE")
clr.AddReference("interop.CimServicesAPI")
clr.AddReference("interop.CimBaseAPI")
clr.AddReference("interop.CimMdlrAPI")

#importing modules from interop dlls
import interop.CimAppAccess
import interop.CimatronE
import interop.CimServicesAPI
import interop.CimBaseAPI
import interop.CimMdlrAPI

#Getting AppAccess Object
aCimAppAccess = interop.CimAppAccess.AppAccess()
#Getting instance of CimatronE Application
aCimApp = None
while (aCimApp == None) :
aCimApp = (interop.CimatronE.IApplication)(aCimAppAccess.GetApplication())
aDocument = (interop.CimatronE.ICimDocument)(aCimApp.GetActiveDoc())
if (aDocument != None) :
aDocument.SavePicture2("C:\temp\part2.jpg", 1, 1)