Hello
I have a function that saves a part and it's drawing:
Sub save_part(name)
Dim partOperationCopyBuilder1 As NXOpen.PDM.PartOperationCopyBuilder = theSession.PdmSession.CreateCopyOperationBuilder(NXOpen.PDM.PartOperationBuilder.OperationType.SaveAs)
partOperationCopyBuilder1.SetOperationSubType(NXOpen.PDM.PartOperationCopyBuilder.OperationSubType.Default)
partOperationCopyBuilder1.DependentFilesToCopyOption = NXOpen.PDM.PartOperationCopyBuilder.CopyDependentFiles.All
partOperationCopyBuilder1.ReplaceAllComponentsInSession = True
Dim selectedparts1(0) As NXOpen.BasePart
selectedparts1(0) = workPart
partOperationCopyBuilder1.SetSelectedPartsToCopy(selectedparts1, Nothing)
Dim logicalobjects2() As NXOpen.PDM.LogicalObject = Nothing
partOperationCopyBuilder1.CreateLogicalObjects(logicalobjects2)
Dim objects2(-1) As NXOpen.NXObject
Dim attributePropertiesBuilder1 As NXOpen.AttributePropertiesBuilder = theSession.AttributeManager.CreateAttributePropertiesBuilder(Nothing, objects2, NXOpen.AttributePropertiesBuilder.OperationType.None)
attributePropertiesBuilder1.SetAttributeObjects(logicalobjects2(0).GetUserAttributeSourceObjects())
attributePropertiesBuilder1.Title = "DB_PART_NAME"
attributePropertiesBuilder1.Category = "Item"
attributePropertiesBuilder1.StringValue = name
attributePropertiesBuilder1.CreateAttribute()
partOperationCopyBuilder1.ValidateLogicalObjectsToCommit()
partOperationCopyBuilder1.Commit()
partOperationCopyBuilder1.Destroy()
attributePropertiesBuilder1.Destroy()
End Sub
The PropertyBuilder sets the new name of the Part. But can I also create a second property builder but for the drawing?
They don't share them as far as I know. But because I'm saving both at the same time it should be possible, right?
Regards