it is an easy question, but i still don’t know enough to answere it on my own.
I just want to check the lanuage of the RUNNING REVIT instance.
Regarding on the result i want to make an different output from my python code.
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
dataEnteringNode = IN
import REVITServices
languageENU=IN[0]
languageDEU=IN[1]
## CODE to check the language from REVIT ###
Revitlanguage
if Revitlanguage == ENU
result = languageENU
else
result= languageDEU
OUT=result
I just thought – learning dynamo and python would be enough at the beginner level :-p but up on now --> REVIT API is doing some decent overflow to me - haha
OK, typical answer and good advise. Wouldn’t it be useful to sum-up something about it in the Share category? Let’s say someone would wish to start a new post with few information…
Great, I think it would be a good idea to put it in the Share category with an specific title, I have noticed that a lot of information cannot be found easily because of an inappropriate referencing…
Dynamos GitHub Wiki page is the place to go when you are looking for the different imports in python nodes: (again with a bit odd title “Python-0.6.3-to-0.7.x-Migration”)
import clr
# Import DocumentManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
languageENU=IN[0]
languageDEU=IN[1]
languageESP=IN[2]
languageFRA=IN[3]
languageITA=IN[4]
languageCHS=IN[5]
languageCHT=IN[6]
languageJPN=IN[7]
languageKOR=IN[8]
languageRUS=IN[9]
languageCSY=IN[10]
languagePLK=IN[11]
languagePTB=IN[12]
## CODE to check the language from REVIT ###
Revitlanguage = app.Language
if Revitlanguage == Autodesk.Revit.ApplicationServices.LanguageType.English_USA:
result = languageENU
elif Revitlanguage == Autodesk.Revit.ApplicationServices.LanguageType.German:
result = languageDEU
elif Revitlanguage == Autodesk.Revit.ApplicationServices.LanguageType.Spanish:
result = languageESP
elif Revitlanguage == Autodesk.Revit.ApplicationServices.LanguageType.French:
result = languageFRA
elif Revitlanguage == Autodesk.Revit.ApplicationServices.LanguageType.Italian:
result = languageITA
elif Revitlanguage == Autodesk.Revit.ApplicationServices.LanguageType.Chinese_Simplified:
result = languageCHS
elif Revitlanguage == Autodesk.Revit.ApplicationServices.LanguageType.Chinese_Traditional:
result = languageCHT
elif Revitlanguage == Autodesk.Revit.ApplicationServices.LanguageType.Japanese:
result = languageJPN
elif Revitlanguage == Autodesk.Revit.ApplicationServices.LanguageType.Korean:
result = languageKOR
elif Revitlanguage == Autodesk.Revit.ApplicationServices.LanguageType.Russian:
result = languageRUS
elif Revitlanguage == Autodesk.Revit.ApplicationServices.LanguageType.Czech:
result = languageCSY
elif Revitlanguage == Autodesk.Revit.ApplicationServices.LanguageType.Polish:
result = languagePLK
elif Revitlanguage == Autodesk.Revit.ApplicationServices.LanguageType.Brazilian_Portuguese:
result = languagePTB
else
result = languageDEU
OUT=result
What is wrong with the code? And it seems I have to use every input port (optional would be better). And is there a difference in the parameter names between English USA and English GB ?