How to collect the unique ID from the Default Layer

Hello Community,
GetDwgLayerAndGiveUnitSequence.dyn (4.5 KB)

To auto mapping between the different language revit DWG layer setting, I wonder could use the ExportDWGSetting function in Dynamo and find the Unit id with each category. I think I could use the GetLayerTableIterator to solve this problem, but in my coding would be shown the problem. Base on this question, could someone help me to correct my idea?


So the Table Iterator Class allows you to Iterate through using it’s specific methods…

add = table.GetLayerTableIterator()
while add.MoveNext():

I was also getting an indent error because you had used spaces (which I agree with) on one line, the rest of the code uses tabs, I swapped that line to tabs and it ran.

Unfortunately I don’t believe that Layers have an accessible Id… I can’t find a method which retrieves them or a property, so I think this is a dead end :frowning:

This gives Export Layer Info Properties, but there’s no Id

This gives Export Layer Key Properties, but there’s no Id

Hopefully I’m wrong!



Thanks, for the reply,

However, I still keep to try the possibilities because since the API provide this function for the date catching, the result would also have the meaning in the future. I am appreciating your test and comment, lets test and tried the other way.