LevelOffset not working for Arc extrusion Roof

LevelOffset not working for Arc extrusion Roof

newbieng
Contributor Contributor
884 Views
2 Replies
Message 1 of 3

LevelOffset not working for Arc extrusion Roof

newbieng
Contributor
Contributor

Hi,

I've encountered a strange result and I'd like to know if it's my fault or if there's an error somewhere or a known issue.

I'm trying to create a new ExtrusionRoof with an arc profile and then change the Level Offset parameter to a different value.

  

I use the ROOF_CONSTRAINT_OFFSET_PARAM BuiltInParameter to find that parameter and then set it.

Unexpectedly Revit set the parameter to my value, but the roof doesn't shift. So there's a discrepancy between the parameter value and the effective position of the roof.

 

I tried to manually change the value, but the roof doesn't shift... it seems like it has a constraint that I can't figure out.  I tested methods like Arc.Create(plane,radius,startAngle,endAngle) and Arc.Create(XYZ,XYZ,XYZ) to create the arc profile for the NewExtrusionRoof but nothing changes. Here's a snippet of my code:

 

double myOffset=1.5;
CurveArray curArr=new CurveArray();
Arc arc = Arc.Create(arc_end0, arc_end1, arc_pointOnCurve);
//Arc arc=Arc.Create(plane,radius,startAngle,endAngle);
curArr.Append(arc);
using (Transaction t=new Transaction(curDoc,"Create ExtRoof"))
{
  t.Start();
ExtrusionRoof extrusionRoof = curDoc.Create.NewExtrusionRoof(curArr, rp, level, roofType, extrusionStart, extrusionEnd);
  Parameter offset = extrusionRoof.get_Parameter(BuiltInParameter.ROOF_CONSTRAINT_OFFSET_PARAM);
  offset.Set(myOffset);
  t.Commit();
}

 

 

 Any ideas?

 

Thanks in advance

0 Likes
885 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk

Work it out manually in the user interface first.

 

Observe the results using RevitLookup.



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

0 Likes
Message 3 of 3

FAIR59
Advisor
Advisor

You are creating geometry and then in the same transaction make a change to it. In the past such a workflow caused problems, that could be solved by separating the creation and modification into 2 transactions. I would suggest you do the same, and see if that resolves your problem.