error create rebar by freeform

error create rebar by freeform

toan1106
Participant Participant
513 Views
0 Replies
Message 1 of 1

error 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;
}

 

0 Likes
514 Views
0 Replies
Replies (0)