<?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 Re: PolyLine2D - Moves after applying a Normal in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/polyline2d-moves-after-applying-a-normal/m-p/5527535#M41195</link>
    <description>&lt;P&gt;My solution was to rotate the object.&lt;/P&gt;&lt;P&gt;I did this in two stages - About the ZAxis and about a Vector perpendicular&amp;nbsp;to what I thought the normal should be.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Mar 2015 05:13:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-03-04T05:13:10Z</dc:date>
    <item>
      <title>PolyLine2D - Moves after applying a Normal</title>
      <link>https://forums.autodesk.com/t5/net-forum/polyline2d-moves-after-applying-a-normal/m-p/5525979#M41193</link>
      <description>&lt;P&gt;I am creating a a PolyLine2D that is perpendicular to 2 points that are selected by the user.&lt;/P&gt;&lt;P&gt;I have created a normal, in one of my test cases this is&amp;nbsp;-0.998174459224936,-0.060396597180692,0&lt;/P&gt;&lt;P&gt;When this is applied i.e&amp;nbsp;PL.Normal = ObjN the PolyLine is created in offset from the required location.&lt;/P&gt;&lt;P&gt;(note it is parrallel&amp;nbsp;to the 2 points).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How&amp;nbsp;do I need to Transform the PolyLine 2D to the correct location?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The full function is drawing the outline of and I beam as a polyline, creating a region and extruding to a solid3d.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2015 04:51:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/polyline2d-moves-after-applying-a-normal/m-p/5525979#M41193</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-03T04:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: PolyLine2D - Moves after applying a Normal</title>
      <link>https://forums.autodesk.com/t5/net-forum/polyline2d-moves-after-applying-a-normal/m-p/5525990#M41194</link>
      <description>&lt;P&gt;Here is the full function code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;   Function Draw_I(ShapeData As StructureFeasol.SelectedShape, _
               points As Geometry.Point3dCollection, _
               ByVal LayerName As String) As ObjectId

        Dim DOC As Document = Application.DocumentManager.MdiActiveDocument
        Dim DB As Database = DOC.Database
        Dim fcn As String = "Shapes2D.Draw_I"
        Dim SH As StructureFeasol.Shape = ShapeData.Shape
        Dim ObjID As ObjectId
        LayerMake.AddLayer(LayerName)
        Using tr As Transaction = DB.TransactionManager.StartTransaction()
            Dim BT As BlockTable
            BT = tr.GetObject(DB.BlockTableId, OpenMode.ForRead)
            ''
            Dim btr As BlockTableRecord
            btr = tr.GetObject(BT(BlockTableRecord.ModelSpace), OpenMode.ForWrite)
            ''
            Dim ctr As Geometry.Point3d = points(0)
            Dim nrm As Geometry.Point3d = points(1)
            ''
            Dim x As Double = nrm.X - ctr.X
            Dim y As Double = nrm.Y - ctr.Y
            Dim z As Double = nrm.Z - ctr.Z
            Dim ObjN As New Geometry.Vector3d(x, y, z)

            ''
            Dim ctr2 As Geometry.Point3d = ctr 'TODO Modify for Insert Point
            Dim Ang As Double = ShapeData.Rotation
            Dim PTS As New Geometry.Point3dCollection
            Dim ISflg As Double = (SH.Width - SH.WebThick) / 2.0
            Dim ISweb As Double = SH.Depth - (SH.FlgThick / 2.0)
            PTS.Add(New Geometry.Point3d(ctr2.X + SH.WebThick / 2.0, _
                                         ctr2.Y + SH.Depth / 2.0 - SH.FlgThick, _
                                         ctr2.Z))
            PTS.Add(PointCalculating.PolarPoints(PTS(0), (Ang + 0.0) * Deg2Rad, ISflg))
            PTS.Add(PointCalculating.PolarPoints(PTS(1), (Ang + 90.0) * Deg2Rad, SH.FlgThick))
            PTS.Add(PointCalculating.PolarPoints(PTS(2), (Ang + 180.0) * Deg2Rad, SH.Width))
            PTS.Add(PointCalculating.PolarPoints(PTS(3), (Ang + 270.0) * Deg2Rad, SH.FlgThick))
            PTS.Add(PointCalculating.PolarPoints(PTS(4), (Ang + 0.0) * Deg2Rad, ISflg))
            PTS.Add(PointCalculating.PolarPoints(PTS(5), (Ang + 270.0) * Deg2Rad, ISweb))
            PTS.Add(PointCalculating.PolarPoints(PTS(6), (Ang + 180.0) * Deg2Rad, ISflg))
            PTS.Add(PointCalculating.PolarPoints(PTS(7), (Ang + 270.0) * Deg2Rad, SH.FlgThick))
            PTS.Add(PointCalculating.PolarPoints(PTS(8), (Ang + 0.0) * Deg2Rad, SH.Width))
            PTS.Add(PointCalculating.PolarPoints(PTS(9), (Ang + 90.0) * Deg2Rad, SH.FlgThick))
            PTS.Add(PointCalculating.PolarPoints(PTS(10), (Ang + 180.0) * Deg2Rad, ISflg))
            ''
            Dim PL As Polyline2d = New Polyline2d(Poly2dType.SimplePoly, PTS, 0.0, True, 0.0, 0.0, Nothing)
            PL.Normal = ObjN.GetNormal
            PL.TransformBy(DOC.Editor.CurrentUserCoordinateSystem)

            ObjID = btr.AppendEntity(PL)
            tr.AddNewlyCreatedDBObject(PL, True)
            tr.Commit()
        End Using
        Return ObjID
    End Function&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2015 05:14:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/polyline2d-moves-after-applying-a-normal/m-p/5525990#M41194</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-03T05:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: PolyLine2D - Moves after applying a Normal</title>
      <link>https://forums.autodesk.com/t5/net-forum/polyline2d-moves-after-applying-a-normal/m-p/5527535#M41195</link>
      <description>&lt;P&gt;My solution was to rotate the object.&lt;/P&gt;&lt;P&gt;I did this in two stages - About the ZAxis and about a Vector perpendicular&amp;nbsp;to what I thought the normal should be.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2015 05:13:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/polyline2d-moves-after-applying-a-normal/m-p/5527535#M41195</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-04T05:13:10Z</dc:date>
    </item>
  </channel>
</rss>

