<?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: Orient Two UCS together in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12091289#M21534</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13518190"&gt;@Andrii_Humeniuk&lt;/a&gt;,&amp;nbsp;Sadly this didn't work, what's happening is the PCS is getting disturbed and shifting to a new position where as the LCS is in the correct position but the inclination is still incorrect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Saikiran_arakeri_1-1688997284503.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1238569i095F2D1344BF454F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Saikiran_arakeri_1-1688997284503.png" alt="Saikiran_arakeri_1-1688997284503.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Red is the PCS here and Blue is the LCS&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jul 2023 13:56:29 GMT</pubDate>
    <dc:creator>Saikiran_arakeri</dc:creator>
    <dc:date>2023-07-10T13:56:29Z</dc:date>
    <item>
      <title>Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12085427#M21528</link>
      <description>&lt;P&gt;Hi, there are two UCS in this scenario, 1. Part-CS, 2. Local-CS. I am trying to orient the LCS with the PCS and incline them in the same orientation, I am doing this so that I can perform UCS to UCS constraint.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Saikiran_arakeri_0-1688706584188.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1237656i713301AD99EB5B29/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Saikiran_arakeri_0-1688706584188.png" alt="Saikiran_arakeri_0-1688706584188.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The axis marked in blacked are of PCS and the other is LCS, I created the LCS at the center point of the PCS, but I am not able to orient each other. Please help.&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13518190"&gt;@Andrii_Humeniuk&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7946284"&gt;@A.Acheson&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 05:12:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12085427#M21528</guid>
      <dc:creator>Saikiran_arakeri</dc:creator>
      <dc:date>2023-07-07T05:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12085469#M21529</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12225536"&gt;@Saikiran_arakeri&lt;/a&gt;&amp;nbsp;.&amp;nbsp;When you change the Local-CS coordinates, you need to run this code again.&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim oDoc As PartDocument = ThisDoc.Document
Dim oUCSs As UserCoordinateSystems = oDoc.ComponentDefinition.UserCoordinateSystems
Dim oLCS, oPCS As UserCoordinateSystem
Try : oLCS = oUCSs("Local-CS") : Catch : Exit Sub : End Try
Dim oOrigin, oXDirect, oYDirect As Inventor.Vertex
If oUCSs("Part-CS") IsNot Nothing Then
	oPCS = oUCSs("Part-CS")
	oPCS.Definition.Transformation = oLCS.Definition.Transformation
Else
	oPCS = oUCSs.Add(oLCS.Definition)
	oPCS.Name = "Part-CS"
End If&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 05:55:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12085469#M21529</guid>
      <dc:creator>Andrii_Humeniuk</dc:creator>
      <dc:date>2023-07-07T05:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12086069#M21530</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12225536"&gt;@Saikiran_arakeri&lt;/a&gt;.&amp;nbsp; Have you tried just creating that 'UCS to UCS' constraint, without aligning the two UCS's first?&amp;nbsp; Adding the constraint should automatically allign them for you when it is applied.&amp;nbsp; Since you mentioned adding a constraint, I assume then that these two UCS objects are in the context of an assembly, instead of both being within a single part, right?&amp;nbsp; The &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=e5189a51-4c90-4826-c10d-1c10959c2f57" target="_blank" rel="noopener"&gt;UCS to UCS type constraint&lt;/A&gt; is an iLogic only snippet, and basically created 3 different flush type constraints (&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=5782943b-2bc6-7b99-5adb-96d344862dfb" target="_blank" rel="noopener"&gt;Link&lt;/A&gt;, &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-FlushConstraint" target="_blank" rel="noopener"&gt;Link&lt;/A&gt;) for you, using the WorkPlanes of either the specified UCS objects, or the Origin of the component.&amp;nbsp; If you specify "Origin", instead of the name of a UCS, it will use the origin WorkPlanes of the component instead of a UCS's WorkPlanes.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 11:49:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12086069#M21530</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-07-07T11:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12087723#M21531</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;, I tried using the direct UCS to UCS constraint, but what happened was, it aligned the PCS with the LCS, now, the LCS is inclined with the default inclination when created, hence the inclination in which the part was placed is getting disturbed. I want it to work the other way around, which is, I want the LCS to align with the PCS so that the part inclination is retained.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jul 2023 06:28:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12087723#M21531</guid>
      <dc:creator>Saikiran_arakeri</dc:creator>
      <dc:date>2023-07-08T06:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12090304#M21532</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13518190"&gt;@Andrii_Humeniuk&lt;/a&gt;, Thank you so much, this worked perfectly.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 06:40:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12090304#M21532</guid>
      <dc:creator>Saikiran_arakeri</dc:creator>
      <dc:date>2023-07-10T06:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12091056#M21533</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12225536"&gt;@Saikiran_arakeri&lt;/a&gt;.&amp;nbsp; Have you tried simply reversing which UCS you specify first and which one you specify second when creating that UCS to UCS constraint.&amp;nbsp; There are many situations in Inventor where the order in which you select things makes all the difference.&amp;nbsp; When I manually create a UCS to UCS constraint by selecting the Assemble tool, then selecting UCS to UCS type, the first UCS I select is the one that will be moved to the position of the second UCS, as long as neither component is grounded (or otherwise constrained).&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 12:32:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12091056#M21533</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-07-10T12:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12091289#M21534</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13518190"&gt;@Andrii_Humeniuk&lt;/a&gt;,&amp;nbsp;Sadly this didn't work, what's happening is the PCS is getting disturbed and shifting to a new position where as the LCS is in the correct position but the inclination is still incorrect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Saikiran_arakeri_1-1688997284503.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1238569i095F2D1344BF454F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Saikiran_arakeri_1-1688997284503.png" alt="Saikiran_arakeri_1-1688997284503.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Red is the PCS here and Blue is the LCS&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 13:56:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12091289#M21534</guid>
      <dc:creator>Saikiran_arakeri</dc:creator>
      <dc:date>2023-07-10T13:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12091296#M21535</link>
      <description>Hey &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;, tried this as well, it didn't work.</description>
      <pubDate>Mon, 10 Jul 2023 13:59:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12091296#M21535</guid>
      <dc:creator>Saikiran_arakeri</dc:creator>
      <dc:date>2023-07-10T13:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12091428#M21536</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12225536"&gt;@Saikiran_arakeri&lt;/a&gt;.&amp;nbsp; As a test on my end, I created two parts that loosely look like a UCS, to make ethier orientation visibly obvious.&amp;nbsp; Then I created a UCS within each of those two nearly identical parts that was aligned with the origin planes of the parts.&amp;nbsp; Then I created a new assembly, and placed one of each of those two parts into the assembly, in different orientations.&amp;nbsp; Below is a screen capture of that assembly.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WCrihfield_2-1688999965048.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1238596iF967A8A9EC2B65DB/image-size/large?v=v2&amp;amp;px=999" role="button" title="WCrihfield_2-1688999965048.png" alt="WCrihfield_2-1688999965048.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;As you can see, both parts are identical, but have slightly different file names, and are in different orientations, and neither one has been grounded or constrained in any way yet.&amp;nbsp; And I have two internal iLogic rules there for creating the UCS to UCS constraint in the two different orders. My first couple tries, where both codes were just the one line of code, but in reversed order, they were working perfect, but then they stopped working as expected.&amp;nbsp; At first, one rule would cause the first part to align with the second perfectly, then the other rule would cause the second part to align with the first part perfectly, but then they both started acting the same (both were aligning the second part with the first part).&amp;nbsp; So, I slightly changed the second rule to first ground the component I did not want to move, then create the constraint, then update the document, then remove the grounded status, and that worked like a charm.&lt;/P&gt;
&lt;P&gt;Below are the contents of those two rules:&lt;/P&gt;
&lt;P&gt;Add UCS to UCS Constraint 1&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Constraints.AddUcsToUcs("UCS to UCS 1", "Coordinates Part:1", "UCS1", "Coordinates Part 2:2", "UCS1", 0, 0, 0)&lt;/LI-CODE&gt;
&lt;P&gt;Add UCS to UCS Constraint 2&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Component.InventorComponent("Coordinates Part 2:2").Grounded = True
Constraints.AddUcsToUcs("UCS to UCS 2", "Coordinates Part 2:2", "UCS1", "Coordinates Part:1", "UCS1", 0, 0, 0)
iLogicVb.DocumentUpdate
Component.InventorComponent("Coordinates Part 2:2").Grounded = False&lt;/LI-CODE&gt;
&lt;P&gt;When I run the first rule, this is the result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WCrihfield_1-1688998191969.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1238576i31C8E2B0262B5DBE/image-size/large?v=v2&amp;amp;px=999" role="button" title="WCrihfield_1-1688998191969.png" alt="WCrihfield_1-1688998191969.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then I undo what that rule did, and run the second rule, and this is the result of that second rule:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WCrihfield_3-1689000059455.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1238598i76192D54876DBA97/image-size/large?v=v2&amp;amp;px=999" role="button" title="WCrihfield_3-1689000059455.png" alt="WCrihfield_3-1689000059455.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So in this case, since this is sort of a compound constraint (actually creates 3 constraints, not just one), you simply have to ground (or otherwise fully constrain) the one you do not want to move first, then apply the constraint, then update the assembly (important), then remove the grounded state from the one component after the document has been updated.&amp;nbsp; If I left out the update step, it would not work right, and it would update the model after the rule was done (after the grounded state was removed), which would cause the second part to move, instead of the first part.&amp;nbsp; But this was the simplest way I found to do this process.&amp;nbsp; There are surely other ways to do this too, but this way just seems to require the least code, and takes advantage of the iLogic shortcut snippets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 14:47:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12091428#M21536</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-07-10T14:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12091923#M21537</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12225536"&gt;@Saikiran_arakeri&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think there may be limitations to moving the UCS in assembly. I can't as a user move the assembly UCS by dragging, only by redefining the feature, and manually created constraints won't let me move the UCS either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you use the transformation of the PCS and it's containing occurrence Transformation to create the assembly UCS, then you could constrain together without moving the Part:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;aDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt; = &lt;SPAN&gt;TryCast&lt;/SPAN&gt;(&lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;, &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt;)
&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;IsNothing&lt;/SPAN&gt;(&lt;SPAN&gt;aDoc&lt;/SPAN&gt;) &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;Logger&lt;/SPAN&gt;.&lt;SPAN&gt;Debug&lt;/SPAN&gt;(&lt;SPAN&gt;"Not Run In Assembly Document"&lt;/SPAN&gt;) : &lt;SPAN&gt;Exit&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;PickUCS&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Object&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN&gt;Pick&lt;/SPAN&gt;(&lt;SPAN&gt;SelectionFilterEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kUserCoordinateSystemFilter&lt;/SPAN&gt;, &lt;SPAN&gt;"Select UCS create aligned in assembly"&lt;/SPAN&gt;)
&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;IsNothing&lt;/SPAN&gt;(&lt;SPAN&gt;PickUCS&lt;/SPAN&gt;) &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;Exit&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;' If nothing gets selected then we're done&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;TransformMatrix&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Matrix&lt;/SPAN&gt; = &lt;SPAN&gt;PickUCS&lt;/SPAN&gt;.&lt;SPAN&gt;Transformation&lt;/SPAN&gt;.&lt;SPAN&gt;Copy&lt;/SPAN&gt;

&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;PickUCS&lt;/SPAN&gt;.&lt;SPAN&gt;Type&lt;/SPAN&gt; = &lt;SPAN&gt;ObjectTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kUserCoordinateSystemProxyObject&lt;/SPAN&gt;
	&lt;SPAN&gt;TransformMatrix&lt;/SPAN&gt;.&lt;SPAN&gt;TransformBy&lt;/SPAN&gt;(&lt;SPAN&gt;PickUCS&lt;/SPAN&gt;.&lt;SPAN&gt;ContainingOccurrence&lt;/SPAN&gt;.&lt;SPAN&gt;Transformation&lt;/SPAN&gt;)
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;UCSdef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;UserCoordinateSystemDefinition&lt;/SPAN&gt; = &lt;SPAN&gt;aDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;UserCoordinateSystems&lt;/SPAN&gt;.&lt;SPAN&gt;CreateDefinition&lt;/SPAN&gt;

&lt;SPAN&gt;UCSdef&lt;/SPAN&gt;.&lt;SPAN&gt;Transformation&lt;/SPAN&gt; = &lt;SPAN&gt;TransformMatrix&lt;/SPAN&gt;

&lt;SPAN&gt;aDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;UserCoordinateSystems&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;UCSdef&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;or you could transform an already created assembly UCS to the part UCS before constraining:&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;Dim aDoc As AssemblyDocument = TryCast(ThisApplication.ActiveDocument, AssemblyDocument)
If IsNothing(aDoc) Then Logger.Debug("Not Run In Assembly Document") : Exit Sub

Dim PickUCS As UserCoordinateSystem = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kUserCoordinateSystemFilter, "Select UCS to move")
If IsNothing(PickUCS) Then Exit Sub ' If nothing gets selected then we're done

Dim PickUCStarget As UserCoordinateSystem = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kUserCoordinateSystemFilter, "Select UCS to set Position")
If IsNothing(PickUCStarget) Then Exit Sub ' If nothing gets selected then we're done

Dim TransformMatrix As Matrix = PickUCStarget.Transformation.Copy

If PickUCStarget.Type = ObjectTypeEnum.kUserCoordinateSystemProxyObject
	TransformMatrix.TransformBy(PickUCStarget.ContainingOccurrence.Transformation)
End If

PickUCS.Transformation = TransformMatrix&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 18:41:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12091923#M21537</guid>
      <dc:creator>J-Camper</dc:creator>
      <dc:date>2023-07-10T18:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12092786#M21538</link>
      <description>&lt;P&gt;Hey &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4898893"&gt;@J-Camper&lt;/a&gt;, tried both the approaches, sadly again it didn't work, I faced the same situation that I posted about here: &lt;A href="https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/orient-two-ucs-together/m-p/12091289#M154980" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/orient-two-ucs-together/m-p/12091289#M154980&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 05:40:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12092786#M21538</guid>
      <dc:creator>Saikiran_arakeri</dc:creator>
      <dc:date>2023-07-11T05:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12092801#M21539</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7812054"&gt;@WCrihfield&lt;/a&gt;, any idea of doing this&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/orient-two-ucs-together/m-p/12091428#M154987" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/orient-two-ucs-together/m-p/12091428#M154987&lt;/A&gt;&amp;nbsp;in C#?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand what you explained, thank you so much for that, I'm not able to do it code-vise, my UCS is orienting in the default way.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 05:52:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12092801#M21539</guid>
      <dc:creator>Saikiran_arakeri</dc:creator>
      <dc:date>2023-07-11T05:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12093000#M21540</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12225536"&gt;@Saikiran_arakeri&lt;/a&gt;&amp;nbsp;.&amp;nbsp;If I understand you correctly, you want to create constraints of the LCS that is in the assembly between the PCS that is in the part. If so, here is the code (iLogic):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Sub main
	Dim oDoc As Document = ThisDoc.Document
	If Not TypeOf oDoc Is AssemblyDocument Then Exit Sub
	Dim oAsmDoc As AssemblyDocument = oDoc
	Dim oAsmDef As AssemblyComponentDefinition = oAsmDoc.ComponentDefinition
	Dim oUCSs As UserCoordinateSystems = oAsmDef.UserCoordinateSystems
	Dim oLCS, oPCS As UserCoordinateSystem
	Try : oLCS = oUCSs("Local-CS") : Catch : Exit Sub : End Try
	Dim oCM As CommandManager = ThisApplication.CommandManager
	Dim oOcc As ComponentOccurrence
	oOcc = oCM.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, "Select your part with 'Part-CS'")
	If oOcc Is Nothing Then Exit Sub
	If oOcc.DefinitionDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kPartDocumentObject Then Exit Sub
	Dim oOccDef As PartComponentDefinition = oOcc.Definition
	Try : oPCS = oOccDef.UserCoordinateSystems("Part-CS") : Catch : Exit Sub : End Try
	If oOcc.Constraints("(X)LCS to PCS") IsNot Nothing Then oOcc.Constraints("(X)LCS to PCS").Delete()
	If oOcc.Constraints("(Y)LCS to PCS") IsNot Nothing Then oOcc.Constraints("(Y)LCS to PCS").Delete()
	If oOcc.Constraints("(Z)LCS to PCS") IsNot Nothing Then oOcc.Constraints("(Z)LCS to PCS").Delete()
	Dim oCnTr As AssemblyConstraints = oAsmDef.Constraints
	Dim proxyXAxis, proxyYAxis, proxyZAxis As WorkAxisProxy
	Call oOcc.CreateGeometryProxy(oPCS.XAxis, proxyXAxis)
	Call oOcc.CreateGeometryProxy(oPCS.YAxis, proxyYAxis)
	Call oOcc.CreateGeometryProxy(oPCS.ZAxis, proxyZAxis)
	Dim oMateX, oMateY, oMateZ As MateConstraint
	oMateX = oCnTr.AddMateConstraint(proxyXAxis, oLCS.XAxis, 0) : oMateX.Name = "(X)LCS to PCS"
	oMateY = oCnTr.AddMateConstraint(proxyYAxis, oLCS.YAxis, 0) : oMateY.Name = "(Y)LCS to PCS"
	oMateZ = oCnTr.AddMateConstraint(proxyZAxis, oLCS.ZAxis, 0) : oMateZ.Name = "(Z)LCS to PCS"
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;If my guess is wrong, please explain your situation fully, thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 07:51:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12093000#M21540</guid>
      <dc:creator>Andrii_Humeniuk</dc:creator>
      <dc:date>2023-07-11T07:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12093260#M21541</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13518190"&gt;@Andrii_Humeniuk&lt;/a&gt;, so, here's what's happening. I have an assembly where in there is a component that has it's own UCS, let's call it PCS (Part-CS). This is inclined in some way. I have to create a new UCS, let's call it LCS (Local-CS) in the assembly at the exact same location where PCS is and orient it in the same way as well. I am orienting it in the same way as only then the UCS to UCS constraint is possible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Saikiran_arakeri_0-1689063816520.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1238881iD82A7E25D604A71E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Saikiran_arakeri_0-1689063816520.png" alt="Saikiran_arakeri_0-1689063816520.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see here, there is a part that has it's own PCS. I have created a LCS in the assembly at the exact same location. Now, I am struggling to orient it the same way as PCS. The axis marked in black here is of LCS and the other PCS. The UCS in the left bottom is the Global-CS.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 09:58:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12093260#M21541</guid>
      <dc:creator>Saikiran_arakeri</dc:creator>
      <dc:date>2023-07-11T09:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12093296#M21542</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13518190"&gt;@Andrii_Humeniuk&lt;/a&gt;, tried the solution that you gave, instead of inclining LCS with the PCS, PCS is getting inclined with the LCS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the part in the assembly before running the code&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Saikiran_arakeri_0-1689070201019.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1238924i8C26807419FDD861/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Saikiran_arakeri_0-1689070201019.png" alt="Saikiran_arakeri_0-1689070201019.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the part in the assembly after running the code&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Saikiran_arakeri_1-1689070261861.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1238925iF3E9C85331ADC065/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Saikiran_arakeri_1-1689070261861.png" alt="Saikiran_arakeri_1-1689070261861.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 10:11:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12093296#M21542</guid>
      <dc:creator>Saikiran_arakeri</dc:creator>
      <dc:date>2023-07-11T10:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12093307#M21543</link>
      <description>&lt;P&gt;Try this code:&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Sub main
	Dim oDoc As Document = ThisDoc.Document
	If Not TypeOf oDoc Is AssemblyDocument Then Exit Sub
	Dim oAsmDoc As AssemblyDocument = oDoc
	Dim oAsmDef As AssemblyComponentDefinition = oAsmDoc.ComponentDefinition
	Dim oUCSs As UserCoordinateSystems = oAsmDef.UserCoordinateSystems
	Dim oLCS, oPCS As UserCoordinateSystem
	Dim oCM As CommandManager = ThisApplication.CommandManager
	Dim oOcc As ComponentOccurrence
	oOcc = oCM.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, "Select your part with 'Part-CS'")
	If oOcc Is Nothing Then Exit Sub
	If oOcc.DefinitionDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kPartDocumentObject Then Exit Sub
	Dim oOccDef As PartComponentDefinition = oOcc.Definition
	Try : oPCS = oOccDef.UserCoordinateSystems("Part-CS") : Catch : Exit Sub : End Try
	Try : oLCS = oUCSs("Local-CS")
	Catch
		Dim oUCSDef As UserCoordinateSystemDefinition = oUCSs.CreateDefinition()
		oUCSDef.Transformation = oPCS.Transformation
		oLCS = oUCSs.Add(oUCSDef)
		oLCS.Name = "Local-CS"
	End Try
	If oOcc.Constraints.Count &amp;gt; 0 Then
		If oOcc.Constraints("(X)LCS to PCS") IsNot Nothing Then oOcc.Constraints("(X)LCS to PCS").Delete()
		If oOcc.Constraints("(Y)LCS to PCS") IsNot Nothing Then oOcc.Constraints("(Y)LCS to PCS").Delete()
		If oOcc.Constraints("(Z)LCS to PCS") IsNot Nothing Then oOcc.Constraints("(Z)LCS to PCS").Delete()
	End If
	Dim oCnTr As AssemblyConstraints = oAsmDef.Constraints
	Dim proxyXAxis, proxyYAxis, proxyZAxis As WorkAxisProxy
	Call oOcc.CreateGeometryProxy(oPCS.XAxis, proxyXAxis)
	Call oOcc.CreateGeometryProxy(oPCS.YAxis, proxyYAxis)
	Call oOcc.CreateGeometryProxy(oPCS.ZAxis, proxyZAxis)
	Dim oMateX, oMateY, oMateZ As MateConstraint
	oMateX = oCnTr.AddMateConstraint(proxyXAxis, oLCS.XAxis, 0) : oMateX.Name = "(X)LCS to PCS"
	oMateY = oCnTr.AddMateConstraint(proxyYAxis, oLCS.YAxis, 0) : oMateY.Name = "(Y)LCS to PCS"
	oMateZ = oCnTr.AddMateConstraint(proxyZAxis, oLCS.ZAxis, 0) : oMateZ.Name = "(Z)LCS to PCS"
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Remember, if your component has no Constraints, then both the component and the Local-CS will be movable in the assembly.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 10:19:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12093307#M21543</guid>
      <dc:creator>Andrii_Humeniuk</dc:creator>
      <dc:date>2023-07-11T10:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12093321#M21544</link>
      <description>&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6330977315112w998h540r532" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6330977315112" data-account="6057940548001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6057940548001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6330977315112w998h540r532');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://forums.autodesk.com/t5/video/gallerypage/video-id/6330977315112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you can see what's happening here. The part is not constrained nor grounded.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 10:29:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12093321#M21544</guid>
      <dc:creator>Saikiran_arakeri</dc:creator>
      <dc:date>2023-07-11T10:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12093665#M21545</link>
      <description>&lt;P&gt;I hope this is exactly what you need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Sub main
	Dim oDoc As Document = ThisDoc.Document
	If Not TypeOf oDoc Is AssemblyDocument Then Exit Sub
	Dim oAsmDoc As AssemblyDocument = oDoc
	Dim oAsmDef As AssemblyComponentDefinition = oAsmDoc.ComponentDefinition
	Dim oUCSs As UserCoordinateSystems = oAsmDef.UserCoordinateSystems
	Dim oLCS, oPCS As UserCoordinateSystem
	Dim oCM As CommandManager = ThisApplication.CommandManager
	Dim oOcc As ComponentOccurrence
	oOcc = oCM.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, "Select your part with 'Part-CS'")
	If oOcc Is Nothing Then Exit Sub
	If oOcc.DefinitionDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kPartDocumentObject Then Exit Sub
	Dim oOccDef As PartComponentDefinition = oOcc.Definition
	Try : oPCS = oOccDef.UserCoordinateSystems("Part-CS") : Catch : Exit Sub : End Try
	Try : oLCS = oUCSs("Local-CS") : Catch : End Try
	If oOcc.Constraints.Count &amp;gt; 0 Then
		Try : oOcc.Constraints("(X)LCS to PCS").Delete() : Catch : End Try
		Try : oOcc.Constraints("(Y)LCS to PCS").Delete() : Catch : End Try
		Try : oOcc.Constraints("(Z)LCS to PCS").Delete() : Catch : End Try
	End If
	If oLCS IsNot Nothing Then oLCS.Delete()
	
	Dim proxyXAxis, proxyYAxis, proxyZAxis As WorkAxisProxy
	Dim proxyPoint As WorkPointProxy
	Call oOcc.CreateGeometryProxy(oPCS.XAxis, proxyXAxis)
	Call oOcc.CreateGeometryProxy(oPCS.YAxis, proxyYAxis)
	Call oOcc.CreateGeometryProxy(oPCS.ZAxis, proxyZAxis)
	Call oOcc.CreateGeometryProxy(oPCS.Origin, proxyPoint)
	Dim oUCSDef As UserCoordinateSystemDefinition = oUCSs.CreateDefinition()
	oUCSDef.Transformation.SetCoordinateSystem(proxyPoint.Point, _
											   proxyXAxis.Line.Direction.AsVector, _
											   proxyYAxis.Line.Direction.AsVector, _
											   proxyZAxis.Line.Direction.AsVector)
	oLCS = oUCSs.Add(oUCSDef)
	oLCS.Name = "Local-CS"
	
	Dim oCnTr As AssemblyConstraints = oAsmDef.Constraints
	Dim oMateX, oMateY, oMateZ As MateConstraint
	oMateX = oCnTr.AddMateConstraint(proxyXAxis, oLCS.XAxis, 0) : oMateX.Name = "(X)LCS to PCS"
	oMateY = oCnTr.AddMateConstraint(proxyYAxis, oLCS.YAxis, 0) : oMateY.Name = "(Y)LCS to PCS"
	oMateZ = oCnTr.AddMateConstraint(proxyZAxis, oLCS.ZAxis, 0) : oMateZ.Name = "(Z)LCS to PCS"
End Sub&lt;/LI-CODE&gt;&lt;P&gt;Or:&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Sub main
	Dim oDoc As Document = ThisDoc.Document
	If Not TypeOf oDoc Is AssemblyDocument Then Exit Sub
	Dim oAsmDoc As AssemblyDocument = oDoc
	Dim oAsmDef As AssemblyComponentDefinition = oAsmDoc.ComponentDefinition
	Dim oUCSs As UserCoordinateSystems = oAsmDef.UserCoordinateSystems
	Dim oLCS, oPCS As UserCoordinateSystem
	Dim oCM As CommandManager = ThisApplication.CommandManager
	Dim oMatrix As Matrix = ThisApplication.TransientGeometry.CreateMatrix
	Dim oOcc As ComponentOccurrence
	oOcc = oCM.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, "Select your part with 'Part-CS'")
	If oOcc Is Nothing Then Exit Sub
	If oOcc.DefinitionDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kPartDocumentObject Then Exit Sub
	Dim oOccDef As PartComponentDefinition = oOcc.Definition
	Try : oPCS = oOccDef.UserCoordinateSystems("Part-CS") : Catch : Exit Sub : End Try
	Dim proxyXAxis, proxyYAxis, proxyZAxis As WorkAxisProxy
	Dim proxyPoint As WorkPointProxy
	Call oOcc.CreateGeometryProxy(oPCS.XAxis, proxyXAxis)
	Call oOcc.CreateGeometryProxy(oPCS.YAxis, proxyYAxis)
	Call oOcc.CreateGeometryProxy(oPCS.ZAxis, proxyZAxis)
	Call oOcc.CreateGeometryProxy(oPCS.Origin, proxyPoint)
	Try 
		oLCS = oUCSs("Local-CS")
		oMatrix.SetCoordinateSystem(proxyPoint.Point, _
												   proxyXAxis.Line.Direction.AsVector, _
												   proxyYAxis.Line.Direction.AsVector, _
												   proxyZAxis.Line.Direction.AsVector)
		oLCS.Transformation = oMatrix
	Catch
		Dim oUCSDef As UserCoordinateSystemDefinition = oUCSs.CreateDefinition()
		oUCSDef.Transformation.SetCoordinateSystem(proxyPoint.Point, _
												   proxyXAxis.Line.Direction.AsVector, _
												   proxyYAxis.Line.Direction.AsVector, _
												   proxyZAxis.Line.Direction.AsVector)
		oLCS = oUCSs.Add(oUCSDef)
		oLCS.Name = "Local-CS"
	End Try	
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 13:14:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12093665#M21545</guid>
      <dc:creator>Andrii_Humeniuk</dc:creator>
      <dc:date>2023-07-11T13:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12093671#M21546</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12225536"&gt;@Saikiran_arakeri&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is weird that the part would move after aligning the UCSs, I would expect it shouldn't want to move while adding Flush constraints to matching planes with no offset.&amp;nbsp; It seems like the assembly UCS wasn't actually getting aligned before constraints were added if you are still getting the issue you stated before.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The assembly UCS will never yield to the part UCS, so we need to fully align the 2 before making the constraints if you want to preserve the part's transformation.&amp;nbsp; If UCSs moved with constraints it would defeat their purpose.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you share your test assembly?&amp;nbsp; Maybe there is something going on that i can't reproduce on my own.&amp;nbsp; I only tested a part occurrence in and assembly, is your part in a deeper level than that?&amp;nbsp; It might need more transforms to get the UCSs to align.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 13:04:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12093671#M21546</guid>
      <dc:creator>J-Camper</dc:creator>
      <dc:date>2023-07-11T13:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: Orient Two UCS together</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12093715#M21547</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12225536"&gt;@Saikiran_arakeri&lt;/a&gt;.&amp;nbsp; Once you create the UCS within the context of the assembly, and get it in the same position and orientation as the UCS that is within the part type component, what do you intent to do at that point?&amp;nbsp; Both the component and the UCS that you created within the assembly would both still be unconstrained.&amp;nbsp; Do you intend to create a constraint between the UCS within the part, and the UCS that you created in the assembly?&amp;nbsp; If so, that still would not solve anything, because they would both still be fully movable in every way.&amp;nbsp; One of the two objects simply needs to be constrained in some other way before constraining one to the other, or some unexpected movement is bound to happen on either side.&amp;nbsp; Maybe once you get the UCS that you created within the assembly into position &amp;amp; orientation of the one in the part, you then need to somehow inspect the position and orientation of that UCS that you created within the assembly, and use those measurements to constrain it relative to the assembly's native origin WorkPlanes.&amp;nbsp; Then once that is done, create the UCS to UCS constraint between that UCS, and the one in the part.&amp;nbsp; That way the one you created in the assembly will not be able to move when you create the constraints between them.&amp;nbsp; Do you understand what I am talking about here?&lt;/P&gt;
&lt;P&gt;It would be pretty simple to simply create a new UCS in the assembly that is in the same position and orientation as the one in the part, but a UCS is just like a newly added component in some ways, because it too needs to be constrained to keep it from moving, and constraining it to an unconstrained component does not solve anything yet.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 13:16:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/orient-two-ucs-together/m-p/12093715#M21547</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-07-11T13:16:18Z</dc:date>
    </item>
  </channel>
</rss>

