What you need isn't available via any documented API, I'm afraid.
You can get it, but it requires the use of acdbEntGet() (which you
have to P/Invoke from managed code).
Attached is a screen grab showing the DXF fields for the object
that stores the visibility states for a dynamic block. That object
is buried in the dynamic block def's extension dictionary, and
is an instance of an "AcDbBlockVisibilityParameter" (that's the
native ObjectARX class and the runtime class name, it's not the
managed wrapper type).
The right side shows the DXF fields for that object, and you can
see the DXF fields for a single visiblity state. The 303 string is the
name of the visiblity state. The next item (code 94) is an integer
that holds the number of ObjectIds that immediately follow, which
are the ids of the block entities that are explicitly visible in that state.
The DXF data for the AcDbBlockVisibilityParameter contains this
same set of fields for each visibility state. Since there can only be
a single visibility state for each dynamic block, you can just seek
the DXF data of the owner object to locate it's ObjectId, and then
call acdbEntGet() on that, to get the visibility state data.
So, the steps are:
1. Get the BlockTableRecord for the dynamic block definition.
2. Get the extension dictionary for the BlockTableRecord.
3. Get ObjectId of the "ACAD_ENHANCEDBLOCK" entry in
the extension dictionary.
4. call acdbEntGet() on ObjectId obtained in step 3, which
returns a ResultBuffer containing TypedValues.
5. Iterate over the TypedValues looking for an item whose group
code is 360, and get the ObjectId stored in the TypedValue's
Value property, then get value of the 'Name' property of the
ObjectId's ObjectClass property, and see if it equals the string
"AcDbBlockVisibilityParameter".
6. Once you've found the AcDbBlockVisibilityParameter object's
ObjectId, call acdbEntGet() on it, and data like that shown on
the right side of the screen grab is returned in a ResultBuffer.
7. Iterate over the TypedValues in the ResultBuffer returned by
acdbEntGet(), looking for an item whose group code is 303,
and whose string value equals the name of the visibility group.
8. Get the next element from the ResultBuffer, which is a 94
group code whose value is the number of ObjectIds that
follow, and then read that many subsequent items having a
group code of 331, and collect the ObjectIds in each into a
list, and you then have the ObjectIds of the block entities
that are explicitly visible in the visiblity state.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010
http://www.acadxtabs.com
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");
wrote in message news:6346232@discussion.autodesk.com...
Sorry for the late response - I had forgotten to mark "Watch this thread".
Yes Tony, that is exactly what I am trying to get at : what entities are visible
for a given visibility state of a dynamic block.
Thank you, Gagan