<?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: Help with Selection set in VB in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652756#M34164</link>
    <description>FilterData(0 to 0) must be Variant, not Object&lt;BR /&gt;
&lt;BR /&gt;
These could be all sorts of things, but I don't think an Object would ever &lt;BR /&gt;
be an appropriate value.  Could be a layer name (string), any type of &lt;BR /&gt;
numeric value, etc.&lt;BR /&gt;
&lt;BR /&gt;
If you're having trouble understanding that part and you're not familiar &lt;BR /&gt;
with DXF format, you may want to browse through the DXF Reference section, &lt;BR /&gt;
particularly the Entities section.  It would probably help in understanding &lt;BR /&gt;
how the FilterType/FilterData arrays actually work.&lt;BR /&gt;
&lt;BR /&gt;
&lt;WCRUZ&gt; wrote in message news:5183535@discussion.autodesk.com...&lt;BR /&gt;
Ok, here is the story, I have copied this piece of code from this same forum &lt;BR /&gt;
&amp;amp; I'm using it in VB NOT VBA, (it works fine under AutoCAD VBA) for some odd &lt;BR /&gt;
reason some stuff won't work. I have noted the things that aren't working on &lt;BR /&gt;
the code.  Thanks in advance for your help.&lt;BR /&gt;
&lt;BR /&gt;
William&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Dim SelSet As AcadSelectionSet&lt;BR /&gt;
&lt;BR /&gt;
        Dim FilterType(0 To 0) As Integer&lt;BR /&gt;
&lt;BR /&gt;
        Dim FilterData(0 To 0) As Object&lt;BR /&gt;
&lt;BR /&gt;
&lt;SNIPPED of="" rest="" of="" code=""&gt;&lt;/SNIPPED&gt;&lt;/WCRUZ&gt;</description>
    <pubDate>Tue, 23 May 2006 18:23:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2006-05-23T18:23:32Z</dc:date>
    <item>
      <title>Help with Selection set in VB</title>
      <link>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652755#M34163</link>
      <description>Ok, here is the story, I have copied this piece of code from this same forum &amp;amp; I’m using it in VB NOT VBA, (it works fine under AutoCAD VBA) for some odd reason some stuff won’t work. I have noted the things that aren’t working on the code.  Thanks in advance for your help.&lt;BR /&gt;
&lt;BR /&gt;
William&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Dim SelSet As AcadSelectionSet&lt;BR /&gt;
&lt;BR /&gt;
        Dim FilterType(0 To 0) As Integer&lt;BR /&gt;
&lt;BR /&gt;
        Dim FilterData(0 To 0) As Object&lt;BR /&gt;
&lt;BR /&gt;
        Dim blk As AcadEntity&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
        AcadDoc.SelectionSets.Add("SelSet")&lt;BR /&gt;
&lt;BR /&gt;
        *-*-*-* ‘I GET THE SQUIGLEE LINES HERE-*-*-*-*&lt;BR /&gt;
        SelSet = AcadDoc.SelectionSets("SelSet")&lt;BR /&gt;
&lt;BR /&gt;
        SelSet.Clear()&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
        FilterType(0) = 0&lt;BR /&gt;
&lt;BR /&gt;
        FilterData(0) = "INSERT"&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
         *-*-*-* ‘I GET AN INVALID FILTERTYP OR FILTERDATA -*-*-*-*&lt;BR /&gt;
        SelSet.Select(AcSelect.acSelectionSetAll, , , FilterType, FilterData)&lt;BR /&gt;
        'SelSet.SelectOnScreen(FilterType, FilterData)&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
        If SelSet.Count = 0 Then Exit Sub&lt;BR /&gt;
&lt;BR /&gt;
        For Each blk In SelSet&lt;BR /&gt;
&lt;BR /&gt;
            MsgBox(blk.ObjectName)&lt;BR /&gt;
&lt;BR /&gt;
        Next</description>
      <pubDate>Tue, 23 May 2006 17:18:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652755#M34163</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-23T17:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Selection set in VB</title>
      <link>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652756#M34164</link>
      <description>FilterData(0 to 0) must be Variant, not Object&lt;BR /&gt;
&lt;BR /&gt;
These could be all sorts of things, but I don't think an Object would ever &lt;BR /&gt;
be an appropriate value.  Could be a layer name (string), any type of &lt;BR /&gt;
numeric value, etc.&lt;BR /&gt;
&lt;BR /&gt;
If you're having trouble understanding that part and you're not familiar &lt;BR /&gt;
with DXF format, you may want to browse through the DXF Reference section, &lt;BR /&gt;
particularly the Entities section.  It would probably help in understanding &lt;BR /&gt;
how the FilterType/FilterData arrays actually work.&lt;BR /&gt;
&lt;BR /&gt;
&lt;WCRUZ&gt; wrote in message news:5183535@discussion.autodesk.com...&lt;BR /&gt;
Ok, here is the story, I have copied this piece of code from this same forum &lt;BR /&gt;
&amp;amp; I'm using it in VB NOT VBA, (it works fine under AutoCAD VBA) for some odd &lt;BR /&gt;
reason some stuff won't work. I have noted the things that aren't working on &lt;BR /&gt;
the code.  Thanks in advance for your help.&lt;BR /&gt;
&lt;BR /&gt;
William&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Dim SelSet As AcadSelectionSet&lt;BR /&gt;
&lt;BR /&gt;
        Dim FilterType(0 To 0) As Integer&lt;BR /&gt;
&lt;BR /&gt;
        Dim FilterData(0 To 0) As Object&lt;BR /&gt;
&lt;BR /&gt;
&lt;SNIPPED of="" rest="" of="" code=""&gt;&lt;/SNIPPED&gt;&lt;/WCRUZ&gt;</description>
      <pubDate>Tue, 23 May 2006 18:23:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652756#M34164</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-23T18:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Selection set in VB</title>
      <link>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652757#M34165</link>
      <description>Tom, VB does not have a Variant type. The Object, in this case, is &lt;BR /&gt;
correct.....&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"TomD" &lt;TDIVITTIS&gt; wrote in message &lt;BR /&gt;
news:5183628@discussion.autodesk.com...&lt;BR /&gt;
FilterData(0 to 0) must be Variant, not Object&lt;BR /&gt;
&lt;BR /&gt;
These could be all sorts of things, but I don't think an Object would ever&lt;BR /&gt;
be an appropriate value.  Could be a layer name (string), any type of&lt;BR /&gt;
numeric value, etc.&lt;BR /&gt;
&lt;BR /&gt;
If you're having trouble understanding that part and you're not familiar&lt;BR /&gt;
with DXF format, you may want to browse through the DXF Reference section,&lt;BR /&gt;
particularly the Entities section.  It would probably help in understanding&lt;BR /&gt;
how the FilterType/FilterData arrays actually work.&lt;BR /&gt;
&lt;BR /&gt;
&lt;WCRUZ&gt; wrote in message news:5183535@discussion.autodesk.com...&lt;BR /&gt;
Ok, here is the story, I have copied this piece of code from this same forum&lt;BR /&gt;
&amp;amp; I'm using it in VB NOT VBA, (it works fine under AutoCAD VBA) for some odd&lt;BR /&gt;
reason some stuff won't work. I have noted the things that aren't working on&lt;BR /&gt;
the code.  Thanks in advance for your help.&lt;BR /&gt;
&lt;BR /&gt;
William&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Dim SelSet As AcadSelectionSet&lt;BR /&gt;
&lt;BR /&gt;
        Dim FilterType(0 To 0) As Integer&lt;BR /&gt;
&lt;BR /&gt;
        Dim FilterData(0 To 0) As Object&lt;BR /&gt;
&lt;BR /&gt;
&lt;SNIPPED of="" rest="" of="" code=""&gt;&lt;/SNIPPED&gt;&lt;/WCRUZ&gt;&lt;/TDIVITTIS&gt;</description>
      <pubDate>Tue, 23 May 2006 18:24:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652757#M34165</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-23T18:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Selection set in VB</title>
      <link>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652758#M34166</link>
      <description>You beat me to it. VB Express got rid of a Variant type and replaced it with an Object.</description>
      <pubDate>Tue, 23 May 2006 18:30:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652758#M34166</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-23T18:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Selection set in VB</title>
      <link>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652759#M34167</link>
      <description>I'm going to guess that since you said "SQUIGLEE" you're not in VB or VBA &lt;BR /&gt;
but rather VB.NET?&lt;BR /&gt;
&lt;BR /&gt;
Sounds like your AcadDoc object is not instantiated.&lt;BR /&gt;
&lt;BR /&gt;
&lt;WCRUZ&gt; wrote in message news:5183535@discussion.autodesk.com...&lt;BR /&gt;
Ok, here is the story, I have copied this piece of code from this same forum &lt;BR /&gt;
&amp;amp; I'm using it in VB NOT VBA, (it works fine under AutoCAD VBA) for some odd &lt;BR /&gt;
reason some stuff won't work. I have noted the things that aren't working on &lt;BR /&gt;
the code.  Thanks in advance for your help.&lt;BR /&gt;
&lt;BR /&gt;
William&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Dim SelSet As AcadSelectionSet&lt;BR /&gt;
&lt;BR /&gt;
        Dim FilterType(0 To 0) As Integer&lt;BR /&gt;
&lt;BR /&gt;
        Dim FilterData(0 To 0) As Object&lt;BR /&gt;
&lt;BR /&gt;
        Dim blk As AcadEntity&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
        AcadDoc.SelectionSets.Add("SelSet")&lt;BR /&gt;
&lt;BR /&gt;
        *-*-*-* 'I GET THE SQUIGLEE LINES HERE-*-*-*-*&lt;BR /&gt;
        SelSet = AcadDoc.SelectionSets("SelSet")&lt;BR /&gt;
&lt;BR /&gt;
        SelSet.Clear()&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
        FilterType(0) = 0&lt;BR /&gt;
&lt;BR /&gt;
        FilterData(0) = "INSERT"&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
         *-*-*-* 'I GET AN INVALID FILTERTYP OR FILTERDATA -*-*-*-*&lt;BR /&gt;
        SelSet.Select(AcSelect.acSelectionSetAll, , , FilterType, &lt;BR /&gt;
FilterData)&lt;BR /&gt;
        'SelSet.SelectOnScreen(FilterType, FilterData)&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
        If SelSet.Count = 0 Then Exit Sub&lt;BR /&gt;
&lt;BR /&gt;
        For Each blk In SelSet&lt;BR /&gt;
&lt;BR /&gt;
            MsgBox(blk.ObjectName)&lt;BR /&gt;
&lt;BR /&gt;
        Next&lt;/WCRUZ&gt;</description>
      <pubDate>Tue, 23 May 2006 18:32:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652759#M34167</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-23T18:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Selection set in VB</title>
      <link>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652760#M34168</link>
      <description>Thank you both and my sincerest apologies for the misleading answer.&lt;BR /&gt;
&lt;BR /&gt;
.....Maybe I should be looking into VB Express?&lt;BR /&gt;
&lt;BR /&gt;
&lt;WCRUZ&gt; wrote in message news:5183655@discussion.autodesk.com...&lt;BR /&gt;
You beat me to it. VB Express got rid of a Variant type and replaced it with &lt;BR /&gt;
an Object.&lt;/WCRUZ&gt;</description>
      <pubDate>Tue, 23 May 2006 18:35:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652760#M34168</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-23T18:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Selection set in VB</title>
      <link>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652761#M34169</link>
      <description>Here is the first part of the code that was not included in the origina post.&lt;BR /&gt;
&lt;BR /&gt;
Dim acadApp As AcadApplication&lt;BR /&gt;
        Dim AcadDoc As AcadDocument&lt;BR /&gt;
        Dim AcadObj As AcadObject&lt;BR /&gt;
        Dim BlockRef As AcadBlockReference&lt;BR /&gt;
&lt;BR /&gt;
        Try&lt;BR /&gt;
            acadApp = GetObject(, "AutoCAD.Application")&lt;BR /&gt;
        Catch&lt;BR /&gt;
            acadApp = CreateObject("AutoCAD.Application")&lt;BR /&gt;
        End Try&lt;BR /&gt;
&lt;BR /&gt;
        AcadDoc = acadApp.ActiveDocument</description>
      <pubDate>Tue, 23 May 2006 18:35:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652761#M34169</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-23T18:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Selection set in VB</title>
      <link>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652762#M34170</link>
      <description>In VB.Net the Integer is now a 32 bit integer where Acad is expecting a 16 &lt;BR /&gt;
bit integer.....try this:&lt;BR /&gt;
Dim FilterType(0) As Int16&lt;BR /&gt;
&lt;BR /&gt;
&lt;WCRUZ&gt; wrote in message news:5183646@discussion.autodesk.com...&lt;BR /&gt;
Here is the first part of the code that was not included in the origina &lt;BR /&gt;
post.&lt;BR /&gt;
&lt;BR /&gt;
Dim acadApp As AcadApplication&lt;BR /&gt;
        Dim AcadDoc As AcadDocument&lt;BR /&gt;
        Dim AcadObj As AcadObject&lt;BR /&gt;
        Dim BlockRef As AcadBlockReference&lt;BR /&gt;
&lt;BR /&gt;
        Try&lt;BR /&gt;
            acadApp = GetObject(, "AutoCAD.Application")&lt;BR /&gt;
        Catch&lt;BR /&gt;
            acadApp = CreateObject("AutoCAD.Application")&lt;BR /&gt;
        End Try&lt;BR /&gt;
&lt;BR /&gt;
        AcadDoc = acadApp.ActiveDocument&lt;/WCRUZ&gt;</description>
      <pubDate>Tue, 23 May 2006 19:07:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652762#M34170</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-23T19:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Selection set in VB</title>
      <link>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652763#M34171</link>
      <description>Also, you could use Short in lieu of Int16...&lt;BR /&gt;
&lt;BR /&gt;
"Jeff Mishler" &lt;MIFFATSONICDOTNETIS_ALL&gt; wrote in message &lt;BR /&gt;
news:5183712@discussion.autodesk.com...&lt;BR /&gt;
In VB.Net the Integer is now a 32 bit integer where Acad is expecting a 16&lt;BR /&gt;
bit integer.....try this:&lt;BR /&gt;
Dim FilterType(0) As Int16&lt;/MIFFATSONICDOTNETIS_ALL&gt;</description>
      <pubDate>Tue, 23 May 2006 19:09:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652763#M34171</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-23T19:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Selection set in VB</title>
      <link>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652764#M34172</link>
      <description>Thanks Jeff &amp;amp; others for the suggestions. Your solution fixed the problem. "Int16"</description>
      <pubDate>Tue, 23 May 2006 19:16:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/help-with-selection-set-in-vb/m-p/1652764#M34172</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-05-23T19:16:02Z</dc:date>
    </item>
  </channel>
</rss>

