本文整理汇总了C++中CComObject::CreatePaletteATC方法的典型用法代码示例。如果您正苦于以下问题:C++ CComObject::CreatePaletteATC方法的具体用法?C++ CComObject::CreatePaletteATC怎么用?C++ CComObject::CreatePaletteATC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComObject
的用法示例。
在下文中一共展示了CComObject::CreatePaletteATC方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: asdkCreateTools
void asdkCreateTools()
{
CComObject<CBoltTool> tool;
// Create the stock tool (definition)
AcTcCatalog *pCatalog=tool.CreateStockToolATC(_T("BoltCatalog"));
if(!pCatalog)
{
acutPrintf("\nFailed to create the Stock Tool\n");
return;
}
// Create the 'BoltPalette'
AcTcPalette *pPalette=tool.CreatePaletteATC(pCatalog,_T("BoltPalette"));
if(!pPalette)
{
acutPrintf("\nFailed to create the Palette\n");
return;
}
// Create the shape package to hold the flyout tool definitions
AcTcPackage* pShapePackage=tool.CreateShapeCatalogATC(_T("Bolt Flyout Catalog"));
if(!pShapePackage)
{
acutPrintf("\nFailed to create the Shape Catalog\n");
return;
}
if(pShapePackage->GetChildCount()==0)
{
// Add two tools to this package
tool.New();//Set Default Values specified in the New override for this tool.
if(!tool.CreateToolATC(pShapePackage,_T("Stainless Bolt"),_T("IDB_BOLTIMAGE")))
acutPrintf("\nFailed to create a Tool instance\n");
// Now, create additional tools with different parameters:
tool.m_HeadSides=6;
tool.m_HeadHeight=2.5f;
tool.m_ShaftLength=12.0f;
tool.m_ShaftDiameter=3.0f;
tool.m_ThreadLength=3.5f;
tool.m_ThreadWidth=0.1f;
tool.m_HeadDiameter=7.0f;
tool.m_Color.setColorIndex(2);
_tcscpy(tool.m_MaterialName,_T("Aluminum"));
_tcscpy(tool.m_PartNumber,_T("Unassigned"));
if(!tool.CreateToolATC(pShapePackage,_T("Aluminum Bolt"),_T("IDB_BOLTALUMINUM")))
acutPrintf("\nFailed to create a Tool instance\n");
// A separate galvanized tool.
tool.m_HeadSides=6;
tool.m_HeadHeight=3.5f;
tool.m_ShaftLength=15.0f;
tool.m_ShaftDiameter=5.0f;
tool.m_ThreadLength=5.5f;
tool.m_ThreadWidth=0.3f;
tool.m_HeadDiameter=9.0f;
tool.m_Color.setColorIndex(4);
_tcscpy(tool.m_MaterialName,_T("Galvanized"));
_tcscpy(tool.m_PartNumber,_T("Unassigned"));
if(!tool.CreateToolATC(pShapePackage,_T("Galvanized"),_T("IDB_BOLTGALVANIZED")))
acutPrintf("\nFailed to create a Tool instance\n");
if(!tool.CreateCommandToolATC(pShapePackage,_T("BoltJig"),_T("IDB_BOLTJIG"),_T("^C^CBOLTJIG")))
acutPrintf("\nFailed to create the Command Tool instance\n");
}
// Now create a flyout tool, a regular tool, and a command tool on the palette.
tool.New();//reset the properties...
if(!tool.CreateFlyoutToolATC(pPalette,pShapePackage,"Bolt Flyout"))
acutPrintf("\nFailed to create a Flyout Tool instance\n");
if(!tool.CreateToolATC(pPalette,_T("Stainless Tool"),_T("IDB_BOLTIMAGE")))
acutPrintf("\nFailed to create a Shape Tool instance\n");
if(!tool.CreateCommandToolATC(pPalette,_T("BoltJig"),_T("IDB_BOLTJIG"),_T("^C^CBOLTJIG")))
acutPrintf("\nFailed to create a Shape Command Tool instance\n");
// Refresh the Tool Palette with the above changes.
AcTcGetManager()->LoadCatalogs(); // Refresh the Palette in the AutoCAD UI.
}