<?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>[MicroStation Connect Version 10.16.02.34] Draw and scale line</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/235747/microstation-connect-version-10-16-02-34-draw-and-scale-line</link><description>Hi community, 
 What would be your best way to scale a newly created line based on a user input? 
 I am thinking of creating a small program which let&amp;#39;s the user input a *.txt file with coordinates from a point with old and new coordinates, draw a line</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: [MicroStation Connect Version 10.16.02.34] Draw and scale line</title><link>https://communities.bentley.com/thread/732589?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 19:59:03 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:b00d063a-378a-40a6-b594-31b2572fd10c</guid><dc:creator>Marco W</dc:creator><description>&lt;p&gt;Hi Barry, ah I see! makes sense. Thanks for your explanation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [MicroStation Connect Version 10.16.02.34] Draw and scale line</title><link>https://communities.bentley.com/thread/732587?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 19:58:28 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:c41ea7bb-e27d-4e9d-add9-6a92f7454454</guid><dc:creator>Marco W</dc:creator><description>&lt;p&gt;Hi Jon, thanks for your input. Need to get my head around the matrix itself, initially thought just put in the numbers but as you write on your linked page not a great idea to do so&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [MicroStation Connect Version 10.16.02.34] Draw and scale line</title><link>https://communities.bentley.com/thread/732583?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 19:48:38 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:6553dbd9-9be1-410c-9143-0142176dc3bc</guid><dc:creator>Barry Lothian</dc:creator><description>&lt;p&gt;Hi Marco. In MicroStation (and in any other software really),&amp;nbsp;Lines have 2 points, a start and end point. A&amp;nbsp;point element is actually a line element&amp;nbsp;with length =0 , therefore a point element has its start and end points in the same location. Yongan&amp;rsquo;s example is creating a vector from a line&amp;rsquo;s start &amp;amp; end points by subtracting them, then scaling that vector by a scale factor. Try his sample code with a single line and you can compare the results doing the same with the scale tool and looking at the start and endpoint coordinates via the element properties or XYZ text.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [MicroStation Connect Version 10.16.02.34] Draw and scale line</title><link>https://communities.bentley.com/thread/732579?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 19:18:14 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:adc7b26f-844a-4efa-8e64-a2d40ca6ae3f</guid><dc:creator>Marco W</dc:creator><description>&lt;p&gt;Hello Yongan, thank you for your input. What I am after is scaling a line, not a point unfortunately.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [MicroStation Connect Version 10.16.02.34] Draw and scale line</title><link>https://communities.bentley.com/thread/732530?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 13:03:53 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:f9ac8111-d833-4368-bcb1-146a6308bde1</guid><dc:creator>Robert Hook</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="/members/de0601d9_2d00_ca2e_2d00_4005_2d00_a7b3_2d00_982abaee9aeb"&gt;Jon Summers&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;FYI. I added your two (good) introductory links to our existing topic:&amp;nbsp;&lt;a href="/products/programming/microstation_programming/w/wiki/52100/transforms"&gt;Transforms - MicroStation Programming - Wiki&lt;/a&gt;; in hopes the one page can best guide all our users.&amp;nbsp; Let me know if you prefer not to have that information on that page and I can revert this update.&lt;/p&gt;
&lt;p&gt;Thank you!&lt;br /&gt;Bob&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [MicroStation Connect Version 10.16.02.34] Draw and scale line</title><link>https://communities.bentley.com/thread/732447?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 07:27:16 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:fee320cf-d860-496d-b0aa-77a2c22bf8b5</guid><dc:creator>Jon Summers</dc:creator><description>&lt;h4&gt;&lt;span style="color:seagreen;"&gt;Element Transformation&lt;/span&gt;&lt;/h4&gt;
[quote userid="1309096" url="~/products/programming/microstation_programming/f/microstation-programming---forum/235747/microstation-connect-version-10-16-02-34-draw-and-scale-line"]What would be your best way to scale a newly created line?  Google hasn&amp;#39;t found me something useful, neither the learning MicroStation VBA handbook.[/quote]
&lt;p&gt;Scaling, movement and rotation are provided by a higher-level mathematical concept called &lt;a title="Math is Fun: Transformations" href="https://www.mathsisfun.com/geometry/transformations.html" rel="noopener noreferrer" target="_blank"&gt;transformation&lt;/a&gt;.&amp;nbsp; The data for a transformation are conveyed in a VBA &lt;em&gt;User Defined Type&lt;/em&gt; (UDT) called either &lt;code&gt;Transform3d&lt;/code&gt; or &lt;code&gt;Matrix3d&lt;/code&gt;.&amp;nbsp; There are many methods you can apply to both those UDTs to construct a transformation.&amp;nbsp; More info &lt;a title="LA Solutions: VBA Matrices" href="http://www.la-solutions.co.uk/content/CONNECT/MVBA/MVBA-Matrices.htm" rel="noopener noreferrer" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Once you have a transform filled with data, use it with any element by applying &lt;code&gt;Element.Transform&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [MicroStation Connect Version 10.16.02.34] Draw and scale line</title><link>https://communities.bentley.com/thread/732441?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 06:53:17 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e800439c-6af1-47a6-a331-24e489eca6f6</guid><dc:creator>Yongan.Fu</dc:creator><description>&lt;p&gt;I believe &lt;strong&gt;Point3dScale&lt;/strong&gt; method is what you want.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/620x240/__key/communityserver-discussions-components-files/343173/8182.png" /&gt;&lt;/p&gt;
&lt;p&gt;The VBA code can be something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Sub Point3dScaleTest()
    Dim oldPt As Point3d, newPt As Point3d, vec As Point3d, scaledNewPt As Point3d
    oldPt = Point3dFromXYZ(X_old, Y_old, Z_old)
    newPt = Point3dFromXYZ(X_new, Y_new, Z_new)
    vec = Point3dSubtract(newPt, oldPt)
    scaledNewPt = Point3dScale(vec, myScale)
End Sub&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>