View Scale Spec Type Id Error

Hi All

I was busy upgrading a script to Revit 2023 when I got this error.
I am dumbfounded as to what this means. Can anyone please clarify?
Thanks for your help.

Looks like the Dynamo for Revit team missed a forge unit migration.

Can you create a VERY simple reproducible case, and post an issue on the Dyanmo for Revit GitHub so that we can get them to have a look? Issues · DynamoDS/DynamoRevit · GitHub

Hi Jacob

Sure thing. Will do so now.
Do you know of a fix I can use in the interim?
Thanks.

Not offhand. If my intuition on the cause is correct (and I’m 99% certain it is) there is a possible Python fix where we’d import the correct Forge Spec Type, but I’d need to see the simple reproducible graph to know where to start on that.

Can you post a screen shot of the second warning?

Hi Jacob

Here you go. There are three errors.
I have used an active view as a simple reproducible case.
Are these Forge Type IDs for integrations with Autodesk Forge?


Yes and no. @Konrad_K_Sobon summed it up quite well here: https://archi-lab.net/handling-the-revit-2022-unit-changes/, but basically there is a need for units to be common across the larger Autodesk ecosystem to enable a lot of coming stuff based in Forge. As a hypothetical, Imaging having to convert from Tandem units to Navisworks units to Revit units just so you could move a markup into Revit; it’d be horrible and would frequently error out. But if everyone used the same units you could go directly from the Tandem markup to the Revit add-in.

1 Like

Understood thanks.

That graph is pretty much perfect for the issue submission, and clear enough that I can see what’s happening.

It’s a holiday for me in the US (Juneteenth) so I’m not at my desk yet, but I’ll pop open the laptop and try and write some Python to resolve this for you later today.

Much appreciated, Jacob. I have submitted the issue.
I will also look into the API to see if I can write the code.
I will let you know if I succeed.
Thanks.

1 Like

I think the below is sufficient for my use case. I don’t have to figure out the Forge Units this way. I would still be interested to see what you come up with.
Thank you.

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

#Define function to ensure that objects are in a list
def tolist(obj1):
	if hasattr(obj1,"__iter__"): return obj1
	else: return [obj1]

#Views
elem = tolist(UnwrapElement(IN[0]))

#Parameter Name
paramName = IN[1]

#Parameter Values
paramVals = IN[2]
 
outlist = []

#Set Parameter Values
TransactionManager.Instance.EnsureInTransaction(doc)

for e in elem:
    e.LookupParameter(paramName).Set(paramVals)
    outlist.append(e)


TransactionManager.Instance.TransactionTaskDone()

OUT = outlist

5 Likes

Try use node from package DynaMEP in this case, Only solution temp at the moment.


5 Likes

Hi there

Thank you. The previous API solution I posted also works for me.
Much appreciated.

2 Likes