返回块引用的属性文本
VB开发|黄洪辉|2018-05-30 09:52
-
回答:
Private Sub readAttrib() AxMxDrawX1.OpenDwgFile("H:\A4图框.dwg") Dim ss As MxDrawXLib.MxDrawSelectionSet ss = New MxDrawXLib.MxDrawSelectionSet ss.AllSelect() Dim iNum As Long iNum = 0 Do While iNum < ss.Count Dim ent As MxDrawXLib.MxDrawEntity ent = ss.Item(iNum) If TypeOf ent Is MxDrawXLib.MxDrawBlockReference Then Dim blkRef As MxDrawXLib.MxDrawBlockReference blkRef = ent Dim iAttrib As Long iAttrib = 0 Do While iAttrib < blkRef.AttributeCount Dim attrib As MxDrawXLib.MxDrawAttribute attrib = blkRef.AttributeItem(iAttrib) attrib.TextString = attrib.TextString + "-test" iAttrib = iAttrib + 1 Loop blkRef.AssertWriteEnabled() End If iNum = iNum + 1 Loop End Sub