Skip to content

Commit 1975b80

Browse files
Revit 2022 Family API changes
1 parent f610e42 commit 1975b80

10 files changed

+21
-20
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Labs/3_Revit_Family_API/SourceCS/2_ColumnLshape.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,9 @@ void addParameters()
503503

504504
// API parameter group for Dimension is PG_GEOMETRY:
505505
//
506-
ForgeTypeId builtinParamGroup = new ForgeTypeId(BuiltInParameterGroup.PG_GEOMETRY.ToString());
507-
ForgeTypeId parameterTypeId = new ForgeTypeId(SpecTypeId.Length.ToString());
506+
ForgeTypeId builtinParamGroup = new ForgeTypeId(GroupTypeId.Geometry.TypeId);
507+
ForgeTypeId parameterTypeId = SpecTypeId.Length;
508+
508509
FamilyParameter paramTw = mgr.AddParameter(
509510
"Tw", builtinParamGroup,
510511
parameterTypeId, false);

Labs/3_Revit_Family_API/SourceCS/3_ColumnFormulaMaterial.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,8 @@ void addParameters()
517517

518518
// API parameter group for Dimension is PG_GEOMETRY:
519519
//
520-
ForgeTypeId builtinParamGroup=new ForgeTypeId(BuiltInParameterGroup.PG_GEOMETRY.ToString());
521-
ForgeTypeId parametertype = new ForgeTypeId(SpecTypeId.Length.ToString());
520+
ForgeTypeId builtinParamGroup=new ForgeTypeId(GroupTypeId.Geometry.TypeId);
521+
ForgeTypeId parametertype = SpecTypeId.Length;
522522
FamilyParameter paramTw = mgr.AddParameter(
523523
"Tw", builtinParamGroup,
524524
parametertype, false);
@@ -795,8 +795,8 @@ public void addMaterials(Extrusion pSolid)
795795
// this time we use instance parameter so that we can change it at instance level.
796796
//
797797
FamilyManager pFamilyMgr = _doc.FamilyManager;
798-
ForgeTypeId builtinParamGroup = new ForgeTypeId(BuiltInParameterGroup.PG_MATERIALS.ToString());
799-
ForgeTypeId parametertype = new ForgeTypeId(SpecTypeId.Reference.Material.ToString());
798+
ForgeTypeId builtinParamGroup = new ForgeTypeId(GroupTypeId.Materials.TypeId);
799+
ForgeTypeId parametertype = SpecTypeId.Reference.Material;
800800
FamilyParameter famParamFinish = pFamilyMgr.AddParameter("ColumnFinish", builtinParamGroup,parametertype, true);
801801

802802
// (2b.1) associate material parameter to the family parameter we just added

Labs/3_Revit_Family_API/SourceCS/4_ColumnVisibility.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,8 @@ void addParameters()
518518

519519
// API parameter group for Dimension is PG_GEOMETRY:
520520
//
521-
ForgeTypeId builtinParamgroupTypeId = new ForgeTypeId(BuiltInParameterGroup.PG_GEOMETRY.ToString());
522-
ForgeTypeId parameterTypeId = new ForgeTypeId(SpecTypeId.Length.ToString());
521+
ForgeTypeId builtinParamgroupTypeId = new ForgeTypeId(GroupTypeId.Geometry.TypeId);
522+
ForgeTypeId parameterTypeId =SpecTypeId.Length;
523523
FamilyParameter paramTw = mgr.AddParameter(
524524
"Tw", builtinParamgroupTypeId,
525525
parameterTypeId, false );
@@ -789,8 +789,8 @@ public void addMaterials( Extrusion pSolid )
789789
//
790790
// this time we use instance parameter so that we can change it at instance level.
791791
//
792-
ForgeTypeId builtinParamgroupTypeId = new ForgeTypeId(BuiltInParameterGroup.PG_MATERIALS.ToString());
793-
ForgeTypeId parameterTypeId = new ForgeTypeId(SpecTypeId.Reference.Material.ToString());
792+
ForgeTypeId builtinParamgroupTypeId = new ForgeTypeId(GroupTypeId.Materials.TypeId);
793+
ForgeTypeId parameterTypeId = SpecTypeId.Reference.Material;
794794
FamilyManager pFamilyMgr = _doc.FamilyManager;
795795
FamilyParameter famParamFinish = pFamilyMgr.AddParameter( "ColumnFinish", builtinParamgroupTypeId,parameterTypeId, true );
796796

Labs/3_Revit_Family_API/SourceVB/2_ColumnLshape.vb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,8 @@ Public Class RvtCmd_FamilyCreateColumnLShape
489489

490490
'' parameter group for Dimension is PG_GEOMETRY in API
491491
''
492-
Dim builtinParamGroup As ForgeTypeId = New ForgeTypeId(BuiltInParameterGroup.PG_GEOMETRY.ToString())
493-
Dim parameterTypeId As ForgeTypeId = New ForgeTypeId(SpecTypeId.Length.ToString())
492+
Dim builtinParamGroup As ForgeTypeId = New ForgeTypeId(GroupTypeId.Geometry.TypeId)
493+
Dim parameterTypeId As ForgeTypeId = SpecTypeId.Length
494494
Dim paramTw As FamilyParameter = _doc.FamilyManager.AddParameter("Tw", builtinParamGroup, parameterTypeId, False)
495495
Dim paramTd As FamilyParameter = _doc.FamilyManager.AddParameter("Td", builtinParamGroup, parameterTypeId, False)
496496

Labs/3_Revit_Family_API/SourceVB/3_ColumnFormulaMaterial.vb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,8 @@ Public Class RvtCmd_FamilyCreateColumnFormulaMaterial
501501
''
502502
'' parameter group for Dimension is PG_GEOMETRY in API
503503
''
504-
Dim builtinParamGroup As ForgeTypeId = New ForgeTypeId(BuiltInParameterGroup.PG_GEOMETRY.ToString())
505-
Dim parametertype As ForgeTypeId = New ForgeTypeId(SpecTypeId.Length.ToString())
504+
Dim builtinParamGroup As ForgeTypeId = New ForgeTypeId(GroupTypeId.Geometry.TypeId)
505+
Dim parametertype As ForgeTypeId = SpecTypeId.Length
506506
Dim paramTw As FamilyParameter = _doc.FamilyManager.AddParameter("Tw", builtinParamGroup, parametertype, False)
507507
Dim paramTd As FamilyParameter = _doc.FamilyManager.AddParameter("Td", builtinParamGroup, parametertype, False)
508508

@@ -768,8 +768,8 @@ Public Class RvtCmd_FamilyCreateColumnFormulaMaterial
768768
'' this time we use instance parameter so that we can change it at instance level.
769769
''
770770
Dim pFamilyMgr As FamilyManager = _doc.FamilyManager
771-
Dim builtinParamGroup As ForgeTypeId = New ForgeTypeId(BuiltInParameterGroup.PG_MATERIALS.ToString())
772-
Dim parametertype As ForgeTypeId = New ForgeTypeId(SpecTypeId.Reference.Material.ToString())
771+
Dim builtinParamGroup As ForgeTypeId = New ForgeTypeId(GroupTypeId.Materials.TypeId)
772+
Dim parametertype As ForgeTypeId = SpecTypeId.Reference.Material
773773
Dim famParamFinish As FamilyParameter = pFamilyMgr.AddParameter("ColumnFinish", builtinParamGroup, parametertype, True)
774774

775775
'' (2b.1) associate material parameter to the family parameter we just added

Labs/3_Revit_Family_API/SourceVB/4_ColumnVisibility.vb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,8 @@ Public Class RvtCmd_FamilyCreateColumnVisibility
512512
''
513513
'' parameter group for Dimension is PG_GEOMETRY in API
514514
''
515-
Dim builtinParamgroupTypeId As ForgeTypeId = New ForgeTypeId(BuiltInParameterGroup.PG_GEOMETRY.ToString())
516-
Dim parameterTypeId As ForgeTypeId = New ForgeTypeId(SpecTypeId.Length.ToString())
515+
Dim builtinParamgroupTypeId As ForgeTypeId = New ForgeTypeId(GroupTypeId.Geometry.TypeId)
516+
Dim parameterTypeId As ForgeTypeId = SpecTypeId.Length
517517
Dim paramTw As FamilyParameter = _doc.FamilyManager.AddParameter("Tw", builtinParamgroupTypeId, parameterTypeId, False)
518518
Dim paramTd As FamilyParameter = _doc.FamilyManager.AddParameter("Td", builtinParamgroupTypeId,parameterTypeId, False)
519519

@@ -778,8 +778,8 @@ Public Class RvtCmd_FamilyCreateColumnVisibility
778778
'' this time we use instance parameter so that we can change it at instance level.
779779
''
780780
Dim pFamilyMgr As FamilyManager = _doc.FamilyManager
781-
Dim builtinParamgroupTypeId As ForgeTypeId = New ForgeTypeId(BuiltInParameterGroup.PG_MATERIALS.ToString())
782-
Dim parameterTypeId As ForgeTypeId = New ForgeTypeId(SpecTypeId.Reference.Material.ToString())
781+
Dim builtinParamgroupTypeId As ForgeTypeId = New ForgeTypeId(GroupTypeId.Materials.TypeId)
782+
Dim parameterTypeId As ForgeTypeId = SpecTypeId.Reference.Material
783783
Dim famParamFinish As FamilyParameter = pFamilyMgr.AddParameter("ColumnFinish", builtinParamgroupTypeId, parameterTypeId, True)
784784

785785
'' (2b.1) associate material parameter to the family parameter we just added

0 commit comments

Comments
 (0)