当前位置: 首页>>代码示例>>C++>>正文


C++ AcDbLayerTableRecord::setVPDFLT方法代码示例

本文整理汇总了C++中AcDbLayerTableRecord::setVPDFLT方法的典型用法代码示例。如果您正苦于以下问题:C++ AcDbLayerTableRecord::setVPDFLT方法的具体用法?C++ AcDbLayerTableRecord::setVPDFLT怎么用?C++ AcDbLayerTableRecord::setVPDFLT使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AcDbLayerTableRecord的用法示例。


在下文中一共展示了AcDbLayerTableRecord::setVPDFLT方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: acdbHostApplicationServices

// This function creates a new AcDbLayerTableRecord, fills
// it in, and adds it to the layer table
// 
// THE FOLLOWING CODE APPEARS IN THE SDK DOCUMENT.
//
void
addLayer()
{
    AcDbLayerTable *pLayerTbl;
    acdbHostApplicationServices()->workingDatabase()
        ->getSymbolTable(pLayerTbl, AcDb::kForWrite);

    if (!pLayerTbl->has(_T("ASDK_TESTLAYER"))) {
        AcDbLayerTableRecord *pLayerTblRcd
            = new AcDbLayerTableRecord;
        pLayerTblRcd->setName(_T("ASDK_TESTLAYER"));
        pLayerTblRcd->setIsFrozen(0);// layer to THAWED
        pLayerTblRcd->setIsOff(0);   // layer to ON
        pLayerTblRcd->setVPDFLT(0);  // viewport default
        pLayerTblRcd->setIsLocked(0);// un-locked

        AcCmColor color;
        color.setColorIndex(1); // set color to red
        pLayerTblRcd->setColor(color);

        // For linetype, we need to provide the object ID of
        // the linetype record for the linetype we want to
        // use.  First, we need to get the object ID.
	//
        AcDbLinetypeTable *pLinetypeTbl;
        AcDbObjectId ltId;
        acdbHostApplicationServices()->workingDatabase()
            ->getSymbolTable(pLinetypeTbl, AcDb::kForRead);
        if ((pLinetypeTbl->getAt(_T("DASHED"), ltId))
            != Acad::eOk)
        {
            acutPrintf(_T("\nUnable to find DASHED")
                _T(" linetype. Using CONTINUOUS"));
            
            // CONTINUOUS is in every drawing, so use it.
            //
            pLinetypeTbl->getAt(_T("CONTINUOUS"), ltId);
        }
        pLinetypeTbl->close();

        pLayerTblRcd->setLinetypeObjectId(ltId);
        pLayerTbl->add(pLayerTblRcd);
        pLayerTblRcd->close();
        pLayerTbl->close();
    } else {
        pLayerTbl->close();
        acutPrintf(_T("\nlayer already exists"));
    }
}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:54,代码来源:tablerec.cpp

示例2: CreateLayer

void CreateLayer()
{
	Acad::ErrorStatus es;
	ACHAR szNewName[255];
	_tcscpy(szNewName, _T("NewLayer"));

	AcDbDatabase* pCurDb = acdbHostApplicationServices()->workingDatabase();
	if (pCurDb == NULL)
	{
		acutPrintf(_T("\nError:Current database is NULL!"));
		return;
	}

	AcDbLayerTableRecord* pNewLayer = new AcDbLayerTableRecord;
	es = pNewLayer->setName(szNewName);
	if (es != Acad::eOk)
	{
		acutPrintf(_T("\nFailed setName of the layer!"));
		delete pNewLayer;
		return;
	}

	AcCmColor cmColor;
	cmColor.setColorIndex(1);
	pNewLayer->setColor(cmColor);

	pNewLayer->setIsFrozen(false);
	pNewLayer->setIsOff(false);
	pNewLayer->setVPDFLT(false);
	pNewLayer->setIsLocked(false);

	bool bStat = false;
	AcDbLayerTable* pLayerTbl = NULL;
	es = pCurDb->getLayerTable(pLayerTbl, AcDb::kForWrite);
	if (es == Acad::eOk)
	{
		if (pLayerTbl->has(szNewName))
		{
			acutPrintf(_T("\nThe Layer \"%s\" has existed!"), szNewName);
			delete pNewLayer;
		}
		else
		{
			es = pLayerTbl->add(pNewLayer);
			if (es == Acad::eOk)
			{
				bStat = true;
				pNewLayer->close();
			}
			else
			{
				acutPrintf(_T("\nFailed to add a new layer in LayerTable!"));
				delete pNewLayer;
			}
		}

		pLayerTbl->close();
	}

	if (bStat)
	{
		acutPrintf(_T("\nCreated the new layer: \"%s\" successfully!"), szNewName);
	}
	else
	{
		acutPrintf(_T("\nFailed to create the layer: \"%s\""), szNewName);
	}
}
开发者ID:kevinzhwl,项目名称:ZRXSDKMod,代码行数:68,代码来源:LayerSample.cpp


注:本文中的AcDbLayerTableRecord::setVPDFLT方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。