EaBIM一直以来积极响应国家“十二五”推进建筑业信息化的号召,对建筑领域的信息技术开展深入技术交流和探讨!致力于打造“BIM-建筑师-生态技术”三位一体综合资源交流共享平台,希望为BIM与可持续设计理念及技术的普及做出微小的贡献!!!

萧闫子 发表于 2014-1-9 12:40:02

梁曲线Beam Requires Curve

We discussed the issue of inserting a beam and also creating a curved beam in some depth already. The former discussion includes a pretty detailed analysis showing that you really do have to specify a curve in order to generate a valid beam instance, and all other overloads of the NewFamilyInstance will fail in one way or the other. In spite of this, people continue having problems inserting beam instances. My colleague Joe Ye just encountered another case like this:Question: I am creating a beam using the following code:Level level;FamilySymbol symbol;double x1, y1, x2, y2;XYZ p = new XYZ( x1, y1, level.Elevation );XYZ q = new XYZ( x2, y2, level.Elevation );   Autodesk.Revit.DB.Structure.StructuralType st   = Autodesk.Revit.DB.Structure.StructuralType.Beam;   FamilyInstance beam = doc.Create.NewFamilyInstance(   p, symbol, level, st );   LocationCurve beamCurve = beam.Location   as LocationCurve;   if( null != beamCurve ){    Line line = app.Create.NewLineBound( p, q );    beamCurve.Curve = line;}When I try to use it, though, I run into several problems:
[*]Its beam type is <Automatic>:
http://thebuildingcoder.typepad.com/.a/6a00e553e1689788330133ec8d0592970b-800wi

[*]Even worse, it cannot host rebars.
Answer: Yes, I can reproduce what you say.The reason that the beam cannot host rebars is that it lacks the rebar cover parameters. Concrete beams created manually have the following three rebar cover related parameters:
[*]Rebar Cover – Top Face
[*]Rebar Cover – Bottom Face
[*]Rebar Cover – Other Faces
The real reason lies deeper, though. As explained in some depth in inserting a beam, the beam instance really does require a curve to be specified when creating it. As your code above proves, the curve cannot simply be added after the initial creation step. If you create your beam using the following NewFamilyInstance overload instead of the one taking a point argument, all works well:Curve useCurve = app.Create.NewLineBound( p, q );beam = doc.Create.NewFamilyInstance(   useCurve, symbol, level, st );

dison 发表于 2014-2-20 14:44:09

顶!!!!!!!!!!

页: [1]
查看完整版本: 梁曲线Beam Requires Curve