Revit开发之载入族的创建小技巧


在Revit中创建载入族的实例,要用到NewFamilyInstance 这个方法,

但是这个 这个方法有很多的重载,有时候很难找到正确的那个重载.

如果是我们自己建的族,我们还可以有一些选择方向,如果是别人

的族,那就比较麻烦了。

起始RevitAPI里虽然没有明确的方法可以让你一下找到正确的重载,

但是在Family里提供了参考:

Family.FamilyPlacementType

这返回的是一个枚举,他包含了以下类容:

OneLevelBased The family is placed referencing a single level.
OneLevelBasedHosted The family is placed referencing a single level and host.
TwoLevelsBased The family is placed referencing two levels (e.g. a column).
ViewBased The family is view-specific (e.g. a detail annotation)
WorkPlaneBased The family is placed on a work plane or face.
CurveBased The family is based on a line and placed on a work plane.
CurveBasedDetail The family is based on a line and place on a specific view (e.g. a detail component).
CurveDrivenStructural The family is a structural curve driven member (beam, brace, or slanted column)
Adaptive The family is an adaptive family.
Invalid This signals an invalid value for the enum. 

我们可以参考这些信息,快速找到正确的方法。


注意:自适应族不能用NewFamilyInstance 这个创建


博主会经常更新一些技术文章,请大家多多关注,多多交流

更多技术交流,请加qq群480950299





你可能感兴趣的:(Revit开发随笔)