<?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>Julia Frid's Activities</title><link>https://communities.bentley.com/members/f560754b_2d00_cd42_2d00_4fe6_2d00_b270_2d00_e83368aee7ae</link><description>Julia Frid's recent activity</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>[CONNECT Update 17 VBA]  place text element above/below</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/239942/connect-update-17-vba-place-text-element-above-below</link><pubDate>Wed, 28 Dec 2022 08:35:17 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:9072d235-a18d-45e8-bd9d-89d6af96bede</guid><dc:creator>Julia Frid</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;How is possible to place text along (above/below) programmatically ? using SendKeyin not good solution for me, because is opened key-in windows. Maybe exist&amp;nbsp; another variant ?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;           CadInputQueue.SendKeyin &amp;quot;PLACE TEXT ABOVE&amp;quot;
            CadInputQueue.SendKeyin lineLength
            CadInputQueue.SendDataPoint line.StartPoint
            CadInputQueue.SendReset&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Discussion Starter I</title><link>https://communities.bentley.com/achievements/21025ab1-febb-4fb4-a872-d32a921cb45c</link><pubDate>Wed, 28 Dec 2022 08:35:18 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:768f259d-e185-49f7-8ab9-f0c3abb3ccb1</guid><dc:creator /><description>Start a discussion in a forum that receives 5 replies.</description></item><item><title>[CE MDL C++] how to close MDL?</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/234165/ce-mdl-c-how-to-close-mdl</link><pubDate>Wed, 17 Aug 2022 08:58:15 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:7026bfa4-676b-44bf-b593-5c48ab138ee9</guid><dc:creator>Julia Frid</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I need any advice how to correct close/unload md. In main function, before opening form, function CheckTime check expired date and close mdl. In V8i function mdlSystem_exit worked perfectly, but in CE it crash Microstation. I tries 3 variants and all of them crash Microstation. What is correct way to close/unload app ?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;extern &amp;quot;C&amp;quot; DLLEXPORT void MdlMain(int argc, WCharCP argv[])
{
...
	CheckTime();  ///check expired date
...
	mdlDialog_hookPublish(sizeof(uHooks) / sizeof(DialogHookInfo), uHooks);
	dbMain = mdlDialog_open(NULL, CnvBox);
...
}


void CheckTime(void) {
	int Ye = 2022, y, Mo = 7, D=31;
	time_t t;
	struct tm *tt;
	WChar timeBuf[4096];
	time(&amp;amp;t);

	tt = localtime(&amp;amp;t); y = tt-&amp;gt;tm_year; if (y &amp;gt;= 100 &amp;amp;&amp;amp; y&amp;lt;1000) y += 1900;
	if ((y &amp;gt; Ye) || (y == Ye &amp;amp;&amp;amp; tt-&amp;gt;tm_mon + 1 &amp;gt; Mo))
	{
	    swprintf(timeBuf, L&amp;quot;Valid to  %i.%i.%i&amp;quot;,D, Mo, Ye);
		mdlDialog_openInfoBox(timeBuf);
		
	    //mdlDialog_cmdNumberQueue(FALSE, CMD_MDL_UNLOAD, mdlSystem_getCurrTaskID(), INPUTQ_HEAD);	return ; - crash ms
		//exit(EXIT_SUCCESS); -  crash ms
        //mdlSystem_exit(0, 1);   return; -  crash ms

	}
	return;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Julia&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>[CONNECT Update 16 VBA]  mdlLicense_getStrings() crash</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/230886/connect-update-16-vba-mdllicense_getstrings-crash</link><pubDate>Tue, 07 Jun 2022 07:14:56 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:35ba78c7-cc45-4f8a-aed0-c54bd7798e77</guid><dc:creator>Julia Frid</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;I wantto check company&amp;#39;s name (VBA macro) with mdlLicense_getStrings() function, but it&amp;#39;s all time crash. What I&amp;#39;m doing wrong?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Option Explicit
Private Declare PtrSafe Sub mdlLicense_getStrings Lib &amp;quot;stdmdlbltin.dll&amp;quot; (ByRef theInfoStrings As brandInfo) 
Private Declare PtrSafe Function mdlLicense_isRegisteredProduct Lib &amp;quot;stdmdlbltin.dll&amp;quot; () As Long
Public dblInterval As Double

Type brandInfo
   theUN As String * 64
   theUO As String * 64
   theComputerName As String * 32
End Type


Public Function IsMicroStationRegistered() As Boolean
    IsMicroStationRegistered = (0 &amp;lt;&amp;gt; mdlLicense_isRegisteredProduct())
End Function



Sub CheckCN()

Dim licInfo As brandInfo
If IsMicroStationRegistered() Then
    Debug.Print &amp;quot;MicroStation is registered&amp;quot;
Else
    Debug.Print &amp;quot;MicroStation is not registered&amp;quot;
End If

mdlLicense_getStrings licInfo &amp;#39;&amp;#39;&amp;#39;here crash

&amp;#39;&amp;#39;MsgBox licInfo.theComputerName, vbInformation, &amp;quot;License Check&amp;quot;

End Sub&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;CE Update 16 v 10.16.03.11&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Regards,&lt;br /&gt;Julia&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>Tue, 07 Jun 2022 07:15:48 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:fa215524-3970-4ae2-8948-0a1d98610f34</guid><dc:creator /><description>Ask 10 questions in a forum.</description></item><item><title>Ask A Question I</title><link>https://communities.bentley.com/achievements/460ac7df-7ccc-4c42-a204-9e05eef3be09</link><pubDate>Thu, 17 Jun 2021 01:30:13 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:9d20e9d2-625e-4f93-b4b8-b33319f89cd2</guid><dc:creator /><description>Ask a question in a forum.</description></item><item><title>[CE] can mvba be signed without SDK?</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/214144/ce-can-mvba-be-signed-without-sdk</link><pubDate>Thu, 20 May 2021 04:12:11 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:71186096-bd02-499f-9212-006589a9f9e3</guid><dc:creator>Tuan Le</dc:creator><description>&lt;p&gt;Just wondering if mvba can be signed without SDK? If yes, any steps or guide would be greatly appreciated. I created a personal cert using&amp;nbsp;power shell and tried the Digital Signature tool in VBA ide, but no luck:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/343173/pastedimage1621483923634v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/343173/pastedimage1621483947080v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Tuan Le&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>[CONNECT - MDL C++] Problem with mdlClip_isElemInside in 3D</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/132052/connect---mdl-c-problem-with-mdlclip_iseleminside-in-3d</link><pubDate>Wed, 22 Feb 2017 10:25:35 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:d2122397-8139-49bd-9ccb-7a017251422c</guid><dc:creator>Julia Frid</dc:creator><description>&lt;p class="brush: cpp; fontsize: 100; first-line: 1; "&gt;Hello,&lt;br /&gt;I need to put cell in shape, but only if it fits fully inside shape. In 2d files this code work correctly : if cell is outside shape element it&amp;#39;s removed. But in 3d file it doesn&amp;#39;t correctly check if cell is inside and get wrong result as also cell are placed outside.&lt;/p&gt;
&lt;pre class="brush: cpp; fontsize: 100; first-line: 1; "&gt;void MakeExLabels(int n)  // fills  shape element Fdscr
{ // using active level, active cell
	DRange3d rv;  //Range for Shape element
	Bentley::WString cnm;
	double x0, y0, x, y, dx, dy, d, dd;
	int fx, fy, fx1, fy1, ix, iy, i, j, nc = 0;
	Transform Tr;
	if (!Fdscr)
	{
		wcscpy(buf, L&amp;quot;No shape defined!&amp;quot;);    
		if (dbMain &amp;amp;&amp;amp; diPmsg) mdlDialog_itemSetStringValue(&amp;amp;res, buf, dbMain, diPmsg-&amp;gt;itemIndex);
		return;
	}
	if (tb_clip) Ngg = mdlSystem_updateGraphicGroup();
	ActiveParams::GetValue(cnm, ActiveStringParams::ACTIVEPARAM_CELLNAME);
	if (cnm.c_str())
	{
		i = mdlCell_readLibraryElements(&amp;amp;dscrEx, cnm.c_str(), NULL, FALSE);
	
		if (i == SUCCESS) // instead test if a cell is active!!!!!!
		{
			i = mdlElement_extractRange(&amp;amp;rv, &amp;amp;Fdscr-&amp;gt;el);
			if (ISessionMgr::GetActiveDgnModelRefP()-&amp;gt;Is3d())
			{
				if (Dbg) printf(&amp;quot;\n Is3d&amp;quot;);
				mdlElmdscr_convertTo2D(&amp;amp;pedTemp, Fdscr, VW, &amp;amp;Tr, MASTERFILE, MASTERFILE, FALSE);
				mdlElmdscr_convertTo3D(&amp;amp;Fdscr, pedTemp, FIXEDDEPTH, NULL, NULL, MASTERFILE, MASTERFILE);
				mdlElmdscr_freeAll(&amp;amp;pedTemp);
			} 
			i = mdlClip_fromElement(clip, Fdscr, FALSE, VW);	//set Shape as clipping element		
			dx = fabs(rv.low.x - rv.high.x); //distance x 
			dy = fabs(rv.low.y - rv.high.y); //distance y
			dd = MM1 * 5 * dgnMeter*1e-3; //set default distance between cells		

			d = MM1 * 100; // 1 m on map
			x0 = rv.low.x; //start point lower left corner
			y0 = rv.low.y; //start point lower left corner&lt;br /&gt;&lt;br /&gt;//calculate rows and columns&lt;br /&gt;
			fx = (int)floor(x0 / dd + .99999); 
			fy = (int)floor(y0 / dd + .99999);
			fx1 = (int)floor((x0 + dx) / dd);
			fy1 = (int)floor((y0 + dy) / dd);
			ix = fx1 - fx + 1;
			iy = fy1 - fy + 1;&lt;br /&gt;
			if (ix&amp;gt;0 &amp;amp;&amp;amp; iy&amp;gt;0 ) 
			{
				for (i = 0; i&amp;lt;ix; i++) for (j = 0; j&amp;lt;iy; j++) 
				{
					x = (fx + i)*dd; y = (fy + j)*dd; 
					nc += PutCell(x, y, dd);
				}
				if (tb_patt&amp;gt;0)
				{
					for (i = -1; i&amp;lt;ix; i++) for (j = -1; j&amp;lt;iy; j++)
					{
						x = ((fx + i) + 0.5)*dd; y = ((fy + j) + 0.5)*dd;
						nc += PutCell(x, y, dd);
					}
				}
				swprintf(buf, L&amp;quot;Places %i cells %s&amp;quot;, nc, cnm.c_str());
			}
			else wcscpy(buf, L&amp;quot;No coordinate cross inside shape!&amp;quot;); //special case for placing coordinate crosses at fixed intervals
			if (nc == 0) PutCell(x0 + dx / 2, y0 + dy / 2, dd); // at least one
			if (dbMain &amp;amp;&amp;amp; diPmsg) mdlDialog_itemSetStringValue(&amp;amp;res, buf, dbMain, diPmsg-&amp;gt;itemIndex);
			if (dscrEx) mdlElmdscr_freeAll(&amp;amp;dscrEx);
		}
		else
		{
			mdlUtil_beep(1);  swprintf(buf, L&amp;quot;cell =%s= not found!&amp;quot;, cnm.c_str());
			if (dbMain &amp;amp;&amp;amp; diPmsg) mdlDialog_itemSetStringValue(&amp;amp;res, buf, dbMain, diPmsg-&amp;gt;itemIndex);
		}
	}
	else {
		wcscpy(buf, L&amp;quot;Not defined active cell&amp;quot;);
		if (dbMain &amp;amp;&amp;amp; diPmsg) mdlDialog_itemSetStringValue(&amp;amp;res, buf, dbMain, diPmsg-&amp;gt;itemIndex);
	}

	return;
}

int PutCell(double x, double y, double d) // cell in dscrEx
{
	DPoint3d pt;
	Transform Tr;
	double k;
	bool o;
	Bentley::WString cellname;
	long ke;
	int r = 0, i;
	ULong flp;	

	pt.x = x; pt.y = y; pt.z =0;
	k = (MM1 * 5) / 2500; 

	if (dscr) mdlElmdscr_freeAll(&amp;amp;dscr);   dscr = NULL;
	mdlTMatrix_getIdentity(&amp;amp;Tr);
	mdlTMatrix_setTranslation(&amp;amp;Tr, &amp;amp;pt);
	mdlTMatrix_scale(&amp;amp;Tr, &amp;amp;Tr, k, k, k);
	mdlElmdscr_duplicate(&amp;amp;dscr, dscrEx);
	mdlElmdscr_transform(&amp;amp;dscr, &amp;amp;Tr);
	mdlElmdscr_addByModelRef(dscr, MASTERFILE);

	if (dscr)
	{		
		i = mdlClip_isElemInside(&amp;amp;o, dscr, clip.get(), VW, FALSE);
		if (i) //in 3d file incorrectly shows as always inside
		{			
			if (!o){
				r = 1;
				if (tb_clip) mdlElement_setProperties(&amp;amp;dscr-&amp;gt;el, NULL, &amp;amp;Ngg, NULL, NULL, NULL, NULL, NULL, NULL);  // grouping
				mdlElmdscr_display(dscr, MASTERFILE, DRAW_MODE_Normal);
				ke = mdlElmdscr_add(dscr);				
			}
			else
			{
				if (Dbg) printf(&amp;quot;\n%s&amp;quot;, &amp;quot;cell on element!&amp;quot;);
				flp = mdlElmdscr_getFilePos(dscr);
				mdlElmdscr_deleteByModelRef(dscr, flp, MASTERFILE, FALSE);
			}
		}
		else {
			flp = mdlElmdscr_getFilePos(dscr);
			mdlElmdscr_deleteByModelRef(dscr, flp, MASTERFILE, FALSE);
		}
	}
	else if (Dbg) printf(&amp;quot;\n%s&amp;quot;, &amp;quot;Cell placing fail!&amp;quot;);
	return r;
}
 &lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre class="brush: cpp; fontsize: 100; first-line: 1; "&gt;&lt;a href="/cfs-file/__key/communityserver-discussions-components-files/343173/2642.cell.png" class="brush: cpp; fontsize: 100; first-line: 1; "&gt;&lt;img src="/resized-image/__size/940x0/__key/communityserver-discussions-components-files/343173/2642.cell.png" alt=" " /&gt;&lt;/a&gt;&lt;/pre&gt;
&lt;pre class="brush: cpp; fontsize: 100; first-line: 1; "&gt;&lt;br /&gt;&lt;br /&gt;please help me to understand what I doing wrong ?&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>[CONNECT - MDL C++] get active cellname</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/130774/connect---mdl-c-get-active-cellname</link><pubDate>Wed, 18 Jan 2017 08:57:37 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:1c0b7e42-241f-4450-97d8-664e71c86c7e</guid><dc:creator>Julia Frid</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;please help me understand what type of variable I need to use for getting ACTIVEPARAM_CELLNAME&lt;/p&gt;
&lt;pre class="brush: cpp; fontsize: 100; first-line: 1; "&gt;Old code:

char cnm[256];
mdlParams_getActive(cnm, ACTIVEPARAM_CELLNAME);
if (cnm[0])
	{
		if (Dbg) printf(&amp;quot;\n tagad Cell=%s&amp;quot;, cnm[0]);
}

New code:

WString cellname; // 
ActiveParams::GetValue(cellname, ActiveStringParams::ACTIVEPARAM_CELLNAME);
if (Dbg) printf(&amp;quot;\n  cellname =%s&amp;quot;, cellname);

result:   cellname =a&lt;/pre&gt;
&lt;pre class="brush: applescript; fontsize: 100; first-line: 1; "&gt;variable get only first symbol of cellname. When try to use char type as old code got error:&amp;nbsp;&amp;nbsp; &lt;/pre&gt;
&lt;pre class="brush: applescript; fontsize: 100; first-line: 1; "&gt;    IntelliSense: no instance of overloaded function &amp;quot;ActiveParams::GetValue&amp;quot; matches the argument list
 argument types are: (char [256], ActiveStringParams)  &lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>[CONNECT C++]  mdlRegion_floodFillWithHoles problem</title><link>https://communities.bentley.com/products/programming/f/developers-and-programming-forum/128452/connect-c-mdlregion_floodfillwithholes-problem</link><pubDate>Tue, 15 Nov 2016 14:06:26 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:a40432ef-fecd-46cd-96e8-f4ba917a3c82</guid><dc:creator>Julia Frid</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;MicroStation&amp;nbsp; CONNECT Edition update 3 - Version 10.03.00.30&lt;/p&gt;
&lt;p&gt;I need any advice with calling mdlRegion_floodFillWithHoles. On this function calling all time get this message :&lt;/p&gt;
&lt;p&gt;&lt;em&gt; &amp;quot;MicroStation stopped working&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;A software error has occurred; we apologize for any inconvenience this may have caused. This error has been logged locally.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;if (Dbg) printf(&amp;quot;\n StartFlood&amp;nbsp; X=%lf&amp;nbsp; Y=%lf&amp;nbsp;&amp;nbsp; Qv=%i&amp;nbsp; Fdsc=%i&amp;nbsp; &amp;quot;, Ppt.x, Ppt.y,Qv,Fdsc);&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;if (SUCCESS == mdlRegion_floodFillWithHoles(&amp;amp;Fdscr,&amp;nbsp; &amp;amp;ar, Fdsc, NULL, MASTERFILE, &amp;amp;Ppt, Qv, TRUE, 10.0, -1)) {&lt;/p&gt;
&lt;p&gt;....&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Printed variables:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;StartFlood&amp;nbsp; X=5006161792.554092&amp;nbsp; Y=3064978139.690812&amp;nbsp;&amp;nbsp; Qv=0&amp;nbsp; Fdsc=603761872&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre id="line1"&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>