navigate  
  Home
Contact Us
Store
Library
Forums
 
     

  Forums

Forums » Customization » Selection of a circle from a solid hole Messages in this topic - RSS
|
30.11.2004 05:47:34


Posts

I want to select a circle of a solid hole to retreive the matrix of the circle.


If you have a circle that don't belong to a solid, there is not problem, I can retreive the matrix.


But if the circle belong to a solid hole, the matrix is not good. I don't know how the position of the matrix is given ?


Do you have an idea of this problem?


Example:


// *************************************************
// Selection cercle de base
// *************************************************


CLEAR Hentite,NumId,Entype
HEntity Hentite
INT NumId,Entype


CLEAR cpmat
DOUBLE cpmat[0]
ARRAY cpmat[12]


CLEAR X,Y,Z,R,AG,AGD,TOL,TabCoord,TabBase
DOUBLE X,Y,Z,R,AG,AGD,TOL,TabCoord[0],TabBase[0]
ARRAY TabCoord[3]
ARRAY TabBase[3]


TOL=0.001


MASKENTITY 3


GETENT "Sélection du cercle :",Hentite
              
efM=@KEY">DefM=@KEY


If (@key==-2) {
    GOTO Debut
   }
If (@key==-3) {
    GOTO FINPROG
   }


// *** Matrice du cercle ****


    cpmat[0]=@matrix[0]
    cpmat[1]=@matrix[1]
    cpmat[2]=@matrix[2]
    cpmat[3]=@matrix[3]
    cpmat[4]=@matrix[4]
    cpmat[5]=@matrix[5]
    cpmat[6]=@matrix[6]
    cpmat[7]=@matrix[7]
    cpmat[8]=@matrix[8]
    cpmat[9]=@matrix[9]
    cpmat[10]=@matrix[10]
    cpmat[11]=@matrix[11]
    TabCoord[0]=cpmat[9]
    TabCoord[1]=cpmat[10]
    TabCoord[2]=cpmat[11]
   
    X=cpmat[9]
    Y=cpmat[10]
    Z=cpmat[11]
    R=@DBLDAT[0]
    AG =@DBLDAT[1]
    AGD=@DBLDAT[2]


    IF ((AG<TOL)&&AGD<TOL)) {
         PAUSE"Entité CERCLE"
               
         }
    ELSE {
          AG =ABS(AG)
          AGD=ABS(AGD)
          IF ((AG==180)&&AGD==180)) {
              PAUSE"Entité CERCLE"
             }
          ELSE {  
              PAUSE "Attention: entité ARC, Reselectionner SVP"
             // PAUSE"AG:%.2f AGD:%.2f",AG,AGD
             GOTO Debut
          }
    }
   

pages: 1
|

Forums » Customization » Selection of a circle from a solid hole