How to clear extra lines in AutoCAD. How to clean the DWG file that came to you? How to remove unused blocks in AutoCAD - a simple procedure

Quite often there are situations when it is necessary to delete any unnecessary layer in AutoCAD. How to remove unused layers in AutoCAD will be discussed in this article.

Of course, one could simply make the layer invisible, but then, although it will not be displayed and printed, it will still be stored in the drawing file. And at the same time the file size will be increased.

Therefore, if you are firmly convinced that you no longer need a layer, then it is better not to turn off this layer in AutoCAD, but to delete it.

To delete a layer in AutoCAD, select it in the Layer Properties Manager dialog box and click the Delete button.

When finished, close the Manager and make sure the layer is deleted.

You can also remove layers through the "Clear" command (aka _PURGE).

The above methods do not always work. Here are the main reasons why AutoCAD layer cannot be deleted:

1) The layer contains graphic elements of the drawing, i.e. contains objects.

2) You are trying to delete the "0" layer or the Defpoints layer (find out what these layers are).

3) The layer is current.

4) Previously, blocks were created on this layer, i.e. it contains a description of the block, although the block itself may not already be in the drawing (check out the article about the relationship between blocks and layers in AutoCAD to avoid mistakes!).

These are, perhaps, the main reasons why the layer in AutoCAD is not removed. If the attempt to delete a layer is unsuccessful, a warning message will appear:

And yet, how to remove unnecessary layers in the AutoCAD drawing? To do this, use the sequential instructions below.

Algorithm for removing unnecessary layer

1) Make sure the layer is not current, unfrozen and unlocked.

2) Make sure there are no objects on the layer. It's very easy to do: turn off all layers, then press Ctrl + A to select all objects on the current layer and the Delete key. It is also rational to execute the _LAYDEL command (aka LAYDEL), which allows you not only to delete all objects on a layer, but also to clear it. For this command to be executed correctly, the layer to be cleared of objects must not be current.

3) Delete any block definitions that are not used in the drawing. To do this, run the "Clear" command (read how to remove blocks in AutoCAD).

4) Check if any files are connected to the drawing as external reference links (xref, pictures, etc.).

5) Repeat the above procedure to delete a layer using the Layer Properties Manager or the CLEAR command.

If all else fails, then as an alternative you can simply create new file with the necessary layers and then copy the graphic elements of the drawing from the "dirty" files there.

I advise everyone to read the video tutorial, which will allow you to increase the efficiency of work in AutoCAD several times. You will learn how you can delete all elements that are not present in the graphics space, but at the same time load the file (see the lesson "Creating commands and macros in AutoCAD using the CLEAR command as an example"). Using this material, removing layers in AutoCAD will take place in 2 clicks!

How to delete a layer in AutoCAD containing objects?

A fair question arises: is it possible to delete a layer along with objects in AutoCAD? After all, it can take a long time to remove any unnecessary elements. Especially if the drawing was not originally created by you. It would be much easier to immediately delete AutoCAD layers with all the "trash".

Autocad 2013 - software very resource-demanding operating system and hardware. During installation, "Acad" reserves space in a number of directories on the system local disk and in the volume on which the installation was made. In addition, Autodesk products make changes to the registry in two of its branches and place the license files in two directories on the local media. When reinstalled, the Autocad installer may detect traces of previous version on your computer and will not be able to complete the installation correctly, so from earlier installed program should be completely disposed of.

Preparing to uninstall

The uninstall procedure takes about 20 minutes and is very simple.
Before you start uninstalling Autocad 2013, you need to:

Disable antivirus software so that it doesn't block uninstallation executable files, libraries and registry editing;
- create a system restore point;
- create backup system registry;
- install the Microsoft Fixit utility for Windows;
- quit all applications.

Complete removal of Autocad 2013 and other versions

The first stage of removal is carried out using a standard Windows utilities"Remove programs". First, remove all additions to Autocad, then the CAD system itself. This is followed by the removal of the program by means of the already installed Fixit. After uninstallation, you may be prompted to reboot the system, which must be accepted.

This is followed by the removal of the license files. They are located in the C: \ ProgramData \ FLEXnet directories for Windows 7 or Windows Vista and C: \ Documents and Settings \ All Users \ Application Data \ FLEXnet for the operating room Windows systems XP. The license files in both cases are named adskflex__tsf.data and adskflex__tsf.data.backup.

After uninstalling the program, the working folders of the program remain on the hard disk, which must be deleted manually. The best way to do this - search for folders on system disk as requested by Autodesk. Do not forget to empty the trash, or use the Shift + Delete key combination when deleting.

Finally, you need to clear the Temp folder on the system drive and delete the registry keys HKEY_CURRENT_USER \ Software \ Autodesk and HKEY_LOCAL_MACHINE \ Software \ Autodesk. Then you will need to restart your computer, after which you need to create a new restore point and a new backup copy of the registry, after which you can consider Autocad 2013 completely removed from your computer.

Working with blocks is one of the key advantages of using AutoCAD, which greatly simplifies the construction of projects. But after preparing the drawing, the question becomes reasonable, how to remove the block in AutoCAD if it is not used in the project.

Technique for removing blocks in AutoCAD.

After all, unnecessary definitions seriously affect the overall file size. Therefore, it is logical to want to optimize the project, getting rid of unnecessary ones. Our instructions will allow you to achieve this effect in a matter of minutes.

Why blocks are needed in AutoCAD - the main advantages of work

They can rightfully be considered the crown of drawing automation in AutoCAD. In fact, they are a single object that is created based on primitives.


How to remove unused blocks in AutoCAD - a simple procedure

To delete an entry in the drawing (link), the standard method is also quite suitable. To do this, select the necessary block and press Delete. Or you can use the "Erase" command. But in this case, we need to take into account one detail dangerous for us - the definition itself will still be saved in the file. Therefore, it will continue to be on the list, taking up additional space.

It would seem logical to assume that the AutoCAD Block Editor can help us in this case. But, having experimented a lot with this tool, we were able to absolutely make sure that it is not capable of solving the problem.

But this is not the time to be upset - there are others more effective ways... In particular, you can use the CLEAR command to remove unnecessary definitions. Although there is a catch here - to be sure that this command is actually executed correctly, you need to make sure that there are no block occurrences in the graphics space. Therefore, they will be removed in several stages - first of all, we get rid of the blocks in our drawing. Next, go to the "Applications" menu, select "Utilities" here, then click "Clear".

Although, if desired, you can use and command line by specifying here for a similar command: Operations AutoCAD Utilities - Clear. The opened dialog box "Clean up drawing" allows the user to see in more detail the tree of all named objects, which we can proceed to delete. To clear the entire drawing from unused blocks at once, use the "BLOCKS" section.

If it is necessary to delete only individual objects, then with the left mouse button double-click on the "Blocks" element. A general list of blocks will appear, from which it remains to select the ones required for deletion.

Good day!

Quite often, users ask the question - what can be done with the file Dwg that came from another user? How can I clean it up and optimize it to avoid problems when using it? Quite a few have already been written and rewritten on this topic, I bring my experience.



Indeed, even in a "decent" file, created according to all the rules and recommendations of the developer and in accordance with the experience of other sophisticated users, there is often all sorts of garbage, unnecessary and unused elements. The appearance of such unnecessary objects is inevitable, since when working with a file, you have to redraw the geometry several times, create temporary objects to work out design solutions, and much more. Naturally, you can forget to delete something. Also, if the file was created in "vertical" AutoCAD or in a third-party application, then it may contain proxy objects and unnecessary data about these applications.

In the article, I tried to describe the maximum possible number of actions that can be performed with a DWG file, in each case you need to look at which of them to apply.


1. Delete unused geometry

Description of the problem:

Remove all intermediate sketches, elaboration elements, etc. from the drawing. Often users forget to delete their drafts from finished files, get rid of them. Also, delete geometry that might be mistakenly away from the main body of the drawing.

Solution:

Unfreeze all layers, run the command show all (double tap mouse wheel). If there is distant geometry in the drawing, then you can immediately see it. Use Select All (Ctrl + A) to select all objects in the drawing. After you select all objects, hold down the key Shift and select those objects that you need. Anything else not needed, delete. Be careful! Command Choose all selects objects that lie on disabled layers, so you will delete all objects that you do not see in the current drawing state, but that you may need.

2. Find and remove all invisible objects

Description of the problem:

In drawings, there may be empty invisible objects such as points, empty lines, hidden empty block attributes, invisible faces 3D objects, groups and disguises. They take up disk space and take time to process them - safely delete them!

Solution:

  • To search for hidden points, change their appearance with the command DIALTTOCH (_DDPTYPE), they will become visible

  • To remove empty lines, assign to the variable QTEXTMODE value 1. In this case, all lines will be displayed as an empty frame, even empty ones. Don't forget to set the variable back to 0.
  • To display hidden attributes, enter the command ATTECR (_ATTDISP) and select the Enable option. In this case, all attributes, even hidden ones, will be displayed on the screen. Delete unnecessary ones. Be careful! Hidden attributes can store the information you need.
  • To display hidden edges and faces of 3D objects, assign SPLFRAME value 1. Delete unnecessary elements such as control polygons for spirals, invisible edges of faces and meshes, etc.
  • Start the group manager with the command GROUP (_GROUP) or CLASSICGROUP and remove unnecessary groups
  • To search for invisible masking objects, turn on their frames with the command TFRAMES from Express Tools or set the value of the variable WIPEOUTFRAME= 1 and delete unnecessary ones.

3. Remove duplicate geometry, overlapping lines, arcs and polylines

Description of the problem:

Overlapping lines, repeating objects, and other unnecessary objects are common as you sketch and modify the drawing. They are not visible visually, but in reality there are many of them in every drawing. Clean the drawing from unnecessary graphic debris.

Solution:

Use the command PURGE (_OVERKILL) to remove duplicate or overlapping lines, arcs and polylines. In addition, the command combines partially overlapping or adjacent elements.



4. Remove unused layers

Description of the problem:

Drawings often contain layers that have nothing on them. Delete them. If the layer is not deleted, then there is something on it, or it is frozen in some kind of viewport. Check the state of the layer in all viewports, very often it is impossible to delete an empty layer precisely because it is frozen in the viewport.

Solution:

  • Use the command LAYOBED (_LAYMRG) to merge layers. After merging, the empty layer is removed from the drawing
  • To remove a layer containing objects, use the command LAYDEL (_LAYDEL).
  • In order to understand whether layers are used, set the variable SHOWLAYERUSAGE value 1. In this case, icons will be displayed in the list of layers indicating whether layers are being used. Important! Remember to turn off the display as it slows down the system.

5. Remove unused layer filters

Description of the problem:

Remove unused layer filters. Even if you previously deleted unnecessary layers, the filters in which they appeared will remain.

Solution:

Run the command FILTERS (_FILTERS) and remove unnecessary filters.


6. Remove unused and unnecessary design styles

Description of the problem:

Almost every drawing contains unused text, dimension, table, multileader, multiline, section, detail, and plot styles. Get rid of them. Be careful, you may be deleting a style that is a corporate template customization and may be useful to you in the future!

Solution:

To remove unused styles use the command PURGE (_PURGE)



7. Remove unused blocks, linetypes, shapes, etc.

Solution:

To remove unused objects also use the command PURGE (_PURGE)... As of AutoCAD 2015, this command also removes groups, empty text strings, and data from DGN files (from Bentley's Microstation system). If your AutoCAD is older than 2015, use the AutoCAD DGN Hotfix for 2013 and 2014, or third-party utilities to remove garbage from DGN files.

8. Check the file for errors

Description of the problem:

Check the drawing database for errors

Solution:

To check, use the command CHECK (_AUDIT)... If errors are found in the file, then use the drawing recovery command RECOVER (_RECOVER) to fix them.

9. Delete the history of the creation of 3D solids

Description of the problem:

When building three-dimensional solids in AutoCAD, it is possible to save the history of their construction (system variable SOLIDHIST). However, this data greatly "burdens" the drawing and slows down the work. Delete history if you do not plan to edit bodies.

Solution:

This can be done using the command GRPRED (_BREP), it allows you to remove the story from 3D and compound bodies, and unassociative surfaces.

10. Delete the data of registered applications

Description of the problem:

If you received a file created in any "vertical" AutoCAD, for example, AutoCAD Mechanical, then it may contain information about this program. Delete this data, it takes up space and slows down the file.

Solution:

To delete data on registered applications, enter the command -PURGE (-_PURGE), select an option REGISTER (_REGAPPS) and press Enter... If the command finds data on registered applications, then it will issue an error message for deleting them.

11. Remove geometric and dimensional constraints

Description of the problem:

When building parametric sketches and drawings, users create geometric and dimensional constraints. If you do not need parameterization in this drawing, then you can remove these constraints.

Solution:

Use the command REMOVER (_DELCONSTRAIN), it allows you to remove all geometric and dimensional constraints from a set of objects.

12. Remove unused proxy primitives and proxy objects

Description of the problem:

If the drawing was created using third party applications under AutoCAD, or in "vertical" AutoCAD, it will contain many proxy primitives, some of which are hidden. Proxy primitives are used in AutoCAD and other applications in place of third-party objects created with ObjectARX if the latter is not available. Later, when the application becomes available, proxy primitives and proxy objects are replaced with third-party objects.

Solution:

Assign to variable PROXYSHOW value 2, then all proxy primitives will be displayed as a bounding box. Delete unnecessary ones. The deletion process is described in more detail in the document by Alexei Kulik in paragraph 5, I will not repeat it.

13. Delete unused scales

Description of the problem:

When working with annotative objects, the user creates a lot of annotation scales, some of which eventually turn out to be unused. Delete unnecessary ones.

Solution:

Use the command -SCALELISTEDIT (-_SCALELISTEDIT), select an option Delete and enter *. Any unused scales will be removed.

14. Delete location data

Description of the problem:

In modern versions of AutoCAD, it became possible to include geolocation data in a drawing so that it could be tied to a specific place on the map. Delete location data if you do not plan to use it.

Solution:

Use the command UDALGEO (_GEOREMOVE) to remove all geographic location information from the drawing file.


15. Don't mindlessly dismember blocks.

Description of the problem:

I often meet users who, at the first opportunity, explode blocks in other people's drawings, motivating this by the fact that no one knows what is in these blocks and how they are made, and the dismembered geometry can be corrected easily and quickly, without fear of spoiling the entire drawing when changing block. On the one hand, everything is correct, because when you change a block, you can choose the wrong base point, for example, in this case all occurrences of the block will change and the drawing will become unusable. On the other hand, blocks significantly save memory - if there are 10 primitives in one block and this block is inserted 100 times, then you will work with 110 primitives. If all these blocks are exploded, then you will have to work with 1000 primitives, each of which has a bunch of parameters. Therefore, do not rush to thoughtlessly dismember all the blocks.

Solution:

If you really need to make changes to the block, copy it into a new file, experiment with it, and then make changes to the original file.

A separate story is dynamic blocks. You need to be doubly careful with them, since their dismemberment is almost guaranteed to lead to file corruption.

16. Make the drawing flat

Description of the problem:

Often a drawing contains 3D objects. If the user has a top view turned on, then he simply will not see these objects and will snap to 3D objects when drawing. As a result, you will not get a drawing, but a set of spatial objects, which have different coordinates along the Z axis. To avoid this situation, you need to make a flat drawing. Such drawings can "exit" from programs that work with solid objects, for example, floor plans from AutoCAD Architecture, topographic results from AutoCAD Civil 3D. It is easy to check the drawing for 3D objects - rotate it using the 3D orbit or viewcube.



Solution:

Use the command FLATTEN from the Express Tools package. When using the tool FLATTEN creates a 2D representation of the selected objects and projects them onto the current view plane. The result of the work is 2D-objects, where possible, retaining the original layers, line types, colors and types of objects. This will allow you to avoid creating a drawing with binding primitives to 3D objects.

Alternatively, you can select all geometric objects and use the Properties window to set the Z coordinate to 0.


Conclusion

All of the above methods for cleaning and preparing a file can be useful to users in their daily activities when it is necessary to clean up DWG files. In reality, of course, there is no need to use all these methods at the same time, it is enough to apply several.

If you want to automatically clean the file, then use the program from Alexey Kulik aka kpblc. Read more about it in his blog at the link.


UPD: added the deletion of geo-location data to the post and corrected the item on the removal of unused geometry. Thanks to colleagues Alexey Kulik, Evgeny Elpanov, Alexander Rivilis and Neibosha Novkovich for their help and tips. Thanks friends!

Working with blocks in AutoCAD gives certain advantages (read the article "Features of using blocks in AutoCAD"). However, after creating a drawing, very often there are "extra" blocks that are not used in the project. And this, in turn, significantly affects the file size. Therefore, in this article, we will consider how to delete unnecessary blocks so that there is no confusion, and the file itself weighs less.

Rice. 1. Blocks in AutoCAD are not all used in the project.

How to remove a block in AutoCAD?

Block occurrence in drawing (i.e. reference) is removed in a standard way: you can select a block and press Delete or use the DELETE command. But with such an action, the block definition itself remains in the file, and, accordingly, in the list of blocks.

Unfortunately, the AutoCAD block editor will not help with this.

In order to get rid of unnecessary blocks in AutoCAD, use the "CLEAR" command. To run this command correctly, make sure there are no block occurrences in graphics.

So, removal of blocks in AutoCAD takes place in several stages: first you need to first remove the blocks from the drawing, then go to the application menu (the letter "A" in the left upper corner), select "Utilities" → "Clear". Alternative option- use the command line.

Rice. 2. Removing AutoCAD Blocks - the "Clear" command.

The Clean Up Drawing dialog box displays a tree of all named objects that you can delete.

Rice. 3. Dialog box AutoCAD "Clean up drawing".

To clear the entire drawing of unused blocks, select the BLOCKS section.

By connecting the option "Delete nested elements", you can include nested blocks in the list for deletion.

If you need to delete only some objects, then double-click LMB on the "BLOCKS" element. A list of blocks will open, in which you should select the elements to delete. (see fig. 4).

Rice. 4. List of AutoCAD blocks that can be removed.

It is possible that some blocks may be missing from the list. In this case, check the box next to "View items that cannot be deleted."

Rice. 5. View all existing blocks in the AutoCAD file.

When removing blocks from the list, confirm your action. This option can be suppressed by disabling the "Delete items with confirmation" prompt (see Fig. 6).

Rice. 6. Removing the block in AutoCAD.

Click Remove. An updated list of available block definitions in the drawing appears when you execute the Insert command (see Figure 7).