<?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>How to use point3d as optional argument</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/bdn-vba/101842/how-to-use-point3d-as-optional-argument</link><description>I try to use a point3d parameter as optional argument as given in the below code. But it produces a &amp;quot;compile error: Constant Expression required&amp;quot;. How to solve this? 
 
 Private Sub test(Optional testPoint As Point3d = Point3dZero) &amp;#39;&amp;#39;Some code End Su</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to use point3d as optional argument</title><link>https://communities.bentley.com/thread/302740?ContentTypeID=1</link><pubDate>Wed, 15 Oct 2014 07:13:10 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:ec237840-cf69-420f-afee-1fac3ffa93f0</guid><dc:creator>Philippe HALET</dc:creator><description>You can use this piece of code :&lt;br /&gt;
&lt;br /&gt;
Sub test()&lt;br /&gt;
    &lt;br /&gt;
    test2&lt;br /&gt;
    &lt;br /&gt;
    test2 Point3dFromXYZ(1#, 2#, 3#)&lt;br /&gt;
    &lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
Sub test2(Optional pvar As Variant)&lt;br /&gt;
    Dim p As Point3d&lt;br /&gt;
    &lt;br /&gt;
    If IsMissing(pvar) Then&lt;br /&gt;
        p = Point3dZero&lt;br /&gt;
    Else&lt;br /&gt;
        p = pvar&lt;br /&gt;
    End If&lt;br /&gt;
    &lt;br /&gt;
    Debug.Print p.x, p.y, p.Z&lt;br /&gt;
    &lt;br /&gt;
End Sub&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>