KevinBarnett
2004-07-12, 10:57 AM
Greetings Gang,
How do you acquire and alter the properties of a SheetSets IAcSmFileReference object?
Here's the situation. I have appended code to the example sheet set VBA project file. The idea is to use the subset names as the new sheetset location folders. When you make a new sheet set the existing sub folders are used as the names of the subsets - for us, it would be ideal if the new sheet set location used the same folder (maybe we will adopt different concepts as we become more familiar with sheet sets). Anyway, the setnewsheetsetlocation subset method uses a IAcSmFileReference object and not a string to set the location. I just dont know how to acquire or use this object. The below code is appended to the SheetSet class in the example sheet set project.
This line:
FR.SetFileName RootFolder & Right$(SSetPath, Len(SSetPath) - 1)
produces this error:
The owner of the PerUser subscription is not logged on to the system specified.
Help! Please! ...
Thanks,
Kevin.
Public Sub FolderUpdate(db As IAcSmDatabase, RootFolder As String)
Dim iter As IAcSmEnumPersist
Dim Item As IAcSmPersist
Dim sheet As IAcSmSheet
Dim subset As IAcSmSubset
Dim osubset As IAcSmSubset
Dim SubOwner As IAcSmPersist
Dim SSetPath As String
Dim FR As IAcSmFileReference
Set iter = db.GetEnumerator
Set Item = iter.Next
Do While Not Item Is Nothing
If Item.GetTypeName = "AcSmSubset" Then
Set subset = Item
Set SubOwner = Item
SSetPath = "\" & subset.GetName
Int1 = 0
Do While SubOwner.GetTypeName <> "AcSmSheetSet"
Int1 = Int1 + 1
Set SubOwner = SubOwner.GetOwner
If SubOwner.GetTypeName = "AcSmSubset" Then
Set osubset = SubOwner
SSetPath = "\" & osubset.GetName & SSetPath
End If
Loop
Set FR = subset.GetNewSheetLocation
FR.SetFileName RootFolder & Right$(SSetPath, Len(SSetPath) - 1)
Err.Clear
On Error Resume Next
subset.SetNewSheetLocation FR
If Err <> 0 Then
MsgBox Err.Description
End If
End If
Set Item = iter.Next
Loop
ThisDrawing.Application.Update
End Sub
How do you acquire and alter the properties of a SheetSets IAcSmFileReference object?
Here's the situation. I have appended code to the example sheet set VBA project file. The idea is to use the subset names as the new sheetset location folders. When you make a new sheet set the existing sub folders are used as the names of the subsets - for us, it would be ideal if the new sheet set location used the same folder (maybe we will adopt different concepts as we become more familiar with sheet sets). Anyway, the setnewsheetsetlocation subset method uses a IAcSmFileReference object and not a string to set the location. I just dont know how to acquire or use this object. The below code is appended to the SheetSet class in the example sheet set project.
This line:
FR.SetFileName RootFolder & Right$(SSetPath, Len(SSetPath) - 1)
produces this error:
The owner of the PerUser subscription is not logged on to the system specified.
Help! Please! ...
Thanks,
Kevin.
Public Sub FolderUpdate(db As IAcSmDatabase, RootFolder As String)
Dim iter As IAcSmEnumPersist
Dim Item As IAcSmPersist
Dim sheet As IAcSmSheet
Dim subset As IAcSmSubset
Dim osubset As IAcSmSubset
Dim SubOwner As IAcSmPersist
Dim SSetPath As String
Dim FR As IAcSmFileReference
Set iter = db.GetEnumerator
Set Item = iter.Next
Do While Not Item Is Nothing
If Item.GetTypeName = "AcSmSubset" Then
Set subset = Item
Set SubOwner = Item
SSetPath = "\" & subset.GetName
Int1 = 0
Do While SubOwner.GetTypeName <> "AcSmSheetSet"
Int1 = Int1 + 1
Set SubOwner = SubOwner.GetOwner
If SubOwner.GetTypeName = "AcSmSubset" Then
Set osubset = SubOwner
SSetPath = "\" & osubset.GetName & SSetPath
End If
Loop
Set FR = subset.GetNewSheetLocation
FR.SetFileName RootFolder & Right$(SSetPath, Len(SSetPath) - 1)
Err.Clear
On Error Resume Next
subset.SetNewSheetLocation FR
If Err <> 0 Then
MsgBox Err.Description
End If
End If
Set Item = iter.Next
Loop
ThisDrawing.Application.Update
End Sub