5 Replies Latest reply on Nov 19, 2012 1:16 PM by hglenn

    How to edit a net name with a hot key or stroke

    hglenn
      The ability to draw a net then edit the net name without having to move the mouse over to the properties dialog box used to exist in older versions. This would be a major time saver if there was a way to do it. I can't figure out any command or stroke to enable this. Any suggestions?
      
        • 1. Re: How to edit a net name with a hot key or stroke
          robert_davies

          This isn't possible and was removed from earlier versions by popular request, moving the focus automatically to the Properties dialog led to inadvertent naming of nets if you scrolled the mouse to zoom. If you have a series if nets to name you could place them without names and the use the Add Properties dialog to assign nets in bulk.

          • 2. Re: How to edit a net name with a hot key or stroke
            john_dube

            You could use the "label" command - as long as only one segment is selected, hit the spacebar, type in "la" and a dialog is displayed with the focus on the net name field.  If you are using Automatically Name Nets, you can use the "chglabel" command instead.

             

            And you could bind a key and/or stroke to those commands, or define a new command that calls Net.AddLabel.

             

            John

            • 3. Re: How to edit a net name with a hot key or stroke
              hglenn

              Hi John,

              Thanks for the quick reply, this is getting me part of the way there. Not a

              perfect solution as you have to "place" each label after it's made, I'll

              have to use it a bit to see if that will work. I'm having some trouble with

              the key-bindings now, I've included this line to try and add a label,

               

              "Bindings("Schematic").AddKeyBinding "Ctrl+L", "Net.AddLabel", Menu, Key "

               

              But on start-up I get an error about Net.AddLable not being a "Menu" item.

              No idea what would be correct here.

               

              Thanks

              • 4. Re: How to edit a net name with a hot key or stroke
                john_dube

                Here is a custom label command/keybinding example:

                 

                Scripting.DontExit = True

                Sub MyLabel(arg)
                    ' Get the first selected net, and it's first segment
                    Set Net = ActiveView.Query(VDM_NET, VD_SELECTED).Item(1)
                    Set Seg = Net.GetSegments(1)

                    ' If there is no label, add one
                    OnErrorResumeNext
                    Set lbl = Net.GetConnectedLabel(Seg)
                    If lblIsNothingThen
                        ptloX = Seg.Location(VDJ_LOW).X
                        ptloY = Seg.Location(VDJ_LOW).Y
                        sNetName = Replace(Net.UID, "$", "_")
                        Set lbl = Net.AddLabel(Seg, sNetName, ptloX, ptloY)
                    EndIf
                    ExecuteCommand"chglabel"
                EndSub

                Application.RegisterOLECommand"mylabel", "Custom Net Label command", False, ScriptThis
                Bindings("Schematic").AddKeyBinding"Ctrl+L", "mylabel", 1, 1, 1

                 

                John

                • 5. Re: How to edit a net name with a hot key or stroke
                  hglenn

                  Hi John,

                  Thanks very much for all your help.

                   

                  We are  getting into a realm of DxDesigner that I have not had need to use before  and that is custom scrips. I copied this into a file called add_label.vbs and added an entry to the scrips.ini file for

                   

                  [ViewDraw]

                  Script#0=add_label.vbs

                   

                  But this did not seem to enable the function. Is this the right approach?

                   

                  Thanks,

                  Hal