Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LevelOffset not working for Arc extrusion Roof

2 REPLIES 2
Reply
Message 1 of 3
newbieng
261 Views, 2 Replies

LevelOffset not working for Arc extrusion Roof

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

Tags (1)
2 REPLIES 2
Message 2 of 3
jeremytammik
in reply to: newbieng

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

Message 3 of 3
FAIR59
in reply to: newbieng

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community