<?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>How to place a line using XYZ Coordinates using a Key-In Script</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/56192/how-to-place-a-line-using-xyz-coordinates-using-a-key-in-script</link><description>Bentley View, MicroStation, PowerDraft</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>How to place a line using XYZ Coordinates using a Key-In Script</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/56192/how-to-place-a-line-using-xyz-coordinates-using-a-key-in-script</link><pubDate>Thu, 23 Sep 2021 15:27:01 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:87e36180-2486-42e3-82bd-2b7115e65ce7</guid><dc:creator>Carl Myhill</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/56192/how-to-place-a-line-using-xyz-coordinates-using-a-key-in-script#comments</comments><description>Current Revision posted to MicroStation Wiki by Carl Myhill on 9/23/2021 3:27:01 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:#dce5f0 0px solid;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;MicroStation&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;V8i / CONNECT Edition&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Environment:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;N\A&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Dimensions&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Subarea:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;General&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How to place a line in a Design Model using XYZ coordinates contained within a Text file using a Key-In Script&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Text file format:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span style="color:#800080;"&gt;324.477,278.3686,0&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#800080;"&gt;81.8949,242.823,0&lt;/span&gt;&lt;br /&gt;.....&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;A line can be placed manually in a Design Model, by first selecting the Place Line tool and then manually entering the XYZ coordinates of each vertex point. Alternatively, a long Key-In could be used such as:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Place Line;XY=324.477,278.3686,0;XY=81.8949,242.823,0;.............;Reset&lt;/p&gt;
&lt;p&gt;Another approach may be to use the &amp;#39;Import Coordinates&amp;#39; tool to place Points at each XYZ coordinate&amp;nbsp;followed by the&amp;nbsp;Place&amp;nbsp;Line tool to join the Points.&lt;/p&gt;
&lt;p&gt;However, these methods can be very tedious and time consuming as well as being prone to errors.&lt;/p&gt;
&lt;h1&gt;Steps to Accomplish&lt;/h1&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;An alternative approach would be to copy and modify the Text file to include the required MicroStation Commands and then use a Key-In Script to place the Line in the Design Model.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;To accomplish this first add a Line to the top of the file, containing the MicroStation Command to be run, in this Instance &amp;#39;Place Line&amp;#39; but could be &amp;#39;Place Curve&amp;#39; depending on required element type. Then at the end of the file add a line with &amp;#39;Reset&amp;#39; to finish the selected command. Then in front of each XYZ coordinate add XY= for example:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span style="color:#800080;"&gt;Place Line&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#800080;"&gt;xy=-324.477,278.3686,0&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#800080;"&gt;xy=-81.8949,242.823,0&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#800080;"&gt;....&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#800080;"&gt;....&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#800080;"&gt;Reset&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Tip: Use Microsoft Excel to modify / save the CSV file, its easier to add a column of XY= to each rows XYZ coordinate values. Plus, if required the &amp;#39;X&amp;#39; &amp;#39;Y&amp;#39; &amp;#39;Z&amp;#39; columns can be reordered easily if required.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open the Design Model&lt;/li&gt;
&lt;li&gt;Set the Active Attributes as required (Level, Color, Weight ...)&lt;/li&gt;
&lt;li&gt;Open the &amp;#39;Key-In&amp;#39;&amp;nbsp;dialog (Drawing &amp;gt; Home &amp;gt; Primary &amp;gt; Key-In)&lt;/li&gt;
&lt;li&gt;Select the &amp;#39;Top&amp;#39; View&amp;nbsp;(The Coordinates&amp;nbsp;in the text file being&amp;nbsp;X,Y,Z&amp;nbsp;in this example)&lt;/li&gt;
&lt;li&gt;Enter the following Key in:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @&lt;span style="color:#0080c0;"&gt;D:/temp/coordinate.txt&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Where &lt;span style="color:#0080c0;"&gt;D:/temp/coordinate.txt &lt;/span&gt;is the path and name of the file containing the coordinates. Note if there is a space character in the path use quotes for example &lt;span style="color:#0080c0;"&gt;@&amp;quot;D:/temp/import files/coordinate.txt&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://docs.bentley.com/LiveContent/web/MicroStation%20Help-v18/en/GUID-C58DEF3A-81E4-16D5-602E-8393996A7020.html"&gt;Help&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: GENERAL, V8i / CONNECT Edition, MicroStation, Dimensions, en&lt;/div&gt;
</description></item><item><title>How to place a line using XYZ Coordinates using a Key-In Script</title><link>https://communities.bentley.com/products/microstation/w/microstation__wiki/56192/how-to-place-a-line-using-xyz-coordinates-using-a-key-in-script/revision/1</link><pubDate>Thu, 23 Sep 2021 15:19:48 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:87e36180-2486-42e3-82bd-2b7115e65ce7</guid><dc:creator>Carl Myhill</dc:creator><comments>https://communities.bentley.com/products/microstation/w/microstation__wiki/56192/how-to-place-a-line-using-xyz-coordinates-using-a-key-in-script#comments</comments><description>Revision 1 posted to MicroStation Wiki by Carl Myhill on 9/23/2021 3:19:48 PM&lt;br /&gt;
&lt;table style="border-top:#dce5f0 0px solid;border-right:#dce5f0 0px solid;border-bottom:#dce5f0 0px solid;border-left:#dce5f0 0px solid;background-color:#dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;MicroStation&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;V8i / CONNECT Edition&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Environment:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;N\A&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Dimensions&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Subarea:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;General&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How to place a line in a Design Model using XYZ coordinates contained within a Text file using a Key-In Script&lt;/p&gt;
&lt;p&gt;324.477,278.3686,0&lt;br /&gt;81.8949,242.823,0&lt;br /&gt;.....&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;A line can be placed manually in a Design Model, by first selecting the Place Line tool and then manually entering the XYZ coordinates of each vertex point. Alternatively, a long Key-In could be used such as:&lt;/p&gt;
&lt;p&gt;Place Line;XY=324.477,278.3686,0;XY=81.8949,242.823,0;.............;Reset&lt;/p&gt;
&lt;p&gt;Another approach may be to use the &amp;#39;Import Coordinates&amp;#39; tool to place Points at each XYZ coordinate&amp;nbsp;followed by the&amp;nbsp;Place&amp;nbsp;Line tool to join the Points.&lt;/p&gt;
&lt;p&gt;However, these methods can be very tedious and time consuming as well as being prone to errors. &lt;/p&gt;
&lt;h1&gt;Steps to Accomplish&lt;/h1&gt;
&lt;p&gt;&lt;font size="3"&gt;An alternative approach would be to copy and modify the Text file to include the required MicroStation Commands and then use a Key-In Script to place the Line in the Design Model.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;To accomplish this first add a Line to the top of the file, containing the MicroStation Command to be run, in this Instance &amp;#39;Place Line&amp;#39; but could be &amp;#39;Place Curve&amp;#39; depending on required element type. Then at the end of the file add a line with &amp;#39;Reset&amp;#39; to finish the selected command. Then in front of each XYZ coordinate add XY= for example:&lt;/p&gt;
&lt;p&gt;Place Line&lt;br /&gt;xy=-324.477,278.3686,0&lt;br /&gt;xy=-81.8949,242.823,0&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;Reset&lt;/p&gt;
&lt;p&gt;Tip: Use Microsoft Excel to modify / save the CSV file, its easier to add a column of XY= to each rows XYZ coordinate values. Plus, if required the &amp;#39;X&amp;#39; &amp;#39;Y&amp;#39; &amp;#39;Z&amp;#39; columns can be reordered easily if required.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open the Design Model &lt;/li&gt;
&lt;li&gt;Set the Active Attributes as required (Level, Color, Weight ...)&lt;/li&gt;
&lt;li&gt;Open the &amp;#39;Key-In&amp;#39;&amp;nbsp;dialog (Drawing &amp;gt; Home &amp;gt; Primary &amp;gt; Key-In)&lt;/li&gt;
&lt;li&gt;Select the &amp;#39;Top&amp;#39; View&amp;nbsp;(The Coordinates&amp;nbsp;in the text file being&amp;nbsp;X,Y,Z&amp;nbsp;in this example)&lt;/li&gt;
&lt;li&gt;Enter the following Key in:&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @&lt;font color="#0080c0"&gt;D:/temp/coordinate.txt&lt;/font&gt; &lt;/p&gt;
&lt;p&gt;Where &lt;font color="#0080c0"&gt;D:/temp/coordinate.txt &lt;/font&gt;is the path and name of the file containing the coordinates. Note if there is a space character in the path use quotes for example &lt;font color="#0080c0"&gt;@&amp;quot;D:/temp/import files/coordinate.txt&amp;quot;&lt;/font&gt;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;Help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: GENERAL, V8i / CONNECT Edition, MicroStation, Dimensions, en&lt;/div&gt;
</description></item></channel></rss>