Message 1 of 1
arraray function

Not applicable
01-21-2003
12:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I would like to make an array that would input this information.
AcDbLayerTable *pLayerTbl;
acdbHostApplicationServices()->workingDatabase()
->getSymbolTable(pLayerTbl, AcDb::kForWrite);
if (!pLayerTbl->has("cde-code-clerance")) {
AcDbLayerTableRecord *pLayerTblRcd
= new AcDbLayerTableRecord;
pLayerTblRcd->setName("cde-code-clerance");
pLayerTblRcd->setIsFrozen(0);// layer to THAWED
pLayerTblRcd->setIsOff(0); // layer to ON
pLayerTblRcd->setVPDFLT(0); // viewport default
pLayerTblRcd->setIsLocked(0);// un-locked
pLayerTblRcd->setIsPlottable(0); //layer not to be plotted
AcCmColor color;
color.setColorIndex(241); // set colorte
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("CONTINUOUS", ltId))
!= Acad::eOk)
{
acutPrintf("\nUnable to find CONTINUOUS"
" linetype. Using CONTINUOUS");
// CONTINUOUS is in every drawing, so use it.
//
pLinetypeTbl->getAt("CONTINUOUS", ltId);
}
pLinetypeTbl->close();
pLayerTblRcd->setLinetypeObjectId(ltId);
pLayerTbl->add(pLayerTblRcd);
pLayerTblRcd->close();
pLayerTbl->close();
} else {
pLayerTbl->close();
acutPrintf("\nlayer already exists");
}
AcDbLayerTable *pLayerTbl;
acdbHostApplicationServices()->workingDatabase()
->getSymbolTable(pLayerTbl, AcDb::kForWrite);
if (!pLayerTbl->has("cde-code-clerance")) {
AcDbLayerTableRecord *pLayerTblRcd
= new AcDbLayerTableRecord;
pLayerTblRcd->setName("cde-code-clerance");
pLayerTblRcd->setIsFrozen(0);// layer to THAWED
pLayerTblRcd->setIsOff(0); // layer to ON
pLayerTblRcd->setVPDFLT(0); // viewport default
pLayerTblRcd->setIsLocked(0);// un-locked
pLayerTblRcd->setIsPlottable(0); //layer not to be plotted
AcCmColor color;
color.setColorIndex(241); // set colorte
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("CONTINUOUS", ltId))
!= Acad::eOk)
{
acutPrintf("\nUnable to find CONTINUOUS"
" linetype. Using CONTINUOUS");
// CONTINUOUS is in every drawing, so use it.
//
pLinetypeTbl->getAt("CONTINUOUS", ltId);
}
pLinetypeTbl->close();
pLayerTblRcd->setLinetypeObjectId(ltId);
pLayerTbl->add(pLayerTblRcd);
pLayerTblRcd->close();
pLayerTbl->close();
} else {
pLayerTbl->close();
acutPrintf("\nlayer already exists");
}