Jump to content

hyperlink coordinates into table (command)


Recommended Posts

Posted

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

Posted

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

Posted

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.

Posted
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.

Posted

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

Posted

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

Tabord.jpg

Posted

i'll try this, thanks again Mr. Asmi.:)

Posted

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.

tab-coord.jpg

Posted

thanks in advance....

  • 6 months later...
Posted

rockmaster.wordpress.com/2009/01/14/introducing-the-autocad-coordinizer/

  • 2 weeks later...
Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...