<?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: Invalid number of references when creating a simple dimention in a family editor in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764081#M22318</link>
    <description>&lt;P&gt;One reference is always an invalid number of references. You can't dimension a line from nowhere.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Nov 2021 17:14:17 GMT</pubDate>
    <dc:creator>RPTHOMAS108</dc:creator>
    <dc:date>2021-11-17T17:14:17Z</dc:date>
    <item>
      <title>Invalid number of references when creating a simple dimention in a family editor</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764060#M22317</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="refin1.png" style="width: 589px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/990762i8E339E0C23EBF833/image-size/large?v=v2&amp;amp;px=999" role="button" title="refin1.png" alt="refin1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 17:06:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764060#M22317</guid>
      <dc:creator>dem1st</dc:creator>
      <dc:date>2021-11-17T17:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid number of references when creating a simple dimention in a family editor</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764081#M22318</link>
      <description>&lt;P&gt;One reference is always an invalid number of references. You can't dimension a line from nowhere.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 17:14:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764081#M22318</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-11-17T17:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid number of references when creating a simple dimention in a family editor</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764115#M22319</link>
      <description>Thanks for responding! Im a little bit confused, please clarify things.&lt;BR /&gt;There's got to be 1 line and 2 Reference planes perpendicular to it,&lt;BR /&gt;correct?&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Nov 2021 17:23:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764115#M22319</guid>
      <dc:creator>dem1st</dc:creator>
      <dc:date>2021-11-17T17:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid number of references when creating a simple dimention in a family editor</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764128#M22320</link>
      <description>&lt;P&gt;The reference array needs to contain at least two references one is from the line and the other is from that thing you want the line dimensioned from.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Depends on the types of references in terms of if they need to be parallel to one another or not i.e. in the UI you can dimension between whole line and end point of other line not parallel to first line.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 17:30:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764128#M22320</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-11-17T17:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid number of references when creating a simple dimention in a family editor</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764158#M22321</link>
      <description>&lt;P dir="rtl"&gt;&lt;SPAN style="color: #000000; font-family: sans-serif; font-size: 12.8px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;Could you say what purpose does that line serve? Also, I'm not sure I understood what you meant by "that thing you want the line dimensioned from". My apologies if the questions are trivial, I've not worked with dimensions before. Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 17:39:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764158#M22321</guid>
      <dc:creator>dem1st</dc:creator>
      <dc:date>2021-11-17T17:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid number of references when creating a simple dimention in a family editor</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764185#M22322</link>
      <description>&lt;P&gt;The 'Line' mentioned in&amp;nbsp;Document.NewDimension argument is the dimension line i.e. the line where the dimension text is just above. Likely doesn't have to be the right length (i.e. matching overall dimension) is used as an alignment position, so could perhaps be a unit length.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reference array contains references obtained from geometry that you want to dimension between. So if you dimension between two things you obtain the references of those two things (lines/grids/surfaces/points...) to put in the array. If you dimension between four things (as below) you obtain the references from those four things (it creates then a dimension with three dimension segments). Probably they need to be in the right order, I've not put them in the wrong order so can't say for sure.&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="211117.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/990789i6B1A8A6916A0A6EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="211117.PNG" alt="211117.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 17:59:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764185#M22322</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-11-17T17:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid number of references when creating a simple dimention in a family editor</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764215#M22323</link>
      <description>&lt;P&gt;Awesome exanaion, makes sense. What if we are dealing with a reference plane and not a geometry element. While trying to get that reference of the reference plane compiler finds error saying there is no such member!?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dem1st_1-1637151784535.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/990794iE27E05820B705415/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dem1st_1-1637151784535.png" alt="dem1st_1-1637151784535.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 18:07:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764215#M22323</guid>
      <dc:creator>dem1st</dc:creator>
      <dc:date>2021-11-17T18:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid number of references when creating a simple dimention in a family editor</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764292#M22324</link>
      <description>&lt;P&gt;I usually use 'New Reference(ReferencePlane)' for that rather than trying to get geometry from a reference plane, similar for grids.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 18:40:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764292#M22324</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-11-17T18:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid number of references when creating a simple dimention in a family editor</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764445#M22325</link>
      <description>&lt;P&gt;Tried to do it with&amp;nbsp;&lt;SPAN&gt;'New Reference(ReferencePlane)'&amp;nbsp; and got an error. What can be the problem here?&lt;/SPAN&gt;&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="dem1st_0-1637178107516.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/990828i0B6DADA838F91EBD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dem1st_0-1637178107516.png" alt="dem1st_0-1637178107516.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 19:47:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764445#M22325</guid>
      <dc:creator>dem1st</dc:creator>
      <dc:date>2021-11-17T19:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid number of references when creating a simple dimention in a family editor</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764626#M22326</link>
      <description>&lt;P&gt;Are the reference planes parallel?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can probably use ReferencePlane.GetReference your original error was likely due to using old sample code where GetReference used to be a property called ReferencePlane.Reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think either way should lead to same result i.e. the references are not suitable in their current form to create a dimension (demonstrate in UI).&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 21:24:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764626#M22326</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2021-11-17T21:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid number of references when creating a simple dimention in a family editor</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764741#M22327</link>
      <description>&lt;P&gt;Plugin does create Reference planes but it doesn't go pass that point throwing same "ArgumentException: 'One of the conditions for the inputs was not satisfied"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dem1st_0-1637186898348.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/990879i4692DEB7A21EF388/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dem1st_0-1637186898348.png" alt="dem1st_0-1637186898348.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume that is because something is wrong with the line creation. Right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;                XYZ z1 = new XYZ(5, 5, 0);
                XYZ z2 = new XYZ(5, -5, 0);
                XYZ z3 = new XYZ(-5, -5, 0);
                XYZ z4 = new XYZ(-5, 5, 0);

                XYZ cutVec = new XYZ(0, 0, 5);
                ReferencePlane refplane1 = doc.FamilyCreate.NewReferencePlane(z1, z2, cutVec, doc.ActiveView);
                ReferencePlane refplane2 = doc.FamilyCreate.NewReferencePlane(z4, z3, cutVec, doc.ActiveView);

                XYZ pt1 = new XYZ(-5, 5, 0);
                XYZ pt2 = new XYZ(5, 5, 0);
//is the problem down below?
                Line lin = Line.CreateBound(pt1, pt2);

                ReferenceArray ra = new ReferenceArray();
                ra.Append(refplane1.GetReference());
                ra.Append(refplane2.GetReference());

                Dimension dim = doc.FamilyCreate.NewLinearDimension(doc.ActiveView, lin, ra);&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Nov 2021 22:12:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10764741#M22327</guid>
      <dc:creator>dem1st</dc:creator>
      <dc:date>2021-11-17T22:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid number of references when creating a simple dimention in a family editor</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10767863#M22328</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10661415"&gt;@dem1st&lt;/a&gt;&amp;nbsp;: Can you try Document.Regenerate() after creating the reference planes and before grabbing their reference, or maybe do those in 2 separate transactions. Sometimes Revit do not have full grasp of newly created geometry before the transaction is committed.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 06:21:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/invalid-number-of-references-when-creating-a-simple-dimention-in/m-p/10767863#M22328</guid>
      <dc:creator>snajjar</dc:creator>
      <dc:date>2021-11-19T06:21:07Z</dc:date>
    </item>
  </channel>
</rss>

