Check if a families nested family has its parameters associated from a project environment


#1

I know…that description is a bit convoluted but I will try to explain.

I am currently creating a graph that will be verifying certain things before allowing a user to proceed. One of those checks will be making sure a logo family that is nested within our titleblock family has had it’s parameters associated to the titleblocks parameters correctly.

I found this thread (Associate family parameter in a family) which has a python script written by the amazing @awilliams which allows the association of said parameters. I am wondering how hard it would be to modify this python script to simply check to see if a list of provided parameters are associated or not and return true/false values for each.

Thanks in advance!


#2

Not sure it works, I don’t have much time to test it, but I guess you can use this method from the API:
http://www.revitapidocs.com/2018.1/ada33bdc-f484-c4a6-3713-6946dabd5fcf.htm

Taking the script in that post, it might be something like this:

	for i,j in zip(elemAssoc,famAssoc):
		try:
			doc.FamilyManager.GetAssociatedFamilyParameter(i, j)
			result.append(True)
			
		except:
			result.append(False)

But I might be completely wrong, give a try!


#3

@lucamanzoni

I can’t seem to get this to work. I am getting the following error:
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 61, in
NameError: name ‘result’ is not defined


#4

My example was just an indication about which method to use, the script doesn’t work if you simply replace the part.
I started to edit that script but it takes some time, in the meantime have you tried without python?

For example, Clockwork package has a node that shows if an element parameter is associated with family parameter. I run a test associating the width of the Autodesk logo in the default Titleblock:


#5

I did try to handle this using nodes but I couldn’t find one. Thanks! I will try this.


#6

So this would work if it would also look for type parameters. Unfortunately it only seems to check instance parameters. >< I am going to put in a new feature request to see if it is something that can be worked into this node.


#7

Maybe @erfajo can help you, he always has a node for any kind of parameter :wink:


#8

I have nodes for Associate both for family documents and for documents…
check my sample collection to see if you can use something from there :slight_smile:


#9

@erfajo I know you have the Parameter.Associate node which allows the user to associate a parameter. What I am trying to do is check whether a family parameter is associated to a document parameter. Maybe you do have a node that accomplishes this but I have not been able to find it.

The ultimate goal is to do the following from a project environment:

  1. Select a family in a project
  2. Have dynamo check whether a nested family inside the selected family is associated to the correct parameters of the host family.

If it is not possible to accomplish that, being able to do the check within the family document would be better than nothing.


#10

aha a lookup if a parameter is being associated.

could you please put this in my wish list, so I can prioritize building it :slight_smile:


#11

@rdeardorff I think it should work for type parameters as well. Have you tried feeding it a family type instead of a f family instance?


#12

@Andreas_Dieckmann Thanks, that did work.

@erfajo I will add it this afternoon.


#13

@rdeardorff,

here is the new node checking if a parameter has associated elements (…in upper right corner)

-Orchid package --> released at Github


#14

New nodes released to handle “Associate”