phoenixdjq 发表于 2009-2-11 09:00:00

<p>因为文件格式不对,压缩后就能上传了</p>

dzt 发表于 2009-3-5 22:22:00

<p>我也试了,的确黑白间隔不等,而且拟合后,有些白色的框框数量减少,导致黑白间隔差距更大,这到底为什么?能有更好的处理方法吗?</p>

dianbotang 发表于 2009-4-5 01:34:00

<p>绘制铁路线的vba程序,适用于将多条多段线转为铁路线,有兴趣的朋友可以据此改进满足自身需要。</p><p>对于样条曲线,直线和圆弧,可以先转为多段线。</p><p>Option Explicit<br/>'绘制铁路线<br/>Sub Railway()<br/>&nbsp;&nbsp;&nbsp; On Error GoTo ErrorHandler</p><p>&nbsp;&nbsp;&nbsp; Dim SSet As AcadSelectionSet<br/>&nbsp;&nbsp;&nbsp; Set SSet = ThisDrawing.PickfirstSelectionSet<br/>&nbsp;&nbsp;&nbsp; If SSet.Count = 0 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox "未选择对象"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit Sub<br/>&nbsp;&nbsp;&nbsp; End If<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; AppActivate ThisDrawing.Application.Caption<br/>&nbsp;&nbsp;&nbsp; Dim Width As Double<br/>&nbsp;&nbsp;&nbsp; Width = ThisDrawing.Utility.GetReal(vbLf &amp; "请输入铁路线宽: ")<br/>&nbsp;&nbsp;&nbsp; Dim currLTScale As Double<br/>&nbsp;&nbsp;&nbsp; currLTScale = ThisDrawing.Utility.GetReal(vbLf &amp; "请输入铁路线型比例: ")<br/>&nbsp;&nbsp;&nbsp; Dim currLinetype As String<br/>&nbsp;&nbsp;&nbsp; currLinetype = ThisDrawing.Utility.GetString(False, vbLf &amp; "请输入铁路线型: ")<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; Dim entry As AcadLineType<br/>&nbsp;&nbsp;&nbsp; Dim found As Boolean<br/>&nbsp;&nbsp;&nbsp; found = False<br/>&nbsp;&nbsp;&nbsp; For Each entry In ThisDrawing.Linetypes<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If StrComp(entry.Name, currLinetype, 1) = 0 Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; found = True<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit For<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br/>&nbsp;&nbsp;&nbsp; Next<br/>&nbsp;&nbsp;&nbsp; If Not (found) Then ThisDrawing.Linetypes.Load currLinetype, "acad.lin"</p><p>&nbsp;&nbsp;&nbsp; Dim PlineObj As AcadEntity<br/>&nbsp;&nbsp;&nbsp; Dim OffsetObj1 As Variant<br/>&nbsp;&nbsp;&nbsp; Dim OffsetObj2 As Variant<br/>&nbsp;&nbsp;&nbsp; For Each PlineObj In SSet<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If TypeName(PlineObj) Like "IAcad*Polyline" Then<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OffsetObj1 = PlineObj.Offset(Width / 2)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OffsetObj2 = PlineObj.Offset(-Width / 2)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PlineObj.ConstantWidth = Width<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PlineObj.LinetypeScale = currLTScale<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PlineObj.Linetype = currLinetype<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PlineObj.LinetypeGeneration = True<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br/>&nbsp;&nbsp;&nbsp; Next<br/>&nbsp;&nbsp;&nbsp; ThisDrawing.Regen True<br/>&nbsp;&nbsp;&nbsp; Exit Sub<br/>&nbsp;&nbsp;&nbsp; <br/>ErrorHandler:<br/>&nbsp; MsgBox Err.Description<br/>&nbsp;&nbsp;&nbsp; <br/>End Sub<br/></p>
页: 1 2 [3]
查看完整版本: [求助]铁路线怎么画??