×
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

XYZ point locations on a drawing
2

XYZ point locations on a drawing

XYZ point locations on a drawing

(OP)
Does anyone know of a company that writes GRIP programs or Journal files? My company needs a program to label XYZ point locations on a drawing. We are using the drawing for electrode locations so we also want it to label the component that the points belong to on the drawing. I know it is possible, but I'm not sure of the best way to do it. We currently copy and paste from the listing window, but it is very time consuming and errors get made too often. Any suggestions would be greatly appreciated.

RE: XYZ point locations on a drawing

(OP)
Frank,
There was nothing in the .zip file. Can you please try it again? Thanks.

RE: XYZ point locations on a drawing

(OP)
Thanks Frank. It is a good start. BTW, We are running 7.5.5.4.
I don't understand why the leader goes out in space when you place the numbers on a drawing though. I think it is something to do with the view? I think we also want to add a line for the trode name.

RE: XYZ point locations on a drawing

As the program stands it works as a demonstration program for the following limiting conditions.

The selected point cannot be selected using the often normally used inferred point option. This is because with the inferred method we get the drawing view and not the model view. Since we need model point data this could give us errors. It also gives us an error in terms of the label attachment point since here we need to convert the model data to drawing data since the label is placed on the drawing. If you take care to use a point selection method which ensures it is a point on the model then it should work OK.

Having said this I should have you check the nx8 version of the program which I have attached. In this case I needed to expand the drawing view to select the model point. I typically dont worry about release updates which may be part of the answer.

I dont know what "trode name" is but it would be simple to add an additional line.

Regards

Frank Swinkels

RE: XYZ point locations on a drawing

(OP)
Thanks Frank,
The Trode name is actually the component name. Do I need programing software to add that line? What software would I need?

RE: XYZ point locations on a drawing

What I meant when I said add an extra line I was referring to an extra line for the boxed label. That is the program would need to get the component name, determine a new length for the boxed label, resize the exising box and add the extra line (for the component name text). Now I think this should be done off-line. However as I understand it I cannot display my email address.

Regards

Frank Swinkels

RE: XYZ point locations on a drawing

Here is your program revised. It only contained one error. I also made some changes so that it reads better (I feal). I have also made a change and left the equivalent code commented out.

CODE -->

Option Strict Off Imports System Imports NXOpen Imports NXOpen.UF Module pointsInfo_fbs1 Sub Main() Dim theSession As Session = Session.GetSession() Dim ufs As UFSession = UFSession.GetUFSession() Dim response2 As Selection.Response = Nothing Dim pnt2() As Double = {0.0, 0.0, 0.0} Dim selectedObjects As NXObject() = Nothing theSession.ListingWindow.Open() Start1: response2 = selectPoints(selectedObjects) If response2 = Selection.Response.Cancel Then GoTo End1 Dim info As String = "Number of selected objects = " info = String.Concat(info, selectedObjects.Length) theSession.ListingWindow.WriteLine(info) For Each sda As Point In selectedObjects theSession.ListingWindow.WriteLine("X= " & sda.Coordinates.X.ToString("N4") & _ " Y= " & sda.Coordinates.Y.ToString("N4") & _ " Z= " & sda.Coordinates.Z.ToString("N4")) Next 'For Each sda As Point In selectedObjects ' ufs.Curve.AskPointData(sda.Tag, pnt2) ' theSession.ListingWindow.WriteLine("X= " & pnt2(0).ToString("N4") & " Y= " & pnt2(1).ToString("N4") & " Z= " & pnt2(2).ToString("N4")) 'Next GoTo Start1 ' Continue selecting points End1: End Sub Function selectPoints(ByRef selectedObjects As NXObject()) As Selection.Response Dim ui As UI = ui.GetUI() Dim mask(0) As Selection.MaskTriple With mask(0) .Type = UFConstants.UF_point_type .Subtype = UFConstants.UF_point_subtype .SolidBodySubtype = 0 End With Try Dim resp As Selection.Response = _ ui.SelectionManager.SelectObjects("Select Points", "Select Points", _ Selection.SelectionScope.AnyInAssembly, _ Selection.SelectionAction.ClearAndEnableSpecific, _ False, False, mask, selectedObjects) If resp = Selection.Response.Cancel Or _ resp = Selection.Response.Back Then Return Selection.Response.Cancel Else Dim info As String = "Number of selected objects = " info = String.Concat(info, selectedObjects.Length) System.Diagnostics.Trace.WriteLine(info) Return Selection.Response.Ok End If Catch e As Exception System.Diagnostics.Trace.WriteLine("Problems selecting objects.") System.Diagnostics.Trace.WriteLine(e.ToString) End Try End Function 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


Regards

Frank Swinkels

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