Selecting nested entities and inheriting from BlockReference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all
My primary goal in this exercise is to select a nested polyline within a block and have access to its grips. I'm still not even sure if it's possible, so if anyone knows either way, please let me know.
However, before I'm even getting to that stage I'm hitting some problems. I have some custom objects which all in some way or another inherit from BlockReference:
BlockReference
-Derived Abstract Class with common attributes
-Derived Concrete Class1
-Derived Concrete Class2
-Derived Concrete Class3
I insert instances of my derived concrete classes using jigs( Class2 for example is created using a polyline jig). However, when I select the block generated from it using a PromptSelectionResult, it returns a BlockReference, not the derived concrete class, not the derived abstract class.
When I try and cast that as the correct class type I get an error telling me I can't cast from the Base class to any of the derived classes.
So, firstly, why is it returning a BlockReference when the object I'm clicking on is an instance of a type that indirectly inherits BlockReference? And is it even possible to gain access to a nested entity's grips? I followed Kean's post here: http://through-the-interface.typepad.com/through_the_interface/2006/12/highlighting_an.html but it doesn't give me what I need.
I've tried ed.GetNestedEntity and the AllowSubSelections property of PromptSelectionOptions and had little joy.
Any ideas?
Cheers
MrRamsden
