- UID
- 5043
- 积分
- 1347
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-5-13
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- #include "dblayout.h"
- #include "acaplmgr.h"
- #include "dbplotsetval.h"
- #include "dbplotsettings.h"
- // This is command 'MPLOTS'
- void mplotzzmplots()
- {
- AcApLayoutManager *pLayMan = NULL;
- pLayMan = (AcApLayoutManager *) acdbHostApplicationServices()->layoutManager();
- //get the active layout
- AcDbLayout *pLayout = pLayMan->findLayoutNamed(pLayMan->findActiveLayout(TRUE),TRUE);
- AcDbPlotSettings* pPlotSetting = (AcDbPlotSettings*)pLayout;
- char* mediaName;
- pPlotSetting->getCanonicalMediaName(mediaName);
- acutPrintf(" Media Name:%s", mediaName);
- char* styleSheetName;
- pPlotSetting->getCurrentStyleSheet(styleSheetName);
- acutPrintf(" StyleSheet Name:%s", styleSheetName);
- char* plotCfgname;
- pPlotSetting->getPlotCfgName(plotCfgname); // Output pointer to name of configured system or PC3 plot device
- acutPrintf(" PlotCfg Name:%s", plotCfgname);
- //get the PlotSettingsValidator
- AcDbPlotSettingsValidator *pPSV =NULL;
- pPSV = acdbHostApplicationServices()->plotSettingsValidator();
- //refresh the Plot Config list
- pPSV->refreshLists(pLayout);
- //get all the Plot Configurations
- AcArray< const char * > mDeviceList;
- pPSV->plotDeviceList(mDeviceList);
- acutPrintf(" Plot Configuration List :");
- int nLength = mDeviceList.length();
- char* localeName;
- pPSV->getLocaleMediaName(pLayout, 0, localeName);
- acutPrintf(" Cur Midia Name:%s", localeName);
- pPlotSetting->close();
- pLayout->close();
- return;
- for(int nCtr = 0;nCtr < nLength; nCtr++)
- {
- acutPrintf(" %i) - %s",(nCtr + 1), 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(" Select the Plot Configuration number to list the Media names: ", &nSel);
- if (nSel > nLength)
- {
- acutPrintf(" Enter 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
- AcArray< const char * > mMediaList;
- const char *pLocaleName;
- pPSV->canonicalMediaNameList(pLayout,mMediaList);
- acutPrintf(" Media list for Plot Configuration - %s:",mDeviceList.at(nSel));
- nLength = mMediaList.length();
- for(nCtr = 0;nCtr < nLength; nCtr++)
- {
- //get the localename
- pPSV->getLocaleMediaName(pLayout,mMediaList.at(nCtr),pLocaleName);
- acutPrintf(" %i) Name: %s Locale Name: %s ",(nCtr + 1),mMediaList.at(nCtr),pLocaleName);
- }
- mRes = RTNONE;
- while(RTNORM != mRes)
- {
- acedInitGet((RSG_NONULL + RSG_NONEG + RSG_NOZERO),NULL);
- mRes = acedGetInt(" Select the Media by entering the number: ", &nSel);
- if (nSel > nLength)
- {
- acutPrintf(" Enter a number between 1 to %i",nLength);
- mRes = RTNONE;
- }
- }
- //set selected Media for the layout
- pPSV->setCanonicalMediaName(pLayout,mMediaList.at(--nSel));
- pLayout->close();
- }
|
|