+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
  1. #1
    Super Member Bill Tillman's Avatar
    Using
    AutoCAD 2013
    Join Date
    Oct 2008
    Location
    Miami, FL
    Posts
    870

    Default Problem With LISP Code on Corporate Machine vs Home Machine

    Registered forum members do not see this ad.

    I have a copy of Lee-Mac's Popup code which I tried at my office and all that happens is a quick blink on the mouse click but no popup window. I copied the same code on my home machine and it works great. I will double check the copy I have at the office later today but does anyone have a suggestion on what might be limiting it's running on a particular machine. The IT guys at this place have some policies but they gave my machine almost full-access because I'm doing development.

    Code:
    (defun c:test (/ x)
      (vl-load-com)
     
    (LM:Popup "Title Text" "This is a test message." (+ 2 48 4096))
     
    )
     
    ;;-------------------------=={ Popup }==----------------------;;
    ;;                                                            ;;
    ;;  Displays a pop-up message box prompting the user.         ;;
    ;;------------------------------------------------------------;;
    ;;  Author: Lee Mac, Copyright © 2011 - www.lee-mac.com       ;;
    ;;------------------------------------------------------------;;
    ;;  Arguments:                                                ;;
    ;;  title - Text to be displayed in the pop-up title bar      ;;
    ;;  msg   - Text content of the pop-up message box            ;;
    ;;  flags - Integer indicating icon & button appearance       ;;
    ;;------------------------------------------------------------;;
    ;;  Returns:  Integer indicating the button pressed to exit   ;;
    ;;------------------------------------------------------------;;
    (defun LM:Popup ( title msg flags / wsh res )
      (vl-catch-all-apply
        (function
          (lambda nil
            (setq wsh (vlax-create-object "WScript.Shell"))
            (setq res (vlax-invoke-method wsh 'popup msg 0 title flags))
          )
        )
      )
      (if wsh (vlax-release-object wsh))
      res
    )
    It's deja vu, all over again.

  2. #2
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro 4000, 2GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2013
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    33,023

    Default

    Are the two computers exactly the same in terms of OS, software (AutoCAD) and hardware?

    What do you mean "almost full access"? Either you got full access or you don't. You want full admin rights. Tell IT to go pound sand for awhile and stop getting in the way of you doing your job.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

  3. #3
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    2,986

    Default

    It may be from the version of Windows that are you using - please try to run this line in console:
    Code:
    (vlax-invoke-method (vlax-create-object "WScript.Shell") 'popup "TEST" 0 "X" 2)
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  4. #4
    Super Member Bill Tillman's Avatar
    Using
    AutoCAD 2013
    Join Date
    Oct 2008
    Location
    Miami, FL
    Posts
    870

    Default

    MSasu,

    I made sure that (vl-load-com) had been executed and then ran the command above from the console and got this message:

    ; error: bad argument type: VLA-OBJECT nil

    I did the same thing on one of another machine running XP with 2013 and it worked without error.

    I have double checked with two other computers (XP with AC 2009) in this office and Lee-Mac's code is rock solid on those, runs perfectly. I also double checked that wscript.exe is on this machine and that windows scripting is enabled, affirmative to both. I cold booted this machine this morning just in case. No matter how many times I try it on my corporate computer it only returns nil on the command line. The IT guys are not in yet, but believe me, as educated as these guys are on networking they will quickly become deer in the headlights on this kind of issue. I know what I would do with this machine and that would be to reformat the hard drive and reinstall everything...but IT will never allow me to do that, unless I bribe them.

    Remark,

    Tell IT to go pound sand for awhile and stop getting in the way of you doing your job.
    Amen brother...but that and $4 US will get me a latte at Starbucks.
    It's deja vu, all over again.

  5. #5
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,707

    Default

    Try without the 4096 bit-code, i.e.:

    Code:
    (LM:Popup "Title Text" "This is a test message." (+ 2 48))
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  6. #6
    Super Member Bill Tillman's Avatar
    Using
    AutoCAD 2013
    Join Date
    Oct 2008
    Location
    Miami, FL
    Posts
    870

    Default

    Tried leaving off the 4096 but the results were still the same. Only nil came back on the command line and no popup window whatsoever. It is isolated to just this machine. Every other machine in this office will run the code just fine. Since I'm able to work with Remote Desktop to another machine which is running the code correctly, I'm just going to chaulk this one up to this machine having something wrong with it and move on for now.
    It's deja vu, all over again.

  7. #7
    Forum Deity
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    3,780

    Default

    A simple pop up if you only want a simple message no title etc but grabs your attention

    Code:
    (setq ans "this is a popup")
    (alert ans)
    or
    (alert "this is a popup")
    A man who never made mistakes never made anything

  8. #8
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,932

    Default

    Not sure if this is an acceptable option or not, but DOSLib actually has some great interface (dialogs, HTML, popup, balloon, etc) LispFunction Methods. Really nice for folks like me that don't require custom dialogs, never learned DCL, and/or don't have time for all that's needed for Windows Forms, or WPF User Controls.
    "Potential has a shelf life." - Margaret Atwood

  9. #9
    Super Member Bill Tillman's Avatar
    Using
    AutoCAD 2013
    Join Date
    Oct 2008
    Location
    Miami, FL
    Posts
    870

    Default

    Thanks. The one-liner that MSasu posted is a real killer piece of code. Simple, to the point and it works....on every machine I have tested except this POS they gave me to develop on. That's one of the nice things about being a developer. Once you get your code debugged, you don't have to run it anymore.
    It's deja vu, all over again.

  10. #10
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,707

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by Bill Tillman View Post
    The one-liner that MSasu posted is a real killer piece of code. Simple, to the point and it works....on every machine I have tested except this POS they gave me to develop on.
    That one liner also doesn't release the WSH Object from memory.
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

Similar Threads

  1. Code Misbehaving on Particular Machine
    By Bill Tillman in forum AutoLISP, Visual LISP & DCL
    Replies: 10
    Last Post: 2nd Mar 2012, 02:05 pm
  2. autocad print pdf or machine problem
    By cytechnician in forum AutoCAD General
    Replies: 3
    Last Post: 19th Oct 2011, 03:30 pm
  3. Autodesk EULA - Installing on a work & home machine?
    By StykFacE in forum Software & Licensing
    Replies: 3
    Last Post: 1st Oct 2010, 02:52 pm
  4. I WANT AUTOCAD convert g-code for machine wirecut
    By pong2004 in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 1st Sep 2009, 11:55 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts