I did all of that, still nothing! As I said, the macro does work when I go to Tools>Macro>Macros>Run. (the macro name is C:\AcadCustom\CentroidFinder.dvb!Module1.Centroidfinder) But when I press the button, I get this in the command line:
_-vbarun Macro name: "C:\
If I fill in the rest of the macro name after the "C:\, it'll run. Why won't it just do it automatically?
EDIT: tried to attach, but the site wouldn't let me. Here's the raw text in Module1:
Sub Centroidfinder()
Dim ent(0) As AcadEntity
Dim p1 As AcadLWPolyline
Dim pp As Variant
Dim reg As AcadRegion
Dim center As AcadCircle
Dim varctr As Variant
Dim radius As Double
Dim ctr(2) As Double
ctr(2) = 0
radius = 4
ThisDrawing.Utility.GetEntity ent(0), "Select a polyline: "
If TypeOf ent(0) Is AcadLWPolyline Or TypeOf ent(0) Is AcadPolyline Then
pp = ThisDrawing.ModelSpace.AddRegion(ent)
ent(0).Delete
MsgBox "A region was created"
varctr = pp(0).Centroid
ctr(0) = varctr(0)
ctr(1) = varctr(1)
Set center = ThisDrawing.ModelSpace.AddCircle(ctr, radius)
'ThisDrawing.SendCommand ("MASSPROP" & vbCr)
ElseIf TypeOf ent(0) Is AcadRegion Then
varctr = ent(0).Centroid
ctr(0) = varctr(0)
ctr(1) = varctr(1)
Set center = ThisDrawing.ModelSpace.AddCircle(ctr, radius)
End If
End Sub