Apologies if this is already been solved.
There are similar discussion in the forum regarding this topic but I can’t find/figure out the solution.
The FamilyManager.AddParameter Method doesn’t accept a list but just a string.
Can it be iterated? or a completely different method is needed to achieve this.
Alisder, It's possible but both I and others have already shown that many times in the forum. You could either search in the forum or check the great python examples inside node from Clockwork or Archi-lab. I always try to keep the code that I post to a minimum - this site makes any code sniplets unusable and the only other alternative, images, is hard to replicate. On your second question, Konrad's node uses the shared parameter file to get the internal definitions for the parameter group a…
Try wrapping python script in to custom node.
Do you mean creating a custom node using the python script?
If so, I tried that and it’s giving me a null value
@salvatoredragotta Alright try this:
I had to add in order to work (before starting the transaction):
doc = DocumentManager.Instance.CurrentDBDocument.
Thanks a lot!
Hello, I am getting an error “unexpected token RevitServices”
Can someone explain why? or how to solve it?
Could you please show me your complete python script.
Hey, nice work guys!
Is there possibility to add to the python script parameter type and parameter group as input value?
@Kulkul Thanks for the fast reply.
Here is the script plus the error I get.
@moraruandrei29 You have typo error:
@Kulkul Thanks a lot man, I am new to Python, I had some more mistakes, but I fixed it and now is working.
I am new to python in Dynamo.
Could anybody take a look, whats wrong with code?
I am trying to add multiple Yes/No patameters (001, 002, 003…), in other section.
So you will need to be incredibly diligent with your working, spacing and captial letters. Make sure it is identical to what the above python script has and it will work! i will copy and paste mine below.
Load the Python Standard and DesignScript Libraries
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
from Autodesk.Revit.DB import *
par_name = IN
par_type = ParameterType.Text
par_grp = BuiltInParameterGroup.PG_DATA
for i in IN:
doc.FamilyManager.AddParameter(i,par_grp, par_type, True)
this is awesome thank you!
Try saving it, closing it and opening it. it did that for me too.
also check that the parameters didnt make anyway. that also happened to me