Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Uf clone functions call question

Status
Not open for further replies.

Ehaviv

Computer
Joined
Jul 2, 2003
Messages
1,012
Location
IL


Hi is someone know in which order to call the uf cloning functions.
I know the order of the first and last but between I don't.

Thank you in advanced.


ufs.Clone.Terminate()
ufs.Clone.Initialise(UFClone.OperationClass.ImportOperation)
ufs.Clone.SetFamilyTreatment(UFClone.FamilyTreatment.StripFamilyStatus)
ufs.Clone.setDefNaming(UFClone.NamingTechnique.Autogen)
ufs.Clone.SetDefDirectory(pathsave)
ufs.Clone.SetDefAction(UFClone.Action.Overwrite)
ufs.Clone.SetLogfile(pathsave + "clone.txt")
ufs.Clone.SetDefAssocFileCopy (False)
ufs.Clone.SetDefFolder (user_name + ":" + import_folder)


Dim di As New IO.DirectoryInfo(pathsave)

Dim lFiles As IO.FileInfo() = di.GetFiles("*.prt")

Dim fi As System.IO.FileSystemInfo

Dim foundfile As IO.FileInfo

' get the files in the directory

For Each foundFile In lFiles


OS_FileName = foundFile.name.Remove(foundFile.name.Length - 4, 4)
ufs.Clone.AddAssembly(pathsave + foundfile.name, load_status)
ufs.Clone.AddPart(pathsave + foundfile.name)
ufs.Clone.setNaming(foundFile.name, UFClone.NamingTechnique.Autogen, OS_FileName)
ufs.Clone.SetPdmDesc(foundfile.name, OS_FileName)
ufs.Clone.SetPdmName(foundfile.name, OS_FileName)
ufs.Clone.SetAssocFileCopy (foundfile.name, False)

Next
Dim naming_failures As UFClone.NamingFailures = Nothing
ufs.Clone.setdryrun (false)
ufs.Clone.GenerateReport()
ufs.Clone.PerformClone (naming_failures)
ufs.Clone.Terminate()
 
I need to know it the in between functions call order is important.

The above example was taken from this link

and copied here for convantion

Code:
cschnei (Industrial) 
(OP)
29 Apr 15 07:22 
Hello Alex,
 I think you forgot to initialise the clone operation. Here is a snippet of the code I use to import all parts of a selected OS Folder to a specified Teamcenter folder:

 ufs.Clone.Terminate()
 ufs.Clone.Initialise(UFClone.OperationClass.ImportOperation)
[b] ufs.Clone.SetFamilyTreatment(UFClone.FamilyTreatment.StripFamilyStatus)
 ufs.Clone.setDefNaming(UFClone.NamingTechnique.Autogen)
 ufs.Clone.SetDefDirectory(pathsave)
 ufs.Clone.SetDefAction(UFClone.Action.Overwrite)
 ufs.Clone.SetLogfile(pathsave + "clone.txt")
 ufs.Clone.SetDefAssocFileCopy (False)
 ufs.Clone.SetDefFolder (user_name + ":" + import_folder)[/b]


 Dim di As New IO.DirectoryInfo(pathsave)

 Dim lFiles As IO.FileInfo() = di.GetFiles("*.prt")

 Dim fi As System.IO.FileSystemInfo

 Dim foundfile As IO.FileInfo

 ' get the files in the directory

 For Each foundFile In lFiles


 OS_FileName = foundFile.name.Remove(foundFile.name.Length - 4, 4)
 [b]ufs.Clone.AddAssembly(pathsave + foundfile.name, load_status)
 ufs.Clone.AddPart(pathsave + foundfile.name)
 ufs.Clone.setNaming(foundFile.name, UFClone.NamingTechnique.Autogen, OS_FileName)
 ufs.Clone.SetPdmDesc(foundfile.name, OS_FileName)
 ufs.Clone.SetPdmName(foundfile.name, OS_FileName)
 ufs.Clone.SetAssocFileCopy (foundfile.name, False)

 Next
 Dim naming_failures As UFClone.NamingFailures = Nothing
 ufs.Clone.setdryrun (false)
 ufs.Clone.GenerateReport()
 ufs.Clone.PerformClone (naming_failures)
 ufs.Clone.Terminate()
[/b]
 I hope this helps.
 Carsten
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top