// How I can get the coordinate of a position in an instance view in mode model
// but not in absolu of the layout.
// actually If I select a position in an active instance I have the
// XYZ coordinates of the layout but not the position on the model.
// -----------------------------------------------------------
// IN CK19 I have several funtions.
// ly_sel_instance "Select an instance view :", inst_id
//       For select a instance view
// ly_invpointtrans inst_id, X0, Y0, Z0, vX0, vY0, vZ0 
//       This function transform the coordinates 
//       wordl layout coordinates to Model coordinates  
// Do you have the same functions in KXL KC4.0 ?
:depart
// ********************************************************
//    Indiquer origine du repere
// ******************************************************** 
CLEAR hLocAnchor,hLabel,a,$Sdir1,$Sdir2
CLEAR xdir1,ydir1,zdir1,xdir2,ydir2,zdir2
HLOCATION hLocAnchor,hLabel
INT a
STRING $Sdir1,$Sdir2 
DOUBLE Xdir1,Ydir1,Zdir1,Xdir2,Ydir2,Zdir2
:_origine
a=3
GETPOS "Sélection de l'origine(0,0,0):",a,hLocAnchor
IF (@KEY==-2)
        GOTO FINPROG
IF (@KEY==-3)
        GOTO FINPROG
a=@KEY
LOCATIONCOORD hLocAnchor,XBASE,YBASE,ZBASE
    
$Sdir1="X"
$Sdir2="Y" 
:_origdir1        
GETPOS "Indiquer la position de l'axe X",a,hLocAnchor
IF (@KEY==-2)
        GOTO origine
IF (@KEY==-3)
        GOTO FINPROG
a=@KEY
LOCATIONCOORD hLocAnchor,Xdir1,Ydir1,Zdir1
GETPOS "Indiquer la position de l'axe Y",a,hLocAnchor
IF (@KEY==-2)
        GOTO origdir1
IF (@KEY==-3)
        GOTO FINPROG
a=@KEY
LOCATIONCOORD hLocAnchor,Xdir2,Ydir2,Zdir2
// *** coordonnees in the instance view *****
CLEAR TabCoord
DOUBLE TabCoord[0]
ARRAY TabCoord[3]
    TabCoord[0]=XBASE
    TabCoord[1]=YBASE
    TabCoord[2]=ZBASE
PAUSE "X:%.2f, Y:%.2f, Z:%.2f",TabCoord[0],TabCoord[1],TabCoord[2]
//    TRANSFORMATION IN MODE MODEL COORDINATES
PAUSE "X:%.2f, Y:%.2f, Z:%.2f",TabCoord[0],TabCoord[1],TabCoord[2]