At the moment when I import .dwg file all the blocks will be imported as separate elements. Is there a way to avoid that and import the blocks as groups?
You will need to use a third-party plugin like Astute Graphics or HotDoor to auto-join associated broken paths. DWG files always come in as line segments instead of grouped/joined paths.
The question is not about paths, all the lines are imported as they should. The problem is with objects, for example thousands of circles, that are gouped in to a block in .dwg file but are imported as single elements and not as a group. I have searched for a plugin to fix that but haven't found in the descriptions anything about fixing the groups.
dwg does not honor grouping. Everything comes in as a single path.
If I open a dwg with CorelDraw, the blocks are imported as groups. If I open the same dwg file with Illustrator there are no groups, just single elements. I wanted to switch to Illustrator and thought that maybe there is a simple solution for that problem because recreating the blocks/groups would be too time consuming...
If the file originated from CorelDraw - it would still honor the grouping. I've never had a DWG or DXF come through with groups created in another application. They all come in as single items.
can you share a sample file?
The .dwg sharing is not supported here so I put the file in the cloud (hopefully this sharing method works). In this sample all the squares are grouped in to one block and all the circles into another.
This could be scripted since the circles and squares are named. Do you need to process these kinds of files often?
in the meantime, you could manually group them somewhat easily
- open the file
- select one circle
- click on Start Global Edit button on the Properties Panel
- change the stroke
- select all items with the same stroke
- repeat above for squares
It does not help you right now, but just a note: In older versions of Illustrator (at least up to CS5 or CS6) the DWG import used to be able to handle blocks as groups pretty well.