Points

Points

Oliver_C3D
Advocate Advocate
1,397 Views
16 Replies
Message 1 of 17

Points

Oliver_C3D
Advocate
Advocate

Hi

I have a project that has a lot of points. And these most places points go together and get crowded.

I'm looking for Lisp to Thinning out the elevation point.

0 Likes
1,398 Views
16 Replies
Replies (16)
Message 2 of 17

CodeDing
Advisor
Advisor

@Oliver_C3D ,

 

It appears you are using Civil 3D, here is a helpful link that explains multiple ways you can achieve what you desire.

 

https://www.augi.com/articles/detail/the-civil-side-managing-large-surface-data

 

Best,

~DD

0 Likes
Message 3 of 17

Oliver_C3D
Advocate
Advocate

No

I want way in autocad I don't want points delete !

I want Additional points To be separated

0 Likes
Message 4 of 17

CodeDing
Advisor
Advisor

Maybe I do not understand. Can you post an example .dwg file that shows what your situation currently looks like, and also includes an example of what your desired outcome will look like?

 

Best,

~DD

0 Likes
Message 5 of 17

Oliver_C3D
Advocate
Advocate

This is sample

0 Likes
Message 6 of 17

Kent1Cooper
Consultant
Consultant

You didn't include something showing how you want things to be after "thinning out."  I hope you don't want to Move  the Text objects [not Points], since they represent information about a specific location  [which I assume is the Text's insertion point], and it can't be good to put them at different locations -- if you do, what is their purpose?  Are you looking for something like a Line or Leader from the true location to a re-positioned Text object about that location?

Kent Cooper, AIA
0 Likes
Message 7 of 17

Sea-Haven
Mentor
Mentor

How delete post 

 

Posted in error to Kent1Cooper

0 Likes
Message 8 of 17

Sea-Haven
Mentor
Mentor

 

I think your looking for the wrong thing. 

 

1 Can you not make the text smaller ?

2 Can you create the point dump that points are on different layers

3 As there is no line work or an actual POINT you can not turn on/off by some method

4 If you want can make a POINT at every text location in 3d then pick points you want RL labelled

5 what your after is "readability" always been fuzzy logic

6  Does your point file have a description for each point ? N,x,y,z,desc 

7 What software created the points

0 Likes
Message 9 of 17

hak_vz
Advisor
Advisor

If I understand you well, you would like to retain all point objects in a drawing, and separate overlapping elevation text in a layer that can be hidden if needed. Although I don't like sharing my work on this forum because at more then often some else collects all the fame (i.e likes and final solution). Haven't been posting posting on this forum almost a year.

 

This lisp works only with text objects that have defined text style and assumes that all text objext are in layer 0.

a) Put all text in a layer 0. After you envoke "overlap" function for a first time it seeks for layers "to_hold" and "to_hide". If they dont exist in a drawing, it creates them.
b) By repetitive calls to command "overlap" (just keep enter key pressed) it looks for overlapping text and separates them in those to layers. You will see how text object change its color to red and green.

 

If you want to retain you layer structure in separate file perform the action for each layer and rename resulting layers respectively. Copy all text object from that layer in a new empty drawing and perform action for each layer.

If original layers name is i.e drainage you may rename resulting layers to drainage_hold and drainage_hide or what ever you like.

 

I have written this tool in a hury many years ago, never had a time to polish it to perfection. It is not perfect but it served me well in many occasions. I am posting a lisp file and your file with separated overlaping text. If after first sesion you find overlaping text, transfer all text in layer "to_hold" to layer 0 and repeat the action, or do it by hand.

 

 

  (defun new_layer (name  color) ;
    (if (= (tblsearch "layer" name) nil)
      (command "._layer" "_n" name "_c" color name "")
      (command "._layer" "_t" name "_on" name "_c" color name ""))
  )

(defun c:overlap ( / );*error* ss len del tlist tb ang p1  en en_len en_pts _l j k m clip_ss cen
(defun *error* () (princ))
(setvar "cmdecho" 0)
(new_layer "to_hold" 3)
(new_layer "to_hide" 1)
    (setq   ss (ssget "X" '((0 . "text") (8 . "0"))) 
        del 1.0 _del (* -1.0 del) i 0)
	 (repeat (sslength ss)
     (setq e (ssname ss i)
        en (entget e)
        tb (textbox en)
        ang_rad (cdr(assoc 50 en))
        p1 (cdr(assoc 10 en ))
        dx (car p1) dy (cadr p1)
        x_list (list _del (+ (caadr tb) del) (+ (caadr tb) del) _del _del)
        y_list (list _del _del (+ (cadadr tb) del) (+ (cadadr tb) del) _del)
        _cos (cos ang_rad) 
        _sin (sin ang_rad)
        cos_list (list _cos _cos _cos _cos _cos)
        sin_list (list _sin _sin _sin _sin _sin)
        -cos_list (mapcar '* (list -1 -1 -1 -1 -1) (list _cos _cos _cos _cos _cos))
        -sin_list (mapcar '* (list -1 -1 -1 -1 -1) (list _sin _sin _sin _sin _sin))
        dx_list (list dx dx dx dx dx)
        dy_list (list dy dy dy dy dy)
        x_cos (mapcar '* x_list cos_list)
        y_cos (mapcar '* y_list cos_list)
        -x_cos (mapcar '* x_list -cos_list)
        -y_cos (mapcar '* y_list -cos_list)
        x_sin (mapcar '* x_list sin_list)
        y_sin (mapcar '* y_list sin_list)
        -x_sin (mapcar '* x_list -sin_list)
        -y_sin (mapcar '* y_list -sin_list)
        _x (mapcar '+ x_cos -y_sin)
        _y (mapcar '+ y_cos x_sin)
        _x (mapcar '+ _x dx_list)
        _y (mapcar '+ _y dy_list)
        en_pts (mapcar 'list _x _y)
        j 0
        clip_ss (ssget "_CP" en_pts '((0 . "TEXT"))) 
        k (sslength clip_ss)
        m 1
        zad (entget (ssname clip_ss 0))
        zad (subst (cons 8 "to_hold") (assoc 8 zad) zad)
        zad (entmod zad)
    )
       
    (repeat k
        (setq   cen (entget (ssname clip_ss m))
                cen (subst (cons 8 "to_hide") (assoc 8 cen) cen)
                cen (entmod cen)
                m(+ m 1)
         )
    )
	(setq i (+ i 1))
	)
(setvar "cmdecho" 1)
)

In attachment is your file after cleanup.

I hope ithis works for you. If it works you should proclame it "final solution".

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Message 10 of 17

hak_vz
Advisor
Advisor

And here is my solution written in a more readable way

 

(defun new_layer (name  color)
(if (= (tblsearch "layer" name) nil)
  (command "._layer" "_n" name "_c" color name "")
  (command "._layer" "_t" name "_on" name "_c" color name "")))
(defun keyValue (key el)(cdr (assoc key el)))  
(defun tbox (e / ent rb elst p rot width textheight a b c d )
(setq ent (entget e))
(setq tb (textbox ent)
	elst (list
	(cons "p1" (keyValue 10 ent))
	(cons "textheight" (keyValue 40 ent))
	(cons "rot" (keyValue 50 ent))
	(cons "width" (caadr tb))
	)
)
(setq p (keyValue "p1" elst) p2 (keyValue "p2" elst) 
	rot (keyValue "rot" elst)
	width (keyValue "width" elst)
	textheight (keyValue "textheight" elst)
	a p b (polar p rot width) c (polar b (+ rot (* pi 0.5)) textheight) d (polar c (+ rot pi) width))
(list a b c d a)
)
(defun c:overlap ( / *error* i ss en_pts clip_ss k m zad cen);
(defun *error* () (princ))
(setvar "cmdecho" 0)
(new_layer "to_hold" 3)
(new_layer "to_hide" 1)
    (setq i 0)
(repeat (sslength (setq   ss (ssget "X" '((0 . "text") (8 . "0")))) )
    (setq en_pts (tbox (ssname ss i))
        clip_ss (ssget "_CP" en_pts '((0 . "TEXT"))) 
        k (sslength clip_ss)
        m 1
        zad (entget (ssname clip_ss 0))
        zad (subst (cons 8 "to_hold") (assoc 8 zad) zad)
        zad (entmod zad)
    )
    (repeat k
        (setq   cen (entget (ssname clip_ss m))
                cen (subst (cons 8 "to_hide") (assoc 8 cen) cen)
                cen (entmod cen)
                m(+ m 1)
         )
    )
	(setq i (+ i 1))
	)

(setvar "cmdecho" 1)
)

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Message 11 of 17

john.uhden
Mentor
Mentor

Are your points actually insertions of a "POINT" block with attributes for elevation and maybe even # and description?

Rescaling them (in place) smaller will make areas more legible if you zoom in.

If your issue is in plotting them, that's another story, possibly requiring you to make an inset viewport that shows them at a smaller scale and tighter zoom.

Or maybe things will clear up a little if you freeze the layer of the # attribute and maybe even the description.

John F. Uhden

0 Likes
Message 12 of 17

hak_vz
Advisor
Advisor

@john.uhden wrote:

Are your points actually insertions of a "POINT" block with attributes for elevation and maybe even # and description?....................

 


@Oliver_C3D  has posted his sample file, so open it to get a clearer picture about what he asks for help.

In his sample he doesn't use blocks with attributes but separate point and text (simplest but best option if you ask me). Obviously he needs to clean up his drawing for printing, but also to simplify his work. All those points and text are useful mainly just to recreate contours.
Rescaling text or block with attributes is not an feasible option in case of printing.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 13 of 17

john.uhden
Mentor
Mentor
I disagree with you but respect your opinion.
Maybe he should be using Civil 3D.

John F. Uhden

0 Likes
Message 14 of 17

Sea-Haven
Mentor
Mentor

I am not going into to much but spent about 3 hours fixing a flat 2d dwg back into a CIV3d surface what should have taken about 5 minutes, the problem was there was no 3d points with elevation, so made them from the text label problem was some of the text had been moved to make readable so had to search manually for all of these and move the 3d point to correct location, making sure breaklines were correct also.

 

So the caution here is make sure you never lose any 3d info.

0 Likes
Message 15 of 17

hak_vz
Advisor
Advisor

Many times I had to repair drawings because surveyor didn't prepare drawing in 3D, what should be a norm. It is good when at least you have elevation text near a line or a point. When you don't have it, it is all left to your pure imagination.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 16 of 17

hak_vz
Advisor
Advisor

I highly respect your opinions as a user who has given enormous contribution to this community. Through the practice we all acquire our experiences, some good, some not so good.


Regarding this topic, the best approach (if using newer version of ACAD) would be to use annotative scale, at least they say so. (https://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2019/ENU/AutoC...). This option is sometimes not applicable, i.e. your client or someone in a design process uses older software that doesn't provide this function.


Through my almost 20 years working on project documentation (mining geotechnics, geology, quarrying and surface exploitation of aggregates....) I have used approach shown above, leave points and hide overlapping text and it worked well.

In one of your latest post you told that you use Acad 2004, At work I use ACAD based product (version 2007) that supports autolisp, but doesn't have visual lisp incorporated. In my work I would definitively need some functionality of Civil 3D, but even such limited software has enabled me to create (with autolisp and eventually C) many functions that it offers (terrain sections, contouring, modeling, various drafting automation....).


Combination of ACAD and autolisp ( or some other programming extension) is sometime more than sufficient to tackle complex problems. Does he really need Civil 3D, maybe yes, maybe not.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Message 17 of 17

john.uhden
Mentor
Mentor
Been there, etc. It's hard to find a good aerial company. I tried to fire
one once but my boss was friends with the owner. Luckily my boss got fired
and I had made friends with the Contracting Officer's Tech. Rep. so we
managed to make a minimal profit, which could otherwise have been a painful
loss..

John F. Uhden

0 Likes