<?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: Copy with base point in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6386848#M65016</link>
    <description>&lt;P&gt;sorry but the revised code did nothing. In fact it even didn;t got rotated&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jun 2016 09:26:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-06-16T09:26:22Z</dc:date>
    <item>
      <title>Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6374371#M65000</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I call copy with base point via api.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sanjay Pandey(BIM[Revit] Developer)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2016 09:24:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6374371#M65000</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-09T09:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6375112#M65001</link>
      <description>&lt;P&gt;&lt;FONT color="#000000" face="Consolas" size="2"&gt;Something like this:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;Selection&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; selection = uidoc.Selection;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;ICollection&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;ElementId&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;gt; selectedIds = uidoc.Selection.GetElementIds();&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;XYZ&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; point1 = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;new&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;XYZ&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;(0, 0, 0);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;XYZ&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; point2 = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;XYZ&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(0, 0, 0);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;XYZ&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; point3 = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;XYZ&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(0, 0, 0);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;point1 = selection.PickPoint(&lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"Please pick a base point."&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;point2 = selection.PickPoint(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"Please pick a point to place elements"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;point3 = point2.Subtract(point1);&lt;/P&gt;&lt;P&gt;t.Start();&lt;/P&gt;&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;ICollection&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;ElementId&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;gt; pastedIds = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;ElementTransformUtils&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;.CopyElements(doc, selectedIds, point3);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;t.Commit();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The view must have a workplane set for the PickPoint to work.&amp;nbsp; With a workplane set, this will work in plan views, elevation views, and even 3D views.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2016 14:52:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6375112#M65001</guid>
      <dc:creator>stever66</dc:creator>
      <dc:date>2016-06-09T14:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6378667#M65002</link>
      <description>&lt;P&gt;I can't understand the question, can you clarify more please?&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jun 2016 19:54:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6378667#M65002</guid>
      <dc:creator>Mustafa.Salaheldin</dc:creator>
      <dc:date>2016-06-11T19:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6379904#M65003</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have a group whose group origin i have changed. Now How do I find the center point of the group. because after changing the group origin to the top left the rotation of the group is not working properly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have a group whose group origin i have changed. Now How do I find the center point of the group.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sanjay Pandey(BIM[Revit] Developer)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2016 09:48:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6379904#M65003</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-13T09:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6380034#M65004</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for the group's center point, why not get the bounding boxes of the members and then calculate it ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2016 11:35:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6380034#M65004</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2016-06-13T11:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6384216#M65005</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the suggestion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about getting the bounding box of the group itself and getting the center.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;
&lt;P&gt;Sanjay Pandey&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2016 08:58:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6384216#M65005</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-15T08:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6384259#M65006</link>
      <description>&lt;P&gt;Hi sanjayman,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've already seen that you created another thread for the Group center point.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api/group-center-point/td-p/6379898" target="_blank"&gt;http://forums.autodesk.com/t5/revit-api/group-center-point/td-p/6379898&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as I can see, there are about three types of Groups:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Model groups&lt;/LI&gt;
&lt;LI&gt;Detail groups&lt;/LI&gt;
&lt;LI&gt;Model groups with attached Detail groups&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Each group consists of a list of members.&lt;/P&gt;
&lt;P&gt;You can get the members' BoundingBoxes, this method needs a View parameter.&lt;/P&gt;
&lt;P&gt;Depending on the kind of the group,use the View the Element resides in (Detail group) or null (for Model group).&lt;/P&gt;
&lt;P&gt;May be that you need to use a valid View3D instead of null, in this case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the third case, I have no idea so far.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once having the BoundinBoxXYZ for each Element in a group, get their minimum and maximum extends.&lt;/P&gt;
&lt;P&gt;Calculate the center of the extends by dividing it by two...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Remark: Groups can contain groups.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Revitalizer&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2016 09:31:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6384259#M65006</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2016-06-15T09:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6384271#M65007</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am only dealing with Model Groups[no detail group attached nor any group within group]. After replying to you I tried to do :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. got the bounding box of the group&amp;nbsp;group.get_BoundingBox(activeview)&lt;/P&gt;
&lt;P&gt;2. divide the max and min by two.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but results are quiet bad&lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://forums.autodesk.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sanjay Pandey(BIM[Revit] Developer)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2016 09:39:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6384271#M65007</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-15T09:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6384306#M65008</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;not the BoundingBox of the Group itself but those boxes of its members.&lt;/P&gt;
&lt;P&gt;Get the member Elements (respectively their Ids) by Group.GetMemberIds().&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that Groups can be embedded recursively, a Group's member could be another Group, since a Group is an Element itself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a Model group, I wouldn't use the ActiveView since the result will be view depending.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2016 10:01:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6384306#M65008</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2016-06-15T10:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6384664#M65009</link>
      <description>&lt;P&gt;Please try this and tell me the result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;#region Namespaces

using System;
using System.Text;
using System.Linq;
using System.Xml;
using System.Reflection;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Media.Imaging;
using System.Windows.Forms;
using System.IO;

using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;

using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Events;
using Autodesk.Revit.DB.Architecture;
using Autodesk.Revit.DB.Structure;
using Autodesk.Revit.DB.Mechanical;
using Autodesk.Revit.DB.Electrical;
using Autodesk.Revit.DB.Plumbing;

using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.UI.Events;

//using Autodesk.Revit.Collections;
using Autodesk.Revit.Exceptions;
using Autodesk.Revit.Utility;

using RvtApplication = Autodesk.Revit.ApplicationServices.Application;
using RvtDocument = Autodesk.Revit.DB.Document;

#endregion

namespace RevitAddinCS5
{
    [Transaction(TransactionMode.Manual)]
    [Regeneration(RegenerationOption.Manual)]
    public class ExtCmd : IExternalCommand
    {
        #region Cached Variables

        private static ExternalCommandData _cachedCmdData;

        public static UIApplication CachedUiApp
        {
            get
            {
                return _cachedCmdData.Application;
            }
        }

        public static RvtApplication CachedApp
        {
            get
            {
                return CachedUiApp.Application;
            }
        }

        public static RvtDocument CachedDoc
        {
            get
            {
                return CachedUiApp.ActiveUIDocument.Document;
            }
        }

        #endregion

        #region IExternalCommand Members

        public Result Execute(ExternalCommandData cmdData, ref string msg, ElementSet elemSet)
        {
            _cachedCmdData = cmdData;

            try
            {
                FilteredElementCollector collector = new FilteredElementCollector(CachedDoc);
                collector.OfCategory(BuiltInCategory.OST_IOSModelGroups).WhereElementIsNotElementType();

                List&amp;lt;Element&amp;gt; els = collector.Cast&amp;lt;Element&amp;gt;().ToList();

                Element el = els.First();
                Group g = el as Group;

                BoundingBoxXYZ box = g.get_BoundingBox(CachedDoc.ActiveView);

                XYZ p1 = box.Max.Add(box.Min) / 2;
                XYZ p2 = p1.Add(new XYZ(0, 0, 1));

                Line ln = Line.CreateBound(p1, p2);

                using (Transaction t = new Transaction(CachedDoc, "Revit"))
                {
                    t.Start();

                    ElementTransformUtils.RotateElement(CachedDoc, el.Id, ln, Math.PI / 2);

                    t.Commit();
                }

                return Result.Succeeded;
            }
            catch (Exception ex)
            {
                msg = ex.ToString();
                return Result.Failed;
            }
        }

        #endregion
    }
}&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Jun 2016 12:59:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6384664#M65009</guid>
      <dc:creator>Mustafa.Salaheldin</dc:creator>
      <dc:date>2016-06-15T12:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6384702#M65010</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am only dealing with Model Groups[no detail group attached nor any group within group]. After replying to you I tried to do :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. got the bounding box of the group&amp;nbsp;group.get_BoundingBox(activeview)&lt;/P&gt;&lt;P&gt;2. divide the max and min by two.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but results are quiet bad&lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://forums.autodesk.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sanjay Pandey(BIM[Revit] Developer)&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;For step 2, don't you mean:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;min + (max - min)/2&amp;nbsp; ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2016 13:15:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6384702#M65010</guid>
      <dc:creator>stever66</dc:creator>
      <dc:date>2016-06-15T13:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6384847#M65011</link>
      <description>&lt;P&gt;Please try this and tell me the result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;#region Namespaces

using System;
using System.Text;
using System.Linq;
using System.Xml;
using System.Reflection;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Media.Imaging;
using System.Windows.Forms;
using System.IO;

using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;

using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Events;
using Autodesk.Revit.DB.Architecture;
using Autodesk.Revit.DB.Structure;
using Autodesk.Revit.DB.Mechanical;
using Autodesk.Revit.DB.Electrical;
using Autodesk.Revit.DB.Plumbing;

using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.UI.Events;

//using Autodesk.Revit.Collections;
using Autodesk.Revit.Exceptions;
using Autodesk.Revit.Utility;

using RvtApplication = Autodesk.Revit.ApplicationServices.Application;
using RvtDocument = Autodesk.Revit.DB.Document;

#endregion

namespace RevitAddinCS5
{
    [Transaction(TransactionMode.Manual)]
    [Regeneration(RegenerationOption.Manual)]
    public class ExtCmd : IExternalCommand
    {
        #region Cached Variables

        private static ExternalCommandData _cachedCmdData;

        public static UIApplication CachedUiApp
        {
            get
            {
                return _cachedCmdData.Application;
            }
        }

        public static RvtApplication CachedApp
        {
            get
            {
                return CachedUiApp.Application;
            }
        }

        public static RvtDocument CachedDoc
        {
            get
            {
                return CachedUiApp.ActiveUIDocument.Document;
            }
        }

        #endregion

        #region IExternalCommand Members

        public Result Execute(ExternalCommandData cmdData, ref string msg, ElementSet elemSet)
        {
            _cachedCmdData = cmdData;

            try
            {
                FilteredElementCollector collector = new FilteredElementCollector(CachedDoc);
                collector.OfCategory(BuiltInCategory.OST_IOSModelG&lt;WBR /&gt;roups).WhereElementIsNotElementType();

                List&amp;lt;Element&amp;gt; els = collector.Cast&amp;lt;Element&amp;gt;().ToList();

                Element el = els.First();
                Group g = el as Group;

                BoundingBoxXYZ box = g.get_BoundingBox(CachedDoc.ActiveView);

                XYZ p1 = box.Max.Add(box.Min) / 2;
                XYZ p2 = p1.Add(new XYZ(0, 0, 1));

                Line ln = Line.CreateBound(p1, p2);

                using (Transaction t = new Transaction(CachedDoc, "Revit"))
                {
                    t.Start();

                    ElementTransformUtils.RotateElement(CachedDoc, el.Id, ln, Math.PI / 2);

                    t.Commit();
                }

                return Result.Succeeded;
            }
            catch (Exception ex)
            {
                msg = ex.ToString();
                return Result.Failed;
            }
        }

        #endregion
    }
}&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Jun 2016 13:59:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6384847#M65011</guid>
      <dc:creator>Mustafa.Salaheldin</dc:creator>
      <dc:date>2016-06-15T13:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6386538#M65012</link>
      <description>&lt;P&gt;Dear Mustafa,&lt;/P&gt;
&lt;P&gt;I don;t know but I see a bonding getting developed here.&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://forums.autodesk.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt; Thanks for spending time for me. Can I have your emailid?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried your code and you can see the results in the image below.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/248081iF28E47ACF4650A2A/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="mustafa.png" title="mustafa.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 05:32:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6386538#M65012</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-16T05:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6386692#M65013</link>
      <description>&lt;P&gt;You have to adjust the angle in the code because it is already set to 90 degree (Math.Pi / 2).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've modified the code to make you able to control the value of the angle.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this reply satisfies your need please don't forget to mark it as solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;This code will rotate the group by 180 dgree now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;#region Namespaces

using System;
using System.Text;
using System.Linq;
using System.Xml;
using System.Reflection;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Media.Imaging;
using System.Windows.Forms;
using System.IO;

using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;

using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Events;
using Autodesk.Revit.DB.Architecture;
using Autodesk.Revit.DB.Structure;
using Autodesk.Revit.DB.Mechanical;
using Autodesk.Revit.DB.Electrical;
using Autodesk.Revit.DB.Plumbing;

using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.UI.Events;

//using Autodesk.Revit.Collections;
using Autodesk.Revit.Exceptions;
using Autodesk.Revit.Utility;

using RvtApplication = Autodesk.Revit.ApplicationServices.Application;
using RvtDocument = Autodesk.Revit.DB.Document;

#endregion

namespace RevitAddinCS5
{
    [Transaction(TransactionMode.Manual)]
    [Regeneration(RegenerationOption.Manual)]
    public class ExtCmd : IExternalCommand
    {
        #region Cached Variables

        private static ExternalCommandData _cachedCmdData;

        public static UIApplication CachedUiApp
        {
            get
            {
                return _cachedCmdData.Application;
            }
        }

        public static RvtApplication CachedApp
        {
            get
            {
                return CachedUiApp.Application;
            }
        }

        public static RvtDocument CachedDoc
        {
            get
            {
                return CachedUiApp.ActiveUIDocument.Document;
            }
        }

        #endregion

        #region IExternalCommand Members

        public Result Execute(ExternalCommandData cmdData, ref string msg, ElementSet elemSet)
        {
            _cachedCmdData = cmdData;

            try
            {
                FilteredElementCollector collector = new FilteredElementCollector(CachedDoc);
                collector.OfCategory(BuiltInCategory.OST_IOSModelGroups).WhereElementIsNotElementType();

                List&amp;lt;Element&amp;gt; els = collector.Cast&amp;lt;Element&amp;gt;().ToList();

                Element el = els.First();
                Group g = el as Group;

                BoundingBoxXYZ box = g.get_BoundingBox(CachedDoc.ActiveView);

                XYZ p1 = box.Max.Add(box.Min) / 2;
                XYZ p2 = p1.Add(new XYZ(0, 0, 1));

                Line ln = Line.CreateBound(p1, p2);

                using (Transaction t = new Transaction(CachedDoc, "Revit"))
                {
                    t.Start();

                    //control the rotation angle from here.
                    double RotationAngle = Math.PI;
                    ElementTransformUtils.RotateElement(CachedDoc, el.Id, ln, RotationAngle);

                    t.Commit();
                }

                return Result.Succeeded;
            }
            catch (Exception ex)
            {
                msg = ex.ToString();
                return Result.Failed;
            }
        }

        #endregion
    }
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 07:45:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6386692#M65013</guid>
      <dc:creator>Mustafa.Salaheldin</dc:creator>
      <dc:date>2016-06-16T07:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6386818#M65014</link>
      <description>&lt;P&gt;don;t know what's going wrong;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;my code with your help goes like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;trans.Start("sun");&lt;BR /&gt; XYZ targetPoint = Command.uidoc.Selection.PickPoint("Please pick a point.");&lt;/P&gt;
&lt;P&gt;Group dt = uidoc.Document.Create.PlaceGroup(targetPoint, ty);&lt;/P&gt;
&lt;P&gt;BoundingBoxXYZ box1 = dt.get_BoundingBox(Command.doc.ActiveView);&lt;BR /&gt; XYZ p1 = box1.Max.Add(box1.Min) / 2;&lt;BR /&gt; XYZ p2 = p1.Add(new XYZ(0, 0, 1));&lt;BR /&gt; Line ln = Line.CreateBound(p1, p2);&lt;/P&gt;
&lt;P&gt;ElementTransformUtils.RotateElement(Command.doc, dt.Id, ln, 180);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/248141i9FD9F00BBD119B47/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="mustafa1.png" title="mustafa1.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 09:13:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6386818#M65014</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-16T09:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6386830#M65015</link>
      <description>&lt;P&gt;Revit uses the radian measurments for angel so your code should be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;trans.Start("sun");
 XYZ targetPoint = Command.uidoc.Selection.PickPoint("Please pick a point.");

Group dt = uidoc.Document.Create.PlaceGroup(targetPoint, ty);

BoundingBoxXYZ box1 = dt.get_BoundingBox(Command.doc.ActiveView);
 XYZ p1 = box1.Max.Add(box1.Min) / 2;
 XYZ p2 = p1.Add(new XYZ(0, 0, 1));
 Line ln = Line.CreateBound(p1, p2);

// replace 180 with Math.Pi
ElementTransformUtils.RotateElement(Command.doc, dt.Id, ln, Math.Pi);
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To rotate around the arbitary point&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;trans.Start("sun");
 XYZ targetPoint = Command.uidoc.Selection.PickPoint("Please pick a point.");

Group dt = uidoc.Document.Create.PlaceGroup(targetPoint, ty);

BoundingBoxXYZ box1 = dt.get_BoundingBox(Command.doc.ActiveView);
 XYZ p1 = targetPoint ;
 XYZ p2 = p1.Add(new XYZ(0, 0, 1));
 Line ln = Line.CreateBound(p1, p2);

ElementTransformUtils.RotateElement(Command.doc, dt.Id, ln, 180);
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 09:23:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6386830#M65015</guid>
      <dc:creator>Mustafa.Salaheldin</dc:creator>
      <dc:date>2016-06-16T09:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6386848#M65016</link>
      <description>&lt;P&gt;sorry but the revised code did nothing. In fact it even didn;t got rotated&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 09:26:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6386848#M65016</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-16T09:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6386860#M65017</link>
      <description>&lt;P&gt;Sorry it was my mistake &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://forums.autodesk.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;trans.Start("sun");
 XYZ targetPoint = Command.uidoc.Selection.PickPoint("Please pick a point.");

Group dt = uidoc.Document.Create.PlaceGroup(targetPoint, ty);

BoundingBoxXYZ box1 = dt.get_BoundingBox(Command.doc.ActiveView);
 XYZ p1 = targetPoint ;
 XYZ p2 = p1.Add(new XYZ(0, 0, 1));
 Line ln = Line.CreateBound(p1, p2);

ElementTransformUtils.RotateElement(Command.doc, dt.Id, ln, Math.PI);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I forget to repalce the 180 by PI &lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 09:40:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6386860#M65017</guid>
      <dc:creator>Mustafa.Salaheldin</dc:creator>
      <dc:date>2016-06-16T09:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Copy with base point</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6386908#M65018</link>
      <description>&lt;P&gt;Dear Mustafa,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for you time and help. Your code did the trick only with a very very little minor change.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;trans.Start("sun");
 XYZ targetPoint = Command.uidoc.Selection.PickPoint("Please pick a point.");

Group dt = uidoc.Document.Create.PlaceGroup(targetPoint, ty);

BoundingBoxXYZ box1 = dt.get_BoundingBox(Command.doc.ActiveView);
 XYZ p1 = box1.Max.Add(box1.Min) / 2;
 XYZ p2 = p1.Add(new XYZ(0, 0, 1));
 Line ln = Line.CreateBound(p1, p2);

// replace 180 with Math.Pi
//ElementTransformUtils.RotateElement(Command.doc, dt.Id, ln, Math.Pi); &lt;BR /&gt;//Replaced above line with&lt;/PRE&gt;
&lt;PRE&gt;ElementTransformUtils.RotateElement(Command.doc, dt.Id, ln, rotation defined bu user * Math.PI / 180);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again a big thank for you. Kudos to you and I will accept your solution as accepted answer. But I want to carry it forward. I am posting a new query in the forum. I which I will be needing your expert suggestion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sanjay Pandey(BIM[Revit] Developer)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 10:31:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/copy-with-base-point/m-p/6386908#M65018</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-16T10:31:28Z</dc:date>
    </item>
  </channel>
</rss>

