Rebar error

Rebar error

Arciviz
Advocate Advocate
2,516 Views
6 Replies
Message 1 of 7

Rebar error

Arciviz
Advocate
Advocate

Hi,

I have tried rebar. Unable to create.

Please refer attachment.

In Method 1 (Rebar.CreateFromCurves) work without error but rebar not found.

In Method 2 (Rebar.CreateFromCurvesAndShape) shows ERROR "RebarShape does not match curve";

 

pt0,pt1,pt2 & pt3 creates correct curve. That matches with Shape code "21".;

 

I don't know, Where I made mistake. Please help me. 

View cu_view = ui_doc.ActiveView;
                  Element elem = Beams_Data_Lst[0].beam;

                  double left_bearing = Beams_Data_Lst[0].Left_Bearing,
                        right_bearing = Beams_Data_Lst[0].Right_Bearing,
                        Bm_depth = Beams_Data_Lst[0].Beam_Depth,
                        Bm_width = Beams_Data_Lst[0].Beam_Width,
                        Bm_cover = Beams_Data_Lst[0].Beam_Cover,
                        Bm_cut_len = Beams_Data_Lst[0].Beam_Cut_Length,
                        cover_Left_Col = Beams_Data_Lst[0].Left_Column_Cover,
                        cover_Right_Col = Beams_Data_Lst[0].Rigth_Column_Cover;
                  XYZ LLpt = Beams_Data_Lst[0].left_Cent_pt - new XYZ(0 , Bm_width * 0.5 , Bm_depth * 0.5);
                  XYZ pt0 = LLpt + new XYZ(-left_bearing + cover_Left_Col , Bm_cover , Bm_cover),
                     pt1 = pt0 + new XYZ(0 , 0 , Bm_depth - 2 * Bm_cover),
                     pt2 = pt1 + new XYZ(left_bearing - cover_Left_Col + Bm_cut_len + right_bearing - cover_Right_Col , 0 , 0),
                     pt3 = pt2 + new XYZ(0 , 0 , -Bm_depth + 2 * Bm_cover);
                  KJU.draw.DrawCircle(ui_doc ,LLpt , 0.25 , XYZ.BasisZ);
                  KJU.draw.DrawCircle(ui_doc , pt0 , 0.25 , XYZ.BasisZ);
                  KJU.draw.DrawCircle(ui_doc , pt1 , 0.25 , XYZ.BasisX);
                  KJU.draw.DrawCircle(ui_doc , pt2 , 0.25 , -XYZ.BasisZ);
                  KJU.draw.DrawCircle(ui_doc , pt3 , 0.25 , -XYZ.BasisZ);
                  IList<Curve> curves = new List<Curve>();
                  RebarHookType hook1 = KJU.Filter.ElementFiltering(doc ,typeof( RebarHookType ), "Rebar Hook 90") as RebarHookType;
                  curves.Add(Line.CreateBound(pt0,pt1)); curves.Add(Line.CreateBound(pt1 , pt2)); curves.Add(Line.CreateBound(pt2 , pt3));


                  // Method 1 = Rebar.CreateFromCurves  ***********************
                  Rebar rebar = Rebar.CreateFromCurves(doc , RebarStyle.Standard , UpperBar_Data_Lst[0][0].BarType , hook1 , hook1 , elem , 
                     new XYZ(1,1,1), curves,RebarHookOrientation.Left , RebarHookOrientation.Right , true , false);

                  // Method 2 =  Rebar.CreateFromCurvesAndShape ***********************
                  //Rebar rebar1 = Rebar.CreateFromCurvesAndShape(doc , UpperBar_Data_Lst[0][0].ShapeCode , UpperBar_Data_Lst[0][0].BarType , null , null,
                  //   elem , new XYZ(0 , 0 , 1) , curves , RebarHookOrientation.Left , RebarHookOrientation.Right);

                  if(null != rebar)
                  {
                     rebar.GetShapeDrivenAccessor().SetLayoutAsFixedNumber(3 , Bm_width - 2 * Bm_cover , true , true , true);
                  }

Regards,

Sudhan.

0 Likes
Accepted solutions (1)
2,517 Views
6 Replies
Replies (6)
Message 2 of 7

Mustafa.Salaheldin
Collaborator
Collaborator

Can you please provide a sample project file ?


¯\_(ツ)_/¯
Let it work like a charm.

Mustafa Salaheldin


EESignature




Digital Integration Manager, DuPod

Facebook | Twitter | LinkedIn

0 Likes
Message 3 of 7

Arciviz
Advocate
Advocate

Part 1. Getting input ->  completed working fine.

part 2. getting  schema data  from beams -> completed working fine

part 3. Rebar on structural frame(Beam) (issue with it)

please find attachment.

regards,

Sudhan

0 Likes
Message 4 of 7

Mustafa.Salaheldin
Collaborator
Collaborator

I meant Revit project sample 🙂


¯\_(ツ)_/¯
Let it work like a charm.

Mustafa Salaheldin


EESignature




Digital Integration Manager, DuPod

Facebook | Twitter | LinkedIn

0 Likes
Message 5 of 7

Arciviz
Advocate
Advocate

That is in side the zip. Also find it in the attachment.

0 Likes
Message 6 of 7

Arciviz
Advocate
Advocate

I have stored "ExtensibleStorage" as schema in Grid - E in revit sample model. All RebarBarType, RebarSHape, hook, etc are saved in family.

 

0 Likes
Message 7 of 7

Arciviz
Advocate
Advocate
Accepted solution

Solved My self. I made mistake in normal vector. normal Vector should perpendicular to Beam Longitudinal section.  

0 Likes