sanju2323 Posted February 23, 2015 Share Posted February 23, 2015 (edited) i need Area Statement by using Lisp of Closed Polyline with Existing No. under Layer "Acquired No. & Area" to the csv. Please Note Merge Area same No. Requirea Area Statement.csv Tighar.dwg Edited February 23, 2015 by sanju2323 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 24, 2015 Share Posted February 24, 2015 Pretty easy just make a list of the text within the polygons then run the Bpoly command one of its properties is area write answer out. One problem all ready 18P its insert point is out side polygon, can be reworked though. Someone may have a lisp already. Quote Link to comment Share on other sites More sharing options...
sanju2323 Posted February 24, 2015 Author Share Posted February 24, 2015 BIGAL, I already have similar lisp, but in this lisp create own order serially Boundary text. i need existing text under polyline boundary create area statement. Multiple Area to XLS.lsp Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 24, 2015 Share Posted February 24, 2015 (edited) Bit long winded for what I think you want I will return if someone does not put up something 1st. Almost there your turn ran out of time (defun textarea ( / obj obj2 ss pt point1 Tarea Textval) (setq obj (vlax-ename->vla-object (car (entsel "Pick text")))) (setq layname (vla-get-layer obj)) (setq ss (ssget (list (cons 0 "Text")(cons 8 layname)))) (setq x -1) (setq len (sslength ss)) (repeat len (setq tobj (vlax-ename->vla-object (ssname ss (setq x (+ x 1))))) (setq pt (vla-get-Insertionpoint tobj)) (setq texval (vla-get-Textstring tobj)) (setq point1 (vlax-safearray->list (vlax-variant-value pt))) (bpoly)(vl-cmdf point1 "") (setq obj2 (vlax-ename->vla-object (entlast))) (setq Tarea (vla-get-area obj2)) (vl-cmdf "erase" "last" "") ; remove bpoly ; write out answers now to csv (princ (strcat "\nLabel " texval " Area " (rtos Tarea 2 0))) ) ) (textarea) Edited February 24, 2015 by BIGAL Quote Link to comment Share on other sites More sharing options...
sanju2323 Posted February 25, 2015 Author Share Posted February 25, 2015 Thank you for the support, but this lisp code does not work very well. I have added a second copy for to understand better. Bit long winded for what I think you want I will return if someone does not put up something 1st. Almost there your turn ran out of time (defun textarea ( / obj obj2 ss pt point1 Tarea Textval) (setq obj (vlax-ename->vla-object (car (entsel "Pick text")))) (setq layname (vla-get-layer obj)) (setq ss (ssget (list (cons 0 "Text")(cons 8 layname)))) (setq x -1) (setq len (sslength ss)) (repeat len (setq tobj (vlax-ename->vla-object (ssname ss (setq x (+ x 1))))) (setq pt (vla-get-Insertionpoint tobj)) (setq texval (vla-get-Textstring tobj)) (setq point1 (vlax-safearray->list (vlax-variant-value pt))) (bpoly)(vl-cmdf point1 "") (setq obj2 (vlax-ename->vla-object (entlast))) (setq Tarea (vla-get-area obj2)) (vl-cmdf "erase" "last" "") ; remove bpoly ; write out answers now to csv (princ (strcat "\nLabel " texval " Area " (rtos Tarea 2 0))) ) ) (textarea) Sample 2.dwg Required Sheet.xls Sample 2.lsp Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 25, 2015 Share Posted February 25, 2015 This is what I got Label 87 Area 12205 Label 48 Area 5015 Label 65 Area 9518 Label 55 Area 15421 As I said not finished need to just do csv bit ie write to file, but it works ! Lot less code. Making it write to excel automatically its your turn. Quote Link to comment Share on other sites More sharing options...
sanju2323 Posted February 25, 2015 Author Share Posted February 25, 2015 Sir, It does not matter to me. If export in Microsoft Excel or CSV. It is important required result. This is what I gotLabel 87 Area 12205 Label 48 Area 5015 Label 65 Area 9518 Label 55 Area 15421 As I said not finished need to just do csv bit ie write to file, but it works ! Lot less code. Making it write to excel automatically its your turn. 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.