<?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/"><channel><title>04-imodel获取schemas</title><link>https://communities.bentley.com/communities/other_communities/chinafirst/w/chinawiki/19164/04-imodelschemas</link><description /><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>04-imodel获取schemas</title><link>https://communities.bentley.com/communities/other_communities/chinafirst/w/chinawiki/19164/04-imodelschemas</link><pubDate>Mon, 02 Feb 2015 02:45:39 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:0e64fa1c-c7af-472e-b2d0-2e967836d709</guid><dc:creator>lijun.ma</dc:creator><comments>https://communities.bentley.com/communities/other_communities/chinafirst/w/chinawiki/19164/04-imodelschemas#comments</comments><description>Current Revision posted to 技术资料库 by lijun.ma on 2/2/2015 2:45:39 AM&lt;br /&gt;
&lt;p&gt;通过imodel对象的Schemas属性，我们可以得到文件已有的所有schemas，示例代码如下：&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;foreach(Schema sch in imodel.Schemas)&lt;br /&gt; {&lt;br /&gt;strInfo += (&amp;quot;schemaName = &amp;quot; + sch.Name + &amp;quot;\n&amp;quot;);&lt;/p&gt;
&lt;p&gt;foreach (Class cl in sch.Classes)&lt;br /&gt; {&lt;br /&gt; strInfo += (&amp;quot;\tclass = &amp;quot; + cl.Name + &amp;quot;\n&amp;quot;);&lt;/p&gt;
&lt;p&gt;foreach (Property pr in cl.Properties)&lt;br /&gt; {&lt;br /&gt;strInfo += (&amp;quot;\t\tProperty = &amp;quot; + pr.CLRType.Name + &amp;quot; &amp;quot; + pr.Name + &amp;quot;\n&amp;quot;);&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;foreach (Relationship rel in cl.Relationships)&lt;br /&gt; {&lt;br /&gt; strInfo += (&amp;quot;\t\trelationship = &amp;quot; + rel.Source.Name + &amp;quot;-&amp;gt;&amp;quot; + rel.Target.Name + &amp;quot;\n&amp;quot;);&lt;br /&gt; }&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;foreach (string strRela in sch.Relationships)&lt;br /&gt; {&lt;br /&gt; strInfo += (&amp;quot;\tRelationship = &amp;quot; + strRela + &amp;quot;\n&amp;quot;);&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;strInfo += (&amp;quot;\n\n&amp;quot;);&lt;br /&gt; }&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: imodel schema&lt;/div&gt;
</description></item><item><title>04-imodel获取schemas</title><link>https://communities.bentley.com/communities/other_communities/chinafirst/w/chinawiki/19164/04-imodelschemas/revision/1</link><pubDate>Sat, 31 Jan 2015 08:22:26 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:0e64fa1c-c7af-472e-b2d0-2e967836d709</guid><dc:creator>lijun.ma</dc:creator><comments>https://communities.bentley.com/communities/other_communities/chinafirst/w/chinawiki/19164/04-imodelschemas#comments</comments><description>Revision 1 posted to 技术资料库 by lijun.ma on 1/31/2015 8:22:26 AM&lt;br /&gt;
&lt;p&gt;04-imodel获取schemas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: imodel schema&lt;/div&gt;
</description></item></channel></rss>