wangrong0820 发表于 2009-10-15 18:48:00
先谢谢好心的你了!希望以后多发一些有用的资料,非常感激兰州人 发表于 2009-10-15 20:02:00
<p>一般用法是ThisDrawing.ModelSpace</p><p>ThisDrawing.Application.ActiveDocument.ModelSpace的用法虽然正确,但不常用。</p><p>见下载程序的两个示例。</p><p>Sub EditLwPolyline()<br/> Dim objLwPl As AcadLWPolyline<br/> Dim xy(5) As Double<br/> xy(0) = 100: xy(1) = 200<br/> xy(2) = 300: xy(3) = 300<br/> xy(4) = 500: xy(5) = 600<br/> Set objLwPl = ThisDrawing.Application.ActiveDocument.ModelSpace.AddLightWeightPolyline(xy)<br/> objLwPl.Closed = True '闭合<br/> objLwPl.ConstantWidth = 0 '全局宽度<br/> objLwPl.Linetype = "10421" '线型(加载了才可用)<br/> objLwPl.Highlight True '高亮显示<br/> MsgBox "ID=" & objLwPl.ObjectID<br/> MsgBox "类型=" & objLwPl.ObjectName<br/> MsgBox "句柄=" & objLwPl.Handle<br/> MsgBox "多段线坐标为:(" & objLwPl.Coordinates(0) & "," & objLwPl.Coordinates(1) & "),(" & objLwPl.Coordinates(2) & "," & objLwPl.Coordinates(3) & "),(" & objLwPl.Coordinates(4) & "," & objLwPl.Coordinates(5) & ")"<br/>End Sub<br/>Sub EditText()<br/> Dim objText As AcadText<br/> Dim xy(2) As Double<br/> xy(0) = 100: xy(1) = 200: xy(2) = 300<br/> Set objText = ThisDrawing.Application.ActiveDocument.ModelSpace.AddText("Hello World!", xy, 30)<br/> MsgBox "插入点位置:(" & objText.insertionPoint(0) & "," & objText.insertionPoint(1) & "," & objText.insertionPoint(2) & ")"<br/> objText.Alignment = acAlignmentBottomRight '对齐方式<br/> objText.height = 20 '高度<br/> objText.StyleName = "STANDARD" '样式<br/> objText.TextString = "AutoCAD VBA 测绘" '文字内容<br/>End Sub</p>tl319 发表于 2009-10-17 20:55:00
晕,又不说清楚,白花了我1元大洋lijianggc 发表于 2009-10-21 16:02:00
<p>下载了看看,谢谢哈</p>FLYFUN 发表于 2009-10-31 16:31:00
<p>学习一下 下载看啊看你</p>参股银行 发表于 2009-10-31 22:44:00
还要钱 干什么?onnet 发表于 2009-11-13 15:30:00
<div style="LINE-HEIGHT: normal; MARGIN-TOP: 10px; TEXT-INDENT: 0px; MIN-HEIGHT: 200px; WORD-WRAP: break-word; FONT-SIZE: 12pt; WORD-BREAK: break-all;">不错,适合初学的!</div>leefy55555 发表于 2009-11-14 15:46:00
<p>看着像是好东西,因为我也是干测绘的,可是怎么下不下来呢?</p>chariv9801 发表于 2009-11-15 15:21:00
下载学习,学习superyjy 发表于 2009-11-16 11:42:00
<p>非常好.谢谢楼主的大公无私</p><p></p>