Regards @anoopXR6VK
With DE, I don't think it's possible directly. Since it always obtains the coordinates in the Universal system. Maybe moving your entire drawing to (0,0) and rotating it to coincide with the Y axis can achieve what you require.
Try this code to obtain the coordinate table of the insertion points of the texts in the current coordinate system, verified in the file you attached...
(Defun c:Coord_tx (/ LData ss i e tx ccoord X_ Y_ eData Obj_Table Tname crow)
(vl-load-com)
(if
(setq LData nil
ss (ssget '((0 . "MTEXT")))
)
(progn
(repeat (setq i (sslength ss))
(setq e (vlax-ename->vla-object (ssname ss (setq i (1- i))))
tx (vlax-get e 'textstring)
)
(if (= (atoi (substr tx 2 1)) 3)
(progn
(setq ccoord (trans (vlax-get e 'InsertionPoint) 0 1)
X_ (car ccoord)
Y_ (cadr ccoord)
eData (list tx X_ Y_)
LData (cons eData LData)
)
)
)
) ;repeat
(setq LData (vl-sort LData '(lambda (m n) (< (Car m) (car n)))))
(setq Obj_Table
(vlax-invoke
(vlax-get (vla-get-ActiveLayout
(vla-get-activedocument (vlax-get-acad-object))
)
'Block
)
'Addtable
(trans (getpoint "\nPick point for Table:") 1 0)
2
3
25
150
)
)
(setq Tname "COORDINATE TABLE")
(vla-settext Obj_Table 0 0 Tname)
(vla-setcelltextheight Obj_Table 0 0 8.0)
(mapcar '(lambda (y)
(vla-settext Obj_Table 1 (car y) (cadr y))
(vla-setcelltextheight Obj_Table 1 (car y) 8.0)
)
(list '(0 "Contents") '(1 "Position X") '(2 "Position Y"))
)
(foreach j LData
(vla-insertrows
Obj_Table
(1+ (setq crow (vla-get-rows Obj_Table)))
15
1
)
(vla-setcelltextheight Obj_Table crow 0 8.0)
(vla-setCellAlignment Obj_Table crow 0 5)
(vla-setCellValue Obj_Table crow 0 (car j))
(vla-setCellValue Obj_Table crow 1 (cadr j))
(vla-setCellValue Obj_Table crow 2 (caddr j))
(vla-setcelltextheight Obj_Table crow 1 8.0)
(vla-setcelltextheight Obj_Table crow 2 8.0)
(vla-setCellAlignment Obj_Table crow 1 5)
(vla-setCellAlignment Obj_Table crow 2 5)
(vla-setcellformat Obj_Table crow 1 "%lu2%pr3%ps[, m]")
(vla-setcellformat Obj_Table crow 2 "%lu2%pr3%ps[, m]")
)
(vla-setColumnWidth Obj_Table 1 100)
(vla-setColumnWidth Obj_Table 2 100)
)
)
(princ)
)
Carlos Calderon G
>Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.