I am in a family and want to add parameters. Below is my python node but I am missing something.
#import module for Revit
#import Revit API
from Autodesk.Revit.DB import *
#import module for the Document and transcactions
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
paramName = IN
exec(“paramGroup = BuiltInParameterGroup.%s” % IN)
exec(“paramType = ParameterType.%s” % IN)
paramBool = IN
addParam = doc.FamilyManager
newParam = addParam.AddParameter(paramName,param_Group,paramType,paramBool)
newParam = “could not create new parameter”
OUT = newParam
When sharing code please paste it as preformatted text - this post here shows a gif on how to do so properly:
However, you do not need to use Python here as there is a node for adding parameters in a Family Document in the Orchid package
Thank you for the reply. Yes I am aware of Orchid and have a previous version to the newest downloaded in Dynamo. The purpose for asking the question is a learning lesson using the API.chm, dynamo and python.
I believe I have all necessary references and variables included. I called for the Family Manager and Add Parameter method with all necessary variables but no joy. In my script the (try and except) is indented as required (not as shown above).
Any help is appreciated.
No Orchid work as designed. Just trying to learn to code myself, most of the time I can work thru but this has me stumped
Sorry I didn’t recognize you are the developer of Orchid and be assured I have no desire to post, copy or steal any of your content. I very seldom post on any of the forums any longer. I have been working with Revit from 2003 and I am near the end of my career and just having fun now. Also totally understand your point of view and appreciate you work.
Thanks for your reply.