<?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>XY=(var1),(var2) does not read var, only numeric values seems read</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/246860/xy-var1-var2-does-not-read-var-only-numeric-values-seems-read</link><description>Hello, my VBA does not seem to read the variables on the xy= command/ key-in. So xy=100,200 works ok but xy=(var1),(var2) does not work. the VBA reads value zero by default. I have a msgbox (var1), so the values are really filled in. There is no syntax</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: XY=(var1),(var2) does not read var, only numeric values seems read</title><link>https://communities.bentley.com/thread/771046?ContentTypeID=1</link><pubDate>Mon, 26 Jun 2023 18:57:39 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:0c28c056-49d6-4149-9fd8-0625f5ff7aeb</guid><dc:creator>MaryB</dc:creator><description>&lt;p&gt;The issue here is that you need to assemble the command string (sCmd) out of&amp;nbsp;your variables.&lt;br /&gt;That is what&lt;/p&gt;
&lt;p&gt;sCMD = &amp;quot;xy=&amp;quot; &amp;amp; CStr(x) &amp;amp; &amp;quot;,&amp;quot; &amp;amp; CStr(y) does.&lt;/p&gt;
&lt;p&gt;&amp;quot;xy=&amp;quot; and &amp;quot;,&amp;quot; are text. Cstr(x) and CStr(y) convert the double values to strings for use in the command, and &amp;amp; is the symbol to concatenate the entire line into a single string.&amp;nbsp;&lt;em&gt;That&lt;/em&gt; string is then used to the keyin sent to MicroStation.&lt;/p&gt;
&lt;p&gt;You have example code right in front of you, but you have strayed significantly from it. Rewrite your code to follow the steps as shown in the example. Learn what each step does. Once you understand how the code works, you can adjust it if you like, but if you don&amp;#39;t understand what your example is doing, your success at rewriting it is going to be nil.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Dim Point_X0 as Double
Dim Point_Y0 as Double

&amp;#39; define coordinates
Point_X0 = 1234
Point_Y0 = 5678

&amp;#39;create command string
Dim sCmd as String
sCmd = &amp;quot;xy=&amp;quot; &amp;amp; CStr(Point_X0) &amp;amp; &amp;quot;,&amp;quot; CStr(Point_Y0)

&amp;#39;Start the Place Line command
CadInputQueue.SendKyin &amp;quot;place line&amp;quot;

&amp;#39;place the first data point at zero
CadInputQueue.SendDataPoint Point3DZero

&amp;#39; send the previously defined command string
CadInputQueue.SendKeyin sCmd

&amp;#39;reset to end the line
CadInputQueue.SendReset&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;There are other things amiss in your code. I have no idea what &amp;quot;L&amp;quot; is or where that is defined, so that&amp;#39;s an obvious problem as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: XY=(var1),(var2) does not read var, only numeric values seems read</title><link>https://communities.bentley.com/thread/770769?ContentTypeID=1</link><pubDate>Fri, 23 Jun 2023 10:18:32 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:389cf60e-352b-42fc-ba17-a32c9a54fa0d</guid><dc:creator>NicolasT</dc:creator><description>&lt;p&gt;Many thanks Jan,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;sorry for the lack of info.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is fixed now. Bentley Support, Arthur Goldsweer helped me out.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;2023-06-23 01:29:46 PDT - Artur Goldsweer&lt;/strong&gt;&lt;sup&gt; Additional comments&lt;/sup&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Hello Nicolas,&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;from your problem description it is not clear what the problem in detail is.&lt;/em&gt;&lt;br /&gt;&lt;em&gt; In general there are no issue with using variables with keyin commands.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;I just mad a quick test with VBA and using x,y values as double and this example works fine:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Sub xytest()&lt;/em&gt;&lt;br /&gt;&lt;em&gt; Dim x As Double&lt;/em&gt;&lt;br /&gt;&lt;em&gt; Dim y As Double&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp; x = 2.12345&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp; y = 3.23456&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp; Dim sCmd As String&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp; sCmd = &amp;quot;xy=&amp;quot; &amp;amp; CStr(x) &amp;amp; &amp;quot;,&amp;quot; &amp;amp; CStr(y)&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp; CadInputQueue.SendKeyin &amp;quot;place line&amp;quot;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp; CadInputQueue.SendDataPoint Point3dZero&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp; CadInputQueue.SendKeyin sCmd&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &amp;nbsp; &amp;nbsp; CadInputQueue.SendReset&lt;/em&gt;&lt;br /&gt;&lt;em&gt; End Sub&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;If this code example does not help to fix the issue, please provide a code example to allow us to reproduce the issue - thanks&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Best regards,&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Artur Goldsweer&lt;/em&gt;&lt;br /&gt;&lt;em&gt; BDN Technical Support&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I had&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Dim point_X0 As Double&lt;br /&gt; Dim point_Y0 As Double&lt;/p&gt;
&lt;p&gt;point_X0 = 0 - L&lt;br /&gt; point_Y0 = 0&lt;br /&gt;CadInputQueue.SendCommand &amp;quot;Place Line;xy=0,0;xy=(point_X0),(point_Y0);reset&amp;quot;&lt;/p&gt;
&lt;p&gt;Sorry again, I am an occasional VBA clumsy user.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Nico&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: XY=(var1),(var2) does not read var, only numeric values seems read</title><link>https://communities.bentley.com/thread/770760?ContentTypeID=1</link><pubDate>Fri, 23 Jun 2023 08:10:52 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:9acc1da0-fefc-4fb5-badc-0faf9efc22ae</guid><dc:creator>Jan Šlegr</dc:creator><description>[quote userid="279028" url="~/products/programming/microstation_programming/f/microstation-programming---forum/246860/xy-var1-var2-does-not-read-var-only-numeric-values-seems-read"]my VBA does not seem to read the variables on the xy= command/ key-in[/quote]
&lt;p&gt;What VBA? Share your code. Otherwise there is nothing to be discussed, because it is not clear what code you use to read the values.&lt;/p&gt;
&lt;p&gt;Also, please respect the best practices and define what product and version you use.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>