Modify height don't work

Modify height don't work

sizy458
Advocate Advocate
440 Views
1 Reply
Message 1 of 2

Modify height don't work

sizy458
Advocate
Advocate

Hello,

I should modify length of rebar (type shape '77') and it's don't work !

How modify programming the length of the rebar (shape '77') ???

 

The code which divise by 2/3 the length but it don't work.

 

Thank.

 

 Rebar rborg = TcmPick.saisiracier(uiapp.ActiveUIDocument, "rebar");
                Document doc = rborg.Document;

               

               
                Transaction trans;
                trans = new Transaction(doc);
                trans.Start("diviseheight");
                /*RebarShapeDrivenAccessor ef = rborg.GetShapeDrivenAccessor();
                ef.Height *= 00.75;*/

                var pp = rborg.get_Parameter(BuiltInParameter.REBAR_MAX_LENGTH);
                double d = pp.AsDouble();
                pp.Set(d * 0.66);

                pp = rborg.get_Parameter(BuiltInParameter.REBAR_MIN_LENGTH);
                 d = pp.AsDouble();
                pp.Set(d * 0.66);

                pp = rborg.get_Parameter(BuiltInParameter.REBAR_SHAPE_SPIRAL_HEIGHT);
                d = pp.AsDouble();
                pp.Set(d * 0.66);


                


                trans.Commit();

 

0 Likes
441 Views
1 Reply
Reply (1)
Message 2 of 2

jeremytammik
Autodesk
Autodesk

I suggest you use one of the Wall.Create overloads that takes a level id argument to specify the proper level. Then, you can just specify the top and bottom bounding level, again using element ids. Look at the ADN labs Xtra sample Lab2_0_CreateLittleHouse to see how:

 

https://github.com/jeremytammik/AdnRevitApiLabsXtra

 

https://github.com/jeremytammik/AdnRevitApiLabsXtra/blob/master/XtraCs/Labs2.cs#L42-L427

  

I hope this helps.

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes