<?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: project units in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/project-units/m-p/7156945#M57699</link>
    <description>&lt;P&gt;here is an update&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i think i figure it out &amp;nbsp;(working on Revit 2015)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;document.ActiveProjectLocation&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;return EastWest and NorthSouth only if the Project Base Point was moved cliped&lt;/P&gt;
&lt;P&gt;it will returns the origin point (0, 0, 0) if the Project Base Point was moved unclipped&lt;/P&gt;
&lt;P&gt;is this a bug? or that's how it works?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;another issue is:&lt;/P&gt;
&lt;P&gt;formatoptions.DisplayUnits = units.GetFormatOptions(UnitType.UT_Length).DisplayUnits;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this return DUT_MILIMETERS even if the project units is in CM or Meter&lt;/P&gt;
&lt;P&gt;again is this a known bug?&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>Fri, 16 Jun 2017 09:53:29 GMT</pubDate>
    <dc:creator>Moshe-A</dc:creator>
    <dc:date>2017-06-16T09:53:29Z</dc:date>
    <item>
      <title>project units</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/project-units/m-p/7155940#M57697</link>
      <description>&lt;P&gt;Guys Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i am retrieving the Project Base Point and i would like to format it&amp;nbsp;&lt;SPAN&gt;according to the current Project Units&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;here is my simple code:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;namespace MyNameSpace
{
    public class Command : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            Document document = commandData.Application.ActiveUIDocument.Document;
            ProjectLocation projectlocation = document.ActiveProjectLocation;

            XYZ origin = new XYZ(0, 0, 0);
            ProjectLocation position = projectlocation.get_ProjectPosition(origin);
            double angle = position.Angle;
            double eastWest = position.EastWest;
            double northSouth = position.NorthSouth;

            Units units = new Units(UnitSystem.Metric);

            FormatValueOptions formatvalueoptions = new FormatValueOptions();
            FormatOptions formatoptions = new FormatOptions();
            formatoptions = units.GetFormatOptions(UnitType.UT_Length);
            formatvalueoptions.SetFormatOptions(formatoptions);

            string s1 = UnitFormatUtils.Format(document.GetUnits(), Autodesk.Revit.DB.UnitType.UT_Length, eastWest, false,   false, formatvalueoptions);
            string s2 = UnitFormatUtils.Format(document.GetUnits(), Autodesk.Revit.DB.UnitType.UT_Length, northSouth, false, false, formatvalueoptions);

            return Autodesk.Revit.UI.Result.Succeeded;
        }
    }
}&lt;/PRE&gt;
&lt;PRE&gt;Units units = new Units(UnitSystem.Metric);&lt;BR /&gt;can i get the UnitSystem from the project?&lt;BR /&gt;&lt;BR /&gt;s1 + s2 are set to be "0", what am i doing wrong?&lt;BR /&gt;(i do not want to set each FormatOptions properties, i would like them to inherit from Units)&lt;BR /&gt;&lt;BR /&gt;if there is another way to do this?&lt;BR /&gt;&lt;BR /&gt;thanks in advance&lt;BR /&gt;Moshe&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 21:06:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/project-units/m-p/7155940#M57697</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2017-06-15T21:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: project units</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/project-units/m-p/7156580#M57698</link>
      <description>&lt;P&gt;Good Morning,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;forgot to mention...i did moved the Project Base Point from Survey Point/Startup Point&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>Fri, 16 Jun 2017 05:08:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/project-units/m-p/7156580#M57698</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2017-06-16T05:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: project units</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/project-units/m-p/7156945#M57699</link>
      <description>&lt;P&gt;here is an update&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i think i figure it out &amp;nbsp;(working on Revit 2015)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;document.ActiveProjectLocation&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;return EastWest and NorthSouth only if the Project Base Point was moved cliped&lt;/P&gt;
&lt;P&gt;it will returns the origin point (0, 0, 0) if the Project Base Point was moved unclipped&lt;/P&gt;
&lt;P&gt;is this a bug? or that's how it works?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;another issue is:&lt;/P&gt;
&lt;P&gt;formatoptions.DisplayUnits = units.GetFormatOptions(UnitType.UT_Length).DisplayUnits;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this return DUT_MILIMETERS even if the project units is in CM or Meter&lt;/P&gt;
&lt;P&gt;again is this a known bug?&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>Fri, 16 Jun 2017 09:53:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/project-units/m-p/7156945#M57699</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2017-06-16T09:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: project units</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/project-units/m-p/7160965#M57700</link>
      <description>&lt;P&gt;for projectunits try:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Units units=&amp;nbsp;document.&lt;SPAN&gt;GetUnits&lt;/SPAN&gt;();&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 09:06:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/project-units/m-p/7160965#M57700</guid>
      <dc:creator>FAIR59</dc:creator>
      <dc:date>2017-06-19T09:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: project units</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/project-units/m-p/7162874#M57701</link>
      <description>&lt;P&gt;yes i did that&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i&amp;nbsp;have pretty much solved all my issues, the only issue left&amp;nbsp;is this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;document.ActiveProjectLocation&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;return EastWest and NorthSouth only if the Project Base Point was moved cliped&lt;/P&gt;
&lt;P&gt;it will returns the origin point (0, 0, 0) if the Project Base Point was moved unclipped&lt;/P&gt;
&lt;P&gt;is this a bug? or that's how it works?&amp;nbsp; (in Revit 2015)&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>Mon, 19 Jun 2017 19:49:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/project-units/m-p/7162874#M57701</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2017-06-19T19:49:36Z</dc:date>
    </item>
  </channel>
</rss>

