I’m a bit stuck I’m trying to clear objects of any keys and data associated through a script.
I’ve tried to use the DeleteObjectData method frome Rhino Script but the keys are not deleted. ( This method is not available in Python (Rhino 5.0)
Option Explicit Call Main() Sub Main() Dim arrlistObj,strObject arrlistObj = Rhino.GetObjects("SelectObjects") For Each strObject In arrlistObj If Not IsNull(strObject) Then Call Rhino.DeleteObjectData(strObject) End If Next End Sub
I’ve also tried using the command option suggested by Helvetosaur and Pacal, setting the key to “” in a Python script. This does not work either.
import rhinoscriptsyntax as rs listObj = rs.GetObjects("Select objects") for obj in listObj: listKeys = rs.GetUserText(obj) if listKeys: for key in listKeys: rs.SelectObject(obj) empty = '""' strDel = "_SetUserText "+key+" "+empty rs.Command(strDel) rs.Command("_SelNone")
If you have any suggestions or if you can see what I’m doing wrong here.