dim invApp as Application dim irx as TransientGeometry dim storePath Dim PI dim sketchDic as object Private Function CreateSketch1_3(partCompDef As PartComponentDefinition) Dim firstPoint as SketchPoint Dim lastPoint as SketchPoint set sketchNormal=irx.CreateUnitVector(0,0,1) sketchDic.add "Sketch_1",sketchNormal set feat3=createSketch(partCompDef,"Sketch_1",0,0,0,1,0,0,0,1,0) set centerStartPk=feat3.SketchPoints.Add(convertToSketchSpace(feat3,5,0,0)) set centerEndPk=feat3.SketchPoints.Add(convertToSketchSpace(feat3,-5,0,0)) feat3.SketchLines.AddByTwoPoints centerStartPk,centerEndPk set lastPoint=AddSketchArc(feat3,0,0.28,0,0.0087867965644036,0.2587867965644,0,0.03,0.25,0,firstPoint,lastPoint,1) set lastPoint=AddSketchLine(feat3,0.03,0.25,0,0.47,0.25,0,firstPoint,lastPoint,0) set lastPoint=AddSketchArc(feat3,0.47,0.25,0,0.4912132034356,0.2587867965644,0,0.5,0.28,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.5,0.28,0,0.5,0.41,0,firstPoint,lastPoint,0) set lastPoint=AddSketchArc(feat3,0.5,0.41,0,0.49707106781187,0.41707106781187,0,0.49,0.42,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.49,0.42,0,0.32785242449661,0.42,0,firstPoint,lastPoint,0) set lastPoint=AddSketchArc(feat3,0.32785242449661,0.42,0,0.25,0.391,0,0.17214757550339,0.42,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.17214757550339,0.42,0,0.01,0.42,0,firstPoint,lastPoint,0) set lastPoint=AddSketchArc(feat3,0.01,0.42,0,0.0029289321881345,0.41707106781187,0,0,0.41,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0,0.41,0,0,0.28,0,firstPoint,lastPoint,2) feat3.Profiles.AddForSolid Set CreateSketch1_3=feat3 End Function Private Function CreateSketch2_3(partCompDef As PartComponentDefinition) Dim firstPoint as SketchPoint Dim lastPoint as SketchPoint set sketchNormal=irx.CreateUnitVector(0,0,1) sketchDic.add "Sketch_2",sketchNormal set feat3=createSketch(partCompDef,"Sketch_2",0,0,0,1,0,0,0,1,0) set centerStartPk=feat3.SketchPoints.Add(convertToSketchSpace(feat3,5,0,0)) set centerEndPk=feat3.SketchPoints.Add(convertToSketchSpace(feat3,-5,0,0)) feat3.SketchLines.AddByTwoPoints centerStartPk,centerEndPk set lastPoint=AddSketchLine(feat3,0,0.77,0,0,0.6728125,0,firstPoint,lastPoint,1) set lastPoint=AddSketchArc(feat3,0,0.6728125,0,0.0022882282719801,0.66728822827198,0,0.0078125,0.665,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.0078125,0.665,0,0.0125,0.665,0,firstPoint,lastPoint,0) set lastPoint=AddSketchArc(feat3,0.0125,0.665,0,0.029166666666667,0.68166666666667,0,0.045833333333333,0.665,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.045833333333333,0.665,0,0.057294587079384,0.6,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.057294587079384,0.6,0,0.17214757550339,0.6,0,firstPoint,lastPoint,0) set lastPoint=AddSketchArc(feat3,0.17214757550339,0.6,0,0.25,0.629,0,0.32785242449661,0.6,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.32785242449661,0.6,0,0.44270541292062,0.6,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.44270541292062,0.6,0,0.45416666666667,0.665,0,firstPoint,lastPoint,0) set lastPoint=AddSketchArc(feat3,0.45416666666667,0.665,0,0.47083333333333,0.68166666666667,0,0.4875,0.665,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.4875,0.665,0,0.4921875,0.665,0,firstPoint,lastPoint,0) set lastPoint=AddSketchArc(feat3,0.4921875,0.665,0,0.49771177172802,0.66728822827198,0,0.5,0.6728125,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.5,0.6728125,0,0.5,0.77,0,firstPoint,lastPoint,0) set lastPoint=AddSketchArc(feat3,0.5,0.77,0,0.4912132034356,0.7912132034356,0,0.47,0.8,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.47,0.8,0,0.03,0.8,0,firstPoint,lastPoint,0) set lastPoint=AddSketchArc(feat3,0.03,0.8,0,0.0087867965644036,0.7912132034356,0,0,0.77,0,firstPoint,lastPoint,2) feat3.Profiles.AddForSolid Set CreateSketch2_3=feat3 End Function Private Function CreateSketch3_3(partCompDef As PartComponentDefinition) Dim firstPoint as SketchPoint Dim lastPoint as SketchPoint set sketchNormal=irx.CreateUnitVector(0,0,1) sketchDic.add "Sketch_1",sketchNormal set feat3=createSketch(partCompDef,"Sketch_1",0,0,0,1,0,0,0,1,0) set centerStartPk=feat3.SketchPoints.Add(convertToSketchSpace(feat3,5,0,0)) set centerEndPk=feat3.SketchPoints.Add(convertToSketchSpace(feat3,-5,0,0)) feat3.SketchLines.AddByTwoPoints centerStartPk,centerEndPk set lastPoint=AddSketchLine(feat3,0.018,0.42,0,0.027,0.42,0,firstPoint,lastPoint,1) set lastPoint=AddSketchLine(feat3,0.027,0.42,0,0.036,0.5425,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.036,0.5425,0,0.036,0.665,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.036,0.665,0,0.027,0.665,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.027,0.665,0,0.018,0.5425,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.018,0.5425,0,0.018,0.42,0,firstPoint,lastPoint,2) feat3.Profiles.AddForSolid Set CreateSketch3_3=feat3 End Function Private Function CreateSketch4_3(partCompDef As PartComponentDefinition) Dim firstPoint as SketchPoint Dim lastPoint as SketchPoint set sketchNormal=irx.CreateUnitVector(0,0,1) sketchDic.add "Sketch_1",sketchNormal set feat3=createSketch(partCompDef,"Sketch_1",0,0,0,1,0,0,0,1,0) set centerStartPk=feat3.SketchPoints.Add(convertToSketchSpace(feat3,5,0,0)) set centerEndPk=feat3.SketchPoints.Add(convertToSketchSpace(feat3,-5,0,0)) feat3.SketchLines.AddByTwoPoints centerStartPk,centerEndPk set lastPoint=AddSketchLine(feat3,0.464,0.665,0,0.464,0.5425,0,firstPoint,lastPoint,1) set lastPoint=AddSketchLine(feat3,0.464,0.5425,0,0.473,0.42,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.473,0.42,0,0.482,0.42,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.482,0.42,0,0.482,0.5425,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.482,0.5425,0,0.473,0.665,0,firstPoint,lastPoint,0) set lastPoint=AddSketchLine(feat3,0.473,0.665,0,0.464,0.665,0,firstPoint,lastPoint,2) feat3.Profiles.AddForSolid Set CreateSketch4_3=feat3 End Function Private Function CreateSketch5_3(partCompDef As PartComponentDefinition) Dim firstPoint as SketchPoint Dim lastPoint as SketchPoint set sketchNormal=irx.CreateUnitVector(0,0,1) sketchDic.add "Sketch_1",sketchNormal set feat3=createSketch(partCompDef,"Sketch_1",0,0,0,1,0,0,0,1,0) set centerStartPk=feat3.SketchPoints.Add(convertToSketchSpace(feat3,5,0.51,0)) set centerEndPk=feat3.SketchPoints.Add(convertToSketchSpace(feat3,-5,0.51,0)) feat3.SketchLines.AddByTwoPoints centerStartPk,centerEndPk set lastPoint=AddSketchArc(feat3,0.131,0.51,0,0.25,0.629,0,0.369,0.51,0,firstPoint,lastPoint,1) set lastPoint=AddSketchLine(feat3,0.369,0.51,0,0.131,0.51,0,firstPoint,lastPoint,2) feat3.Profiles.AddForSolid Set CreateSketch5_3=feat3 End Function Private Sub getLocalOptions() storePath = InputBox("Enter Path (e.g. c:\cadfiles\ )") l=len(storePath) if l<>0 then lastChar=mid(storePath,l,1) if lastChar<>"\" then storePath=storePath & "\" end if end if end sub Private Function convertToSketchSpace(sketch, pointX, pointY, pointZ) Dim myPoint As Point Set myPoint = irx.CreatePoint(pointX, pointY, pointZ) Set convertToSketchSpace = sketch.ModelToSketchSpace(myPoint) End Function Private Function createSketch(partCompDef As PartComponentDefinition, sketchName as String,tx, ty, tz, xx, xy, xz, yx, yy, yz) Dim pk1, pk2, pk3 As point Set pk1 = irx.CreatePoint(tx, ty, tz) Set pk2 = irx.CreatePoint(xx, xy, xz) Set pk3 = irx.CreatePoint(yx, yy, yz) Dim wpk1, wpk2, wpk3 As WorkPoint Set wpk1 = partCompDef.WorkPoints.AddFixed(pk1) Set wpk2 = partCompDef.WorkPoints.AddFixed(pk2) Set wpk3 = partCompDef.WorkPoints.AddFixed(pk3) wpk1.Visible=false wpk2.Visible=false wpk3.Visible=false Dim createPlane As Workplane Set createPlane = partCompDef.WorkPlanes.AddByThreePoints(wpk1, wpk2, wpk3, True) Dim createAxis As WorkAxis Set AxisVector = irx.CreateUnitVector(xx - tx, xy - ty, xz - tz) Set createAxis = partCompDef.WorkAxes.AddFixed(pk1, AxisVector) createAxis.visible=false Dim sketch As object Set sketch = partCompDef.Sketches.AddWithOrientation(createPlane, createAxis, False, True, wpk1, False) sketch.visible=false sketch.name=sketchName If (invApp.SoftwareVersion.Major <= 6) Then createPlane.visible=false end if Set createSketch = sketch end function Private Sub ExtrudeSketch(partCompDef,sketch,dist,side As PartFeatureExtentDirectionEnum,op As PartFeatureOperationEnum,draft As String) Dim planeNormal As UnitVector Dim sketchNormal As UnitVector Set planeNormal = sketch.PlanarEntityGeometry.Normal Set sketchNormal = sketchDic.Item(sketch.name) If (sketchNormal.IsEqualTo(planeNormal) = False) Then If (side = kNegativeExtentDirection) Then side = kPositiveExtentDirection ElseIf (side = kPositiveExtentDirection) Then side = kNegativeExtentDirection End If End If Set extrudeFeat = partCompDef.Features.ExtrudeFeatures.AddByDistanceExtent(sketch.Profiles(1), dist, side, op, draft) end sub Private Sub RotateSketch(partCompDef,sketch,angle,side As PartFeatureExtentDirectionEnum,op As PartFeatureOperationEnum) Dim planeNormal As UnitVector Dim sketchNormal As UnitVector Set planeNormal = sketch.PlanarEntityGeometry.Normal Set sketchNormal = sketchDic.Item(sketch.name) If (sketchNormal.IsEqualTo(planeNormal) = False) Then If (side = kNegativeExtentDirection) Then side = kPositiveExtentDirection ElseIf (side = kPositiveExtentDirection) Then side = kNegativeExtentDirection End If End If set axis=sketch.SketchLines(1) Set RotateFeat = partCompDef.Features.RevolveFeatures.AddByAngle(sketch.Profiles(1), axis, angle/180*PI, side, op) end sub Private Sub setPartColor(partDocument, red, green, blue, colorName) Dim style As RenderStyle Set style = partDocument.RenderStyles.Add(colorName) style.SetAmbientColor red, green, blue partDocument.ActiveRenderStyle = style End Sub Private Function AddSketchLine(ByVal sketch As PlanarSketch, startx As Double, starty As Double, startz As Double, endx As Double, endy As Double, endz As Double, firstPoint As SketchPoint, lastPoint As SketchPoint, pos As Integer) Dim startPoint As SketchPoint Dim endPoint As SketchPoint If (pos = 1) Then Set startPoint = sketch.SketchPoints.Add(convertToSketchSpace(sketch, startx, starty, startz)) Set endPoint = sketch.SketchPoints.Add(convertToSketchSpace(sketch, endx, endy, endz)) Set firstPoint = startPoint ElseIf (pos = 2) Then Set startPoint = lastPoint Set endPoint = firstPoint Else Set startPoint = lastPoint Set endPoint = sketch.SketchPoints.Add(convertToSketchSpace(sketch, endx, endy, endz)) Set lastPoint = endPoint End If Set lines = sketch.SketchLines lines.AddByTwoPoints startPoint, endPoint Set AddSketchLine = endPoint End Function Private Function AddSketchArc(ByVal sketch As PlanarSketch, startx As Double, starty As Double, startz As Double, midx As Double, midy As Double, midz As Double, endx As Double, endy As Double, endz As Double, firstPoint As SketchPoint, lastPoint As SketchPoint, pos As Integer) Dim startPoint As SketchPoint Dim midPoint As SketchPoint Dim endPoint As SketchPoint Set midPoint = sketch.SketchPoints.Add(convertToSketchSpace(sketch, midx, midy, midz)) If (pos = 1) Then Set startPoint = sketch.SketchPoints.Add(convertToSketchSpace(sketch, startx, starty, startz)) Set endPoint = sketch.SketchPoints.Add(convertToSketchSpace(sketch, endx, endy, endz)) Set firstPoint = startPoint ElseIf (pos = 2) Then Set startPoint = lastPoint Set endPoint = firstPoint Else Set startPoint = lastPoint Set endPoint = sketch.SketchPoints.Add(convertToSketchSpace(sketch, endx, endy, endz)) Set lastPoint = endPoint End If Set arcs = sketch.SketchArcs arcs.AddByThreePoints startPoint,midPoint.Geometry,endPoint Set AddSketchArc = endPoint End Function Private Sub CreatePart0 sketchDic.RemoveAll Dim sketchNormal As UnitVector searchName=Dir(storePath & "625_2Z_PART1.ipt") if searchName<>"" then exit sub end if set partDocument=InvApp.Documents.Add(kPartDocumentObject,"",true) partDocument.UnitsOfMeasure.LengthUnits = kMillimeterLengthUnits partDocument.UnitsOfMeasure.AngleUnits = kDegreeAngleUnits dim partCompDef as PartComponentDefinition set partCompDef=partDocument.ComponentDefinition set feat3=CreateSketch1_3(partCompDef) RotateSketch partCompDef,feat3,360,kPositiveExtentDirection,kJoinOperation If (invApp.SoftwareVersion.Major >= 6) Then partDocument.PropertySets.Item("{F29F85E0-4FF9-1068-AB91-08002B27B3D9}").ItemByPropId(kTitleSummaryInformation).Value = "625-2Z_PART1" partDocument.PropertySets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}").ItemByPropId(kVendorDesignTrackingProperties).Value = "skf" partDocument.PropertySets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}").ItemByPropId(kPartNumberDesignTrackingProperties).Value = "625-2Z_PART1" else partDocument.PropertySets.Item("Summary Information").ItemByPropId(kTitleSummaryInformation).Value = "625-2Z_PART1" partDocument.PropertySets.Item("Design Tracking Properties").ItemByPropId(kPartNumberDesignTrackingProperties).Value = "625-2Z_PART1" end if setPartColor partDocument,175,175,175,"RGB(175,175,175)" partDocument.SaveAs storePath & "625_2Z_PART1.ipt",false partdocument.Close End Sub Private Sub CreatePart1 sketchDic.RemoveAll Dim sketchNormal As UnitVector searchName=Dir(storePath & "625_2Z_PART2.ipt") if searchName<>"" then exit sub end if set partDocument=InvApp.Documents.Add(kPartDocumentObject,"",true) partDocument.UnitsOfMeasure.LengthUnits = kMillimeterLengthUnits partDocument.UnitsOfMeasure.AngleUnits = kDegreeAngleUnits dim partCompDef as PartComponentDefinition set partCompDef=partDocument.ComponentDefinition set feat3=CreateSketch2_3(partCompDef) RotateSketch partCompDef,feat3,360,kPositiveExtentDirection,kJoinOperation If (invApp.SoftwareVersion.Major >= 6) Then partDocument.PropertySets.Item("{F29F85E0-4FF9-1068-AB91-08002B27B3D9}").ItemByPropId(kTitleSummaryInformation).Value = "625-2Z_PART2" partDocument.PropertySets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}").ItemByPropId(kVendorDesignTrackingProperties).Value = "skf" partDocument.PropertySets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}").ItemByPropId(kPartNumberDesignTrackingProperties).Value = "625-2Z_PART2" else partDocument.PropertySets.Item("Summary Information").ItemByPropId(kTitleSummaryInformation).Value = "625-2Z_PART2" partDocument.PropertySets.Item("Design Tracking Properties").ItemByPropId(kPartNumberDesignTrackingProperties).Value = "625-2Z_PART2" end if setPartColor partDocument,175,175,175,"RGB(175,175,175)" partDocument.SaveAs storePath & "625_2Z_PART2.ipt",false partdocument.Close End Sub Private Sub CreatePart2 sketchDic.RemoveAll Dim sketchNormal As UnitVector searchName=Dir(storePath & "625_2Z_PART3.ipt") if searchName<>"" then exit sub end if set partDocument=InvApp.Documents.Add(kPartDocumentObject,"",true) partDocument.UnitsOfMeasure.LengthUnits = kMillimeterLengthUnits partDocument.UnitsOfMeasure.AngleUnits = kDegreeAngleUnits dim partCompDef as PartComponentDefinition set partCompDef=partDocument.ComponentDefinition set feat3=CreateSketch3_3(partCompDef) RotateSketch partCompDef,feat3,360,kPositiveExtentDirection,kJoinOperation If (invApp.SoftwareVersion.Major >= 6) Then partDocument.PropertySets.Item("{F29F85E0-4FF9-1068-AB91-08002B27B3D9}").ItemByPropId(kTitleSummaryInformation).Value = "625-2Z_PART3" partDocument.PropertySets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}").ItemByPropId(kVendorDesignTrackingProperties).Value = "skf" partDocument.PropertySets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}").ItemByPropId(kPartNumberDesignTrackingProperties).Value = "625-2Z_PART3" else partDocument.PropertySets.Item("Summary Information").ItemByPropId(kTitleSummaryInformation).Value = "625-2Z_PART3" partDocument.PropertySets.Item("Design Tracking Properties").ItemByPropId(kPartNumberDesignTrackingProperties).Value = "625-2Z_PART3" end if setPartColor partDocument,175,175,175,"RGB(175,175,175)" partDocument.SaveAs storePath & "625_2Z_PART3.ipt",false partdocument.Close End Sub Private Sub CreatePart3 sketchDic.RemoveAll Dim sketchNormal As UnitVector searchName=Dir(storePath & "625_2Z_PART4.ipt") if searchName<>"" then exit sub end if set partDocument=InvApp.Documents.Add(kPartDocumentObject,"",true) partDocument.UnitsOfMeasure.LengthUnits = kMillimeterLengthUnits partDocument.UnitsOfMeasure.AngleUnits = kDegreeAngleUnits dim partCompDef as PartComponentDefinition set partCompDef=partDocument.ComponentDefinition set feat3=CreateSketch4_3(partCompDef) RotateSketch partCompDef,feat3,360,kPositiveExtentDirection,kJoinOperation If (invApp.SoftwareVersion.Major >= 6) Then partDocument.PropertySets.Item("{F29F85E0-4FF9-1068-AB91-08002B27B3D9}").ItemByPropId(kTitleSummaryInformation).Value = "625-2Z_PART4" partDocument.PropertySets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}").ItemByPropId(kVendorDesignTrackingProperties).Value = "skf" partDocument.PropertySets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}").ItemByPropId(kPartNumberDesignTrackingProperties).Value = "625-2Z_PART4" else partDocument.PropertySets.Item("Summary Information").ItemByPropId(kTitleSummaryInformation).Value = "625-2Z_PART4" partDocument.PropertySets.Item("Design Tracking Properties").ItemByPropId(kPartNumberDesignTrackingProperties).Value = "625-2Z_PART4" end if setPartColor partDocument,175,175,175,"RGB(175,175,175)" partDocument.SaveAs storePath & "625_2Z_PART4.ipt",false partdocument.Close End Sub Private Sub CreatePart4 sketchDic.RemoveAll Dim sketchNormal As UnitVector searchName=Dir(storePath & "625_2Z_PART5.ipt") if searchName<>"" then exit sub end if set partDocument=InvApp.Documents.Add(kPartDocumentObject,"",true) partDocument.UnitsOfMeasure.LengthUnits = kMillimeterLengthUnits partDocument.UnitsOfMeasure.AngleUnits = kDegreeAngleUnits dim partCompDef as PartComponentDefinition set partCompDef=partDocument.ComponentDefinition set feat3=CreateSketch5_3(partCompDef) RotateSketch partCompDef,feat3,360,kPositiveExtentDirection,kJoinOperation If (invApp.SoftwareVersion.Major >= 6) Then partDocument.PropertySets.Item("{F29F85E0-4FF9-1068-AB91-08002B27B3D9}").ItemByPropId(kTitleSummaryInformation).Value = "625-2Z_PART5" partDocument.PropertySets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}").ItemByPropId(kVendorDesignTrackingProperties).Value = "skf" partDocument.PropertySets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}").ItemByPropId(kPartNumberDesignTrackingProperties).Value = "625-2Z_PART5" else partDocument.PropertySets.Item("Summary Information").ItemByPropId(kTitleSummaryInformation).Value = "625-2Z_PART5" partDocument.PropertySets.Item("Design Tracking Properties").ItemByPropId(kPartNumberDesignTrackingProperties).Value = "625-2Z_PART5" end if setPartColor partDocument,191,191,0,"RGB(191,191,0)" partDocument.SaveAs storePath & "625_2Z_PART5.ipt",false partdocument.Close End Sub Private Sub CreatePart5 searchName=Dir(storePath & "625_2Z.iam") if searchName<>"" then exit sub end if createPart0 createPart1 createPart2 createPart3 createPart4 createPart4 createPart4 createPart4 createPart4 createPart4 createPart4 createPart4 set asmDocument=InvApp.Documents.Add(kAssemblyDocumentObject,"",true) asmDocument.UnitsOfMeasure.LengthUnits = kMillimeterLengthUnits asmDocument.UnitsOfMeasure.AngleUnits = kDegreeAngleUnits dim actOcc as ComponentOccurrence set Matrix = irx.CreateMatrix() Matrix.SetCoordinateSystem irx.CreatePoint(0,0,0),irx.CreateVector(1,0,0),irx.CreateVector(0,1,0),irx.CreateVector(0,0,1) Set actOcc=asmDocument.ComponentDefinitions(1).Occurrences.Add(storePath &"625_2Z_PART1.ipt",matrix) actOcc.Grounded=True set Matrix = irx.CreateMatrix() Matrix.SetCoordinateSystem irx.CreatePoint(0,0,0),irx.CreateVector(1,0,0),irx.CreateVector(0,1,0),irx.CreateVector(0,0,1) Set actOcc=asmDocument.ComponentDefinitions(1).Occurrences.Add(storePath &"625_2Z_PART2.ipt",matrix) actOcc.Grounded=True set Matrix = irx.CreateMatrix() Matrix.SetCoordinateSystem irx.CreatePoint(0,0,0),irx.CreateVector(1,0,0),irx.CreateVector(0,1,0),irx.CreateVector(0,0,1) Set actOcc=asmDocument.ComponentDefinitions(1).Occurrences.Add(storePath &"625_2Z_PART3.ipt",matrix) actOcc.Grounded=True set Matrix = irx.CreateMatrix() Matrix.SetCoordinateSystem irx.CreatePoint(0,0,0),irx.CreateVector(1,0,0),irx.CreateVector(0,1,0),irx.CreateVector(0,0,1) Set actOcc=asmDocument.ComponentDefinitions(1).Occurrences.Add(storePath &"625_2Z_PART4.ipt",matrix) actOcc.Grounded=True set Matrix = irx.CreateMatrix() Matrix.SetCoordinateSystem irx.CreatePoint(0,0,0),irx.CreateVector(1,0,0),irx.CreateVector(0,1,0),irx.CreateVector(0,0,1) Set actOcc=asmDocument.ComponentDefinitions(1).Occurrences.Add(storePath &"625_2Z_PART5.ipt",matrix) actOcc.Grounded=True set Matrix = irx.CreateMatrix() Matrix.SetCoordinateSystem irx.CreatePoint(0,0,0),irx.CreateVector(1,0,0),irx.CreateVector(0,0.70710678118655,-0.70710678118655),irx.CreateVector(0,0.70710678118655,0.70710678118655) Set actOcc=asmDocument.ComponentDefinitions(1).Occurrences.Add(storePath &"625_2Z_PART5.ipt",matrix) actOcc.Grounded=True set Matrix = irx.CreateMatrix() Matrix.SetCoordinateSystem irx.CreatePoint(0,0,0),irx.CreateVector(1,0,0),irx.CreateVector(0,0,-1),irx.CreateVector(0,1,0) Set actOcc=asmDocument.ComponentDefinitions(1).Occurrences.Add(storePath &"625_2Z_PART5.ipt",matrix) actOcc.Grounded=True set Matrix = irx.CreateMatrix() Matrix.SetCoordinateSystem irx.CreatePoint(0,0,0),irx.CreateVector(1,0,0),irx.CreateVector(0,-0.70710678118655,-0.70710678118655),irx.CreateVector(0,0.70710678118655,-0.70710678118655) Set actOcc=asmDocument.ComponentDefinitions(1).Occurrences.Add(storePath &"625_2Z_PART5.ipt",matrix) actOcc.Grounded=True set Matrix = irx.CreateMatrix() Matrix.SetCoordinateSystem irx.CreatePoint(0,0,0),irx.CreateVector(1,0,0),irx.CreateVector(0,-1,0),irx.CreateVector(0,0,-1) Set actOcc=asmDocument.ComponentDefinitions(1).Occurrences.Add(storePath &"625_2Z_PART5.ipt",matrix) actOcc.Grounded=True set Matrix = irx.CreateMatrix() Matrix.SetCoordinateSystem irx.CreatePoint(0,0,0),irx.CreateVector(1,0,0),irx.CreateVector(0,-0.70710678118655,0.70710678118655),irx.CreateVector(0,-0.70710678118655,-0.70710678118655) Set actOcc=asmDocument.ComponentDefinitions(1).Occurrences.Add(storePath &"625_2Z_PART5.ipt",matrix) actOcc.Grounded=True set Matrix = irx.CreateMatrix() Matrix.SetCoordinateSystem irx.CreatePoint(0,0,0),irx.CreateVector(1,0,0),irx.CreateVector(0,0,1),irx.CreateVector(0,-1,0) Set actOcc=asmDocument.ComponentDefinitions(1).Occurrences.Add(storePath &"625_2Z_PART5.ipt",matrix) actOcc.Grounded=True set Matrix = irx.CreateMatrix() Matrix.SetCoordinateSystem irx.CreatePoint(0,0,0),irx.CreateVector(1,0,0),irx.CreateVector(0,0.70710678118655,0.70710678118655),irx.CreateVector(0,-0.70710678118655,0.70710678118655) Set actOcc=asmDocument.ComponentDefinitions(1).Occurrences.Add(storePath &"625_2Z_PART5.ipt",matrix) actOcc.Grounded=True If (invApp.SoftwareVersion.Major >= 6) Then asmDocument.PropertySets.Item("{F29F85E0-4FF9-1068-AB91-08002B27B3D9}").ItemByPropId(kTitleSummaryInformation).Value = "625-2Z" asmDocument.PropertySets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}").ItemByPropId(kVendorDesignTrackingProperties).Value = "skf" asmDocument.PropertySets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}").ItemByPropId(kPartNumberDesignTrackingProperties).Value = "625-2Z" else asmDocument.PropertySets.Item("Summary Information").ItemByPropId(kTitleSummaryInformation).Value = "625-2Z" asmDocument.PropertySets.Item("Design Tracking Properties").ItemByPropId(kPartNumberDesignTrackingProperties).Value = "625-2Z" end if asmDocument.SaveAs storePath & "625_2Z.iam",false asmDocument.Close end sub sub CreateInventorDocument set invApp=GetObject(,"Inventor.Application") set irx = invApp.TransientGeometry PI=3.141592653589793238462643383279 Set sketchDic = CreateObject("Scripting.Dictionary") getLocalOptions createPart5 invApp.Documents.Open storePath & "625_2Z.iam" end sub