找回密码
 立即注册

QQ登录

只需一步,快速开始

微信扫码登录

搜索
查看: 973|回复: 0

[分享] 怎麼獲得點集內點的坐標

[复制链接]

44

主题

166

回帖

5317

积分

爱好者VIP1

积分
5317

VIP会员

发表于 2018-6-2 14:23:40 | 显示全部楼层 |阅读模式
您可以遍歷集合來處理每個特徵或查找特定的特徵。
Option Strict Off
Imports System
Imports NXOpen

Module Module1

    Sub Main()

        Dim theSession As Session = Session.GetSession()
        If IsNothing(theSession.Parts.Work) Then
            'active part required
            Return
        End If

        Dim workPart As Part = theSession.Parts.Work
        Dim lw As ListingWindow = theSession.ListingWindow
        lw.Open()

        For Each myFeature As Features.Feature In workPart.Features
            If TypeOf (myFeature) Is Features.PointSet Then
                lw.WriteLine(".GetFeatureName: " & myFeature.GetFeatureName)
                lw.WriteLine(".Name: " & myFeature.Name)
                lw.WriteLine(".FeatureType: " & myFeature.FeatureType)
                lw.WriteLine(".Timestamp: " & myFeature.Timestamp.ToString)
                lw.WriteLine("")

                Dim myPoints() As NXObject = myFeature.GetEntities

                For Each tempPt As Point In myPoints
                    lw.WriteLine(tempPt.Coordinates.ToString)
                Next

            End If

        Next


        lw.Close()

    End Sub


    Public Function GetUnloadOption(ByVal dummy As String) As Integer

        'Unloads the image immediately after execution within NX
        GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately

    End Function

End Module


评分

参与人数 1G币 +20 收起 理由
3D世界网-零 + 20 不错,支持你!

查看全部评分

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

咨询QQ:1359218528|发帖须知!|Archiver|手机版|小黑屋|UG爱好者论坛 ( 京ICP备10217105号-2 )

GMT+8, 2025-2-5 06:45

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表