void AsdkAcUiDialogSample::OnButtonAngle() 
{
    // Hide the dialog and give control to the editor
    BeginEditorCommand();

    // Setup the default point for picking an angle
    // based on the m_strXPt, m_strYPt and m_strZPt values
    ads_point pt; 
    acdbDisToF(m_strXPt, -1, &pt[X]);
    acdbDisToF(m_strYPt, -1, &pt[Y]);
    acdbDisToF(m_strZPt, -1, &pt[Z]);
    
    double angle;

    // Get a point from the user
    if (acedGetAngle(pt, "\nPick an angle: ", &angle) == RTNORM) {
        // If we got an angle, go back to the dialog
        CompleteEditorCommand();
        // Convert the acquired radian value to degrees since the 
        // AcUi control can convert that to the other formats.
        m_strAngle.Format("%g", angle*(180.0/PI));
        DisplayAngle();
    } else {
        // otherwise cancel the command (including the dialog)
        CancelEditorCommand();
    }

}
void
ArxDbgUiTdmTransDbClones::getBasePoint(AcGePoint3d& basePt)
{
	BeginEditorCommand();

	ArxDbgUiPrPoint prPt(_T("Base point"), NULL);
	if (prPt.go() == ArxDbgUiPrPoint::kOk)
		basePt = ArxDbgUtils::ucsToWcs(prPt.value());

	CompleteEditorCommand();
}
Exemplo n.º 3
0
void PPPDlg::OnBnClickedPppPtBtn()
{
    BeginEditorCommand();
    AcGePoint3d pt;
    ArxUtilHelper::PromptPt( _T( "\n请选择插入点坐标: " ), pt );
    CompleteEditorCommand();

    m_xPos = pt.x;
    m_yPos = pt.y;
    m_zPos = pt.z;
    UpdateData( FALSE );
}
void
ArxDbgUiTdmTransDbClones::addToCloneSet(ArxDbgCloneSet& cloneSet)
{
	BeginEditorCommand();

	ArxDbgSelSet ss;
	if (ss.userSelect() != ArxDbgSelSet::kSelected) {
		CompleteEditorCommand();
		return;
	}

	AcDbObjectIdArray objIds;
	ss.asArray(objIds);

	cloneSet.addObjects(objIds);

	CompleteEditorCommand();
}
void AsdkAcUiDialogSample::OnButtonPoint() 
{
    // Hide the dialog and give control to the editor
    BeginEditorCommand();

    ads_point pt;

    // Get a point
    if (acedGetPoint(NULL, "\nPick a point: ", pt) == RTNORM) {
        // If the point is good, continue
        CompleteEditorCommand();
        m_strXPt.Format("%g", pt[X]);
        m_strYPt.Format("%g", pt[Y]);
        m_strZPt.Format("%g", pt[Z]);
        DisplayPoint();
    } else {
        // otherwise cancel the command (including the dialog)
        CancelEditorCommand();
    }

}
Exemplo n.º 6
0
void CDlgReadInfo::OnBnClickedBtnSelect()
{
	//交互选择实体
	BeginEditorCommand();

	CString strCadName;
	CComboBox* pCmb = (CComboBox*)GetDlgItem(IDC_COMBO_CADLY);
	pCmb->GetLBText(pCmb->GetCurSel(),strCadName);

	
	ads_name ssName;
	struct resbuf *filter=NULL;
	if(strCadName.CompareNoCase("所有图层") != 0)
	{
		filter=acutNewRb(AcDb::kDxfLayerName);
		filter->restype=AcDb::kDxfLayerName;
		filter->resval.rstring = (char*) malloc((strCadName.GetLength()+1)*sizeof(char));
		strcpy(filter->resval.rstring,strCadName.GetBuffer(0));
		filter->rbnext=NULL;
	}
	
	if (acedSSGet(":S", NULL, NULL, filter, ssName) != RTNORM)
	{
		acutPrintf("\n选择实体有误!");
		acedSSFree(ssName); acutRelRb(filter);
		CompleteEditorCommand();
		return;
	}
	if(filter != NULL) acutRelRb(filter);

	AcDbObjectId tempObjId;
	ads_name ssTemp;
	long nNum = 0;
	int nPos = 0;
	acedSSLength(ssName,&nNum);
	CString strSdeName,strId,strRowId;

	m_wndTree.DeleteAllItems();

	// 清空属性列表
	ResetListItems();

	for(int i=0; i<nNum; i++)
	{
		acedSSName(ssName, i, ssTemp);
		if(Acad::eOk != acdbGetObjectId(tempObjId, ssTemp)) continue;
		strId.Format("%d",tempObjId.asOldId());
		CDistXData tempXData(tempObjId,"ROWID_OBJS");
		if(tempXData.Select("SDELYNAME",strSdeName)==FALSE) continue;
		if(tempXData.Select("OBJECTID",strRowId)==FALSE) continue;
		tempXData.Close();

		HTREEITEM hItem = m_wndTree.InsertItem(strId);

		AcDbEntity *pEnt = NULL;
		if (Acad::eOk != acdbOpenObject(pEnt, tempObjId, AcDb::kForRead))
		{
			return;
		}
		pEnt->close();

		ITEM_DATA xxItemData;
		xxItemData.strID = strId;
		xxItemData.strSdelayerName = strSdeName;
		xxItemData.strCadLayerName = pEnt->layer();
		xxItemData.strRowId = strRowId;

		mapItemData[strId] = xxItemData;

		nPos++;
	}
	
	acedSSFree(ssName);

	CompleteEditorCommand();

	if (m_wndTree.GetCount() <= 0)
	{
		return;
	}

	HTREEITEM hItem = m_wndTree.GetFirstVisibleItem();

	// 显示属性
	OnSelectChanged(hItem);
}