×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to capture the values of perimeter and area from face measurement in NX Journal

How to capture the values of perimeter and area from face measurement in NX Journal

How to capture the values of perimeter and area from face measurement in NX Journal

(OP)
I am looking for a solution to capture the values of perimeter and area contained in the face measurement feature and bounding box of flat solid.
Here is a little Journal I have written and I need help to store these values in variables x1 and x2. Also if there is a idea to get bounding box for parent feature, it will be welcome !

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.Features
Imports NXOpen.UF
Imports NXOpen.UI
Imports NXOpen.Utilities

Module MCH_Module
Dim s As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim lw As ListingWindow = s.ListingWindow
Dim theSession As Session = Session.GetSession()

Sub Main()
If s.Parts.Work Is Nothing Then
MsgBox("Pas de Part Active !!!", MsgBoxStyle.Critical)
Exit Sub
End If

Dim wp As Part = s.Parts.Work
Dim face_measure As String

For Each fonction As Feature In wp.Features

'===========================================================
' FACE MEASUREMENT Feature
'===========================================================

If fonction.FeatureType = "FACE_MEASUREMENT" Then

ufs.Modl.AskFeatName(fonction.Tag, face_measure)
lw.WriteLine("measure feature tage = " & face_measure)

Dim unit1 As Unit = CType(wp.UnitCollection.FindObject("SquareMilliMeter"), Unit)
Dim unit2 As Unit = CType(wp.UnitCollection.FindObject("MilliMeter"), Unit)

'Dim x1, x2 As Double

...
...

'x1 = measure1.Area
'x2 = measure1.Perimeter
'lw.WriteLine( & measure1)
'lw.WriteLine("Perimeter :" & x2)

End If
Next
End Sub

Public Function GetUnloadOption(ByVal dummy As String) As Integer
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately
End Function

End Module

Thanks in advance

moh23
NX8.5

RE: How to capture the values of perimeter and area from face measurement in NX Journal

An associative face measurement will create expressions with the area and perimeter; you can access the expressions associated with the measure feature to get the values.

www.nxjournaling.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources