Dim m_selection As Autodesk.Revit.UI.Selection.Selection = m_uidocment.Selection
Dim m_elementset As ElementSet = m_selection.Elements
For Each elem As Autodesk.Revit.DB.Element In m_elementset
'新建一个事务
Dim m_transaction As New Autodesk.Revit.DB.Transaction(m_uidocment.Document)
Dim m_dimension As Autodesk.Revit.DB.Dimension = elem
Dim s_array As Autodesk.Revit.DB.DimensionSegmentArray = m_dimension.Segments
'For Each segment As Autodesk.Revit.DB.DimensionSegment In s_array
' TaskDialog.Show("宽度", segment.Value * 304.8)
' TaskDialog.Show("Y轴", segment.Origin.Y)
'Next
'TaskDialog.Show("X轴", s_array.Item(0).Origin.X.ToString())
Dim m_referencearray As ReferenceArray = m_dimension.References
For Each ref As Autodesk.Revit.DB.Reference In m_referencearray
TaskDialog.Show("df", ref.Element.Name + "id:" + ref.Element.Id.IntegerValue.ToString() + vbLf + ref.Element.ObjectType.Name)
Next
不好意思,代码发成VB的了,我一直用C#的,心血来潮用下VB.NET,呵呵。
6 个解决方案
#1
#2
#3
没人搞这方面的么?再顶一次
#4
不会吧,居然没人搞这个!顶一下的人都没有,真悲惨!
#5
#1
#2
#3
没人搞这方面的么?再顶一次
#4
不会吧,居然没人搞这个!顶一下的人都没有,真悲惨!
#5
#6
标注的文字,你想怎么移动?
Revit二次开发论坛 http://revit.5d6d.com
Revit二次开发论坛 http://revit.5d6d.com