<?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: regen in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646551#M66521</link>
    <description>Thanks Tony, I understand what I have to modify in my code so that it works more efficient.&lt;BR /&gt;
In Europe they say: "the ball is now completely on my side"</description>
    <pubDate>Fri, 12 Mar 2010 11:09:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-03-12T11:09:15Z</dc:date>
    <item>
      <title>regen</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646539#M66509</link>
      <description>I've made a program and during the running Autocad regenerates the drawing multiple times.&lt;BR /&gt;
Therefor I want to surpress this. I've used the command &lt;BR /&gt;
&lt;BR /&gt;
 ApplicationServices.Application.DocumentManager.MdiActiveDocumentdatabase..Regenmode = False &lt;BR /&gt;
&lt;BR /&gt;
on top of the code. And True on the bottom code.&lt;BR /&gt;
&lt;BR /&gt;
Now I get the question within Autocad "About to regen proceed OK/Cancel". I want to surpress  this question and I want to regen automatically (last line of my code).&lt;BR /&gt;
&lt;BR /&gt;
How can I do this?</description>
      <pubDate>Wed, 10 Mar 2010 11:30:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646539#M66509</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-10T11:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: regen</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646540#M66510</link>
      <description>You need to set "AUTOREGEN" to ON. &lt;BR /&gt;
Then you can stop the screen from showing any updates until your done with your code. &lt;BR /&gt;
&lt;BR /&gt;
LockView&lt;BR /&gt;
... do stuff&lt;BR /&gt;
unLockView&lt;BR /&gt;
&lt;BR /&gt;
{code}&lt;BR /&gt;
Imports Autodesk.AutoCAD.Interop&lt;BR /&gt;
Imports Autodesk.AutoCAD&lt;BR /&gt;
&lt;BR /&gt;
Public Class LockView&lt;BR /&gt;
&lt;BR /&gt;
    Declare Function LockWindowUpdate Lib "user32" (ByVal hWndLock As Long) As Long&lt;BR /&gt;
&lt;BR /&gt;
    Sub lockView()&lt;BR /&gt;
        LockWindowUpdate(ThisDrawing.HWND)&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
    Sub unlockView()&lt;BR /&gt;
        LockWindowUpdate(0)&lt;BR /&gt;
        regen()&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
    Function ThisDrawing() As AcadDocument&lt;BR /&gt;
        'The COM active drawing&lt;BR /&gt;
        Dim objThisDrawing As AcadDocument&lt;BR /&gt;
        'Get the COM AutoCAD application object&lt;BR /&gt;
        Dim objAcadApp As AcadApplication = CType(Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication, AcadApplication)&lt;BR /&gt;
        Try&lt;BR /&gt;
            'Get the COM active drawing&lt;BR /&gt;
            objThisDrawing = objAcadApp.ActiveDocument&lt;BR /&gt;
            Return objThisDrawing&lt;BR /&gt;
        Catch ex As System.Exception&lt;BR /&gt;
        End Try&lt;BR /&gt;
        Return Nothing&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
    Sub regen()&lt;BR /&gt;
        Dim MyDWG As Autodesk.AutoCAD.ApplicationServices.Document&lt;BR /&gt;
        MyDWG = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument&lt;BR /&gt;
        Dim MyEd As EditorInput.Editor&lt;BR /&gt;
        MyEd = MyDWG.Editor&lt;BR /&gt;
        MyEd.Regen()&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
End Class&lt;BR /&gt;
{code}</description>
      <pubDate>Wed, 10 Mar 2010 19:44:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646540#M66510</guid>
      <dc:creator>arcticad</dc:creator>
      <dc:date>2010-03-10T19:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: regen</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646541#M66511</link>
      <description>I'm sorry, I'm not familiar with interop and the given code gives 2 errors in vb Express 2008&lt;BR /&gt;
&lt;BR /&gt;
Imports Autodesk.AutoCAD.Interop : VB doesn't find this namespace&lt;BR /&gt;
AcadDocument: VB doesn't recognize this document&lt;BR /&gt;
&lt;BR /&gt;
What did I do wrong ?</description>
      <pubDate>Wed, 10 Mar 2010 21:03:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646541#M66511</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-10T21:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: regen</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646542#M66512</link>
      <description>You need to add a reference to the &lt;BR /&gt;
&lt;BR /&gt;
"AutoCAD 2010 Type Library"&lt;BR /&gt;
"AutoCAD/ObjectDBX Common 18.0 Type Library"&lt;BR /&gt;
&lt;BR /&gt;
go to references and com and find it in the list. &lt;BR /&gt;
&lt;BR /&gt;
Adjust versions as needed.</description>
      <pubDate>Wed, 10 Mar 2010 21:34:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646542#M66512</guid>
      <dc:creator>arcticad</dc:creator>
      <dc:date>2010-03-10T21:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: regen</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646543#M66513</link>
      <description>Ok, the interop problem is solved.&lt;BR /&gt;
&lt;BR /&gt;
But I still get:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Error	1	Type 'AcadDocument' is not defined."</description>
      <pubDate>Wed, 10 Mar 2010 21:59:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646543#M66513</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-10T21:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: regen</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646544#M66514</link>
      <description>You need to add a reference to these two dll files&lt;BR /&gt;
and , in properties, set copy local to false for each. &lt;BR /&gt;
&lt;BR /&gt;
go to add references and browse and select these two. &lt;BR /&gt;
&lt;BR /&gt;
c:\Program Files\AutoCAD 2010\&lt;BR /&gt;
&lt;BR /&gt;
acdbmgd.dll&lt;BR /&gt;
acmgd.dll</description>
      <pubDate>Wed, 10 Mar 2010 22:16:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646544#M66514</guid>
      <dc:creator>arcticad</dc:creator>
      <dc:date>2010-03-10T22:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: regen</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646545#M66515</link>
      <description>I'm not sure where you're getting this from, but LockWindowUpdate()&lt;BR /&gt;
is not how you prevent updates.  In fact, that API should never be used&lt;BR /&gt;
because It causes the entire desktop to be redrawn when you call it with&lt;BR /&gt;
an argument of 0.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2010&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;ARCTICAD&gt; wrote in message news:6352436@discussion.autodesk.com...&lt;BR /&gt;
You need to set "AUTOREGEN" to ON.&lt;BR /&gt;
Then you can stop the screen from showing any updates until your done with your &lt;BR /&gt;
code.&lt;BR /&gt;
&lt;BR /&gt;
LockView&lt;BR /&gt;
... do stuff&lt;BR /&gt;
unLockView&lt;BR /&gt;
&lt;BR /&gt;
{code}&lt;BR /&gt;
Imports Autodesk.AutoCAD.Interop&lt;BR /&gt;
Imports Autodesk.AutoCAD&lt;BR /&gt;
&lt;BR /&gt;
Public Class LockView&lt;BR /&gt;
&lt;BR /&gt;
    Declare Function LockWindowUpdate Lib "user32" (ByVal hWndLock As Long) As &lt;BR /&gt;
Long&lt;BR /&gt;
&lt;BR /&gt;
    Sub lockView()&lt;BR /&gt;
        LockWindowUpdate(ThisDrawing.HWND)&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
    Sub unlockView()&lt;BR /&gt;
        LockWindowUpdate(0)&lt;BR /&gt;
        regen()&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
    Function ThisDrawing() As AcadDocument&lt;BR /&gt;
        'The COM active drawing&lt;BR /&gt;
        Dim objThisDrawing As AcadDocument&lt;BR /&gt;
        'Get the COM AutoCAD application object&lt;BR /&gt;
        Dim objAcadApp As AcadApplication = &lt;BR /&gt;
CType(Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication, &lt;BR /&gt;
AcadApplication)&lt;BR /&gt;
        Try&lt;BR /&gt;
            'Get the COM active drawing&lt;BR /&gt;
            objThisDrawing = objAcadApp.ActiveDocument&lt;BR /&gt;
            Return objThisDrawing&lt;BR /&gt;
        Catch ex As System.Exception&lt;BR /&gt;
        End Try&lt;BR /&gt;
        Return Nothing&lt;BR /&gt;
    End Function&lt;BR /&gt;
&lt;BR /&gt;
    Sub regen()&lt;BR /&gt;
        Dim MyDWG As Autodesk.AutoCAD.ApplicationServices.Document&lt;BR /&gt;
        MyDWG = &lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument&lt;BR /&gt;
        Dim MyEd As EditorInput.Editor&lt;BR /&gt;
        MyEd = MyDWG.Editor&lt;BR /&gt;
        MyEd.Regen()&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
End Class&lt;BR /&gt;
{code}&lt;/ARCTICAD&gt;</description>
      <pubDate>Thu, 11 Mar 2010 03:19:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646545#M66515</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-11T03:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: regen</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646546#M66516</link>
      <description>Rather than trying to cover up the problem, how about&lt;BR /&gt;
finding out what's causing it to start with?&lt;BR /&gt;
&lt;BR /&gt;
What is your code doing that is triggering the regens?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2010&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;FALLRIGHT&gt; wrote in message news:6351959@discussion.autodesk.com...&lt;BR /&gt;
I've made a program and during the running Autocad regenerates the drawing &lt;BR /&gt;
multiple times.&lt;BR /&gt;
Therefor I want to surpress this. I've used the command&lt;BR /&gt;
&lt;BR /&gt;
 ApplicationServices.Application.DocumentManager.MdiActiveDocumentdatabase..Regenmode= Falseon top of the code. And True on the bottom code.Now I get the question within Autocad "About to regen proceed OK/Cancel". I wantto surpress  this question and I want to regen automatically (last line of mycode).How can I do this?&lt;/FALLRIGHT&gt;</description>
      <pubDate>Thu, 11 Mar 2010 03:19:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646546#M66516</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-11T03:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: regen</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646547#M66517</link>
      <description>Hey Tony, I was using the code to zoom around the screen and grab objects using intersectwith. I didn't want the user see all the zooming,   turning off the screen temporarily works. The Issue I had was that it didn't work if the lines were off the screen. &lt;BR /&gt;
&lt;BR /&gt;
as for the argument of 0,&lt;BR /&gt;
is there a way to only affect the window? I don't know of another cleaner method&lt;BR /&gt;
&lt;BR /&gt;
Thanks.</description>
      <pubDate>Thu, 11 Mar 2010 03:39:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646547#M66517</guid>
      <dc:creator>arcticad</dc:creator>
      <dc:date>2010-03-11T03:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: regen</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646548#M66518</link>
      <description>I don't think there's any remedy for the problem that LockWindowUpdate()&lt;BR /&gt;
has, other than not using it.&lt;BR /&gt;
&lt;BR /&gt;
As far as why you need to zoom the display, I think that's really the&lt;BR /&gt;
problem. You shouldn't need to do that. If you're using object selection&lt;BR /&gt;
to find objects, that's not a very reliable to start with.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2010&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;ARCTICAD&gt; wrote in message news:6352722@discussion.autodesk.com...&lt;BR /&gt;
Hey Tony, I was using the code to zoom around the screen and grab objects using &lt;BR /&gt;
intersectwith. I didn't want the user see all the zooming,   turning off the &lt;BR /&gt;
screen temporarily works. The Issue I had was that it didn't work if the lines &lt;BR /&gt;
were off the screen.&lt;BR /&gt;
&lt;BR /&gt;
as for the argument of 0,&lt;BR /&gt;
is there a way to only affect the window? I don't know of another cleaner method&lt;BR /&gt;
&lt;BR /&gt;
Thanks.&lt;/ARCTICAD&gt;</description>
      <pubDate>Thu, 11 Mar 2010 05:00:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646548#M66518</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-11T05:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: regen</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646549#M66519</link>
      <description>Inside my code: 2 viewports are created: this causes 2 times an automatically regen.&lt;BR /&gt;
&lt;BR /&gt;
Inside my code I call 10 times a subroutine that replaces text: this causes 10 times an automatically regen.&lt;BR /&gt;
f.i. tekstreplace("&amp;lt;&lt;EXAMPLE&gt;&amp;gt;", "example")    (code subroutine in attach)&lt;BR /&gt;
I can change the subroutine so that is an "array of strings" is send with the command so that it only regens 1 time.&lt;BR /&gt;
&lt;BR /&gt;
But the sum of all regens remains 2 + 1 times. That's 2 times too much for me.&lt;BR /&gt;
That is the reason for me to find a way to set regenauto off (and surpress all messages from autocad) and set it on after all the code has finished.&lt;/EXAMPLE&gt;</description>
      <pubDate>Thu, 11 Mar 2010 11:16:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646549#M66519</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-11T11:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: regen</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646550#M66520</link>
      <description>The code to modify text shouldn't trigger a regen unless it is&lt;BR /&gt;
called from a command handler, and the command is being&lt;BR /&gt;
invoked multiple times. You don't show how or where you are&lt;BR /&gt;
calling from.&lt;BR /&gt;
&lt;BR /&gt;
If you're modifying multiple objects, you should do it within&lt;BR /&gt;
a single transaction.  Start a transaction before you call the&lt;BR /&gt;
method that modifies the text, and end the transaction after&lt;BR /&gt;
you've finished modifying all the text.&lt;BR /&gt;
&lt;BR /&gt;
As far as creating the viewports go, I don't think there is any&lt;BR /&gt;
way around that one, and LockWindowUpdate() will not stop&lt;BR /&gt;
it from happening.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD&lt;BR /&gt;
Supporting AutoCAD 2000 through 2010&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;FALLRIGHT&gt; wrote in message news:6352802@discussion.autodesk.com...&lt;BR /&gt;
Inside my code: 2 viewports are created: this causes 2 times an automatically &lt;BR /&gt;
regen.&lt;BR /&gt;
&lt;BR /&gt;
Inside my code I call 10 times a subroutine that replaces text: this causes 10 &lt;BR /&gt;
times an automatically regen.&lt;BR /&gt;
f.i. tekstreplace("&amp;lt;&lt;EXAMPLE&gt;&amp;gt;", "example")    (code subroutine in attach)&lt;BR /&gt;
I can change the subroutine so that is an "array of strings" is send with the &lt;BR /&gt;
command so that it only regens 1 time.&lt;BR /&gt;
&lt;BR /&gt;
But the sum of all regens remains 2 + 1 times. That's 2 times too much for me.&lt;BR /&gt;
That is the reason for me to find a way to set regenauto off (and surpress all &lt;BR /&gt;
messages from autocad) and set it on after all the code has finished.&lt;/EXAMPLE&gt;&lt;/FALLRIGHT&gt;</description>
      <pubDate>Thu, 11 Mar 2010 19:13:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646550#M66520</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-11T19:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: regen</title>
      <link>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646551#M66521</link>
      <description>Thanks Tony, I understand what I have to modify in my code so that it works more efficient.&lt;BR /&gt;
In Europe they say: "the ball is now completely on my side"</description>
      <pubDate>Fri, 12 Mar 2010 11:09:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regen/m-p/2646551#M66521</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-03-12T11:09:15Z</dc:date>
    </item>
  </channel>
</rss>

