<?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: Mirror entity and Extrusion direction relative to UCS problem. in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/mirror-entity-and-extrusion-direction-relative-to-ucs-problem/m-p/4411049#M47797</link>
    <description>&lt;P&gt;simple mirror is 2d mirror, what you are doing here is 3d mirroring, that's why you get opposite extrusion direction, which is the same as normal vector of the object&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can try something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        Dim ent2 As Line = ent.Clone

        ent2.TransformBy(Matrix3d.Mirroring(New Line3d(New Point3d, New Point3d(0, 1, 0))))
        ent2.Normal = ent.Normal&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Sep 2013 12:19:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-09-09T12:19:54Z</dc:date>
    <item>
      <title>Mirror entity and Extrusion direction relative to UCS problem.</title>
      <link>https://forums.autodesk.com/t5/net-forum/mirror-entity-and-extrusion-direction-relative-to-ucs-problem/m-p/4402767#M47795</link>
      <description>&lt;P&gt;I'm trying to make my custom command that mirrors all the entities (lines, blocks, etc.).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used this:&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://through-the-interface.typepad.com/through_the_interface/2008/10/mirroring-autoc.html"&gt;http://through-the-interface.typepad.com/through_the_interface/2008/10/mirroring-autoc.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have one problem. After mirroring the line or polyline if I show list of parameters (LIST command) I have this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Extrusion direction relative to UCS:&amp;nbsp;X= 0.0000 Y= 0.0000 Z= -1.0000&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The problem is that I cannot then stretch this line if I select line and block in one time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me? How can I get rid of this "Extrusion ...".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With simple mirror I doesn't have this problem.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2013 09:24:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/mirror-entity-and-extrusion-direction-relative-to-ucs-problem/m-p/4402767#M47795</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-06T09:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: Mirror entity and Extrusion direction relative to UCS problem.</title>
      <link>https://forums.autodesk.com/t5/net-forum/mirror-entity-and-extrusion-direction-relative-to-ucs-problem/m-p/4409895#M47796</link>
      <description>&lt;P&gt;Anyone can help me?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2013 08:01:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/mirror-entity-and-extrusion-direction-relative-to-ucs-problem/m-p/4409895#M47796</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-09T08:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Mirror entity and Extrusion direction relative to UCS problem.</title>
      <link>https://forums.autodesk.com/t5/net-forum/mirror-entity-and-extrusion-direction-relative-to-ucs-problem/m-p/4411049#M47797</link>
      <description>&lt;P&gt;simple mirror is 2d mirror, what you are doing here is 3d mirroring, that's why you get opposite extrusion direction, which is the same as normal vector of the object&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can try something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        Dim ent2 As Line = ent.Clone

        ent2.TransformBy(Matrix3d.Mirroring(New Line3d(New Point3d, New Point3d(0, 1, 0))))
        ent2.Normal = ent.Normal&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2013 12:19:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/mirror-entity-and-extrusion-direction-relative-to-ucs-problem/m-p/4411049#M47797</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-09T12:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Mirror entity and Extrusion direction relative to UCS problem.</title>
      <link>https://forums.autodesk.com/t5/net-forum/mirror-entity-and-extrusion-direction-relative-to-ucs-problem/m-p/5471260#M47798</link>
      <description>&lt;P&gt;It doesn't work for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        public ObjectId MirrorEntity(ObjectId id, Point3d firstPoint, Point3d secondPoint)
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
            DocumentLock dl = doc.LockDocument(DocumentLockMode.ProtectedAutoWrite, null, null, true);
            using (dl)
            {
                using (Transaction tr = db.TransactionManager.StartTransaction())
                {
                    try
                    {
                        Entity ent = tr.GetObject(id, OpenMode.ForRead) as Entity;
                        Entity me = ent.Clone() as Entity;

                        Line3d line = new Line3d(firstPoint.Add(this.BasePoint3d.GetAsVector()), secondPoint.Add(this.BasePoint3d.GetAsVector()));
                        
                        Matrix3d mm = Matrix3d.Mirroring(line);
                        me.TransformBy(mm);

                        BlockTableRecord btr = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
                        ObjectId newId = btr.AppendEntity(me);
                        tr.AddNewlyCreatedDBObject(me, true);
                        tr.Commit();
                        return newId;
                    }
                    catch (Autodesk.AutoCAD.Runtime.Exception ex)
                    {
                        Utilities.ErrorMessage("\nException!\n " + ex.Message);
                        tr.Abort();
                        return ObjectId.Null;
                    }
                }
            }
        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jan 2015 18:55:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/mirror-entity-and-extrusion-direction-relative-to-ucs-problem/m-p/5471260#M47798</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-15T18:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Mirror entity and Extrusion direction relative to UCS problem.</title>
      <link>https://forums.autodesk.com/t5/net-forum/mirror-entity-and-extrusion-direction-relative-to-ucs-problem/m-p/5471375#M47799</link>
      <description>&lt;P&gt;You are not setting the normal to the value of the original entity, that can make the difference.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jan 2015 20:01:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/mirror-entity-and-extrusion-direction-relative-to-ucs-problem/m-p/5471375#M47799</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-15T20:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Mirror entity and Extrusion direction relative to UCS problem.</title>
      <link>https://forums.autodesk.com/t5/net-forum/mirror-entity-and-extrusion-direction-relative-to-ucs-problem/m-p/5471430#M47800</link>
      <description>&lt;P&gt;I tried, but I'm getting error that Normal property is read-only.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jan 2015 20:48:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/mirror-entity-and-extrusion-direction-relative-to-ucs-problem/m-p/5471430#M47800</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-15T20:48:06Z</dc:date>
    </item>
  </channel>
</rss>

