Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert inside Insert #275

Open
merco opened this issue Feb 7, 2024 · 1 comment
Open

Insert inside Insert #275

merco opened this issue Feb 7, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@merco
Copy link

merco commented Feb 7, 2024

I can't figure out how can I iterate over all "insert objects".

This is the file:

UniRif4-63125_151-Rev2.zip

With this code I'm able to get first level of Insert

For Each entt In thedoc.Entities.OfType(Of ACadSharp.Entities.Insert)

But inside "FILLER" insert I have other child insert

immagine

How can I get their attributes values?

@merco merco added the bug Something isn't working label Feb 7, 2024
@DomCR
Copy link
Owner

DomCR commented Feb 7, 2024

Hi @merco

I don't know much about VB, but I you can check this code in C# and see if it helps you:

	var inserts = doc.Entities.OfType<Insert>().Where(e => e.Block.Name == "FILLER");
	foreach (Insert insert in inserts)
	{
		foreach (var att in inserts.Select(b => b.Block.Entities.OfType<Insert>().Select(i => i.Attributes)))
		{
			// To something with the attribute
		}
	}

What this code does is to get the Inserts called FILLER and iterate throw the entities in the Block record and get the nested inserts, and then select the attributes in it.

Let me know if this helps.

@DomCR DomCR added help wanted Extra attention is needed and removed bug Something isn't working labels Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants