News:

Please note new Forum URL: forum.designcad.com

Main Menu
DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

autoselect infobox

Started by bdeck, March 02, 2007, 08:15:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bdeck

This macro saves a few keystrokes by adding some logic to the infobox command.  Works in version 17.2, but not 14.

If there is a current selection, then the macro simply displays the info box.

If no entities are selected, the macro first selects the most recently drawn entity before displaying the infobox.

Thus it is not necessary to set options to "Select When Created."

If the last item drawn has been incorporated into a group, it selects only the individual entity, not the entire group. (Select the group manually if you wish to edit it as a group, or change the function logic)

Assign to the i key, or hit SPC, i ,RTN to run it.

BD




' i.d3m    bdeck   2/07
' macro to
' 1) select the last entity created (if nothing is selected)
' 2) redraw the selection
' 3) show info box
'
' ignores groups and grids


Alias ENT_SELECTED  &H010C 

if sys(80) = 0 then  'if no entities selected'

   nent=sys(9)  'get last entity number'
   if nent=0 then end
   getattr nent, type
   
   do while type>31 and type<35     ' ignore groups and grids'                 
      nent=nent-1
      if nent=0 then end
      getattr nent, type
   loop   

   entity nent
   change ENT_SELECTED, 1
   update   

         
    >Move  ' force redraw of selection without redrawing entire window
    {
    <reference 1
    <type 1
    <pointxyz 0, 0, 0
    <pointxyz 0, 0, 0
    }
   
endif

  >InfoBox
  {
  }

end