Author Topic: Simulate click on toolbar  (Read 11386 times)

0 Members and 1 Guest are viewing this topic.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Simulate click on toolbar
« Reply #30 on: January 18, 2017, 07:31:43 AM »
I have updated the code again. See here.

The function c:Osnap-FormToggle has been renamed to c:Osnaps-FormToggle.
This function only toggles the display of the form.

There is a new function c:Osnaps-Toggle.
This function toggles the osnaps (the 16384 bit) and changes the display of the form to match.

A keyboard shortcut should work with this as the command:
Code: [Select]
^P'Osnaps-Toggle^P
« Last Edit: January 18, 2017, 07:41:01 AM by roy_043 »

lamarn

  • Swamp Rat
  • Posts: 636
Re: Simulate click on toolbar
« Reply #31 on: January 18, 2017, 05:34:19 PM »
Nice work Roy.. Great further improvement! Will make it more efficient en user friendly.
I decided to leave the F3 button unchanged because this these OpenDCL function don't fully work transparent.
So, i was thinking, this F4 button can be a great target since i never use with 3Dsnaps.
Here is how F-button can be adressed... follwing..

http://forums.autodesk.com/t5/autocad-2010-2011-2012/function-keys-customization/td-p/3045206

attached also the idea of pressing F3, F4
I Like it!



« Last Edit: January 18, 2017, 05:55:42 PM by lamarn »
Design is something you should do with both hands. My 2d hand , my 3d hand ..

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Simulate click on toolbar
« Reply #32 on: January 19, 2017, 03:36:11 AM »
... because this these OpenDCL function don't fully work transparent...
For the functions to work transparently you have to prefix the macro command with a single quote. It seems you have forgotten to do so. See the suggestion in my previous post. In BricsCAD c:Osnaps-Toggle and c:Osnaps-FormToggle can be used transparently.

Edit:
Mind you there is an issue (in BricsCAD 16 at least) when trying to use keyboard shortcuts if DYNMODE is on.
« Last Edit: January 19, 2017, 06:49:18 AM by roy_043 »

lamarn

  • Swamp Rat
  • Posts: 636
Re: Simulate click on toolbar
« Reply #33 on: January 19, 2017, 03:41:03 PM »
Prolongated it to F3.
Design is something you should do with both hands. My 2d hand , my 3d hand ..

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Simulate click on toolbar
« Reply #34 on: January 19, 2017, 04:22:18 PM »
@Hans:
Do you also experience a problem with the transparent use of the command if you type:
Code: [Select]
'Osnaps-Toggle?

lamarn

  • Swamp Rat
  • Posts: 636
Re: Simulate click on toolbar
« Reply #35 on: January 19, 2017, 06:00:42 PM »
No. I do some more testing
Will report if i've had any strange behaviour..

https://youtu.be/g5v36dmHStY

« Last Edit: January 19, 2017, 06:05:04 PM by lamarn »
Design is something you should do with both hands. My 2d hand , my 3d hand ..

Hugo

  • Bull Frog
  • Posts: 430
Re: Simulate click on toolbar
« Reply #36 on: January 20, 2017, 12:19:18 AM »
Wanted this also testing runs unfortunately OpenDCL on Autocad 2017 not.   :-( :-(


Wollte das auch Testen leider läuft OpenDCL auf Autocad 2017 nicht.

lamarn

  • Swamp Rat
  • Posts: 636
Re: Simulate click on toolbar
« Reply #37 on: January 20, 2017, 03:07:53 AM »
Hi Hugo
What version did you install? Check their website /forum for 2017..
It runs on my laptop.

« Last Edit: January 20, 2017, 03:16:02 AM by lamarn »
Design is something you should do with both hands. My 2d hand , my 3d hand ..

Hugo

  • Bull Frog
  • Posts: 430
Re: Simulate click on toolbar
« Reply #38 on: January 20, 2017, 04:36:47 AM »
Autocad 2017 21.0s

How is the OpenDCL loaded with you?


Autocad 2017 21.0s

Wie wird bei dir das OpenDCL geladen ?

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Simulate click on toolbar
« Reply #39 on: January 20, 2017, 06:05:28 AM »
Autocad 2017 21.0s

How is the OpenDCL loaded with you?


Autocad 2017 21.0s

Wie wird bei dir das OpenDCL geladen ?
The program will load ODCL, but you have to have the correct ODCL version installed. And ODCL must be installed after AutoCAD.

lamarn

  • Swamp Rat
  • Posts: 636
Re: Simulate click on toolbar
« Reply #40 on: January 20, 2017, 06:12:04 PM »
Autocad 2017 21.0s

How is the OpenDCL loaded with you?


Autocad 2017 21.0s

Wie wird bei dir das OpenDCL geladen ?

Like .dcl the .odcl files needs to be in the support path. The rest is the same, load the lisp (on activation)
Design is something you should do with both hands. My 2d hand , my 3d hand ..

lamarn

  • Swamp Rat
  • Posts: 636
Re: Simulate click on toolbar
« Reply #41 on: December 06, 2018, 09:56:17 AM »
I'm picking up this old story about the osnap function.
What i really would like is to isolate the osnapz toggle function, written without opendcl code.
Meaning a reactor controls the grid in conjuction with the osnapz setting.
That would be a great function for wider use.

I isolates some code to start.  But i am not experienced enough to get this to work propertly.  :crazy2:
Maybe someone can help me with this.

Thanks!

Code: [Select]

(defun Osnapz-OnLoad () ; based on the work of Roy
    ;; Remove existing reactors:
    (mapcar '(lambda (rea)
                 (if (= "OSNAPZ" (vlr-data rea))
                     (vlr-remove rea)
                 )
             )
            (apply 'append (mapcar 'cdr (vlr-reactors)))
    )
    ;; Create new reactors:
    (vlr-sysvar-reactor
        "OSNAPZ"
        '((:vlr-sysvarchanged . Osnaps-CallBackSysvarChanged)
          (:vlr-sysvarwillchange . Osnaps-CallBackSysvarWillChange)
         )
    )
    (vlr-docmanager-reactor
        "OSNAPZ"
        '((:vlr-documentbecamecurrent . Osnaps-CallBackDocumentBecameCurrent)
          (:vlr-documenttobedeactivated . Osnaps-CallBackDocumentToBeDeactivated)
         )
    )
    (vlr-command-reactor
        "OSNAPZ"
        '((:vlr-commandcancelled . Osnaps-CallBackCommandCancelled)
          (:vlr-commandfailed . Osnaps-CallBackCommandCancelled)
          (:vlr-commandwillstart . Osnaps-CallBackCommandWillStart)
         )
    )
    (princ)
)


(defun Osnaps-CallBackSysvarChanged (rea lst)
    (cond ((= "OSNAPZ" (car lst)) (Osnaps-UpdateOsnapz nil)))
)
(defun Osnaps-CallBackDocumentBecameCurrent (rea lst)
  (Osnaps-UpdateOsnapz nil)
)
(defun Osnaps-CallBackDocumentToBeDeactivated (rea lst)
  (Osnaps-UpdateOsnapz  T)
)

(defun Osnaps-UpdateOsnapz (disableP / btn)
  (if (setq btn Osnaps/Main/btnOsnapz)
    (cond
      (disableP
        (dcl-Control-SetBackColor btn -16) ; here .., no opendcl codes ..
        (dcl-Control-SetForeColor btn -19) ; here .., no opendcl codes ..
      )
      ((zerop (getvar 'osnapz))
        (dcl-Control-SetBackColor btn 0) ; here .., no opendcl codes ..
        (dcl-Control-SetForeColor btn 7) ; here .., no opendcl codes ..
      )
      (T
        (dcl-Control-SetBackColor btn 7) ; here .., no opendcl codes ..
        (dcl-Control-SetForeColor btn 0) ; here .., no opendcl codes ..
      )
    )
  )
)

; not working yet though

« Last Edit: December 06, 2018, 09:59:56 AM by lamarn »
Design is something you should do with both hands. My 2d hand , my 3d hand ..

lamarn

  • Swamp Rat
  • Posts: 636
Re: Simulate click on toolbar
« Reply #42 on: December 10, 2018, 02:35:00 AM »
Aha. Just this one.

(defun c:Oz () (setvar 'gridmode (setvar 'osnapz (boole 6 (getvar 'osnapz) 1))) (princ))
Design is something you should do with both hands. My 2d hand , my 3d hand ..