The Courage Dog Posted July 8, 2008 Posted July 8, 2008 Hi, is anybody know the techniques or lisp on how to hyperlink coordinates into table? i mean when you try to generate x & y coordinates by clicking point it will update the table automatically, something like this.......instead of getting the x & y coordinates copy & paste it to table, that is annoying.... your expertise is higly appreciated... Thanks, jake Quote
ASMI Posted July 8, 2008 Posted July 8, 2008 Is that points 'point' entity or something else? For example block insertion points? You can insert field inside table (see drawing). It's not so hard to write lisp which will to insert coodinates to table very quickly (pick point - pick table cell or pick first cell and pick many poits to fill table automatically) but need some more info, for example *.dwg. Coordinates.dwg Quote
The Courage Dog Posted July 8, 2008 Author Posted July 8, 2008 there are no points or blocks on each corner of the polyline. What i i have is only polyline, i just picking each corners & center of arc. Do i have to create POINT on each corner of the polyline? or you have a lisp by just picking the polyline & it will generate X & y coordinates to the table. Quote
ASMI Posted July 8, 2008 Posted July 8, 2008 Do i have to create POINT on each corner of the polyline? Why not? (defun c:ppoint() (and (setq cLp(entsel "\nSelect LwPoliline > ")) (= "LWPOLYLINE"(cdr(assoc 0(setq cLp(entget(car cLp)))))) (mapcar '(lambda(x)(vl-cmdf "_.point" x))(mapcar 'cdr (vl-remove-if-not '(lambda(a)(= 10(car a)))cLp))) ); end and (princ) ); end of c:ppoint or you have a lisp by just picking the polyline & it will generate X & y coordinates to the table. I haven't but can to write. Quote
The Courage Dog Posted July 8, 2008 Author Posted July 8, 2008 please if you have the time to write the code (about picking a polyline & it will generate x & y coordinates & link it to table automatically) can i have the copy. thanks Asmi Quote
ASMI Posted July 8, 2008 Posted July 8, 2008 As the sketch only without chekups and other things... Choose a lwpolyline, the table and click inside the first cell. Missing rows will be added automatically. It is not fields, but works normal. (defun c:tabord(/ cPl cTb ptLst vlaTab hitPt hitRes ptLst Row Column rCnt adNum chT cStr) (vl-load-com) (defun Extract_DXF_Code(Entity Code / cPl) (cdr(assoc Code(setq cPl(entget(car Entity))))) ); end of Extract_DXF_Code (if (and (setq cPl(entsel "\nSelect LwPoliline > ")) (= "LWPOLYLINE"(Extract_DXF_Code cPl 0)) ); end and (if (and (setq cTb(entsel "\nSelect Table > ")) (= "ACAD_TABLE"(Extract_DXF_Code cTb 0)) ); end and (if (setq cPt(getpoint "\nClick inside first cell > ")) (progn (setq vlaTab(vlax-ename->vla-object(car cTb)) hitPt (vlax-3D-Point(trans cPt 1 0)) hitRes(vla-HitTest vlaTab hitPt (vlax-3D-Point '(0.0 0.0 1.0)) 'Row 'Column) ptLst(mapcar 'cdr (vl-remove-if-not '(lambda(a)(= 10(car a))) (entget(car cPl)))) ); end setq (if(= :vlax-true hitRes) (progn (setq adNum(-(length ptLst)(-(vla-get-Rows vlaTab)Row)) chT(vla-getRowHeight vlaTab Row) ); end setq (if(not(minusp adNum)) (vla-InsertRows vlaTab Row chT adNum) ); end if (foreach itm ptLst (setq cStr (strcat(rtos(car itm)2 2) "," (rtos(cadr itm)2 2)) ); end setq (vla-SetCellValue vlaTab Row Column cStr) (setq Row(1+ Row)) ); end foreach ); end progn ); end if ); end if ); end progn ); end if ); end if (princ) ); end of c:tabord Quote
The Courage Dog Posted July 9, 2008 Author Posted July 9, 2008 i'll try this, thanks again Mr. Asmi. Quote
The Courage Dog Posted July 9, 2008 Author Posted July 9, 2008 i have tried your tabord.lsp, it works fine. In my requirements i need the x & y coordinate to be on separate cell, also the i need the last digits to be 4, see the image. Quote
Rockmaster Posted January 15, 2009 Posted January 15, 2009 rockmaster.wordpress.com/2009/01/14/introducing-the-autocad-coordinizer/ Quote
ASMI Posted January 15, 2009 Posted January 15, 2009 Continue of this thread here: http://www.cadtutor.net/forum/showthread.php?t=25192&highlight=tabcord Quote
eng_off Posted January 27, 2009 Posted January 27, 2009 hi ASMI just now i register to this wonderful site ur lisp is very powerful, i like it so much but i it has 2 problems first; when i use it for polyline with many points exceeding (a to z) it stops marking points , but it gives coodinates in the table without ID second; when i join 2 polyline, it doesn't work properly please fix that f u have time it is really wonderful lisp thanks in advance Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.