Jump to content

List coordinate by select point group


jason tay

Recommended Posts

Hi all:D , i wonder any one know how to create lisp which could list out the coordinate of group of point (not pick point by point) and create individual layer of N and E with the text stick on the point position and if it can create numbering also will be much helpful.

I need this lisp becase i always need to create the coordinate for lots of point (more than 50).

 

Im first time post at this forum if any things wrong please forgive me,

here is really a good place for learning.

thanks all .:oops:

Sample.dwg

Link to comment
Share on other sites

  • Replies 37
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    14

  • surveyman

    7

  • jason tay

    6

  • tagkelas

    3

Guest Alan Cullen

yeah, Jason,

 

It can be done, relatively easily. So stop panicking. There will be a lot of our lisp gurus along shortly to point you in the right direction. Just stand by. If you have no response overnight, just yell for me, I'm sure I can get these gurus up and running for you. :lol: :lol: :lol:

Link to comment
Share on other sites

this can be a start:

 

 

 
(defun c:test (/ mysset counter)
 (setq mysset (ssget))
 (setq counter 0)
 (setq sch 0.5)
 (while (< counter (sslength mysset))
   (setq p1 (cdr (assoc 10 (entget (ssname mysset counter)))))
   (setq ytxt (strcat "N" (rtos (cadr p1) 2 3)))
   (setq xtxt (strcat "E" (rtos (car p1) 2 3)))  
   (command "text" p1 (* sch 2.5) "0" xtxt)
   (command "text" "" ytxt)
   (command "text" "" (itoa (1+ counter)))
   (setq counter (+ counter 1))
 ) ;_ end of while
 (princ)
)

Link to comment
Share on other sites

Thank you very much all of the guru here ,

especially to Wizman !you all are really great!

but is that possible that the coordinate and numbering all in single layer - East, North and Num

if cannot then never mine because what you have done alreally helping me a lot.

Eldon im from Malaysia:oops: sorry for the confuse i make :P

Link to comment
Share on other sites

Guest Alan Cullen

Mate, if you can wait until I get home tonight, I'll have a play with that lisp and modify it for you, I'm pretty busy here at work at the moment.

 

I think wizman is assuming your dimscale is set at 0.5.

Link to comment
Share on other sites

(defun c:test (/ mysset counter laylist p1 sch  xtxt ytxt)
 (setq laylist (list "NORTH" "EAST" "NUM"))
 (foreach x laylist
   (if    (tblsearch "Layer" x)
     (command "._layer" "_thaw" x "_on" x "_unlock" x "_set" x    "") ;_ closes command
     (command "._layer" "_make" x "_color" "7" x "") ;_ closes command
   )
 )
 (prompt "SELECT POINTS JASON: ")
 (setq mysset (ssget '((0 . "POINT"))))
 (setq counter 0)
 (if (null sch)
   (setq sch 1.0)
 )
 (initget 6)
 (setq temp (getreal (strcat "\nENTER SCALE <" (rtos sch 2 2) ">: ")))
 (if temp
   (setq sch temp)
   (setq temp sch)
 )
 (while (< counter (sslength mysset))
   (setq p1 (cdr (assoc 10 (entget (ssname mysset counter)))))
   (setq xtxt (strcat "E" (rtos (car p1) 2 3)))
   (setq ytxt (strcat "N" (rtos (cadr p1) 2 3)))
   (command "text" p1 (* sch 2.5) "0" xtxt)
   (command "_change" (entlast) "" "p" "la" "EAST" "")
   (command "text" "" ytxt)
   (command "_change" (entlast) "" "p" "la" "NORTH" "")
   (command "text" "" (itoa (1+ counter)))
   (command "_change" (entlast) "" "p" "la" "NUM" "")
   (setq counter (+ counter 1))
 ) ;_ end of while
 (princ)
)

Link to comment
Share on other sites

Dear Alan,is no problem for me to wait :D

i have a lisp dont know where i found which list the coordinate pick point by point is similar to some lisp i found in this forum and i try to modify it so it can -1.select group of point 2. individual layer for East,North and numbering but end up with fail, because im not familiar with the lisp language.

WCO.LSP

Link to comment
Share on other sites

  • 1 year later...

Wizman - that's a great automated routine. Would it be possible to get it to write the coords to a .txt file in the form

 

pt number,E,N,Z

 

I have seen some lsp routines doing this, but they require manual picking of the points.

 

For my particular purpose I don't need the E,N,Z to be plotted on the drawing - just the point number is useful.

 

I'm new to this forum so hope my reply was posted correctly, and hope I'm not taking too many libertys early on!

 

Thanks alot.

Link to comment
Share on other sites

Hi surveyman,

 

Correct me if I am wrong, and I may be well off the mark, but do you just want the x,y,z and pt number of ACAD points in the drawing written to the notepad txt file. Is this correct?

Link to comment
Share on other sites

If that indeed is your intention - this should suit your needs:

 

(defun c:ptwriter (/ file ss file eLst i)
 (vl-load-com)
 (if (and (setq file (getfiled "Create a Text File" "C:\\" "txt" 9))
      (setq ss (ssget "X" (list (cons 0 "POINT")
             (if (getvar "CTAB")(cons 410 (getvar "CTAB"))
               (cons 67 (- 1 (getvar "TILEMODE"))))))))
   (progn
     (setq file (open file "w")
       eLst (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) i 1)
     (foreach e eLst
   (write-line (strcat (rtos i) ","
               (rtos (cadr (assoc 10 (entget e)))) ","
               (rtos (caddr (assoc 10 (entget e)))) ","
               (rtos (cadddr (assoc 10 (entget e))))) file)
   (setq i (1+ i))))
   (princ "\n<!> No File Selected or No Points found <!>"))
 (princ "\n<< Points Written to File >>")
 (close file)
 (princ))
   

Link to comment
Share on other sites

Lee Mac,

Thanks for your response. Wow that works quickly! The lsp ran so quickly I opened the file expecting it to be blank. However.....

 

What I really want is a combination of your routine and Wiz Mans (which currently automatically plots "number, E,N,Z" on the drawing)

 

Required workflow

 

1. Select text file name

2. Preferably select starting point number to count from

3. Select points from drawing

4. Lsp will then automatically plot a point number (next to each point) on the drawing ( E,N,Z is not required to be plotted) at each point

5. These points will be written to a text file as per your routine in format number,E,N,Z

6. Purpose is I can then take a drawing onto site, select the point number I wish to set out (from the plotted numbers on the drawing) and then select this point (which will contain the coords) from my data logger for setting out.

 

Does this workflow make sense?

 

Thanks again for the work so far.

Surveyman

Link to comment
Share on other sites

Hi Surveyman, I understand things a lot better now thanks.

 

But I do have one further question - would you like to select the points that are to be plotted to the text file/have a number printed? Or would you like the program to automatically select all the points in the drawing as it does currently?

Link to comment
Share on other sites

Lee Mac,

 

I would like to select them using a selection tool. This way I can just pick one or 2 houses (for example) from a design drawing showing 50.

 

Should I want all 50 I could of course pick the whole drawing - no doubt this process complicates things a bit.

 

I really do appreciate your input.

 

Thanks

 

Surveyman:)

Link to comment
Share on other sites

No worries surveyman, it is not any harder to have the user select the points than it is to have the program select all points in the drawing - just a means a smaller selection set is retrieved.

 

Will see what I can do :)

Link to comment
Share on other sites

I have seen some lsp routines doing this, but they require manual picking of the points.

 

If you want to have any control over the order of the point numbering, you have to pick the points manually. Unless the lisp is cleverer than I thought :oops:

Usually for setting out, it is easier to have your point numbers going consecutively in the order for setting out.

Link to comment
Share on other sites

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