Jump to content

Coordinate lisp


Madruga_SP

Recommended Posts

Hi guys,

Happy New Year!!!:D

 

I need to put the coordinate about 176 blocks in my drawing.

I'm looking for a lisp to do that. I was wondering if someone could help me.

 

I'm using ID command and copy and paste the x and y coordinate. I'm wasting a lot of time.

 

I'll will be really happy if someone could help me out.

 

I'm attaching a example

Thank in advance

Link to comment
Share on other sites

  • Replies 28
  • Created
  • Last Reply

Top Posters In This Topic

  • Madruga_SP

    15

  • pBe

    8

  • Tharwat

    3

  • ReMark

    1

Top Posters In This Topic

There are plenty of lisp routines that will place coordinates in a drawing but I don't know of one that will do it automatically. Here is a description of one such program.

 

Auto Coordinate Dynamic Block is used to label coordinates automatically in the drawing instead of using any lisp. The attribute fields get the eastward and northward values, The dynamic properties of the block make it flexible and can adjust the size by Annotative scale.

Link to comment
Share on other sites

Yep Henrique,

Because the table is complicated and I think that a lisp isn't doing that.

 

But if the code make as I want to. It will be great, mate!

 

 

I was thinking something that you pick the points and in the end create a text file with coordinates.

Then I copy and paste the results.

 

Regards

coordinate-test.dwg

Link to comment
Share on other sites

Okay then, via pick points? or global?

 

no answer?

 

Anyhoo.

(defun c:nsf (/ data file ss op number coord str2dis) ;<< Not So Fancy 
 (setq data nil)
 (if (and
(ssget "_X"
       (list '(0 . "INSERT")
	     '(2 . "quadra")
	     (cons 410 (getvar 'ctab))
       )
)
(setq file
       (getfiled "Enter file name" (getvar 'dwgprefix) "txt" 1)
)
     )

   (progn
     (vlax-for	itm (setq
	      ss (vla-get-ActiveSelectionSet
		   (vla-get-ActiveDocument (vlax-get-acad-object))
		 )
	    )
(setq number (atoi (vla-get-textstring
		     (car (vlax-invoke itm 'Getattributes))
		   )
	     )
)
(setq coord (vlax-get itm 'Insertionpoint))
(if (/= number 0)
  (setq	data (cons
	       (list number
		     (strcat
		       (rtos (car coord) 2 4)
		       "\t\t"
		       (rtos (cadr coord) 2 4)
		     )
	       )
	       data
	     )
  )
)
     )
     (vla-delete ss)
     (setq op (open file "w"))
     (foreach val (vl-sort data '(lambda (a b) (< (car a) (car b))))
(princ
  (Strcat
    "\n"
    (setq str2dis (strcat (itoa (car val)) "\t" (cadr val)))
  )
)
(write-line str2dis op)
     )
     (close op)
     (startapp "Notepad" file)
   )
 )
 (princ)
)

Edited by pBe
Link to comment
Share on other sites

Sorry for delay.

 

I went to lunch.

 

Could be pick all block's named quadra and give me the coordinates?

 

I don't know how to use your code.

Edited by Madruga_SP
Link to comment
Share on other sites

Sorry for delay.

 

I went to lunch.

 

Could be pick all block's named quadra and give me the coordinates?

 

I don't know how to use your code.

 

Load the code and type NSF at the command prompt:

 

command: NSF

 

Simple like that

Link to comment
Share on other sites

Madruga , I am really surprised that you don't know how to load a lisp file ! :o

 

My bad guys. I've realized that I had to explode the block to renumber them.

:(

 

The code isn't working

Link to comment
Share on other sites

Thank you pBe!!

Your code is wonderful worked like a charm.

 

But I exploded all blocks to renumber and now it's just a circle and text. :cry:

Link to comment
Share on other sites

You must be using another Attributed block than the one you have uploaded in this thread . I guess

 

Hi my friend Tharwat,

I had to insert all blocks again.

 

It works great!

 

Thank you

Link to comment
Share on other sites

Hi my friend Tharwat,

I had to insert all blocks again.

 

It works great!

 

Thank you

 

Good to hear that :thumbsup:

 

All credits go to pBe for the nice codes for sure :)

Link to comment
Share on other sites

Good to hear that :thumbsup:

 

All credits go to pBe for the nice codes for sure :)

 

Kudos for everyone!!

I'm really happy with the goal.

 

Thank you

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