Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5791

Retrieve layer name list from file with different language than English

$
0
0

Hello,

I’ve retrieved all the layer names in grasshopper, but some layers in my rhino file have named in different language, specifically Korean texts.
Rhino 7 is displaying it without an issue however ghphyton doesn’t show it correctly even I tried to encode it into 'utf-8'.

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
import codecs

sc.doc = Rhino.RhinoDoc.ActiveDoc

layers = rs.LayerNames()

if layers:
    for layer in layers: print layer.encode('utf-8')
    
sc.doc = ghdoc

drawing-example-도면1.3dm (50.8 KB)

What should I do in this case?
Thank you.

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 5791

Trending Articles