<?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 selection filter text papersize in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/selection-filter-text-papersize/m-p/5475735#M41620</link>
    <description>&lt;P&gt;I'm writing a code to change the color of all text in a drawing depending on text size.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thickness has te be 1/10 of the textheight.&lt;/P&gt;&lt;P&gt;Text with a papersize of 2.5 should get a color that has a thickness of 0.25 mm in the pentable.&lt;/P&gt;&lt;P&gt;At the moment this is the only code that works but i have to link the&amp;nbsp;selectionfilter to a&amp;nbsp;textstyle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;' Start a transaction&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Using acTrans As Transaction = db.TransactionManager.StartTransaction()&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Dim mytextstyle(0) As TypedValue&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;'' Create a TypedValue array to define the filter criteria&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;mytextstyle.SetValue(New TypedValue(DxfCode.TextStyleName, "text2.5"), 0)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Dim selectiefilter As New SelectionFilter(WFO)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;'' Request for objects to be selected in the drawing area&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Dim acSSPrompt As PromptSelectionResult = ed.SelectAll(selectiefilter)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;'' If the prompt status is OK, objects were selected&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;If acSSPrompt.Status = PromptStatus.OK Then&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Dim acSSet As SelectionSet = acSSPrompt.Value&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;'' Step through the objects in the selection set&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;For Each acSSObj As SelectedObject In acSSet&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;'' Check to make sure a valid SelectedObject object was returned&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;If Not IsDBNull(acSSObj) Then&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;'' Open the selected object for write&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Dim acEnt As Entity = acTrans.GetObject(acSSObj.ObjectId, _&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;OpenMode.ForWrite)&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;If Not IsDBNull(acEnt) Then&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;'' Change the object's color&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;acEnt.ColorIndex = 7&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;End If&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;End If&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Next&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;End If&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;'' Save the new object to the database&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;acTrans.Commit()&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;'' Dispose of the transaction&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;End Using&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(repeated with different text styles text5, text3.5, text1.5)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;textstyle text2.5 has a papersize of 2.5 but when i scale the text to 5 for example&amp;nbsp;it will not change its color to the right of course.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know i can use dxfCode.txtPsize but how can i use an selectionfilter that&amp;nbsp;filters textsize between&amp;nbsp;two values?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jan 2015 14:55:40 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-01-20T14:55:40Z</dc:date>
    <item>
      <title>selection filter text papersize</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-filter-text-papersize/m-p/5475735#M41620</link>
      <description>&lt;P&gt;I'm writing a code to change the color of all text in a drawing depending on text size.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thickness has te be 1/10 of the textheight.&lt;/P&gt;&lt;P&gt;Text with a papersize of 2.5 should get a color that has a thickness of 0.25 mm in the pentable.&lt;/P&gt;&lt;P&gt;At the moment this is the only code that works but i have to link the&amp;nbsp;selectionfilter to a&amp;nbsp;textstyle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;' Start a transaction&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Using acTrans As Transaction = db.TransactionManager.StartTransaction()&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Dim mytextstyle(0) As TypedValue&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;'' Create a TypedValue array to define the filter criteria&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;mytextstyle.SetValue(New TypedValue(DxfCode.TextStyleName, "text2.5"), 0)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Dim selectiefilter As New SelectionFilter(WFO)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;'' Request for objects to be selected in the drawing area&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Dim acSSPrompt As PromptSelectionResult = ed.SelectAll(selectiefilter)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;'' If the prompt status is OK, objects were selected&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;If acSSPrompt.Status = PromptStatus.OK Then&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Dim acSSet As SelectionSet = acSSPrompt.Value&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;'' Step through the objects in the selection set&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;For Each acSSObj As SelectedObject In acSSet&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;'' Check to make sure a valid SelectedObject object was returned&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;If Not IsDBNull(acSSObj) Then&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;'' Open the selected object for write&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Dim acEnt As Entity = acTrans.GetObject(acSSObj.ObjectId, _&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;OpenMode.ForWrite)&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;If Not IsDBNull(acEnt) Then&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;'' Change the object's color&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;acEnt.ColorIndex = 7&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;End If&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;End If&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Next&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;End If&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;'' Save the new object to the database&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;acTrans.Commit()&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;'' Dispose of the transaction&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;End Using&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(repeated with different text styles text5, text3.5, text1.5)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;textstyle text2.5 has a papersize of 2.5 but when i scale the text to 5 for example&amp;nbsp;it will not change its color to the right of course.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know i can use dxfCode.txtPsize but how can i use an selectionfilter that&amp;nbsp;filters textsize between&amp;nbsp;two values?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2015 14:55:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-filter-text-papersize/m-p/5475735#M41620</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-20T14:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: selection filter text papersize</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-filter-text-papersize/m-p/5477141#M41621</link>
      <description>TypedValue[] filter = new TypedValue[3];&lt;BR /&gt;filter.SetValue(new TypedValue((int)DxfCode.Start, "CIRCLE"), 0);&lt;BR /&gt;filter.SetValue(new TypedValue((int)DxfCode.Operator, "&amp;gt;="), 1);&lt;BR /&gt;filter.SetValue(new TypedValue(40, 5), 2);&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Jan 2015 15:13:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-filter-text-papersize/m-p/5477141#M41621</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2015-01-21T15:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: selection filter text papersize</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-filter-text-papersize/m-p/5482022#M41622</link>
      <description>&lt;P&gt;It doesnt accept TypedValue[] so i chaged it to TypedValue().&lt;/P&gt;&lt;P&gt;But it also doesnt accept the (int) part&lt;/P&gt;&lt;P&gt;Why do i need Dxfcode.Start, "circle" ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jan 2015 07:38:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-filter-text-papersize/m-p/5482022#M41622</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-26T07:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: selection filter text papersize</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-filter-text-papersize/m-p/5482059#M41623</link>
      <description>my C# sample showed you how to apply calculation rules, such as Radius &amp;gt;= 1.&lt;BR /&gt;You should change that sample into the rule TexhtHeight &amp;gt;= 2.5</description>
      <pubDate>Mon, 26 Jan 2015 08:19:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-filter-text-papersize/m-p/5482059#M41623</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2015-01-26T08:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: selection filter text papersize</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-filter-text-papersize/m-p/5483689#M41624</link>
      <description>&lt;P&gt;Thanks, this helped me a lot further.&lt;/P&gt;&lt;P&gt;This code now works now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WFO.SetValue(New TypedValue(DxfCode.Start, "text"), 0)&lt;BR /&gt;WFO.SetValue(New TypedValue(DxfCode.Operator, "&amp;gt;="), 1)&lt;BR /&gt;WFO.SetValue(New TypedValue(DxfCode.TxtSize, 200), 2)&lt;BR /&gt;WFO.SetValue(New TypedValue(DxfCode.Operator, "&amp;lt;"), 3)&lt;BR /&gt;WFO.SetValue(New TypedValue(DxfCode.TxtSize, 300), 4)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately Dxfcode.txtPsize doesn't work when i debug it (error at&amp;nbsp;acSSPrompt).&lt;/P&gt;&lt;P&gt;I also triend using 42 instead of dxfcode.txtPsize.&lt;/P&gt;&lt;P&gt;TxtSize takes the value of model space height so it goes wrong when i print in different scales than 1:100.&lt;/P&gt;&lt;P&gt;Have you ever used DxfCode.TxtPSize?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jan 2015 08:33:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-filter-text-papersize/m-p/5483689#M41624</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-27T08:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: selection filter text papersize</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-filter-text-papersize/m-p/5483697#M41625</link>
      <description>no never used it.&lt;BR /&gt;Can't you multiply the required textsizes with the plotscale (dimscale)?</description>
      <pubDate>Tue, 27 Jan 2015 08:44:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-filter-text-papersize/m-p/5483697#M41625</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2015-01-27T08:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: selection filter text papersize</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-filter-text-papersize/m-p/5483709#M41626</link>
      <description>&lt;P&gt;Yes i thought about it.&lt;/P&gt;&lt;P&gt;I dont use paperspace so i have to take the scale from the specific text.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WFO.SetValue(New TypedValue(DxfCode.Start, "text"), 0)&lt;BR /&gt;WFO.SetValue(New TypedValue(DxfCode.Operator, "&amp;gt;="), 1)&lt;BR /&gt;WFO.SetValue(New TypedValue((DxfCode.TxtSize) / (DxfCode.TxtStyleXScale), 2), 2)&lt;BR /&gt;WFO.SetValue(New TypedValue(DxfCode.Operator, "&amp;lt;"), 3)&lt;BR /&gt;WFO.SetValue(New TypedValue((DxfCode.TxtSize) / (DxfCode.TxtStyleXScale), 3), 4)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The questions are now:&lt;/P&gt;&lt;P&gt;Do i need to multiply or devide? Depending if&amp;nbsp;a scale of 1:100 has a value of 0.01 or 100.&lt;/P&gt;&lt;P&gt;Do i need to use dxfcode.TxtStyleXScale, dxfcode.shapescale or pixelscale?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jan 2015 08:57:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-filter-text-papersize/m-p/5483709#M41626</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-27T08:57:44Z</dc:date>
    </item>
  </channel>
</rss>

