Message 1 of 6
Create dimension between rebars in set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have rebars set and I need to create between all/selected of them.
The result I need:
What I have tried:
Method A - Use Reference to SubElements
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
List<Reference> rebarsInSetRef = rebar.GetSubelements().Where(s => s.Element is Rebar).Select(s =>s.GetReference()).Cast<Reference>().ToList();
but when I tried to use those references to create the dimension it throws an Exception:
"Invalid number of references".
Method B - Compute References for Geometry
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Options options = new Options();
options.ComputeReferences = true;
options.IncludeNonVisibleObjects = true;
options.View= curView;
GeometryElement geometryElement = rebar.get_Geometry(options);
but geometryElement has only single line element.
Method C - Create reference to rebars
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ReferenceArray referenceArray = new ReferenceArray();
List<Rebar> rebars = rebar.GetSubelements().Where(s => s.Element is Rebar).Select(s => s.Element as Rebar).ToList();
referenceArray.Append(new Reference(rebars[0]));
referenceArray.Append(new Reference(rebars[1]));
but when I tried to use those references to create the dimension it throws an Exception:
"The references are not geometric references".