Hello, I’m trying to generate a specific layer structure from a Python code, and when I add some layers under a parent layer, a weird text ( something like (e47a)) is added to the layer name. Does anybody know what is this?
Thanks.
Hello, I’m trying to generate a specific layer structure from a Python code, and when I add some layers under a parent layer, a weird text ( something like (e47a)) is added to the layer name. Does anybody know what is this?
Thanks.
Hi @masaaki.miki,
Can you provide some sample code that repeats what you are reporting?
Thanks,
– Dale
Hello dale, thanks for the reply. This is what I’m doing. It’s working except the layer name.
import Rhino as rhino
import os
import Rhino.FileIO as io
import Rhino.Geometry as rg
import Rhino as rhino
import System
dir="somewhere in my HDD"
file="target.3dm"
newfile=io.File3dm()
for key in x.keys():
data=x[key]
layer=rhino.DocObjects.Layer()
layer.Name=key
newfile.Layers.Add(layer)
layer=newfile.Layers.FindName(key,System.Guid.Empty)
parent_id=layer.Id
Index=layer.Index
for i,key in enumerate(data):
layer=rhino.DocObjects.Layer()
layer.ParentLayerId = parent_id
index=newfile.Layers.Add(layer)
layer=newfile.Layers.FindIndex(i+1+Index)
layer.Name=key
att=rhino.DocObjects.ObjectAttributes()
att.LayerIndex=i+1+Index
for mesh in data[key]["G"]:
if mesh and isinstance(mesh,rg.Mesh):
newfile.Objects.AddMesh(mesh,att)
if y:
newfile.Write(os.path.join(dir,file+".3dm"),2)
Hello,
I have previously seen a similar issue on this forum. I couldn’t find it with a very quick search but it should be there somewhere…
Indeed, I remember this too. I believe it was suggested to be related to an asian characterset.
@masaaki.miki what language is your OS in and what language do you use for naming the layers?
-Willem