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?

Hey,

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

add = table.GetLayerTableIterator()
while add.MoveNext():
	current.append(add.Current)

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
http://www.revitapidocs.com/2018/c8228022-58c2-ae04-fea0-7f480bcddc81.htm

This gives Export Layer Key Properties, but there’s no Id
http://www.revitapidocs.com/2018/29c8677c-3365-d773-cb6d-4633f3dd11f5.htm

Hopefully I’m wrong!

Cheers,

Mark

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.