Sub main() P+ |- I5 D- W+ k- c, T" e, `Set swApp = Application.SldWorks" ^; w5 }0 S. l; n+ N5 U1 N% Z
Set modelDoc = swApp.ActiveDoc " b- x# S3 W5 J5 ~9 Z'// Check active document 0 D+ Q0 [ V# {4 I+ v* o! J7 Z' % N; o; o( t$ I$ k! m& a; {; n- @If modelDoc Is Nothing Then8 m+ y4 p% D4 c! |$ B
MsgBox "No active document!" z: l% _8 u" d. N5 M
Exit Sub * B% d! { Y) S9 v& e7 I, }/ w l/ wEnd If
Q# c' [3 G) k0 ]% I- F" h
'// get active sketch ! m! n* x" m) u7 m* C$ }'- f' T6 N: H$ U; Z# H4 e
Set sketch = modelDoc.SketchManager.ActiveSketch5 v( u' ~' t! D1 z; t
If sketch Is Nothing Then& x$ y# l" T! i$ X
MsgBox "No active Sketch!", w: F6 H. m5 c- p; a
Exit Sub$ j% X/ ` e5 f: s
End If # U- e4 f% @1 f) |+ n: y , w- l% x" J6 I0 I'// Output to file4 r. G- P' t0 D
Dim iFileNum As Integer 3 j6 b2 ^: t8 ^iFileNum = FreeFile() + [2 ?7 \# f+ {Open FILE_NAME For Output As iFileNum - `! C" y( T& M/ v M* [ ^Dim i As Integer 7 U, N8 R* O. L* vDim sketchPoints As Variant 3 D, a, {1 I' n9 B4 d) vsketchPoints = sketch.GetSketchPoints2()( g( P2 |$ i7 D+ z
For i = 0 To UBound(sketchPoints)