Finding (and closing?) snapped polylines

Finding (and closing?) snapped polylines

Anonymous
不适用
3,607 次查看
18 条回复
1 条消息(共 19 条)

Finding (and closing?) snapped polylines

Anonymous
不适用

Hi there,

I've got a series of drawings, created by contractors, where there are open polylines that should be closed, but have only been snapped. These should be exported as polygons, but currently only export as lines. Is there a way to find these polylines, and ideally close them? At present I'm doing it manually by scanning the drawing, but this is very time consuming. It's not possible to just close everything, because the majority of the features should be open lines.  I attach a small section of a sample drawing to show the problem.

Thanks

0 个赞
3,608 次查看
18 条回复
回复 (18)
2 条消息(共 19 条)

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> These should be exported as polygons

From your drawing, how should open areas build up closed borders to get polygons?

I have marked you only a few open positions where borders can't be closed without knowing the reality from that object structure...

 

20190308_224356.png

 

How should the computer know which connections to do to close these areas?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2025
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 个赞
3 条消息(共 19 条)

ChicagoLooper
Mentor
Mentor

Depending on your drawing and what you want to achieve, the 'Clean Up' function can close those polylines. While in your drawing, go to Tools tab>Map Edit panel>Cleanup. Be sure to do this on a COPY of your dwg so you'll still have the Contractor drawings in their original state.

 

There are many options that Cleanup offers. Undershoots will close will close the corner 'gaps' while overshoots will shorten a line that extends beyond the corner.

 

To read about Autocad's explanation of undershoots, click >>HERE<<.

Chicagolooper

EESignature

0 个赞
4 条消息(共 19 条)

ChicagoLooper
Mentor
Mentor

ProSoft had a good video on Map 3D Cleanup-Tools. To watch, click >>HERE<<

Chicagolooper

EESignature

5 条消息(共 19 条)

Anonymous
不适用

Hi Alfred,

Sorry for the delayed reply, and apologies that I didn't explain clearly. It is precisely because I don't want to close everything that I have the problem. I only want to close those features that have been snapped closed, because they should be closed, unlike all the rest which should be open.

I attach a revised version of the drawing, in which I've drawn orange circles around the features I want to close.

 

I've also tried using Clean-up, but depending on the settings, especially undershoots/simplify etc, it either doesn't close, or if it does, it also simplifies the feature beyond what I want, thereby distorting it.

 

I hope you can help.

0 个赞
6 条消息(共 19 条)

parkr4st
Advisor
Advisor

Cleanup.jpg

 

Did you select the Interactive option radio button.  if you do there will be a window which allows you to fix or remove each closure one by one

 

 

7 条消息(共 19 条)

Anonymous
不适用

Thanks for that. Unfortunately, there are likely to be hundreds in some drawings, which is why I'm trying to find some way to do it automatically, but only for those that are already snapped closed.

0 个赞
8 条消息(共 19 条)

ChicagoLooper
Mentor
Mentor

You can do it using MAPCLEAN command. Go to Tools tab=>Map Edit panel=>Drawing Clean Up icon. The parameters you want are:

  1. Extend Undershoots: This will make two lines meet at their apparent intersection.  There's a tolerance associated with undershoots so any distance, or gap, above the tolerance will remain open while gaps at or below will be closed. You can even make tolerance=0 so only lines that are already touching will be affected. Establishing tolerance is subjective, so choose it carefully.
  2. Dissolve Pseudo Nodes: At the point where the endpoints of two separate lines meet there are two vertices where one vertex is directly on top of another. Dissolving will keep one vertex and eliminate the other. Because the command will eliminate one of the vertices, the two lines have no choice but to join.

The parameters in the list will be performed in sequence, from top to bottom, so how they are displayed is critical.

 

Using a new, clean drawing, you can test MAPCLEAN using the parameters shown above and by drawing 5 entities: one closed polygon, such as a rectangle, and four individual lines arranged in the shape of a rectangle without any gaps at the four corners (tolerance=0). Perform MAPCLEAN on the 5 entities.

 

Selecting the Cleanup Actions for MAPCLEAN command.Selecting the Cleanup Actions for MAPCLEAN command.

 

 

 

Chicagolooper

EESignature

9 条消息(共 19 条)

Anonymous
不适用

Hi there,

I don't know why, but for me that doesn't work, neither on the simple version, nor my test data. Please could you try it on this file and tell me if it works? If it does then I'm very puzzled 沮丧表情

0 个赞
10 条消息(共 19 条)

ChicagoLooper
Mentor
Mentor

Your latest uploaded dwg file contained two polygons. According to the Properties Palette, one polygon was closed white the other was not. The were no gaps at the corners of either polygon.

 

You can add Simplify Objects to your existing Map Cleanup action list which will 'close' the polygon. Is a closed polygon what you want? If it is, then good. If not, you'll need to provide a better and more thorough explanation of what you're trying to achieve.

 

Add Simplify Objects to the  action list.Add Simplify Objects to the action list.

Chicagolooper

EESignature

0 个赞
11 条消息(共 19 条)

Anonymous
不适用

Closed is what I want, but my problem is that there are some quite intricate features, i.e. with curves that require multiple vertices. When I simplify enough to close, they are also simplified and deformed? I've tried various parameters, but have not found one that closes, without significant distortion.

0 个赞
12 条消息(共 19 条)

ChicagoLooper
Mentor
Mentor

It's sounds like you are not interested in achieving what you simply wanted in your opening post. You have failed to disclose your final outcome and it is causing issues with giving you a usable workflow. Please be more forthcoming?

 

  1. What are the polylines(or entities) that are snapped? Lines, polygons, polylines, arcs, circles, splines, etc.?  
  2. Please explain 'snapped polylines' in a way a first semester AutoCAD student would be able to understand it.
  3. Why do you need to change a 'snapped polygon' into a 'closed polygon?' What do you expect to accomplish?

Chicagolooper

EESignature

0 个赞
13 条消息(共 19 条)

Anonymous
不适用

My apologies if this wasn't sufficiently clear. The end product for all of this is a GIS using ESRI. For this I need to have closed polylines that will import as polygons. All the features in the drawing are polylines, as I have already used MapCleanup to convert from circles, arcs etc. At present what I have is a mix of properly closed polylines, which will export as polygons, and snapped polylines, which won't. By snapped polylines, I mean that the contractor has simply used the object snap function when drawing the polyline, rather than actually closing using the "close" command. I therefore need to actually close all of those polylines that have just been snapped closed, so that they will export as polygons. However, there are lots of other features that I do not want to close. Both those I wish to close and those I don't number in the hundreds, hence I need to do this automatically, rather than interactively.

Does that make more sense?

0 个赞
14 条消息(共 19 条)

ChicagoLooper
Mentor
Mentor

Thank you for providing the additional information. The issue is your title to the opening post. A more appropriate title would be, How do I Export AutoCAD Polylines and Polygons to Shapefile so All Resulting Polygons are Closed?

 

Regardless of whether the polygons are closed or snapped, you are exporting to shapefile.  The exported shapefile must be a vector such as a 1) polygon, 2) line or 3) point. (You cannot combine vector types so if you need to export all three types of vectors, you'll need to export to three separate shapefiles.)

 

Go to output Tab=>Map Data Transfer=>DWG to SDF button. In next dialog, change 'Files of type:' from SDF to ESRI Shapefile then Name and Save your shapefile in a folder.

 

In the Export dialog there are 3 tabs. Use the following to select your settings. If you use this method, you don't need 'Drawing Clean Up.' The key to accomplishing what you need is on the 3rd image, Options Tab.

 

 

1-Choose a method to select the entities for your shapefile.1-Choose a method to select the entities for your shapefile.2-You may choose attributes to populate the shapefiles's dbf.2-You may choose attributes to populate the shapefiles's dbf.3-Check the box labeled 'Treat closed polylines as polygons.'3-Check the box labeled 'Treat closed polylines as polygons.'

 

 

Chicagolooper

EESignature

0 个赞
15 条消息(共 19 条)

Anonymous
不适用

Thanks for that, but the point is that if the polylines are not closed then they will not export as polygons.

0 个赞
16 条消息(共 19 条)

ChicagoLooper
Mentor
Mentor

Select all your closed and non-closed polygons. go to Properties Palette, scroll to Misc at the bottom of the palette, then change 'Closed' to YES using the dropdown. 

 

In Properties Palette, change 'Closed' to YES.In Properties Palette, change 'Closed' to YES.

Chicagolooper

EESignature

0 个赞
17 条消息(共 19 条)

Anonymous
不适用

Unfortunately, I can't do that, because, as I said at the beginning there are a large number of features that are not supposed to be closed.

0 个赞
18 条消息(共 19 条)

ChicagoLooper
Mentor
Mentor

Back to Drawing Cleanup. Here's a video that demonstrates how to close polylines so they'll be polygons. It does not close polylines with 'gaps' it only closes those polylines where the contractor meant to create polygons but drew polylines instead of polygons. 

 

Since you are unable or unwilling to provide your drawing, or a reasonable 'sample' of your drawing, I will have to guess what you are trying to accomplish. In the video below, white objects are closed polygons while red are polylines that have been 'snapped closed' and have the appearance of polygons. Some of the red objects have gaps so they are not polygons they are technically polylines.

 

The video shows Map Cleanup being performed on all line work in the drawing, whether polyline or polygon, whether closed or snapped closed, all entities are subjected to the map clean up operation. The results of the operation are considered new entities and are placed on a separate layer. The original objects are not erased and remain as-is. After the completion of Map Cleanup, you may select all new objects and export them to a polygon shapefile. This export operation will only include the polygons--the polylines (the objects with gaps) will be ignored (even though they were selected along with the new polygons) and won't be part of the new shapefile.

 

Click >>HERE<< to watch the video.

Chicagolooper

EESignature

0 个赞
19 条消息(共 19 条)

Anonymous
不适用

Hi there,

Unless I'm missing something your video has the exact same parameters as the screen shots provided earlier, which for whatever reason do not work for me. I had attached a version of my drawing with the original question, and a revised one with my reply to Alfred, but here is another. If you can get it to work so that those features within the circles close, but nothing else does, and none of the features are distorted I will be most grateful, because I can't. I've tried using your instructions, as well as the suggestions by others, but for some reason they do not work. Is it possible that there is some background setting I'm unaware of?

I appreciate this is frustrating, but it is equally so for me.

Thank you.

0 个赞