<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic setting UCS in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/setting-ucs/m-p/3492308#M55153</link>
    <description>&lt;P&gt;I'm new to vb.net and i'm trying to make some basic code to use in my programs.&lt;/P&gt;&lt;P&gt;I was wondering if some of you could give me your&amp;nbsp;thought about&amp;nbsp;my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Shared Function UCS_Set(ByVal DBIn As Database, ByVal Point1 As Point3d, ByVal Point2 As Point3d, Optional ByVal Z_axix_InLine_With_Points As Boolean = False) As Matrix3d
        Dim ZAxis As Vector3d
        Dim yAxis As Vector3d
        Dim xAxis As Vector3d

        Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor

        Try
            If Z_axix_InLine_With_Points = True Then
                ZAxis = Point1.GetVectorTo(Point2).GetNormal
                yAxis = ZAxis.GetPerpendicularVector.GetNormal
                xAxis = yAxis.CrossProduct(ZAxis).GetNormal()
            Else
                xAxis = Point1.GetVectorTo(Point2).GetNormal
                yAxis = xAxis.GetPerpendicularVector.GetNormal
                ZAxis = xAxis.CrossProduct(yAxis).GetNormal()
            End If

            Dim NewMatrix3d As Matrix3d = Matrix3d.AlignCoordinateSystem(Point3d.Origin, Vector3d.XAxis, Vector3d.YAxis, Vector3d.ZAxis, Point1, xAxis, yAxis, ZAxis)

            UCS_Set = NewMatrix3d
        Catch
            UCS_Set = Nothing
        End Try
    End Function&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jun 2012 18:19:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-06-08T18:19:27Z</dc:date>
    <item>
      <title>setting UCS</title>
      <link>https://forums.autodesk.com/t5/net-forum/setting-ucs/m-p/3492308#M55153</link>
      <description>&lt;P&gt;I'm new to vb.net and i'm trying to make some basic code to use in my programs.&lt;/P&gt;&lt;P&gt;I was wondering if some of you could give me your&amp;nbsp;thought about&amp;nbsp;my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Shared Function UCS_Set(ByVal DBIn As Database, ByVal Point1 As Point3d, ByVal Point2 As Point3d, Optional ByVal Z_axix_InLine_With_Points As Boolean = False) As Matrix3d
        Dim ZAxis As Vector3d
        Dim yAxis As Vector3d
        Dim xAxis As Vector3d

        Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor

        Try
            If Z_axix_InLine_With_Points = True Then
                ZAxis = Point1.GetVectorTo(Point2).GetNormal
                yAxis = ZAxis.GetPerpendicularVector.GetNormal
                xAxis = yAxis.CrossProduct(ZAxis).GetNormal()
            Else
                xAxis = Point1.GetVectorTo(Point2).GetNormal
                yAxis = xAxis.GetPerpendicularVector.GetNormal
                ZAxis = xAxis.CrossProduct(yAxis).GetNormal()
            End If

            Dim NewMatrix3d As Matrix3d = Matrix3d.AlignCoordinateSystem(Point3d.Origin, Vector3d.XAxis, Vector3d.YAxis, Vector3d.ZAxis, Point1, xAxis, yAxis, ZAxis)

            UCS_Set = NewMatrix3d
        Catch
            UCS_Set = Nothing
        End Try
    End Function&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2012 18:19:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/setting-ucs/m-p/3492308#M55153</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-08T18:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: setting UCS</title>
      <link>https://forums.autodesk.com/t5/net-forum/setting-ucs/m-p/3578186#M55154</link>
      <description>&lt;P&gt;Hi There,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's hard to give you some help on that one, especially that you don't tell what is the issue with the code and what you are trying to achieve exactly... Is the code not producing the expected result or you don't know how to get it done?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you aware about the AutoCAD DevBlog, you will find there many useful code samples:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://adndevblog.typepad.com/autocad/" target="_blank"&gt;http://adndevblog.typepad.com/autocad/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Philippe.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2012 16:16:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/setting-ucs/m-p/3578186#M55154</guid>
      <dc:creator>philippe.leefsma</dc:creator>
      <dc:date>2012-08-14T16:16:27Z</dc:date>
    </item>
  </channel>
</rss>

