<?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: Changing an assembly fixed workplane name does not show up in 3D in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-an-assembly-fixed-workplane-name-does-not-show-up-in-3d/m-p/10422958#M125888</link>
    <description>&lt;P&gt;im no good with c++ (i guess that this is c++) and i can reproduce the problem, but often when i run in this kind of problems a update helps. In iLogic it would look like this:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;doc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Document&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;doc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Update2&lt;/SPAN&gt;()&lt;/PRE&gt;</description>
    <pubDate>Sat, 26 Jun 2021 19:05:11 GMT</pubDate>
    <dc:creator>JelteDeJong</dc:creator>
    <dc:date>2021-06-26T19:05:11Z</dc:date>
    <item>
      <title>Changing an assembly fixed workplane name does not show up in 3D</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-an-assembly-fixed-workplane-name-does-not-show-up-in-3d/m-p/10422729#M125887</link>
      <description>&lt;P&gt;I've written some code to add fixed workplanes in an assembly, offset from one of the std workplanes of that assembly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the end of the function I change the name of the workplane, I can see the name change in the browser, but not in the 3D View. And when I get the name in the code just to check I correctly get the newly changed name.&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="oransen_0-1624723153990.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/934820i297752759CF27B71/image-size/large?v=v2&amp;amp;px=999" role="button" title="oransen_0-1624723153990.png" alt="oransen_0-1624723153990.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this a bug or am I doing something wrong? Here is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;bool AddFixedWorkPlaneInAsm (CComPtr&amp;lt;AssemblyComponentDefinition&amp;gt;&amp;amp; pAsmCompDef,  // where the plane will be added
                             const int ikPlaneIdx, // Which of the standard planes to base the new one on
                             const double kOffsetMm, // Offset,
                             const wchar_t* const pszPlaneName)    // Name of the newly created plane
{
    gLogger.Printf (ekLogMsg,L"AFWPIA %d &amp;lt;%s&amp;gt; starting",ikPlaneIdx,pszPlaneName) ;
    // Get WorkPlanes
    CComPtr&amp;lt;WorkPlanes&amp;gt; pWorkPlanes ;
    HRESULT hRes = pAsmCompDef-&amp;gt;get_WorkPlanes(&amp;amp;pWorkPlanes);
    if (FAILED(hRes)) {
        ShowCOMError (hRes,L"AFWPIA, get_WorkPlanes failed") ;
        return false ;
    }

    // Get hold of one of the WorkPlanes. Valid indices are 1 2 3 for standard workplanes
    CComPtr&amp;lt;WorkPlane&amp;gt; pAsmStdWorkPlane ;
    hRes = pWorkPlanes-&amp;gt;get_Item(CComVariant(ikPlaneIdx),&amp;amp;pAsmStdWorkPlane);
    if (FAILED(hRes) || (pAsmStdWorkPlane==nullptr)) {
        ShowCOMError (hRes,L"AFWPIA, get_Item (workplane %d) failed",ikPlaneIdx) ;
        return false ;
    }

    // Get the standard plane to use as a base for the offset plane
    PlanePtr ThePlane = pAsmStdWorkPlane-&amp;gt;GetPlane() ;
    PointPtr StdPlaneOrigin = ThePlane-&amp;gt;RootPoint ;

    CComPtr&amp;lt;TransientGeometry&amp;gt; pTransGeo = GetTransGeomPtr () ;    

    // Internally Inventor always uses cm, so convert...
    const double kOffsetInCm = kOffsetMm/10.0 ;

    CComPtr&amp;lt;Point&amp;gt; pOrigin ;
    hRes = pTransGeom-&amp;gt;CreatePoint (StdPlaneOrigin-&amp;gt;X,StdPlaneOrigin-&amp;gt;Y,StdPlaneOrigin-&amp;gt;Z,&amp;amp;pOrigin);
    if (FAILED(hRes) || (pOrigin == nullptr)) {
        ShowCOMError (hRes,L"AFWPIA, could not create origin point") ;
        return false ;
    }

    CComPtr&amp;lt;UnitVector&amp;gt; uVector;
    CComPtr&amp;lt;UnitVector&amp;gt; vVector;
    switch (ikPlaneIdx) {
        case gikXYPlaneIndex :
            pTransGeo-&amp;gt;CreateUnitVector (1.0, 0.0, 0.0, &amp;amp;uVector) ;
            pTransGeo-&amp;gt;CreateUnitVector (0.0, 1.0, 0.0, &amp;amp;vVector) ;
            pOrigin-&amp;gt;PutZ (kOffsetInCm) ;
            break ;

        case gikXZPlaneIndex :
            pTransGeo-&amp;gt;CreateUnitVector (1.0, 0.0, 0.0, &amp;amp;uVector) ;
            pTransGeo-&amp;gt;CreateUnitVector (0.0, 0.0, 1.0, &amp;amp;vVector) ;
            pOrigin-&amp;gt;PutY (kOffsetInCm) ;
            break ;

        case gikYZPlaneIndex :
            pTransGeo-&amp;gt;CreateUnitVector (0.0, 1.0, 0.0, &amp;amp;uVector) ;
            pTransGeo-&amp;gt;CreateUnitVector (0.0, 0.0, 1.0, &amp;amp;vVector) ;
            pOrigin-&amp;gt;PutX (kOffsetInCm) ;
            break ;

        default :
            gLogger.Printf (ekErrMsg,L"AFWPIA unhandled index:%d", ikPlaneIdx) ;
            // Do something anyway...
            pTransGeo-&amp;gt;CreateUnitVector (1.0, 0.0, 0.0, &amp;amp;uVector) ;
            pTransGeo-&amp;gt;CreateUnitVector (0.0, 1.0, 0.0, &amp;amp;vVector) ;
            pOrigin-&amp;gt;PutZ (kOffsetInCm) ;
            break ;
    }

    CComPtr&amp;lt;WorkPlane&amp;gt; pOffsetWorkPlane;
    hRes = pWorkPlanes-&amp;gt;AddFixed(pOrigin,uVector,vVector, VARIANT_FALSE,&amp;amp;pOffsetWorkPlane);
    if (FAILED(hRes) || pOffsetWorkPlane == nullptr) { 
        ShowCOMError (hRes,L"AFWPIA, Could not AddFixed plane %d",ikPlaneIdx) ;
        return false ;
    }
    
    CComBSTR bstrName = CString (pszPlaneName) ;
    hRes = pOffsetWorkPlane-&amp;gt;put_Name (bstrName) ;
    if (FAILED(hRes)) { 
        ShowCOMError (hRes,L"AFWPIA, Could not set plane name") ;
        return false ;
    }

    CComBSTR bstrNameTest ;
    pOffsetWorkPlane-&amp;gt;get_Name (&amp;amp;bstrNameTest) ;

    gLogger.Printf (ekLogMsg,L"AFWPIA &amp;lt;%s&amp;gt; &amp;lt;%s&amp;gt; ending ok",pszPlaneName,(LPWSTR)bstrNameTest) ;

    return true ;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Follow pszPlaneName in the code above to see what I do...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Jun 2021 16:01:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-an-assembly-fixed-workplane-name-does-not-show-up-in-3d/m-p/10422729#M125887</guid>
      <dc:creator>oransen</dc:creator>
      <dc:date>2021-06-26T16:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Changing an assembly fixed workplane name does not show up in 3D</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-an-assembly-fixed-workplane-name-does-not-show-up-in-3d/m-p/10422958#M125888</link>
      <description>&lt;P&gt;im no good with c++ (i guess that this is c++) and i can reproduce the problem, but often when i run in this kind of problems a update helps. In iLogic it would look like this:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;doc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Document&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Document&lt;/SPAN&gt;
&lt;SPAN style="color: #800000;"&gt;doc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Update2&lt;/SPAN&gt;()&lt;/PRE&gt;</description>
      <pubDate>Sat, 26 Jun 2021 19:05:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-an-assembly-fixed-workplane-name-does-not-show-up-in-3d/m-p/10422958#M125888</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2021-06-26T19:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Changing an assembly fixed workplane name does not show up in 3D</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-an-assembly-fixed-workplane-name-does-not-show-up-in-3d/m-p/10423600#M125897</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;,&amp;nbsp; the update icon is not showing and even if I save and reopen the file it remains with two different names...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Jun 2021 05:10:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-an-assembly-fixed-workplane-name-does-not-show-up-in-3d/m-p/10423600#M125897</guid>
      <dc:creator>oransen</dc:creator>
      <dc:date>2021-06-27T05:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Changing an assembly fixed workplane name does not show up in 3D</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-an-assembly-fixed-workplane-name-does-not-show-up-in-3d/m-p/10425409#M125907</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;, I tried the Update, but no change.&amp;nbsp; &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@F462EEC827775DA92CB03B7FC147D389/emoticons/1f61e.png" alt=":disappointed_face:" title=":disappointed_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 07:20:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-an-assembly-fixed-workplane-name-does-not-show-up-in-3d/m-p/10425409#M125907</guid>
      <dc:creator>oransen</dc:creator>
      <dc:date>2021-06-28T07:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Changing an assembly fixed workplane name does not show up in 3D</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-an-assembly-fixed-workplane-name-does-not-show-up-in-3d/m-p/10438163#M126074</link>
      <description>&lt;P&gt;Is this a bug in Inventor?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 09:57:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-an-assembly-fixed-workplane-name-does-not-show-up-in-3d/m-p/10438163#M126074</guid>
      <dc:creator>oransen</dc:creator>
      <dc:date>2021-07-02T09:57:07Z</dc:date>
    </item>
  </channel>
</rss>

