Hi,
I am extracting the coordinates of a text layer through Data Extraction. I don't understand why the coordinate format in the extract don't match with what I see on screen.
This is what I see on screen:
This is the corresponding extracted value:
Any pointers on how I can get the extract in the same format visible on screen?
Thanks in advance!
Solved! Go to Solution.
Hi,
I am extracting the coordinates of a text layer through Data Extraction. I don't understand why the coordinate format in the extract don't match with what I see on screen.
This is what I see on screen:
This is the corresponding extracted value:
Any pointers on how I can get the extract in the same format visible on screen?
Thanks in advance!
Solved! Go to Solution.
Solved by calderg1000. Go to Solution.
post the dwg and explain what the data is relevant to, coordinate system, metric or imperial. any of that may help get a solution.
post the dwg and explain what the data is relevant to, coordinate system, metric or imperial. any of that may help get a solution.
Thanks for the response!
I have attached a sample of the dwg file.
The relevant layer is PVCase Stringing Numbers. I am looking to extract the geometric positions of these text fields. These represnt the electrical strings for a PV plant.
I have to dig deeper into what these coordinates represent. But a great first step would be to get the same output when I extract the data into an excel file (attached).
I hope this clear enough
Thanks for the response!
I have attached a sample of the dwg file.
The relevant layer is PVCase Stringing Numbers. I am looking to extract the geometric positions of these text fields. These represnt the electrical strings for a PV plant.
I have to dig deeper into what these coordinates represent. But a great first step would be to get the same output when I extract the data into an excel file (attached).
I hope this clear enough
What is the application you are using? I am unable to do anything with your file
What is the application you are using? I am unable to do anything with your file
Please click on continue opening DWG file..It should work normally, let me know if you are still facing issues
Please click on continue opening DWG file..It should work normally, let me know if you are still facing issues
2020
go back to post 3 image. recapture the full screen to include everything on the screen and post that.
That should show the software title & coordinate information
2020
go back to post 3 image. recapture the full screen to include everything on the screen and post that.
That should show the software title & coordinate information
Here you go. Hope this helps.
Here you go. Hope this helps.
Regards @anoopXR6VK
You are working with a relative coordinate system, it is rotated and with its origin at the point that I show in the image
That is why with ID, it shows you a value corresponding to the current system. But with DE, it shows you the value of its location in the Universal system.
Apply UCS->W->ENTER, Then PLANT->CURRENT UCS and you will be in the Universal system. Then by applying DE, you will already have coordinate matches.
But my question is which of the 2 coordinate values do you require. The universal or the relative...?
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.
Regards @anoopXR6VK
You are working with a relative coordinate system, it is rotated and with its origin at the point that I show in the image
That is why with ID, it shows you a value corresponding to the current system. But with DE, it shows you the value of its location in the Universal system.
Apply UCS->W->ENTER, Then PLANT->CURRENT UCS and you will be in the Universal system. Then by applying DE, you will already have coordinate matches.
But my question is which of the 2 coordinate values do you require. The universal or the relative...?
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.
@calderg1000 Thanks Carlos! This is very insightful.
Ideally I want the relative system in the DE as it is more intutive. Is there a way we can get the relative coordinates in the DE?
@calderg1000 Thanks Carlos! This is very insightful.
Ideally I want the relative system in the DE as it is more intutive. Is there a way we can get the relative coordinates in the DE?
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.
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.
Amazing! Thank you so much for this @calderg1000
Amazing! Thank you so much for this @calderg1000
Can't find what you're looking for? Ask the community or share your knowledge.