> Builder
Посмотри пример из учебника, может на его
основе сделаешь что нужно
Option Explicit
'' written by Joe Sutphin
Public Sub WriteAllPolylinesToFile(strFilename As String)
Dim SelectionSet As AcadSelectionSet
Dim sSet As AcadSelectionSet
Dim intGroupCode(0) As Integer
Dim varDataCode(0) As Variant
Dim LWPolyline As AcadLWPolyline
Dim File As Integer
Dim Column As Long
Dim Row As Long
Dim Lines() As Double
On Error Resume Next
'do Lightweight polylines
intGroupCode(0) = 0
varDataCode(0) = "LWPolyline"
For Each sSet In ThisDrawing.SelectionSets
Set SelectionSet = sSet
If SelectionSet.Name = "Poly" Then
SelectionSet.Delete
Exit For
End If
Next
'create a selection of all lightweight polylines
Set SelectionSet = ThisDrawing.SelectionSets.Add("Poly")
SelectionSet.Select acSelectionSetAll, , , intGroupCode, varDataCode
If SelectionSet.Count < 1 Then Exit Sub
File = FreeFile
'write the polyline vertices to file
Open strFilename For Append Access Write As #File
Write #File, "Polyline vertices"
'go through each polyline object
ReDim Lines(SelectionSet.Count + 1, 1)
For Each LWPolyline In SelectionSet
Write #File, "Polyline Handle: " & LWPolyline.Handle
For Row = 0 To ((UBound(LWPolyline.Coordinates) + 1) / 2) - 1
For Column = 0 To 1
Lines(Row, Column) = LWPolyline.Coordinates(Row + Column)
Next Column
Write #File, Lines(Row, 0) & ", " & Lines(Row, 1)
Next Row
Next LWPolyline
Close #File
If Err Then
Kill strFilename
MsgBox "There were errors, no file created!"
End If
End Sub
Public Sub Start()
WriteAllPolylinesToFile ("C:\MyVBA\JOE.txt") '' change full path here
End Sub
~'J'~