×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*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.

# Help Fixing this Journal Please

## Help Fixing this Journal Please

(OP)
I recorded a journal where I select points and move them to layer 230

I have been trying to merge it with another journal so that it will let the user select the points that will be moved. I know this is an easy enough task to do without a journal, but my goal is, once it is done, it will also filter so only points with the color 60, 66 & 75 can be selected. This is something I do quite often when on particular jobs and it grows tiring always having to set the filters. Over and over. So I figured I would create a journal that makes it all much easier.

However, the journal I have keeps erring out on the same line. (where the recorded journal selects points form a particular components. I need it to let me select from any component in the assembly. I have been trying to figure out how to rewrite this line but my knowledge is simply far too restricted.

The line in question (To my belief) is now bracketed by two long lines of dashes to help it stand out in the code.

If someone can please give me the fix, I would greatly appreciate it.

#### CODE -->

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module Module1

Sub Main()

Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As NXOpen.Part = theSession.Parts.Display

Dim thePoints() As NXObject

If SelectPoints("Select points", thePoints) = Selection.Response.Cancel Then
Return
End If

Dim objectArray1(0) As NXOpen.DisplayableObject
-------------------------------------------
Dim point1 As NXOpen.Point = CType(component4.FindObject("PROTO#.Features|WELD_POINTMARK_ELEMENT(7)|POINT 1"), NXOpen.Point)
-------------------------------------------
objectArray1(0) = point1
workPart.Layers.MoveDisplayableObjects(230, objectArray1)

End Sub

Function SelectPoints(ByVal prompt As String, byRef selObj() as NXObject) As Selection.Response

Dim theUI As UI = UI.GetUI
Dim title As String = "Select points"
Dim includeFeatures As Boolean = False
Dim keepHighlighted As Boolean = False
Dim selAction As Selection.SelectionAction = Selection.SelectionAction.ClearAndEnableSpecific

Dim scope As Selection.SelectionScope = Selection.SelectionScope.AnyInAssembly
'Dim scope As Selection.SelectionScope = Selection.SelectionScope.WorkPart

.Type = UFConstants.UF_point_type
.Subtype = UFConstants.UF_point_subtype
End With

Dim resp As Selection.Response = theUI.SelectionManager.SelectObjects(prompt, _
title, scope, selAction, _
selobj)
If resp = Selection.Response.Ok Then
Return Selection.Response.Ok
Else
Return Selection.Response.Cancel
End If

End Function

Public Function GetUnloadOption(ByVal dummy As String) As Integer

'Unloads the image when the NX session terminates

End Function

End Module 

Ken
www.OneGodLogic.com
My brain is like a sponge. A sopping wet sponge. When I use it, I seem to lose more than I soak in.

### RE: Help Fixing this Journal Please

Is the goal to get all the points with color 60, 66, and 75 moved to layer 230? If so, it might actually be easier to write code that does it without a user selection.

### RE: Help Fixing this Journal Please

(OP)
I definitely need to be able to select specific ones. We have a file with hundreds of spots. Sometimes well over a thousand. All spots are just points with attributes assigned to them. We have to create templates for surfaces showing where the spots are. Each time I create a new template, which could have 1 to 50 spots, I like to move the points I used to layer 230 which will be turned off. This way the spots I have already done will not still be showing up and making the job confusing. Quite often we will have a bunch of templates where there are only 2 to 5 spots on each. So I have to move them to layer 230 quite often to get them out of the way.

I used to just have this button working with a macro, but when we upgraded, something went wrong I believe. Now when I record a macro with a user entry, it errors out on playback. I currently have a couple people in other companies who are going to record the same macro when they get the chance. I am hoping that the problem is in the recording and I can compare them to ours and see something I can change manually. IF not, then at least I will be able to tell IT that it records them right, but doesnt play them back right for some reason. But with this problem, I am forced to spend a lot of time that I dont have to figuring out how to make the same buttons with Journal. Which I am slowly, ever so slowly getting better at, but still really suck. lol

Ken
www.OneGodLogic.com
My brain is like a sponge. A sopping wet sponge. When I use it, I seem to lose more than I soak in.

### RE: Help Fixing this Journal Please

What version of NX are you using?

### RE: Help Fixing this Journal Please

(OP)
Crap. I am usually so good at adding that and I have been forgetting lately. At the top it says NX1872. Not sure if that is equivalent to NX13 or what.

Ken
www.OneGodLogic.com
My brain is like a sponge. A sopping wet sponge. When I use it, I seem to lose more than I soak in.

### RE: Help Fixing this Journal Please

(OP)
Hey Cowski,

I dont know if it will make any difference or not, but I just happened to notice in a macro I tried to record, that it listed us at NX1969. I just checked and that is the version we have. For some reason it lists the last version at the top of our sessions. lol

Ken
www.OneGodLogic.com
My brain is like a sponge. A sopping wet sponge. When I use it, I seem to lose more than I soak in.

### RE: Help Fixing this Journal Please

I don't think it will matter. I asked because one of the new versions (1980?) has some new selection filters that I was going to try out.

### RE: Help Fixing this Journal Please

(OP)
Awesome as always Cowski.

My mind is a bit burnt out on this today, so tomorrow or Monday I will need to look closer at how this works compared to the other journals that allow user selection. This one looks different with the extra functions.

Thank you very much.

Ken
www.OneGodLogic.com
My brain is like a sponge. A sopping wet sponge. When I use it, I seem to lose more than I soak in.

#### 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.

#### Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a partâ€™s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!