01-29-2015
11:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-29-2015
11:38 PM
Do you have an example for this? Thank you very much.
I could copy the sketch
Sub VBAMain()
Dim oPart1 As PartDocument
Set oPart1 = ThisApplication.Documents.Open("c:\part1.ipt", False)
Dim oSketch_inPart1 As Sketch
Set oSketch_inPart1 = oPart1.ComponentDefinition.Sketches(1)
Dim oPart2 As PartDocument
Set oPart2 = ThisApplication.Documents.Open("c:\part2.ipt", False)
Dim oSketch_inPart2 As Sketch
Set oSketch_inPart2 = oPart2.ComponentDefinition.Sketches(1)
Call oSketch_inPart1.CopyContentsTo(oSketch_inPart2)
Call oPart1.Close(True)
oPart2.Update
oPart2.Save
Call oPart2.Close(True)
End Sub