iCAx开思网

标题: CAA中怎样得到工程图上点的坐标? [打印本页]

作者: fireghost    时间: 2005-9-5 11:00
标题: CAA中怎样得到工程图上点的坐标?
我在工程图中生成了一个点,然后想用鼠标点击选择,得到点的坐标,可是总出问题得不到,劳烦各位帮我看看,谢了~~
  
....
CATFeatureImportAgent * _ObjectAgent;
  
_ObjectAgent  = new CATFeatureImportAgent ( "ointAgent", NULL, NULL, NULL, NULL, NULL) ;
  
     _ObjectAgent -> SetElementType ( "CATI2DPoint"  );
     _ObjectAgent -> SetBehavior      ( CATDlgEngWithPrevaluation | CATDlgEngAcceptOnPrevaluate | CATDlgEngWithUndo | CATDlgEngWithPSOHSO | CATDlgEngOneShot);
     _ObjectAgent -> SetAgentBehavior ( MfPermanentBody  | MfLastFeatureSupport | MfRelimitedFeaturization );
  
     // Point selection state
     CATDialogState *pState1= GetInitialState("Select a point ");
     pState1 -> AddDialogAgent ( _ObjectAgent   );  
  
     //-----------------------------------------------------------------------------
     // Transitions
     AddTransition ( pState1 , NULL ,  
                     IsOutputSetCondition ( _ObjectAgent ) ,
                     Action ( ( ActionMethod ) [$DmCmd::GetPoint ) )]  
....
  
CATBoolean DmCmd::GetPoint( void *data )
{
      CATPathElement* iPath=NULL;
      iPath = _ObjectAgent->GetValue();
      CATBaseUnknown * pObject2D = _ObjectAgent->GetElementValue(iPath);
      CATMathPoint2D * pPoint = (CATMathPoint2D *) pObject2D;   
  
      x = pPoint->GetX();
      y = pPoint->GetY();
      
      _ObjectAgent -> InitializeAcquisition();   
     return TRUE;  
}
作者: fireghost    时间: 2005-9-5 22:38
已解决```
作者: zcsq    时间: 2005-9-9 16:57
怎样解决的呀,能否贴出来,共同学习呀?




欢迎光临 iCAx开思网 (https://www.icax.org/) Powered by Discuz! X3.3