I have two objects: objLine1 & objLine2. Is there a fillet utility or do I have to do this that hard way and draw arcs?
|
I have two objects: objLine1 & objLine2. Is there a fillet utility or do I have to do this that hard way and draw arcs?
Last edited by cgerhardt; 2006-08-16 at 08:43 PM.
Hard way.
Calculate the arc center point, and the two tangent points, then draw the arc and reset each line endpoint.
R.K. McSwain | CAD Panacea |
Just do a fillet command and enter R for radius. That's normal cad. Nothing hard about that unless you are after something that requires calculating exact coordinates and distances.Originally Posted by cgerhardt
This is the VBA forum.Originally Posted by Firmso
I assume the OP is wanting to do this using VBA, not manual user entry at the command line.
R.K. McSwain | CAD Panacea |
The guy is asking for a utility or he's gonna draw it in.Originally Posted by rkmcswain
I thought maybe he didn't know.
Sorry if I hurt somebody's feelings.
No feelings hurt here.Originally Posted by Firmso
The OP is looking for a FILLET method in VBA, and it doesn't exist.
R.K. McSwain | CAD Panacea |
Yes it was in VBA. That's exact what I thought! For what I need it's easier in AutoLISP.
Thanks for the replies.
You are probably right. I am currently working on a VBA routine to assist in the creation of median breaks, left hand turn lanes, etc. - using specific criteria. Manually creating these "fillets" is not fun.Originally Posted by cgerhardt
R.K. McSwain | CAD Panacea |
I use SendCommand and nothing else,
w/o any calculation
~'J'~Code:Sub FilletLines() Dim objLine1 As AcadLine Dim objLine2 As AcadLine Dim varPt As Variant Dim dblFill, newSysVar As Double Dim comString As String dblFill = ThisDrawing.GetVariable("FILLETRAD") On Error GoTo ProblemHere MsgBox CStr(dblFill) newSysVar = CDbl(InputBox("Enter fillet radius:", "Fillet Radius Value", "2,5")) ThisDrawing.Utility.GetEntity objLine1, varPt, "Select first line" ThisDrawing.Utility.GetEntity objLine2, varPt, "Select second line" If objLine1 Is Nothing Or objLine2 Is Nothing Then Exit Sub Else If TypeOf objLine1 Is AcadLine And _ TypeOf objLine2 Is AcadLine Then ThisDrawing.SetVariable "FILLETRAD", newSysVar comString = "_FILLET" & vbCr & "(HANDENT " & Chr(34) & CStr(objLine1.Handle) & Chr(34) & ")" & vbCr & _ "(HANDENT " & Chr(34) & CStr(objLine2.Handle) & Chr(34) & ")" & vbCr ThisDrawing.SendCommand comString Else MsgBox "Incorrect object type" Exit Sub End If End If ThisDrawing.SetVariable "FILLETRAD", dblFill ProblemHere: If Err Then ThisDrawing.SetVariable "FILLETRAD", dblFill MsgBox vbCr & Err.Description End If End Sub