Unable to add multiple SP to multiple families

I’ve been trying to add multiple shared parameters into multiple families and have been unable to incorporate the DanEDU nodes I found. I have attached an image showing that I’m not even able to find the test families using the node, but when I use the “Directory.Contents+” node I can. I’m assuming not being able to use his initial node is causing problems farther down the script because even with the Directory.Contents node it still isn’t Adding the parameters from the SP file.
BulkUpgrade-sharedParameter.dyn (20.5 KB)

Thank you for replying so soon, but I still was unable to get it to work. I tried changing the text and it didn’t seem to have any effect. I have made sure that the files are not “read only” as well. Why is the other node able to find the families but your node is not?

Try unistalling DanEdu package and reinstall it back again.

Thank you Kulkul for that recommendation but it did not work either… I did notice this warning I get when I start up Dynamo, could it be impacting his nodes? Also, I only have Dynamo version 1.3.2 installed
image

Uninstall all the custom packages and install first DanEdu package and then RHYTHM.

So I removed everything and then reinstalled the two packages and now I’m receiving some feedback from the node. I also no longer have the “System.IO.FileLoadException” error. Also, I probably should have mentioned this earlier but I’m using Revit 2016

Gave it a shot but it did not work. I’ll let you know if it works when I upgrade to Revit 2018 in the coming weeks, thanks!

@anelson It works for me in Revit 2016 :slight_smile:

1 Like

I guess that confirms that it has something to do with my settings… Thank you for checking on that!

I’m trying to run your code line by line from the console but I seem to be running into some issues. Shouldn’t when I run this code have some lines that return “found” instead of always being “not found” once it finds your assemblies? At first I thought maybe the IronPython console didn’t have permission due to our security but now I’m wondering if it is not allowing it to return information?

@erfajo I just tested the node as well and it appears that introducing the Python Script Reader|DanEDU node may be the culprit somehow… :thinking:

Seems to still not be returning anything. What do you have your permissions set as? Allow all, including special permissions?

I reinstalled the package to the most current version - sorry about that. I still get the same error regarding line 13 as well. The “DanEDUicon.dll” file does exist in that location. Its strange to me that the exact script works when read from file with OOTB nodes because nothing is different about line 13 :thinking:

@erfajo I wasn’t sure if I removed, closed, opened and replaced in that order so I just tried and have the same results. I ran the binaryPath script and these are my results:

[0] C:\Program files (x86)\IronPython 2.7\Lib
[1] C:\Users\AWilliams\AppData\Roaming\Dynamo\Dynamo Revit\1.3\packages\DanEDU Dynamo\extra\lib
[2] .

It seems as though the script is changed somehow when output from the Python Script Reader node, because the script works using File.ReadFromFile in place of that node. And when I copy and paste the output of that node and try running it I get the same error about line 13. But they appear to be the same from what I can tell. :face_with_raised_eyebrow:

EDIT: Ha I was only looking at line 13, d’oh. The differences are lines 0-3 where the paths are imported which are the same paths above, I understand the relation to the binary file better now. I don’t understand why that causes it to fail though.

Well, I don’t know exactly what you updated but now it works… I uninstalled the previous version and installed your new version and it seems to have fixed it. I’m curious if I uninstall your package and reinstall the old one if the problem will reappear, but I’m also reluctant to try and break it again.

Start a github? :smiley:

Oh I just like the idea of being able to poke my head in on what you’re up to every so often… a glimpse into the madness so to speak… :wink:

1 Like

So I was able to get the nodes to start working and I was able to set the three test SP’s using the “AddSharedParameter” node. Now i’m trying to add the formulas portion, but it doesn’t seem to be working. I’m trying to change the formula to set the SP_test2 to 1 but it seems to get stuck at that node because the “Application.CloseDocument” never closes it.

While the group I added the parameter to was “TEXT” the parameter takes a number.

With our freedom to pass diffferent input to our nodes in Dynamo, I think it would be difficult to indentify exactly what the user meant to do.

Personally, I think the more reasonable thing to do would be to provide some error handling.
You could try to catch common mistakes using Try/Except within your python script and provide some sort of error handling. In your example you could perhaps implement something clever with respect to the Parameter StorageType.

I generally do not like to modify the user input to a node, but just as a small demo of what I meant:

Is there a reason the “SP_parameterGroup” isn’t set up to accept an array as well? I have a lot of parameters that I use in my motor family and they vary from different groups, and instead of nesting the nodes I would prefer to keep it compact within the same Code Block. I also am questioning if I should just make a dynamo script that runs all the formulas and just push the values after the fact instead of making large formulas that are hindered by Revit.