2.2.4.19.6 GraphObject::GetObjectType

Description

The type of the graphic object as a string.

Syntax

string GetObjectType( int * pnTypeID = NULL, BOOL bDetailedString = FALSE)

Parameters

pnTypeID
[output] type ID that can be used in CreateGraphObject
bDetailedString
[input] to specified result string if include more details.

Return

the string representing the type of the graphic object.

Examples

EX1

void    GraphObjectBase_GetObjectType_ex1()
{
    GraphPage gp;
    gp.Create("origin");
    GraphLayer        gl(gp.GetName(),0);
    GraphObject        grobj;
    
    // Loop over all the graphic objects in the layer and for each of them
    // display its type as string:
    foreach (grobj in gl.GraphObjects)
    {
        out_str(grobj.GetObjectType());
    }
}

EX2

void GraphObjectBase_GetObjectType_ex2()
{
   //before run, there should exit a layoutPage called "Layout1"
	Layout lay("Layout1");
	
	if(lay)
	{
		foreach(GraphObject go in lay.GraphObjects)
		{	
			int nTypeID;
			out_str( go.GetObjectType(&nTypeID, TRUE) )
		}
	}
}

Remark

See Also

Header to Include

origin.h