Jump to content

Recommended Posts

Posted

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

 

2020-11-25_12-14-27.jpg

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

 

image.thumb.png.dd3abf452ae93cdcd0574863f4398cc6.png

 

Edited by BIGAL
  • Like 1
Posted

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

 

Posted

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!   :beer:

Posted

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!

Posted (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 by BIGAL
Posted

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

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

Posted
Just now, mannybmanago said:

About 10,626 lines of texts for individual plot points took 15 minutes.

 

2020-11-27_11-32-07.jpg

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

 

Capture.JPG

Edited by hosneyalaa
Posted

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.

  • Thanks 1

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