// This is command 'CONFIGGS' void AsdkConfigGS() { const char* regEntry = NULL; char regPath[2024]; // Get the current AutoCAD registry path // e.g. Software\Autodesk\AutoCAD\R16.2\ACAD-301:409 regEntry = acrxProductKey(); // this is the path we want sprintf (regPath, "%s\\3DGS Configuration\\GSHEIDI10", regEntry); // get the GsManager from current MDI Client Window AcGsManager *pGsMgr = acgsGetGsManager (NULL); // if we go the gs manager ok if (pGsMgr != NULL) { // get the GsClass factory AcGsClassFactory *pClassFactory = pGsMgr->getGSClassFactory(); // if we got it ok if (pClassFactory != NULL) { // now get the gs config class AcGsConfig *pConfig = pClassFactory->getConfig(); // if we got this ok too if (pConfig != NULL) { // display the config dialog pConfig->configure (regPath, true); } } } }
CGraphListCtrl::CGraphListCtrl( ) { m_nItemCount = 0; // 左键图标框的索引位置 m_bAllowDefault = false; // 是否允许设置默认项 m_bAllowSel = true; // 是否允许选择 m_bShowCaption = false; // 是否显示标题 m_bSortByFixedRow = false; // 是否固定行,按列自由增减处理 m_nCurSel = -1; // 当前选择项 m_nCurDefault = -1; // 默认选项,绘制红旗标注,若没有设置为-1 m_nBarState = SB_VERT; // 控件的显示控制数据 m_nFixedRowNum = 2; // 固定行数 m_nFixedColNum = 2; // 固定列数 m_sizeItem = CSize(120, 120); // 每项尺寸 m_nCaptionHeight = 12; m_nMargin = 6; CDC* pDc = acedGetAcadFrame()->GetDC(); m_colBk = pDc->GetBkColor(); // 背景色 m_colText = pDc->GetTextColor(); // 文字颜色 m_colTextBk = GetSysColor(COLOR_MENU); // 文字背景色 m_font; // 用于控制tip的变量 m_nMouseItem = -1; m_nOldMouseItem = -1; // 用于控制滚动条的变量 m_nVScrollMax = -1; m_nHScrollMax = -1; // 成员 // 数据库 m_pCurDb = NULL; // 控制Item的显示 m_nRenderMode = AcGsView::k2DOptimized; m_viewVector = AcGeVector3d::kZAxis; m_bSetUserView = false; // m_pOwnerBtn = NULL;; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// BOOL bSuc = RegisterWindowClass(); NONCLIENTMETRICS ncm; ::ZeroMemory(&ncm, sizeof(NONCLIENTMETRICS)); ncm.cbSize = sizeof(NONCLIENTMETRICS); VERIFY(::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0)); m_font.CreateFontIndirect(&ncm.lfMenuFont); m_pOrbitModel = acgsGetGsManager()->createAutoCADModel(); ResetDefaultIcon(); }
CGraphListCtrl::~CGraphListCtrl() { DeleteAllItem(); m_TitleTip.DestroyWindow(); acgsGetGsManager()->destroyAutoCADModel(m_pOrbitModel); if (NULL != GetSafeHwnd()) { DestroyWindow(); } }
void Jig3d::init(const AcDbObjectId& idEntity,const AcGePoint3d& refPoint,int viewportNumber) throw(CmdException) { m_int.m_idEntity = idEntity; m_refPoint = refPoint; AcGsManager * pMan = acgsGetGsManager(); if (pMan==NULL) throw CmdException("Cannot get Gs manager"); AcGsView * pView = acgsGetGsView (viewportNumber, false); if (pView==0) throw CmdException("Perform this command in a 3d View. Use the shademode command to activate one."); m_MSBObjectID = GetModelSpaceBlockID(); if (m_MSBObjectID.asOldId() == 0) throw CmdException("Unable to retrieve modelspace block ID"); m_pModel = pMan->getDBModel(); if (m_pModel==NULL) throw CmdException("Unable to retrieve AcDb AcGsModel"); m_pModel->onAdded (&m_int, m_MSBObjectID.asOldId()); m_mode = kMove; }