<?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 DatumPlane SetCurve problems in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/datumplane-setcurve-problems/m-p/6033350#M67667</link>
    <description>I am trying to use DatumPlane.SetCurveInView to duplicate 2d extents of grids across views. I am taking a reference view and using GetCurvesInView to get the curve to set with. This works fine for views that are essentially copies of the primary view (Same Associated Level)&lt;BR /&gt;&lt;BR /&gt;But when I attempt it for plan views that are at a different level than the reference plan view, it does not work. Which makes sense....the ref curve is not at the correct elevation.&lt;BR /&gt;&lt;BR /&gt;No problem, I'll use Curve.CreateTransformed(Transform.CreateTranslation(XYZ(0,0,offset))) where offset is the Z value (level elevation) of my new view minus the Z value of the reference level. But this fails for some reason. The error states that the curve must be bound and coincident with the datum plane. I tested using Curve.IsBound and that returned "True"....so how can the curve not be coincident if it was only offset in Z??&lt;BR /&gt;&lt;BR /&gt;I also tried getting the start and end points of the reference curve, and creating new XYZ with the new Z value and using Line.CreateBound but that too gave me the same error.&lt;BR /&gt;&lt;BR /&gt;So my question is - how do I use SetCurveInView when the reference curve is taken from a datum plane that is in a plan view at a different elevation than the plan view containing the datum plane I am trying to set.</description>
    <pubDate>Wed, 10 Feb 2016 15:34:19 GMT</pubDate>
    <dc:creator>bosborne</dc:creator>
    <dc:date>2016-02-10T15:34:19Z</dc:date>
    <item>
      <title>DatumPlane SetCurve problems</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/datumplane-setcurve-problems/m-p/6033350#M67667</link>
      <description>I am trying to use DatumPlane.SetCurveInView to duplicate 2d extents of grids across views. I am taking a reference view and using GetCurvesInView to get the curve to set with. This works fine for views that are essentially copies of the primary view (Same Associated Level)&lt;BR /&gt;&lt;BR /&gt;But when I attempt it for plan views that are at a different level than the reference plan view, it does not work. Which makes sense....the ref curve is not at the correct elevation.&lt;BR /&gt;&lt;BR /&gt;No problem, I'll use Curve.CreateTransformed(Transform.CreateTranslation(XYZ(0,0,offset))) where offset is the Z value (level elevation) of my new view minus the Z value of the reference level. But this fails for some reason. The error states that the curve must be bound and coincident with the datum plane. I tested using Curve.IsBound and that returned "True"....so how can the curve not be coincident if it was only offset in Z??&lt;BR /&gt;&lt;BR /&gt;I also tried getting the start and end points of the reference curve, and creating new XYZ with the new Z value and using Line.CreateBound but that too gave me the same error.&lt;BR /&gt;&lt;BR /&gt;So my question is - how do I use SetCurveInView when the reference curve is taken from a datum plane that is in a plan view at a different elevation than the plan view containing the datum plane I am trying to set.</description>
      <pubDate>Wed, 10 Feb 2016 15:34:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/datumplane-setcurve-problems/m-p/6033350#M67667</guid>
      <dc:creator>bosborne</dc:creator>
      <dc:date>2016-02-10T15:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: DatumPlane SetCurve problems</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/datumplane-setcurve-problems/m-p/6046850#M67668</link>
      <description>Dear bosborne, is it possible to provide a rvt file with code example to help us to reproduce your problem? thanks</description>
      <pubDate>Fri, 19 Feb 2016 07:49:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/datumplane-setcurve-problems/m-p/6046850#M67668</guid>
      <dc:creator>Aaron.Lu</dc:creator>
      <dc:date>2016-02-19T07:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: DatumPlane SetCurve problems</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/datumplane-setcurve-problems/m-p/10999046#M67669</link>
      <description>&lt;P&gt;Did you ever solve this? I'm experiencing the same problem attempting to resize the DatumPlane associated with Levels&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 15:55:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/datumplane-setcurve-problems/m-p/10999046#M67669</guid>
      <dc:creator>simonjones-uk</dc:creator>
      <dc:date>2022-03-11T15:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: DatumPlane SetCurve problems</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/datumplane-setcurve-problems/m-p/12899581#M67670</link>
      <description>&lt;LI-CODE lang="csharp"&gt;foreach (Curve cv in dp.GetCurvesInView(DatumExtentType.Model, doc.ActiveView))
{
    MessageBox.Show(cv.GetEndPoint(0).ToString() + "  " + cv.GetEndPoint(1).ToString());
}&lt;/LI-CODE&gt;&lt;P&gt;I use this parse to read the curves, and found that it's only works in view section, and the curve is bounded by both the Z-axis and the section plane.&lt;/P&gt;&lt;P&gt;So edit it in South Side and East Side View (or any sections horizontal to X and Y axis) would be better.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Level level;
View southViewSection, eastViewSection;

//get these and check the view is with correct direction.

//edit the datum for X-axis
Curve datumToCurveX = level.GetCurvesInView(DatumExtentType.Model, southViewSection).First();
                datumToCurveX = Line.CreateBound(
                    new XYZ(newX0, datumToCurveX.GetEndPoint(0).Y, datumToCurveX.GetEndPoint(0).Z),
                    new XYZ(newX1, datumToCurveX.GetEndPoint(1).Y, datumToCurveX.GetEndPoint(1).Z)
                );
                level.SetCurveInView(DatumExtentType.Model, southViewSection, datumToCurveX);
//do Same for Y-axis&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 01:24:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/datumplane-setcurve-problems/m-p/12899581#M67670</guid>
      <dc:creator>admaecc211151</dc:creator>
      <dc:date>2024-07-16T01:24:36Z</dc:date>
    </item>
  </channel>
</rss>

