End Point Reference of Beams Generates Zero dimension Value in the Segment

End Point Reference of Beams Generates Zero dimension Value in the Segment

AGYEMANG.OFOSU
Advocate Advocate
640 Views
4 Replies
Message 1 of 5

End Point Reference of Beams Generates Zero dimension Value in the Segment

AGYEMANG.OFOSU
Advocate
Advocate

In generating dimension using point reference of beams, zero dimension values are generated. The GetEndPointReference results in two references at each end which leads to zero values at that point. A solution to filter to one reference point will be helpful.

In generating dimension using point reference of beams, zero dimension values are generated. The GetEndPointReference results in two references at each end which leads to zero values at that point. A solution to filter to one reference will be helpful.
            
            Options opt = new Options();
            opt.ComputeReferences = true;
            opt.IncludeNonVisibleObjects = true;
            opt.View = ActiveView;
            Reference pointRefr = null;
            Reference pointRefl = null;
            List<Reference> references = new List<Reference>();
            var referencearray = new ReferenceArray();
           
             foreach (var geoObj in element.get_Geometry(opt))
             {
              Curve curve = geoObj as Curve;
                 if (curve == null)
                  continue;
                  pointRefr = curve.GetEndPointReference(0);
                  pointRefl = curve.GetEndPointReference(1);
                  references.Add(pointRefl);
                  references.Add(pointRefr);         
             }

 

0 Likes
Accepted solutions (1)
641 Views
4 Replies
Replies (4)
Message 2 of 5

jeremytammik
Autodesk
Autodesk

I suggest you check the distance between the XYZ points before adding the corresponding references to your list. Ensure that the points are unique with a certain minimum distance between them. Otherwise, skip the corresponding reference.

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 5

AGYEMANG.OFOSU
Advocate
Advocate

The issue is, the reference of say GetEndPointReference(0) has two references in reality and thus generate zero value. but the distance between GetEndPointReference(0) and GetEndPointReference(1) is correct without problem. How do I go about that?

 

 

0 Likes
Message 4 of 5

jeremytammik
Autodesk
Autodesk
Accepted solution

Ignore the one that generates a zero value?

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 5 of 5

AGYEMANG.OFOSU
Advocate
Advocate

Thanks a lot. One of my loops was giving me a false impression of a double reference from the same point. 

0 Likes