﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Manifold Community Site: Refresh after Selections</title><link>http://forum.manifold.net/forum/t18068</link><description>Manifold Community Site thread</description><image><url>http://forum.manifold.net/forum/images/img-feedhead.png</url><title>Manifold Community Site: Refresh after Selections</title><link>http://forum.manifold.net/forum/t18068</link></image><item><title>RE: Refresh after Selections</title><link>http://forum.manifold.net/forum/t18068#18069</link><description>&lt;P&gt;I am developing an add-in and have the following code (2 drawings, I want to select points that fall within an area created by a buffered line):&lt;/P&gt;&lt;P&gt;       xQuery = theApplication.ActiveDocument.NewQuery(&amp;quot;TempQuery&amp;quot;, False)         xQuery.Text = &amp;quot;SELECT * FROM [&amp;quot; + theStationDrawing + &amp;quot;], [&amp;quot; + theProfileDrawing + &amp;quot;] WHERE [&amp;quot; + theProfileDrawing + &amp;quot;].[Selection (I)] AND Contains(Buffer([&amp;quot; + theProfileDrawing + &amp;quot;].[ID],1000), [&amp;quot; + theStationDrawing + &amp;quot;].[ID]);&amp;quot;&lt;/P&gt;&lt;P&gt;        xQuery.RunEx(True)         xStations.Refresh()         xProfiles.Refresh()&lt;/P&gt;&lt;P&gt;The selection is not updated in the map as expected. The query does work fine: if i run the query from the query window that is created in the project through this code, the selection is made and the map updates.&lt;/P&gt;&lt;P&gt;What am I missing to make the map update through my code?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;N&lt;/P&gt;</description><dc:creator>njengler</dc:creator><comments>http://forum.manifold.net/forum/t18068#18069</comments><guid>http://forum.manifold.net/forum/t18068#18069</guid><pubDate>Fri, 23 Dec 2005 08:53:04 GMT</pubDate></item><item><title>RE: Refresh after Selections</title><link>http://forum.manifold.net/forum/t18068#18075</link><description>&lt;P&gt;Selecting objects and records returned by a query is a purely UI thing, done for the user's convenience. You can turn it off in Tools - Options, Miscellaneous (uncheck the &amp;quot;Automatically select query records&amp;quot; option). To select objects returned by a query from within a script, convert a SELECT query into an equivalent UPDATE query which sets the [Selection (I)] column, eg: &lt;P class='code'&gt;&lt;span class=c&gt;--SQL&lt;/span&gt;&lt;/P&gt;&lt;P class='code'&gt;&lt;span class=k&gt;UPDATE&lt;/span&gt;&amp;#160;(&lt;span class=k&gt;SELECT&lt;/span&gt;&amp;#160;&lt;span class=i&gt;[Stations]&lt;/span&gt;.&lt;span class=i&gt;[Selection&amp;#160;(I)]&lt;/span&gt;&amp;#160;&lt;span class=k&gt;FROM&lt;/span&gt;&amp;#160;...&amp;#160;&lt;span class=k&gt;WHERE&lt;/span&gt;&amp;#160;...)&amp;#160;&lt;span class=k&gt;SET&lt;/span&gt;&amp;#160;&lt;span class=i&gt;[Selection&amp;#160;(I)]&lt;/span&gt;&amp;#160;=&amp;#160;&lt;span class=k&gt;True&lt;/span&gt;;&lt;/P&gt; Prior to running the above query, unselect all objects using: &lt;P class='code'&gt;&lt;span class=c&gt;--SQL&lt;/span&gt;&lt;/P&gt;&lt;P class='code'&gt;&lt;span class=k&gt;UPDATE&lt;/span&gt;&amp;#160;&lt;span class=i&gt;[Stations]&lt;/span&gt;&amp;#160;&lt;span class=k&gt;SET&lt;/span&gt;&amp;#160;&lt;span class=i&gt;[Selection&amp;#160;(I)]&lt;/span&gt;&amp;#160;=&amp;#160;&lt;span class=k&gt;False&lt;/span&gt;;&lt;/P&gt;&lt;/P&gt;</description><dc:creator>adamw</dc:creator><comments>http://forum.manifold.net/forum/t18068#18075</comments><guid>http://forum.manifold.net/forum/t18068#18075</guid><pubDate>Fri, 23 Dec 2005 22:14:03 GMT</pubDate></item><item><title>RE: Refresh after Selections</title><link>http://forum.manifold.net/forum/t18068#18094</link><description>&lt;P&gt;Excellent, thanks adamw!&lt;/P&gt;&lt;P&gt;A further note for others using this SQL: If your SQL statement contains multiple tables you must explicitly reference the table from which the Selection(I) column is derived after the SET command.&lt;/P&gt;&lt;P&gt; i.e. [TableName].[Selection (I)] = True;&lt;/P&gt;</description><dc:creator>njengler</dc:creator><comments>http://forum.manifold.net/forum/t18068#18094</comments><guid>http://forum.manifold.net/forum/t18068#18094</guid><pubDate>Mon, 26 Dec 2005 12:03:51 GMT</pubDate></item></channel></rss>