Jump to content

AutoCAD .net inside block


marcio
 Share

Recommended Posts

Hi

 

I´m trying to get all objects inside a block, but I cannot find the objects. Can you help me? I´m using the VB.NET and have the following rotine:

 

For

Each acSSObj As SelectedObject In acSSet

If Not IsDBNull(acSSObj) Then

Dim acEnt As Entity = acTrans.GetObject(acSSObj.ObjectId, OpenMode.ForRead)

If TypeOf acEnt Is BlockReference Then

Dim oBr As BlockReference = CType(acEnt, BlockReference)

''I need to list all vertex of Polyline inside the block!!!

End If

End If

Next

Can you help me?

Thanks a lot

Márcio

Link to comment
Share on other sites

There are a few ways of approaching this:

 

Retrieve the Block Table Record that the INSERT references, then iterate through that collection. The routine would have to account for all the Transforms applied to the INSERT to recreate the exact geometry.

 

or

Explode the Insert, then iterate through the remnants.

 

With both methods, it may be necessary to do that process recursively depend on the level of nesting.

 

The other option would be the use of Editor.GetNestedEntity. It requires more user interaction, but simplifies the geometry retrieval.

Link to comment
Share on other sites

Dear Seant

 

Thank you for your help. In realy, finaly I sove my problem. I got the block position and scale, then apply to the entity inside the block.

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...