×
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

NX11 - Create assembly labels for components

NX11 - Create assembly labels for components

NX11 - Create assembly labels for components

(OP)
We have a program from one customer that will label all of the components on an iso view.

We click the button, select a component, select the location we want the note to be placed, then attach the leader to the component. That note will automatically read the TOOL_ID attribute of the selected component, copy it and paste it into the note. This will only be a note and not associated to the attribute.

I know how to attach a note to a component's attribute, but it will always keep it associated.

The problem is we cannot use this button for other customers. So I need to find a way to do the same thing. Currently all of the employees have to attach notes and manually type the TOOL_ID into the note for each component.

It would be awesome if we can just select a component inside the view window, attach the note to the edge of the component in the view and place a note and that note will only be a note but will have the TOOL_ID attribute in the note. (Not associated).

IS there a way to do this

RE: NX11 - Create assembly labels for components

Have you tried using the parts list ?
set the "balloon" to present the Tool_id instead of the callout.

I imagine that Tool_id is an attribute that your company sets on all components. ( ? )
I have attached an example, NX10, where the callout is "underline" instead of the regular balloon. ( The tool_id does not fit inside a balloon)
If you add "balloon" and select the type to be "underline" ( do not type anything) , place the leader on the edge of the lower box that's missing a note , then update the partslist, it will / should update that new underline-balloon.

I have set the callout for this partslist to "Tool_id = <W$=@tool_id>"

Regards,
Tomas




RE: NX11 - Create assembly labels for components

(OP)
Hi Toost

Thanks for the help.

I was playing around with the parts list. The problem is I cannot get it to match our standards. Shown in the image.

Yes "Tool_ID" is an attribute we give all of our parts. It is basically the order string for purchased components and the detail number for make details.

1) The leader ends up underlining the note and everything we do has the leader extend from the end of the note.

2) It adds "Tool_id" to the note. I cant seem to figure out how to keep that from coming in.

3) Another problem is that the Parts List seems to keep things associated. If I delete the actual Parts List, which we dont need as we create BOMs for that information, all of the notes disappear.

Granted I have never messed around with the parts list before as we have always used another program for that. So all of this stuff may be easy to adjust. I just have figured out how yet. lol

RE: NX11 - Create assembly labels for components

1, i do not know a way to avoid this, i assume that it's a European customer who has required the underline- balloon type.
Try the other balloon types such as "Rounded Box" and see if any other balloon shape works for you . ( for the rounded box , set the size to maybe 2" or 25 mm ?)

2, my example adds "Tool Id=" because the callout for the balloon is set to "Tool_id = <W$=@tool_id>" ... winky smile
RMB the partslist, -settings - see the image below

3, these balloons are 100% dependent on the partslist and will disappear if the partslist goes.
Move the partslist to an invisible layer .( or hide it)
It is oddly a little more difficult to move it to a different sheet ( and keep auto-balloons) but i think manual balloons does stay.
-one has to fiddle with view dependent edit to move the parts list and keep the balloons.

-I think many companies has their BOM's in other systems, but also quite few who export the NX parts list into text or excel and use that to feed that other system.



Regards,
Tomas

RE: NX11 - Create assembly labels for components

Quote (Kenja824)

I know how to attach a note to a component's attribute, but it will always keep it associated.

The problem is we cannot use this button for other customers. So I need to find a way to do the same thing. Currently all of the employees have to attach notes and manually type the TOOL_ID into the note for each component.

It would be awesome if we can just select a component inside the view window, attach the note to the edge of the component in the view and place a note and that note will only be a note but will have the TOOL_ID attribute in the note. (Not associated).

I'm curious why you want these notes to be unassociated to the attribute; wouldn't it be better to keep them associative?

www.nxjournaling.com

RE: NX11 - Create assembly labels for components

(OP)


Funny, I was in the middle of replying about that same thing when I got an email showing you replied again. lol

TBH, I think this is just a boss thing. I am going to try to push doing it that way and leaving it associated. Then the only hassle will be to make a journal that allows us to just keep selecting components and adding the notes instead of placing them one note at a time. We have plenty of tools that have upward of 50+ components and details that need to be labelled. Some with plenty more. So the process of adding each of these notes even associated is a bit slow doing them one at a time.

I think the first step is to get the associated notes accepted. lol

RE: NX11 - Create assembly labels for components

(OP)
Well I got the okay to leave them associated. So now the only problem is speeding up the process when there is a lot of components and details.

RE: NX11 - Create assembly labels for components

... if you use the partslist you can use the autoballoon option....
it will not place these balloon beautifully, but it will add balloons to all visible components in the selected view-s. ( note the -s.)
else you add the partslist without autoballoons, then you manually place empty balloons ( of the correct type) where you want them. and finally you update the partslist. all these empty balloons will then get the tool_id printed.

( Note: and "Autoballoon" can not move the leader from component to component and then update the ID, the ID will stay despite the leader attached to a different component
, a manually placed balloon will update when the leader has moved.)

Regards,
Tomas

RE: NX11 - Create assembly labels for components

(OP)
I was pulled onto other more pressing issues and am just now returning to this problem.

Tomas....

Currently we do not create a parts list. We have a B.O.N. that we make with another program. The ISO view is just so someone can see the components in the assembly and where they go in the assembly to aid with.... the assembly of the assembly... (Wow that sounds funny)

So we basically just need to label all of the components with a note that is associated with their "TOOL_ID" attribute.

ALL....

I have been trying to figure out how to write code to let me just select a component in the window view or the navigator, then add the note to the view and it would automatically be associated with the attribute. Unfortunately I cant seem to figure out how to even allow the user to select a component much less the rest of it.

Adding the notes manually with the note program wouldnt be bad if it had a button on it to "select new objects". But it doesnt seem to have that and we have to close the note program and then open it again then click the "insert object attribute" then select which attribute, etc... over and over. Where if it let us select new objects and kept everything the same it would really speed up the process.

RE: NX11 - Create assembly labels for components

You still haven't caught the option i was trying to serve you... smile

Create a Parts list AND Make it Invisible.
You can place the PL on a invisible layer, you can place the PL outside the drawing border ( still visible if you zoom out but it will not print/plot) , you can simply select + hide , You can move it to a different sheet.
use any method you prefer to hide it.*
but,
The parts list can still add auto balloons and /or update manual ballons. All the parts list does is automate the text on these balloons. nothing more. It's not the "BOM".
-it will be visible in the Part Navigator and you can right click there to autoballoon.

Without the P-list, automating these labels will be more difficult.
( and , if you like to have these associative.)

Btw,
One company i work with has their BOM in a separate system, but since that requires so much typing to "Get going", they use the NX Parts List (using a pre set template which includes the data they require)
then they copy all this data from the NX PL to that separate system.
When updating, they copy separate lines from the NX PL to that BOM system. This way they avoid typing mistakes and such.


* Moving a PL to a different sheet whilst keeping existing balloons requires the use of View dependent editing. first make it model dependent, then make it view dependent on that other sheet.

Regards,
Tomas

RE: NX11 - Create assembly labels for components

(OP)
I was just playing with the parts list and auto ballooning. The auto ballooning feature would be cool to use.

The problem is that in conjunction with the fact we use the Tool_ID attribute, which is basically the order string for purchased components and names of the details, it really looks bad on the sheet. The labels will vary greatly on their length. If there is a way of making the underline length automatically adjust to underline the entire label, I might be able to get the bosses to buy off on it. If I can adjust the underline to start at the beginning or end of the label, depending on which direction the leader is coming from, there would be an outside chance of getting them to accept that. But currently I cant see a way to adjust this. The underline is in the center of the label with the label extending out both directions from it. I tried using the round box but that wont surround the entire label. I cant adjust its size according to each label. I just cant find a setting that makes it look a little better than outright bad.

This what I am coming up with so far. The CYL-12 note is just a regular note. That is how we like our leaders if possible. If we can at least make them look decent we could change up but I know they wont buy into these leaders.



Whatever the outcome, I want to say thanks for the help. There is a guy my company has been paying to create certain programs for us. A hole chart, a stocklist program etc... I have a feeling this will just come down to the company paying him to create this as well. lol

RE: NX11 - Create assembly labels for components

(OP)
So in playing with it some, I learned that once the labels are in position, if you double click a single label, you dont have to click on anything else and can just type a number in and hit enter and the length of the underline will adjust. In ours the starting length is set at 14. So depending on how long the label is I can quickly get used to about how long to make it. If I adjust it and it still needs more length, I dont need to do anything but type another number and hit enter. Keep doing that until the underline looks good.

Seems like a lot of work in explaining it, but even if you have 50 labels, once you get used to it, it wont take long. Its better than having to create each note one by one.

The end result isnt too bad. I might be able to get the bosses to buy into it. At least temporarily until they get a program written up for it.

RE: NX11 - Create assembly labels for components

(OP)
So I was looking for something else and just happened to come across this code. It has you select a component, then select an edge of the component, and then wants you to pick a placement for the balloon.

As far as I can tell, this might do what I am looking for, but it isnt quite working right.
It seems to be working right up until you place the note/balloon. Nothing appears on the drafting sheet.

Line 50 allows me to place the attribute it looks for in that component. I set that to Tool_ID, which is the attribute we use for order strings.

I am hoping if it doesnt do exactly as I need, that I can adjust it to do what I need. I am guessing it only adds one note. If so, if you know how to make it so it lets you keep adding new labels until you are done, that would be awesome.

Can someone see what is wrong that it doesnt actually place a note, label or whatever?

CODE -->

' NX Add Associative callout by manual mode
' Journal created by Alto on 10-06-2015
 
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.Annotations
Imports System.Windows.Forms
Imports NXOpen.UF
Imports NXOpen.Annotations.Annotation
Imports NXOpen.Assemblies
Module NXJournal
 
    Dim theUI As UI = UI.GetUI
    Dim theSession As Session = Session.GetSession()
    Dim ufs As UFSession = UFSession.GetUFSession
 
    Sub Main()
        Call Mysub1()
        Call Mysub2()
    End Sub
 
    Sub Mysub1()
 
 
        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()
 
        Const undoMarkName As String = "NXJ journal"
        Dim markId1 As Session.UndoMarkId
        markId1 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, undoMarkName)
 
        Dim myComponent As Assemblies.Component = Nothing
        If SelectComponent("Select component", myComponent) = Selection.Response.Cancel Then
            Return
        End If
 
 
 
 
        '$$$ specify attribute title to get from component
        Const myAttrTitle As String = "Tool_ID"
 
        Dim myAttrValue As String
        Dim output As String
 
 
        Try
            myAttrValue = myComponent.GetStringAttribute(myAttrTitle)
            output = "<W!" & myComponent.Tag.ToString & "@" & myAttrTitle & ">"
            Clipboard.SetText(output)
 
        Catch ex As NXException
            If ex.ErrorCode = 512008 Then
                'attribute not found
                MessageBox.Show("Attribute '" & myAttrTitle & "' not found, journal exiting", "Attribute not found", MessageBoxButtons.OK, MessageBoxIcon.Error)
                Return
            Else
                theSession.UndoToMark(markId1, undoMarkName)
                MessageBox.Show(ex.Message, "Error: " & ex.ErrorCode, MessageBoxButtons.OK, MessageBoxIcon.Error)
            End If
 
        Finally
 
        End Try
 
        lw.Close()
 
    End Sub
 
 
    Sub Mysub2()
 
        'Dim myEdge As Object
        Dim myPoint As Point3d
        Dim myPointBalloon As Point3d
 
        Dim theSession As Session = Session.GetSession()
        Dim workPart As Part = theSession.Parts.Work
        Dim displayPart As Part = theSession.Parts.Display
        Dim theUI As UI = UI.GetUI()
        ' Dim response As Selection.DialogResponse
 
 
        Dim nullAnnotations_IdSymbol As Annotations.IdSymbol = Nothing
 
        Dim idSymbolBuilder1 As Annotations.IdSymbolBuilder
        Dim leaderData1 As Annotations.LeaderData
        idSymbolBuilder1 = workPart.Annotations.IdSymbols.CreateIdSymbolBuilder(nullAnnotations_IdSymbol)
        idSymbolBuilder1.Type = Annotations.IdSymbolBuilder.SymbolTypes.Circle
        idSymbolBuilder1.Origin.Plane.PlaneMethod = Annotations.PlaneBuilder.PlaneMethodType.XyPlane
        idSymbolBuilder1.UpperText = Clipboard.GetText
        idSymbolBuilder1.Size = 0.35
        leaderData1 = workPart.Annotations.CreateLeaderData()
        leaderData1.StubSize = 0.25
        leaderData1.Arrowhead = Annotations.LeaderData.ArrowheadType.FilledArrow
        idSymbolBuilder1.Leader.Leaders.Append(leaderData1)
        leaderData1.StubSide = Annotations.LeaderSide.Inferred
        idSymbolBuilder1.Origin.SetInferRelativeToGeometry(True)
 
        Dim myedge As object = Nothing
        If UserSelectEdge("Select edge to attach balloon", myedge, myPoint) = Selection.Response.Cancel Then
            Return
        End If
        'MsgBox(myPoint.ToString())
 
 
        Dim nullview As NXOpen.View = Nothing
        Dim point1_1 As Point3d = New Point3d(myPoint.X, myPoint.Y, 0)
        Dim point2_1 As Point = workPart.Points.CreatePoint(point1_1)
        Dim point3_1 As Point3d = New Point3d(myPoint.X, myPoint.Y, 0.0)
        leaderData1.Leader.SetValue(point2_1, workPart.Views.WorkView, point3_1)
 
 
        Dim assocOrigin1 As Annotations.Annotation.AssociativeOriginData = Nothing
        assocOrigin1.View = nullview
        assocOrigin1.ViewOfGeometry = nullview
        assocOrigin1.XOffsetFactor = 0.0
        assocOrigin1.YOffsetFactor = 0.0
        idSymbolBuilder1.Origin.SetAssociativeOrigin(assocOrigin1)
 
        Dim response2 As Selection.DialogResponse = UserSelectScreenPos("Place balloon", myPointBalloon)
        If response2 <> Selection.DialogResponse.Pick Then
            Return
        End If
 
        Dim point4_1 As Point3d = New Point3d(myPointBalloon.X, myPointBalloon.Y, 0.0)
        idSymbolBuilder1.Origin.Origin.SetValue(Nothing, nullview, point4_1)
 
        Dim nXObject1 As NXObject
        nXObject1 = idSymbolBuilder1.Commit()
        idSymbolBuilder1.Destroy()
 
    End Sub
 
    Function UserSelectEdge(ByVal prompt As String, ByRef selObj As TaggedObject, ByRef selPoint As Point3d) As Selection.Response
 
        'Allow user to interactively select an edge
 
        Dim title As String = "Select an edge"
        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 selectionMask_array(6) As Selection.MaskTriple
 
        'Set the selection criteria to any edge
        'TODO: Add point on surface
        selectionMask_array(0).Type = UFConstants.UF_solid_type
        selectionMask_array(0).Subtype = UFConstants.UF_UI_SEL_FEATURE_ANY_EDGE
        selectionMask_array(0).SolidBodySubtype = UFConstants.UF_UI_SEL_FEATURE_ANY_EDGE
 
        selectionMask_array(1).Type = UFConstants.UF_line_type
        selectionMask_array(1).Subtype = UFConstants.UF_all_subtype
 
        selectionMask_array(2).Type = UFConstants.UF_circle_type
        selectionMask_array(2).Subtype = UFConstants.UF_all_subtype
 
        selectionMask_array(3).Type = UFConstants.UF_conic_type
        selectionMask_array(3).Subtype = UFConstants.UF_all_subtype
 
        selectionMask_array(4).Type = UFConstants.UF_spline_type
        selectionMask_array(4).Subtype = UFConstants.UF_all_subtype
 
        selectionMask_array(5).Type = UFConstants.UF_solid_silhouette_type
        selectionMask_array(5).Subtype = UFConstants.UF_all_subtype
 
        selectionMask_array(6).Type = UFConstants.UF_section_edge_type
        selectionMask_array(6).Subtype = UFConstants.UF_all_subtype
 
        'This line allows the user to select from any view:
        ufs.Ui.SetCursorView(0)
 
        Dim resp As Selection.Response = theUI.SelectionManager.SelectTaggedObject(prompt, _
         title, scope, selAction, _
         includeFeatures, keepHighlighted, selectionMask_array, _
         selObj, selPoint)
        If resp = Selection.Response.ObjectSelected OrElse resp = Selection.Response.ObjectSelectedByName Then
            Return Selection.Response.Ok
        Else
            Return Selection.Response.Cancel
        End If
 
    End Function
 
    Function UserSelectScreenPos(ByVal prompt As String, ByRef selPoint As Point3d) As Selection.DialogResponse
        'Allow user to interactively select a screen position
        Dim view As NXOpen.View = Nothing
        Return theUI.SelectionManager.SelectScreenPosition(prompt, view, selPoint)
    End Function
 
 
    Function SelectComponent(ByVal prompt As String, ByRef selObj As NXObject) As Selection.Response
 
 
        Dim title As String = "Select a component"
        Dim includeFeatures As Boolean = False
        Dim keepHighlighted As Boolean = False
        Dim selAction As Selection.SelectionAction = Selection.SelectionAction.ClearAndEnableSpecific
        Dim cursor As Point3d
        Dim scope As Selection.SelectionScope = Selection.SelectionScope.AnyInAssembly
        Dim selectionMask_array(0) As Selection.MaskTriple
 
        With selectionMask_array(0)
            .Type = UFConstants.UF_component_type
            .Subtype = UFConstants.UF_all_subtype
        End With
 
        Dim resp As Selection.Response = theUI.SelectionManager.SelectObject(prompt, _
         title, scope, selAction, _
         includeFeatures, keepHighlighted, selectionMask_array, _
         selObj, cursor)
        If resp = Selection.Response.ObjectSelected OrElse resp = Selection.Response.ObjectSelectedByName 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
        GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination
 
        '----Other unload options-------
        'Unloads the image immediately after execution within NX
        'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately
 
        'Unloads the image explicitly, via an unload dialog
        'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Explicitly
        '-------------------------------
 
    End Function
End Module 

RE: NX11 - Create assembly labels for components

(OP)
If it helps, I find if I use this in modeling, it creates a balloon. In drafting nothing seems to happen.

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! Already a Member? Login


Resources

White Paper – Data Security and Know-How Protection
Our data is constantly exposed to the danger of being intercepted or stolen as it wends its way over global data networks. Data security measures and measures for protecting intellectual property should not, however, first be implemented when data is exchanged – companies must lay the foundation for these measures within their own organization. Download Now
White Paper – Collaboration in the PLM Context
The influence exerted by the Internet of Things (IoT) means that there is a steadily growing need for collaboration in industry. Partners from new industries and areas of application need to be integrated in cross-company business processes to ensure that the lifecycle of smart, connected products can be managed from end to end. 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:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close