NX Two-time development clones

Source: Internet
Author: User

 NXOpen.UF.UFSession theufsession = NXOpen.UF.UFSession.GetUFSession (); try {//initialize NXOpen.UF.UFClone.OperationClass Operationclass = Nxopen. UF.                    UFClone.OperationClass.CloneOperation;                    TheUfSession.Clone.Initialise (Operationclass);                    Add the original assembly to the clone assembly, there are add Assembly and add Part two methods, here with the add Assembly NXOpen.UF.UFPart.LoadStatus loadstatus;                    theUfSession.Clone.AddAssembly (Selectpath,out loadstatus);                    TheUfSession.Clone.AddPart (Selectpath);                    Specifies the default clone mode NXOpen.UF.UFClone.Action Action = NXOpen.UF.UFClone.Action.Clone;                    TheUfSession.Clone.SetDefAction (action); Method for specifying a default file name NXOpen.UF.UFClone.NamingTechnique Namingtechnique = NXOpen.UF.UFClone.NamingTechnique.Nami                    Ngrule;                TheUfSession.Clone.SetDefNaming (Namingtechnique);    Define clone naming rules for new assemblies NXOpen.UF.UFClone.NameRuleDef Nameruledef;                    Nameruledef.type = UFClone.NameRuleType.PrependString;                    nameruledef.new_string = "M8"; nameruledef.base_string = "";                    Before the NX7.5 version, the following sentence is not required, but is called in later versions of NX7.5, you must add the following sentence, otherwise the cloning error will be displayed.                    NXOpen.UF.UFClone.NamingFailures Namingfailures;                    TheUfSession.Clone.InitNamingFailures (out namingfailures);                    TheUfSession.Clone.SetNameRule (ref nameruledef, ref namingfailures);                    TheUfSession.Clone.SetDefDirectory (@ "C:\temp\");                    String outputname = "C:\\xxxxx.prt";                    TheUfSession.Clone.SetNaming (Selectpath, UFClone.NamingTechnique.DefaultNaming, outputname); TheUI.NXMessageBox.Show ("", NXMessageBox.DialogType.Information, Namingfailures.n_failures.                    ToString ());                    TheUfSession.Clone.PerformClone (ref namingfailures);TheUfSession.Clone.Terminate (); } catch (Exception Ex1) {theUI.NXMessageBox.Show ("Block Styler", Nxmessa GeBox.DialogType.Error, Ex1.                ToString ());                } finally {theUfSession.Clone.Terminate (); }

  

NX Two-time development clones

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.