Gatan | AMETEKSkip to Main Content
No options found

Iterate layouts

DigitalMicrograph Script

Command example showing how ImageDocument layouts are set.

Preview

ImageDocument doc = GetFrontImageDocument()
number nLO = doc.ImageDocumentGetLayoutCount()

Result( "\n Available layouts (" +  nLO + "):" )
For( number i=0; i < nLO; i++ )
{
    string layoutName = doc.ImageDocumentGetLayoutName( i )
    Result( "\n\t#" + i + ":" + layoutName )
}

For( number i=0; i < nLO; i++ )
{
    string layoutName = doc.ImageDocumentGetLayoutName( i )
    doc.ImageDocumentApplyLayout( layoutName )
    if ( TwoButtonDialog( "Applied '" + layoutName + "'.", "Keep it", "Next" ) )
		break
	OKDialog( "No more layouts available." )
}