<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Overrule causing slow performance in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/overrule-causing-slow-performance/m-p/9193796#M20701</link>
    <description>&lt;P&gt;I worked it out. The overrule was being loaded everytime I activated the document.&lt;/P&gt;&lt;P&gt;Every document activated or loaded meant it was being triggered an additional time.&lt;/P&gt;&lt;P&gt;I thought the overrule might have been document specific.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So rather than being loaded in&amp;nbsp;docMan_documentActivated it needed to be in the AutoCAD's Initialize Sub.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Dec 2019 16:45:26 GMT</pubDate>
    <dc:creator>SRSDS</dc:creator>
    <dc:date>2019-12-10T16:45:26Z</dc:date>
    <item>
      <title>Overrule causing slow performance</title>
      <link>https://forums.autodesk.com/t5/net-forum/overrule-causing-slow-performance/m-p/9178149#M20700</link>
      <description>&lt;P&gt;I have added an overrule to remove unecessary grippoints on dynamic blocks which is causing a serious performance issue with AutoCAD.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can the impentation be improved?&lt;/P&gt;&lt;P&gt;On intitialize Active Document I have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DBlockClassLibrary.Commands.RemoveGripPoints()&lt;/PRE&gt;&lt;P&gt;And the class is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Geometry
'Remove block insertion point overrule
Namespace DBlockClassLibrary
    Public Class Commands
        Public Class MyGripOverrule
            Inherits GripOverrule
            Public Overrides Sub GetGripPoints(ent As Entity, grips As GripDataCollection, curViewUnitSize As Double, gripSize As Integer, curViewDir As Vector3d, bitFlags As GetGripPointsFlags)
                Try
                    MyBase.GetGripPoints(ent, grips, curViewUnitSize, gripSize, curViewDir, bitFlags)
                    If ent.GetXDataForApplication(AppName) IsNot Nothing Then
                        Dim myXdata As Array = ent.GetXDataForApplication(AppName).AsArray
                        Dim br As BlockReference = TryCast(ent, BlockReference)
                        If br IsNot Nothing Then
                            If myXdata.GetValue(1).value = "View" AndAlso myXdata.GetValue(4).value &amp;lt;&amp;gt; "Section" Then 'adding E67 won't help as basepoint isn't the centrepoint
                                Dim toRemove As GripData = Nothing
                                For Each gd As GripData In grips
                                    If gd.GripPoint = br.Position And gd.GizmosEnabled = True Then 'guessing gizmosenabled has something to do with the basepoint
                                        toRemove = gd
                                        Exit For
                                    End If
                                Next
                                If toRemove IsNot Nothing Then
                                    grips.Remove(toRemove)
                                End If
                            End If
                        End If
                    End If
                Catch
                End Try
            End Sub
        End Class
        Public Shared Sub RemoveGripPoints()
            Overrule.AddOverrule(RXClass.GetClass(GetType(BlockReference)), New MyGripOverrule(), True)
            Overrule.AddOverrule(RXClass.GetClass(GetType(Polyline)), New MyGripOverrule(), True)
            Overrule.Overruling = True
        End Sub
    End Class
End Namespace&lt;/PRE&gt;&lt;P&gt;Can I ask why this might be?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 21:07:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/overrule-causing-slow-performance/m-p/9178149#M20700</guid>
      <dc:creator>SRSDS</dc:creator>
      <dc:date>2019-12-02T21:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Overrule causing slow performance</title>
      <link>https://forums.autodesk.com/t5/net-forum/overrule-causing-slow-performance/m-p/9193796#M20701</link>
      <description>&lt;P&gt;I worked it out. The overrule was being loaded everytime I activated the document.&lt;/P&gt;&lt;P&gt;Every document activated or loaded meant it was being triggered an additional time.&lt;/P&gt;&lt;P&gt;I thought the overrule might have been document specific.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So rather than being loaded in&amp;nbsp;docMan_documentActivated it needed to be in the AutoCAD's Initialize Sub.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 16:45:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/overrule-causing-slow-performance/m-p/9193796#M20701</guid>
      <dc:creator>SRSDS</dc:creator>
      <dc:date>2019-12-10T16:45:26Z</dc:date>
    </item>
  </channel>
</rss>

