create rebar by freeform

create rebar by freeform

toan1106
Participant Participant
708 Views
1 Reply
Message 1 of 2

create rebar by freeform

toan1106
Participant
Participant

hi everyone, i Have a error, when i created rebars, the rebars are placed somewhere away outside of it. please help me

this is my code.

public IList<CurveLoop> Curveloopform(Document doc, PlanarFace faces)
{
IList<CurveLoop> listloop = new List<CurveLoop>();
listloop = faces.GetEdgesAsCurveLoops();
return listloop;
}

public Element Facehost(Document doc)
{
UIDocument uidoc = _data.uidoc;
Selection sel = uidoc.Selection;
Reference rf = sel.PickObject(ObjectType.Element, "Select Face");
Element ele = doc.GetElement(rf);
return ele;
}

public Rebar CreaRebar(Document doc,IList<CurveLoop> curveloops,Element host,RebarBarType barType)
{
Transaction tran = new Transaction(doc, "sss");
tran.Start();
Rebar rebar= Rebar.CreateFreeForm(doc, barType, host, curveloops,out RebarFreeFormValidationResult error);
tran.Commit();
return rebar;
}

 

709 Views
1 Reply
Reply (1)
Message 2 of 2

rufaidemir
Explorer
Explorer

you can try to define rebarType in transaction 

 RebarBarType rebarBarType = RebarBarType.Create(doc);

0 Likes