Skip to content

Commit

Permalink
removed unit related deprecated api calls
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremytammik committed Jan 11, 2021
1 parent 4f87712 commit de5858a
Show file tree
Hide file tree
Showing 37 changed files with 64 additions and 57 deletions.
11 changes: 7 additions & 4 deletions 1_Revit_API_Intro/SourceCS/6_ExtensibleStorage.cs
Expand Up @@ -132,7 +132,8 @@ public bool AllowReference(Reference r, XYZ p)

// Set unit type

fieldBuilder1.SetUnitType(UnitType.UT_Length);
//fieldBuilder1.SetUnitType( UnitType.UT_Length ); // 2020
fieldBuilder1.SetSpec(SpecTypeId.Length); // 2021

// Add documentation (optional)

Expand All @@ -151,7 +152,8 @@ public bool AllowReference(Reference r, XYZ p)

Entity ent = new Entity(schema);
Field socketLocation = schema.GetField("SocketLocation");
ent.Set<XYZ>(socketLocation, new XYZ(2, 0, 0), DisplayUnitType.DUT_METERS);
//ent.Set<XYZ>( socketLocation, new XYZ( 2, 0, 0 ), DisplayUnitType.DUT_METERS ); // 2020
ent.Set<XYZ>( socketLocation, new XYZ( 2, 0, 0 ), UnitTypeId.Meters ); // 2021

Field socketNumber = schema.GetField("SocketNumber");
ent.Set<string>(socketNumber, "200");
Expand Down Expand Up @@ -193,8 +195,9 @@ public bool AllowReference(Reference r, XYZ p)
Entity wallSchemaEnt = wall.GetEntity(Schema.Lookup(_guid));

XYZ wallSocketPos = wallSchemaEnt.Get<XYZ>(
Schema.Lookup(_guid).GetField("SocketLocation"),
DisplayUnitType.DUT_METERS);
Schema.Lookup( _guid ).GetField( "SocketLocation" ),
//DisplayUnitType.DUT_METERS); // 2020
UnitTypeId.Meters ); // 2021

s = "SocketLocation: " + Format.PointString(wallSocketPos);

Expand Down
4 changes: 2 additions & 2 deletions 1_Revit_API_Intro/SourceCS/Properties/AssemblyInfo.cs
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "2021.0.0.1" )]
[assembly: AssemblyFileVersion( "2021.0.0.1" )]
[assembly: AssemblyVersion( "2021.0.0.4" )]
[assembly: AssemblyFileVersion( "2021.0.0.4" )]
2 changes: 1 addition & 1 deletion 1_Revit_API_Intro/SourceVB/1_HelloWorld.vb
@@ -1,5 +1,5 @@
#Region "Copyright"
' Copyright (C) 2009-2020 by Autodesk, Inc.
' Copyright (C) 2009-2021 by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software in
' object code form for any purpose and without fee is hereby granted,
Expand Down
2 changes: 1 addition & 1 deletion 1_Revit_API_Intro/SourceVB/2_DbElement.vb
@@ -1,6 +1,6 @@
#Region "Copyright"
'
' Copyright (C) 2009-2020 by Autodesk, Inc.
' Copyright (C) 2009-2021 by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software in
' object code form for any purpose and without fee is hereby granted,
Expand Down
2 changes: 1 addition & 1 deletion 1_Revit_API_Intro/SourceVB/3_ElementFiltering.vb
@@ -1,6 +1,6 @@
#Region "Copyright"
'
' Copyright (C) 2009-2020 by Autodesk, Inc.
' Copyright (C) 2009-2021 by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software in
' object code form for any purpose and without fee is hereby granted,
Expand Down
2 changes: 1 addition & 1 deletion 1_Revit_API_Intro/SourceVB/4_ElementModification.vb
@@ -1,6 +1,6 @@
#Region "Copyright"
'
' Copyright (C) 2009-2020 by Autodesk, Inc.
' Copyright (C) 2009-2021 by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software in
' object code form for any purpose and without fee is hereby granted,
Expand Down
2 changes: 1 addition & 1 deletion 1_Revit_API_Intro/SourceVB/5_ModelCreation.vb
@@ -1,6 +1,6 @@
#Region "Copyright"
'
' Copyright (C) 2009-2020 by Autodesk, Inc.
' Copyright (C) 2009-2021 by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software in
' object code form for any purpose and without fee is hereby granted,
Expand Down
2 changes: 1 addition & 1 deletion 1_Revit_API_Intro/SourceVB/5_ModelCreationExport.vb
@@ -1,6 +1,6 @@
#Region "Copyright"
'
' Copyright (C) 2009-2020 by Autodesk, Inc.
' Copyright (C) 2009-2021 by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software in
' object code form for any purpose and without fee is hereby granted,
Expand Down
20 changes: 12 additions & 8 deletions 1_Revit_API_Intro/SourceVB/6_ExtensibleStorage.vb
@@ -1,6 +1,6 @@
#Region "Copyright"
'
' Copyright (C) 2009-2020 by Autodesk, Inc.
' Copyright (C) 2009-2021 by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software in
' object code form for any purpose and without fee is hereby granted,
Expand Down Expand Up @@ -125,12 +125,13 @@ Friend Class ExtensibleStorage

' Create field1

Dim fieldBuilder1 As FieldBuilder = _
builder.AddSimpleField("SocketLocation", GetType(XYZ)).SetUnitType(UnitType.UT_Length)
Dim fieldBuilder1 As FieldBuilder =
builder.AddSimpleField("SocketLocation", GetType(XYZ)) '.SetUnitType(UnitType.UT_Length)

' Set unit type

fieldBuilder1.SetUnitType(UnitType.UT_Length)
' fieldBuilder1.SetUnitType(UnitType.UT_Length) ' 2020
fieldBuilder1.SetSpec(SpecTypeId.Length) ' 2021

' Add documentation (optional)

Expand All @@ -149,7 +150,8 @@ Friend Class ExtensibleStorage

Dim ent As New Entity(schema)
Dim socketLocation As Field = schema.GetField("SocketLocation")
ent.Set(Of XYZ)(socketLocation, New XYZ(2, 0, 0), DisplayUnitType.DUT_METERS)
'ent.Set(Of XYZ)(socketLocation, New XYZ(2, 0, 0), DisplayUnitType.DUT_METERS) ' 2020
ent.Set(Of XYZ)(socketLocation, New XYZ(2, 0, 0), UnitTypeId.Meters) ' 2021

Dim socketNumber As Field = schema.GetField("SocketNumber")
ent.Set(Of String)(socketNumber, "200")
Expand Down Expand Up @@ -189,9 +191,11 @@ Friend Class ExtensibleStorage

Dim wallSchemaEnt As Entity = wall.GetEntity(schema.Lookup(_guid))

Dim wallSocketPos As XYZ = wallSchemaEnt.Get(Of XYZ)( _
schema.Lookup(_guid).GetField("SocketLocation"), _
DisplayUnitType.DUT_METERS)
Dim wallSocketPos As XYZ = wallSchemaEnt.Get(Of XYZ)(
Schema.Lookup(_guid).GetField("SocketLocation"),
UnitTypeId.Meters) ' 2021

' DisplayUnitType.DUT_METERS) ' 2020

s = "SocketLocation: " + Format.PointString(wallSocketPos)

Expand Down
2 changes: 1 addition & 1 deletion 1_Revit_API_Intro/SourceVB/7_SharedParameter.vb
@@ -1,6 +1,6 @@
#Region "Copyright"
'
' Copyright (C) 2009-2020 by Autodesk, Inc.
' Copyright (C) 2009-2021 by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software in
' object code form for any purpose and without fee is hereby granted,
Expand Down
4 changes: 2 additions & 2 deletions 1_Revit_API_Intro/SourceVB/My Project/AssemblyInfo.vb
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("2021.0.0.1")>
<Assembly: AssemblyFileVersion("2021.0.0.1")>
<Assembly: AssemblyVersion("2021.0.0.4")>
<Assembly: AssemblyFileVersion("2021.0.0.4")>
2 changes: 1 addition & 1 deletion 1_Revit_API_Intro/SourceVB/Util.vb
@@ -1,6 +1,6 @@
#Region "Copyright"
'
' Copyright (C) 2009-2020 by Autodesk, Inc.
' Copyright (C) 2009-2021 by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software in
' object code form for any purpose and without fee is hereby granted,
Expand Down
4 changes: 2 additions & 2 deletions 2_Revit_UI_API/SourceCS/Properties/AssemblyInfo.cs
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "2021.0.0.1" )]
[assembly: AssemblyFileVersion( "2021.0.0.1" )]
[assembly: AssemblyVersion( "2021.0.0.4" )]
[assembly: AssemblyFileVersion( "2021.0.0.4" )]
2 changes: 1 addition & 1 deletion 2_Revit_UI_API/SourceVB/1_Ribbon.vb
@@ -1,6 +1,6 @@
#Region "Copyright"
'
' Copyright (C) 2009-2020 by Autodesk, Inc.
' Copyright (C) 2009-2021 by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software in
' object code form for any purpose and without fee is hereby granted,
Expand Down
2 changes: 1 addition & 1 deletion 2_Revit_UI_API/SourceVB/2_Selection.vb
@@ -1,6 +1,6 @@
#Region "Copyright"
'
' Copyright (C) 2009-2020 by Autodesk, Inc.
' Copyright (C) 2009-2021 by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software in
' object code form for any purpose and without fee is hereby granted,
Expand Down
2 changes: 1 addition & 1 deletion 2_Revit_UI_API/SourceVB/3_TaskDialog.vb
@@ -1,6 +1,6 @@
#Region "Copyright"
'
' Copyright (C) 2009-2020 by Autodesk, Inc.
' Copyright (C) 2009-2021 by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software in
' object code form for any purpose and without fee is hereby granted,
Expand Down
2 changes: 1 addition & 1 deletion 2_Revit_UI_API/SourceVB/4_Event.vb
@@ -1,6 +1,6 @@
#Region "Copyright"
'
' Copyright (C) 2009-2020 by Autodesk, Inc.
' Copyright (C) 2009-2021 by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software in
' object code form for any purpose and without fee is hereby granted,
Expand Down
4 changes: 2 additions & 2 deletions 2_Revit_UI_API/SourceVB/My Project/AssemblyInfo.vb
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("2021.0.0.1")>
<Assembly: AssemblyFileVersion("2021.0.0.1")>
<Assembly: AssemblyVersion("2021.0.0.4")>
<Assembly: AssemblyFileVersion("2021.0.0.4")>
4 changes: 2 additions & 2 deletions 3_Revit_Family_API/SourceCS/Properties/AssemblyInfo.cs
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "2021.0.0.1" )]
[assembly: AssemblyFileVersion( "2021.0.0.1" )]
[assembly: AssemblyVersion( "2021.0.0.4" )]
[assembly: AssemblyFileVersion( "2021.0.0.4" )]
2 changes: 1 addition & 1 deletion 3_Revit_Family_API/SourceVB/1_ColumnRectangle.vb
@@ -1,6 +1,6 @@
#Region "Copyright"
''
'' (C) Copyright 2009-2020 by Autodesk, Inc.
'' (C) Copyright 2009-2021 by Autodesk, Inc.
''
'' Permission to use, copy, modify, and distribute this software in
'' object code form for any purpose and without fee is hereby granted,
Expand Down
2 changes: 1 addition & 1 deletion 3_Revit_Family_API/SourceVB/2_ColumnLshape.vb
@@ -1,6 +1,6 @@
#Region "Copyright"
''
'' (C) Copyright 2009-2020 by Autodesk, Inc.
'' (C) Copyright 2009-2021 by Autodesk, Inc.
''
'' Permission to use, copy, modify, and distribute this software in
'' object code form for any purpose and without fee is hereby granted,
Expand Down
2 changes: 1 addition & 1 deletion 3_Revit_Family_API/SourceVB/3_ColumnFormulaMaterial.vb
@@ -1,6 +1,6 @@
#Region "Copyright"
''
'' (C) Copyright 2009-2020 by Autodesk, Inc.
'' (C) Copyright 2009-2021 by Autodesk, Inc.
''
'' Permission to use, copy, modify, and distribute this software in
'' object code form for any purpose and without fee is hereby granted,
Expand Down
2 changes: 1 addition & 1 deletion 3_Revit_Family_API/SourceVB/4_ColumnVisibility.vb
@@ -1,6 +1,6 @@
#Region "Copyright"
''
'' (C) Copyright 2009-2020 by Autodesk, Inc.
'' (C) Copyright 2009-2021 by Autodesk, Inc.
''
'' Permission to use, copy, modify, and distribute this software in
'' object code form for any purpose and without fee is hereby granted,
Expand Down
6 changes: 3 additions & 3 deletions 3_Revit_Family_API/SourceVB/My Project/AssemblyInfo.vb
Expand Up @@ -11,7 +11,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyDescription("Revit Family API Labs")>
<Assembly: AssemblyCompany("Autodesk, Inc.")>
<Assembly: AssemblyProduct("RFA LabsVb")>
<Assembly: AssemblyCopyright("Copyright © 2009-2020 by Autodesk, Inc.")>
<Assembly: AssemblyCopyright("Copyright © 2009-2021 by Autodesk, Inc.")>
<Assembly: AssemblyTrademark("")>

<Assembly: ComVisible(False)>
Expand All @@ -30,5 +30,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("2021.0.0.1")>
<Assembly: AssemblyFileVersion("2021.0.0.1")>
<Assembly: AssemblyVersion("2021.0.0.4")>
<Assembly: AssemblyFileVersion("2021.0.0.4")>
2 changes: 1 addition & 1 deletion 3_Revit_Family_API/SourceVB/Utils.vb
@@ -1,6 +1,6 @@
#Region "Copyright"
''
'' Copyright (C) 2009-2020 by Autodesk, Inc.
'' Copyright (C) 2009-2021 by Autodesk, Inc.
''
'' Permission to use, copy, modify, and distribute this software in
'' object code form for any purpose and without fee is hereby granted,
Expand Down
4 changes: 2 additions & 2 deletions XtraCs/Properties/AssemblyInfo.cs
Expand Up @@ -31,5 +31,5 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion( "2021.0.0.1" )]
[assembly: AssemblyFileVersion( "2021.0.0.1" )]
[assembly: AssemblyVersion( "2021.0.0.4" )]
[assembly: AssemblyFileVersion( "2021.0.0.4" )]
2 changes: 1 addition & 1 deletion XtraVb/Lab3_4_Form.vb
@@ -1,7 +1,7 @@
#Region "Header"
' Revit API .NET Labs
'
' Copyright (C) 2007-2020 by Autodesk, Inc.
' Copyright (C) 2007-2021 by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software
' for any purpose and without fee is hereby granted, provided
Expand Down
2 changes: 1 addition & 1 deletion XtraVb/LabConstants.vb
@@ -1,7 +1,7 @@
#Region "Header"
' Revit API .NET Labs
'
' Copyright (C) 2006-2020 by Autodesk, Inc.
' Copyright (C) 2006-2021 by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software
' for any purpose and without fee is hereby granted, provided
Expand Down
2 changes: 1 addition & 1 deletion XtraVb/LabUtils.vb
@@ -1,7 +1,7 @@
#Region "Header"
' Revit API .NET Labs
'
' Copyright (C) 2006-2020 by Autodesk, Inc.
' Copyright (C) 2006-2021 by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software
' for any purpose and without fee is hereby granted, provided
Expand Down
2 changes: 1 addition & 1 deletion XtraVb/Labs1.vb
@@ -1,7 +1,7 @@
#Region "Header"
' Revit API .NET Labs
'
' Copyright (C) 2006-2020 by Autodesk, Inc.
' Copyright (C) 2006-2021 by Autodesk, Inc.
'
' Permission to use, copy, modify, and distribute this software
' for any purpose and without fee is hereby granted, provided
Expand Down
2 changes: 1 addition & 1 deletion XtraVb/Labs2.vb
@@ -1,7 +1,7 @@
#Region "Header"
'Revit API .NET Labs

'Copyright (C) 2006-2020 by Autodesk, Inc.
'Copyright (C) 2006-2021 by Autodesk, Inc.

'Permission to use, copy, modify, and distribute this software
'for any purpose and without fee is hereby granted, provided
Expand Down
2 changes: 1 addition & 1 deletion XtraVb/Labs3.vb
@@ -1,7 +1,7 @@
#Region "Header"
'Revit API .NET Labs

'Copyright (C) 2006-2020 by Autodesk, Inc.
'Copyright (C) 2006-2021 by Autodesk, Inc.

'Permission to use, copy, modify, and distribute this software
'for any purpose and without fee is hereby granted, provided
Expand Down
2 changes: 1 addition & 1 deletion XtraVb/Labs4.vb
@@ -1,7 +1,7 @@
#Region "Header"
'Revit API .NET Labs

'Copyright (C) 2006-2020 by Autodesk, Inc.
'Copyright (C) 2006-2021 by Autodesk, Inc.

'Permission to use, copy, modify, and distribute this software
'for any purpose and without fee is hereby granted, provided
Expand Down
2 changes: 1 addition & 1 deletion XtraVb/Labs5.vb
@@ -1,7 +1,7 @@
#Region "Header"
'Revit API .NET Labs

'Copyright (C) 2006-2020 by Autodesk, Inc.
'Copyright (C) 2006-2021 by Autodesk, Inc.

'Permission to use, copy, modify, and distribute this software
'for any purpose and without fee is hereby granted, provided
Expand Down
2 changes: 1 addition & 1 deletion XtraVb/Labs6.vb
@@ -1,7 +1,7 @@
#Region "Header"
'Revit API .NET Labs

'Copyright (C) 2006-2020 by Autodesk, Inc.
'Copyright (C) 2006-2021 by Autodesk, Inc.

'Permission to use, copy, modify, and distribute this software
'for any purpose and without fee is hereby granted, provided
Expand Down
2 changes: 1 addition & 1 deletion XtraVb/Labs7.vb
@@ -1,7 +1,7 @@
#Region "Header"
'Revit API .NET Labs

'Copyright (C) 2006-2020 by Autodesk, Inc.
'Copyright (C) 2006-2021 by Autodesk, Inc.

'Permission to use, copy, modify, and distribute this software
'for any purpose and without fee is hereby granted, provided
Expand Down
6 changes: 3 additions & 3 deletions XtraVb/My Project/AssemblyInfo.vb
Expand Up @@ -12,7 +12,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyDescription("Revit API Introduction XtraVb Labs")>
<Assembly: AssemblyCompany("Autodesk, Inc.")>
<Assembly: AssemblyProduct("XtraVb")>
<Assembly: AssemblyCopyright("Copyright © 2007-2020 by Autodesk, Inc.")>
<Assembly: AssemblyCopyright("Copyright © 2007-2021 by Autodesk, Inc.")>
<Assembly: AssemblyTrademark("")>
<Assembly: CLSCompliant(True)>

Expand All @@ -29,6 +29,6 @@ Imports System.Runtime.InteropServices
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("2021.0.0.1")>
<Assembly: AssemblyFileVersion("2021.0.0.1")>
<Assembly: AssemblyVersion("2021.0.0.4")>
<Assembly: AssemblyFileVersion("2021.0.0.4")>
<Assembly: ComVisibleAttribute(False)>

0 comments on commit de5858a

Please sign in to comment.