Sub main() ! ]0 c! h6 {* \: }' NSet swApp = Application.SldWorks' V$ s0 W3 h3 {7 s+ a# E
Set modelDoc = swApp.ActiveDoc* n8 _0 F) `; j, X4 P
'// Check active document2 s1 m) i2 {/ v1 L' m
' % \, X- [4 u' xIf modelDoc Is Nothing Then. o* ^2 r2 E' k6 ?5 @, w
MsgBox "No active document!" % m7 @$ c+ g1 g, fExit Sub 3 T/ F+ o8 j4 p; X0 K) }End If
2 ~- g6 E; [! @( S! M
'// get active sketch# w/ _) v! e( K$ w' }6 P% N/ ]
'9 n1 Z3 \ j4 v5 ^) v6 D& B% T+ ]
Set sketch = modelDoc.SketchManager.ActiveSketch 4 W( O9 k4 c; G7 I5 v8 EIf sketch Is Nothing Then / v6 F' G/ H( j- _: L+ K! fMsgBox "No active Sketch!" 0 n6 d: z2 D" Q* X- }& ]Exit Sub $ q& y- q1 [. Z$ F D( zEnd If$ f: p2 x0 }) @& p9 J9 r
" J2 m+ x I" T$ j* O% G- D* w6 e
'// Output to file , R: Q; N3 ^# tDim iFileNum As Integer $ A% a- a( _, {9 X+ ziFileNum = FreeFile()% S x/ x, [& j( U
Open FILE_NAME For Output As iFileNum0 s D1 U9 b4 F: p9 N
Dim i As Integer+ s6 m `& x5 E B" E
Dim sketchPoints As Variant5 E4 ?' ~, T3 j0 i0 ~1 X
sketchPoints = sketch.GetSketchPoints2() $ }, C% d. n" D! p. |2 E; q8 LFor i = 0 To UBound(sketchPoints)