Message 1 of 3
Get CenteLinesCurves from rebar

Not applicable
05-11-2016
06:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I´m a newbie in this area.
I´m trying to get the center lines curves from the rebar to create a detail line with the shape of the rebar.
I´m cannot find the method to do this operation.
Any help will be welcome.
This is my code, I´m stuck at this point.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Autodesk.Revit.DB; using Autodesk.Revit.DB.Structure; using Autodesk.Revit.UI; using Autodesk.Revit.UI.Selection; using Autodesk.Revit.Attributes; namespace CreateImageRebar { [TransactionAttribute(TransactionMode.Manual)] [RegenerationAttribute(RegenerationOption.Manual)] public class ReinforcementDetail : IExternalCommand { //Clase de filtro de selección public class RebarPickFilter : ISelectionFilter { public bool AllowElement(Element e) { return (e.Category.Id.IntegerValue.Equals((int)BuiltInCategory.OST_Rebar)); } public bool AllowReference(Reference r, XYZ p) { return false; } } public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { UIApplication uiApp = commandData.Application; Document doc = uiApp.ActiveUIDocument.Document; Reference pickedRef = null; Selection sel = uiApp.ActiveUIDocument.Selection; RebarPickFilter selFilter = new RebarPickFilter(); pickedRef = sel.PickObject(ObjectType.Element, selFilter, "Seleccione una Armadura"); //Obtener referencia Element el = doc.GetElement(pickedRef); Rebar myRebar = el as Rebar;