二次开发获取默认类型Id

Document GetDefaultElementTypeId Method

public ElementId GetDefaultElementTypeId(
	ElementTypeGroup defaultTypeId
)

ElementTypeGroup为枚举类型 

Member nameDescription
RailingsTypeForStairsThe railings type for stairs.
RailingsTypeForRampsThe railings type for ramps.
WallTypeThe wall type.
RoofTypeThe roof type.
FloorTypeThe floor type.
FootingSlabTypeThe footing slab type.
CeilingTypeThe ceiling type.
StairsBySketchTypeThe stairs by sketch type.
GridTypeThe Grid Type.
LevelTypeThe Level Type
LinearDimensionTypeThe linear dimension type.
SpotElevationTypeThe spot elevation type.
TextNoteTypeThe text note type.
TagNoteTypeThe tag note type.
ModelTextTypeThe model text type.
CorniceTypeThe cornice type.
RevealTypeThe reveal type.
ViewportTypeThe viewport type.
ReferenceViewerTypeThe reference viewer type.
CalloutTypeThe callout view type.
RampTypeThe ramp type.
StairsRailingTypeThe stairs railing type.
ModelGroupTypeThe model group type.
DetailGroupTypeThe detail group type.
AttachedDetailGroupTypeThe attached detail group type.
FilledRegionTypeThe filled region type.
RadialDimensionTypeThe radial dimension type.
AngularDimensionTypeThe angular dimension type.
ArcLengthDimensionTypeThe arc length dimension type.
BuildingPadTypeThe building pad type.
DecalTypeThe decal type.
ContourLabelingTypeThe contour labeling type.
RoofSoffitTypeThe roof soffit type.
FasciaTypeThe fascial type.
GutterTypeThe gutter type.
EdgeSlabTypeThe slab edge type.
RepeatingDetailTypeThe repeating detail type.
BeamSystemTypeThe beam system type.
CurtainSystemTypeThe curtain system type.
ViewType3DThe 3D view type.
ViewTypeWalkthroughThe walkthrough view type.
ViewTypeRenderingThe rendering view type.
ViewTypeScheduleThe schedule view type.
ViewTypeLegendThe legend view type.
ViewTypeCostReportThe cost report view type.
ViewTypeSheetThe sheet view type.
ViewTypeDraftingThe drafting view type.
ViewTypeStructuralPlanThe structural plan view type.
ViewTypeFloorPlanThe floor plan view type.
ViewTypeCeilingPlanThe ceiling plan view type.
ViewTypeSectionThe section view type.
ViewTypeDetailViewThe detail view type.
ViewTypeElevationThe elevation view type.
ViewTypeStructuralElevationThe structrual elevation view type.
ViewTypeLoadsReportThe loads report view type.
ViewTypePressureLossReportThe pressure loss report view type.
ViewTypePanelScheduleThe panel schedule view type.
AreaLoadTypeThe area load type.
LineLoadTypeThe line load type.
PointLoadTypeThe point load type.
RebarBarTypeThe rebar bar type.
AreaReinforcementTypeArea reinforcement type.
PathReinforcementTypePath reinforcement type.
FabricAreaTypeThe fabric area type.
FabricSheetTypeThe fabric sheet type.
DuctTypeThe duct type.
FlexDuctTypeThe flex duct type.
PipeTypeThe pipe type.
FlexPipeTypeThe flex pipe type.
WireTypeThe wire type.
SpotCoordinateTypeThe spot coordinate type.
ViewTypeGraphScheduleColumnThe graph schedule column view type.
SpotSlopeTypeThe spot slope type.
WallFoundationTypeThe wall foundation type.
PipeInsulationTypeThe pipe insulation type.
DuctInsulationTypeThe duct insulation type.
DuctLiningTypeThe duct lining type.
CableTrayTypeThe cable tray type.
ConduitTypeThe conduilt type.
DiameterDimensionTypeThe diameter dimension type.
StairsTypeThe stairs type.
AnalyticalLinkTypeThe analytical link type.
MultiReferenceAnnotationTypeThe multi-reference annotation type.
ColorFillTypeThe color fill legend type.
RebarContainerTypeThe Rebar Container Type.

案例

private bool IsWallUsingDefaultType(Document document, Wall wall)
{
    ElementId defaultElementTypeId = document.GetDefaultElementTypeId(ElementTypeGroup.WallType);
    return (wall.WallType.Id == defaultElementTypeId);
}

Document.GetDefaultFamilyTypeId Method

public ElementId GetDefaultFamilyTypeId(
	ElementId familyCategoryId
)

Gets the default family type id with the given family category id.

案例

private void AssignDefaultTypeToColumn(Document document, FamilyInstance column)
{
    ElementId defaultTypeId = document.GetDefaultFamilyTypeId(new ElementId(BuiltInCategory.OST_StructuralColumns));

    if (defaultTypeId != ElementId.InvalidElementId)
    {
        FamilySymbol defaultType = document.GetElement(defaultTypeId) as FamilySymbol;
        if (defaultType != null)
        {
            column.Symbol = defaultType;
        }
    }
}

 

 

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值