Add Shared Parameter to Project

**

Add Shared Parameter to Project (better it can be to Family directly.)

**

As you can see using the node from Archi-lab and after following steps from various post i always end this way. In both cases it creates the Group Parameter with the Shared Parameter Group Name but nothing else.

Function:

Null:

Someone can help me with this? Should be really easy… but i cant manage to make it work!!

Im working in Revit 2015 -Dynamo 1.2

Can you Share Dummy Revit and Dynamo files?Check
Share parameter file.Create a new share parameter file and check.

Revit File:

Proyecto Base.rvt (616 KB)

Dynamo File:

Add Shared Parameters Null.dyn (12.4 KB)

Shared Parameter File:
Dynamo_PARAMETROS.txt (402 Bytes)

@bikashseas Thanks for the quick response.

The only difference i found in your screenshot is the node Parameter Type. Mine looks like the one from categories. I can’t manage to find one similar to the Parameter Group or like yours.

But don’t know if that’s the problem.

Would you mind to pass me the Python Code from that Custom Node ( Parameter Type)

Create New share parameter file and check.Its working here.

Ok Thanks.

Would you mind to pass me the Python Code from that Custom Node ( Parameter Type), i would like to duplicate this node.

I’m trying with this code from @Konrad_K_Sobon , but it doesn’t work:

#Copyright© 2015, Konrad Sobon

@arch_laboratory, http://archi-lab.net

import clr
clr.AddReference(“ProtoGeometry”)
from Autodesk.DesignScript.Geometry import *

Import DocumentManager and TransactionManager

clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

Import RevitAPI

clr.AddReference(“RevitAPI”)
import Autodesk
from Autodesk.Revit.DB import *
import System

#Assign your output to the OUT variable
OUT = System.Enum.GetValues(ParameterType)


Check, i’m trying but no success:

I’ve ran into this issue before. The “parameter type” node doesn’t work well with the “Add Shared Parameter to Project” node. Here is what I have done. It works flawlessly. The only difference is mine is for adding shared parameters to a family.

1 Like

@kiknchikn2060 thanks for your quick answer. I can’t find none of this nodes:

Document.AddSharedParamsToFamily

Document.GetSharedParamsGroupNames

Document.GetSharedParamsInGroup

Which packages i must download?

When i get this nodes i’ll try your way, because was my final point in all of this. Insert the Shared Parameters inside a family. But of course i’ll like to learn all possible ways. And i really can’t understand why ins’t working the first 2 images.

I’m looking forward to hearing from you soon.

Thanks again.

https://drive.google.com/open?id=0B2BbPdT34g8QSk0ySi1kT3dpTTA
Here is the dll file. Please download it asap. It might get moved or deleted over time. This should include all the nodes you asked about. Just place it in the same folder as your packages and import it using menu option Library>ImportLibraries.

@kiknchikn2060 i downloaded the file, copied in the folder with the other packages. Then Library>ImportLibraries and this message appeared:

Says: Can’t Upload the library: …

Well shoot. Try removing it from you packages folder and re-import. If that doesn’t work, I will need the assistance of the Dynamo gurus.

Happens the same from every path i locate the .dll file… Who are the Dynamo Gurus? Maybe @Konrad_K_Sobon or @Kulkul or @Mostafa_El_Ayoubi I’d like some help please.

Yup. Those are the gurus. I’m only on my 3rd month of dynamo experience. Ok. So I made it a package and published it online. Search for Dyn_SharedParamTesting. See if that works.

Hi @Raul.Galdran

Make sure you “Unblock” dll file by right clicking it.


I tested your file it works for me. Below is the process in action:

1 Like

@Kulkul Thanks for the tip. It worked perfectly. Now i’ll try the nodes from @kiknchikn2060

Original Topic

About the original topic of the discussion. I just realized that the problem is that im working with new version API 2016 so the code has changed.

@bikashseas @kiknchikn2060

So in the end it worked with this solution that i found in this post:

http://dynamobim.org/forums/topic/shared-parameter-creation-from-list/

Code modified from the Python.Script of the custom node Add Shared Parameter to Project from Archi-lab:

def addParam(doc, _paramName, _visible, _instance, _groupName, _paramGroup):
	message = None
	if ParamBindingExists(doc, _paramName, _paramType):
		if not RemoveParamBinding(doc, _paramName, _paramType) == "Success":
			message = "Param Binding Not Removed Successfully"
		else:
			message = None
			
	group = file.Groups.get_Item(_groupName)
	if group == None:
		group = file.Groups.Create(_groupName)	

	if group.Definitions.Contains(group.Definitions.Item[_paramName]):
		_def = group.Definitions.Item[_paramName]
	else:
###		_def = group.Definitions.Create(_paramName, _paramType, _visible)
		opt = ExternalDefinitionCreationOptions(_paramName, _paramType)
		opt.Visible = _visible;
		_def = group.Definitions.Create(opt)
		
	param = doc.ParameterBindings.Insert(_def, bind, _paramGroup)
	return message

Thanks a lot for you help and time.

1 Like

@Raul.Galdran Don’t forget to mark the post as solved. Thanks :slight_smile:

2 Likes

Hi @Raul.Galdran,

Did the Dyn_sharedParamsTesting.dll not work? I wrote that node (and the link that @kiknchikn2060 posted is my google drive), it seems to work for me and others.

Unblocking the .dll as @Kulkul said should get it into Dynamo, but you said there is an API change causing it to fail? Is there any balloon error message with the node?

I see that you’ve got to a solution already, but for my peace of mind, If there is an error I’ll still update the .dll.

Cheers,
Dan

Sorry I didn’t give you credit. I forgot who shared that with me. I will remove the package as well that I published or keep it and put your name as the creator.

@kiknchikn2060,

Nah, you’re all good buddy. That nodes for anyone. I’m concerned that it doesn’t work and that means i need to have a look at it as i developed it. The stuff in that folder is for anyone to share.

Cheers,
Dan