How to extract nested objects from a block

Hello,

I have a Civil3D file that has a block that is made up of a closed polyline with a hatch. I would like to extract the polyline from the block as a polycurve. The ultimate goal is to determine the area enclosed within the polycurve, which I know how to do however, I am having trouble interacting with objects that are nested within blocks.

Any help would be greatly appreciated.

Thank you

Could you share relevant dwg file here through Dropbox or similar?

The dropbox link to view the dwg is below. It is a very simple dwg including only a block. The block is made up of a closed polyline and a hatch. The end goal would be to determine the square footage of polyline in the block.

Thanks!

@DMeegan I’m not able to access what you have shared.

@Kulkul sorry about that, can you try the link below.

It didn’t work. If you’re trying to extract polylines from blocks then you could get this way:

3 Likes

@Kulkul awesome thank you, that looks like it is close to what I will need to do. Accessing the nexted items with list.last is what I was missing I think.

I have a follow up question regarding the coordinate system. Does that method return the coordinate system used on the blockReference in the dwg?

Hi @Kulkul,

Is it also possible to read the hatch from a blockreference?

Great! Mark the post as solved.

Yes. That coordinate system is what you have placed on the Model Space.

Hi @Daan

This would be another topic of the day.

1 Like