Jump to content

Recommended Posts

Posted

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

  • Replies 28
  • Created
  • Last Reply

Top Posters In This Topic

  • Madruga_SP

    15

  • pBe

    8

  • Tharwat

    3

  • ReMark

    1

Top Posters In This Topic

Posted

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.

Posted

I'm attaching a example

Hi Madruga_SP,

? the example ?

 

Henrique

Posted

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

Posted
Hi Madruga_SP,

? the example ?

 

Henrique

 

I don't see it either :)

 

Yep Henrique,

 

Where is the attachment Madruga_SP?

Posted

ACAD_TABLE with lisp is easy Madruga_SP. Do you need a table on the drawing or an external file? or both?

Posted

pBe,

Is not so fancy friend. Maybe a notepad or autocad text windows wil be good.

 

e.g

TEST.txt

Posted (edited)

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
Posted (edited)

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
Posted

Hi guys,

Could anybody help me out please?

 

I really need that informations...

 

Regards

Posted

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

Posted
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

Posted
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

Posted

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:

Posted

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

Posted
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

Posted
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 :)

Posted
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

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