This one is working on my end
{code}
Option Explicit
'' require reference to Microsoft Scripting Runtime
Sub TestRegions()
Dim oEnt As AcadEntity
Dim oReg As AcadRegion
Dim ftype(0) As Integer
Dim fdata(0) As Variant
Dim dxfCode, dxfValue
Dim name As String
Dim count As Integer
On Error GoTo Err_Control
Dim oSset As AcadSelectionSet
With ThisDrawing.SelectionSets
While .count > 0
.Item(0).Delete
Wend
Set oSset = .Add("$Regions$")
End With
ftype(0) = 0: fdata(0) = "REGION"
dxfCode = ftype: dxfValue = fdata
oSset.SelectOnScreen dxfCode, dxfValue
MsgBox oSset.count
ThisDrawing.SetVariable "EXPERT", 5
ThisDrawing.SetVariable "FILEDIA", 0
For Each oEnt In oSset
Set oReg = oEnt
name = Replace(ThisDrawing.name, ".dwg", ".sat")
ThisDrawing.SendCommand "_acisout " & "(handent " & Chr(34) & CStr(oReg.Handle) & Chr(34) & ") " & vbCr & name & vbCr & vbCr
count = CountPoints(name)
If count = 3 Then
MsgBox "Trianle"
Else
MsgBox "Another shape"
End If
Kill name
Next
ThisDrawing.SendCommand vbCr
Exit_Here:
ThisDrawing.SetVariable "FILEDIA", 1
ThisDrawing.SetVariable "EXPERT", 0
Exit Sub
Err_Control:
If Err.Number <> 0 Then
MsgBox Err.Description
Err.Clear
End If
Resume Exit_Here
End Sub
Public Function CountPoints(fname As String) As Integer
Dim fn, sr As String, fs, ForReading
Dim tmp(1) As String
ForReading = 1
Dim count As Integer
Set fs = CreateObject("Scripting.FileSystemObject")
Set fn = fs.OpenTextFile(fname, ForReading, False) ''<--full path
Do While Not fn.AtEndOfStream
sr = fn.Read(0)
sr = fn.ReadLine
If sr Like "point*" Then
count = count + 1
End If
Loop
fn.Close
Set fn = Nothing
Set fs = Nothing
CountPoints = count
End Function
{code}
~'J'~
_____________________________________
C6309D9E0751D165D0934D0621DFF27919