isolating objects

isolating objects

JN05
Enthusiast Enthusiast
1,540 Views
13 Replies
Message 1 of 14

isolating objects

JN05
Enthusiast
Enthusiast

Good day.

 

I will be very grateful for any help. Can you help me isolate the pertinent water network and water network descriptions into a separate layer.
Using object filtering and using the _filter function does not work.

 

Problem:
The _filter function cannot find leader lines.

 

Description of the problem:
1. objects are located on one layer.
The 2nd task is to isolate the references and descriptions next to the references into a separate layer
3. After using element isolation with the _filter function, this function cannot isolate objects.

 

Best regards and thank you for your help and directions to solve the problem.

Tomasz Stawarz, Co-owner
ZNAK Gdańsk sp. z o.o.
Gdańsk, PL.
Tomasz Stawarz is co-founder and co-owner of ZNAK Gdańsk sp. z o.o., Gdańsk, PL. Tom's speciality is Civil Infrastructure and has been working with AutoCad since 1997.
0 Likes
Accepted solutions (1)
1,541 Views
13 Replies
Replies (13)
Message 2 of 14

pbejse
Mentor
Mentor

@JN05 wrote:

...isolate the pertinent water network and water network descriptions into a separate layer.
Using object filtering and using the _filter function does not work.


Daunting task but doable, what about them lowercase "w" , whats the deail with that?  

 

0 Likes
Message 3 of 14

ronjonp
Advisor
Advisor

What program (person) created this drawing? This is a problem that should be dealt with either on the software side or a swift kick in the arse of the drafter that created this mess. 😶

 

Here's a simple filter to change the layer of your text items.

(defun c:foo (/ s)
  (if (setq s (ssget "_X" '((0 . "TEXT") (1 . "###.##"))))
    (foreach e (mapcar 'cadr (ssnamex s)) (entmod (append (entget e) '((8 . "Text")))))
  )
  (princ)
)
0 Likes
Message 4 of 14

JN05
Enthusiast
Enthusiast

I suspect that the Microstation program made it. This is a file I got from surveyors. Unfortunately, this is a common practice in geodesy.

Tomasz Stawarz, Co-owner
ZNAK Gdańsk sp. z o.o.
Gdańsk, PL.
Tomasz Stawarz is co-founder and co-owner of ZNAK Gdańsk sp. z o.o., Gdańsk, PL. Tom's speciality is Civil Infrastructure and has been working with AutoCad since 1997.
0 Likes
Message 5 of 14

ronjonp
Advisor
Advisor

Try this, it's horribly inefficient and not perfect but a start:

 

(defun c:foo (/ p s s2)
  (cond	((and (setq s (ssget "_X" '((0 . "TEXT") (1 . "###.##"))))
	      (setq s2 (ssget "_X" '((0 . "LWPOLYLINE,LINE"))))
	 )
	 (setq s2 (mapcar 'cadr (ssnamex s2)))
	 (foreach e (mapcar 'cadr (ssnamex s))
	   (entmod (append (entget e) '((8 . "Text"))))
	   (setq p (cdr (assoc 10 (entget e))))
	   (setq s2 (vl-sort s2
			     '(lambda (r j)
				(< (distance p (vlax-curve-getclosestpointto r p))
				   (distance p (vlax-curve-getclosestpointto j p))
				)
			      )
		    )
	   )
	   (entmod (append (entget (car s2)) '((8 . "Text"))))
	 )
	)
  )
  (princ)
)

 

 

0 Likes
Message 6 of 14

JN05
Enthusiast
Enthusiast

Good day.

 

@ronjonp, you are right, but in the industry geodesy in Central and Eastern Europe is the standard, unfortunately.

First of all, thank you for your time. @ronjonp's Lisp works, but seems to need some improvement. I marked them with a blue color (blue numbers: 1,2,3). Lisp doesn't work in these places. @ronjonp, could you please help me find the problem why lisp doesn't select all items?

In the second step, if you could help me, how could the program do the following:
Step A. connect objects (lines, plines) marked in white (white numbers: 1,2,3,4,5,6,7,8) into one 3d polyline. Step B. Automatically assign the height of the pline3d made in step A by returning the elevation marked in yellow (yellow numbers: 1,2,3,4,5)

Step C. Copy the polyline made in step A and give it elevations marked in green (green numbers: 1,2,3,4,5,6,7).

The whole thing is quite a complicated task, but maybe some parts of it could be overcome together with you. Thank you in advance for any help and tips.

 

Best wishes.

Tomasz Stawarz, Co-owner
ZNAK Gdańsk sp. z o.o.
Gdańsk, PL.
Tomasz Stawarz is co-founder and co-owner of ZNAK Gdańsk sp. z o.o., Gdańsk, PL. Tom's speciality is Civil Infrastructure and has been working with AutoCad since 1997.
0 Likes
Message 7 of 14

ronjonp
Advisor
Advisor

Sorry .. I don't have the time to solve this for you. That drawing has too many inconsistencies ( leaders made up of lines and polylines for instance ). If this is something you do all the time you might want to hire a programmer to give you a more thorough solution.

 

I still stand by the notion that this should be solved on the software side where the export is happening. This is a VERY ugly drawing, especially if it's coming from a professional software package.

0 Likes
Message 8 of 14

JN05
Enthusiast
Enthusiast

Does not matter. I wrote to the group, and maybe someone will need our problem, our tips.
I encounter this problem basically on every project. So it will repeat itself over and over again. Perhaps the easiest way to start is to break down all the pieces and put them back together. Later you can convert pline to pline3d. However, I do not know how to program it. Is there someone else who could help us?

Tomasz Stawarz, Co-owner
ZNAK Gdańsk sp. z o.o.
Gdańsk, PL.
Tomasz Stawarz is co-founder and co-owner of ZNAK Gdańsk sp. z o.o., Gdańsk, PL. Tom's speciality is Civil Infrastructure and has been working with AutoCad since 1997.
0 Likes
Message 9 of 14

Sea-Haven
Mentor
Mentor

This looks like data from a say a Esri database ie a Water board output, its got stuff all over the place why is a wd32 lines, plines and on different layers ?

 

We used a data export every day from a Esri data base and yes we did post process but it had consistent output.

 

Like others if you can go back up the chain and find out how the data is exported there may be significant improvements using a different export method.

0 Likes
Message 10 of 14

JN05
Enthusiast
Enthusiast

Unfortunately, I have no influence on how we obtain such unstructured data.

 

State geodetic centers in our country have a very large disorder. It is not possible to ask a government official to fix export esri or Microstation software.

 

Can you help me to isolate these four elements into another layer or change its color in each case.

The red marks are places where nothing changes in the new file.

 

At the moment lisp: author's foo @ronjont (thanks @ronjonp for the help) works, but holes are created. I would like to correct the lisp syntax, if at all possible.

 

Best regards and thank you for your time.

Tomasz Stawarz, Co-owner
ZNAK Gdańsk sp. z o.o.
Gdańsk, PL.
Tomasz Stawarz is co-founder and co-owner of ZNAK Gdańsk sp. z o.o., Gdańsk, PL. Tom's speciality is Civil Infrastructure and has been working with AutoCad since 1997.
0 Likes
Message 11 of 14

ВeekeeCZ
Consultant
Consultant

Done in 60 sec. 

0 Likes
Message 12 of 14

ronjonp
Advisor
Advisor
Accepted solution

@ВeekeeCZ There are more requests than what is provided but nice job 🍻 ... don't you mean 'Gone in 60 Seconds😁 ?

Message 13 of 14

JN05
Enthusiast
Enthusiast

Thank you very much for all your help and support. On behalf of all forum members, we can only ask @ВeekeeCZ for tips and modifications to @ronjonp work.

Thank you very much.

Tomasz Stawarz, Co-owner
ZNAK Gdańsk sp. z o.o.
Gdańsk, PL.
Tomasz Stawarz is co-founder and co-owner of ZNAK Gdańsk sp. z o.o., Gdańsk, PL. Tom's speciality is Civil Infrastructure and has been working with AutoCad since 1997.
0 Likes
Message 14 of 14

ВeekeeCZ
Consultant
Consultant

Well, there is really nothing more to say about it. I've used just basic tools that I learn at school. No customized tool needed. I bet that everybody in this forum is able to do the same, even faster than me!

The only tip I can possibly give you is, rather than asking for customized tools, grab the book to learn to use the build-in tools properly. 

 

But, to not just blabbering, I made a SCREENCAST for you, how it was done. In fact, it took me about 20 sec and that's just because I'm so clumsy.

 

And YES, I do realize that not all drawings are so simple, but the point remains... learn the basics properly first.

Good luck.

0 Likes