<?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: Select entity by lineweight in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/select-entity-by-lineweight/m-p/2158943#M21616</link>
    <description>That worked, thanks!</description>
    <pubDate>Fri, 01 Feb 2008 11:19:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-02-01T11:19:54Z</dc:date>
    <item>
      <title>Select entity by lineweight</title>
      <link>https://forums.autodesk.com/t5/vba-forum/select-entity-by-lineweight/m-p/2158938#M21611</link>
      <description>I have a macro that selects lines from a selectionset with certain properties and sets them to 'bylayer' then to a certain layer.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Sub SelHiddenLType()&lt;BR /&gt;
&lt;BR /&gt;
Dim SS As AcadSelectionSet&lt;BR /&gt;
Dim fType(2) As Integer&lt;BR /&gt;
Dim fData(2) As Variant&lt;BR /&gt;
Dim ssObject As AcadEntity&lt;BR /&gt;
Dim Count As Integer&lt;BR /&gt;
&lt;BR /&gt;
Set SS = SSDel("temp")&lt;BR /&gt;
&lt;BR /&gt;
fType(0) = 0: fData(0) = "line"&lt;BR /&gt;
fType(1) = 6: fData(1) = "Continuous"&lt;BR /&gt;
fType(2) = 370: fData(2) = "50" 'this is not working&lt;BR /&gt;
&lt;BR /&gt;
SS.Select acSelectionSetAll, , , fType, fData&lt;BR /&gt;
&lt;BR /&gt;
MsgBox SS.Count &amp;amp; " hidden line(s) found"&lt;BR /&gt;
&lt;BR /&gt;
For Each ssObject In SS&lt;BR /&gt;
ssObject.Linetype = "BYLAYER"&lt;BR /&gt;
ssObject.Lineweight = acLnWtByLayer&lt;BR /&gt;
ssObject.color = acByLayer&lt;BR /&gt;
ssObject.Layer = "__Contour"&lt;BR /&gt;
Next ssObject&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Private Function SSDel(strName As String) As AcadSelectionSet&lt;BR /&gt;
&lt;BR /&gt;
' Check Selection Set Name&lt;BR /&gt;
&lt;BR /&gt;
Dim ObjSS As AcadSelectionSet&lt;BR /&gt;
Dim objSSets As AcadSelectionSets&lt;BR /&gt;
&lt;BR /&gt;
Set objSSets = ThisDrawing.SelectionSets&lt;BR /&gt;
For Each ObjSS In objSSets&lt;BR /&gt;
If ObjSS.Name = strName Then&lt;BR /&gt;
objSSets.Item(strName).Delete&lt;BR /&gt;
Exit For&lt;BR /&gt;
End If&lt;BR /&gt;
Next&lt;BR /&gt;
Set ObjSS = objSSets.Add(strName)&lt;BR /&gt;
Set SSDel = ObjSS&lt;BR /&gt;
&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The problem is that fType(2) = 370: fData(2) = "50" does not detect 0.50 mm lineweight. I've tried changing fType to 371-379 and the fData to -1(ByLayer).&lt;BR /&gt;
&lt;BR /&gt;
Can someone help?</description>
      <pubDate>Fri, 18 Jan 2008 08:47:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/select-entity-by-lineweight/m-p/2158938#M21611</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-18T08:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Select entity by lineweight</title>
      <link>https://forums.autodesk.com/t5/vba-forum/select-entity-by-lineweight/m-p/2158939#M21612</link>
      <description>The value for dxf code 370 must be integer:&lt;BR /&gt;
fType(2) = 370: fData(2) = 50&lt;BR /&gt;
or use AutoCAD VBA enum (see Lineweight property&lt;BR /&gt;
in the Help file)&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Sat, 19 Jan 2008 22:48:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/select-entity-by-lineweight/m-p/2158939#M21612</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-19T22:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Select entity by lineweight</title>
      <link>https://forums.autodesk.com/t5/vba-forum/select-entity-by-lineweight/m-p/2158940#M21613</link>
      <description>Thanks for you're reply, but both 50 and acLnWt050 do not work! any other suggestions?</description>
      <pubDate>Tue, 29 Jan 2008 11:29:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/select-entity-by-lineweight/m-p/2158940#M21613</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-29T11:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Select entity by lineweight</title>
      <link>https://forums.autodesk.com/t5/vba-forum/select-entity-by-lineweight/m-p/2158941#M21614</link>
      <description>Sorry for the belating,&lt;BR /&gt;
Yes, you're right, I 'm wrong&lt;BR /&gt;
Here is an ugly and dirty method to select&lt;BR /&gt;
all objects entire drawing with using of Lisp&lt;BR /&gt;
expression in SendCommand (I don't like it)&lt;BR /&gt;
&lt;BR /&gt;
Option Explicit&lt;BR /&gt;
&lt;BR /&gt;
Public Sub SelectByLwt()&lt;BR /&gt;
&lt;BR /&gt;
     Dim ss As AcadSelectionSet&lt;BR /&gt;
     On Error GoTo Err_Control&lt;BR /&gt;
     Dim lwt As String&lt;BR /&gt;
     lwt = InputBox(vbCr &amp;amp; "Enter lineweight value" &amp;amp; vbCr &amp;amp; _&lt;BR /&gt;
                           "[ as integer number only ]" &amp;amp; vbCr &amp;amp; _&lt;BR /&gt;
                           "Or press Enter to set default", "Select by lineweight", "53")&lt;BR /&gt;
          With ThisDrawing&lt;BR /&gt;
               While .SelectionSets.Count &amp;gt; 0&lt;BR /&gt;
                    .SelectionSets.item(0).Delete&lt;BR /&gt;
               Wend&lt;BR /&gt;
               ' lisp expression to select all objects with this lineweight entire drawing&lt;BR /&gt;
               .SendCommand "(SSGET " &amp;amp; Chr(34) &amp;amp; "X" &amp;amp; Chr(34) &amp;amp; " (list (cons 370 " &amp;amp; lwt &amp;amp; ")))" &amp;amp; vbCr&lt;BR /&gt;
          Set ss = .ActiveSelectionSet&lt;BR /&gt;
     End With&lt;BR /&gt;
&lt;BR /&gt;
     MsgBox "Selected: " &amp;amp; ss.Count &amp;amp; " objects"&lt;BR /&gt;
     &lt;BR /&gt;
Dim ent As AcadEntity&lt;BR /&gt;
For Each ent In ss&lt;BR /&gt;
On Error Resume Next&lt;BR /&gt;
ent.color = acYellow&lt;BR /&gt;
Next&lt;BR /&gt;
&lt;BR /&gt;
Err_Control:&lt;BR /&gt;
If Not Err = 0 Then&lt;BR /&gt;
MsgBox Err.Description&lt;BR /&gt;
Err.Clear&lt;BR /&gt;
End If&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Wed, 30 Jan 2008 12:38:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/select-entity-by-lineweight/m-p/2158941#M21614</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-30T12:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Select entity by lineweight</title>
      <link>https://forums.autodesk.com/t5/vba-forum/select-entity-by-lineweight/m-p/2158942#M21615</link>
      <description>Rather than use lineweight as a selection filter test for it within the loop:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Sub SelHiddenLType()&lt;BR /&gt;
&lt;BR /&gt;
Dim SS As AcadSelectionSet&lt;BR /&gt;
Dim fType(1) As Integer&lt;BR /&gt;
Dim fData(1) As Variant&lt;BR /&gt;
Dim ssObject As AcadEntity&lt;BR /&gt;
Dim Count As Integer&lt;BR /&gt;
&lt;BR /&gt;
Set SS = SSDel("temp")&lt;BR /&gt;
&lt;BR /&gt;
fType(0) = 0: fData(0) = "line"&lt;BR /&gt;
fType(1) = 6: fData(1) = "Continuous"&lt;BR /&gt;
'fType(2) = 370: fData(2) = "50" 'this is not working&lt;BR /&gt;
&lt;BR /&gt;
SS.Select acSelectionSetAll, , , fType, fData&lt;BR /&gt;
&lt;BR /&gt;
MsgBox SS.Count &amp;amp; " hidden line(s) found"&lt;BR /&gt;
&lt;BR /&gt;
For Each ssObject In SS&lt;BR /&gt;
If Not ssObject.Lineweight = acLnWt050 Then GoTo skipme&lt;BR /&gt;
ssObject.Linetype = "BYLAYER"&lt;BR /&gt;
ssObject.Lineweight = acLnWtByLayer&lt;BR /&gt;
ssObject.color = acByLayer&lt;BR /&gt;
ssObject.Layer = "__Contour"&lt;BR /&gt;
skipme:&lt;BR /&gt;
Next ssObject&lt;BR /&gt;
&lt;BR /&gt;
End Sub</description>
      <pubDate>Thu, 31 Jan 2008 17:57:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/select-entity-by-lineweight/m-p/2158942#M21615</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-31T17:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Select entity by lineweight</title>
      <link>https://forums.autodesk.com/t5/vba-forum/select-entity-by-lineweight/m-p/2158943#M21616</link>
      <description>That worked, thanks!</description>
      <pubDate>Fri, 01 Feb 2008 11:19:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/select-entity-by-lineweight/m-p/2158943#M21616</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-02-01T11:19:54Z</dc:date>
    </item>
  </channel>
</rss>

