hi,
I have removed the _get but the problem is Parameter param, the error is: "Parameter is a type that can not be use as espression"
I post he total code:
Region
"Imports"
' Import the following name spaces in the project properties/references.
' Note: VB.NET has a slighly different way of recognizing name spaces than C#.
' if you explicitely set them in each .vb file, you will need to specify full name spaces.
'Imports System
'Imports Autodesk.Revit.DB
'Imports Autodesk.Revit.UI
'Imports Autodesk.Revit.ApplicationServices ' Application class
'Imports Autodesk.Revit.Attributes ' specific this if you want to save typing for attributes. e.g.,
'Imports Autodesk.Revit.UI.Selection ' for selection
Imports
Revit.Util.Constant
Imports
Revit.Util
Imports
System.Reflection
#End
Region
#Region
"Description"
' Revit Intro Lab - 2
'
' In this lab, you will learn how an element is represended in Revit.
' Disclaimer: minimum error checking to focus on the main topic.
'
#End
Region
'<Autodesk.Revit.Attributes.Regeneration(Attributes.RegenerationOption.Manual)>
'<Autodesk.Revit.Attributes.Transaction(Attributes.TransactionMode.Manual)>_
'<TransactionAttribute(Autodesk.Revit.Attributes.TransactionMode.Manual)> _
<
Transaction(TransactionMode.Automatic)> _
Public
ClassRevitCommand2ImplementsIExternalCommand
PublicFunctionExecute(commandDataAsExternalCommandData, ByRefmessagesAsString, elementsAsElementSet) AsResult_
ImplementsIExternalCommand.ExecuteDimappAsUIApplication = commandData.ApplicationDimdocAsDocument = app.ActiveUIDocument.DocumentDimselAsSelection = app.ActiveUIDocument.SelectionDimref1AsReference = sel.PickObject(ObjectType.Element, "Please pick title block")
DimtbAsFamilyInstance = TryCast(doc.GetElement(ref1), FamilyInstance)
'title block is a FamilyInstance
IftbIsNothingThenReturnResult.FailedEndIf
'If the target shared parameter is from the family symbol/ family type.DimSh_NameAsParameter = tb.Parameter(BuiltInParameter.SHEET_NAME)
DimSh_NumberAsParameter = tb.Parameter(BuiltInParameter.SHEET_NUMBER)
DimSh_ScaleAsParameter = tb.Parameter(BuiltInParameter.SHEET_SCALE)
DimparamAsParameter
'Dim param2 As Parameter = tb.Parameter("D2")'If the target shared parameter is from the family instance.Parameterparam = tb.Parameter("D2") '//directly use the shared parameter name
'show the fire rating in task dialog'TaskDialog.Show("target shared parameter value", param2.AsString())ReturnResult.Succeeded
End
Class