求教,Circle和Mline的IntersectWith不在中心线上
我的多线中红色分别是正负0.5的偏移,蓝色是0,它和直线为什么的交点(已用白色线段连起来了)有时候却不在蓝色线上呢file:///d:/lml.gif 本帖最后由 作者 于 2004-10-15 20:07:47 编辑 <br /><br /> 我写的代码如下:
Dim objMLine As AcadMLine, pnt<BR> ThisDrawing.Utility.GetEntity objMLine, pnt, "请选择插入点:"<BR> <BR> If Not objMLine.ObjectName = "AcDbMline" Then<BR> ThisDrawing.Utility.Prompt "请选择插入点"<BR> Exit Sub<BR> End If<BR> <BR> Dim tmpCircle As AcadCircle<BR> Set tmpCircle = ThisDrawing.ModelSpace.AddCircle(pnt, 0.5)<BR> <BR> Dim tmpPoint As Variant<BR> tmpPoint = objMLine.IntersectWith(tmpCircle, acExtendBoth)<BR> <BR> Dim pnt1(0 To 2) As Double<BR> pnt1(0) = tmpPoint(3)<BR> pnt1(1) = tmpPoint(4)<BR> pnt1(2) = tmpPoint(5)<BR> <BR> Dim pnt2(0 To 2) As Double<BR> pnt2(0) = tmpPoint(0)<BR> pnt2(1) = tmpPoint(1)<BR> pnt2(2) = tmpPoint(2)
Dim tmpLine As AcadLine<BR> Set tmpLine = ThisDrawing.ModelSpace.AddLine(pnt2, pnt1)<BR> 可能与你的多线的对齐点(对正方式)有关,把对正方式设置为“无”试试。 我确实是将它设为无的,ML/J/Z
而且,我发现,当我把Circle换成XLine(垂直于那条白线)后,得到的结果更奇怪,交点在很远的地方。
页:
[1]