When creating your node, you might need to add an attribute holding multiple fields like can be a position attribute or a vector attribute .
There are two main way in order to accomplish that (as far as i know ).
1) Compound attribute
2) Point attribute
The compound attribute let you creates many attributes and then group them together like in the example 1:
example 1 ) I created an output attribute for holding vector data
//Output vector attribute
//Creating 3 single attributes vectorX,Y,Z
MFnNumericAttribute oVecXAttr;
oVecX= oVecXAttr.create("vectorX","vx",MFnNumericData::kFloat);
addAttribute(oVecX);
MFnNumericAttribute oVecYAttr;
oVecY= oVecYAttr.create("vectorY","vy",MFnNumericData::kFloat);
addAttribute(oVecY);
MFnNumericAttribute oVecZAttr;
oVecZ= oVecZAttr.create("vectorZ","vZ",MFnNumericData::kFloat);
addAttribute(oVecZ);
//Output vector compound attribute
//Group them togheter with a compound attribute
MFnCompoundAttribute FoVec;
oVec= FoVec.create("outputVector","ov");
//use addChild method to add our attributes to the compound attribute
FoVec.addChild(oVecX);
FoVec.addChild(oVecY);
FoVec.addChild(oVecZ);
addAttribute(oVec);
The point attribute make everything faster , you can achieve same result with way fewer lines of codes check example 2:
example 2)
//Create a numeric attribute function set
MFnNumericAttribute originFn;
 
// instead using create() we will use createPoint()
origin=originFn.createPoint("origin","o");
addAttribute(origin);
The main difference here is that using createPoint() method will automatically create originX originY and originZ so if that s the goal you want to achieve I highly suggest using createPoint() method if you want to have attributes that are not X,Y,Z or have different names or are more than 3 use the compound attribute function set .
enjoy .
For more tips and tricks visit :
http://www.giordanoanimator.com/tips.php
Share and Enjoy