Active family parameter

Hi everyone,

I am wondering if anyone has a way to get and set active family parameters. All searched a lot and the best I could finf was a package from 2014 that doesnt seem to work anymore…

here’s the error message I get :

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “<string>”, line 13, in <module>
IOError: System.IO.IOException: Could not add reference to assembly LibGNet
at IronPython.Runtime.ClrModule.AddReference(CodeContext context, String name)
at IronPython.Runtime.ClrModule.AddReference(CodeContext context, Object references)
at Microsoft.Scripting.Interpreter.ActionCallInstruction2.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at Microsoft.Scripting.Interpreter.DynamicInstruction4.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)
at Microsoft.Scripting.SourceUnit.Execute(Scope scope)
at DSIronPython.IronPythonEvaluator.EvaluateIronPythonScript(String code, IList bindingNames, IList bindingValues)

 

Thanks a lot for your time

 

Just giving this topic another chance… anyone? :slight_smile:

Hey Mostafa,

It sounds like you’re looking to retrieve a parameter in a family and then change that parameter. Two nodes that could achieve this would be the “LunchBox Get Parameter Value” and the “Element.SetParameterByName”.

 

Of course in between checking the value and then setting a different one (or not), you could use some logic.

 

Hi Mostafa,

The body of the code is still valid. You’ll just have to revise the imports a bit and add a transaction. Here’s a more robust version:

2016-05-12_11-01-49

1 Like

Thank you very much Dimitar that’s great!