Export all shared parameters to shared parameters txt file

I have put the following graph together which will collect all the shared parameters from revit file (titleblock family in my case) and put them in the same format as shared parameter.txt file i.e values are separated by tabs

If i use “AppendText” node to add these to my existing shared parameters file, i end up with this

Can someone help or point me to ther right direction on how to add these to my shared parameter.txt file please. Thanks

Export Shared Parameters-WIP.dyn (39.0 KB)

Where are the SharedParameters nodes coming from? I can’t replicate your results without them. Also, it looks like you might be missing a few fields. If you take the sharedparameters.txt file and paste it into a spreadsheet, you can make sure that each field lines up with the proper header (you need to add another tab for DATACATEGORY and DESCRIPTION for the fields to line up properly.

I will be using this mainly for titleblocks.
Title_Blocks_A1_Metric.rfa (412 KB)

Once i figure out how to write to revit SP file, then i will add other fields to it :+1:

Thanks for including the family as well–but I’m also trying to figure out where SharedParameters.GUID and SharedParameters.Info are downloaded from as they’re not included in Dynamo by default.

Hi,
they are from “Zhukoven” Package

Here is as far as I’ve gotten:


Export Shared Parameters-WIP (1).dyn (35.7 KB)

import sys
sys.path.append(r'C:\Program Files (x86)\IronPython 2.7\Lib')
sys.path.append(r'C:\Program Files\IronPython 2.7\Lib')
import io

filepath = IN[0]
parameter_lists = IN[1]
id = IN[2]
name = IN[3]

# Separate all fields using tab char
parameters_in = ['\t'.join(p)+'\n' for p in parameter_lists]
# Create new group separated by tab chars
new_group = '{g}\t{i}\t{n}\n'.format(g='GROUP', i=id, n=name)
parameters_out = []

with io.open(filepath, 'r', encoding='utf-16') as f:
	lines = f.readlines()
	for line in lines:
		parameters_out.append(line)
		# Insert new group after *GROUP key
		if line[:6] == '*GROUP':
			parameters_out.append(new_group)
	parameters_out.extend(parameters_in)

# Overwrite existing file with new data
with io.open(filepath, 'w', encoding='utf-16') as f:
	f.writelines(parameters_out)
	f.write('')

Revit still doesn’t consider this a valid shared parameters file, so I’m not sure what’s exactly happening but I’ve discovered a few things.

  1. The shared parameters txt file appears to be encoded in UTF-16, as evidenced by null characters between every character if written in binary.

  2. You are missing a few fields in your inputs, as noted in my other comment.

  3. A group has to be added after the *GROUP line as shared parameters must exist within a group.

This is the output of the graph using the default construction template:

1 Like

Thank you very much, very busy today / tomorrow with some deadlines.
I will have a look once i get chance. Thanks again for your help