zwcad获取打印样式和打印设备(如果是CAD,将zw换成ac即可)

来源:互联网 发布:张艺兴凝血障碍知乎 编辑:程序博客网 时间:2024/06/03 00:05

ZcApLayoutManager *pLayMan = NULL;
    pLayMan = (ZcApLayoutManager *) zcdbHostApplicationServices()->layoutManager();
    ZcDbLayout *pLayout = pLayMan->findLayoutNamed(pLayMan->findActiveLayout(TRUE),TRUE);
 ZcDbPlotSettingsValidator *pPSV =NULL;
    pPSV = zcdbHostApplicationServices()->plotSettingsValidator(); 
    pPSV->refreshLists(pLayout);   
    ZcArray< const char * > mDeviceList;
    pPSV->plotDeviceList(mDeviceList);  
    int nCtr,nLength = mDeviceList.length();  
  
    for( nCtr = 0;nCtr < nLength; nCtr++)
    {
  m_comDevice.AddString(mDeviceList.at(nCtr));      
    } 
    /*  
    //get the user input for listing the Media Names
    int nSel;
    int mRes =  RTNONE;   
    while(RTNORM != mRes)
    {
        acedInitGet((RSG_NONULL + RSG_NONEG + RSG_NOZERO),NULL);
        mRes = acedGetInt("\nSelect the Plot Configuration number to list the Media names: ", &nSel);
        if (nSel > nLength)
        {
            acutPrintf("\nEnter a number between 1 to %i",nLength);
            mRes = RTNONE;
        }
    }
   
    //select the selected Plot configuration
    pPSV->setPlotCfgName(pLayout,mDeviceList.at(--nSel));
    //list all the paper sizes in the given Plot configuration
 */

    ZcArray< const char * > mMediaList;
   
    pPSV->plotStyleSheetList(mMediaList);   
 
    nLength = mMediaList.length();
    for(nCtr = 0;nCtr < nLength; nCtr++)
    {      
  this->m_comStyleSheet.AddString(mMediaList.at(nCtr));
    } 
    pLayout->close();

原创粉丝点击