.NET

Reply
Valued Contributor
FRFR1426
Posts: 92
Registered: ‎04-05-2012
Message 1 of 2 (581 Views)
Accepted Solution

Explode dynamic block with visibility states

581 Views, 1 Replies
10-02-2012 08:59 AM

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();

 

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 -

*Expert Elite*
Alfred.NESWADBA
Posts: 9,400
Registered: ‎06-29-2007
Message 2 of 2 (579 Views)

Re: Explode dynamic block with visibility states

10-02-2012 09:03 AM 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
-------------------------------------------------------------------------
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!