<?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: DimensionSegment /Dimension Segment Array in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/dimensionsegment-dimension-segment-array/m-p/9060685#M39546</link>
    <description>&lt;P&gt;Using the code below, I was able to generate a single dimension string. How would I be able to generate a dimension string with multiple references and dimension segments (as seen in the image below the code and in the first post)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I Append multiple references to the ReferenceArray, I get an error saying "Expected DimensionSegment, got Line" for the dimension transaction. I also generated an unboundline to see if that woul work. A solution to this would be a huge help.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;P1 = edge.AsCurve().GetEndPoint(0)
P2 = edge.AsCurve().GetEndPoint(1)
        
dimensionLine = Line.CreateBound(P1, P2)

dlEdRef1 = edge.GetEndPointReference(0)
dlEdRef2 = edge.GetEndPointReference(1)

edgeRefArray = ReferenceArray()
		
edgeRefArray.Append(dlEdRef1)
edgeRefArray.Append(dlEdRef2)

tt.Start()
dim = doc.Create.NewDimension (view, dimensionLine, edgeRefArray)
tt.Commit()&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dimension segments.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/683372i6BD1F5EBB43E43FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="dimension segments.PNG" alt="dimension segments.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Oct 2019 19:24:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-10-01T19:24:32Z</dc:date>
    <item>
      <title>DimensionSegment /Dimension Segment Array</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/dimensionsegment-dimension-segment-array/m-p/9053421#M39545</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sample dim.PNG" style="width: 859px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/682064iC9FCFF6EE921E01A/image-size/large?v=v2&amp;amp;px=999" role="button" title="sample dim.PNG" alt="sample dim.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am familiar with the process to generate dimensions by creating lines and adding references to an array. However,&amp;nbsp; I have been attempting to recreate an ordinate dimension string as seen in the image, where it is a single string with multiple references. From using Revit Lookup, it appears I need to construct a &lt;A href="https://www.revitapidocs.com/2019/ea274891-53e6-efbe-6dec-fc2c32636ad2.htm" target="_blank" rel="noopener"&gt;DimensionSegmentArray&lt;/A&gt;&amp;nbsp;and Append it with a &lt;A href="https://www.revitapidocs.com/2019/36b254a0-3dc5-7bdc-d6b4-986e5d82ddbf.htm" target="_blank" rel="noopener"&gt;DimensionSegment&lt;/A&gt;.&amp;nbsp; I've attempted to create lines and use those, but get an error to create "DimensionSegments" instead. I've searched hours for a solution to this, but I am apparently missing something.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I construct a "Dimension Segment"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would I have to create a NewDimension for each segment, then append those to create another, longer dimension? If that's the case, then how would the number of Reference Arrays work in the longer NewDimension?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 17:15:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/dimensionsegment-dimension-segment-array/m-p/9053421#M39545</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-27T17:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: DimensionSegment /Dimension Segment Array</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/dimensionsegment-dimension-segment-array/m-p/9060685#M39546</link>
      <description>&lt;P&gt;Using the code below, I was able to generate a single dimension string. How would I be able to generate a dimension string with multiple references and dimension segments (as seen in the image below the code and in the first post)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I Append multiple references to the ReferenceArray, I get an error saying "Expected DimensionSegment, got Line" for the dimension transaction. I also generated an unboundline to see if that woul work. A solution to this would be a huge help.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;P1 = edge.AsCurve().GetEndPoint(0)
P2 = edge.AsCurve().GetEndPoint(1)
        
dimensionLine = Line.CreateBound(P1, P2)

dlEdRef1 = edge.GetEndPointReference(0)
dlEdRef2 = edge.GetEndPointReference(1)

edgeRefArray = ReferenceArray()
		
edgeRefArray.Append(dlEdRef1)
edgeRefArray.Append(dlEdRef2)

tt.Start()
dim = doc.Create.NewDimension (view, dimensionLine, edgeRefArray)
tt.Commit()&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dimension segments.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/683372i6BD1F5EBB43E43FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="dimension segments.PNG" alt="dimension segments.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 19:24:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/dimensionsegment-dimension-segment-array/m-p/9060685#M39546</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-01T19:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: DimensionSegment /Dimension Segment Array</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/dimensionsegment-dimension-segment-array/m-p/9061234#M39547</link>
      <description>&lt;P&gt;I answered my own question in the post above after a bit more exploration.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 00:03:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/dimensionsegment-dimension-segment-array/m-p/9061234#M39547</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-02T00:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: DimensionSegment /Dimension Segment Array</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/dimensionsegment-dimension-segment-array/m-p/10768262#M39548</link>
      <description>&lt;P&gt;Segments got created automatically as reference planes were&amp;nbsp;sequentially added one after another to the reference array.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;XYZ p1 = new XYZ(10, 10, 0);
XYZ p2 = new XYZ(10, -10, 0);
XYZ p3 = new XYZ(-10, -10, 0);
XYZ p4 = new XYZ(-10, 10, 0);

ReferencePlane refplane1 = doc.FamilyCreate.NewReferencePlane(p4, p1, cutVec, uidoc.ActiveGraphicalView);
ReferencePlane refplane2 = doc.FamilyCreate.NewReferencePlane(p3, p2, cutVec, uidoc.ActiveGraphicalView);

ReferenceArray raD = new ReferenceArray();
ReferencePlane refplane3 = doc.FamilyCreate.NewReferencePlane(new XYZ(0, 0, 0), new XYZ(1, 0, 0), cutVec, uidoc.ActiveGraphicalView);
doc.Regenerate();

            raD1.Append(refplane2.GetReference());
            raD1.Append(refplane3.GetReference());
            raD1.Append(refplane1.GetReference());

            Line LineD = Line.CreateBound(new XYZ(p4.X-0.5, p4.Y , p4.Z), new XYZ(p3.X-0.5, p3.Y , p3.Z));

            var dimD = doc.FamilyCreate.NewLinearDimension(uidoc.ActiveGraphicalView, LineD, raD1);

            DimensionSegmentArray s = dimD.Segments;
            s.get_Item(0).IsLocked = true;
            s.get_Item(1).IsLocked = true;
            dimD.AreSegmentsEqual = true;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 10:58:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/dimensionsegment-dimension-segment-array/m-p/10768262#M39548</guid>
      <dc:creator>dem1st</dc:creator>
      <dc:date>2021-11-19T10:58:00Z</dc:date>
    </item>
  </channel>
</rss>

