Madruga_SP Posted January 6, 2015 Share Posted January 6, 2015 Hi guys, Happy New Year!!! 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 Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 6, 2015 Share Posted January 6, 2015 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. Quote Link to comment Share on other sites More sharing options...
eldon Posted January 6, 2015 Share Posted January 6, 2015 This thread could be of use Quote Link to comment Share on other sites More sharing options...
hmsilva Posted January 6, 2015 Share Posted January 6, 2015 I'm attaching a example Hi Madruga_SP, ? the example ? Henrique Quote Link to comment Share on other sites More sharing options...
Madruga_SP Posted January 6, 2015 Author Share Posted January 6, 2015 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 Quote Link to comment Share on other sites More sharing options...
pBe Posted January 6, 2015 Share Posted January 6, 2015 Hi Madruga_SP,? the example ? Henrique I don't see it either Yep Henrique, Where is the attachment Madruga_SP? Quote Link to comment Share on other sites More sharing options...
Madruga_SP Posted January 6, 2015 Author Share Posted January 6, 2015 Sorry... Henrique coordinate-test.dwg Quote Link to comment Share on other sites More sharing options...
pBe Posted January 6, 2015 Share Posted January 6, 2015 ACAD_TABLE with lisp is easy Madruga_SP. Do you need a table on the drawing or an external file? or both? Quote Link to comment Share on other sites More sharing options...
Madruga_SP Posted January 6, 2015 Author Share Posted January 6, 2015 pBe, Is not so fancy friend. Maybe a notepad or autocad text windows wil be good. e.g TEST.txt Quote Link to comment Share on other sites More sharing options...
pBe Posted January 6, 2015 Share Posted January 6, 2015 (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 January 6, 2015 by pBe Quote Link to comment Share on other sites More sharing options...
Madruga_SP Posted January 6, 2015 Author Share Posted January 6, 2015 (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 January 6, 2015 by Madruga_SP Quote Link to comment Share on other sites More sharing options...
Madruga_SP Posted January 7, 2015 Author Share Posted January 7, 2015 Hi guys, Could anybody help me out please? I really need that informations... Regards Quote Link to comment Share on other sites More sharing options...
Tharwat Posted January 7, 2015 Share Posted January 7, 2015 Madruga , I am really surprised that you don't know how to load a lisp file ! Quote Link to comment Share on other sites More sharing options...
pBe Posted January 7, 2015 Share Posted January 7, 2015 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 Quote Link to comment Share on other sites More sharing options...
Madruga_SP Posted January 7, 2015 Author Share Posted January 7, 2015 Madruga , I am really surprised that you don't know how to load a lisp file ! My bad guys. I've realized that I had to explode the block to renumber them. The code isn't working Quote Link to comment Share on other sites More sharing options...
Madruga_SP Posted January 7, 2015 Author Share Posted January 7, 2015 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. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted January 7, 2015 Share Posted January 7, 2015 You must be using another Attributed block than the one you have uploaded in this thread . I guess Quote Link to comment Share on other sites More sharing options...
Madruga_SP Posted January 7, 2015 Author Share Posted January 7, 2015 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 Quote Link to comment Share on other sites More sharing options...
Tharwat Posted January 7, 2015 Share Posted January 7, 2015 Hi my friend Tharwat,I had to insert all blocks again. It works great! Thank you Good to hear that All credits go to pBe for the nice codes for sure Quote Link to comment Share on other sites More sharing options...
Madruga_SP Posted January 7, 2015 Author Share Posted January 7, 2015 Good to hear that All credits go to pBe for the nice codes for sure Kudos for everyone!! I'm really happy with the goal. Thank you Quote Link to comment Share on other sites More sharing options...
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.