Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Toggle between arrow-in vs arrow-out in drafting 2

Status
Not open for further replies.

MartijnH

Mechanical
Sep 24, 2013
18
I'm looking for a journal/shortcut which can toggle between arrow-in and arrow-out in drafting. Me and my colleagues find it not so easy that you need at least 3 mouseclicks before you reach the 'annotation style' and can choose the correct arrow placing. It would be nicer to have some kind of toggle function.
I have found a journal (Link) which lets you select certain objects, but I cannot find the correct code to set the LineAndArrowPreferences(). This method also is not so easy, so I was also wondering if a journal can look for already selected dimensions before the journal is executed?

Can anybody help me with this? I'm using NX75
 
Replies continue below

Recommended for you

We've added a simple IN/OUT toggle option when editing Arrowhead style in NX 9.0.

ArrowheadToggle_zps21d45499.png


John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
I read about that in an other thread, but that's not going to help me because we will probably stick to NX75 for a couple of years. Is there no 'work-around' for NX75?
 
If you say that it's taking you "at least 3 mouseclicks" then that's about all you can do for now.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
Martin,

While placing your dimensions, right click near the dimension. From the pop-up dialog, choose Placement (no click involved, just hover), then choose from the available options. Works for more than just arrows. I don't include the 2nd pick as a mouse click because it allows for the user to hover a moment before showing the fly-out. So a max. of 2 clicks, 3 if you're super impatient.

Refer to the attachment.

Tim Flater
NX Designer
NX 8.0.3.4
Win7 Pro x64 SP1
Intel Xeon 2.53 GHz 6GB RAM
NVIDIA Quadro 4000 2GB
 
 http://files.engineering.com/getfile.aspx?folder=b0e61dcd-99dc-4d15-8244-8368625d2600&file=dim_mb3_popup.PNG
Ok, thanks for all replies. I already figured out the popup Xwheelguy talks about, unfortunately this is only when placing a dimension, not when I want to edit it afterwards. So I guess I'm now stuck to 3 mouseclicks :)
 
Seems like a lot of fuss about 3 measly mouse clicks, but anyway, try the journal below.

Code:
Option Strict Off
Imports System
Imports System.Collections.Generic
Imports NXOpen
Imports NXOpen.UF

Module Module1

    Dim theSession As Session = Session.GetSession()
    Dim theUfSession As UFSession = UFSession.GetUFSession()

    Sub Main()

        Dim selobj As NXObject
        Dim type As Integer
        Dim subtype As Integer
        Dim lw As ListingWindow = theSession.ListingWindow

        Dim theUI As UI = UI.GetUI
        Dim numsel As Integer = theUI.SelectionManager.GetNumSelectedObjects()

        'process the preselected dimensions
        If numsel > 0 Then

            For inx As Integer = 0 To numsel - 1
                selobj = theUI.SelectionManager.GetSelectedObject(inx)

                theUfSession.Obj.AskTypeAndSubtype(selobj.Tag, type, subtype)

                If type = UFConstants.UF_dimension_type Then

                    Dim theDim As Annotations.Dimension
                    theDim = DirectCast(selobj, Annotations.Dimension)

                    ToggleDimArrows(theDim)

                End If

            Next

        Else
            'prompt to select dimensions

            Dim myDims As New List(Of Annotations.Dimension)
            If SelectDimensions("Select Dimensions to toggle arrows", myDims) = Selection.Response.Cancel Then
                Return
            End If

            For Each tempDim As Annotations.Dimension In myDims
                ToggleDimArrows(tempDim)
            Next

        End If

    End Sub

    Sub ToggleDimArrows(ByVal theDim As Annotations.Dimension)

        Dim markId1 As Session.UndoMarkId
        markId1 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "toggle arrows")

        Dim dimensionPreferences1 As Annotations.DimensionPreferences
        dimensionPreferences1 = theDim.GetDimensionPreferences()

        If dimensionPreferences1.TextPlacement = Annotations.TextPlacement.ManualArrowsIn Then
            dimensionPreferences1.TextPlacement = Annotations.TextPlacement.ManualArrowsOut
        ElseIf dimensionPreferences1.TextPlacement = Annotations.TextPlacement.ManualArrowsOut Then
            dimensionPreferences1.TextPlacement = Annotations.TextPlacement.ManualArrowsIn

        End If

        theDim.SetDimensionPreferences(dimensionPreferences1)

        dimensionPreferences1.Dispose()

        Dim nErrs1 As Integer
        nErrs1 = theSession.UpdateManager.DoUpdate(markId1)

    End Sub

    Function SelectDimensions(ByVal prompt As String, ByRef someDims As List(Of Annotations.Dimension)) As Selection.Response

        Dim selObj() As NXObject
        Dim theUI As UI = UI.GetUI
        Dim title As String = "Select dimensions"
        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.WorkPart
        Dim selectionMask_array(0) As Selection.MaskTriple

        With selectionMask_array(0)
            .Type = UFConstants.UF_dimension_type
            .Subtype = UFConstants.UF_all_subtype
        End With

        Dim resp As Selection.Response = theUI.SelectionManager.SelectObjects(prompt, _
         title, scope, selAction, _
         includeFeatures, keepHighlighted, selectionMask_array, _
         selobj)
        If resp = Selection.Response.Ok Then
            For Each temp As Annotations.Dimension In selObj
                someDims.Add(temp)
            Next
            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

www.nxjournaling.com
 
For what it is worth in I-Deas it was just a simple "O" keyboard stroke. Really Really quick. Nice enhancement in NX 9. Thanks

It just not about three mouse clicks. It is the couple second hesitation before the "style" box comes up. There is a for sure a delay between clicking the style and the dialogue box showing up so we can change these settings.

Once again nice Enhancement. Sometimes it is these little enhancements that could drastically increase productivity.

Also Thanks for that script Cowski Will be used a lot.
 
In NX 9.0, you just double-click the arrowhead.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
Hi John, I've tried in NX9 the double-click the arrowhead, but doesn't invert the direction.

Thank you...

Using NX 8 and TC9.1
 
Double-clicking does not automatically invert the direction. It DOES however activate a so-called 'hot-spot' at the arrowhead which when you place your cursor over it, a widget will appear that then allows you to invert the arrownhead.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor