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/>&nbsp;&nbsp; Dim objLwPl As AcadLWPolyline<br/>&nbsp;&nbsp; Dim xy(5) As Double<br/>&nbsp;&nbsp; xy(0) = 100: xy(1) = 200<br/>&nbsp;&nbsp; xy(2) = 300: xy(3) = 300<br/>&nbsp;&nbsp; xy(4) = 500: xy(5) = 600<br/>&nbsp;&nbsp; Set objLwPl = ThisDrawing.Application.ActiveDocument.ModelSpace.AddLightWeightPolyline(xy)<br/>&nbsp;&nbsp; objLwPl.Closed = True '闭合<br/>&nbsp;&nbsp; objLwPl.ConstantWidth = 0 '全局宽度<br/>&nbsp;&nbsp; objLwPl.Linetype = "10421" '线型(加载了才可用)<br/>&nbsp;&nbsp; objLwPl.Highlight True '高亮显示<br/>&nbsp;&nbsp; MsgBox "ID=" &amp; objLwPl.ObjectID<br/>&nbsp;&nbsp; MsgBox "类型=" &amp; objLwPl.ObjectName<br/>&nbsp;&nbsp; MsgBox "句柄=" &amp; objLwPl.Handle<br/>&nbsp;&nbsp; MsgBox "多段线坐标为:(" &amp; objLwPl.Coordinates(0) &amp; "," &amp; objLwPl.Coordinates(1) &amp; "),(" &amp; objLwPl.Coordinates(2) &amp; "," &amp; objLwPl.Coordinates(3) &amp; "),(" &amp; objLwPl.Coordinates(4) &amp; "," &amp; objLwPl.Coordinates(5) &amp; ")"<br/>End Sub<br/>Sub EditText()<br/>&nbsp;&nbsp; Dim objText As AcadText<br/>&nbsp;&nbsp; Dim xy(2) As Double<br/>&nbsp;&nbsp; xy(0) = 100: xy(1) = 200: xy(2) = 300<br/>&nbsp;&nbsp; Set objText = ThisDrawing.Application.ActiveDocument.ModelSpace.AddText("Hello World!", xy, 30)<br/>&nbsp;&nbsp; MsgBox "插入点位置:(" &amp; objText.insertionPoint(0) &amp; "," &amp; objText.insertionPoint(1) &amp; "," &amp; objText.insertionPoint(2) &amp; ")"<br/>&nbsp;&nbsp; objText.Alignment = acAlignmentBottomRight '对齐方式<br/>&nbsp;&nbsp; objText.height = 20 '高度<br/>&nbsp;&nbsp; objText.StyleName = "STANDARD" '样式<br/>&nbsp;&nbsp; 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>
页: 1 2 [3] 4 5 6 7 8 9 10 11 12
查看完整版本: AutoCAD二次开发(VBA)测绘篇