码迷,mamicode.com
首页 > 其他好文 > 详细

NX Open显示符号(UF_DISP_display_temporary_point)

时间:2015-06-24 18:09:36      阅读:869      评论:0      收藏:0      [点我收藏+]

标签:

UF_DISP_display_temporary_point

使用方法:

Dim x As Double = 0, y As Double = 0, z As Double = 0

       Dim theUfSession = UFSession.GetUFSession()
       theUfSession.Disp.Refresh()

       Dim view_tag As NXOpen.Tag = NXOpen.Tag.Null
       theUfSession.View.AskWorkView(view_tag)

       Dim which_views = NXOpen.UF.UFDisp.ViewType.UseWorkView

       Dim layer_number As Integer = 0
       theUfSession.Layer.AskWorkLayer(layer_number)
       Dim color As NXOpen.UF.UFObj.DispProps
       With color
           .layer = layer_number
           .color = 216 ‘ 114
           .blank_status = UFConstants.UF_OBJ_NOT_BLANKED
           .line_width = UFConstants.UF_OBJ_WIDTH_NORMAL
           .highlight_status = True
       End With

       For Each marker_type In [Enum].GetValues(GetType(NXOpen.UF.UFDisp.PolyMarker))
           Try
               Dim makerpos() As Double = {x, y, z}
               theUfSession.Disp.DisplayTemporaryPoint(view_tag, which_views, makerpos, color, marker_type)
           Catch ex As Exception
           End Try
           Dim ref_point As UFDisp.TextRef = NXOpen.UF.UFDisp.TextRef.Middleleft
           Dim text as String = marker_type
           Dim text_coord() As Double = {x + 2, y, z}
           theUfSession.Disp.DisplayTemporaryText(view_tag, which_views, text, text_coord, ref_point, color, 3, 1)
           text = [Enum].GetName(marker_type.GetType, marker_type)
           text_coord = {x + 5, y, z}
           theUfSession.Disp.DisplayTemporaryText(view_tag, which_views, text, text_coord, ref_point, color, 3, 1)
           y -= 2
       Next

效果图、序号、名称如下所示:

技术分享技术分享技术分享技术分享

技术分享技术分享

NX Open显示符号(UF_DISP_display_temporary_point)

标签:

原文地址:http://www.cnblogs.com/bizca/p/4598094.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!