<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>【MS CE C#/C++】命令状态切换</title><link>https://communities.bentley.com/communities/other_communities/chinafirst/f/microstation-projectwise/175383/ms-ce-c-c</link><description>老师好，问题如下： 
 我拟在一个命令中实现先选择一个元素，然后选点的操作。 
 实现：Class A派生自DgnElementSetTool, Class B派生自DgnPrimitiveTool； 
 A.InstallTool，A.OnDataButton函数中（1、接受选择，2、A.ExitTool， 3、启动B.InstallTool() ） 
 发现可以进入B.OnPostInstall(), 但就直接退出了，不能选择点。求指导。</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: 【MS CE C#/C++】命令状态切换</title><link>https://communities.bentley.com/thread/632361?ContentTypeID=1</link><pubDate>Wed, 03 Feb 2021 06:44:52 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:a4c4ce8a-fe40-4123-adb6-bbf7c569265b</guid><dc:creator>HongQiang Guo</dc:creator><description>&lt;p&gt;&lt;span&gt;OnDataButton函数是鼠标在视图中点击左键时被调用的，在基类DgnElementSetTool的OnDataButton实现中会调用LocateOneElement去定位元素并添加到ElementAgenda中，如果您重写了OnDataButton函数，在重写的OnDataButton函数中如果没有调用LocateOneElement后者调用基类DgnElementSetTool的OnDataButton函数，那ElementAgenda中肯定没有元素了&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 【MS CE C#/C++】命令状态切换</title><link>https://communities.bentley.com/thread/632344?ContentTypeID=1</link><pubDate>Wed, 03 Feb 2021 03:02:09 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:c051fa90-0865-443a-9277-1cac86b31452</guid><dc:creator>Liaoyuan Zhang</dc:creator><description>&lt;p&gt;您好，我重写以后，在OnDataButton中调用，还是为0，是不是我的调用方式有问题，我刚刚接触DgnElementSetTool&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 【MS CE C#/C++】命令状态切换</title><link>https://communities.bentley.com/thread/632340?ContentTypeID=1</link><pubDate>Wed, 03 Feb 2021 02:44:39 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:f5c56ad4-0fa6-411f-a40c-e198935a3b28</guid><dc:creator>Xiaoqi Zhang</dc:creator><description>&lt;p&gt;您重写一些该函数：&lt;/p&gt;
&lt;p&gt;protected override void LocateOneElement(DgnButtonEvent ev, bool newSearch) { base.LocateOneElement(ev, newSearch); }&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 【MS CE C#/C++】命令状态切换</title><link>https://communities.bentley.com/thread/632338?ContentTypeID=1</link><pubDate>Wed, 03 Feb 2021 02:29:52 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e224530a-88d7-4d48-ac4d-ec2fd7feb8d2</guid><dc:creator>Liaoyuan Zhang</dc:creator><description>&lt;p&gt;需要重写LocateOneElement方法吗？我这边显示找不到元素&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 【MS CE C#/C++】命令状态切换</title><link>https://communities.bentley.com/thread/507284?ContentTypeID=1</link><pubDate>Fri, 22 Feb 2019 02:58:10 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:d6c90fc7-6bec-469c-83a8-3cd20c4124f8</guid><dc:creator>邓 彦</dc:creator><description>&lt;p&gt;&amp;nbsp;直接 B.InstallTool() ，就可以实现关闭A&amp;nbsp; 打开 B；&lt;/p&gt;
&lt;p&gt;&amp;nbsp;或在B.OnCleanup()，进行判断 是否调用 DetachFromMicroStation()&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 【MS CE C#/C++】命令状态切换</title><link>https://communities.bentley.com/thread/506821?ContentTypeID=1</link><pubDate>Wed, 20 Feb 2019 08:36:53 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:454c5be0-73ab-4826-87c6-94a62247102d</guid><dc:creator>Yongan.Fu</dc:creator><description>[quote userid="874374" url="~/communities/other_communities/chinafirst/f/microstation-projectwise/175383/ms-ce-c-c/506803"]ElementAgenda怎么用的？GetCount始终为0[/quote]
&lt;p&gt;学习某个函数如何调用的最佳方法是找一个例子，你到SDK的examples下搜索一下能找到大量的例子在用GetCount()。其用法是：&lt;/p&gt;
&lt;p&gt;GetElementAgenda().GetCount()。您试一下这个方法。&lt;/p&gt;
&lt;p&gt;如果仍然是0，说明你工具中目前确实没有选中任何元素。&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 【MS CE C#/C++】命令状态切换</title><link>https://communities.bentley.com/thread/506819?ContentTypeID=1</link><pubDate>Wed, 20 Feb 2019 08:33:24 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:a28e2109-590d-4b5c-85d7-c071a1e61dc6</guid><dc:creator>HongQiang Guo</dc:creator><description>&lt;p&gt;DgnElementSetTool::LocateOneElement可以在鼠标点附近搜寻元素，搜到的元素会被添加到DgnElementSetTool::ElementAgenda中&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 【MS CE C#/C++】命令状态切换</title><link>https://communities.bentley.com/thread/506803?ContentTypeID=1</link><pubDate>Wed, 20 Feb 2019 07:49:40 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:988effdb-383a-4883-98da-402403a2ea0c</guid><dc:creator>xiaoping xia</dc:creator><description>&lt;p&gt;符老师，再问一下，ElementAgenda怎么用的？GetCount始终为0。.&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/343510/pastedimage1550648919747v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 【MS CE C#/C++】命令状态切换</title><link>https://communities.bentley.com/thread/506769?ContentTypeID=1</link><pubDate>Wed, 20 Feb 2019 05:53:51 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:a7a4354b-7f65-41c8-829f-c47be51b35f3</guid><dc:creator>Yongan.Fu</dc:creator><description>&lt;p&gt;记得以前这个部分是个Bug，只有C++的类能支持框选，但后期某个版本修复了。请选用最新版的MSCE U11应该是支持的。&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 【MS CE C#/C++】命令状态切换</title><link>https://communities.bentley.com/thread/506765?ContentTypeID=1</link><pubDate>Wed, 20 Feb 2019 05:24:17 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:934edaaa-ed98-415f-b760-f7dffdc0f469</guid><dc:creator>xiaoping xia</dc:creator><description>&lt;p&gt;好的，谢谢符老师。C# DgnElementSetTool类可以框选过滤元素吗？&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 【MS CE C#/C++】命令状态切换</title><link>https://communities.bentley.com/thread/506758?ContentTypeID=1</link><pubDate>Wed, 20 Feb 2019 03:39:11 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:2178fe98-82f3-4039-b449-94fd009e5ce0</guid><dc:creator>Yongan.Fu</dc:creator><description>&lt;p&gt;不能这么设计。一个工具的所有操作最好都要在一个DgnTool类中实现。选择元素和点选都要在OnDataButton中去做，可通过判断当前的ElementAgenda中是否有元素来推断当前是选中了一个元素还是没有选中。请多读一下SDK例子中有关DgnTool类的相关例子。&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>