I need to delete all dimensions in a cell (in the Central Library) using Аutomation. For this, I have opened the Central Library in Library Manager and run the following script (a cell name is "test").
Here I attempted two methods of deletion (see comments in a script), but without any success. Has anybody attempted to delete the dimensions in a cell using Automation?
Set app = GetObject (,"LibraryManager.Application")
Set lib = app.ActiveLibrary
Set cellEditor = CreateObject("CellEditorAddin.CellEditorDlg")
Set cellDB = cellEditor.OpenDatabase(lib.FullName, False)
cellEditor.Visible = False
For Each partition In cellDB.Partitions
For Each cell In partition.Cells
If (cell.Name = "test") Then
Set doc = cell.Edit()
'Now let's delete all the dimensions (if they exist):
If (doc.Dimensions.Count > 0) Then
MsgBox doc.Dimensions.Count & " dimensions are detected, let's delete them...", 0, ""
'First method: delete the dimensions all at once:
Set aaa = doc.Dimensions
'Second method: delete the dimensions one by one:
'For Each aaa In doc.Dimensions
MsgBox "After deleting, " & doc.Dimensions.Count & " dimensions are detected, should be 0", 0, ""
MsgBox "Nothing to delete", 0, ""