bios8086 发表于 2008-5-14 08:01:00

'how to get text object in model space ?

<p>&nbsp;&nbsp;&nbsp; Function TextString(ByVal ThisDrawing As AcadDocument, ByVal acadapp As AcadApplication)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim textObj As AcadText<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim text As String<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim insertionPoint(0 To 2) As Double<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim height As Double<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Define the text object<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; text = "jjjjjjj"<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insertionPoint(0) = 0.0# : insertionPoint(1) = 0.0# : insertionPoint(2) = 0.0#<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; height = 5000<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Create the text object in model space<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textObj = ThisDrawing.ModelSpace.AddText(text, insertionPoint, height)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acadapp.ZoomAll()</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Return the current text string for the object<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; text = textObj.TextString<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox("The TextString property equals: " &amp; text, vbInformation, "TextString 示例")</p><p></p><p>&nbsp;&nbsp;&nbsp; End Function</p><p>这段代码是创建text object 在model space厘面 ,那么如何取得呢?帮助里面说访问路径是<table cellspacing="1" cellpadding="4" border="0"><tbody><tr valign="top"><th align="left"><p class="Bullet2-end">访问途径:</p></th><td><p class="Bullet2-end">ModelSpace.Item</p></td></tr></tbody></table>&nbsp; 能不能给个范例 具体是如何访问的?</p><p></p>
页: [1]
查看完整版本: 'how to get text object in model space ?