<?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: Retrieving boundaries from non-associative hatch in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385673#M84294</link>
    <description>Ok, I may have spoken too soon about things working - wierd things are happening.  I've basically got an MFC application calling a VB.NET library which calls AutoCAD.  The VB.NET code does the SendCommand, and by default AutoCAD is set to be not visible (setting the AcadApplication.Visible to false).  When my MFC app starts up, everything's ok, and I can load normal files with no problem.  When I load one that requires the SendCommand("(command -""hatchedit""...) thing, when that SendCommand is called, the AutoCAD instance becomes visible and pops up.  Not a problem - just reset the Visible flag on the AcadApplication again right after the SendCommand.&lt;BR /&gt;
&lt;BR /&gt;
But what happens is when I load another file after that, I get an error and the AutoCAD instance goes away.  The error message I get is "The object invoked has disconnected from its clients".  I'm not getting them any more, but once there were message boxes saying exceptions occurred in "AcObjClassImp.arx" and "Acopm.arx".&lt;BR /&gt;
&lt;BR /&gt;
The other wierd thing is that if I let the AutoCAD instance become visible, or start it off being visible, everything works fine.  I'm wondering if there's some error or something that AutoCAD need to tell me about so it pops up.&lt;BR /&gt;
&lt;BR /&gt;
I can put in code in my app to reconnect if it finds itself disconnected, but I'd rather figure out what I'm doing wrong here.&lt;BR /&gt;
&lt;BR /&gt;
Edit:  Also, the -hatchedit command does not seem to be able to handle hatch entities in block definitions.  Bummer.

Message was edited by: jnelso99</description>
    <pubDate>Fri, 29 Jul 2005 22:01:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-07-29T22:01:28Z</dc:date>
    <item>
      <title>Retrieving boundaries from non-associative hatch</title>
      <link>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385659#M84280</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
We're writing a VB.NET application to perform custom processing on AutoCAD files.  The app reads in entities and performs various calculations on them.  One of the tasks requires  the boundaries from hatch objects, both associative and non-associative.  Associative is fine (GetLoopAt function works), but the latter does not (GetLoopAt returns Nothing).  I've seen the "HatchB" AutoLisp file floating around and will probably start poking around in that to see what's going on and if it will be of any help, but in the meantime, is there any possible way to get the boundary objects of a non-associative hatch entity via .NET?  This is one of those "if it can't be done, the whole project is pretty much shot" kind of thing...&lt;BR /&gt;
&lt;BR /&gt;
If any other details are needed, please let me know.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!</description>
      <pubDate>Thu, 21 Jul 2005 18:33:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385659#M84280</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-21T18:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving boundaries from non-associative hatch</title>
      <link>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385660#M84281</link>
      <description>Hmm...looks like the only way is to call that Lisp function via a SendCommand call, but how would I get any usable data back to VB Land?  Is there a way to populate a string (with the entity data the HatchB command parses) via the Lisp/SendCommand call, dump that string into a custom dictionary or xref or whatever, and have VB read it as a string for further parsing (basically doing whatever Hatchb does only in VB)?&lt;BR /&gt;
&lt;BR /&gt;
Does any of this make sense, or am I just SOL and have to tell the customer that if they want this to work, they have to fix all of their DWG files?</description>
      <pubDate>Fri, 22 Jul 2005 18:20:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385660#M84281</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-22T18:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving boundaries from non-associative hatch</title>
      <link>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385661#M84282</link>
      <description>have you tried using the hatches bounding box? Works in VBA, I haven't&lt;BR /&gt;
tried in .net though.&lt;BR /&gt;
&lt;BR /&gt;
&lt;JNELSO99&gt; wrote in message news:4909040@discussion.autodesk.com...&lt;BR /&gt;
Hmm...looks like the only way is to call that Lisp function via a &lt;BR /&gt;
SendCommand call, but how would I get any usable data back to VB Land?  Is &lt;BR /&gt;
there a way to populate a string (with the entity data the HatchB command &lt;BR /&gt;
parses) via the Lisp/SendCommand call, dump that string into a custom &lt;BR /&gt;
dictionary or xref or whatever, and have VB read it as a string for further &lt;BR /&gt;
parsing (basically doing whatever Hatchb does only in VB)?&lt;BR /&gt;
&lt;BR /&gt;
Does any of this make sense, or am I just SOL and have to tell the customer &lt;BR /&gt;
that if they want this to work, they have to fix all of their DWG files?&lt;/JNELSO99&gt;</description>
      <pubDate>Fri, 22 Jul 2005 19:13:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385661#M84282</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-22T19:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving boundaries from non-associative hatch</title>
      <link>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385662#M84283</link>
      <description>I need to get the actual boundaries of the hatch, not just the extents.  For some reason you're not allowed to do it the normal way with GetLoopAt if the hatch is non-associative.  Thanks anyway.</description>
      <pubDate>Fri, 22 Jul 2005 20:25:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385662#M84283</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-22T20:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving boundaries from non-associative hatch</title>
      <link>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385663#M84284</link>
      <description>the bounding box will point you toward the object&lt;BR /&gt;
cant be to many in the same place&lt;BR /&gt;
&lt;JNELSO99&gt; wrote in message news:4909197@discussion.autodesk.com...&lt;BR /&gt;
I need to get the actual boundaries of the hatch, not just the extents.  For &lt;BR /&gt;
some reason you're not allowed to do it the normal way with GetLoopAt if the &lt;BR /&gt;
hatch is non-associative.  Thanks anyway.&lt;/JNELSO99&gt;</description>
      <pubDate>Fri, 22 Jul 2005 22:24:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385663#M84284</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-22T22:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving boundaries from non-associative hatch</title>
      <link>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385664#M84285</link>
      <description>&amp;gt;and have to tell the customer that if they want this to work, they have to &lt;BR /&gt;
&amp;gt;fix all of their DWG files?&lt;BR /&gt;
&lt;BR /&gt;
What if the customer had asked you to reassociate all hatches?&lt;BR /&gt;
&lt;BR /&gt;
Find Bounding Box of hatch&lt;BR /&gt;
Find Object whos' Bounding Box Matches&lt;BR /&gt;
Copy properties of existingHatch, Create new one&lt;BR /&gt;
Append object to your new hatch&lt;BR /&gt;
Delete old hatch.&lt;BR /&gt;
&lt;BR /&gt;
Might be an eaiser way, but I just tested this and it works fine.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;JNELSO99&gt; wrote in message news:4909040@discussion.autodesk.com...&lt;BR /&gt;
Hmm...looks like the only way is to call that Lisp function via a &lt;BR /&gt;
SendCommand call, but how would I get any usable data back to VB Land?  Is &lt;BR /&gt;
there a way to populate a string (with the entity data the HatchB command &lt;BR /&gt;
parses) via the Lisp/SendCommand call, dump that string into a custom &lt;BR /&gt;
dictionary or xref or whatever, and have VB read it as a string for further &lt;BR /&gt;
parsing (basically doing whatever Hatchb does only in VB)?&lt;BR /&gt;
&lt;BR /&gt;
Does any of this make sense, or am I just SOL and have to tell the customer &lt;BR /&gt;
that if they want this to work, they have to fix all of their DWG files?&lt;/JNELSO99&gt;</description>
      <pubDate>Fri, 22 Jul 2005 23:31:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385664#M84285</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-22T23:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving boundaries from non-associative hatch</title>
      <link>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385665#M84286</link>
      <description>Ah - now I see what you're saying.  I'll give that a shot, but I'm not sure if it will work for all of my cases.  There are some hatch entities that consist of multiple areas.  For example, think of a dashed line drawn out where all of the dashes are included in a single hatch entity.  Also, the hatch boundaries tend to consist of individual line segments (AcDbLine entities).&lt;BR /&gt;
&lt;BR /&gt;
But as I think about it, I have an idea on how to make this work, at least good enough for government work &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;  I'm going to put this task aside for a day or two to regain my sanity before tackling it, tho.&lt;BR /&gt;
&lt;BR /&gt;
I'd still like to know how to be able to call a Lisp function with SendCommand and get some kind of useful result data back to VB, just to satisfy my curiosity, but I think I'm set for now with my immediate problem.  I really appreciate your help.  Thanks!</description>
      <pubDate>Fri, 22 Jul 2005 23:46:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385665#M84286</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-22T23:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving boundaries from non-associative hatch</title>
      <link>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385666#M84287</link>
      <description>&amp;gt;I'd still like to know how to be able to call a Lisp function with &lt;BR /&gt;
&amp;gt;SendCommand and get some kind of &amp;gt;useful result data back to VB, just to &lt;BR /&gt;
&amp;gt;satisfy my curiosity, but I think I'm set for now with my &amp;gt;immediate&lt;BR /&gt;
&lt;BR /&gt;
How about the userr variables? I assume you can access these in .net&lt;BR /&gt;
&lt;BR /&gt;
      $USERI1 - 5 70 Five integer variables intended for use by third-party &lt;BR /&gt;
developers&lt;BR /&gt;
      $USERR1 - 5 40 Five real variables intended for use by third-party &lt;BR /&gt;
developers&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;JNELSO99&gt; wrote in message news:4909345@discussion.autodesk.com...&lt;BR /&gt;
Ah - now I see what you're saying.  I'll give that a shot, but I'm not sure &lt;BR /&gt;
if it will work for all of my cases.  There are some hatch entities that &lt;BR /&gt;
consist of multiple areas.  For example, think of a dashed line drawn out &lt;BR /&gt;
where all of the dashes are included in a single hatch entity.  Also, the &lt;BR /&gt;
hatch boundaries tend to consist of individual line segments (AcDbLine &lt;BR /&gt;
entities).&lt;BR /&gt;
&lt;BR /&gt;
But as I think about it, I have an idea on how to make this work, at least &lt;BR /&gt;
good enough for government work &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;  I'm going to put this task aside for a &lt;BR /&gt;
day or two to regain my sanity before tackling it, tho.&lt;BR /&gt;
&lt;BR /&gt;
I'd still like to know how to be able to call a Lisp function with &lt;BR /&gt;
SendCommand and get some kind of useful result data back to VB, just to &lt;BR /&gt;
satisfy my curiosity, but I think I'm set for now with my immediate problem. &lt;BR /&gt;
I really appreciate your help.  Thanks!&lt;/JNELSO99&gt;</description>
      <pubDate>Sat, 23 Jul 2005 00:06:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385666#M84287</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-23T00:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving boundaries from non-associative hatch</title>
      <link>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385667#M84288</link>
      <description>Have you considered upgrading to AutoCAD 2006 that has much better &lt;BR /&gt;
functionality to restore boundaries than my HatchB.lsp?&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
Best Regards, Jimmy Bergmark&lt;BR /&gt;
CAD and Database Developer Manager at www.pharmadule-emtunga.com&lt;BR /&gt;
Blog: http://jtbworld.blogspot.com&lt;BR /&gt;
JTB FlexReport (FLEXnet / FLEXlm report tool) -&lt;BR /&gt;
http://www.jtbworld.com/jtbflexreport&lt;BR /&gt;
SmartPurger (Purges automatically) - &lt;BR /&gt;
http://www.jtbworld.com/?/smartpurger.htm&lt;BR /&gt;
or download some freeware at http://www.jtbworld.com&lt;BR /&gt;
More on AutoCAD 2005 and 2006&lt;BR /&gt;
http://www.jtbworld.com/autocad2005.htm&lt;BR /&gt;
http://www.jtbworld.com/autocad2006.htm&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;JNELSO99&gt; wrote in message news:4909345@discussion.autodesk.com...&lt;BR /&gt;
Ah - now I see what you're saying.  I'll give that a shot, but I'm not sure &lt;BR /&gt;
if it will work for all of my cases.  There are some hatch entities that &lt;BR /&gt;
consist of multiple areas.  For example, think of a dashed line drawn out &lt;BR /&gt;
where all of the dashes are included in a single hatch entity.  Also, the &lt;BR /&gt;
hatch boundaries tend to consist of individual line segments (AcDbLine &lt;BR /&gt;
entities).&lt;BR /&gt;
&lt;BR /&gt;
But as I think about it, I have an idea on how to make this work, at least &lt;BR /&gt;
good enough for government work &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;  I'm going to put this task aside for a &lt;BR /&gt;
day or two to regain my sanity before tackling it, tho.&lt;BR /&gt;
&lt;BR /&gt;
I'd still like to know how to be able to call a Lisp function with &lt;BR /&gt;
SendCommand and get some kind of useful result data back to VB, just to &lt;BR /&gt;
satisfy my curiosity, but I think I'm set for now with my immediate problem. &lt;BR /&gt;
I really appreciate your help.  Thanks!&lt;/JNELSO99&gt;</description>
      <pubDate>Sat, 23 Jul 2005 18:06:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385667#M84288</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-23T18:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving boundaries from non-associative hatch</title>
      <link>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385668#M84289</link>
      <description>That's what we're using.  I haven't found how to get the boundaries through .NET, and everything I've seen on this group hints that it isn't possible withough jumping though lots of hoops.  The documented "GetLoopAt" function doesn't seem to do as advertised with non-associative hatches.  Most likely I'm doing something wrong, but I've only been working with this stuff for a week.</description>
      <pubDate>Sat, 23 Jul 2005 19:01:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385668#M84289</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-23T19:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving boundaries from non-associative hatch</title>
      <link>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385669#M84290</link>
      <description>Have you tried using the command -HATCHEDIT and the options to restore the &lt;BR /&gt;
boundary? It doesn't work on gradient hatches though.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
Best Regards, Jimmy Bergmark&lt;BR /&gt;
CAD and Database Developer Manager at www.pharmadule-emtunga.com&lt;BR /&gt;
Blog: http://jtbworld.blogspot.com&lt;BR /&gt;
JTB FlexReport (FLEXnet / FLEXlm report tool) -&lt;BR /&gt;
http://www.jtbworld.com/jtbflexreport&lt;BR /&gt;
SmartPurger (Purges automatically) - &lt;BR /&gt;
http://www.jtbworld.com/?/smartpurger.htm&lt;BR /&gt;
or download some freeware at http://www.jtbworld.com&lt;BR /&gt;
More on AutoCAD 2005 and 2006&lt;BR /&gt;
http://www.jtbworld.com/autocad2005.htm&lt;BR /&gt;
http://www.jtbworld.com/autocad2006.htm&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;JNELSO99&gt; wrote in message news:4909511@discussion.autodesk.com...&lt;BR /&gt;
That's what we're using.  I haven't found how to get the boundaries through &lt;BR /&gt;
.NET, and everything I've seen on this group hints that it isn't possible &lt;BR /&gt;
withough jumping though lots of hoops.  The documented "GetLoopAt" function &lt;BR /&gt;
doesn't seem to do as advertised with non-associative hatches.  Most likely &lt;BR /&gt;
I'm doing something wrong, but I've only been working with this stuff for a &lt;BR /&gt;
week.&lt;/JNELSO99&gt;</description>
      <pubDate>Sun, 24 Jul 2005 08:42:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385669#M84290</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-24T08:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving boundaries from non-associative hatch</title>
      <link>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385670#M84291</link>
      <description>I'll look into that command.  One question, tho - Is there an automatic, non-interactive version of the command, so that a hatch entity would not need to be explicitly clicked by the user, and something like an object id can just be used instead?  I would like this process invisible to the user.  Thanks!</description>
      <pubDate>Wed, 27 Jul 2005 20:59:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385670#M84291</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-27T20:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving boundaries from non-associative hatch</title>
      <link>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385671#M84292</link>
      <description>Using AutoLISP:&lt;BR /&gt;
(command "-hatchedit" ent "B" "P" "Y")&lt;BR /&gt;
where "ent" points to the object.&lt;BR /&gt;
Not sure how to call this from .NET though.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
Best Regards, Jimmy Bergmark&lt;BR /&gt;
CAD and Database Developer Manager at www.pharmadule-emtunga.com&lt;BR /&gt;
Blog: http://jtbworld.blogspot.com&lt;BR /&gt;
JTB FlexReport (FLEXnet / FLEXlm report tool) -&lt;BR /&gt;
http://www.jtbworld.com/jtbflexreport&lt;BR /&gt;
SmartPurger (Purges automatically) - &lt;BR /&gt;
http://www.jtbworld.com/?/smartpurger.htm&lt;BR /&gt;
or download some freeware at http://www.jtbworld.com&lt;BR /&gt;
More on AutoCAD 2005 and 2006&lt;BR /&gt;
http://www.jtbworld.com/autocad2005.htm&lt;BR /&gt;
http://www.jtbworld.com/autocad2006.htm&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;JNELSO99&gt; wrote in message news:4912895@discussion.autodesk.com...&lt;BR /&gt;
I'll look into that command.  One question, tho - Is there an automatic, &lt;BR /&gt;
non-interactive version of the command, so that a hatch entity would not &lt;BR /&gt;
need to be explicitly clicked by the user, and something like an object id &lt;BR /&gt;
can just be used instead?  I would like this process invisible to the user. &lt;BR /&gt;
Thanks!&lt;/JNELSO99&gt;</description>
      <pubDate>Thu, 28 Jul 2005 13:20:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385671#M84292</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-28T13:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving boundaries from non-associative hatch</title>
      <link>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385672#M84293</link>
      <description>Excellent!  I think it's going to work!  I'm a happy camper!  Thanks!&lt;BR /&gt;
&lt;BR /&gt;
For whoever else needs it, here's more or less how to do this in VB.NET (minus error checking, type checking, imports, etc):&lt;BR /&gt;
&lt;BR /&gt;
Public Sub ReassociateHatch(ByVal hatchid As Integer, ByVal acadDoc As AcadDocument)&lt;BR /&gt;
&lt;BR /&gt;
    Dim ent As AcadEntity = acadDoc.ObjectIdToObject(hatchid)&lt;BR /&gt;
    Dim cmd As String&lt;BR /&gt;
  &lt;BR /&gt;
    cmd = "(command ""-hatchedit"" (handent """ &amp;amp; ent.Handle &amp;amp; """) ""B"" ""P"" ""Y"")" &amp;amp; vbCr&lt;BR /&gt;
    acadDoc.SendCommand(cmd)&lt;BR /&gt;
&lt;BR /&gt;
End Sub</description>
      <pubDate>Fri, 29 Jul 2005 16:43:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385672#M84293</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-29T16:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving boundaries from non-associative hatch</title>
      <link>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385673#M84294</link>
      <description>Ok, I may have spoken too soon about things working - wierd things are happening.  I've basically got an MFC application calling a VB.NET library which calls AutoCAD.  The VB.NET code does the SendCommand, and by default AutoCAD is set to be not visible (setting the AcadApplication.Visible to false).  When my MFC app starts up, everything's ok, and I can load normal files with no problem.  When I load one that requires the SendCommand("(command -""hatchedit""...) thing, when that SendCommand is called, the AutoCAD instance becomes visible and pops up.  Not a problem - just reset the Visible flag on the AcadApplication again right after the SendCommand.&lt;BR /&gt;
&lt;BR /&gt;
But what happens is when I load another file after that, I get an error and the AutoCAD instance goes away.  The error message I get is "The object invoked has disconnected from its clients".  I'm not getting them any more, but once there were message boxes saying exceptions occurred in "AcObjClassImp.arx" and "Acopm.arx".&lt;BR /&gt;
&lt;BR /&gt;
The other wierd thing is that if I let the AutoCAD instance become visible, or start it off being visible, everything works fine.  I'm wondering if there's some error or something that AutoCAD need to tell me about so it pops up.&lt;BR /&gt;
&lt;BR /&gt;
I can put in code in my app to reconnect if it finds itself disconnected, but I'd rather figure out what I'm doing wrong here.&lt;BR /&gt;
&lt;BR /&gt;
Edit:  Also, the -hatchedit command does not seem to be able to handle hatch entities in block definitions.  Bummer.

Message was edited by: jnelso99</description>
      <pubDate>Fri, 29 Jul 2005 22:01:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/retrieving-boundaries-from-non-associative-hatch/m-p/1385673#M84294</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-29T22:01:28Z</dc:date>
    </item>
  </channel>
</rss>

