<?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: in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/addhatch/m-p/315550#M95372</link>
    <description>I must confess, I've never done a hatch in VBA but if I was doing this&lt;BR /&gt;
manually, I would set the scale prior to evaluating the hatch (take a look&lt;BR /&gt;
at the hatch dialog to see what I'm talking about). Perhaps you should set&lt;BR /&gt;
your PatternScale immediately after creating the hatch object.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Get free software and more at http://www2.stonemedia.com/franko&lt;BR /&gt;
&lt;BR /&gt;
"Donald B. Larson" &lt;DON&gt; wrote in message&lt;BR /&gt;
news:8915dp$coe19@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; Frank,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Doh!  That's it.  The VBA procedures are in Excel, not AutoCad.  So I've&lt;BR /&gt;
&amp;gt; defined:&lt;BR /&gt;
&amp;gt; Public ac As AcadApplication&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; So ac.ActiveDocument.ModelSpace.AddHatch is correct.  Should'a typed it&lt;BR /&gt;
out&lt;BR /&gt;
&amp;gt; &amp;amp; the help boxes would have shown me this.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Trouble you with another?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; PatternType = acHatchPatternTypePreDefined&lt;BR /&gt;
&amp;gt; PatternName = "EARTH"&lt;BR /&gt;
&amp;gt; Associativity = True&lt;BR /&gt;
&amp;gt; Set HatchObj = ac.ActiveDocument.ModelSpace.AddHatch(PatternType,&lt;BR /&gt;
&amp;gt; PatternName, Associativity)&lt;BR /&gt;
&amp;gt; 'Append the Outer Loop:&lt;BR /&gt;
&amp;gt; HatchObj.AppendOuterLoop (OuterLoop)&lt;BR /&gt;
&amp;gt; HatchObj.PatternScale = 20&lt;BR /&gt;
&amp;gt; HatchObj.Evaluate&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Errors at HatchObj.Evaluate with "pattern too dense".  Doesn't seem to&lt;BR /&gt;
apply&lt;BR /&gt;
&amp;gt; the PatternScale Property.  Any ideas?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thanks again,  Don&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/DON&gt;</description>
    <pubDate>Wed, 23 Feb 2000 17:33:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2000-02-23T17:33:06Z</dc:date>
    <item>
      <title>AddHatch</title>
      <link>https://forums.autodesk.com/t5/vba-forum/addhatch/m-p/315547#M95369</link>
      <description>My first attempt at Hatching.  Took this right out of the example.  The&lt;BR /&gt;
acPLine displays correctly.  I can manually hatch it.  Errors out at the&lt;BR /&gt;
line  "Set HatchObj =" with "object doesn't support this property or&lt;BR /&gt;
method".  Can anyone spot my error?&lt;BR /&gt;
&lt;BR /&gt;
Thanks, Don&lt;BR /&gt;
&lt;BR /&gt;
Set acPLine = ac.ActiveDocument.ModelSpace.AddLightWeightPolyline(Data)&lt;BR /&gt;
acPLine.Color = acBlue&lt;BR /&gt;
acPLine.Closed = True&lt;BR /&gt;
&lt;BR /&gt;
'Create the outer boundary for the hatch:&lt;BR /&gt;
Dim OuterLoop(0 To 0) As AcadEntity&lt;BR /&gt;
Set OuterLoop(0) = acPLine&lt;BR /&gt;
&lt;BR /&gt;
'Define the hatch:&lt;BR /&gt;
Dim HatchObj As AcadHatch&lt;BR /&gt;
Dim PatternType As AcPatternType&lt;BR /&gt;
Dim PatternName As String&lt;BR /&gt;
Dim Associativity As Boolean&lt;BR /&gt;
&lt;BR /&gt;
PatternType = acHatchPatternTypePreDefined&lt;BR /&gt;
PatternName = "ANSI31"&lt;BR /&gt;
Associativity = False&lt;BR /&gt;
Set HatchObj = ac.ModelSpace.AddHatch(PatternType, PatternName,&lt;BR /&gt;
Associativity)&lt;BR /&gt;
'Append the Outer Loop:&lt;BR /&gt;
HatchObj.AppendOuterLoop (OuterLoop)&lt;BR /&gt;
HatchObj.Evaluate</description>
      <pubDate>Wed, 23 Feb 2000 17:35:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/addhatch/m-p/315547#M95369</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-23T17:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: AddHatch</title>
      <link>https://forums.autodesk.com/t5/vba-forum/addhatch/m-p/315548#M95370</link>
      <description>Is ac a reference to the Application or the ActiveDocument? ModelSpace can&lt;BR /&gt;
be fond in a document object, not the application object. Try this:&lt;BR /&gt;
ac.ActiveDocument.ModelSpace.AddHatch&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Visit me at: http://www2.stonemedia.com/franko&lt;BR /&gt;
&lt;BR /&gt;
"Donald B. Larson" &lt;DON&gt; wrote in message&lt;BR /&gt;
news:88v8c9$7te7@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; My first attempt at Hatching.  Took this right out of the example.  The&lt;BR /&gt;
&amp;gt; acPLine displays correctly.  I can manually hatch it.  Errors out at the&lt;BR /&gt;
&amp;gt; line  "Set HatchObj =" with "object doesn't support this property or&lt;BR /&gt;
&amp;gt; method".  Can anyone spot my error?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thanks, Don&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Set acPLine = ac.ActiveDocument.ModelSpace.AddLightWeightPolyline(Data)&lt;BR /&gt;
&amp;gt; acPLine.Color = acBlue&lt;BR /&gt;
&amp;gt; acPLine.Closed = True&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; 'Create the outer boundary for the hatch:&lt;BR /&gt;
&amp;gt; Dim OuterLoop(0 To 0) As AcadEntity&lt;BR /&gt;
&amp;gt; Set OuterLoop(0) = acPLine&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; 'Define the hatch:&lt;BR /&gt;
&amp;gt; Dim HatchObj As AcadHatch&lt;BR /&gt;
&amp;gt; Dim PatternType As AcPatternType&lt;BR /&gt;
&amp;gt; Dim PatternName As String&lt;BR /&gt;
&amp;gt; Dim Associativity As Boolean&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; PatternType = acHatchPatternTypePreDefined&lt;BR /&gt;
&amp;gt; PatternName = "ANSI31"&lt;BR /&gt;
&amp;gt; Associativity = False&lt;BR /&gt;
&amp;gt; Set HatchObj = ac.ModelSpace.AddHatch(PatternType, PatternName,&lt;BR /&gt;
&amp;gt; Associativity)&lt;BR /&gt;
&amp;gt; 'Append the Outer Loop:&lt;BR /&gt;
&amp;gt; HatchObj.AppendOuterLoop (OuterLoop)&lt;BR /&gt;
&amp;gt; HatchObj.Evaluate&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/DON&gt;</description>
      <pubDate>Wed, 23 Feb 2000 00:56:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/addhatch/m-p/315548#M95370</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-23T00:56:56Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/addhatch/m-p/315549#M95371</link>
      <description>Frank,&lt;BR /&gt;
&lt;BR /&gt;
Doh!  That's it.  The VBA procedures are in Excel, not AutoCad.  So I've&lt;BR /&gt;
defined:&lt;BR /&gt;
Public ac As AcadApplication&lt;BR /&gt;
&lt;BR /&gt;
So ac.ActiveDocument.ModelSpace.AddHatch is correct.  Should'a typed it out&lt;BR /&gt;
&amp;amp; the help boxes would have shown me this.&lt;BR /&gt;
&lt;BR /&gt;
Trouble you with another?&lt;BR /&gt;
&lt;BR /&gt;
PatternType = acHatchPatternTypePreDefined&lt;BR /&gt;
PatternName = "EARTH"&lt;BR /&gt;
Associativity = True&lt;BR /&gt;
Set HatchObj = ac.ActiveDocument.ModelSpace.AddHatch(PatternType,&lt;BR /&gt;
PatternName, Associativity)&lt;BR /&gt;
'Append the Outer Loop:&lt;BR /&gt;
HatchObj.AppendOuterLoop (OuterLoop)&lt;BR /&gt;
HatchObj.PatternScale = 20&lt;BR /&gt;
HatchObj.Evaluate&lt;BR /&gt;
&lt;BR /&gt;
Errors at HatchObj.Evaluate with "pattern too dense".  Doesn't seem to apply&lt;BR /&gt;
the PatternScale Property.  Any ideas?&lt;BR /&gt;
&lt;BR /&gt;
Thanks again,  Don</description>
      <pubDate>Wed, 23 Feb 2000 17:29:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/addhatch/m-p/315549#M95371</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-23T17:29:26Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/addhatch/m-p/315550#M95372</link>
      <description>I must confess, I've never done a hatch in VBA but if I was doing this&lt;BR /&gt;
manually, I would set the scale prior to evaluating the hatch (take a look&lt;BR /&gt;
at the hatch dialog to see what I'm talking about). Perhaps you should set&lt;BR /&gt;
your PatternScale immediately after creating the hatch object.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Get free software and more at http://www2.stonemedia.com/franko&lt;BR /&gt;
&lt;BR /&gt;
"Donald B. Larson" &lt;DON&gt; wrote in message&lt;BR /&gt;
news:8915dp$coe19@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; Frank,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Doh!  That's it.  The VBA procedures are in Excel, not AutoCad.  So I've&lt;BR /&gt;
&amp;gt; defined:&lt;BR /&gt;
&amp;gt; Public ac As AcadApplication&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; So ac.ActiveDocument.ModelSpace.AddHatch is correct.  Should'a typed it&lt;BR /&gt;
out&lt;BR /&gt;
&amp;gt; &amp;amp; the help boxes would have shown me this.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Trouble you with another?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; PatternType = acHatchPatternTypePreDefined&lt;BR /&gt;
&amp;gt; PatternName = "EARTH"&lt;BR /&gt;
&amp;gt; Associativity = True&lt;BR /&gt;
&amp;gt; Set HatchObj = ac.ActiveDocument.ModelSpace.AddHatch(PatternType,&lt;BR /&gt;
&amp;gt; PatternName, Associativity)&lt;BR /&gt;
&amp;gt; 'Append the Outer Loop:&lt;BR /&gt;
&amp;gt; HatchObj.AppendOuterLoop (OuterLoop)&lt;BR /&gt;
&amp;gt; HatchObj.PatternScale = 20&lt;BR /&gt;
&amp;gt; HatchObj.Evaluate&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Errors at HatchObj.Evaluate with "pattern too dense".  Doesn't seem to&lt;BR /&gt;
apply&lt;BR /&gt;
&amp;gt; the PatternScale Property.  Any ideas?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thanks again,  Don&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/DON&gt;</description>
      <pubDate>Wed, 23 Feb 2000 17:33:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/addhatch/m-p/315550#M95372</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-23T17:33:06Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/addhatch/m-p/315551#M95373</link>
      <description>One other thing: depending on the size of your loops, a scale of 20 may&lt;BR /&gt;
actually be too small. If my first tip doesn't work, try using a larger&lt;BR /&gt;
scale.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Get free software and more at http://www2.stonemedia.com/franko</description>
      <pubDate>Wed, 23 Feb 2000 17:35:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/addhatch/m-p/315551#M95373</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-02-23T17:35:10Z</dc:date>
    </item>
  </channel>
</rss>

