AttachXFunction
Attach an X-Function to the graphic object.
BOOL AttachXFunction( LPCSTR lpcszName, TreeNode & treeUserData = NULL, int nIndex = 0, DWORD dwCntrl = OCD_INITDATA )
TRUE if the named function is attached to the graphic object else FALSE.
EX1
// Sample expects a graph to be active and accepts the name of a graphic object (which must exist) // and the name of an XFunction appropriate to that object. For example : // OriginObject_AttachXFunction_Ex1(Rect, curve statistics) // attaches the "curve statistics" function to an object named "rect" void OriginObject_AttachXFunction_Ex1(string strObjName, string strXFuncName) { GraphLayer gl = Project.ActiveLayer(); if( gl ) { GraphObject grobj = gl.GraphObjects(strObjName); if(grobj) { if(grobj.AttachXFunction(strXFuncName)) { out_str("XF attached"); return; } } } out_str("Attach failed"); }
origin.h