<?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>Jim Johnson's Activities</title><link>https://communities.bentley.com/members/a2045d1d_2d00_87ab_2d00_41f3_2d00_8100_2d00_c8230e49dc4a</link><description>Jim Johnson's recent activity</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>How to unload a C# addin dll without exiting Microstation</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/125047/how-to-unload-a-c-addin-dll-without-exiting-microstation</link><pubDate>Fri, 19 Aug 2016 20:11:10 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:d569174a-2e7c-4672-94ac-e4590c0abbfa</guid><dc:creator>willmartinpe</dc:creator><description>&lt;p&gt;How to unload a C# addin dll without exiting Microstation. I have tried mdl unload and the dll does not unload.&lt;/p&gt;
&lt;p&gt;IS there any way to unload the program without exiting Microstation?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Microstation VBA - calling mdl function - mdlSurface_extractExtrusion</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/116802/microstation-vba---calling-mdl-function---mdlsurface_extractextrusion</link><pubDate>Tue, 08 Mar 2016 11:41:45 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:a189116f-d76a-45b9-b452-1a90f91e1810</guid><dc:creator>Jim Johnson</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have a type 18 suface element that contains two line strings (and a lot of other line element that I&amp;#39;m not interested in) that are being used to represent railway rails in a 3d drawing. I&amp;#39;ve been trying to extract the line string information from the surface in vba, but there doesn&amp;#39;t appear to be much support for surfaces in the vba / com interface, so I&amp;#39;ve ended trying the get the line information out by the calling the mdl function &amp;quot;mdlSurface_extractExtrusion&amp;quot;. (I arrived at this function after poking round and reading other posts on these forums of a similar nature).&lt;/p&gt;
&lt;p&gt;The mdl function appears to be getting called correctly but I&amp;#39;m getting -105 (MDLERR_BADELEMENT) as the return value. The distance variable reference that is passed to the mdl function also gets updated after the function call, so I think I&amp;#39;m almost there. I just can&amp;#39;t figure out what I need to do to fix it?&lt;/p&gt;
&lt;p&gt;Is&amp;nbsp;mdlSurface_extractExtrusion the correct function to call to get the line string out of a this surface?&lt;/p&gt;
&lt;p&gt;The direction point3d that I&amp;#39;m passing into the function is a point above the surface. I&amp;#39;ve noticed that in the mdl reference the distance parameter in the mdl function call is a 3d vector but in the vba wrapper offered in the mdl reference, it is declared as point 3d so assume that the vector angle is truncated in the conversion to point3d. Don&amp;#39;t know if that is important or not though?&lt;/p&gt;
&lt;p&gt;Any help or pointing in the right direction would be greatly appreciated.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Jim&lt;/p&gt;
&lt;p&gt;My code looks like this:&lt;/p&gt;
&lt;!-- HTML generated using hilite.me --&gt;
&lt;div style="background:#f8f8f8;overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"&gt;
&lt;pre style="margin:0;line-height:125%;"&gt;&lt;span style="color:#008000;font-weight:bold;"&gt;Declare&lt;/span&gt; &lt;span style="color:#008000;font-weight:bold;"&gt;Function&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;mdlSurface_extractExtrusion&lt;/span&gt; &lt;span style="color:#008000;font-weight:bold;"&gt;Lib&lt;/span&gt; &lt;span style="color:#ba2121;"&gt;&amp;quot;stdmdlbltin.dll&amp;quot;&lt;/span&gt; (&lt;span style="color:#008000;font-weight:bold;"&gt;ByRef&lt;/span&gt; edPP &lt;span style="color:#aa22ff;font-weight:bold;"&gt;As&lt;/span&gt; &lt;span style="color:#b00040;"&gt;Long&lt;/span&gt;, &lt;span style="color:#008000;font-weight:bold;"&gt;ByRef&lt;/span&gt; directionP &lt;span style="color:#aa22ff;font-weight:bold;"&gt;As&lt;/span&gt; Point3d, &lt;span style="color:#008000;font-weight:bold;"&gt;ByRef&lt;/span&gt; distanceP &lt;span style="color:#aa22ff;font-weight:bold;"&gt;As&lt;/span&gt; &lt;span style="color:#b00040;"&gt;Double&lt;/span&gt;, &lt;span style="color:#008000;font-weight:bold;"&gt;ByVal&lt;/span&gt; surfaceEdP &lt;span style="color:#aa22ff;font-weight:bold;"&gt;As&lt;/span&gt; &lt;span style="color:#b00040;"&gt;Long&lt;/span&gt;) &lt;span style="color:#aa22ff;font-weight:bold;"&gt;As&lt;/span&gt; &lt;span style="color:#b00040;"&gt;Long&lt;/span&gt;

&lt;span style="color:#008000;font-weight:bold;"&gt;Sub&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;DumpSurfaceDetails&lt;/span&gt;()
    &lt;span style="color:#008000;font-weight:bold;"&gt;Dim&lt;/span&gt; elements &lt;span style="color:#aa22ff;font-weight:bold;"&gt;As&lt;/span&gt; ElementEnumerator
    &lt;span style="color:#008000;font-weight:bold;"&gt;Set&lt;/span&gt; elements &lt;span style="color:#666666;"&gt;=&lt;/span&gt; ActiveModelReference.GetSelectedElements
    
    &lt;span style="color:#008000;font-weight:bold;"&gt;While&lt;/span&gt; elements.MoveNext
        &lt;span style="color:#008000;font-weight:bold;"&gt;If&lt;/span&gt; elements.Current.Type &lt;span style="color:#666666;"&gt;=&lt;/span&gt; &lt;span style="color:#666666;"&gt;18&lt;/span&gt; &lt;span style="color:#008000;font-weight:bold;"&gt;Then&lt;/span&gt;
            
            &lt;span style="color:#008000;font-weight:bold;"&gt;Dim&lt;/span&gt; elementDescPtr &lt;span style="color:#aa22ff;font-weight:bold;"&gt;As&lt;/span&gt; &lt;span style="color:#b00040;"&gt;Long&lt;/span&gt;
            elementDescPtr &lt;span style="color:#666666;"&gt;=&lt;/span&gt; elements.Current.MdlElementDescrP(&lt;span style="color:#008000;font-weight:bold;"&gt;False&lt;/span&gt;)
            
            &lt;span style="color:#008000;font-weight:bold;"&gt;Dim&lt;/span&gt; distance &lt;span style="color:#aa22ff;font-weight:bold;"&gt;As&lt;/span&gt; &lt;span style="color:#b00040;"&gt;Double&lt;/span&gt;
            distance &lt;span style="color:#666666;"&gt;=&lt;/span&gt; &lt;span style="color:#666666;"&gt;10&lt;/span&gt;
            
            &lt;span style="color:#008000;font-weight:bold;"&gt;Dim&lt;/span&gt; direction &lt;span style="color:#aa22ff;font-weight:bold;"&gt;As&lt;/span&gt; Point3d
            direction &lt;span style="color:#666666;"&gt;=&lt;/span&gt; Application.Point3dFromXYZ(&lt;span style="color:#666666;"&gt;150752.8186&lt;/span&gt;, &lt;span style="color:#666666;"&gt;443929.0342&lt;/span&gt;, &lt;span style="color:#666666;"&gt;22.9228&lt;/span&gt;)
            
            &lt;span style="color:#008000;font-weight:bold;"&gt;Dim&lt;/span&gt; returnedPointer &lt;span style="color:#aa22ff;font-weight:bold;"&gt;As&lt;/span&gt; &lt;span style="color:#b00040;"&gt;Long&lt;/span&gt;
            &lt;span style="color:#008000;font-weight:bold;"&gt;Dim&lt;/span&gt; success &lt;span style="color:#aa22ff;font-weight:bold;"&gt;As&lt;/span&gt; &lt;span style="color:#b00040;"&gt;Long&lt;/span&gt;
            success &lt;span style="color:#666666;"&gt;=&lt;/span&gt; mdlSurface_extractExtrusion(returnedPointer, direction, distance, (elementDescPtr))
            
            &lt;span style="color:#008000;font-weight:bold;"&gt;If&lt;/span&gt; returnedPointer &lt;span style="color:#666666;"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color:#666666;"&gt;0&lt;/span&gt; &lt;span style="color:#008000;font-weight:bold;"&gt;Then&lt;/span&gt;
                &lt;span style="color:#008000;font-weight:bold;"&gt;Dim&lt;/span&gt; element &lt;span style="color:#aa22ff;font-weight:bold;"&gt;As&lt;/span&gt; element
                &lt;span style="color:#008000;font-weight:bold;"&gt;Set&lt;/span&gt; element &lt;span style="color:#666666;"&gt;=&lt;/span&gt; MdlCreateElementFromElementDescrP(returnedPointer)
            &lt;span style="color:#008000;font-weight:bold;"&gt;End&lt;/span&gt; &lt;span style="color:#008000;font-weight:bold;"&gt;If&lt;/span&gt;
        &lt;span style="color:#008000;font-weight:bold;"&gt;End&lt;/span&gt; &lt;span style="color:#008000;font-weight:bold;"&gt;If&lt;/span&gt;
    &lt;span style="color:#008000;font-weight:bold;"&gt;Wend&lt;/span&gt;
    
&lt;span style="color:#008000;font-weight:bold;"&gt;End&lt;/span&gt; &lt;span style="color:#008000;font-weight:bold;"&gt;Sub&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Dropped Cell Recovery</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/96618/dropped-cell-recovery</link><pubDate>Fri, 25 Apr 2014 11:39:41 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:83f73c9e-fe92-4565-9f52-23cb2dc3ca7d</guid><dc:creator>Jim Johnson</dc:creator><description>&lt;p&gt;Is it possible to recover cells that have been dropped to graphics?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>