Whats wrong with (vla-put-ProxyImage APREF 1)

Discussion in 'AutoCAD' started by Dave Lewis, Feb 11, 2004.

  1. Dave Lewis

    Dave Lewis Guest

    trying to turn off the proxy image checkbox
    maybe I just need a list of variables?
     
    Dave Lewis, Feb 11, 2004
    #1
  2. (setq *acad* (vlax-get-acad-object))
    #<VLA-OBJECT IAcadApplication 00af9594>

    (setq *doc* (vla-get-activedocument *acad*))
    #<VLA-OBJECT IAcadDocument 00fadc30>

    (setq *pref* (vla-get-preferences *acad*))
    #<VLA-OBJECT IAcadPreferences 0100d69c>

    (setq *openSave* (vla-get-opensave *pref*))
    #<VLA-OBJECT IAcadPreferencesOpenSave 0100d684>

    (vla-get-ShowProxyDialogBox *opensave*)
    :vlax-false


    ?
     
    Jason Piercey, Feb 11, 2004
    #2
  3. Dave Lewis

    Rudy Tovar Guest

    (setq ac (vla-get-activedocument(vlax-get-acad-object)))

    (vla-setvariable ac "proxyshow" 0)
     
    Rudy Tovar, Feb 11, 2004
    #3
  4. or

    (getenv "ShowProxyDialog")

    (setenv .....)
     
    Jason Piercey, Feb 11, 2004
    #4
  5. Dave Lewis

    Dave Lewis Guest

    I have a options lisp to setup my autocad. It does things suchas
    (vla-put-DisplayScrollBars ADISP 0)

    Based on that format I would think that
    (vla-put-ProxyImage APREF 1) should work


    "Jason Piercey" <Jason AT atreng DOT com>
    |>(setq *acad* (vlax-get-acad-object))
    |>#<VLA-OBJECT IAcadApplication 00af9594>
    |>
    |>(setq *doc* (vla-get-activedocument *acad*))
    |>#<VLA-OBJECT IAcadDocument 00fadc30>
    |>
    |>(setq *pref* (vla-get-preferences *acad*))
    |>#<VLA-OBJECT IAcadPreferences 0100d69c>
    |>
    |>(setq *openSave* (vla-get-opensave *pref*))
    |>#<VLA-OBJECT IAcadPreferencesOpenSave 0100d684>
    |>
    |>(vla-get-ShowProxyDialogBox *opensave*)
    |>:vlax-false
    |>
    |>
    |>?

    --------------------------
    Dave Lewis
    CAD Manager
    http://www.cadthinking.com

    Just say no to HTML Posts!
     
    Dave Lewis, Feb 12, 2004
    #5
  6. Dave Lewis

    Jeff Mishler Guest

    Dave, from your first post: "trying to turn off the proxy image
    checkbox"

    The only checkbox I can find that is associated with proxy objects is :
    "Show Proxy Information Dialog Box"

    The property you are trying to adjust is for what type, if any, graphics
    are shown for proxy objects. This is set in the drop-down list above the
    checkbox mentioned above and your code DOES affect that by:
    0 = don't show proxy graphics
    1 = show proxy graphics (this is what you are setting)
    2 = show bounding box

    So what is it you want to set?

    Jeff
     
    Jeff Mishler, Feb 12, 2004
    #6
  7. Dave Lewis

    Dave Lewis Guest

    I want to turn off that check box to not show the idiot box

    I want the pulldown to "show proxy graphics" which is a seperate issue
    I want the "show proxy information dialog box" to be unchecked

    "Jeff Mishler" <>
    |>Dave, from your first post: "trying to turn off the proxy image
    |>checkbox"
    |>
    |>The only checkbox I can find that is associated with proxy objects is :
    |>"Show Proxy Information Dialog Box"
    |>
    |>The property you are trying to adjust is for what type, if any, graphics
    |>are shown for proxy objects. This is set in the drop-down list above the
    |>checkbox mentioned above and your code DOES affect that by:
    |>0 = don't show proxy graphics
    |>1 = show proxy graphics (this is what you are setting)
    |>2 = show bounding box
    |>
    |>So what is it you want to set?
    |>
    |>Jeff
    |>
    |>
    |>|>> I have a options lisp to setup my autocad. It does things suchas
    |>> (vla-put-DisplayScrollBars ADISP 0)
    |>>
    |>> Based on that format I would think that
    |>> (vla-put-ProxyImage APREF 1) should work
    |>>
    |>>
    |>> "Jason Piercey" <Jason AT atreng DOT com>
    |>> |>(setq *acad* (vlax-get-acad-object))
    |>> |>#<VLA-OBJECT IAcadApplication 00af9594>
    |>> |>
    |>> |>(setq *doc* (vla-get-activedocument *acad*))
    |>> |>#<VLA-OBJECT IAcadDocument 00fadc30>
    |>> |>
    |>> |>(setq *pref* (vla-get-preferences *acad*))
    |>> |>#<VLA-OBJECT IAcadPreferences 0100d69c>
    |>> |>
    |>> |>(setq *openSave* (vla-get-opensave *pref*))
    |>> |>#<VLA-OBJECT IAcadPreferencesOpenSave 0100d684>
    |>> |>
    |>> |>(vla-get-ShowProxyDialogBox *opensave*)
    |>> |>:vlax-false
    |>> |>
    |>> |>
    |>> |>?
    |>>
    |>> --------------------------
    |>> Dave Lewis
    |>> CAD Manager
    |>> http://www.cadthinking.com
    |>>
    |>> Just say no to HTML Posts!
    |>

    --------------------------
    Dave Lewis
    CAD Manager
    http://www.cadthinking.com

    Just say no to HTML Posts!
     
    Dave Lewis, Feb 18, 2004
    #7
  8. Dave Lewis

    Jeff Mishler Guest

    Dave,
    That setting is in the registry. It is a strange setting, though. If the
    checkbox is checked then there is no listing in the registry. If the
    checkbox is unchecked then the registry entry is there.

    Look at the entry under HKEY_CURRENT_USER/Software/Autodesk/<version>/<local
    version>/Profiles/<current profile>/General/ShowProxyDialog

    HTH,
    Jeff
     
    Jeff Mishler, Feb 18, 2004
    #8
  9. Dave Lewis

    BillZ Guest

    (vlax-put (vla-get-opensave (vla-get-preferences
    (vlax-get-acad-object))) "ShowProxyDialogBox" 0)

    -1 turns it back on.

    Bill
     
    BillZ, Feb 18, 2004
    #9
  10. Dave Lewis

    Dave Lewis Guest

    thankx Bill

    wierd how that code is so much longer then
    say (vla-put-ShowProxyDialogBox APREF 1)
    I don't understand how the other sections such display or files are just one vla command
    compared to your code.

    BillZ <>
    |>(vlax-put (vla-get-opensave (vla-get-preferences
    |>(vlax-get-acad-object))) "ShowProxyDialogBox" 0)

    --------------------------
    Dave Lewis
    CAD Manager
    http://www.cadthinking.com

    Just say no to HTML Posts!
     
    Dave Lewis, Feb 20, 2004
    #10
  11. Dave Lewis

    BillZ Guest

    You're wlecome Dave,

    Let me see if I can explain this to you.
    I am under the understanding that you copied this string from some existing code:

    (vla-put-ShowProxyDialogBox APREF 1)

    You need more code before you can execute that line.

    This is what I gave you.

    (vlax-put (vla-get-opensave (vla-get-preferences
    (vlax-get-acad-object))) "ShowProxyDialogBox" 0)

    Everyone has been too kind (so far) as to chide me for stringing these functions together as most know that I have been at Vlisp for only a couple of months (was R14 vanilla).

    Now if I do it this way:
    (setq *acadobject* (vlax-get-acad-object)
    *acadpref* (vla-get-preferences *acadobject*)
    Apref (vla-get-opensave *acadpref*)
    )
    Now it works!

    (vla-put-ShowProxyDialogBox APREF 1)

    HTH

    Bill
     
    BillZ, Feb 20, 2004
    #11
  12. Dave Lewis

    Dave Lewis Guest

    what's frustrating with AutoCAD is the inconsistency of variable naming.
    Yes I copied the existing code that I figured out for the support paths.
    I cannot find documentation for these preference items so I have to
    make assumptions as to their naming and trial and error test each one.
    What a pain. Its like you have to know each exception to the rule
    such as in this case. I was just wondering how you came to knowing
    this exception as it differed from the others as far as format.

    BillZ <>
    |>You're wlecome Dave,
    |>
    |>Let me see if I can explain this to you.
    |>I am under the understanding that you copied this string from some existing code:
    |>
    |>(vla-put-ShowProxyDialogBox APREF 1)
    |>
    |>You need more code before you can execute that line.
    |>
    |>This is what I gave you.
    |>
    |>(vlax-put (vla-get-opensave (vla-get-preferences
    |>(vlax-get-acad-object))) "ShowProxyDialogBox" 0)
    |>
    |>Everyone has been too kind (so far) as to chide me for stringing these functions together as most know that I have been at Vlisp for only a couple of months (was R14 vanilla).
    |>
    |>Now if I do it this way:
    |>(setq *acadobject* (vlax-get-acad-object)
    |> *acadpref* (vla-get-preferences *acadobject*)
    |> Apref (vla-get-opensave *acadpref*)
    |> )
    |>Now it works!
    |>
    |>(vla-put-ShowProxyDialogBox APREF 1)
    |>
    |>HTH
    |>
    |>Bill
     
    Dave Lewis, Feb 21, 2004
    #12
  13. Dave Lewis

    BillZ Guest

    Dave,
    With everyone trying to make their variable names in their programs more descriptive, vars like *acadobject* can make you wonder if it's a system var or a user var. I feel your pain!
    Also the help files leave a lot to be desired as far as being efficient is concerned.
    The Autolisp developers guide has useful info on ActiveX and related VB methods.
    As far as how I deciphered this bit of code,
    I used the:
    (vlax-dump-object "object" T)
    function to see what is available inside the object

    (setq *acadobject* (vlax-get-acad-object)) ;main AutoCAD drawing object.
    Now at the command prompt:

    Command: (vlax-dump-object *acadobject* t)
    ; IAcadApplication: An instance of the AutoCAD application
    ; Property values:
    ; ActiveDocument = #<VLA-OBJECT IAcadDocument 00fafad0>
    ; Application (RO) = #<VLA-OBJECT IAcadApplication 00af9594>
    ; Caption (RO) = "AutoCAD 2004 - [Drawing1.dwg]"
    ; Documents (RO) = #<VLA-OBJECT IAcadDocuments 0100d3d0>
    ; FullName (RO) = "C:\\Program Files\\AutoCAD 2004\\acad.exe"
    ; Height = 748
    ; HWND (RO) = 1901224
    ; LocaleId (RO) = 1033
    ; MenuBar (RO) = #<VLA-OBJECT IAcadMenuBar 0100ef04>
    ; MenuGroups (RO) = #<VLA-OBJECT IAcadMenuGroups 00f1cd70>
    ; Name (RO) = "AutoCAD"
    ; Path (RO) = "C:\\Program Files\\AutoCAD 2004"
    ; Preferences (RO) = #<VLA-OBJECT IAcadPreferences 0101155c>
    ; StatusId (RO) = ...Indexed contents not shown...
    ; VBE (RO) = #<VLA-OBJECT VBE 05b11844>
    ; Version (RO) = "16.0"
    ; Visible = -1
    ; Width = 1032
    ; WindowLeft = -4
    ; WindowState = 3
    ; WindowTop = -4
    ; Methods supported:
    ; Eval (1)
    ; GetAcadState ()
    ; GetInterfaceObject (1)
    ; ListArx ()
    ; LoadArx (1)
    ; LoadDVB (1)
    ; Quit ()
    ; RunMacro (1)
    ; UnloadArx (1)
    ; UnloadDVB (1)
    ; Update ()
    ; ZoomAll ()
    ; ZoomCenter (2)
    ; ZoomExtents ()
    ; ZoomPickWindow ()
    ; ZoomPrevious ()
    ; ZoomScaled (2)
    ; ZoomWindow (2)
    T

    I wanted preferences so the next step was:

    (setq *acadpref* (vla-get-preferences *acadobject*))

    Now we look under that object:

    Command: (vlax-dump-object *acadpref* t)
    ; IAcadPreferences: This object specifies the current AutoCAD settings
    ; Property values:
    ; Application (RO) = #<VLA-OBJECT IAcadApplication 00af9594>
    ; Display (RO) = #<VLA-OBJECT IAcadPreferencesDisplay 01013a7c>
    ; Drafting (RO) = #<VLA-OBJECT IAcadPreferencesDrafting 01013a78>
    ; Files (RO) = #<VLA-OBJECT IAcadPreferencesFiles 01013a80>
    ; OpenSave (RO) = #<VLA-OBJECT IAcadPreferencesOpenSave 01013a84>
    ; Output (RO) = #<VLA-OBJECT IAcadPreferencesOutput 01013a88>
    ; Profiles (RO) = #<VLA-OBJECT IAcadPreferencesProfiles 01013a8c>
    ; Selection (RO) = #<VLA-OBJECT IAcadPreferencesSelection 01013a90>
    ; System (RO) = #<VLA-OBJECT IAcadPreferencesSystem 01013a94>
    ; User (RO) = #<VLA-OBJECT IAcadPreferencesUser 01013a98>
    ; No methods
    T

    At this point I did have some testing for each object to find the one that I wanted. But eventually came to:
    "ShowProxyDialogBox = -1" inside the OpenSave object.
    (setq apref (vla-get-opensave acadpref))

    Command: (vlax-dump-object apref t)
    ; IAcadPreferencesOpenSave: This object contains the options from the Open and
    Save tab on the Options dialog
    ; Property values:
    ; Application (RO) = #<VLA-OBJECT IAcadApplication 00af9594>
    ; AutoAudit = 0
    ; AutoSaveInterval = 10
    ; CreateBackup = -1
    ; DemandLoadARXApp = 3
    ; FullCRCValidation = 0
    ; IncrementalSavePercent = 50
    ; LogFileOn = 0
    ; MRUNumber (RO) = 9
    ; ProxyImage = 1
    ; SaveAsType = 24
    ; SavePreviewThumbnail = -1
    ; ShowProxyDialogBox = -1
    ; TempFileExtension = "ac$"
    ; XrefDemandLoad = 2
    ; No methods
    T

    So I just figured it would be: (vla-put-ShowProxyDialogBox Apref 0) :^)

    Like I say, I'm fairly new to ActiveX and I'm sure I'll learn better ways to do what i just posted as I find my way around the help files and people on this NG are very generous with helping and sharing techniques.

    HTH

    Bill
     
    BillZ, Feb 23, 2004
    #13
  14. Dave Lewis

    Dave Lewis Guest

    I see, thankx Bill.
    The way I did it was with VLIDE
    I start with this code
    (SETQ AOBJ (vlax-get-acad-object)
    APREF (vla-get-Preferences AOBJ)
    AFILES (vla-get-Files APREF)
    AOUTPUT (vla-get-output APREF)
    ASYSTEM (vla-get-system APREF)
    ADISP (vla-get-Display APREF)
    )

    I highlight APREF and right click on it had hit inspect and go from there.
    The fustrating thing is that so far every config has been straight forward except this one.
    Ultimately what I want is a lisp that configures the entire autocad enviroment. I am sick
    of installing autocads and configuring them to how I like so I started back in R12 with
    a simple variables lisp. Now with Active X and Visual Lisp I can configure just about everything.
    but I have to hunt for all the variables. I am about a 3rd of the way through all of them.
    So that when I open any version of autocad anywhere I can just drag in the lisp and reconfigure
    autocad. I then have commented out some parts of the routine to allow for individual users to
    customize their own enviroment. But most of the vital company standard stuff is handled via
    this company standard options lisp.


    BillZ <>
    |>Like I say, I'm fairly new to ActiveX and I'm sure I'll learn better ways to do what i just posted as I find my way around the help files and people on this NG are very generous with helping and sharing techniques.

    --------------------------
    Dave Lewis
    CAD Manager
    http://www.cadthinking.com

    Just say no to HTML Posts!
     
    Dave Lewis, Feb 23, 2004
    #14
  15. Dave Lewis

    BillZ Guest

    Sounds pretty cool!
    You'll have to add OpenSave to that. 8^))
    Most of what we do here is set up in a certain configuration also.
    I just set R2004 up here and with Vlisp it has been no problem setting the preferences any way you want on startup.
    I'm still having trouble getting used to the Vlide and tend to work at the command line most of the time but even that has been become more frustrating as using the up & down arrows to repeat what you typed doesn't repeat all the pasted stuff and trying to edit the line after you have pasted into a line can turn onto a real circus for sure. Hard to teach old dogs new tricks you know, but I'll probably have to try vlide more and more.

    Bill
     
    BillZ, Feb 24, 2004
    #15
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.