Submitted by Guljar14 on Mon, 09/17/2018 - 08:13
Forums:
Hi all.
Is there any way to remove all orphan status product interfaces from work part..
I tried to record but it's being limited to one object which is selected at the time of journal record but I want to cycle through all the product interfaces in work part n delete the orphan status interfaces...
Remove Orphan Product Interface
Hi, Use the below code to remove orphan objects in product interface.
This will work for NX Version 11.0 & above. If you are trying it in NX Version 10.0 or below then replace "AddObjectsToDeleteList" to "AddToDeleteList" in below code.
Dim objectBuilder1 As NXOpen.Assemblies.ProductInterface.ObjectBuilder = Nothing
objectBuilder1 = workPart.ProductInterface.CreateObjectBuilder()
objectBuilder1.SetBuilderVersion(NXOpen.Assemblies.ProductInterface.ObjectBuilder.BuilderVersion.One)
Dim prodIntObjs1() As NXOpen.Assemblies.ProductInterface.InterfaceObject
prodIntObjs1 = objectBuilder1.QueryProductInterfaceObjects(workPart)
For Each myobj As NXOpen.Assemblies.ProductInterface.InterfaceObject In prodIntObjs1
If myobj.GetProductInterfaceObjectStatus = "Orphan"
Dim objects1(-1) As NXOpen.TaggedObject
Dim nErrs1 As Integer = Nothing
nErrs1 = theSession.UpdateManager.AddObjectsToDeleteList(objects1)
Dim notifyOnDelete As Boolean = Nothing
notifyOnDelete = theSession.Preferences.Modeling.NotifyOnDelete
End If
Next
Happy Coding...
GopinadhGvs
Thank You
Working Perfectly as Required.
-[]-