Solid Edge How to Mirror copy of a part or sheet document?

2023-06-22T15:25:03Z
ASSEMBLY PART/SHEETMETAL DRAFT

Summary


Details

How to Mirror copy of a part or sheet document?

Solution

User can use AddCopiedPart API to mirror copy. User need to open the part or sheet document in Solid Edge then run the below code.

Dim objApp As SolidEdgeFramework.Application = Nothing

Dim objDocuments As SolidEdgeFramework.Documents = Nothing

Dim objPar As SolidEdgePart.PartDocument = Nothing

Dim objModel As SolidEdgePart.Model = Nothing

Dim objPartCopy As SolidEdgePart.CopiedPart = Nothing

Dim objplanes As SolidEdgePart.RefPlanes = Nothing

Dim DocumentID As String = ""

Dim strPath As String = ""

Dim strName As String = ""

Dim strFullName As String = ""

Dim strNewFullname As String = ""

Dim intPlane As Integer = 3 'XZ plane is checked by default

'check if Solid Edge is running

Try

objApp = GetObject(, "SolidEdge.Application")

objDocuments = objApp.Documents

Catch

MsgBox("Solid Edge session must be open.")

End Try

'Check if a file is opened

Try

objPar = objApp.ActiveDocument

objPar.Save()

strPath = objPar.Path

strName = objPar.Name

strFullName = objPar.FullName

'determine the filetype

Select Case objApp.ActiveDocumentType

Case SolidEdgeFramework.DocumentTypeConstants.igPartDocument

DocumentID = "SolidEdge.PartDocument"

Case SolidEdgeFramework.DocumentTypeConstants.igSheetMetalDocument

DocumentID = "SolidEdge.SheetMetalDocument"

Case Else

MsgBox("This custom application only use only with part or sheet metal.")

End Select

Catch

MsgBox("A file (part or sheet metal) must be opened.")

End Try

'Create a new file

objDocuments.Add(DocumentID)

'set as the active doc

Dim objCopydoc As SolidEdgePart.PartDocument

objCopydoc = objApp.ActiveDocument

'switch to ordered mode, for partcopy

objCopydoc.ModelingMode = SolidEdgePart.ModelingModeConstants.seModelingModeOrdered

'get refplanes collection

objplanes = objCopydoc.RefPlanes

'get the models collection

Dim objModels As SolidEdgePart.Models = objCopydoc.Models

'add a partcopy of the file with mirror option

objModel = objModels.AddCopiedPart(FileName:=strFullName, XScale:=1, YScale:=1, ZScale:=1, MirrorOrFlattenPlane:=objplanes.Item(1))

Notes

Part or Sheet part should have geometry that they want to copy.

KB Article ID# PL8710635

Contents

SummaryDetails

Associated Components

ASSEMBLY: ANNOTATIONS/DIMENSIONS