Jump to content

VBA - Command Fillet on 2 single Polyline does not work!


Recommended Posts

Posted

I met a very "strange" behavior of VBA with Fillet Command send via ThisDrawing.SendCommand function.

I have the function Fillet_2Line (line1, line2, r), which will apply the Fillet command to line1, line2 with Radius=R

Sub fillet_2line(line1 As Variant, line2 As Variant, radius As Double)
   Dim text As String
   text = "f" & vbCr & "r" & vbCr & radius & vbCr & "(handent " & Chr(34) & line1.Handle & Chr(34) & ")" & vbCr & "(handent " & Chr(34) & line2.Handle & Chr(34) & ")" & vbCr
   ThisDrawing.SendCommand (text)
End Sub

As you can see, the function is very simple, call Fillet command from Autocad then select two lines by their handle. Use can reproduce the function without VBA by call Fillet command and select two POLILINES by their HANDLE.

However, it works on LINE, but NOT POLYLINE. If I select two polylines by left click on them, it works. But if I select two polylines by their HANDLE, it does not work!

Fillet 2 Line - Selected by left click - Works

Fillet 2 Line - Selected by handle - Works

Fillet 2 PLine - Selected left click - Works

Fillet 2 PLine - Selected by handle - Does not workUntitled.jpg

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...