×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Uf clone functions call question

Uf clone functions call question

Uf clone functions call question

(OP)


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()

RE: Uf clone functions call question

(OP)
I need to know it the in between functions call order is important.

The above example was taken from this link
http://www.eng-tips.com/viewthread.cfm?qid=378131

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)
 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 hope this helps.
 Carsten 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources