<?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>如何使用钢筋SDK提取钢筋的Owner的ElementID</title><link>https://communities.bentley.com/communities/other_communities/chinafirst/f/microstation-projectwise/210637/sdk-owner-elementid</link><description>如题，在PROSTRUCTURE的二次开发过程中，想要获取钢筋所属的梁板柱的信息，麻烦老师解答</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: 如何使用钢筋SDK提取钢筋的Owner的ElementID</title><link>https://communities.bentley.com/thread/645766?ContentTypeID=1</link><pubDate>Wed, 21 Apr 2021 01:23:37 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:62b2c591-b58d-46e8-bee8-764dcd39c718</guid><dc:creator>xiaolan zhou</dc:creator><description>&lt;p&gt;白工，我在执行这段代码的时候，发现&amp;nbsp;RebarAssembly *assem = RebarAssembly::Fetch(eh);获取到的assem始终是空的，请问是怎么回事？操作有什么要求吗？&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 如何使用钢筋SDK提取钢筋的Owner的ElementID</title><link>https://communities.bentley.com/thread/637758?ContentTypeID=1</link><pubDate>Mon, 08 Mar 2021 07:19:21 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:f6067432-c3dd-4115-9db7-40e4f9ee5731</guid><dc:creator>Yongan.Fu</dc:creator><description>&lt;p&gt;我稍微修改了一下白工的代码就能编译过去了。您再试一下：&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void getCallerId()
{
	ElementHandle pickedEh(123L, ACTIVEMODEL);

	if (RebarElement::IsRebarElement(pickedEh))
	{
		RebarElementP rep = RebarElement::Fetch(pickedEh);
		if (rep != nullptr)
		{
			RebarSetCP rebar_set = rep-&amp;gt;GetRebarSet(ACTIVEMODEL);
			ElementId callerId = rebar_set != nullptr ? rebar_set-&amp;gt;GetCallerId() : rep-&amp;gt;GetCallerId();

			ElementHandle eh(callerId, rep-&amp;gt;GetModelRef());
			RebarAssembly *assem = RebarAssembly::Fetch(eh);
			if (assem != nullptr)
			{
				ElementHandle whatyouwant(assem-&amp;gt;GetSelectedElement(), assem-&amp;gt;GetSelectedModel());
			}
		}
	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;我基于Rebar例子修改后的项目文件如下：&lt;/p&gt;
&lt;p&gt;&lt;a href="https://communities.bentley.com/cfs-file/__key/communityserver-discussions-components-files/343510/RebarSDK.7z"&gt;communities.bentley.com/.../RebarSDK.7z&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 如何使用钢筋SDK提取钢筋的Owner的ElementID</title><link>https://communities.bentley.com/thread/637720?ContentTypeID=1</link><pubDate>Mon, 08 Mar 2021 03:29:16 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:6560b7f8-82c3-4ec5-9ac0-7f32643846de</guid><dc:creator>xiaolan zhou</dc:creator><description>&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/343510/pastedimage1615174116264v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;白工，麻烦看一下上面的错误，还有这个eh是在哪定义的吗？&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [PS C#]如何使用钢筋SDK提取钢筋的Owner的ElementID</title><link>https://communities.bentley.com/thread/637453?ContentTypeID=1</link><pubDate>Fri, 05 Mar 2021 08:32:03 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:a5c3431f-36e4-4d4e-8624-b1ab1dba8de8</guid><dc:creator>xiaolan zhou</dc:creator><description>&lt;p&gt;多谢白工！&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [PS C#]如何使用钢筋SDK提取钢筋的Owner的ElementID</title><link>https://communities.bentley.com/thread/637441?ContentTypeID=1</link><pubDate>Fri, 05 Mar 2021 07:59:16 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:d3815d2a-e32c-4b82-82fd-7e143ed6b8aa</guid><dc:creator>Youli Bai</dc:creator><description>&lt;p&gt;配筋完成后，被配筋的元素信息保存在&lt;span&gt;RebarAssembly中，下面的代码是在拾取一个钢筋元素之后，得到对应的RebarAssembly，然后是被配筋元素。这个元素可以是参考文件中的元素。这段代码是C++。Rebar SDK目前是C++的接口，没有C#版本。&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ElementHandle pickedEh;

if(RebarElement::IsRebarElement(pickedEh))
{
    RebarElementP rep = RebarElement::Fetch(eh);
    if (rep != nullptr)
    {
        RebarSetCP rebar_set = rep-&amp;gt;GetRebarSet(modelRef);
        ElementId callerId = rebar_set != nullptr ? rebar_set-&amp;gt;GetCallerId() : rep-&amp;gt;GetCallerId();
    
        ElementHandle eh(callerId, rep-&amp;gt;GetModelRef());
        RebarAssembly *assem = RebarAssembly::Fetch(eh);
        if(assem != nullptr)
        {
            ElementHandle whatyouwant(assem-&amp;gt;GetSelectedElement(), assem-&amp;gt;GetSelectedModel());
        }
    }
}

&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [PS C#]如何使用钢筋SDK提取钢筋的Owner的ElementID</title><link>https://communities.bentley.com/thread/637422?ContentTypeID=1</link><pubDate>Fri, 05 Mar 2021 05:45:16 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5dc31450-4ea3-4779-86cc-4cbd27912d65</guid><dc:creator>Yongan.Fu</dc:creator><description>&lt;p&gt;请提供一个示例DGN文件供我们分析。谢谢！&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 如何使用钢筋SDK提取钢筋的Owner的ElementID</title><link>https://communities.bentley.com/thread/637421?ContentTypeID=1</link><pubDate>Fri, 05 Mar 2021 05:42:25 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:2dcc6883-1a14-419c-869b-d57055c8c292</guid><dc:creator>xiaolan zhou</dc:creator><description>&lt;p&gt;谢谢，我是用的C#开发语言&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 如何使用钢筋SDK提取钢筋的Owner的ElementID</title><link>https://communities.bentley.com/thread/637418?ContentTypeID=1</link><pubDate>Fri, 05 Mar 2021 05:35:54 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e8c24dc2-29c5-4be5-9af2-7342a7e5d342</guid><dc:creator>Yongan.Fu</dc:creator><description>&lt;p&gt;已经通知PS开发技术支持工程师，请您耐心等待。&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>