本帖最后由 wyqzm 于 2014-1-11 17:34 编辑
- Dim db As Database = HostApplicationServices.WorkingDatabase
- Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
- Dim optSel As New PromptSelectionOptions
- optSel.MessageForAdding = vbCrLf & "请选择对象:"
- Dim resSel As PromptSelectionResult = ed.GetSelection(optSel)
- Dim sSeT As SelectionSet = resSel.Value
- Dim ids As ObjectId() = sSeT.GetObjectIds()
- Using trans As Transaction = db.TransactionManager.StartTransaction()
- For Each sSetEntId As ObjectId In ids
- Dim en As Entity = trans.GetObject(sSetEntId, OpenMode.ForWrite)
- ed.WriteMessage(vbCrLf & "你选择的是: " & en.GetType().Name)
- Select Case en.GetType().Name
- Case "RotatedDimension"
- Dim ent As Dimension = en
- ed.WriteMessage(vbCrLf & "标注文字:" & ent.DimensionText) ‘这句得到的文字为空,为什么?’
- Case Else
- MsgBox("other")
- End Select
- Next
- trans.Commit()
- End Using
写: ent.DimensionText = “1234567890” ,倒是正常的,请请教!
|