.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Explode dynamic block with visibility states

1 REPLY 1
SOLVED
Reply
Message 1 of 2
FRFR1426
1643 Views, 1 Reply

Explode dynamic block with visibility states

I have a dynamic block with visibility states.
When I use the method BlockReference.Explode(entities) I get in 'entities' all entities including all those who are part of the visibility states not selected. But I want only the entities in the selected visibility state.
What surprises me more, is that entities from other states of visibility, although they were added to the current space, do not appear.

How to retrieve only entities associated with the selected visibility state?
Or how can I identify entities that are not part of the state of visibility?

 

var entities = new DBObjectCollection();
selectedBr.UpgradeOpen();
selectedBr.Explode(entities);

foreach (Entity entity in entities)
{
   currentSpace.AppendEntity(entity);
   tr.AddNewlyCreatedDBObject(entity, true);
}
selectedBr.Erase();

 

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
1 REPLY 1
Message 2 of 2
Alfred.NESWADBA
in reply to: FRFR1426

Hi,

 

I currently have no chance to try it, but if I remember correctly the entities that would be not visible in that state have also set the property .Visible to false. So when you get the DbObjectCollection of exploded entities check this flag and continue just with the ones that have .Visible = true.

 

And now I hope my brain is working OK.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost