Open Alexwanderwenzel opened 6 months ago
import clr #This is .NET's Common Language Runtime. It's an execution environment
import sys #sys is a fundamental Python library - here, we're using it to load in
sys.path.append('C:\Program Files (x86)\IronPython 2.7\Lib') #Imports the
import System #The System namespace at the root of .NET from System import Array #.NET class for handling array information from System.Collections.Generic import * #Lets you handle generics. Revit's API
clr.AddReference('ProtoGeometry') #A Dynamo library for its proxy geometry
from Autodesk.DesignScript.Geometry import * #Loads everything in Dynamo's
clr.AddReference("RevitNodes") #Dynamo's nodes for Revit
import Revit #Loads in the Revit namespace in RevitNodes clr.ImportExtensions(Revit.Elements) #More loading of Dynamo's Revit libraries clr.ImportExtensions(Revit.GeometryConversion) #More loading of Dynamo's
clr.AddReference("RevitServices") #Dynamo's classes for handling Revit documents import RevitServices from RevitServices.Persistence import DocumentManager #An internal Dynamo class
from RevitServices.Transactions import TransactionManager #A Dynamo class for
clr.AddReference("RevitAPI") #Adding reference to Revit's API DLLs clr.AddReference("RevitAPIUI") #Adding reference to Revit's API DLLs
import Autodesk #Loads the Autodesk namespace from Autodesk.Revit.DB import #Loading Revit's API classes from Autodesk.Revit.UI import #Loading Revit's API UI classes
doc = DocumentManager.Instance.CurrentDBDocument #Finally, setting up handles to the active Revit document uiapp = DocumentManager.Instance.CurrentUIApplication #Setting a handle to the active Revit UI document app = uiapp.Application #Setting a handle to the currently-open instance of the Revit application uidoc = uiapp.ActiveUIDocument #Setting a handle to the currently-open instance of the Revit UI application Viga=IN[0] #######OK NOW YOU CAN CODE######## TransactionManager.Instance.EnsureInTransaction(doc)
Viga.SetParameterByName("z Justification", 2)
TransactionManager.Instance.TransactionTaskDone()
SOLVED: in a 2022 Post
Issue Description
Please fill in the following information to help us reproduce the issue:
Dynamo version
Dynamo:
2.13.1.3887
Operating system
OS:
Microsoft Windows NT 10.0.19045.0
What did you do?
I was trying to change the z Justification in a Beam using the "Element.SetParameterByName" method (I tried both Dynamo modules and Python) and I get this error Element.SetParameterByName Operation Failed. specTypeId is not a measurableSpec (ForgetypeId). Parameter name: specTypeId
What did you expect to see?
A change in the z Justification. In previous versions of Revit that method and the z Justification parameter works fine.
What did you see instead?
(Fill in here)
What packages or external references (if any) were used?
Stack Trace
CLR:
4.0.30319.42000