copy files using Add-in

copy files using Add-in

Anonymous
Not applicable
266 Views
2 Replies
Message 1 of 3

copy files using Add-in

Anonymous
Not applicable
Without using Apprentice Server, is there a way to copy files using AddIn
and maintain the link between the idw and ipt/iam
Thx, CVA

--
www.CVAengineering.com

IV11 Pro. sp2
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 84.26
SpacePilot V 1.1.2
0 Likes
267 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
In Inventor, you will need to copy the files and fix up the references using
the FileDescriptor.ReplaceReference method. In Apprentice, the FileSaveAs
object automates the fixing up of references, but this is not available in
Inventor. The other option is to spawn off an Apprentice process (outside of
Inventor's process), and perform the file copy.

Sanjay-

"CVAengineering" wrote in message
news:5581527@discussion.autodesk.com...
Without using Apprentice Server, is there a way to copy files using AddIn
and maintain the link between the idw and ipt/iam
Thx, CVA

--
www.CVAengineering.com

IV11 Pro. sp2
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 84.26
SpacePilot V 1.1.2
0 Likes
Message 3 of 3

Anonymous
Not applicable
San,
I've tried this code in a .ivb
When I open New.idw, it's still looking for Old.ipt?
Thx, CVA

NewIDW = "c:\new\New.idw"
OldIPT = "c:\old\Old.ipt"
NewIPT = "c:\new\New.ipt"

Dim oApprentice As New ApprenticeServerComponent
If oApprentice Is Nothing Then
Set oApprentice = New ApprenticeServerComponent
End If

Dim oAdoc As ApprenticeServerDrawingDocument
Set oAdoc = oApprentice.Open(NewIDW)

Dim oRefFileDesc As ReferencedFileDescriptor
'Set oRefFileDesc = oApprentice.Document
For Each oRefFileDesc In oAdoc.ReferencedFileDescriptors
If oRefFileDesc.FullFileName = OldIPT Then
Call oRefFileDesc.PutLogicalFileNameUsingFull(NewIPT)
Exit For
End If
Next oRefFileDesc

Dim oFileSaveAs As FileSaveAs
Set oFileSaveAs = oApprentice.FileSaveAs

Call oFileSaveAs.AddFileToSave(oAdoc, oAdoc.FullFileName)
Call oFileSaveAs.ExecuteSave

Set oApprentice = Nothing

--
www.CVAengineering.com

IV11 Pro. sp2
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 84.26
SpacePilot V 1.1.2
"Sanjay Ramaswamy (Autodesk)" wrote in
message news:5582576@discussion.autodesk.com...
In Inventor, you will need to copy the files and fix up the references using
the FileDescriptor.ReplaceReference method. In Apprentice, the FileSaveAs
object automates the fixing up of references, but this is not available in
Inventor. The other option is to spawn off an Apprentice process (outside of
Inventor's process), and perform the file copy.

Sanjay-

"CVAengineering" wrote in message
news:5581527@discussion.autodesk.com...
Without using Apprentice Server, is there a way to copy files using AddIn
and maintain the link between the idw and ipt/iam
Thx, CVA

--
www.CVAengineering.com

IV11 Pro. sp2
Window XP Pro sp2
Pentium 3.2 Ghz, 3.0 GB of RAM
NVIDIA FX 3400 84.26
SpacePilot V 1.1.2
0 Likes