×
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

[NX 8] Align identification symbol

[NX 8] Align identification symbol

[NX 8] Align identification symbol

(OP)
Hi,
how can I align identification symbol horizontally or vertically ?

Thank you...

Using NX 8 and TC8.3

RE: [NX 8] Align identification symbol

You mean like this:



If so, just select the ID symbols that you would like to align, press MB3 and select either the 'Group Horizontlly...' or 'Group Vertically...'.  

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
UG/NX Museum:   http://www.plmworld.org/p/cm/ld/fid=209

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

RE: [NX 8] Align identification symbol

(OP)
Sorry John,
I talk about 'align', not 'group'.
I will ask for another ER.

Thank you...

Using NX 8 and TC8.3

RE: [NX 8] Align identification symbol

Can you provide a better example of what you mean by 'align'?

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
UG/NX Museum:   http://www.plmworld.org/p/cm/ld/fid=209

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

RE: [NX 8] Align identification symbol

(OP)
John,
this is an example of what I intend 'align'.
In NX I can add identification symbol manually or use the auto-balloon, in any case I need to reposition manually each balloon.
I'm looking for a command that align selected identification symbol at left or at top or at bottom....
 

Thank you...

Using NX 8 and TC8.3

RE: [NX 8] Align identification symbol

(OP)
There is a tool in SolidWorks, called 'Magnetic lines', copied from 3DVia Composer, very useful for who does spare parts list drawings or exploded view.
Please see this YouTube video.
http://www.youtube.com/watch?v=RzjGhz5OTHM

Thank you...

Using NX 8 and TC8.3

RE: [NX 8] Align identification symbol

Is this supported by any known drafting standard?  If so, call GTAC and have them open an ER where this standard is sited as the reason that it needs to be implemented in NX Drafting.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
UG/NX Museum:   http://www.plmworld.org/p/cm/ld/fid=209

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

RE: [NX 8] Align identification symbol

(OP)
Magnetic line is a surplus, very useful for designer, but align 'identification symbol' is present in any CAD.
If you think that any enhancement in drawing environment must be present as drawing standard, NX could stay as was at NX 6 version.
But as you can see, NX is growing following the NX user needing.
Anyway...NX 8 can't align identification symbol and for this I will add an ER.
I'm sure that NX users, reading this post are with me.

Thank you...

Using NX 8 and TC8.3

RE: [NX 8] Align identification symbol

Cuba, i don't understand what it is that you cannot do?
  When i drag an ID symbol it aligns to other symbols automaticly, and if the associativity switch is on connects the associativity.
 But no, it cannot do this on a diagonal line.
 

RE: [NX 8] Align identification symbol

Quote (Toost):

When i drag an ID symbol it aligns to other symbols automaticly, and if the associativity switch is on connects the associativity.
This is the behavior I get when placing a new symbol, however if you use autoballoon then drag them to somewhere usable, I don't get the automatic alignment. I agree with Cubalibre00 that this would be a welcome enhancement.

As a good workaround, I turn on the work plane "snap to grid" setting and make the grid the same size as the ID symbol diameter. This way you can drag them around and easily align symbols. Also, the symbols don't end up associated with each other, which in my experience is usually a good thing. It is only a minor inconvenience to turn the grid and/or snap on and off as I work.

www.nxjournaling.com

RE: [NX 8] Align identification symbol

(OP)
Hi cowski,
you have understand.
Add identification symbol manually can permit to use the auto-align tool, but if you move again, the auto-align tool have a strange behavior.
If I use the auto-balloon, the auto-align tool doesn't work.
Add identification symbol manually is a time looser and you don't have idea if you have forget some components.
I will add an ER.

Thank you...

Using NX 8 and TC8.3

RE: [NX 8] Align identification symbol

BTW, even if you can't identify if this covered by a recognized drafting standard, you can still open an ER and it will be given consideration.  HOWEVER, if you CAN site a standard, it will help in setting the appropriate priority for this ER for when it's considered relative to other ER's which will be competing for the finite R&D resources available.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
UG/NX Museum:   http://www.plmworld.org/p/cm/ld/fid=209

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

RE: [NX 8] Align identification symbol

Ah, i missed that difference on auto ballons.
 Now it gets yet stranger,..
Auto ballons can be grouped which is what Johns picture shows above, - manual ballons cannot be grouped.

Then the "mysterios stacking feature" i can't start in NX7.5. ( In NX6 when one dragged a ballon on top of another NX suddenly displayed a dashed box around both and if one released the LMB at that time the ballons were stacked and moved together.( if one dragged the "master ballon")

RE: [NX 8] Align identification symbol

Dear Cubalibre00,
If you would like to play: The horizontal aligning works.

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


Module Module1

    '  Explicit Activation
    '      This entry point is used to activate the application explicitly

    Public theSession As Session = Session.GetSession()
    Public theUI As UI = UI.GetUI()
    Public theUfSession As UFSession = UFSession.GetUFSession()
    Public lw As ListingWindow = theSession.ListingWindow

    Sub Main()

        ' id_symbol listazasanak meghivasa, ami tartamaz egy x koordinata szerinti rendezest es symbol mozgatas alfuggvenyeket
        id_lista()

    End Sub

    ' Rajz nezet lekerdezese, hogy hany darab nezet van, felhasznaljuk az id_symbols nezetenkenti kezelesekor
    Function rajz_hatar() As Array
        Try
            Dim dp As Integer = 0
            'dp = check_for_missing_display_part()

            'If dp = 1 Then
            'Return 0
            ' End If

            Dim currentDrawing As NXOpen.Tag = NXOpen.Tag.Null
            Dim dwgViews() As NXOpen.Tag
            Dim numViews As Integer = 0
            Dim viewName As String = ""
            Dim vwBrdr(3) As Double
            'Dim nezetek As ArrayList


            theUfSession.Draw.AskCurrentDrawing(currentDrawing)

            theUfSession.Draw.AskViews(currentDrawing, numViews, dwgViews)


            lw.Open()

            For Each currentView As NXOpen.Tag In dwgViews
                theUfSession.Obj.AskName(currentView, viewName)
                'lw.WriteLine("View Name: " & viewName)
                'lw.WriteLine("View Name tag: " & currentView.ToString)

                theUfSession.Draw.AskViewBorders(currentView, vwBrdr)

                'nezetek.Add(currentView.ToString)

                'Nezethatar bal also es jobb felso sarkanak koordinatainak lekerdezese
                'lw.WriteLine("vwBrdr = " & vwBrdr(0).ToString() & ", " _
                '& vwBrdr(1).ToString() & ", " _
                '& vwBrdr(2).ToString() & ", " _
                '& vwBrdr(3).ToString())

            Next

            For hh As Integer = 0 To numViews - 1
                'lw.WriteLine(dwgViews(hh).ToString)
            Next
            Return dwgViews

        Catch ex As NXOpen.NXException
            UI.GetUI().NXMessageBox.Show("Message", NXMessageBox.DialogType.[Error], ex.Message)
        End Try


    End Function


    ' Van-e megjelenitett alkatresz
    Public Function check_for_missing_display_part() As Integer

        Dim dispPart As Part = Nothing

        Try
            dispPart = theSession.Parts.Display
        Catch ex As Exception
            lw.Open()
            lw.WriteLine("+++Error: " & ex.ToString())
        End Try

        If dispPart Is Nothing Then
            lw.Open()
            lw.WriteLine("There is no current Displayed Part")
            theUfSession.UF.PrintSyslog("+++ERROR: There is no current Displayed Part", _
                                                                           False)
            Return 1
        End If
        Return 0

    End Function


    ' id_symbols arraylist-be masolasa nezetenkent
    Function id_lista() As ArrayList
        'Dim symbol_tags As New ArrayList
        Dim ossze_nezet As Integer = 0
        'lw.WriteLine(rajz_hatar.Length)
        If rajz_hatar() IsNot Nothing Then
            If rajz_hatar().Length <> 0 Then
                'lw.WriteLine(rajz_hatar.Length) 'Hany darab nezet van a rajzon
                For osszes_nezet = 0 To rajz_hatar().Length - 1
                    lw.WriteLine("---------itt kezdodik--------") 'id_symbol-ok kezelese nezetenkent itt kezdödik
                    lw.WriteLine("Nezet neve" & rajz_hatar(osszes_nezet).ToString)

                    'Ebbe kerulnek a id_symbol-ok tag-jei, anyiszor fut ahany rajzi nezet van
                    Dim symbol_tags As New ArrayList

                    Dim idcol As Annotations.IdSymbolCollection = theSession.Parts.Work.Annotations.IdSymbols
                    Dim ids As Annotations.IdSymbol

                    Dim iEnum1 As IEnumerator = idcol.GetEnumerator()
                    iEnum1.Reset()

                    Dim parent_view As New ArrayList

                    Dim koztes As Integer = 0

                    'Addig megy meg vegig nem jarja az osszes nezeten levo, osszes id_symbol-t
                    While iEnum1.MoveNext()


                        ids = DirectCast(iEnum1.Current, Annotations.IdSymbol)
                        lw.Open()

                        'id_symbol tag-jenek kiiratasa
                        lw.WriteLine("Symbol: " & ids.Tag.ToString())

                        Dim idsb As Annotations.IdSymbolBuilder = idcol.CreateIdSymbolBuilder(ids)
                        'lw.WriteLine(" Text: " + idsb.UpperText) 'id_symbol-ban levo szoveg
                        'lw.WriteLine(" Origin: " & idsb.Origin.OriginPoint.ToString()) 'id_symbol(karika) kozepe
                        'lw.WriteLine(" Size: " & idsb.Size) 'id_symbol (karika) atmeroje


                        Dim lb As Annotations.LeaderBuilder = idsb.Leader
                        Dim ldl As Annotations.LeaderDataList = lb.Leaders
                        'lw.WriteLine(" Number of LeaderData: " + ldl.Length.ToString())

                        Dim selection1 As DisplayableObject
                        Dim view1 As View

                        Dim hatar(3) As Double

                        'id_symbol mutatovonalainak kezelese
                        For i As Integer = 0 To ldl.Length - 1
                            Dim ld As Annotations.LeaderData = ldl.FindItem(i)
                            'lw.WriteLine(" LeaderData No." & i & ": " & ld.ToString())

                            'lw.WriteLine("  Stub Size: " & ld.StubSize.ToString()) 'Mutatovonal tulnyulasa
                            'lw.WriteLine("  Stub Side: " & ld.StubSide.ToString()) 'Mutatovonal merre all
                            ' Perpendicular as of NX7
                            ' lw.WriteLine("  Perpendicular: " + ld.Perpendicular.ToString()); 'Mutatovonal meroleges-e
                            'lw.WriteLine("  Arrowhead: " & ld.Arrowhead.ToString()) 'Mutatovonal nyilveg

                            'Melyik nezetre mutat az id_symbol
                            Dim point1 As Point3d
                            'lw.WriteLine(ld.Leader.Tag)
                            ld.Leader.GetValue(selection1, view1, point1)
                            'lw.WriteLine("  Leader view: " & view1.Name)
                            'lw.WriteLine("  Leader view type: " + view1.GetType().ToString())
                            'lw.WriteLine("  Leader point: " & point1.ToString())

                            'Ha a mutatovonal nezete megegyezik a rajz_hatar-ban levo nezettel, akkor beleteszi
                            If view1.Tag = rajz_hatar(osszes_nezet).ToString Then
                                symbol_tags.Add(ids.Tag.ToString())
                            End If

                            'id_symbol melyik koordinatara mutat
                            If (view1.GetType().ToString() <> "NXOpen.View") Then
                                Dim model_pt(2) As Double
                                model_pt(0) = point1.X
                                model_pt(1) = point1.Y
                                model_pt(2) = point1.Z
                                Dim map_pt(1) As Double

                                theUfSession.View.MapModelToDrawing(view1.Tag, model_pt, map_pt)
                                'lw.WriteLine("  Mapped Leader point: X=" & map_pt(0).ToString() & " ,Y= " & map_pt(1).ToString())
                            End If


                            'id_symbol-nak hany torese van és hol
                            'lw.WriteLine("  Number of jogs: " & ld.Jogs.Size.ToString())
                            Dim jogs As SelectObject() = ld.Jogs.GetSelectObjectArray()
                            For Each jog As SelectObject In jogs
                                'lw.WriteLine("  Jog: " & jog.ToString())
                                Dim selection2 As TaggedObject
                                Dim view2 As View
                                Dim point2 As Point3d
                                jog.GetValue(selection2, view2, point2)
                                'lw.WriteLine("   Jog point: " & point2.ToString())
                            Next

                        Next

                        idsb.Destroy()



                        'lw.WriteLine(" Number of Associativities: " + ids.NumberOfAssociativities.ToString())
                        For i As Integer = 1 To ids.NumberOfAssociativities
                            Dim assoc As Annotations.Associativity = ids.GetAssociativity(i)
                            'lw.WriteLine(" Assoc No." & i & ": " & assoc.ToString())
                            'lw.WriteLine("  ObjectView : " + assoc.ObjectView.Name)

                            Dim obj As NXObject = assoc.FirstObject
                            If obj Is Nothing Then
                                'lw.WriteLine("  FirstObject : null")
                            Else
                                'lw.WriteLine("  FirstObject : " & obj.ToString())
                                'lw.WriteLine("   Owning Part: " + obj.OwningPart.FullPath)
                                If obj.IsOccurrence Then
                                    'lw.WriteLine("   Owning Component: " + obj.OwningComponent.Name)
                                End If
                            End If
                        Next

                    End While

                    'Ez csak egy visszaellenorzes lenne, hany eleme van a tombnek
                    Dim ii As Integer
                    For ii = 0 To symbol_tags.Count - 1
                        'lw.WriteLine(symbol_tags(ii).ToString)
                    Next

                    'rendezes alfuggveny meghivasa: symbol_tags elemeit rendezi azok map_x-e alapjan
                    rendezes(symbol_tags)
                    lw.WriteLine("----------------itt a vege------------------------")

                Next

            Else
                'Hiba kezeles
                Dim ex As String = "There is no drawing view"
                UI.GetUI().NXMessageBox.Show("Message", NXMessageBox.DialogType.[Error], ex)

                Return Nothing
            End If
        End If
    End Function

    'symbol_tags arraylist elemeinek rendezese, azok map_x ertekei szerint novekvoben
    Public Function rendezes(ByRef rend As ArrayList) As ArrayList

        If rend.Count <> 0 Then

            'Csak ellenorzesre, mennyi tomb elem van
            lw.WriteLine("id_lista hossza: " & rend.Count)

            ' Tipusanak, altipusanak lekerdezese
            'Dim type As Integer
            'Dim subtype As Integer
            'theUfSession.Obj.AskTypeAndSubtype(rend_elem, Type, subtype)
            'lw.WriteLine(" Type: " & Type.ToString())
            'lw.WriteLine(" Subtype: " & subtype.ToString())

            Dim map_x As New ArrayList
            Dim origin_x As New ArrayList

            Dim rend_elem As NXOpen.Tag


            For rend_c As Integer = 0 To rend.Count - 1
                'String konvertálása Tag-ge
                rend_elem = CType(rend.Item(rend_c), NXOpen.Tag)

                Dim idcol As Annotations.IdSymbolCollection = theSession.Parts.Work.Annotations.IdSymbols
                'Tag konvertalasa Nxobject-te
                Dim ids As Annotations.IdSymbol = NXObjectManager.Get(rend_elem)
                Dim idsb As Annotations.IdSymbolBuilder = idcol.CreateIdSymbolBuilder(ids)


                lw.WriteLine(" Rend Text: " + idsb.UpperText) 'id_symbol szovege
                lw.WriteLine(" Rend Origin: " & idsb.Origin.OriginPoint.ToString()) 'id_symbol (karika) kozepe
                'lw.WriteLine(" Rend Size: " & idsb.Size) 'id_symbol (karika) merete

                'Kozeppontokat beleteszi egy tombe, nincs ra szukseg
                'origin_x.Add(idsb.Origin.OriginPoint.X.ToString())


                Dim lb As Annotations.LeaderBuilder = idsb.Leader
                Dim ldl As Annotations.LeaderDataList = lb.Leaders
                Dim selection1 As DisplayableObject
                Dim view1 As View

                'Mutatovonal lekerdezese
                For i As Integer = 0 To ldl.Length - 1
                    Dim ld As Annotations.LeaderData = ldl.FindItem(i)


                    Dim point1 As Point3d

                    ld.Leader.GetValue(selection1, view1, point1)
                    'lw.WriteLine("  Leader view: " & view1.Name) 'Nezet neve
                    lw.WriteLine("---Leader view tag: " & view1.Tag) 'Nezet tag-je
                    lw.WriteLine("Stub size: " & ld.StubSize.ToString()) 'Mutatovonal tulnyulasa

                    If (view1.GetType().ToString() <> "NXOpen.View") Then
                        Dim model_pt(2) As Double
                        model_pt(0) = point1.X
                        model_pt(1) = point1.Y
                        model_pt(2) = point1.Z
                        Dim map_pt(1) As Double

                        theUfSession.View.MapModelToDrawing(view1.Tag, model_pt, map_pt)
                        'Melyik pontra mutat a mutatovonal
                        lw.WriteLine(" Mapped Leader point: X=" & map_pt(0).ToString() & " ,Y= " & map_pt(1).ToString())
                        'A pontok x koordinatait teszi egy tombe, e szerint lesz majd a rendezes
                        map_x.Add(map_pt(0).ToString)

                    End If

                Next
            Next

            'Csak ellenorzeskent, x koordinatak es hozzatartozo id_symbol tag-ek kiirasa
            For mx As Integer = 0 To rend.Count - 1
                lw.WriteLine("mx lista rendezesnel: " & map_x.Item(mx))
                lw.WriteLine("rend lista rendezesnel: " & rend.Item(mx))
            Next
            lw.WriteLine("----------------")

            'rendezes: mapped pontoke es a rend tombe
            Dim v, vv As Integer
            Dim temp, wtemp As Double
            vv = 0
            'temp = 0

            For v = 0 To rend.Count - 2
                For vv = v + 1 To rend.Count - 1
                    lw.WriteLine(vv & "----" & map_x.Item(v) & "---" & map_x.Item(vv))
                    If CDbl(map_x.Item(v)) > CDbl(map_x.Item(vv)) Then 'Ha nem CDbl, akkor nem rendez jól
                        'x koordinatak rendezese
                        temp = map_x.Item(v).ToString
                        map_x.Item(v) = map_x.Item(vv).ToString
                        map_x.Item(vv) = temp
                        'id_symbol tag-ek rendezese a fentivel parhuzamosan
                        wtemp = rend.Item(v).ToString
                        rend.Item(v) = rend.Item(vv).ToString
                        rend.Item(vv) = wtemp
                    End If
                Next
            Next

            'Csak ellenorzesre, hogy mindket tombe megtortent a rendezes
            For ww As Integer = 0 To rend.Count - 1
                lw.WriteLine("--------------")
                lw.WriteLine(map_x.Item(ww))
                lw.WriteLine("rend lista: " & rend.Item(ww))
            Next

            lw.WriteLine("----------------")

            'Szerettem volna nezet jobb oldala menten lefele is rendezni
            'rendezes_plusz(rend)

            'A berendezett id_symbolok nezet tetejere mozgatasa
            mozgatas(rend)

            Return rend
        Else
            'Hibakezeles
            Dim ex As String = "There is no id symbol."
            UI.GetUI().NXMessageBox.Show("Message", NXMessageBox.DialogType.[Error], ex)
            'MsgBox("na")
        End If

    End Function

    'Szerettem volna nezet jobb oldala menten lefele is rendezni, most nem kel
    Public Function rendezes_plusz(ByRef rend As ArrayList) As ArrayList

        Dim map_x_p As New ArrayList
        Dim origin_x_p As New ArrayList
        Dim idsb_p_size As New ArrayList
        Dim stub_size As New ArrayList
        Dim rend_elem_p As NXOpen.Tag


        For rend_c_p As Integer = 0 To rend.Count - 1
            'String konvertálása Tag-ge
            rend_elem_p = CType(rend.Item(rend_c_p), NXOpen.Tag)

            Dim idcol As Annotations.IdSymbolCollection = theSession.Parts.Work.Annotations.IdSymbols
            'Tag konvertalasa Nxobject-te
            Dim ids As Annotations.IdSymbol = NXObjectManager.Get(rend_elem_p)
            Dim idsb As Annotations.IdSymbolBuilder = idcol.CreateIdSymbolBuilder(ids)


            lw.WriteLine(" Rend plusz Text: " + idsb.UpperText)
            lw.WriteLine(" Rend plusz Origin: " & idsb.Origin.OriginPoint.ToString())
            lw.WriteLine(" Rend plusz Size: " & idsb.Size)
            origin_x_p.Add(idsb.Origin.OriginPoint.X.ToString())
            idsb_p_size.Add(idsb.Size.ToString)


            Dim lb As Annotations.LeaderBuilder = idsb.Leader
            Dim ldl As Annotations.LeaderDataList = lb.Leaders
            Dim selection1 As DisplayableObject
            Dim view1 As View

            For i As Integer = 0 To ldl.Length - 1
                Dim ld As Annotations.LeaderData = ldl.FindItem(i)


                Dim point1 As Point3d

                ld.Leader.GetValue(selection1, view1, point1)
                'lw.WriteLine("  Leader view: " & view1.Name)
                lw.WriteLine("---Plusz Leader view tag: " & view1.Tag)
                'lw.WriteLine("Stub size: " & ld.StubSize.ToString())
                stub_size.Add(ld.StubSize.ToString)

                If (view1.GetType().ToString() <> "NXOpen.View") Then
                    Dim model_pt_p(2) As Double
                    model_pt_p(0) = point1.X
                    model_pt_p(1) = point1.Y
                    model_pt_p(2) = point1.Z
                    Dim map_pt_p(1) As Double

                    theUfSession.View.MapModelToDrawing(view1.Tag, model_pt_p, map_pt_p)
                    lw.WriteLine(" Plusz Mapped Leader point: X=" & map_pt_p(0).ToString() & " ,Y= " & map_pt_p(1).ToString())
                    map_x_p.Add(map_pt_p(0).ToString)

                End If

            Next
        Next

        Dim csere As Double
        Dim rend_c_p_w As Integer = 0
        'While rend_c_p_w < rend.Count - 1
        For rend_c_p As Integer = 0 To rend.Count - 2
            lw.WriteLine("rend__p: " & rend_c_p)

            If map_x_p.Item(rend_c_p + 1) < origin_x_p.Item(rend_c_p) + idsb_p_size.Item(rend_c_p) / 2 + stub_size.Item(rend_c_p) Then
                lw.WriteLine("c_p_1: " & map_x_p.Item(rend_c_p + 1) & "--------" & "rend_c_p: " & map_x_p.Item(rend_c_p))
                csere = rend.Item(rend_c_p + 1)
                rend.Item(rend_c_p + 1) = rend.Item(rend_c_p)
                rend.Item(rend_c_p) = csere
            End If

        Next
        'End While

        For ww As Integer = 0 To rend.Count - 1
            lw.WriteLine("rend plusz lista: " & rend.Item(ww))
        Next

        mozgatas(rend)


    End Function


    'id_symbols mozgatasa nezetenek bal felso sarkatol x menten
    Public Function mozgatas(ByRef rend As ArrayList)

        'Csak ellenorzesre, hogy mi van a tombe
        lw.WriteLine("id_lista hossza: " & rend.Count)
        For ww As Integer = 0 To rend.Count - 1
            lw.WriteLine("rend lista mozgatasnal: " & rend.Item(ww))
        Next

        Dim mozgat_elem As NXOpen.Tag

        Dim koztes As Integer = 0
        Dim parent_view As New ArrayList
        Dim osszes_nezet As Integer = 0
        Dim mozgat_c_y As Integer = 0
        'Dim k As Integer = 0

        lw.WriteLine("----------------")
        For mozgat_c As Integer = 0 To rend.Count - 1
            'String konvertálása Tag-ge
            mozgat_elem = CType(rend.Item(mozgat_c), NXOpen.Tag)
            lw.WriteLine("mozgatas_elem ctype_nal: " & "mozgat_elem: " & mozgat_elem & "mozgat_c: " & mozgat_c)

            Dim idcol As Annotations.IdSymbolCollection = theSession.Parts.Work.Annotations.IdSymbols
            'Tag konvertalasa Nxobject-te
            Dim ids_m As Annotations.IdSymbol = NXObjectManager.Get(mozgat_elem)
            Dim idsb_m As Annotations.IdSymbolBuilder = idcol.CreateIdSymbolBuilder(ids_m)

            Dim lb As Annotations.LeaderBuilder = idsb_m.Leader
            Dim ldl_m As Annotations.LeaderDataList = lb.Leaders
            'lw.WriteLine(" Number of LeaderData: " + ldl.Length.ToString())

            Dim selection1 As DisplayableObject
            Dim view1 As View

            Dim hatar(3) As Double
            Dim meret_a As Double = 0
            Dim id_meret As Double = 0


            For i As Integer = 0 To ldl_m.Length - 1
                Dim ld As Annotations.LeaderData = ldl_m.FindItem(i)
                Dim point1 As Point3d

                lw.WriteLine(ld.Leader.Tag)
                ld.Leader.GetValue(selection1, view1, point1)
                lw.WriteLine("  Leader view: " & view1.Name)
                lw.WriteLine("---Leader view tag: " & view1.Tag)

                'Rosszat olvas view scale-be, id meretet a scale aranyaban szerettem volna csokkenteni
                'id_meret = idsb_m.Size
                'lw.WriteLine("id_meret" & id_meret & "scale " & view1.Scale)
                'meret_a = view1.Scale
                'idsb_m.Size = id_meret * meret_a
                'lw.WriteLine("id_size" & idsb_m.Size)
                'view1.SetScale(1)

                parent_view.Add(view1.Tag.ToString())
                lw.WriteLine("parent_view tomb:" & parent_view.Count)

                'rajz nezethataranak lekerdezese
                theUfSession.Draw.AskViewBorders(view1.Tag, hatar)


                ' Erre a pontra igazítja az összeset kell a Commit, hogy végrehajtsa
                Dim tav As Integer
                tav = idsb_m.Size * 1.7

                Dim ox As Point3d
                ox.Z = 0

                ox.X = hatar(0) + tav * mozgat_c
                ox.Y = hatar(3) + idsb_m.Size / 2
                idsb_m.Origin.Origin.SetValue(selection1, view1, ox)


                If ld.StubSide.ToString() = "Left" Then
                    ld.StubSide = Annotations.LeaderSide.Right
                End If

                'Ami nem fér el a nezet felett, az menne a jobb oldalán lefelé
                'If ox.X > idsb_m.Origin.OriginPoint.X.ToString() Then
                'lw.WriteLine("y-ba" & ox.X & "--" & idsb_m.Origin.OriginPoint.X.ToString())
                'ox.X = hatar(2) + idsb_m.Size / 3 * 4
                'ox.Y = hatar(3) - idsb_m.Size * 1.2 * mozgat_c_y
                'idsb_m.Origin.Origin.SetValue(selection1, view1, ox)
                'lw.WriteLine("oy: " & ox.Y)
                'mozgat_c_y = mozgat_c_y + 1

                'If ld.StubSide.ToString() = "Right" Then
                'ld.StubSide = Annotations.LeaderSide.Left
                'End If
                'End If

                'lw.WriteLine("szoveg: " & idsb_m.UpperText)

                'Ez kell, hogy mozgassa is
                Dim nXObject1 As NXObject
                nXObject1 = idsb_m.Commit()

                idsb_m.Destroy()

                lw.WriteLine("----------------")
            Next
        Next
        Return 0
    End Function

    Public Function GetUnloadOption(ByVal dummy As String) As Integer

        'Unloads the image immediately after execution within NX
        GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately

        '----Other unload options-------
        'Unloads the image when the NX session terminates
        'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination

        'Unloads the image explicitly, via an unload dialog
        'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Explicitly
        '-------------------------------

    End Function

End Module

 

Attila Szepesi
support engineer
graphIT Ltd.
www.graphit.hu

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