Transparent Command ?

Discussion in 'AutoCAD' started by JB, Apr 23, 2004.

  1. JB

    JB Guest

    Can this code be made into a transparent command?

    (defun c:HID ()
    (command "toolbar" "HID" "f" "400,150" "5")
    (princ)
    )

    If so, how?

    Thanks as always!

    -JB
     
    JB, Apr 23, 2004
    #1
  2. JB

    BillZ Guest

    If a command cannot be made transparent at the command line using the ' like 'zoom, then I don't believe it can be done at all.


    Bill
     
    BillZ, Apr 23, 2004
    #2
  3. Hello JB!
    ------------

    It could be done with VisualLISP and not the COMMAND function!

    There is no error handling!
    You must use the real MENUGROUP and TOOLBAR names!

    Try this and experiment yourself!
    ------------------------------------
    Alexander V. Koshman



    (defun c:tbModify (/ acad doc menuGroupName tbName toolbar status)

    (vl-load-com)

    (setq acad (vlax-get-Acad-Object))
    (setq doc (vla-get-ActiveDocument acad))

    (setq menuGroupName "ACAD")
    (setq tbName "Modify")

    (setq toolbar
    (vla-item
    (vla-get-toolbars
    (vla-item
    (vla-get-menugroups (vlax-get-acad-object))
    menuGroupName
    ) ; - 'vla-item'
    ) ; - 'vla-get-toolbars'
    tbName
    ) ; - 'vla-item'
    ) ; - 'setq'

    (if (/= (vla-get-visible toolbar) ':vlax-true)
    (setq status ':vlax-true)
    (setq status ':vlax-false)
    ) ; - 'if'

    (vla-put-visible toolbar status)

    (vlax-release-object acad)
    (vlax-release-object doc)
    (princ)
    ) ; - 'defun'
     
    Alexander V. Koshman, Apr 23, 2004
    #3
  4. JB

    JB Guest

    Sweet! It works EXACTLY like I wanted - Thank you kindly!

    - JB
     
    JB, Apr 27, 2004
    #4
  5. JB

    Randall Culp Guest

    Just a note.

    Some commands (settings) can be set in a lisp function and accessed
    transparently.
    Example:

    (defun mbp ()

    (if

    (= (getvar "mbuttonpan") 0)

    (setvar "mbuttonpan" 1)

    (setvar "mbuttonpan" 0)

    )

    (TERPRI)

    )



    Then execute (MBP) at any time will toggle MBUTTONPAN
     
    Randall Culp, Apr 28, 2004
    #5
  6. Hi JB and Randall!
    -------------------------
    I think near all system variables can be used transparent.
    .... maybe not...

    And I know about transparent using of ZOOM, DSETTINGS and so on! ; )
    But the fact is:

    Command: 'toolbar
    ** That command may not be invoked transparently **

    and in that case we have not any other chance but use ActiveX...
     
    Alexander V. Koshman, Apr 29, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.