Plugin to Python Code

Maybe you can try @Dimitar_Venkov s C# interpreter: (found in the package manager). I just slightly edited the code to include some references and swapped to Dynamos document manager.

//Add references
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Structure;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;
using RevitServices.Persistence;
using RevitServices.Transactions;

UIDocument uiDoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument;
Document doc = DocumentManager.Instance.CurrentDBDocument;
string OUT;
Family fam;

try
{
	Reference refsel = uiDoc.Selection.PickObject(ObjectType.Element, "selection élément");
	Element elmnt = doc.GetElement(refsel.ElementId);
	FamilyInstance fyInst = elmnt as FamilyInstance;
	fam = fyInst.Symbol.Family;
	using (Transaction trans = new Transaction(doc))
	{
		trans.Start("Mise à jour Paramètre OmniClass");
		Parameter para = fam.get_Parameter(BuiltInParameter.OMNICLASS_CODE);
		para.Set("23.70.50.21.24.14");//valeur exemple
		trans.Commit();
	OUT = "succses!";
	}           
}
catch (Exception e)
{
	OUT = e.Message;
}
1 Like