mannybmanago Posted November 25, 2020 Posted November 25, 2020 Hi, We are working on many master plans and part of it is making parcel/lot numberings in sequence. I am trying to find a solution in automating this task since it's thousands and thousands to work on manualy. I know tcount can be use too. Right now I got all the text placements in the centroid of the polygon to be used in tcont. Somehow, I know it left and right or vice versa is the sequence of points having some direction. Does anybody have done this or have lisp for this? It would be a big help. BR/Emmanuel Quote
Steven P Posted November 25, 2020 Posted November 25, 2020 if in doubt... check Lee Mac... would this work? Incremental Array | Lee Mac Programming (lee-mac.com) 1 Quote
BIGAL Posted November 26, 2020 Posted November 26, 2020 (edited) The automation will depend on stuff like the lots are an individual pline then you could do something like start number then increment eg 1 then 3 5 7 by dragging a line over the lots in sequence stopping and starting would be necessary for a odd even arrangement. Using ssget "F" you could make what you have displayed may need a couple of options Edited November 26, 2020 by BIGAL 1 Quote
mannybmanago Posted November 26, 2020 Author Posted November 26, 2020 Hi Bigal, Yes, the plots or parcels are individual close polylines. My approach would be to just draw a pline in the middle across the a block (or group of plots) and offset this side by side and make a two ordered selections of plots centroid. Then jump from each side and draw pline or add the texts, no idea how i will do this yet. Your approach is also very simple and neat and I will try to code it too. For now, they are stuck with sequence I have attached above. I do copy paste codes from others, a seasonal programming enthusiast in CAD. I also copy the sources links for references unless, i forgot it. Thanks to you all who's been contributing a lot in this forum. BR/Emmanuel Quote
Dadgad Posted November 26, 2020 Posted November 26, 2020 When in doubt, http://www.lee-mac.com/programs.html#general Lee has a wealth of fantastic lisps which would greatly facilitate exactly what you are trying to do, and so much more. Check them out, you'll be glad you did. Thanks Lee! Quote
mannybmanago Posted November 26, 2020 Author Posted November 26, 2020 Yes, I have been digging from his samples a lot and have helped me in many of my tedious tasks. Some are really too advance. And Yes, Thanks a lot Lee! Quote
BIGAL Posted November 27, 2020 Posted November 27, 2020 (edited) Happy to help using fence option have a go when stuck post. For zig zag approach use points or do twice odd even. Edited November 27, 2020 by BIGAL Quote
mannybmanago Posted November 27, 2020 Author Posted November 27, 2020 Anyone experiencing this situation where your lisp is running that it doesn't show your progress on the screen like zooming in to entities being process? Then at almost in the end it shows the results. I am processing like 1K to 3K plots for doing some coordinate points and areas of plots and writing it in a text file report. It's a bit slow too. See the attached sample of the text file output of the program. 1418DF-TBQ(5) -224-U-UM-300 - (Parcel No, Area, Points, X, Y - 2.txt Quote
mannybmanago Posted November 27, 2020 Author Posted November 27, 2020 1 minute ago, mannybmanago said: Anyone experiencing this situation where your lisp is running that it doesn't show your progress on the screen like zooming in to entities being process? Then at almost in the end it shows the results. I am processing like 1K to 3K plots for doing some coordinate points and areas of plots and writing it in a text file report. It's a bit slow too. See the attached sample of the text file output of the program. 1418DF-TBQ(5) -224-U-UM-300 - (Parcel No, Area, Points, X, Y - 2.txt 542.45 kB · 0 downloads About 10,626 lines of texts for individual plot points took 15 minutes. Quote
mannybmanago Posted November 27, 2020 Author Posted November 27, 2020 Just now, mannybmanago said: About 10,626 lines of texts for individual plot points took 15 minutes. Quote
hosneyalaa Posted November 28, 2020 Posted November 28, 2020 (edited) ; ============================================================ ; ; Get centroid coordinates ; ; Obj - VLA object ; ; ============================================================ ; (defun _centroid ( obj / reg cen ) (setq reg (car (vlax-invoke (vla-objectidtoobject (vla-get-document obj) (vla-get-ownerid obj)) 'addregion (list obj))) cen (vlax-get reg 'centroid) ) (vla-delete reg) cen ) ;;; (setq epsilon 2) ;;;https://www.cadtutor.net/forum/topic/33845-lisp-multi-level-sorting/?tab=comments#comment-274898 (defun compare-pointsS (p1 p2) (cond ( (equal (car p1) (car p2) epsilon) ; if x are equal, (> (cadr p1) (cadr p2))) ; then compare y, (t (< (car p1) (car p2))) ; else compare x ) ) (defun C:TEST ( /C CEN CENL CW EPSILON SORTED SS SSSELECTIONS SSW XSSOTP) (IF (setq ssSelections (ssget (list (cons 0 "LWPOLYLINE,POLYLINE")))) (PROGN (setq SS ssSelections) (setq C 0) (repeat (sslength SS) (setq CEN (_centroid (vlax-Ename->vla-Object (ssname SS C)))) (setq CENL (CONS (LIST (CAR CEN) (CADR CEN) (ssname SS C)) CENL)) (setq C (1+ C)) ) (setq epsilon 2) (setq sorted (vl-sort CENL 'compare-pointsS));; sort (setq xsSOTP(mapcar (function (lambda(x)(CADDR x)))sorted));; LENGTH (if (setq SSW sorted) (progn (setq CW 0) (repeat (length SSW) (entmakex (list (cons 0 "TEXT") (cons 10 (LIST (CAR(nth CW SSW))(CADR(nth CW SSW)))) (cons 40 1) (cons 50 0) (cons 1 (RTOS (setq CW (+ 1 CW)) 2 0 )))) ) ) ) ) ) ) @mannybmanago TEST THIS Edited November 28, 2020 by hosneyalaa Quote
BIGAL Posted November 28, 2020 Posted November 28, 2020 It may be worthwhile posting code as it looks like you have done a good job on the output, there may be some coding improvements that give speed, like the text use entmake much faster than if you have used command text. You can add a progress bar to show that it is working. "acet-ui-progress" look up help. 1 Quote
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.