Author Topic: Possibilities for menu, dynamic buttons  (Read 9677 times)

roy_043

  • Sr. Member
  • ****
  • Posts: 369
Re: Possibilities for menu, dynamic buttons
« Reply #15 on: November 18, 2016, 09:58:59 AM »
@Hans:
Although the code does contain a portion to hide the GCE button and reduce the width of the dialog, your last post surprises me for two reasons:
1.
The code should only hide the GCE button if it is visible and therefore should execute only once per CAD-session.
2.
The code should not run on AC 2016 and 2017.

To find the cause of the problem change line 48-61 to:
Code: (autolisp) [Select]
  (if
    (and
      (print Osnaps/Main)
      (print Osnaps/Main/btnGce)
      Osnaps/Main/btnGce ; To be absolutely safe.
      (print (dcl-Control-GetVisible Osnaps/Main/btnGce))
      (if (= "BRICSCAD" (strcase (getvar 'product)))
        (> 16 (atoi (getvar '_vernum)))
        (> 2016 (atoi (substr (print (ver)) 13))) ; https://www.theswamp.org/index.php?topic=36606.msg416136#msg416136
      )
    )
    (progn
      (dcl-Control-SetVisible Osnaps/Main/btnGce nil)
      (dcl-Control-SetWidth Osnaps/Main (- (dcl-Control-GetWidth Osnaps/Main) 32)) ; 32 is the button distance.
    )
  )
And report what you see in the Command Bar when the dialog is first displayed and then closed and reopened.

Peter2

  • Sr. Member
  • ****
  • Posts: 470
Re: Possibilities for menu, dynamic buttons
« Reply #16 on: November 20, 2016, 03:11:49 AM »
Can you provide a screencast to show what is happening?
Peter
ODCL 8.1.... German, AutoCAD 2017 - 2018, Win 7 x64, Win 10

hanslammerts

  • Member
  • *
  • Posts: 38
Re: Possibilities for menu, dynamic buttons
« Reply #17 on: November 20, 2016, 12:54:12 PM »
Turns out i did something to the that did it.  :-\
I have one thing that would be benificial, a Z/Z button for OSNAPZ like ON/OFF for osnap.

;;  (setq osmz (getvar 'osnapz))  ;; etc... etc..
inspiration: https://apps.autodesk.com/ACD/en/Detail/Index?id=9014648650809523218&appLang=en&os=Win32_64
« Last Edit: December 01, 2016, 02:31:48 PM by hanslammerts »

roy_043

  • Sr. Member
  • ****
  • Posts: 369
Re: Possibilities for menu, dynamic buttons
« Reply #18 on: November 21, 2016, 07:58:59 AM »
@Hans:
For me the main goal of this little project was managing a modeless form across drawings, including drawings where the Lisp code is not loaded (two of the three reactors are there for this purpose). It was never my intention to create the 'perfect' Osnap toolbar. You are right: OSNAPZ plays a role, but so do OSOPTIONS and 3DOSMODE. Feel free to add buttons for any or all of these variables. I won't. ;D

hanslammerts

  • Member
  • *
  • Posts: 38
Re: Possibilities for menu, dynamic buttons
« Reply #19 on: November 22, 2016, 02:25:23 PM »
Ok. respect that, really like to thank you for your time & effort. I like it allready as it is,  but there is allways something to wish for ;-)
While i'm using it i noticed i keep using the F3 key a Z osnap would therfore be more welcome, ..to me..

scott_cd

  • Member
  • *
  • Posts: 6
Re: Possibilities for menu, dynamic buttons
« Reply #20 on: November 25, 2016, 05:33:50 AM »
Thanks for sharing this - What a fabulous function.

I have taken the liberty of adding a couple of buttons and changing the colours of the buttons.

I have added the following buttons: m2p .xy and OsnapZ

I am afraid that I wasn't able to update the reactors as it is beyond my skill level.

Thanks again

Scott CD


roy_043

  • Sr. Member
  • ****
  • Posts: 369
Re: Possibilities for menu, dynamic buttons
« Reply #21 on: November 26, 2016, 04:33:57 AM »
Since, apparently, the code is hard to understand for the average Lisper, I have changed my mind and have added an OZ (OSNAPZ) button. By using three separate update functions I hope that others will find the code easier to modify and extend.
See reply #3 for the updated version.
« Last Edit: November 26, 2016, 05:58:04 AM by roy_043 »

hanslammerts

  • Member
  • *
  • Posts: 38
Re: Possibilities for menu, dynamic buttons
« Reply #22 on: December 01, 2016, 02:03:02 PM »
Fantastic you made osnapz running so good Roy_043!!
What i did to it, is turning line 258 into this .. little tweak that i find usefull as graphical feedback by showing grid indicating Z is locked.
Will work great in 3D i know! Looks like the Revit 'show plane' & 'pick plane' option. However, with AutoCAD you still have a lot more freedom in 3D imo..

(defun c:Osnaps/Main/btnOsnapz#OnClicked () (progn ((setvar 'osnapz (boole 6 (getvar 'osnapz) 1)) (setvar 'gridmode (boole 6 (getvar 'gridmode) 1)) (princ))))
« Last Edit: December 01, 2016, 02:31:24 PM by hanslammerts »

roy_043

  • Sr. Member
  • ****
  • Posts: 369
Re: Possibilities for menu, dynamic buttons
« Reply #23 on: December 02, 2016, 02:00:48 AM »
Showing the grid if OSNAPZ is On can be useful. But your code simply toggles the GRIDMODE independently from the OSNAPZ. So if the user has OSNAPZ=0 and GRIDMODE=1, clicking the OZ button will result in OSNAPZ=1 and GRIDMODE=0.
A better solution would be:
Code: (autolisp) [Select]
(defun c:Osnaps/Main/btnOsnapz#OnClicked () (setvar 'gridmode (setvar 'osnapz (boole 6 (getvar 'osnapz) 1))) (princ))

hanslammerts

  • Member
  • *
  • Posts: 38
Re: Possibilities for menu, dynamic buttons
« Reply #24 on: December 02, 2016, 05:22:03 AM »
Even better! Hold that thought for updating the code ( #3 ) :)
I set GRIDDISPLAY = 15 (adoptive and beyond limits) by default

(dcl-Form-Show Osnaps/Main 750 0)
To start at top bottom
« Last Edit: January 15, 2017, 01:43:09 PM by hanslammerts »

roy_043

  • Sr. Member
  • ****
  • Posts: 369
Re: Possibilities for menu, dynamic buttons
« Reply #25 on: January 17, 2017, 10:18:39 AM »
See reply #3 for the 20170117 version.

hanslammerts

  • Member
  • *
  • Posts: 38
Re: Possibilities for menu, dynamic buttons
« Reply #26 on: January 17, 2017, 01:12:02 PM »
Allright..!  like it Roy !)



« Last Edit: January 17, 2017, 01:20:53 PM by hanslammerts »

roy_043

  • Sr. Member
  • ****
  • Posts: 369
Re: Possibilities for menu, dynamic buttons
« Reply #27 on: January 18, 2017, 04:23:33 AM »
See reply #3 for the 20170118 version.

hanslammerts

  • Member
  • *
  • Posts: 38
Re: Possibilities for menu, dynamic buttons
« Reply #28 on: January 18, 2017, 03:02:58 PM »
I decided to use it as F3. But you can set it F4 as well as this is by default the 3D objectsnap function..
« Last Edit: January 24, 2017, 11:31:05 PM by hanslammerts »

hanslammerts

  • Member
  • *
  • Posts: 38
Re: Possibilities for menu, dynamic buttons
« Reply #29 on: January 24, 2017, 11:32:40 PM »
Hi Roy
It needs a .._reset function for its location.
I noticed that it can stay on the disconected monitor..