<?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>Gary Shay's Activities</title><link>https://communities.bentley.com/members/cd8c72aa_2d00_0f53_2d00_4a59_2d00_9546_2d00_7ba0404d4a30</link><description>Gary Shay's recent activity</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>[CONNECT Update 15 C++] - migration from v8i: Creating text in work DGN files</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/238004/connect-update-15-c---migration-from-v8i-creating-text-in-work-dgn-files</link><pubDate>Mon, 07 Nov 2022 14:26:51 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e5465b55-730d-4a7d-bfa1-441576720d39</guid><dc:creator>Gary Shay</dc:creator><description>&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;Ok, I&amp;#39;ve made a lot of progress in the last few months.&amp;nbsp; My current snag point is converting from using mdlText_create functionality to using TextBlocks.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Old v8 Application creates complex elements out of lines, line strings, ellipses, shapes, and text&lt;/li&gt;
&lt;li&gt;App writes the elements to work DGN files, creating between 30 and 100 individual part files that are referenced into an assembly.&lt;/li&gt;
&lt;li&gt;CE uses textBlocks, can&amp;#39;t reuse the old code.&lt;/li&gt;
&lt;li&gt;Trying to make as few changes as possible, just a straight port over from MDL to C++ native code.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&amp;#39;ve found many examples of how to add text to the active design file.&amp;nbsp; This program creates several files from a common seed.&amp;nbsp; Line geometry is being created (hooray) and updated properly in the files.&amp;nbsp; When they are referenced manually into an Assembly file (the active design file), everything is working as it should.&lt;/p&gt;
&lt;p&gt;For each file, I create a chart that identifies the model, who created it (ran the program), date/time stamp, and creates a generic revision block in case of any manual revisions that need to be added.&amp;nbsp; This is populated using mdlText_create and sets level, color, line style, &amp;amp;c properties, which is then added to an Element Descriptor, which is appended to the workDGN after all of the bits are made for the rev block.&amp;nbsp; The parent routine calls ldWriteLine(...) and ldWriteText(...) to create the rev block.&amp;nbsp; Below is the base v8 routine that uses mdlText_create.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Public MSElementDescr *LDWriteText
(
	WChar           *sss,             /* String to print */
	double          sTS,              /* Text size */
	int             sF,               /* Font number */
	int             sJx,              /* Horizontal Justification (0-4) */
	int             sJy,              /* Vertical Justification (0-2) */
	Dpoint3d        *pt,              /* Origin */
	double          xrot,             /* Rotation about X axis */
	double          yrot,             /* Rotation about Y axis */
	double          zrot,             /* Rotation about Z axis */
	UInt32          *color,           /* Text Color */
	UInt32          *weight,          /* Text Weight */
	MSElementDescr  *addDes
)

{
	MSElement           partSegment;
	MSElementDescr      *partDescr;
	TextSizeParam       txSize;
	TextParam           txParm;
	RotMatrix           iMatrix, rMatrix;

	txSize.mode = TXT_BY_TILE_SIZE;
	txSize.size.width = sTS;
	txSize.size.height = sTS;
	txSize.aspectRatio = fc_1;
	txParm.font = sF;
	txParm.just = (sJx &amp;gt; -1 ? sJx * 3 + sJy : TXTJUST_CC);
	txParm.style = 0;
	txParm.viewIndependent = 0;

	mdlRMatrix_getIdentity(&amp;amp;iMatrix);
	mdlRMatrix_rotate(&amp;amp;rMatrix, &amp;amp;iMatrix, xrot, yrot, zrot);

	if (mdlText_create(&amp;amp;partSegment, NULL, sss, pt, &amp;amp;txSize, &amp;amp;rMatrix, &amp;amp;txParm, NULL) == SUCCESS)
	{
		mdlElement_setSymbology(&amp;amp;partSegment, color, weight, NULL);
		if (addDes == NULL)
		{
			mdlElmdscr_new(&amp;amp;partDescr, NULL, &amp;amp;partSegment);
			return partDescr;
		}
		else
		{
			partDescr = mdlElmdscr_appendElement(addDes, &amp;amp;partSegment);
			return partDescr;
		}
	}
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This code is what&amp;#39;s used to add the text to the complex element.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m attempting to update this code, limiting the changes to the function itself.&amp;nbsp; As mentioned, I have good examples of creating TextBlock elements.&amp;nbsp;&lt;strong&gt; I think I&amp;#39;ve got the element creation bits down, but I can&amp;#39;t seem to find sample code that takes the EditElement (or EditElementHandle) and appends it to an Element Descriptor to make it a complex element.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m trying to use the API documentation and searching examples, but that&amp;#39;s slow going (as manual searches are), so I thought I&amp;#39;d drop something here to see if anyone has a &amp;quot;Oh yeah, it&amp;#39;s dead easy, look at this...&amp;quot; response.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I know I probably don&amp;#39;t have enough information here, but I don&amp;#39;t know what else to add.&amp;nbsp; If I knew how to convert the EEH to a Part Descriptor, or append it to one, I think that would push me over the hump.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Gary&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Let me Help You</title><link>https://communities.bentley.com/achievements/687f4b6d-e18a-4e55-836c-49926ca2c9d9</link><pubDate>Mon, 12 Sep 2022 08:15:36 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:6dc0cc3c-423d-425e-b116-624fbf3fad86</guid><dc:creator /><description>Answer a question that is verified as helpful or correct.</description></item><item><title>[CONNECT C++] Fatal link error: module machine type &amp;#39;x64&amp;#39; conflicts with target machine type &amp;#39;x86&amp;#39;</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/234811/connect-c-fatal-link-error-module-machine-type-x64-conflicts-with-target-machine-type-x86</link><pubDate>Tue, 30 Aug 2022 19:25:32 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e557546d-0f15-4279-85de-0d7fbcd6fd06</guid><dc:creator>Gary Shay</dc:creator><description>&lt;p&gt;Hi all -&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been banging away at converting code over from v8i MDL code to C++ native DLL and have (most) of it compiling without error.&amp;nbsp; I&amp;#39;ve decided I need to get a portion of the code working to make sure I&amp;#39;m on the right track.&amp;nbsp; So before I start rewriting modules to write text and add reference files, I&amp;#39;m trying to link modules together.&lt;/p&gt;
&lt;p&gt;I was getting a bunch of errors with finding the OBJ files and figured that out, but now I&amp;#39;m getting the error above and don&amp;#39;t understand why.&amp;nbsp; Rather, in a general sense I understand that somewhere the BMAKE process is saying, &amp;quot;Make this for an x86 machine&amp;quot; and the link libraries are all compiled for an x64 machine, which is the cause of the error.&lt;/p&gt;
&lt;p&gt;What I don&amp;#39;t know how to do is find where to fix it.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Mstn CE 10.15.00.74&lt;/li&gt;
&lt;li&gt;VS2017&lt;/li&gt;
&lt;li&gt;Using C++&lt;/li&gt;
&lt;li&gt;Have 3 different cpp source code files, linking them together&lt;/li&gt;
&lt;li&gt;Have several RSC files, same&lt;/li&gt;
&lt;li&gt;Using the appropriate Microstation CONNECT Edition SDK command prompt (as Administrator) to set up the environment and start Visual Studio&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When I compile, I&amp;#39;m using&amp;nbsp;&lt;strong&gt;bmake &amp;lt;program&amp;gt; -v&lt;/strong&gt; &amp;lt;enter&amp;gt;, which gave me one set of results, where the linker would choke on several of the OBJ files, not being able to find them to use functions in them.&amp;nbsp; In the old make file, there&amp;#39;s a command line that I figured I&amp;#39;d try to see if it gave different results:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;bmake -a +dMDLDEBUG -dNO_COMPILERS_MKI=1 -dBUILD_USING_NoToolset liqdist.mke&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This gave nicely formatted results, but materially changed what I get using the original bmake call, and now I&amp;#39;m getting the error message in the title.&amp;nbsp; I have tried restarting the development environment, now I just get the new error.&lt;/p&gt;
&lt;p&gt;So.&amp;nbsp; Many.&amp;nbsp; Questions.&amp;nbsp; I know it&amp;#39;s bad form to ask more than one, so I&amp;#39;m only going to be a little naughty.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Have I broken the bmake configuration now or is it working and the new problem is the incompatibility between x86 and x64 modules?&lt;/li&gt;
&lt;li&gt;How do I toggle the build to create x64 so it all links and not x86 and throws this error?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I did see Jan Slegr&amp;#39;s response to an earlier post and, while I followed most of it, what I got out was that it was for a different version of CE that needed VS2013 for C++ and not VS2017 for the version I&amp;#39;m running AND it&amp;#39;s a configuration issue.&amp;nbsp; I understand that, but I just don&amp;#39;t know where to look for it.&lt;/p&gt;
&lt;p&gt;If this were C#, I&amp;#39;d look at the target assembly and change it there, but I don&amp;#39;t think BMAKE works with the build properties inside VS (and I tried changing that in several different places, producing the same effect).&lt;/p&gt;
&lt;p&gt;Any suggestions (or magic bullets)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>[CONNECT Native C++] Filleting Lines in V7 / V8i vs.  CONNECT Edition</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/232824/connect-native-c-filleting-lines-in-v7-v8i-vs-connect-edition</link><pubDate>Tue, 19 Jul 2022 13:18:04 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:376e3609-15fb-4ca6-91bc-bc34e015a689</guid><dc:creator>Gary Shay</dc:creator><description>&lt;p&gt;Hi all - Hope everyone is enjoying the Northern Hemisphere summer!&lt;/p&gt;
&lt;p&gt;In v7, I had written a helper routine that took three points that defines two intersecting lines and created a fillet between them using the Constraint tools.&amp;nbsp; This was ported over to V8i relatively untouched.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The v7/v8i Constraint system has been deprecated and I&amp;#39;m assuming that it&amp;#39;s been replaced with Constraint2D and Constraint3D&amp;nbsp;&lt;em&gt;things&lt;/em&gt;.&amp;nbsp; Not sure I actually NEED constraints any more, as there&amp;#39;s several posts by Jon Summers about using different things to fillet based on lines.&amp;nbsp; The old code takes three points and a radius as the input and returns&amp;nbsp;an arc element that represents the fillet.&lt;/p&gt;
&lt;p&gt;The code I&amp;#39;m writing has a planar n-sided non-regular shape (honestly? non-regular triangular or quadrilateral, no more) and needs to fillet all the corners.&amp;nbsp; I think Jon&amp;#39;s original post about &lt;strong&gt;CurveVector.CloneWithFillets&lt;/strong&gt; and &lt;strong&gt;Brien&amp;nbsp;Bastings&lt;/strong&gt; response will be the direction that I head.&amp;nbsp; Basically, it&amp;#39;s creating turret-punched cutouts in plate that need a particular radius fillet to prevent tear-out, and I can either calculate all the fillets or create a closed shape and use something like the direction posted by Brien and Jon&amp;#39;s code on LASolutions site.&lt;/p&gt;
&lt;p&gt;These are C# though, and I&amp;#39;m having some agita worried that it won&amp;#39;t port well.&lt;/p&gt;
&lt;p&gt;So a lot of talky-talky and not a question yet.&amp;nbsp; Here goes:&lt;/p&gt;
&lt;p&gt;Can someone suggest sample CONNECT C++ code that uses the new Constraint API?&amp;nbsp; I may have other areas that are using constraints, so I&amp;#39;d like to&amp;nbsp;have that in my back pocket, just in case.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;G&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>CONNECT Edition (10.15.00.74) Migrate to C++ from MstnJ - cannot find mdlResource_loadFromStringList</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/231823/connect-edition-10-15-00-74-migrate-to-c-from-mstnj---cannot-find-mdlresource_loadfromstringlist</link><pubDate>Mon, 27 Jun 2022 16:55:43 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:ad02e4ea-d9dc-4115-953c-091e60c21b65</guid><dc:creator>Gary Shay</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Working on migrating an application from interpreted MDL (written in MicrostationJ and ported to V8i SS3).&lt;/p&gt;
&lt;p&gt;I&amp;#39;m slogging through the code to get a clean compile and am having problems figuring out how to handle the string list messaging that was being used by the old MDL and what I need to do for CONNECT edition.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The sticking point is mdlResource_loadFromStringList.&amp;nbsp;&amp;nbsp;I&amp;#39;ve seen several references in the Migration code that this is still valid, and in the&amp;nbsp;msrmgr.h include file it suggests that it&amp;#39;s still valid.&amp;nbsp; I just can&amp;#39;t find what files to include or reference.&lt;/p&gt;
&lt;p&gt;If someone can give a pointer where I can search for resources or exported functions, I&amp;#39;d be happy to find it myself - I&amp;#39;ve scanned all the files I can find and I&amp;#39;m not getting any hits.&amp;nbsp; Specifically, searching *.h, *.cpp, *.r, and *.fdf for any occurrences of mdlResource_loadFromStringList I get a ton of hits, but they all look like V8 code in the MigrationTesting labs.&lt;/p&gt;
&lt;p&gt;Any pointers in the right direction would be helpful.&amp;nbsp; The snippet is below, defErr contains the error code from dialog validation.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;			if (defErr)
				{
				mdlResource_loadFromStringList(ldG.defErr, rscFileH, MESSAGELISTID_LDErrors, defErr);
				mdlOutput_error(ldG.defErr);
				}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Gary&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Ask A Question II</title><link>https://communities.bentley.com/achievements/cd3cd235-25c1-476e-bb88-33a5705ca45a</link><pubDate>Mon, 27 Jun 2022 16:57:02 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:25145dd6-1248-405a-a5d0-edeb9e090fdb</guid><dc:creator /><description>Ask 10 questions in a forum.</description></item><item><title>[CONNECT Ed. 10.15.00.74 C# Addin] VS2019 Commands key-in not loading when following the basic example in the wiki</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/223243/connect-ed-10-15-00-74-c-addin-vs2019-commands-key-in-not-loading-when-following-the-basic-example-in-the-wiki</link><pubDate>Thu, 09 Dec 2021 17:59:39 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:630976e7-c82b-48a5-8256-48522a50573d</guid><dc:creator>Gary Shay</dc:creator><description>&lt;p&gt;I&amp;#39;m following the steps to create a new MDL addin using C# and I&amp;#39;m having an issue with getting the commands.xml to be recognized.&lt;/p&gt;
&lt;p&gt;VS 2019 (recommendation says for the below version to load VS2017 or higher for .NET programming)&lt;br /&gt;Microstation CE 10.15.00.74&lt;br /&gt;SDK version 10.00.14.111en&amp;nbsp; (recommended for the version of Microstation)&lt;/p&gt;
&lt;p&gt;The application loads fine using either the MDL applications dialog or &amp;quot;mdl load testcmd.cs.&amp;quot;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve seen several responses here on the forums that suggest running the XML command table checker (not in the SDK version I loaded, which was for 10.00.14.xx), or using the KeyinTree in the AddinAttribute definition (not valid for AddinAttribute).&amp;nbsp; I&amp;#39;ve tried renaming the file (command.xml, commands.xml) and putting it in the MDL directory.&amp;nbsp; I compiled and loaded the DgnECExample and that worked fine - it has a Keyin.cs file that I don&amp;#39;t have, but the WIKI doesn&amp;#39;t mention that at all.&lt;/p&gt;
&lt;p&gt;I have the commands.xml set to EmbeddedResource and copy/pasted from the wiki, but it looks like either the wiki is old or I&amp;#39;m just not seeing the differences other than the obvious Keyin.cs file.&lt;/p&gt;
&lt;p&gt;I think the wiki page was written for v8i coding, not sure if CE coding is that different.&lt;/p&gt;
&lt;p&gt;See below for code.&lt;/p&gt;
&lt;p&gt;XML File:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; ?&amp;gt;
&amp;lt;KeyinTree xmlns=&amp;quot;http://www.bentley.com/schemas/1.0/MicroStation/AddIn/KeyinTree.xsd&amp;quot;&amp;gt;
  &amp;lt;RootKeyinTable ID=&amp;quot;root&amp;quot;&amp;gt;
    &amp;lt;Keyword SubtableRef=&amp;quot;CreateElement&amp;quot;
            CommandWord=&amp;quot;csAddins&amp;quot; &amp;gt;
      &amp;lt;Options Required=&amp;quot;true&amp;quot;/&amp;gt;
    &amp;lt;/Keyword&amp;gt;
  &amp;lt;/RootKeyinTable&amp;gt;

  &amp;lt;SubKeyinTables&amp;gt;
    &amp;lt;KeyinTable ID=&amp;quot;CreateElement&amp;quot;&amp;gt;
      &amp;lt;Keyword SubtableRef=&amp;quot;Commands&amp;quot; CommandWord=&amp;quot;CreateElement&amp;quot;&amp;gt;
        &amp;lt;Options Required=&amp;quot;true&amp;quot;/&amp;gt;
      &amp;lt;/Keyword&amp;gt;
    &amp;lt;/KeyinTable&amp;gt;
    &amp;lt;KeyinTable ID=&amp;quot;Commands&amp;quot;&amp;gt;
      &amp;lt;Keyword CommandWord=&amp;quot;LineAndLineString1&amp;quot;&amp;gt; &amp;lt;/Keyword&amp;gt;
      &amp;lt;Keyword CommandWord=&amp;quot;LineAndLineString2&amp;quot;&amp;gt; &amp;lt;/Keyword&amp;gt;
      &amp;lt;Keyword CommandWord=&amp;quot;LineAndLineString3&amp;quot;&amp;gt; &amp;lt;/Keyword&amp;gt;
      &amp;lt;Keyword CommandWord=&amp;quot;ShapeAndComplexShape&amp;quot;&amp;gt; &amp;lt;/Keyword&amp;gt;
      &amp;lt;Keyword CommandWord=&amp;quot;TextString&amp;quot;&amp;gt; &amp;lt;/Keyword&amp;gt;
      &amp;lt;Keyword CommandWord=&amp;quot;Cell&amp;quot;&amp;gt; &amp;lt;/Keyword&amp;gt;
      &amp;lt;Keyword CommandWord=&amp;quot;Dimension&amp;quot;&amp;gt; &amp;lt;/Keyword&amp;gt;
      &amp;lt;Keyword CommandWord=&amp;quot;BsplineCurve&amp;quot;&amp;gt; &amp;lt;/Keyword&amp;gt;
      &amp;lt;Keyword CommandWord=&amp;quot;Cone&amp;quot;&amp;gt; &amp;lt;/Keyword&amp;gt;
    &amp;lt;/KeyinTable&amp;gt;
  &amp;lt;/SubKeyinTables&amp;gt;

  &amp;lt;KeyinHandlers&amp;gt;
    &amp;lt;KeyinHandler Keyin=&amp;quot;csAddins CreateElement LineAndLineString1&amp;quot;
        Function=&amp;quot;csAddins.CreateElement.LineAndLineString1&amp;quot;/&amp;gt;
    &amp;lt;KeyinHandler Keyin=&amp;quot;csAddins CreateElement LineAndLineString2&amp;quot;
        Function=&amp;quot;csAddins.CreateElement.LineAndLineString2&amp;quot;/&amp;gt;
    &amp;lt;KeyinHandler Keyin=&amp;quot;csAddins CreateElement LineAndLineString3&amp;quot;
        Function=&amp;quot;csAddins.CreateElement.LineAndLineString3&amp;quot;/&amp;gt;
    &amp;lt;KeyinHandler Keyin=&amp;quot;csAddins CreateElement ShapeAndComplexShape&amp;quot;
        Function=&amp;quot;csAddins.CreateElement.ShapeAndComplexShape&amp;quot;/&amp;gt;
    &amp;lt;KeyinHandler Keyin=&amp;quot;csAddins CreateElement TextString&amp;quot;
        Function=&amp;quot;csAddins.CreateElement.TextString&amp;quot;/&amp;gt;
    &amp;lt;KeyinHandler Keyin=&amp;quot;csAddins CreateElement Cell&amp;quot;
        Function=&amp;quot;csAddins.CreateElement.Cell&amp;quot;/&amp;gt;
    &amp;lt;KeyinHandler Keyin=&amp;quot;csAddins CreateElement Dimension&amp;quot;
        Function=&amp;quot;csAddins.CreateElement.Dimension&amp;quot;/&amp;gt;
    &amp;lt;KeyinHandler Keyin=&amp;quot;csAddins CreateElement BsplineCurve&amp;quot;
        Function=&amp;quot;csAddins.CreateElement.BsplineCurve&amp;quot;/&amp;gt;
  &amp;lt;/KeyinHandlers&amp;gt;
&amp;lt;/KeyinTree&amp;gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;TestCmd.cs&lt;br /&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;//--------------------------------------------------------------------------------------+
//
//    $Source: TestCmd.cs $
// 
//    $Copyright: (c) 2021 Bentley Systems, Incorporated. All rights reserved. $
//
//---------------------------------------------------------------------------------------+

//---------------------------------------------------------------------------------------+
//	Using Directives
//---------------------------------------------------------------------------------------+
using System.Windows.Forms;
using Bentley.DgnPlatformNET;
using Bentley.DgnPlatformNET.Elements;
using Bentley.GeometryNET;
using Bentley.MstnPlatformNET;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BIM = Bentley.Interop.MicroStationDGN;

namespace TestCmd
{
[AddInAttribute(MdlTaskID = &amp;quot;csAddins&amp;quot;)]
    internal sealed class TestCmd : AddIn //Bentley.MstnPlatformNET.AddIn
    {
        public static TestCmd Addin = null;
        //--------------------------------------------------------------------------------------
        // @description   This function does...
        // @bsimethod                                                    Bentley
        //+---------------+---------------+---------------+---------------+---------------+------
        private TestCmd(System.IntPtr mdlDesc) : base(mdlDesc)
        {
            //MessageBox.Show(&amp;quot;Pfft.  Nice try, bubba.&amp;quot;);
            Addin = this;
        }

        //--------------------------------------------------------------------------------------
        // @description   This function does...
        // @bsimethod                                                    Bentley
        //+---------------+---------------+---------------+---------------+---------------+------
        protected override int Run(string[] commandLine)
        {
            //MessageBox.Show(&amp;quot;Hello World&amp;quot;);
            //CreateElement.LineAndLineString1();
            //CreateElement.LineAndLineString2();
            //CreateElement.LineAndLineString3();
            //CreateElement.ShapeAndComplexShape();
            //CreateElement.TextString();
            //CreateElement.Cell();
            //CreateElement.Dimension();
            //CreateElement.BsplineCurve();
            return 0;
        }
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;CreateElement.cs&lt;br /&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;
using Bentley.DgnPlatformNET;
using Bentley.DgnPlatformNET.Elements;
using Bentley.GeometryNET;
using Bentley.MstnPlatformNET;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BIM = Bentley.Interop.MicroStationDGN;

namespace TestCmd
{
    class CreateElement
    {
        static double UorPerMas = Session.Instance.GetActiveDgnModel().GetModelInfo().UorPerMaster;

        public static void LineAndLineString1(string unparsed)
        {
            BIM.Application app = Bentley.MstnPlatformNET.InteropServices.Utilities.ComApp;
            BIM.Point3d ptStart = app.Point3dZero();
            BIM.Point3d ptEnd = ptStart;
            ptStart.X = 10;
            BIM.LineElement lineEle = app.CreateLineElement2(null, ref ptStart, ref ptEnd);
            lineEle.Color = 0; lineEle.LineWeight = 2;
            app.ActiveModelReference.AddElement(lineEle);
        }

        public static void LineAndLineString2(string unparsed)
        {
            DgnModel dgnModel = Session.Instance.GetActiveDgnModel();
            ModelInfo modelInfo = dgnModel.GetModelInfo();
            DSegment3d seg = new DSegment3d(0 * UorPerMas, 5 * UorPerMas, 0 * UorPerMas, 10 * UorPerMas, 10 * UorPerMas, 0 * UorPerMas);
            LineElement lineEle = new LineElement(dgnModel, null, seg);
            lineEle.AddToModel();
            DPoint3d[] ptArr = new DPoint3d[5];
            ptArr[0] = new DPoint3d(15 * UorPerMas, 10 * UorPerMas, 0 * UorPerMas);
            ptArr[1] = new DPoint3d(16 * UorPerMas, 12 * UorPerMas, 0 * UorPerMas);
            ptArr[2] = new DPoint3d(18 * UorPerMas, 8 * UorPerMas, 0 * UorPerMas);
            ptArr[3] = new DPoint3d(20 * UorPerMas, 12 * UorPerMas, 0 * UorPerMas);
            ptArr[4] = new DPoint3d(21 * UorPerMas, 10 * UorPerMas, 0 * UorPerMas);
            LineStringElement lineStrEle = new LineStringElement(dgnModel, null, ptArr);
            lineStrEle.AddToModel();
        }

        public static void LineAndLineString3(string unparsed)
        {
            DgnModel dgnModel = Session.Instance.GetActiveDgnModel();
            ModelInfo modelInfo = dgnModel.GetModelInfo();
            DPoint3d[] ptArr = new DPoint3d[5];
            ptArr[0] = new DPoint3d(0 * UorPerMas, 10 * UorPerMas, 0 * UorPerMas);
            ptArr[1] = new DPoint3d(1 * UorPerMas, 12 * UorPerMas, 0 * UorPerMas);
            ptArr[2] = new DPoint3d(3 * UorPerMas, 8 * UorPerMas, 0 * UorPerMas);
            ptArr[3] = new DPoint3d(5 * UorPerMas, 12 * UorPerMas, 0 * UorPerMas);
            ptArr[4] = new DPoint3d(6 * UorPerMas, 10 * UorPerMas, 0 * UorPerMas);
            CurvePrimitive curPri = CurvePrimitive.CreateLineString(ptArr);
            Element ele = DraftingElementSchema.ToElement(dgnModel, curPri, null);
            ele.AddToModel();
        }

        public static void ShapeAndComplexShape(string unparsed)
        {
            DgnModel dgnModel = Session.Instance.GetActiveDgnModel();
            DPoint3d[] ptArr = new DPoint3d[6];
            ptArr[0] = new DPoint3d(0 * UorPerMas, -6 * UorPerMas, 0 * UorPerMas);
            ptArr[1] = new DPoint3d(0 * UorPerMas, -2 * UorPerMas, 0 * UorPerMas);
            ptArr[2] = new DPoint3d(2 * UorPerMas, -2 * UorPerMas, 0 * UorPerMas);
            ptArr[3] = new DPoint3d(2 * UorPerMas, -4 * UorPerMas, 0 * UorPerMas);
            ptArr[4] = new DPoint3d(4 * UorPerMas, -4 * UorPerMas, 0 * UorPerMas);
            ptArr[5] = new DPoint3d(4 * UorPerMas, -6 * UorPerMas, 0 * UorPerMas);
            ShapeElement shapeEle = new ShapeElement(dgnModel, null, ptArr);
            ElementPropertiesSetter elePropSet = new ElementPropertiesSetter();
            elePropSet.SetColor(0);
            elePropSet.SetWeight(2);
            elePropSet.Apply(shapeEle);
            shapeEle.AddToModel();
            for (int i = 0; i &amp;lt; 6; i++)
                ptArr[i].X += 5 * UorPerMas;
            CurvePrimitive curvePri = CurvePrimitive.CreateLineString(ptArr);
            CurveVector curVec = CurveVector.Create(CurveVector.BoundaryType.Outer);
            curVec.Add(curvePri);
            ptArr[2].Y = -8;
            DEllipse3d ellipse = new DEllipse3d();
            if (DEllipse3d.TryCircularArcFromCenterStartEnd(ptArr[2], ptArr[5], ptArr[0], out ellipse))
            {
                curvePri = CurvePrimitive.CreateArc(ellipse);
                curVec.Add(curvePri);
                Element eleTemp = DraftingElementSchema.ToElement(dgnModel, curVec, null);
                eleTemp.AddToModel();
                elePropSet.SetColor(1);
                elePropSet.SetWeight(2);
                elePropSet.Apply(eleTemp);
                eleTemp.AddToModel();
            }
        }

        public static void TextString(string unparsed)
        {
            DgnFile dgnFile = Session.Instance.GetActiveDgnFile();
            DgnModel dgnModel = Session.Instance.GetActiveDgnModel();
            TextBlockProperties txtBlockProp = new TextBlockProperties(dgnModel);
            txtBlockProp.IsViewIndependent = true;
            ParagraphProperties paraProp = new ParagraphProperties(dgnModel);
            DgnTextStyle txtStyle = DgnTextStyle.GetSettings(dgnFile);
            RunProperties runProp = new RunProperties(txtStyle, dgnModel);
            TextBlock txtBlock = new TextBlock(txtBlockProp, paraProp, runProp, dgnModel);
            txtBlock.AppendText(&amp;quot;Hello from C# Addin&amp;quot;);
            TextHandlerBase txtHandlerBase = TextHandlerBase.CreateElement(null, txtBlock);
            DTransform3d trans = DTransform3d.Identity;
            trans.Translation = new DVector3d(6 * UorPerMas, 2 * UorPerMas, 3 * UorPerMas);  //UOR unit
            TransformInfo transInfo = new TransformInfo(trans);
            txtHandlerBase.ApplyTransform(transInfo);
            txtHandlerBase.AddToModel();
        }

        public static void Cell(string unparsed)
        {
            DgnModel dgnModel = Session.Instance.GetActiveDgnModel();
            DPoint3d[] ptArr = new DPoint3d[5];
            ptArr[0] = new DPoint3d(-15 * UorPerMas, -5 * UorPerMas, 0 * UorPerMas);
            ptArr[1] = new DPoint3d(-15 * UorPerMas, 5 * UorPerMas, 0 * UorPerMas);
            ptArr[2] = new DPoint3d(-5 * UorPerMas, 5 * UorPerMas, 0 * UorPerMas);
            ptArr[3] = new DPoint3d(-5 * UorPerMas, -5 * UorPerMas, 0 * UorPerMas);
            ptArr[4] = new DPoint3d(-15 * UorPerMas, -5 * UorPerMas, 0 * UorPerMas);
            ShapeElement shapeEle = new ShapeElement(dgnModel, null, ptArr);
            DPlacementZX dPlaceZX = DPlacementZX.Identity;
            dPlaceZX.Origin = new DPoint3d(-10 * UorPerMas, 0, 0);
            DEllipse3d ellipse = new DEllipse3d(dPlaceZX, 5 * UorPerMas, 5 * UorPerMas, Angle.Zero, Angle.TWOPI);
            EllipseElement elliEle = new EllipseElement(dgnModel, null, ellipse);
            List&amp;lt;Element&amp;gt; listEle = new List&amp;lt;Element&amp;gt;();
            listEle.Add(shapeEle);
            listEle.Add(elliEle);
            DPoint3d ptOri = new DPoint3d();
            DMatrix3d rMatrix = DMatrix3d.Identity;
            DPoint3d ptScale = new DPoint3d(1, 1, 1);
            CellHeaderElement cellHeaderEle = new CellHeaderElement(dgnModel, &amp;quot;CellElementSample&amp;quot;, ptOri, rMatrix, listEle);
            cellHeaderEle.AddToModel();
        }

        public static void Dimension(string unparsed)
        {
            DgnFile dgnFile = Session.Instance.GetActiveDgnFile();
            DgnModel dgnModel = Session.Instance.GetActiveDgnModel();
            double uorPerMast = dgnModel.GetModelInfo().UorPerMaster;
            DimensionStyle dimStyle = new DimensionStyle(&amp;quot;DimStyle&amp;quot;, dgnFile);
            dimStyle.SetBooleanProp(true, DimStyleProp.Placement_UseStyleAnnotationScale_BOOLINT);
            dimStyle.SetDoubleProp(1, DimStyleProp.Placement_AnnotationScale_DOUBLE);
            dimStyle.SetBooleanProp(true, DimStyleProp.Text_OverrideHeight_BOOLINT);
            dimStyle.SetDistanceProp(0.5 * uorPerMast, DimStyleProp.Text_Height_DISTANCE, dgnModel);
            dimStyle.SetBooleanProp(true, DimStyleProp.Text_OverrideWidth_BOOLINT);
            dimStyle.SetDistanceProp(0.4 * uorPerMast, DimStyleProp.Text_Width_DISTANCE, dgnModel);
            dimStyle.SetBooleanProp(true, DimStyleProp.General_UseMinLeader_BOOLINT);
            dimStyle.SetDoubleProp(0.01, DimStyleProp.Terminator_MinLeader_DOUBLE);
            dimStyle.SetBooleanProp(true, DimStyleProp.Value_AngleMeasure_BOOLINT);
            dimStyle.SetAccuracyProp((byte)AnglePrecision.Use1Place, DimStyleProp.Value_AnglePrecision_INTEGER);
            int alignInt = (int)DimStyleProp_General_Alignment.True;
            StatusInt status = dimStyle.SetIntegerProp(alignInt, DimStyleProp.General_Alignment_INTEGER);
            int valueOut;
            dimStyle.GetIntegerProp(out valueOut, DimStyleProp.General_Alignment_INTEGER);
            DgnTextStyle textStyle = new DgnTextStyle(&amp;quot;TestStyle&amp;quot;, dgnFile);
            LevelId lvlId = Settings.GetLevelIdFromName(&amp;quot;Default&amp;quot;);
            CreateDimensionCallbacks callbacks = new CreateDimensionCallbacks(dimStyle, textStyle, new Symbology(), lvlId, null);
            DimensionElement dimEle = new DimensionElement(dgnModel, callbacks, DimensionType.SizeArrow);
            if (dimEle.IsValid)
            {
                DPoint3d pt1 = DPoint3d.Zero, pt2 = DPoint3d.FromXY(uorPerMast * 10, uorPerMast * 0);
                dimEle.InsertPoint(pt1, null, dimStyle, -1);
                dimEle.InsertPoint(pt2, null, dimStyle, -1);
                dimEle.SetHeight(uorPerMast);
                DMatrix3d rMatrix = DMatrix3d.Identity;
                dimEle.SetRotationMatrix(rMatrix);
                dimEle.AddToModel();
            }
        }

        public static void BsplineCurve(string unparsed)
        {
            DgnModel dgnModel = Session.Instance.GetActiveDgnModel();
            DPoint3d[] ptArr = new DPoint3d[5];
            ptArr[0] = new DPoint3d(0 * UorPerMas, 25 * UorPerMas, 0 * UorPerMas);
            ptArr[1] = new DPoint3d(5 * UorPerMas, 35 * UorPerMas, 0 * UorPerMas);
            ptArr[2] = new DPoint3d(10 * UorPerMas, 25 * UorPerMas, 0 * UorPerMas);
            ptArr[3] = new DPoint3d(15 * UorPerMas, 35 * UorPerMas, 0 * UorPerMas);
            ptArr[4] = new DPoint3d(20 * UorPerMas, 25 * UorPerMas, 0 * UorPerMas);
            MSBsplineCurve msBsplineCurve = MSBsplineCurve.CreateFromPoles(ptArr, null, null, 3, false, true);
            CurvePrimitive curvePri = CurvePrimitive.CreateBsplineCurve(msBsplineCurve);
            Element ele = DraftingElementSchema.ToElement(dgnModel, curvePri, null);
            ele.AddToModel();
        }
    }

    //Used By Dimension
    class CreateDimensionCallbacks : DimensionCreateData
    {
        private DimensionStyle m_dimStyle;
        private DgnTextStyle m_textStyle;
        private Symbology m_symbology;
        private LevelId m_levelId;
        private DirectionFormatter m_directionFormatter;

        public CreateDimensionCallbacks(DimensionStyle dimStyle, DgnTextStyle textStyle, Symbology symb, LevelId levelId, DirectionFormatter formatter)
        {
            m_dimStyle = dimStyle;
            m_textStyle = textStyle;
            m_symbology = symb;
            m_levelId = levelId;
            m_directionFormatter = formatter;
        }

        public override DimensionStyle GetDimensionStyle()
        {
            return m_dimStyle;
        }

        public override DgnTextStyle GetTextStyle()
        {
            return m_textStyle;
        }

        public override Symbology GetSymbology()
        {
            return m_symbology;
        }

        public override LevelId GetLevelId()
        {
            return m_levelId;
        }

        public override int GetViewNumber()
        {
            return 0;
        }

        public override DMatrix3d GetDimensionRotation()
        {
            return DMatrix3d.Identity;
        }

        public override DMatrix3d GetViewRotation()
        {
            return DMatrix3d.Identity;
        }

        public override DirectionFormatter GetDirectionFormatter()
        {
            return m_directionFormatter;
        }
    }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>MDL .ma to Native code: setup and updating an old MDL application to native code/VS for v8i SS10</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/208106/mdl-ma-to-native-code-setup-and-updating-an-old-mdl-application-to-native-code-vs-for-v8i-ss10</link><pubDate>Wed, 06 Jan 2021 20:37:52 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:fc781570-d0bd-426f-8a32-093ef8477b7d</guid><dc:creator>Gary Shay</dc:creator><description>&lt;p&gt;Hi all - the new year&amp;#39;s come around and we&amp;#39;ve got some new requests from our Engineering group that need to be addressed.&amp;nbsp; The biggest one is an update to an automation program that was written in MDL and limped along in the old environment through v8i SS2.&amp;nbsp; Now they want new functionality added to it before the scheduled upgrade to MicroStation Connect.&lt;/p&gt;
&lt;p&gt;While I can certainly make the changes using the old MDL environment, I know we&amp;#39;ll have to be moving to the VS programming environment to support Connect in the next year.&amp;nbsp; With other infrastructure changes, I really want to port this MA to a native code DLL, but I&amp;#39;m having problems finding recent information on what I need to do for that.&lt;/p&gt;
&lt;p&gt;Best I can see, for SS10,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I still need to compile using VS2005.&amp;nbsp; Is another version compatible?&amp;nbsp; I&amp;#39;m not doing anything crazy with this app - creating geometry in files and then attaching them to an assembly file is about it.&lt;/li&gt;
&lt;li&gt;Is there a newer version of the SDK for SS10?&amp;nbsp; The one I have is for SS3, and I had success early last year using it to compile using bmake and mcomp for a break/fix.&lt;/li&gt;
&lt;li&gt;Is there a primer anywhere that shows what to choose in VS to create the solution/project and make the changes?
&lt;ul&gt;
&lt;li&gt;I found - and have been using - this page from LA Solutions to try to figure this out:&amp;nbsp;&amp;nbsp;&lt;a href="http://www.la-solutions.co.uk/content/V8/MDL/MdlDll.htm"&gt;Create a MicroStation MDL Application DLL (la-solutions.co.uk)&lt;/a&gt;&amp;nbsp; Unfortunately, I&amp;#39;ve been living in the c# world for the last 8 or so years and I&amp;#39;m feeling a little lost trying to take a step back.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We&amp;#39;re not looking at updating to Mstn Connect soon enough for the Engineering group, so moving to Connect and being able to use VS2017 and&amp;nbsp;.NET for the next version of the code isn&amp;#39;t an immediate option.&amp;nbsp; I&amp;#39;m just a little tired of using an old text editor to make code changes and compiling from a command prompt and would like to use a better environment.&amp;nbsp; Even VS2005 is a HUGE step up from what I&amp;#39;m currently using - aside from a break-fix in the last year, the last time I touched MDL code was circa 2004 and we were still using v7 for PDS 2.2 compatibility.&lt;/p&gt;
&lt;p&gt;Worst case scenario, I&amp;#39;ll keep building it like I&amp;#39;ve been.&amp;nbsp; Debugging is impossible, however; the old MDL debugger stopped working in v8 I think.&amp;nbsp; I know I can&amp;#39;t get it to work now,&amp;nbsp;and everything I&amp;#39;m reading says you need to debug using VS, but the only way to do that is via DLL native code.&lt;/p&gt;
&lt;p&gt;So any help / information that you can provide will be greatly appreciated.&amp;nbsp; I know this might be a repeat from a prior post I made a year or so ago, but I&amp;#39;ve slept a lot in the last year.&lt;/p&gt;
&lt;p&gt;Thank you,&lt;/p&gt;
&lt;p&gt;Gary&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>[MDL V8i SS10] BMake Error in Source during compile, trouble finding .H files in folder %MS%\MDL\Include</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/181775/mdl-v8i-ss10-bmake-error-in-source-during-compile-trouble-finding-h-files-in-folder-ms-mdl-include</link><pubDate>Thu, 27 Jun 2019 20:42:28 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:83745443-5ae5-4cea-a75f-62cc09d2cf7a</guid><dc:creator>Gary Shay</dc:creator><description>&lt;p&gt;I am recompiling a currently working MDL application for SS10, using the SS4 SDK provided by Bentley Support.&amp;nbsp; Was able to configure all that no problems, I think.&lt;/p&gt;
&lt;p&gt;I have changed the environment variables for the system to the suggested settings.&amp;nbsp; The BMAKE starts with no issues, including the various .MKI files properly, but when compiling the resource file for the command - in the cmd.r file - the includes are as follows:&lt;/p&gt;
&lt;p&gt;#include &amp;lt;rscdefs.h&amp;gt;&lt;br /&gt;#include &amp;lt;cmdclass.h&amp;gt;&lt;br /&gt;#include &amp;lt;english\liqditxt.h&amp;gt;&amp;nbsp; // &amp;lt;&amp;lt; this is an application file&lt;/p&gt;
&lt;p&gt;I get the following result:&lt;/p&gt;
&lt;p&gt;C:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdl\bin\rcomp @make.opt&lt;br /&gt;MicroStation Resource Compiler 08.11.09&lt;br /&gt;d:\mdl\liqdist-v8\ldistcmd.r(24) : error: can&amp;#39;t open #include file rscdefs.h&lt;br /&gt;d:\mdl\liqdist-v8\ldistcmd.r(24) : error: No such file or directory&lt;br /&gt;d:\mdl\liqdist-v8\ldistcmd.r(25) : error: can&amp;#39;t open #include file cmdclass.h&lt;br /&gt;d:\mdl\liqdist-v8\ldistcmd.r(25) : error: No such file or directory&lt;br /&gt;d:\mdl\liqdist-v8\ldistcmd.r(41) : error: &amp;#39;Table&amp;#39;: syntax not recognized&lt;br /&gt;There must be at least 1 resource defined. Aborted.&lt;/p&gt;
&lt;p&gt;The two files that it can&amp;#39;t find are definitely in the path included in BMAKE_OPT.&amp;nbsp; I think it&amp;#39;s a path issue within bmake - it&amp;#39;s not finding rscdefs.h in the application&amp;#39;s folder, so it&amp;#39;s not looking in the general MDL Include folder per the SDK.&lt;/p&gt;
&lt;p&gt;I did bmake using the option +p, so I can see where paths for the .MKIs have all resolved, but I think I might need to add something to the MKE file to identify the include path.&amp;nbsp; make.opt shows several include macros, but I&amp;#39;m just not seeing where the gap is.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;BMAKE_OPT=-IC:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdl\include -IC:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdl\include\stdlib&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;MS=C:\PROGRA~2\Bentley\MICROS~1\MICROS~1\&lt;br /&gt;MSMDE=C:\PROGRA~2\Bentley\MICROS~1\MICROS~1\&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\PROGRA~2\Bentley\MICROS~1\MICROS~1\;C:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdl\bin;C:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdl\library;C:\Program Files (x86)\PDFtk Server\bin\PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;MLINK_STDLIB=C:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdl\library\builtin.dlo&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;PolicyFileMapMki=C:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdl\include\MdlSdkPolicyFileMap.mki&lt;br /&gt;PolicyFileNamesMki=C:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdl\include\MdlSdkPolicyFileNames.mki&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;toolspath=C:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdl\bin\&lt;/p&gt;
&lt;p&gt;Any and all help is greatly appreciated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Microstation V8i SDK programming environment (SS10)</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/181380/microstation-v8i-sdk-programming-environment-ss10</link><pubDate>Thu, 20 Jun 2019 16:41:50 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:86c6e626-d212-467b-8f84-8795071d7c55</guid><dc:creator>Gary Shay</dc:creator><description>&lt;p&gt;I have an MDL application that I originally&amp;nbsp;wrote in V7 that was recompiled into V8i SS2 around 2005 (with slight modifications) by another developer who has since retired.&amp;nbsp; The Engineering group has requested program updates to an MDL and I&amp;#39;ve been asked to make those changes.&lt;/p&gt;
&lt;p&gt;We are updating our installation to SS10, but I don&amp;#39;t have a dev environment any more for v8i, and I&amp;#39;ve been looking for the SDK and install instructions to set it up.&amp;nbsp; The last time we had maintenance on these MDLs was in 2012, and that was for v7 changes (we were still using an OLD version of PDS that only ran with v7).&lt;/p&gt;
&lt;p&gt;Can someone point me at the right spot to get the SDK / requirements for updating the MDL?&amp;nbsp; It&amp;#39;s been so long since these programs have been touched that I&amp;#39;m not even sure if I should be installing Visual Studio or just use the C++ redistributable to do native MDL programming.&lt;/p&gt;
&lt;p&gt;I still have LASolutions links (thanks so much for keeping them active, guys!) but since I don&amp;#39;t support Microstation day-to-day, I&amp;#39;m quite out of touch with what needs to be done to set this up again.&lt;/p&gt;
&lt;p&gt;Any help would be greatly appreciated.&lt;/p&gt;
&lt;p&gt;Gary Shay&lt;br /&gt;Air Products and Chemicals, Inc.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Ask A Question I</title><link>https://communities.bentley.com/achievements/460ac7df-7ccc-4c42-a204-9e05eef3be09</link><pubDate>Thu, 20 Jun 2019 02:23:52 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:64602680-76b5-417b-a07d-bc1312d3a56b</guid><dc:creator /><description>Ask a question in a forum.</description></item><item><title>User Preferences in MDL applications (v7 Native MDL)</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/107616/user-preferences-in-mdl-applications-v7-native-mdl</link><pubDate>Tue, 02 Jun 2015 14:41:13 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:6b681cc4-52a7-4b51-a8a2-01da5b720068</guid><dc:creator>Gary Shay</dc:creator><description>&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;First, the basics:&amp;nbsp; Microstation v7, native MDL application, creating model for use with PDS v7.2&lt;/p&gt;
&lt;p&gt;I have an application that takes an external data file and creates a 3D model in a new file.&amp;nbsp; The dialog consists of two buttons to open standard dialogs, one for &amp;quot;select file&amp;quot; and the other for &amp;quot;create a new file from a seed&amp;quot;.&amp;nbsp; Currently, both functions use the configuration variables for the start directory, seed file folder, and standard seed file.&lt;/p&gt;
&lt;p&gt;Most of the time, when this is run, it will be run several times from the same place by the same user.&amp;nbsp; Other users will run it at the same time, but from different folder structures.&amp;nbsp; The way it&amp;#39;s currently written, users will have to traverse to UNC locations every time the application is opened.&lt;/p&gt;
&lt;p&gt;What I want to do, and have been unable to figure out just poking around in the function reference guide, is the best way to keep track of the last selected folder, seed file, and seed file path so that it can default there in the first place.&amp;nbsp; This should be separate from the standard path information when using file/open or file/create.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve looked through the MDL examples delivered with v7 but haven&amp;#39;t found a good example of this, but that could be because I don&amp;#39;t know what I&amp;#39;m looking for.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;I&amp;#39;d like to use the user preferences file, but without sample code I trust, I don&amp;#39;t want to run the risk of corrupting UPFs.&amp;nbsp; That might earn me a beating one evening while hiking out to my truck.&lt;/p&gt;
&lt;p&gt;If anyone (Messrs. Summers or Chouinard?) has an example of using the UPF for that, I&amp;#39;d appreciate it.&amp;nbsp; If not, is an external resource file the right way to go?&amp;nbsp; I started with using User-level configuration variables to hold that information, but I KNOW there&amp;#39;s a way to do it that uses UPF and I&amp;#39;d really prefer that way.&lt;/p&gt;
&lt;p&gt;Thanks in advance for any help anyone can provide.&lt;/p&gt;
&lt;p&gt;Gary Shay&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Microstation v7 MDL:  Fixing old application to new work process</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/106913/microstation-v7-mdl-fixing-old-application-to-new-work-process</link><pubDate>Wed, 06 May 2015 15:45:16 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:7590c77c-d7c5-4342-9cdb-93e1f4abf430</guid><dc:creator>Gary Shay</dc:creator><description>&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m having a brain cramp trying to figure out something that should be very easy that just isn&amp;#39;t working.&amp;nbsp; It&amp;#39;s in a v7 Native MDL application that I need to create various simple solids, without holes.&amp;nbsp; One is a cylinder, the other is a half-cylinder.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the code I&amp;#39;m using for the actual element creation:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;capMode=1;&lt;br /&gt;&amp;nbsp;mdlParams_setActive(&amp;amp;capMode, ACTIVEPARAM_CAPMODE);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;setPoint(&amp;amp;topCtr, origin.x, origin.y, origin.z+topHt);&lt;br /&gt;&amp;nbsp;setPoint(&amp;amp;midCtr, origin.x, origin.y, origin.z-midHt);&lt;br /&gt;&amp;nbsp;setPoint(&amp;amp;botCtr, origin.x, origin.y, origin.z-botHt);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;// Create vertical cylinder.&lt;br /&gt;&amp;nbsp;mdlCone_createRightCylinder(&amp;amp;el, NULL, radius, &amp;amp;midCtr, &amp;amp;topCtr);&lt;br /&gt;&amp;nbsp;mdlElement_add(&amp;amp;el);&lt;br /&gt;&amp;nbsp;mdlElement_display(&amp;amp;el, NORMALDRAW);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;mdlCone_createRightCylinder(&amp;amp;el, NULL, rad, &amp;amp;botCtr, &amp;amp;midCtr);&lt;br /&gt;&amp;nbsp;mdlElement_add(&amp;amp;el);&lt;br /&gt;&amp;nbsp;mdlElement_display(&amp;amp;el, NORMALDRAW);&lt;/p&gt;
&lt;p&gt;What I get is two cylinders, created where I want them, but they&amp;#39;re not solid, they&amp;#39;re just the outer surface with no caps.&lt;/p&gt;
&lt;p&gt;Once created, I can use the Covert To Solid command in Microstation to turn it into a solid like I want, but I&amp;#39;ll be darned if I can figure out what it&amp;#39;s doing!&amp;nbsp; Examining the element information in MS before and after, it looks identical - still a CONE_ELM (23), no property changes, can&amp;#39;t see any element changes.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried creating an element descriptor from the element, closing the descriptor, and adding it to the design file, as below:&lt;br /&gt;&amp;nbsp;&amp;nbsp;mdlElmdscr_new(&amp;amp;elDP, NULL, &amp;amp;el);&lt;br /&gt;&amp;nbsp;&amp;nbsp;mdlElmdscr_close(&amp;amp;plDP, elDP, 0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;mdlElmdscr_add(plDP);&lt;br /&gt;&amp;nbsp;&amp;nbsp;mdlElmdscr_display(plDP, 0, NORMALDRAW);&lt;/p&gt;
&lt;p&gt;I&amp;#39;m creating the half-cylinder slightly differently:&amp;nbsp; create an arc in the xy plane, close the arc descriptor, then project the closed descriptor the desired height.&amp;nbsp; Same results, I get a skin, but it&amp;#39;s hollow.&lt;/p&gt;
&lt;p&gt;Anyone have some sample code to do this?&lt;/p&gt;
&lt;p&gt;Thanks in advance,&lt;/p&gt;
&lt;p&gt;Gary Shay&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Microstation v7 MDL using external DLL:  Passing 2d array of char[] back from DLL</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/101438/microstation-v7-mdl-using-external-dll-passing-2d-array-of-char-back-from-dll</link><pubDate>Wed, 01 Oct 2014 20:25:38 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:f0d956a5-0462-4f20-be5c-9135c85f813c</guid><dc:creator>Gary Shay</dc:creator><description>&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;As I&amp;#39;ve mentioned in prior posts, I&amp;#39;m developing an interface between Excel and MDL v7.&lt;/p&gt;
&lt;p&gt;I have the Excel bits all working and the DLL is working from within Microstation.&amp;nbsp; Thanks to all the help from prior posters!&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s my latest roadblock - one that I&amp;#39;ve got a real brute-force kludge to work.&amp;nbsp; One that I don&amp;#39;t particularly like, and I think there&amp;#39;s probably a better way.&lt;/p&gt;
&lt;p&gt;DLL function:&lt;/p&gt;
&lt;p&gt;int getRangeFiltered(char &lt;em&gt;rangeStr[], int criteriaQty, int criteriaLen, char criteriaList[], int *ColCnt, int *maxStrSize, char ***rtnArray&lt;/em&gt;)&lt;/p&gt;
&lt;p&gt;rangeStr is standard Excel notation - &amp;quot;$A$16:$D$35&amp;quot;.&lt;/p&gt;
&lt;p&gt;Criteria are specified as an array of char[], with criteriaQty and criteriaLen describing the number of criteria and the length of the char[] array.&lt;/p&gt;
&lt;p&gt;The function returns the number of rows.&amp;nbsp; Outputs are ColCnt (2nd dimension of the array), maxStrSize (the size of each element of the array), and lastly the out array, rtnArray.&lt;/p&gt;
&lt;p&gt;What I don&amp;#39;t like about it is that the return array:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;has X times Y elements, made up of char[maxStrSize].&amp;nbsp; There&amp;#39;s a lot of unneeded space when you start looking at large ranges of data.&lt;/li&gt;
&lt;li&gt;Everything comes back as characters.&amp;nbsp; I&amp;#39;m just not getting how to have some kind of variant-type array in MDL.&amp;nbsp; I can do that in c++, but I&amp;#39;d really like to return INT, DOUBLE, CHAR[], to avoid potential conversion issues.&lt;/li&gt;
&lt;li&gt;I can&amp;#39;t seem to represent a range of char[].&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I&amp;#39;ve been thinking that I need to implement (an array | a linked list | a data structure of some kind) with UNION-ed structures (something similar to msElementUnion) and have my DLL just deal with a pointer being passed, and the functionality to delete [] as part of the DLL.&lt;/p&gt;
&lt;p&gt;I already have code working that does a single-column or single-row vector using a single array of char[].&amp;nbsp; I&amp;#39;ve implemented the above as a vector of single-row vectors, accessible via rtnArray[row*RowWidth+column], but that just wastes tons of memory.&amp;nbsp; Not to mention processing time on the DLL side when ranges get arbitrarily large.&lt;/p&gt;
&lt;p&gt;If this isn&amp;#39;t entirely cryptic and unintelligible, does anyone have a suggestion?&amp;nbsp; To put it succinctly, I&amp;#39;m looking for ANY method to pass data back as a 2D &amp;quot;range&amp;quot; of VARIANTs and have MDL v7 be able to read it and use the data.&lt;/p&gt;
&lt;p&gt;Apologies if this has been asked and answered before.&amp;nbsp; I&amp;#39;ve looked and couldn&amp;#39;t find anything.&lt;/p&gt;
&lt;p&gt;Thanks in advance, &lt;/p&gt;
&lt;p&gt;Gary Shay&lt;/p&gt;
&lt;p&gt;PS: ok, right before hitting POST, I&amp;#39;m thinking that maybe pulling in some of the include files into the DLL might help construct the output structure.&amp;nbsp; I&amp;#39;ll be looking into that tomorrow, but any suggestions would be great.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Trying to use an external DLL inside a v7 MDL program</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/100786/trying-to-use-an-external-dll-inside-a-v7-mdl-program</link><pubDate>Tue, 09 Sep 2014 17:01:11 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:29e413d9-e9c6-409b-ab31-1cc752322093</guid><dc:creator>Gary Shay</dc:creator><description>&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;I need to write an MDL program that moves data to/from an external spreadsheet from within Microstation v7.&lt;/p&gt;
&lt;p&gt;So far as I can tell, there are two options open to me:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Microstation VBA and pull in the appropriate references to bridge the gap;&lt;/li&gt;
&lt;li&gt;C++ functions compiled into a DLL and called from an MDL application.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&amp;#39;m leaning toward the second, but for the life of me I can&amp;#39;t find documentation on how to use an external dll in MDL.&amp;nbsp; Oh, I&amp;#39;ve found the DLM sample and the mdlExternal_... functions, but I&amp;#39;m just not sure how to use it.&amp;nbsp; I thought there was a way to just declare some external functions and call them blindly from MDL to perform the appropriate updates.&lt;/p&gt;
&lt;p&gt;Perhaps &amp;#39;blindly&amp;#39; isn&amp;#39;t the best word.&lt;/p&gt;
&lt;p&gt;Since I&amp;#39;d be writing the DLL that interfaces with &lt;strong&gt;The Spreadsheet Application&lt;/strong&gt;, I think I can make it agnostic enough that the MDL won&amp;#39;t care about items being returned to it or sent by it.&amp;nbsp; Again, that&amp;#39;s assuming quite a bit, I know.&lt;/p&gt;
&lt;p&gt;Anyone have a direction (short of forcing a v8i upgrade) that could get me started in the right direction?&lt;/p&gt;
&lt;p&gt;I appreciate any replies, and thanks in advance for your help and/or opinions.&lt;/p&gt;
&lt;p&gt;Gary Shay&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>