Lee Mac Posted December 21, 2010 Share Posted December 21, 2010 Make sure the VLIDE isn't inserting tabs into your code: Tools » Environment Options » Visual LISP Formatting Options » (uncheck) Insert Tabs Quote Link to comment Share on other sites More sharing options...
Tharwat Posted December 21, 2010 Share Posted December 21, 2010 Make sure the VLIDE isn't inserting tabs into your code: Tools » Environment Options » Visual LISP Formatting Options » (uncheck) Insert Tabs Thanks Lee . That's right , it was checked. so I released it . What is the problem that may cause for the others when they copy and paste codes in their Vlide editors ? Would codes get far from eachothers ? I am still wonder why ! Thanks Quote Link to comment Share on other sites More sharing options...
justindm Posted December 21, 2010 Author Share Posted December 21, 2010 @Tharwat - yours works awesome! much simpler than the eattext (and much less filling ) Is there a way to specify the location of the output file? Or just to the same place as the dwg location? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 21, 2010 Share Posted December 21, 2010 Is there a way to specify the location of the output file? Or just to the same place as the dwg location? See my earlier link... Quote Link to comment Share on other sites More sharing options...
justindm Posted December 21, 2010 Author Share Posted December 21, 2010 im either blind or dumb (maybe both). not sure what link youre talking about...... Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 21, 2010 Share Posted December 21, 2010 not sure what link youre talking about...... Post#5 - program should do what you want and much, much more... Quote Link to comment Share on other sites More sharing options...
justindm Posted December 21, 2010 Author Share Posted December 21, 2010 OOOOOOOOHHHHHHHHH.....DUUUUUUDE!!! AWESOME!!! SO AWESOME!!! Thank you!! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 21, 2010 Share Posted December 21, 2010 OOOOOOOOHHHHHHHHH.....DUUUUUUDE!!! AWESOME!!! SO AWESOME!!! Thank you!! Glad you like it! Enjoy Quote Link to comment Share on other sites More sharing options...
Tharwat Posted December 22, 2010 Share Posted December 22, 2010 @Tharwat - yours works awesome! much simpler than the eattext (and much less filling ) Is there a way to specify the location of the output file? Or just to the same place as the dwg location? You're welcome . Here is one according to your request. (defun c:THex (/ dir fNme ss) ; THARWAT 2010 (if (and (setq dir (getvar 'dwgprefix)) (setq fNme (open (strcat dir "Block-coordinates.txt" ) "w")) (setq ss (ssget "_:L" '((0 . "INSERT")))) ) ( (lambda (i / ss1 e pt1 ) (while (setq ss1 (ssname ss (setq i (1+ i)))) (setq e (entget ss1)) (setq pt1 (cdr (assoc 10 e))) (write-line (strcat (rtos (car pt1) 2) "," (rtos (cadr pt1) 2) "," (rtos (caddr pt1) 2)) fNme) ) ) -1 ) (princ) ) (close fNme) (princ "\n Written by Tharwat") (princ) ) Enjoy. Tharwat Quote Link to comment Share on other sites More sharing options...
symoin Posted August 3, 2017 Share Posted August 3, 2017 You're welcome . Here is one according to your request. (defun c:THex (/ dir fNme ss) ; THARWAT 2010 (if (and (setq dir (getvar 'dwgprefix)) (setq fNme (open (strcat dir "Block-coordinates.txt" ) "w")) (setq ss (ssget "_:L" '((0 . "INSERT")))) ) ( (lambda (i / ss1 e pt1 ) (while (setq ss1 (ssname ss (setq i (1+ i)))) (setq e (entget ss1)) (setq pt1 (cdr (assoc 10 e))) (write-line (strcat (rtos (car pt1) 2) "," (rtos (cadr pt1) 2) "," (rtos (caddr pt1) 2)) fNme) ) ) -1 ) (princ) ) (close fNme) (princ "\n Written by Tharwat") (princ) ) Enjoy. Tharwat Thanks for this beautiful code.... Could you please modify to include the layer of the block (layer on which it is inserted) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 3, 2017 Share Posted August 3, 2017 Thanks for this beautiful code.... Thank you. Could you please modify to include the layer of the block (layer on which it is inserted) Can you show how it should look like in the txt file to allow me to modify the codes with one shot if possible? Quote Link to comment Share on other sites More sharing options...
symoin Posted August 3, 2017 Share Posted August 3, 2017 Please find the attached it has Pointid or Sl. No, Easting, Northing, Elevation and Code. Some can like this even without the Sl.No. will be great. Thanks. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 3, 2017 Share Posted August 3, 2017 (defun c:Test (/ sel dir fil int ent get pnt) ;; Tharwat - Date: 03.Aug.2017 ;; (if (and (setq sel (ssget "_:L" '((0 . "INSERT")))) (setq int -1 dir (getvar 'dwgprefix)) (setq fil (open (strcat dir "Block-coordinates.txt") "w")) ) (while (setq ent (ssname sel (setq int (1+ int)))) (setq get (entget ent) pnt (cdr (assoc 10 get)) ) (write-line (strcat (rtos (car pnt) 2) "," (rtos (cadr pnt) 2) "," (rtos (caddr pnt) 2) "," (cdr (assoc 8 get))) fil) ) ) (if fil (close fil)) (princ) ) Quote Link to comment Share on other sites More sharing options...
symoin Posted August 7, 2017 Share Posted August 7, 2017 (defun c:Test (/ sel dir fil int ent get pnt) ;; Tharwat - Date: 03.Aug.2017 ;; (if (and (setq sel (ssget "_:L" '((0 . "INSERT")))) (setq int -1 dir (getvar 'dwgprefix)) (setq fil (open (strcat dir "Block-coordinates.txt") "w")) ) (while (setq ent (ssname sel (setq int (1+ int)))) (setq get (entget ent) pnt (cdr (assoc 10 get)) ) (write-line (strcat (rtos (car pnt) 2) "," (rtos (cadr pnt) 2) "," (rtos (caddr pnt) 2) "," (cdr (assoc 8 get))) fil) ) ) (if fil (close fil)) (princ) ) Firstly I apologize for the delay and Then thanks for this code. This works exactly as required but only one issue is its creating the list in reverse order. (newer first and older last). Can it be reversed to older first and newest last. Thanks Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 7, 2017 Share Posted August 7, 2017 Firstly I apologize for the delay and Then thanks for this code. This works exactly as required but only one issue is its creating the list in reverse order. (newer first and older last). Can it be reversed to older first and newest last. Thanks Its okay - you're welcome anytime. Are you after sorting the list as per the smallest X coordinates? Quote Link to comment Share on other sites More sharing options...
symoin Posted August 8, 2017 Share Posted August 8, 2017 not exactly, now your code creates the list with the order of block created or inserted from newer to older into the drawing, required exactly the same with from older to newer.. Thanks Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 8, 2017 Share Posted August 8, 2017 not exactly,now your code creates the list with the order of block created or inserted from newer to older into the drawing, required exactly the same with from older to newer.. Thanks (defun c:Test (/ sel dir fil int ent get pnt) ;; Tharwat - Date: 03.Aug.2017 ;; (if (and (setq sel (ssget "_:L" '((0 . "INSERT")))) (setq int (sslength sel) dir (getvar 'dwgprefix)) (setq fil (open (strcat dir "Block-coordinates.txt") "w")) ) (while (setq ent (ssname sel (setq int (1- int)))) (setq get (entget ent) pnt (cdr (assoc 10 get)) ) (write-line (strcat (rtos (car pnt) 2) "," (rtos (cadr pnt) 2) "," (rtos (caddr pnt) 2) "," (cdr (assoc 8 get))) fil) ) ) (if fil (close fil)) (princ) ) Quote Link to comment Share on other sites More sharing options...
symoin Posted August 10, 2017 Share Posted August 10, 2017 Thanks, Exactly what I was looking.... appreciate your help Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 10, 2017 Share Posted August 10, 2017 Thanks,Exactly what I was looking.... appreciate your help You're welcome. Quote Link to comment Share on other sites More sharing options...
jgarza0422 Posted January 15, 2018 Share Posted January 15, 2018 What is need to include these attribute information? 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.