Hello,
I am after a bit of help retrieving Shared Parameter element’s “ParameterType”
I revit 2022 and lower versions, I can see it under the GetDefinition
But I can’t see it on Revit 2023
Thanks for your help in advance
Hello,
I am after a bit of help retrieving Shared Parameter element’s “ParameterType”
I revit 2022 and lower versions, I can see it under the GetDefinition
That property is removed in 2023 API and after. See InternalDefinition Members
That page recommends using GetDataType, which is supported by 2022 and newer versions.
This is the value that comes out of GetDataType().TypeId
What you are seeing in the UI is the label for the backend definition of parameter type:
Text is autodesk.spec:spec.String-2.0.0
Length is autodesk.spec.aec:length-2.0.0
If you explain what your goal is, we may be able to help better.
I have a dynamo routine that exports all the shared parameters from a family ( title block family) and save them to the sharedparameters txt file, using Orchid’s shared parameters create package.
There is a python node that retrieve shared parameters group/ type etc and feed them to the create node…
I have been using it for a while and been working fine in the previous versions of revit, but it is not working on Revit 2023, hence my question.
Do you see any errors you can share? Between Revit 2022 and 2023, the only change I know which can impact this workflow is the transition from ParameterType to ForgeTypeId.
Make sure that the active shared parameter file in Revit actually exists and is accessible, and it does not already have some of the parameters, and it has the parameter groups you assigned.
You can see this post for reference: Batch export shared parameters - #4 by cgartland
When switching to ForgeTypeId, it looks like this:
p_names = ["p1","p2"]
p_guids = ["fa64ce9f-8e19-4623-874c-1b6520e55821","e8d9d570-52dd-4e75-ba8d-ddf84f050f3c"]
p_types = [ForgeTypeId("autodesk.spec:spec.string-2.0.0"),ForgeTypeId("autodesk.spec.aec:length-2.0.0")]
g_names = ["gg1","gg2"]
definition_file = app.OpenSharedParameterFile()
definition_groups = definition_file.Groups
for p_name, p_guid, p_type,g_name in zip(p_names, p_guids, p_types,g_names):
for group in definition_groups:
if group.Name == g_name:
ops = ExternalDefinitionCreationOptions(p_name, p_type)
# Construct a Guid from a string
ops.GUID = System.Guid(p_guid)
a = group.Definitions.Create(ops)
Thank you very much for your help.
It looks like there is something wrong with the node from Orchid Package, it is not working in Dynamo 2.16, even though I have downloaded latest packages.
Thanks for your help anyway