- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have to repost this because people may think, last post was answered, but it wasn't and still I am struggling and need a pro to help me here .
Have a overruled block with attribute in it , I just registered the attributes in my overrule class.
I need to overule (make it simple) just lines ( let's say make them circles) and don't want to show the attributes neither do the rest of objects in block . But if user double click on overruled block I need to show attribute tag input table (Dialog). And don't want to show other objects in block if any exists.
Below is my code and I thought solution would be easy and I have to REM ( or remove the line )
MyBase.WorldDraw(drawable, Wd).
But when I do that the block is not selectable and a regen crash the autocad . That was my story and here is the code.
I appreciate any help here. For your convenience a simple block is attached.
Janet
Public Class toverrule
Inherits Autodesk.AutoCAD.GraphicsInterface.DrawableOverrule
Public Overrides Function WorldDraw(ByVal drawable As Autodesk.AutoCAD.GraphicsInterface.Drawable, ByVal Wd As Autodesk.AutoCAD.GraphicsInterface.WorldDraw) As Boolean
Dim myBlock As BlockReference = CType(drawable, BlockReference)
If Not myBlock.Database Is Nothing Then
Dim ListEnts As New List(Of Entity)
Dim MyDBObjColl As DBObjectCollection = New DBObjectCollection()
myBlock.Explode(MyDBObjColl)
Dim myline As New Line
For Each mydbobj As DBObject In MyDBObjColl
If TypeOf mydbobj Is Line Then
myline = TryCast(mydbobj, Line)
Dim mycircle As New Circle
mycircle.Radius = myline.Length
mycircle.Center = myline.StartPoint
ListEnts.Add(mycircle)
ElseIf TypeOf mydbobj Is AttributeDefinition Then
Dim mycircle As New Circle
mycircle.Radius = myline.Length / 2
mycircle.Center = myline.StartPoint
ListEnts.Add(mycircle)
End If
Next
For Each Ent As Entity In ListEnts
Ent.WorldDraw(Wd)
Ent.Dispose()
Next
MyBase.WorldDraw(drawable, Wd)
End If
Return True
End Function
End Class
Solved! Go to Solution.