<?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: vba legend in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/vba-legend/m-p/303446#M96441</link>
    <description>Josh,&lt;BR /&gt;
&lt;BR /&gt;
I was trying to get the type and count and display in some sort of form but&lt;BR /&gt;
also what I would&lt;BR /&gt;
like to accomplish is creating a legend in the map.  For instance, in a&lt;BR /&gt;
current view I have all&lt;BR /&gt;
the wells plotted.  I have a title block off to the right of the drawing.&lt;BR /&gt;
In the title block I would&lt;BR /&gt;
like to allocate some space for a legend.  What I would like the legend to&lt;BR /&gt;
display is one instance&lt;BR /&gt;
of each block that was inserted in the drawing with a description of the&lt;BR /&gt;
block.  After the legend&lt;BR /&gt;
is created in the map, maybe display some sort of form that you described.&lt;BR /&gt;
I am currently working&lt;BR /&gt;
on your solution and if you have any input on the above legend in a map I&lt;BR /&gt;
would appreciate any feedback.&lt;BR /&gt;
&lt;BR /&gt;
Carlos&lt;BR /&gt;
&lt;BR /&gt;
Minkwitz Design &lt;MDSINC&gt; wrote in message&lt;BR /&gt;
news:389087F6.3E5704DC@xta.com...&lt;BR /&gt;
&amp;gt; Carlos,&lt;BR /&gt;
&amp;gt;     If I understand correctly, your just looking for the type and count of&lt;BR /&gt;
the&lt;BR /&gt;
&amp;gt; blocks in your drawing, something for the user to view and then close out.&lt;BR /&gt;
If&lt;BR /&gt;
&amp;gt; that's the case, you can loop through the&lt;BR /&gt;
&amp;gt; autocad.application.activedrawing.blocks collection, not the blockref&lt;BR /&gt;
&amp;gt; collection. Then use select case or block if to count the blocks and&lt;BR /&gt;
assign the&lt;BR /&gt;
&amp;gt; quantities to a group of variables or place them in a multidimenional&lt;BR /&gt;
array&lt;BR /&gt;
&amp;gt; where the first column is the blockname and the second is the count, ect..&lt;BR /&gt;
You&lt;BR /&gt;
&amp;gt; can then create a form and place the info you want in textboxes, ect for&lt;BR /&gt;
the&lt;BR /&gt;
&amp;gt; user to view. By setting the enabled property of the textboxes to false&lt;BR /&gt;
the user&lt;BR /&gt;
&amp;gt; won't be able to modify their values, just view them and close out the&lt;BR /&gt;
form&lt;BR /&gt;
&amp;gt; until the next time you run your program. Hope this is what your looking&lt;BR /&gt;
for.&lt;BR /&gt;
&amp;gt; -Josh&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Carlos Femmer wrote:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Hi guys,&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; One quick note.  I came to this vba news group several months ago and&lt;BR /&gt;
&amp;gt; &amp;gt; answered several questions and posted a couple.  Unfortunately nobody&lt;BR /&gt;
knew&lt;BR /&gt;
&amp;gt; &amp;gt; anything about vba.  I am looking at some recent post and answers and it&lt;BR /&gt;
&amp;gt; &amp;gt; looks like some programmers finally arrived.  I have a problem and any&lt;BR /&gt;
input&lt;BR /&gt;
&amp;gt; &amp;gt; would be appreciated.  I have an oracle database that stores our well&lt;BR /&gt;
&amp;gt; &amp;gt; information.  I wrote a routine that grabs the wells from the database&lt;BR /&gt;
based&lt;BR /&gt;
&amp;gt; &amp;gt; on filters and plots them in the map.  I have 26 different blocks that&lt;BR /&gt;
&amp;gt; &amp;gt; represent the type of wells.  An example would be when I run the well&lt;BR /&gt;
&amp;gt; &amp;gt; routine for a particular area it might plot (10 active blocks, 16 shut&lt;BR /&gt;
in&lt;BR /&gt;
&amp;gt; &amp;gt; blocks, 27 water blocks etc...)  What would be the easiest way to build&lt;BR /&gt;
a&lt;BR /&gt;
&amp;gt; &amp;gt; legend of the blocks plotted.  I have the partial code that inserts the&lt;BR /&gt;
&amp;gt; &amp;gt; blocks based on filters below.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
/***************************************************************************&lt;BR /&gt;
&amp;gt; &amp;gt; ******&lt;BR /&gt;
&amp;gt; &amp;gt; If rs!serial &amp;gt; 1 Then&lt;BR /&gt;
&amp;gt; &amp;gt;             wellPoint(0) = CDbl(rs!sx)&lt;BR /&gt;
&amp;gt; &amp;gt;             wellPoint(1) = CDbl(rs!sy)&lt;BR /&gt;
&amp;gt; &amp;gt;             wellPoint(2) = 0&lt;BR /&gt;
&amp;gt; &amp;gt;             btmPoint(0) = CDbl(rs!btmx)&lt;BR /&gt;
&amp;gt; &amp;gt;             btmPoint(1) = CDbl(rs!btmy)&lt;BR /&gt;
&amp;gt; &amp;gt;             btmPoint(2) = 0&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;             If (rs!Status = "01") Or (rs!Status = "02") Then&lt;BR /&gt;
&amp;gt; &amp;gt;                 If rs!btmx = "0000000" Then&lt;BR /&gt;
&amp;gt; &amp;gt;                     Set anObj =&lt;BR /&gt;
&amp;gt; &amp;gt; acadObj.ActiveDocument.ModelSpace.InsertBlock(wellPoint, cirp, xscale,&lt;BR /&gt;
&amp;gt; &amp;gt; yscale, rotAngle)&lt;BR /&gt;
&amp;gt; &amp;gt;                     attr = anObj.GetAttributes&lt;BR /&gt;
&amp;gt; &amp;gt;                         attr(0).textstring = CStr(rs!serial)&lt;BR /&gt;
&amp;gt; &amp;gt;                     Set ahold =&lt;BR /&gt;
&amp;gt; &amp;gt; acadObj.ActiveDocument.ModelSpace.InsertBlock(wellPoint, lblosin,&lt;BR /&gt;
xscale,&lt;BR /&gt;
&amp;gt; &amp;gt; yscale, rotAngle)&lt;BR /&gt;
&amp;gt; &amp;gt;                     atts = ahold.GetAttributes&lt;BR /&gt;
&amp;gt; &amp;gt;                         atts(0).textstring = CStr(rs!OPNAMET)&lt;BR /&gt;
&amp;gt; &amp;gt;                         atts(1).textstring = CStr(rs!wn)&lt;BR /&gt;
&amp;gt; &amp;gt;                         atts(2).textstring = CStr(rs!se)&lt;BR /&gt;
&amp;gt; &amp;gt;                         atts(3).textstring = CStr(rs!tdpth)&lt;BR /&gt;
&amp;gt; &amp;gt;                 Else&lt;BR /&gt;
&amp;gt; &amp;gt;                     Set anObjsurf =&lt;BR /&gt;
&amp;gt; &amp;gt; acadObj.ActiveDocument.ModelSpace.InsertBlock(wellPoint, surfloc,&lt;BR /&gt;
xscale,&lt;BR /&gt;
&amp;gt; &amp;gt; yscale, rotAngle)&lt;BR /&gt;
&amp;gt; &amp;gt;                     Set anObj =&lt;BR /&gt;
&amp;gt; &amp;gt; acadObj.ActiveDocument.ModelSpace.InsertBlock(btmPoint, cirp, xscale,&lt;BR /&gt;
&amp;gt; &amp;gt; yscale, rotAngle)&lt;BR /&gt;
&amp;gt; &amp;gt;                     Set conObj =&lt;BR /&gt;
&amp;gt; &amp;gt; acadObj.ActiveDocument.ModelSpace.AddLine(wellPoint, btmPoint)&lt;BR /&gt;
&amp;gt; &amp;gt;                     conObj.Color = (cboLnclr.ListIndex + 1)&lt;BR /&gt;
&amp;gt; &amp;gt;                     attu = anObj.GetAttributes&lt;BR /&gt;
&amp;gt; &amp;gt;                         attu(0).textstring = CStr(rs!se)&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
****************************************************************************&lt;BR /&gt;
&amp;gt; &amp;gt; *******/&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Carlos&lt;BR /&gt;
&amp;gt;&lt;/MDSINC&gt;</description>
    <pubDate>Fri, 28 Jan 2000 17:19:07 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2000-01-28T17:19:07Z</dc:date>
    <item>
      <title>vba legend</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-legend/m-p/303443#M96438</link>
      <description>Carlos,&lt;BR /&gt;
    If I understand correctly, your just looking for the type and count of the&lt;BR /&gt;
blocks in your drawing, something for the user to view and then close out. If&lt;BR /&gt;
that's the case, you can loop through the&lt;BR /&gt;
autocad.application.activedrawing.blocks collection, not the blockref&lt;BR /&gt;
collection. Then use select case or block if to count the blocks and assign the&lt;BR /&gt;
quantities to a group of variables or place them in a multidimenional array&lt;BR /&gt;
where the first column is the blockname and the second is the count, ect.. You&lt;BR /&gt;
can then create a form and place the info you want in textboxes, ect for the&lt;BR /&gt;
user to view. By setting the enabled property of the textboxes to false the user&lt;BR /&gt;
won't be able to modify their values, just view them and close out the form&lt;BR /&gt;
until the next time you run your program. Hope this is what your looking for.&lt;BR /&gt;
-Josh&lt;BR /&gt;
&lt;BR /&gt;
Carlos Femmer wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; Hi guys,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; One quick note.  I came to this vba news group several months ago and&lt;BR /&gt;
&amp;gt; answered several questions and posted a couple.  Unfortunately nobody knew&lt;BR /&gt;
&amp;gt; anything about vba.  I am looking at some recent post and answers and it&lt;BR /&gt;
&amp;gt; looks like some programmers finally arrived.  I have a problem and any input&lt;BR /&gt;
&amp;gt; would be appreciated.  I have an oracle database that stores our well&lt;BR /&gt;
&amp;gt; information.  I wrote a routine that grabs the wells from the database based&lt;BR /&gt;
&amp;gt; on filters and plots them in the map.  I have 26 different blocks that&lt;BR /&gt;
&amp;gt; represent the type of wells.  An example would be when I run the well&lt;BR /&gt;
&amp;gt; routine for a particular area it might plot (10 active blocks, 16 shut in&lt;BR /&gt;
&amp;gt; blocks, 27 water blocks etc...)  What would be the easiest way to build a&lt;BR /&gt;
&amp;gt; legend of the blocks plotted.  I have the partial code that inserts the&lt;BR /&gt;
&amp;gt; blocks based on filters below.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; /***************************************************************************&lt;BR /&gt;
&amp;gt; ******&lt;BR /&gt;
&amp;gt; If rs!serial &amp;gt; 1 Then&lt;BR /&gt;
&amp;gt;             wellPoint(0) = CDbl(rs!sx)&lt;BR /&gt;
&amp;gt;             wellPoint(1) = CDbl(rs!sy)&lt;BR /&gt;
&amp;gt;             wellPoint(2) = 0&lt;BR /&gt;
&amp;gt;             btmPoint(0) = CDbl(rs!btmx)&lt;BR /&gt;
&amp;gt;             btmPoint(1) = CDbl(rs!btmy)&lt;BR /&gt;
&amp;gt;             btmPoint(2) = 0&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;             If (rs!Status = "01") Or (rs!Status = "02") Then&lt;BR /&gt;
&amp;gt;                 If rs!btmx = "0000000" Then&lt;BR /&gt;
&amp;gt;                     Set anObj =&lt;BR /&gt;
&amp;gt; acadObj.ActiveDocument.ModelSpace.InsertBlock(wellPoint, cirp, xscale,&lt;BR /&gt;
&amp;gt; yscale, rotAngle)&lt;BR /&gt;
&amp;gt;                     attr = anObj.GetAttributes&lt;BR /&gt;
&amp;gt;                         attr(0).textstring = CStr(rs!serial)&lt;BR /&gt;
&amp;gt;                     Set ahold =&lt;BR /&gt;
&amp;gt; acadObj.ActiveDocument.ModelSpace.InsertBlock(wellPoint, lblosin, xscale,&lt;BR /&gt;
&amp;gt; yscale, rotAngle)&lt;BR /&gt;
&amp;gt;                     atts = ahold.GetAttributes&lt;BR /&gt;
&amp;gt;                         atts(0).textstring = CStr(rs!OPNAMET)&lt;BR /&gt;
&amp;gt;                         atts(1).textstring = CStr(rs!wn)&lt;BR /&gt;
&amp;gt;                         atts(2).textstring = CStr(rs!se)&lt;BR /&gt;
&amp;gt;                         atts(3).textstring = CStr(rs!tdpth)&lt;BR /&gt;
&amp;gt;                 Else&lt;BR /&gt;
&amp;gt;                     Set anObjsurf =&lt;BR /&gt;
&amp;gt; acadObj.ActiveDocument.ModelSpace.InsertBlock(wellPoint, surfloc, xscale,&lt;BR /&gt;
&amp;gt; yscale, rotAngle)&lt;BR /&gt;
&amp;gt;                     Set anObj =&lt;BR /&gt;
&amp;gt; acadObj.ActiveDocument.ModelSpace.InsertBlock(btmPoint, cirp, xscale,&lt;BR /&gt;
&amp;gt; yscale, rotAngle)&lt;BR /&gt;
&amp;gt;                     Set conObj =&lt;BR /&gt;
&amp;gt; acadObj.ActiveDocument.ModelSpace.AddLine(wellPoint, btmPoint)&lt;BR /&gt;
&amp;gt;                     conObj.Color = (cboLnclr.ListIndex + 1)&lt;BR /&gt;
&amp;gt;                     attu = anObj.GetAttributes&lt;BR /&gt;
&amp;gt;                         attu(0).textstring = CStr(rs!se)&lt;BR /&gt;
&amp;gt; ****************************************************************************&lt;BR /&gt;
&amp;gt; *******/&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Carlos</description>
      <pubDate>Thu, 27 Jan 2000 18:01:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-legend/m-p/303443#M96438</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-27T18:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: vba legend</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-legend/m-p/303444#M96439</link>
      <description>One more thing. If you want to keep the info visible while the user is working on&lt;BR /&gt;
the drawing, you can use Jorge Lopez's dockable container and just update every so&lt;BR /&gt;
often. But you'll have to build your code into an ocx.&lt;BR /&gt;
-Josh</description>
      <pubDate>Thu, 27 Jan 2000 18:05:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-legend/m-p/303444#M96439</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-27T18:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: vba legend</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-legend/m-p/303445#M96440</link>
      <description>Hi guys,&lt;BR /&gt;
&lt;BR /&gt;
One quick note.  I came to this vba news group several months ago and&lt;BR /&gt;
answered several questions and posted a couple.  Unfortunately nobody knew&lt;BR /&gt;
anything about vba.  I am looking at some recent post and answers and it&lt;BR /&gt;
looks like some programmers finally arrived.  I have a problem and any input&lt;BR /&gt;
would be appreciated.  I have an oracle database that stores our well&lt;BR /&gt;
information.  I wrote a routine that grabs the wells from the database based&lt;BR /&gt;
on filters and plots them in the map.  I have 26 different blocks that&lt;BR /&gt;
represent the type of wells.  An example would be when I run the well&lt;BR /&gt;
routine for a particular area it might plot (10 active blocks, 16 shut in&lt;BR /&gt;
blocks, 27 water blocks etc...)  What would be the easiest way to build a&lt;BR /&gt;
legend of the blocks plotted.  I have the partial code that inserts the&lt;BR /&gt;
blocks based on filters below.&lt;BR /&gt;
&lt;BR /&gt;
/***************************************************************************&lt;BR /&gt;
******&lt;BR /&gt;
If rs!serial &amp;gt; 1 Then&lt;BR /&gt;
            wellPoint(0) = CDbl(rs!sx)&lt;BR /&gt;
            wellPoint(1) = CDbl(rs!sy)&lt;BR /&gt;
            wellPoint(2) = 0&lt;BR /&gt;
            btmPoint(0) = CDbl(rs!btmx)&lt;BR /&gt;
            btmPoint(1) = CDbl(rs!btmy)&lt;BR /&gt;
            btmPoint(2) = 0&lt;BR /&gt;
&lt;BR /&gt;
            If (rs!Status = "01") Or (rs!Status = "02") Then&lt;BR /&gt;
                If rs!btmx = "0000000" Then&lt;BR /&gt;
                    Set anObj =&lt;BR /&gt;
acadObj.ActiveDocument.ModelSpace.InsertBlock(wellPoint, cirp, xscale,&lt;BR /&gt;
yscale, rotAngle)&lt;BR /&gt;
                    attr = anObj.GetAttributes&lt;BR /&gt;
                        attr(0).textstring = CStr(rs!serial)&lt;BR /&gt;
                    Set ahold =&lt;BR /&gt;
acadObj.ActiveDocument.ModelSpace.InsertBlock(wellPoint, lblosin, xscale,&lt;BR /&gt;
yscale, rotAngle)&lt;BR /&gt;
                    atts = ahold.GetAttributes&lt;BR /&gt;
                        atts(0).textstring = CStr(rs!OPNAMET)&lt;BR /&gt;
                        atts(1).textstring = CStr(rs!wn)&lt;BR /&gt;
                        atts(2).textstring = CStr(rs!se)&lt;BR /&gt;
                        atts(3).textstring = CStr(rs!tdpth)&lt;BR /&gt;
                Else&lt;BR /&gt;
                    Set anObjsurf =&lt;BR /&gt;
acadObj.ActiveDocument.ModelSpace.InsertBlock(wellPoint, surfloc, xscale,&lt;BR /&gt;
yscale, rotAngle)&lt;BR /&gt;
                    Set anObj =&lt;BR /&gt;
acadObj.ActiveDocument.ModelSpace.InsertBlock(btmPoint, cirp, xscale,&lt;BR /&gt;
yscale, rotAngle)&lt;BR /&gt;
                    Set conObj =&lt;BR /&gt;
acadObj.ActiveDocument.ModelSpace.AddLine(wellPoint, btmPoint)&lt;BR /&gt;
                    conObj.Color = (cboLnclr.ListIndex + 1)&lt;BR /&gt;
                    attu = anObj.GetAttributes&lt;BR /&gt;
                        attu(0).textstring = CStr(rs!se)&lt;BR /&gt;
****************************************************************************&lt;BR /&gt;
*******/&lt;BR /&gt;
&lt;BR /&gt;
Carlos</description>
      <pubDate>Thu, 27 Jan 2000 23:03:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-legend/m-p/303445#M96440</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-27T23:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: vba legend</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-legend/m-p/303446#M96441</link>
      <description>Josh,&lt;BR /&gt;
&lt;BR /&gt;
I was trying to get the type and count and display in some sort of form but&lt;BR /&gt;
also what I would&lt;BR /&gt;
like to accomplish is creating a legend in the map.  For instance, in a&lt;BR /&gt;
current view I have all&lt;BR /&gt;
the wells plotted.  I have a title block off to the right of the drawing.&lt;BR /&gt;
In the title block I would&lt;BR /&gt;
like to allocate some space for a legend.  What I would like the legend to&lt;BR /&gt;
display is one instance&lt;BR /&gt;
of each block that was inserted in the drawing with a description of the&lt;BR /&gt;
block.  After the legend&lt;BR /&gt;
is created in the map, maybe display some sort of form that you described.&lt;BR /&gt;
I am currently working&lt;BR /&gt;
on your solution and if you have any input on the above legend in a map I&lt;BR /&gt;
would appreciate any feedback.&lt;BR /&gt;
&lt;BR /&gt;
Carlos&lt;BR /&gt;
&lt;BR /&gt;
Minkwitz Design &lt;MDSINC&gt; wrote in message&lt;BR /&gt;
news:389087F6.3E5704DC@xta.com...&lt;BR /&gt;
&amp;gt; Carlos,&lt;BR /&gt;
&amp;gt;     If I understand correctly, your just looking for the type and count of&lt;BR /&gt;
the&lt;BR /&gt;
&amp;gt; blocks in your drawing, something for the user to view and then close out.&lt;BR /&gt;
If&lt;BR /&gt;
&amp;gt; that's the case, you can loop through the&lt;BR /&gt;
&amp;gt; autocad.application.activedrawing.blocks collection, not the blockref&lt;BR /&gt;
&amp;gt; collection. Then use select case or block if to count the blocks and&lt;BR /&gt;
assign the&lt;BR /&gt;
&amp;gt; quantities to a group of variables or place them in a multidimenional&lt;BR /&gt;
array&lt;BR /&gt;
&amp;gt; where the first column is the blockname and the second is the count, ect..&lt;BR /&gt;
You&lt;BR /&gt;
&amp;gt; can then create a form and place the info you want in textboxes, ect for&lt;BR /&gt;
the&lt;BR /&gt;
&amp;gt; user to view. By setting the enabled property of the textboxes to false&lt;BR /&gt;
the user&lt;BR /&gt;
&amp;gt; won't be able to modify their values, just view them and close out the&lt;BR /&gt;
form&lt;BR /&gt;
&amp;gt; until the next time you run your program. Hope this is what your looking&lt;BR /&gt;
for.&lt;BR /&gt;
&amp;gt; -Josh&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Carlos Femmer wrote:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Hi guys,&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; One quick note.  I came to this vba news group several months ago and&lt;BR /&gt;
&amp;gt; &amp;gt; answered several questions and posted a couple.  Unfortunately nobody&lt;BR /&gt;
knew&lt;BR /&gt;
&amp;gt; &amp;gt; anything about vba.  I am looking at some recent post and answers and it&lt;BR /&gt;
&amp;gt; &amp;gt; looks like some programmers finally arrived.  I have a problem and any&lt;BR /&gt;
input&lt;BR /&gt;
&amp;gt; &amp;gt; would be appreciated.  I have an oracle database that stores our well&lt;BR /&gt;
&amp;gt; &amp;gt; information.  I wrote a routine that grabs the wells from the database&lt;BR /&gt;
based&lt;BR /&gt;
&amp;gt; &amp;gt; on filters and plots them in the map.  I have 26 different blocks that&lt;BR /&gt;
&amp;gt; &amp;gt; represent the type of wells.  An example would be when I run the well&lt;BR /&gt;
&amp;gt; &amp;gt; routine for a particular area it might plot (10 active blocks, 16 shut&lt;BR /&gt;
in&lt;BR /&gt;
&amp;gt; &amp;gt; blocks, 27 water blocks etc...)  What would be the easiest way to build&lt;BR /&gt;
a&lt;BR /&gt;
&amp;gt; &amp;gt; legend of the blocks plotted.  I have the partial code that inserts the&lt;BR /&gt;
&amp;gt; &amp;gt; blocks based on filters below.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
/***************************************************************************&lt;BR /&gt;
&amp;gt; &amp;gt; ******&lt;BR /&gt;
&amp;gt; &amp;gt; If rs!serial &amp;gt; 1 Then&lt;BR /&gt;
&amp;gt; &amp;gt;             wellPoint(0) = CDbl(rs!sx)&lt;BR /&gt;
&amp;gt; &amp;gt;             wellPoint(1) = CDbl(rs!sy)&lt;BR /&gt;
&amp;gt; &amp;gt;             wellPoint(2) = 0&lt;BR /&gt;
&amp;gt; &amp;gt;             btmPoint(0) = CDbl(rs!btmx)&lt;BR /&gt;
&amp;gt; &amp;gt;             btmPoint(1) = CDbl(rs!btmy)&lt;BR /&gt;
&amp;gt; &amp;gt;             btmPoint(2) = 0&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;             If (rs!Status = "01") Or (rs!Status = "02") Then&lt;BR /&gt;
&amp;gt; &amp;gt;                 If rs!btmx = "0000000" Then&lt;BR /&gt;
&amp;gt; &amp;gt;                     Set anObj =&lt;BR /&gt;
&amp;gt; &amp;gt; acadObj.ActiveDocument.ModelSpace.InsertBlock(wellPoint, cirp, xscale,&lt;BR /&gt;
&amp;gt; &amp;gt; yscale, rotAngle)&lt;BR /&gt;
&amp;gt; &amp;gt;                     attr = anObj.GetAttributes&lt;BR /&gt;
&amp;gt; &amp;gt;                         attr(0).textstring = CStr(rs!serial)&lt;BR /&gt;
&amp;gt; &amp;gt;                     Set ahold =&lt;BR /&gt;
&amp;gt; &amp;gt; acadObj.ActiveDocument.ModelSpace.InsertBlock(wellPoint, lblosin,&lt;BR /&gt;
xscale,&lt;BR /&gt;
&amp;gt; &amp;gt; yscale, rotAngle)&lt;BR /&gt;
&amp;gt; &amp;gt;                     atts = ahold.GetAttributes&lt;BR /&gt;
&amp;gt; &amp;gt;                         atts(0).textstring = CStr(rs!OPNAMET)&lt;BR /&gt;
&amp;gt; &amp;gt;                         atts(1).textstring = CStr(rs!wn)&lt;BR /&gt;
&amp;gt; &amp;gt;                         atts(2).textstring = CStr(rs!se)&lt;BR /&gt;
&amp;gt; &amp;gt;                         atts(3).textstring = CStr(rs!tdpth)&lt;BR /&gt;
&amp;gt; &amp;gt;                 Else&lt;BR /&gt;
&amp;gt; &amp;gt;                     Set anObjsurf =&lt;BR /&gt;
&amp;gt; &amp;gt; acadObj.ActiveDocument.ModelSpace.InsertBlock(wellPoint, surfloc,&lt;BR /&gt;
xscale,&lt;BR /&gt;
&amp;gt; &amp;gt; yscale, rotAngle)&lt;BR /&gt;
&amp;gt; &amp;gt;                     Set anObj =&lt;BR /&gt;
&amp;gt; &amp;gt; acadObj.ActiveDocument.ModelSpace.InsertBlock(btmPoint, cirp, xscale,&lt;BR /&gt;
&amp;gt; &amp;gt; yscale, rotAngle)&lt;BR /&gt;
&amp;gt; &amp;gt;                     Set conObj =&lt;BR /&gt;
&amp;gt; &amp;gt; acadObj.ActiveDocument.ModelSpace.AddLine(wellPoint, btmPoint)&lt;BR /&gt;
&amp;gt; &amp;gt;                     conObj.Color = (cboLnclr.ListIndex + 1)&lt;BR /&gt;
&amp;gt; &amp;gt;                     attu = anObj.GetAttributes&lt;BR /&gt;
&amp;gt; &amp;gt;                         attu(0).textstring = CStr(rs!se)&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
****************************************************************************&lt;BR /&gt;
&amp;gt; &amp;gt; *******/&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Carlos&lt;BR /&gt;
&amp;gt;&lt;/MDSINC&gt;</description>
      <pubDate>Fri, 28 Jan 2000 17:19:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-legend/m-p/303446#M96441</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-28T17:19:07Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-legend/m-p/303447#M96442</link>
      <description>Carlos,&lt;BR /&gt;
    Use the insertion point of the title block as a reference for insertion&lt;BR /&gt;
points of your "legend blocks". Then you after looping through the blocks, you&lt;BR /&gt;
can check your variables for : If myvar &amp;gt; 0 then ... insert a block and set an&lt;BR /&gt;
attribute or text string to the variable value showing the number of blocks. If&lt;BR /&gt;
the variable count is still 0 then don't insert the block. I'm in a pinch for&lt;BR /&gt;
time now, but if I have a chance, I may jump on this weekend and be a little&lt;BR /&gt;
more descriptive.&lt;BR /&gt;
-Josh&lt;BR /&gt;
&lt;BR /&gt;
Carlos Femmer wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; Josh,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I was trying to get the type and count and display in some sort of form but&lt;BR /&gt;
&amp;gt; also what I would&lt;BR /&gt;
&amp;gt; like to accomplish is creating a legend in the map.  For instance, in a&lt;BR /&gt;
&amp;gt; current view I have all&lt;BR /&gt;
&amp;gt; the wells plotted.  I have a title block off to the right of the drawing.&lt;BR /&gt;
&amp;gt; In the title block I would&lt;BR /&gt;
&amp;gt; like to allocate some space for a legend.  What I would like the legend to&lt;BR /&gt;
&amp;gt; display is one instance&lt;BR /&gt;
&amp;gt; of each block that was inserted in the drawing with a description of the&lt;BR /&gt;
&amp;gt; block.  After the legend&lt;BR /&gt;
&amp;gt; is created in the map, maybe display some sort of form that you described.&lt;BR /&gt;
&amp;gt; I am currently working&lt;BR /&gt;
&amp;gt; on your solution and if you have any input on the above legend in a map I&lt;BR /&gt;
&amp;gt; would appreciate any feedback.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Carlos&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Minkwitz Design &lt;MDSINC&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:389087F6.3E5704DC@xta.com...&lt;BR /&gt;
&amp;gt; &amp;gt; Carlos,&lt;BR /&gt;
&amp;gt; &amp;gt;     If I understand correctly, your just looking for the type and count of&lt;BR /&gt;
&amp;gt; the&lt;BR /&gt;
&amp;gt; &amp;gt; blocks in your drawing, something for the user to view and then close out.&lt;BR /&gt;
&amp;gt; If&lt;BR /&gt;
&amp;gt; &amp;gt; that's the case, you can loop through the&lt;BR /&gt;
&amp;gt; &amp;gt; autocad.application.activedrawing.blocks collection, not the blockref&lt;BR /&gt;
&amp;gt; &amp;gt; collection. Then use select case or block if to count the blocks and&lt;BR /&gt;
&amp;gt; assign the&lt;BR /&gt;
&amp;gt; &amp;gt; quantities to a group of variables or place them in a multidimenional&lt;BR /&gt;
&amp;gt; array&lt;BR /&gt;
&amp;gt; &amp;gt; where the first column is the blockname and the second is the count, ect..&lt;BR /&gt;
&amp;gt; You&lt;BR /&gt;
&amp;gt; &amp;gt; can then create a form and place the info you want in textboxes, ect for&lt;BR /&gt;
&amp;gt; the&lt;BR /&gt;
&amp;gt; &amp;gt; user to view. By setting the enabled property of the textboxes to false&lt;BR /&gt;
&amp;gt; the user&lt;BR /&gt;
&amp;gt; &amp;gt; won't be able to modify their values, just view them and close out the&lt;BR /&gt;
&amp;gt; form&lt;BR /&gt;
&amp;gt; &amp;gt; until the next time you run your program. Hope this is what your looking&lt;BR /&gt;
&amp;gt; for.&lt;BR /&gt;
&amp;gt; &amp;gt; -Josh&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Carlos Femmer wrote:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Hi guys,&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; One quick note.  I came to this vba news group several months ago and&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; answered several questions and posted a couple.  Unfortunately nobody&lt;BR /&gt;
&amp;gt; knew&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; anything about vba.  I am looking at some recent post and answers and it&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; looks like some programmers finally arrived.  I have a problem and any&lt;BR /&gt;
&amp;gt; input&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; would be appreciated.  I have an oracle database that stores our well&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; information.  I wrote a routine that grabs the wells from the database&lt;BR /&gt;
&amp;gt; based&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; on filters and plots them in the map.  I have 26 different blocks that&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; represent the type of wells.  An example would be when I run the well&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; routine for a particular area it might plot (10 active blocks, 16 shut&lt;BR /&gt;
&amp;gt; in&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; blocks, 27 water blocks etc...)  What would be the easiest way to build&lt;BR /&gt;
&amp;gt; a&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; legend of the blocks plotted.  I have the partial code that inserts the&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; blocks based on filters below.&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; /***************************************************************************&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; ******&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; If rs!serial &amp;gt; 1 Then&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;             wellPoint(0) = CDbl(rs!sx)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;             wellPoint(1) = CDbl(rs!sy)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;             wellPoint(2) = 0&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;             btmPoint(0) = CDbl(rs!btmx)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;             btmPoint(1) = CDbl(rs!btmy)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;             btmPoint(2) = 0&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;             If (rs!Status = "01") Or (rs!Status = "02") Then&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;                 If rs!btmx = "0000000" Then&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;                     Set anObj =&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; acadObj.ActiveDocument.ModelSpace.InsertBlock(wellPoint, cirp, xscale,&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; yscale, rotAngle)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;                     attr = anObj.GetAttributes&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;                         attr(0).textstring = CStr(rs!serial)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;                     Set ahold =&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; acadObj.ActiveDocument.ModelSpace.InsertBlock(wellPoint, lblosin,&lt;BR /&gt;
&amp;gt; xscale,&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; yscale, rotAngle)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;                     atts = ahold.GetAttributes&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;                         atts(0).textstring = CStr(rs!OPNAMET)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;                         atts(1).textstring = CStr(rs!wn)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;                         atts(2).textstring = CStr(rs!se)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;                         atts(3).textstring = CStr(rs!tdpth)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;                 Else&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;                     Set anObjsurf =&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; acadObj.ActiveDocument.ModelSpace.InsertBlock(wellPoint, surfloc,&lt;BR /&gt;
&amp;gt; xscale,&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; yscale, rotAngle)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;                     Set anObj =&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; acadObj.ActiveDocument.ModelSpace.InsertBlock(btmPoint, cirp, xscale,&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; yscale, rotAngle)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;                     Set conObj =&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; acadObj.ActiveDocument.ModelSpace.AddLine(wellPoint, btmPoint)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;                     conObj.Color = (cboLnclr.ListIndex + 1)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;                     attu = anObj.GetAttributes&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;                         attu(0).textstring = CStr(rs!se)&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; ****************************************************************************&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; *******/&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Carlos&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;/MDSINC&gt;</description>
      <pubDate>Fri, 28 Jan 2000 23:47:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-legend/m-p/303447#M96442</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-28T23:47:19Z</dc:date>
    </item>
  </channel>
</rss>

