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

Set object name from file name in Python

$
0
0

I am trying to set the object name of a mesh to the name of the file as part of a workflow. I thought I had it with the below script, but the OBJ name is not set to the file name, but just to “m” in any file I try.

import rhinoscriptsyntax as rs
def ObjNamefromFile():
Docs=rs.DocumentName()
for Name in Docs:
objs=rs.ObjectsByType(32, True)
rs.ObjectName(objs,Name)
ObjNamefromFile()

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 5743

Trending Articles