<?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: Rotating the Assembly Origin in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10077623#M28363</link>
    <description>&lt;P&gt;The assembly's origin is more than&amp;nbsp;&lt;STRONG&gt;just&lt;/STRONG&gt; a point. It also describes the orientation of the assembly (i.e. those colored arrows). It is in fact a coordinate system (to get technical, it is (probably) a right handed orthonormal coordinate system).&lt;/P&gt;&lt;P&gt;This coordinate system can be represented as a 4x4 matrix where the columns of the upper left 3x3 matrix are its x, y, and z basis vectors, the upper 3 values of the 4rth column is the coordinate system's origin, and the bottom row is [0, 0, 0, 1].&lt;/P&gt;&lt;LI-CODE lang="general"&gt;| x1 y1 z1 t1|
| x2 y2 z2 t2|
| x3 y3 z3 t3|
| 0  0  0  1 |&lt;/LI-CODE&gt;&lt;P&gt;where&amp;nbsp;&lt;STRONG&gt;t&lt;/STRONG&gt; is the origin (or &lt;STRONG&gt;t&lt;/STRONG&gt;ranslation) of the coordinate system.&lt;/P&gt;&lt;P&gt;Here's a decent explanation of transforms/coordinate systems&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Affine_transformation" target="_blank"&gt;Affine transformation - Wikipedia&lt;/A&gt;. You could read some articles and/or books about 3D geometry relevant to computer graphics/gaming/CAD if you want to learn more or get a better explanation than I can provide.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Feb 2021 05:50:22 GMT</pubDate>
    <dc:creator>mhannonQ65N2</dc:creator>
    <dc:date>2021-02-12T05:50:22Z</dc:date>
    <item>
      <title>Rotating the Assembly Origin</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10068198#M28355</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am trying to rotate the assembly origin for several days now, although it might seem to be an easy task it is not for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is when I run the code, it rotates the assembly origin but it also moves the origin! which is not desired. I just want to rotate the origin around its own axis so that the origin does not move.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code: (the assembly includes a wall, I find the location of the wall and try to rotate the assembly origin based on this point and the axis which crosses this point and is towards Z direction, please note that I pick the element based on its face.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;Autodesk.Revit.DB &lt;SPAN&gt;as &lt;/SPAN&gt;DB&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;Autodesk.Revit.DB &lt;SPAN&gt;import&lt;/SPAN&gt;*&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;Autodesk.Revit.Exceptions &lt;SPAN&gt;import&lt;/SPAN&gt;*&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;math &lt;SPAN&gt;as &lt;/SPAN&gt;m&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;sys&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;PRE&gt;uidoc = __revit__.ActiveUIDocument&lt;BR /&gt;doc = __revit__.ActiveUIDocument.Document&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;ref = uidoc.Selection.PickObject(ObjectType.Face&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'Please Pick NearFace'&lt;/SPAN&gt;)&lt;BR /&gt;wall = doc.GetElement(ref)&lt;BR /&gt;face = wall.GetGeometryObjectFromReference(ref)&lt;BR /&gt;&lt;BR /&gt;assembly_id = wall.AssemblyInstanceId&lt;BR /&gt;assembly = doc.GetElement(assembly_id)&lt;/PRE&gt;&lt;PRE&gt;line = wall.Location.Curve #Defining the line to find the mid point of the wall so I rotate based on this point&lt;BR /&gt;mid_point = (line.GetEndPoint(&lt;SPAN&gt;1&lt;/SPAN&gt;) + line.GetEndPoint(&lt;SPAN&gt;0&lt;/SPAN&gt;))/&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;axis = line.CreateBound(mid_point&lt;SPAN&gt;, &lt;/SPAN&gt;XYZ(mid_point.X&lt;SPAN&gt;, &lt;/SPAN&gt;mid_point.Y&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;)) #Axis of rotation&lt;BR /&gt;assembly_origin = assembly.GetTransform() #Getting the assembly_origin&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;rotation = assembly_origin.CreateRotationAtPoint(axis&lt;SPAN&gt;, &lt;/SPAN&gt;m.radians(&lt;SPAN&gt;90&lt;/SPAN&gt;)&lt;SPAN&gt;, &lt;/SPAN&gt;mid_point)&lt;BR /&gt;&lt;BR /&gt;t = Transaction(doc&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'ROTATION'&lt;/SPAN&gt;)&lt;BR /&gt;t.Start()&lt;BR /&gt;&lt;BR /&gt;assembly.SetTransform(rotation)&lt;BR /&gt;&lt;BR /&gt;t.Commit()&lt;/PRE&gt;&lt;P&gt;result:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rotation.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/878635i94124DCA810E0D68/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rotation.PNG" alt="rotation.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;I have tried other ways but all result in the same thing. I also read that I have to rotate it based on its local coordination but I don't know how!&lt;/P&gt;&lt;P&gt;Any help would be much appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 01:21:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10068198#M28355</guid>
      <dc:creator>DavoudMWAWD</dc:creator>
      <dc:date>2021-02-09T01:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating the Assembly Origin</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10073258#M28356</link>
      <description>&lt;P&gt;One of the most straightforward ways of rotating an element is via it's location property (when it has one).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For a wall object the below code rotates a wall by the midpoint of it's location curve 'Curve.Evaluate(0.5, True)' about the static value XYZ.Basis.Z (0,0,1).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LC.Rotate(Line.CreateUnbound(LC.Curve.Evaluate(0.5, True), XYZ.BasisZ), Math.PI / 2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For an assembly object the below code rotates the assembly via it location point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LP.Rotate(Line.CreateUnbound(LP.Point, XYZ.BasisZ), Math.PI / 2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that for newly created elements you must Regenerate the document (or commit transaction that added the elements) to make use of the location property this way. The location will have incorrect values until regeneration e.g. a location point is initialised with a value of 0,0,0 until after Regeneration, where the value is updated to reflect actual location. This would make a rotation based upon this similar to what you show (about the model origin). This is likely unrelated to your issue but important to remember.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt; Private Function TObj156(ByVal commandData As Autodesk.Revit.UI.ExternalCommandData,
ByRef message As String, ByVal elements As Autodesk.Revit.DB.ElementSet) As Result

        Dim UIDoc As UIDocument = commandData.Application.ActiveUIDocument
        If UIDoc Is Nothing Then Return Result.Cancelled Else
        Dim IntDoc As Document = UIDoc.Document
        Dim R As Reference = Nothing
        Try
            R = UIDoc.Selection.PickObject(Selection.ObjectType.Element)
        Catch ex As Exception
        End Try
        If R Is Nothing Then Return Result.Cancelled Else

        Dim El As Element = IntDoc.GetElement(R)
        If El.Location Is Nothing Then Return Result.Cancelled Else

        Using Tx As New Transaction(IntDoc, "Rotate 90")
            If Tx.Start = TransactionStatus.Started Then
                Select Case El.Location.GetType
                    Case = GetType(LocationPoint)
                        Dim LP As LocationPoint = El.Location
                        LP.Rotate(Line.CreateUnbound(LP.Point, XYZ.BasisZ), Math.PI / 2)
                    Case = GetType(LocationCurve)
                        Dim LC As LocationCurve = El.Location
                        LC.Rotate(Line.CreateUnbound(LC.Curve.Evaluate(0.5, True), XYZ.BasisZ), Math.PI / 2)
                End Select
            End If
            Tx.Commit()
        End Using

        Return Result.Succeeded
    End Function&lt;/LI-CODE&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;&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>Wed, 10 Feb 2021 17:22:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10073258#M28356</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-02-10T17:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating the Assembly Origin</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10074214#M28357</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;SPAN class=""&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1035859" target="_self"&gt;RPTHOMAS108&lt;/A&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I actually tried to rotate the assembly origin using ''Rotate()'' function, but the problem is this function is not defined for assembly origin (you can actually rotate the whole assembly but not just its origin).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Even the ElementTransformUtils.RotateElement doesn't work here as the assembly origin does not have Id.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;So basically the only way I could find to rotate the assembly origin was by defining the transformation/rotation first and then rotate it using Element.SetTransform(rotation)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Kind Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 22:45:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10074214#M28357</guid>
      <dc:creator>DavoudMWAWD</dc:creator>
      <dc:date>2021-02-10T22:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating the Assembly Origin</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10074775#M28358</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;&lt;SPAN class="login-bold"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;Sorry to bother you, Could you please give me a hint on this issue. I just don't understand why this is happening, and there is also very limited information online regarding this issue (some people have managed to overcome this by using a package called 'BIM4Struc Package') and using a node called 'Element.LocalCoordinateSystem' but I'm not using dynamo...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;Kind Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 06:13:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10074775#M28358</guid>
      <dc:creator>DavoudMWAWD</dc:creator>
      <dc:date>2021-02-11T06:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating the Assembly Origin</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10074919#M28359</link>
      <description>&lt;P&gt;First of all, it costs me effort to ignore the title of this thread and understand what you wish to achieve.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The origin is a single point and infinitely small, zero-dimensional. Rotating a point makes no sense.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you mean 'rotate the assembly around its origin'?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No, apparently that is not what you are after either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Furthermore, I know nothing of Dynamo or the packages you mention.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actually, re-reading your entire post, I still do not understand what you are trying to achieve.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Furthermore, I trust Richard's judgement and experience much more than my own, so I do not see anything I can add to the answer he so kindly already provided.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 07:41:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10074919#M28359</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-02-11T07:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating the Assembly Origin</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10076970#M28360</link>
      <description>&lt;P&gt;The method&amp;nbsp;CreateRotationAtPoint is a static method, not an instance method. Calling it on a Transform instance does not use any of that instance's data, you are creating an entirely new Transform.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think what you want to do is apply the rotation transform that you are creating to the assembly's transform. You can do that with the&amp;nbsp;&lt;EM&gt;Multiply&lt;/EM&gt; method. Because matrix multiplication is not commutative, the order of multiplying the transforms matters. I'm pretty sure the correct order of operations is&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;rotation.Multiply(assembly_origin)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For a brief explanation,&amp;nbsp;&lt;EM&gt;assembly_origin&lt;/EM&gt; describes how to move the assembly from the origin to its current position and orientation. The&amp;nbsp;&lt;EM&gt;rotation&lt;/EM&gt; transform describes how to rotate something about an axis at a point. The result of the multiplication should describe moving something from the origin to the assembly's original position &amp;amp; orientation then rotating it about an axis at a point.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 21:30:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10076970#M28360</guid>
      <dc:creator>mhannonQ65N2</dc:creator>
      <dc:date>2021-02-11T21:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating the Assembly Origin</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10077248#M28361</link>
      <description>&lt;P&gt;I found this link on assembly origin, which illuminates the situation:&lt;/P&gt;&lt;P&gt;&lt;A href="https://knowledge.autodesk.com/support/revit-products/learn-explore/caas/CloudHelp/cloudhelp/2020/ENU/Revit-Model/files/GUID-3C81BBFC-AC75-40CB-980E-023BB27428B0-htm.html" target="_blank" rel="noopener"&gt;Work with an Assembly | Revit Products 2020 | Autodesk Knowledge Network&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So partly it makes sense but as noted rotation of a point about itself doesn't make sense. I can understand why the code translates and rotates it as it does but I'm not understanding is what point&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10026297"&gt;@DavoudMWAWD&lt;/a&gt;&amp;nbsp;wants to rotate the origin about? Seems like it is the centre of the wall which should be starting point for origin.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also there needs to be distinction between CreateRotationAtPoint and CreateRotation one changes origin the other just changes the basis with origin being zero.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is property AssemblyInstance.GetCenter perhaps this is what they want to rotate origin around but first it has to be remote from that.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 00:29:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10077248#M28361</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-02-12T00:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating the Assembly Origin</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10077478#M28362</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I apologize if I couldn't describe the issue clearly. Please see the image below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Assembly origin.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/880134iE5AA8F123E0319F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Assembly origin.png" alt="Assembly origin.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I simply want to do this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8377999"&gt;@mhannonQ65N2&lt;/a&gt;&amp;nbsp;for your suggestion, I tried it, it seems that it does not work either.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1035859"&gt;@RPTHOMAS108&lt;/a&gt;. It is true that assembly origin is just a point as Jeremy described but how can I control the direction of arrows (those red and green arrows that are bound to this point)? I think it is beyond my knowledge to understand why 'assembly origin' is defined as an instance of Transform Class, but looking at the link you sent me it kinda makes sense.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Anyway, thanks for helping, I appreciate your efforts.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 03:11:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10077478#M28362</guid>
      <dc:creator>DavoudMWAWD</dc:creator>
      <dc:date>2021-02-12T03:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating the Assembly Origin</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10077623#M28363</link>
      <description>&lt;P&gt;The assembly's origin is more than&amp;nbsp;&lt;STRONG&gt;just&lt;/STRONG&gt; a point. It also describes the orientation of the assembly (i.e. those colored arrows). It is in fact a coordinate system (to get technical, it is (probably) a right handed orthonormal coordinate system).&lt;/P&gt;&lt;P&gt;This coordinate system can be represented as a 4x4 matrix where the columns of the upper left 3x3 matrix are its x, y, and z basis vectors, the upper 3 values of the 4rth column is the coordinate system's origin, and the bottom row is [0, 0, 0, 1].&lt;/P&gt;&lt;LI-CODE lang="general"&gt;| x1 y1 z1 t1|
| x2 y2 z2 t2|
| x3 y3 z3 t3|
| 0  0  0  1 |&lt;/LI-CODE&gt;&lt;P&gt;where&amp;nbsp;&lt;STRONG&gt;t&lt;/STRONG&gt; is the origin (or &lt;STRONG&gt;t&lt;/STRONG&gt;ranslation) of the coordinate system.&lt;/P&gt;&lt;P&gt;Here's a decent explanation of transforms/coordinate systems&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Affine_transformation" target="_blank"&gt;Affine transformation - Wikipedia&lt;/A&gt;. You could read some articles and/or books about 3D geometry relevant to computer graphics/gaming/CAD if you want to learn more or get a better explanation than I can provide.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 05:50:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10077623#M28363</guid>
      <dc:creator>mhannonQ65N2</dc:creator>
      <dc:date>2021-02-12T05:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating the Assembly Origin</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10077720#M28364</link>
      <description>&lt;P&gt;I see now that the assembly origin is more than just a point, so it does indeed make sense to manipulate its orientation, which is in fact a transform, just as you guys so helpfully explain.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your before-after image, it looks to me as if you wish to modify both the location and the orientation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How is this assembly created?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would assume that you create it yourself.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the creation process, you might start off by specifying the&amp;nbsp;location and the orientation first, and then adding components to it, such as the wall you show.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that &lt;U&gt;is&lt;/U&gt; the case, I still see no problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that is &lt;U&gt;not&lt;/U&gt; the case, I still don't understand what might be causing the problem, i.e., causing an unwanted origin orientation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where does the&amp;nbsp;origin orientation come from, who sets this up?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 07:22:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10077720#M28364</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-02-12T07:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating the Assembly Origin</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10078260#M28365</link>
      <description>&lt;P&gt;You want to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Transform.CreateRotation not&amp;nbsp;Transform.CreateRotationAtPoint otherwise will go wrong when you multiply with existing. Mathematically during multiplication operation you want zero origin added to existing transform origin.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt; Private Function TObj158(ByVal commandData As Autodesk.Revit.UI.ExternalCommandData,
ByRef message As String, ByVal elements As Autodesk.Revit.DB.ElementSet) As Result

        Dim UIDoc As UIDocument = commandData.Application.ActiveUIDocument
        If UIDoc Is Nothing Then Return Result.Cancelled Else
        Dim IntDoc As Document = UIDoc.Document
        Dim R As Reference = Nothing
        Try
            R = UIDoc.Selection.PickObject(Selection.ObjectType.Element)
        Catch ex As Exception
        End Try
        If R Is Nothing Then Return Result.Cancelled Else

        Dim El As AssemblyInstance = TryCast(IntDoc.GetElement(R), AssemblyInstance)
        Dim RTr As Transform = Transform.CreateRotation(XYZ.BasisZ, Math.PI / 2) 'rotate with no origin

        Dim TransformAsIs = El.GetTransform
        Dim Rotated As Transform = TransformAsIs.Multiply(RTr)

        Using Tx As New Transaction(IntDoc, "Rotate")
            If Tx.Start = TransactionStatus.Started Then
                El.SetTransform(Rotated)
                Tx.Commit()
            End If
        End Using
        Return Result.Succeeded

    End Function&lt;/LI-CODE&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>Fri, 12 Feb 2021 12:31:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10078260#M28365</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-02-12T12:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating the Assembly Origin</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10079822#M28366</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/824630"&gt;@jeremy_tammik&lt;/a&gt;, Thanks for your time, I just want to rotate it (I mistakenly moved it a bit in the image, that was not my intention). So at first I create the wall and all the elements attached to it (this is a precast concrete wall which has many cast-ins and components like ferrules and steel plates and ..., these components are generally face-based families which I put them manually on the wall, after creating the wall and all its attached components I create an assembly by selecting the wall and all its attached components. So the assembly origin that you see in the image is created automatically based on what Revit decide, I don't have any control over it. But after the assembly is created, I can select the assembly and rotate or move its origin.). So basically this is the issue: The assembly origin is placed automatically (based on Revit predefined orientation) as you see in the first image. If I create the front view based on this orientation (the green arrow in the first image), the people in the factory won't be able to understand how to create this wall unless I change the orientation of the origin to the second image (green arrow in the second image).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1035859"&gt;@RPTHOMAS108&lt;/a&gt;, Thank you for your time. I will definitely try this and keep you all posted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate everyone's help.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 23:02:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10079822#M28366</guid>
      <dc:creator>DavoudMWAWD</dc:creator>
      <dc:date>2021-02-12T23:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating the Assembly Origin</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10083111#M28367</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;So finally thanks to all of you I achieved what I wanted to do:&lt;/P&gt;&lt;P&gt;I slightly changed the code that&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1035859"&gt;@RPTHOMAS108&lt;/a&gt;&amp;nbsp;kindly wrote for me and it works fine. It was as&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8377999"&gt;@mhannonQ65N2&lt;/a&gt;&amp;nbsp; suggested, using Multiply was the key here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;Autodesk.Revit.DB &lt;SPAN&gt;import&lt;/SPAN&gt;*&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;Autodesk.Revit.UI.Selection &lt;SPAN&gt;import&lt;/SPAN&gt;*&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;sys&lt;BR /&gt;&lt;BR /&gt;uidoc = __revit__.ActiveUIDocument&lt;BR /&gt;doc = __revit__.ActiveUIDocument.Document&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;try&lt;/SPAN&gt;:&lt;BR /&gt;   ref = uidoc.Selection.PickObject(ObjectType.Face&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'Please Pick NF'&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;except &lt;/SPAN&gt;OperationCanceledException:&lt;BR /&gt;   sys.exit()&lt;BR /&gt;wall_from_ref = doc.GetElement(ref)&lt;BR /&gt;face = wall_from_ref.GetGeometryObjectFromReference(ref)&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#We could have selected the assembly itself from the start but I prefered to select the face&lt;BR /&gt;&lt;/SPAN&gt;assembly_instance_id = wall_from_ref.AssemblyInstanceId&lt;BR /&gt;assembly = doc.GetElement(assembly_instance_id)&lt;BR /&gt;&lt;BR /&gt;rotation = Transform.CreateRotation(XYZ.BasisZ&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;90&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;assembly_origin = assembly.GetTransform()&lt;BR /&gt;transform = assembly_origin.Multiply(rotation)&lt;BR /&gt;&lt;BR /&gt;t = Transaction(doc&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'ROTATION'&lt;/SPAN&gt;)&lt;BR /&gt;t.Start()&lt;BR /&gt;assembly.SetTransform(transform)&lt;BR /&gt;t.Commit()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I don't know how can I thank you people, but you really helped a lot.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 00:52:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rotating-the-assembly-origin/m-p/10083111#M28367</guid>
      <dc:creator>DavoudMWAWD</dc:creator>
      <dc:date>2021-02-15T00:52:08Z</dc:date>
    </item>
  </channel>
</rss>

