<?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: (API) Generating Persistent Labels for Structural Axis in Robot Structural Analysis Forum</title>
    <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-generating-persistent-labels-for-structural-axis/m-p/12504541#M4053</link>
    <description>&lt;P&gt;thank you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6876621"&gt;@Stephane.kapetanovic&lt;/a&gt;&amp;nbsp;, worked like a charm.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jan 2024 01:34:45 GMT</pubDate>
    <dc:creator>liam_mchale</dc:creator>
    <dc:date>2024-01-18T01:34:45Z</dc:date>
    <item>
      <title>(API) Generating Persistent Labels for Structural Axis</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-generating-persistent-labels-for-structural-axis/m-p/12502179#M4051</link>
      <description>&lt;P&gt;I am trying to define the Structural Axis for a 2D Frame. I want to assign labels at various X &amp;amp; Z axis positions which will be visible within the Structural Axis dialogue box.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With my current code, the structural axis is active upon opening the ROBOT file, and the defined labels are visible on import. However the labels are not 'loaded' into the Structural Axis dialogue. Additionally there is odd behaviour where the last label element of the Z-axis is being defined on a different basis (1-99) than the rest of the Z axis labels (A-Z).&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="Specific labels are not loaded into the structural axis dialogue box." style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1315154i40EBE93BE2929E6C/image-size/large?v=v2&amp;amp;px=999" role="button" title="StructuralAxisLabels.png" alt="Specific labels are not loaded into the structural axis dialogue box." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Specific labels are not loaded into the structural axis dialogue box.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;IRobotStructuralAxisGridMngr robotStructuralAxisGridMngr = _robotApplication.Project.AxisMngr;
            
IRobotStructuralAxisGridCartesian grid = (IRobotStructuralAxisGridCartesian)robotStructuralAxisGridMngr.Create(IRobotStructuralAxisGridType.I_SAGT_CARTESIAN, "Structure Axis");

grid.X.SetLabelFormat(IRobotStructuralAxisLabelType.I_SALT_123);
grid.Z.SetLabelFormat(IRobotStructuralAxisLabelType.I_SALT_ABC);

foreach(var label in structuralModel.labels.Z){ 
  grid.Z.AddSequence(label.SequenceDistance, 0);
  grid.Save();
}

foreach(var label in structuralModel.labels.X){
  grid.X.AddSequence(label.SequenceDistance, 0);
  grid.Save();
}

var gridIndex = robotStructuralAxisGridMngr.FindByName(grid.Name);
robotStructuralAxisGridMngr.Activate(gridIndex);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate any advice on how to achieve persistent import of Axis Labels &amp;amp; any other code improvements.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you and regards,&lt;/P&gt;&lt;P&gt;Liam McHale&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 15:27:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-generating-persistent-labels-for-structural-axis/m-p/12502179#M4051</guid>
      <dc:creator>liam_mchale</dc:creator>
      <dc:date>2024-01-17T15:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: (API) Generating Persistent Labels for Structural Axis</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-generating-persistent-labels-for-structural-axis/m-p/12502483#M4052</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14028522"&gt;@liam_mchale&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is a generic code for the forum that you can modify to suit your specific case.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using RobotOM;
using static RobotOM.IRobotStructuralAxisLabelType;
using static RobotOM.IRobotStructuralAxisGridType;
using static RobotOM.IRobotGeoCoordinateAxis;
using System;

namespace GridAxis
{
    internal class Program
    {
        static void Main()
        {
            RobotApplication RobApp = new RobotApplication();
            bool isVisible = RobApp.Visible == -1,
                  IsActive = RobApp.Project.IsActive == -1;
            if (!(isVisible &amp;amp;&amp;amp; IsActive)) { RobApp = null; return; }


            RobotStructuralAxisGridMngr AxisMngr = RobApp.Project.AxisMngr;
            RobotStructuralAxisGridCartesian AxisGrid;
            AxisGrid = (RobotStructuralAxisGridCartesian)AxisMngr.Create(I_SAGT_CARTESIAN, "my cartesian Axis");
            AxisGrid.IncludeStoreysInZ = true;
            AxisGrid.SetRelativeToPoint(true, 1, 1, 1);
            AxisGrid.RotationAxis = I_GCA_OZ;
            AxisGrid.RotationAngle = Math.PI / 6;

            RobotStructuralAxisSequenceList XAxis = AxisGrid.X,
                                            YAxis = AxisGrid.Y,
                                            ZAxis = AxisGrid.Z;

            XAxis.SetLabelFormat(I_SALT_123);
            foreach(double x in new double[] { 7.08, 6.35, 5.56, 3.57, 2.23 }) 
                XAxis.AddSequence(x, 1);

            YAxis.SetLabelFormat(I_SALT_ABC);
            YAxis.AddSequence(12.7, 2);
            YAxis.SetAxisLabel(1, "Existing Line A");

            ZAxis.SetLabelFormat(I_SALT_DEFINE, "Level_%+v");
            ZAxis.AddSequence(5, 1);
            ZAxis.AddSequence(1.5, 1);

            AxisGrid.Save();

            RobApp = null;
        }   
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Stephanekapetanovic_2-1705512295827.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1315235i4B785413D41DB298/image-size/large?v=v2&amp;amp;px=999" role="button" title="Stephanekapetanovic_2-1705512295827.png" alt="Stephanekapetanovic_2-1705512295827.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 17:25:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-generating-persistent-labels-for-structural-axis/m-p/12502483#M4052</guid>
      <dc:creator>Stephane.kapetanovic</dc:creator>
      <dc:date>2024-01-17T17:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: (API) Generating Persistent Labels for Structural Axis</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-generating-persistent-labels-for-structural-axis/m-p/12504541#M4053</link>
      <description>&lt;P&gt;thank you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6876621"&gt;@Stephane.kapetanovic&lt;/a&gt;&amp;nbsp;, worked like a charm.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 01:34:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-generating-persistent-labels-for-structural-axis/m-p/12504541#M4053</guid>
      <dc:creator>liam_mchale</dc:creator>
      <dc:date>2024-01-18T01:34:45Z</dc:date>
    </item>
  </channel>
</rss>

