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

[python] scripting Snapshots command issue

$
0
0

@ivelin.peychev wrote:

Hi @dale

There seems to be an issue (may as well be designed this way) with the -snapshot command when used in a script:

If you create a couple of snapshots manually, then run the script below to create several snapshots.
Then comment out the creation part and uncomment the deletion part:

import rhinoscriptsyntax as rs
import scriptcontext as sc



# Create snapshots
list_of_snapshot_names = ["ALA","BALA","NICA"]
for name in list_of_snapshot_names:
    rs.Command("-Snapshots Save {0} _Cancel".format(name))
#
"""
# Deleting all snapshots
list_of_snapshots = sc.doc.Snapshots.Names
for name in list_of_snapshots:
    print name
    rs.Command("-Snapshots Delete {0} _Cancel".format(name))
"""

Apparently you cannot delete snapshots that were created manually.
The script identifies them, prints their names but doesn’t delete them.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5896

Trending Articles