Saving wirh Apprentice

Saving wirh Apprentice

Anonymous
Not applicable
543 Views
3 Replies
Message 1 of 4

Saving wirh Apprentice

Anonymous
Not applicable
Hello,

i've got a problem saving assemblies with apprentice.
All files of my assembly are uptodate.
After saving all the files with new names , all assemblies and the top-assembly are dirty.
After unchecking the "Check/Massproperty" in Application-Settings-Save the files are not dirty.
Is it possible to save assemblies with apprentice without dirtiing Files.

Thanks
0 Likes
544 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
I'm not sure I understand exactly what's going on in your case, but if I'm
reading it correctly, it isn't surprising that the assembly needs to be
saved. If you changed the names of files that the assembly references and
have updated the references within the assembly to reference these new names
then the assembly needs to be saved to maintain this information. I may
have misunderstood your question and would need a specific example before I
can provide any additional help.
--
Brian Ekins
Autodesk Inventor API


wrote in message news:5241122@discussion.autodesk.com...
Hello,

i've got a problem saving assemblies with apprentice.
All files of my assembly are uptodate.
After saving all the files with new names , all assemblies and the
top-assembly are dirty.
After unchecking the "Check/Massproperty" in Application-Settings-Save the
files are not dirty.
Is it possible to save assemblies with apprentice without dirtiing Files.

Thanks
0 Likes
Message 3 of 4

Anonymous
Not applicable
I'm not sure I understand exactly what's going on in your case, but if I'm
reading it correctly, it isn't surprising that the assembly needs to be
saved. If you changed the names of files that the assembly references and
have updated the references within the assembly to reference these new names
then the assembly needs to be saved to maintain this information. I may
have misunderstood your question and would need a specific example before I
can provide any additional help.
--
Brian Ekins
Autodesk Inventor API


wrote in message news:5241122@discussion.autodesk.com...
Hello,

i've got a problem saving assemblies with apprentice.
All files of my assembly are uptodate.
After saving all the files with new names , all assemblies and the
top-assembly are dirty.
After unchecking the "Check/Massproperty" in Application-Settings-Save the
files are not dirty.
Is it possible to save assemblies with apprentice without dirtiing Files.

Thanks
0 Likes
Message 4 of 4

Anonymous
Not applicable
With the code below I'd like to copy an assembly.

Option Explicit

Private Sub CopyStruk()

Dim oApprentice As New ApprenticeServerComponent

Dim odoc As ApprenticeServerDocument
Dim opath As String
Dim oname As String
Dim ocol As New Collection
opath = "Z:\Ablage Inventor\Projekte\Tendler"
opath = opath & "\" & "11-001-903-06-0x.iam"
'oApprentice.FileLocations.FileLocationsFile = "Z:\Ablage Inventor\IDW-Tool.ipj"
Dim osaveas As FileSaveAs



Set odoc = oApprentice.Open(opath)
Set osaveas = oApprentice.FileSaveAs

'Call osaveas.AddFileToSave(odoc, oname)
ocol.Add odoc, odoc.FullFileName
Dim otempdoc As ApprenticeServerDocument

For Each otempdoc In odoc.ReferencedFiles
ocol.Add otempdoc, otempdoc.FullFileName
'oname = Left(otempdoc.FullFileName, Len(otempdoc.FullFileName) - 4) & "test" & Right(otempdoc.FullFileName, 4)
'Call osaveas.AddFileToSave(otempdoc, oname)
Next
Dim opos As Long
Dim olen As Long
Dim i As Long
For i = 1 To ocol.Count

opos = InStrRev(ocol.Item(i).FullFileName, "\")
olen = Len(ocol.Item(i).FullFileName)
oname = ocol.Item(i).FullFileName
oname = "Z:\Ablage Inventor\Projekte\Tendler\" & "test" & Right(ocol.Item(i).FullFileName, olen - opos)
Call osaveas.AddFileToSave(ocol.Item(i), oname)
Next
osaveas.ExecuteSaveAs

End Sub

This works fine. The files become new names and the references in the assembly are ok, if i iterate through the new assembly with apprentice.
When I open the new assembly with Inventor, the top-assembly and all sub-assemblies are dirty.
Is there a solution saving an assembly with new references without becoming dirty files?

Thanks
Reinhard
0 Likes