如何打断曲线?
VB开发|黄洪辉|2018-05-30 09:52
-
回答:
Private Sub SplitCurves() Set mxUtility = New MxDrawXLib.MxDrawUtility Dim ent As MxDrawXLib.MxDrawEntity Set ent = mxUtility.GetEntity(getPt, Chr(13) + Chr(10) + "选择打断的曲线") If (ent Is Nothing) Then MsgBox "没有选择实体.." Exit Sub End If Dim curve As MxDrawXLib.MxDrawCurve If TypeOf ent Is MxDrawXLib.MxDrawCurve Then Set curve = ent Else MsgBox "实体类型不对" Exit Sub End If Dim getPt1 As MxDrawXLib.MxDrawPoint Set getPt1 = mxUtility.GetPoint(, Chr(13) + Chr(10) + "点取打断的位置:") If (getPt1 Is Nothing) Then MsgBox "用户取消.." Exit Sub End If Set param = New MxDrawXLib.MxDrawResbuf param.AddPoint getPt1, -10 Dim rb As MxDrawXLib.MxDrawResbuf If curve.SplitCurves(param, rb) Then MsgBox "打断成功" '把原来的删除掉 curve.Erase End If End Sub