Open LDD

Discussion in 'AutoCAD' started by Rad_Cadder, Dec 27, 2004.

  1. Rad_Cadder

    Rad_Cadder Guest

    Let me start by saying that I am a newbie to VBA and could use all the help I can get.

    I am trying to find out if it would be possible and if so how to setup a routine to launch from the LDD Icon "possibly a DOS Script"? that would check to see if autocad was open and if open, "Alert user" and not open LDD.

    I searched previous posts and found a post "is autocad open" and this sounds like a place to start, but I don't know enough about VBA to tell if this will work or if it is possible.

    Any help much appreciated!!!
     
    Rad_Cadder, Dec 27, 2004
    #1
  2. Hi,

    VBA runs from inside a running AutoCAD version.

    Hence for your purpose VBA will not be of any use.

    You will need to write the program in another language. Due to the help you
    can get from the sample files and the published items in this newsgroup, VB
    is your best option - but you will have to buy it.

    Alternatively use the Microsoft scripting language which is free, and you
    certainly will be able to find help on other Internet Newsgroups to do this.

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au


    routine to launch from the LDD Icon "possibly a DOS Script"? that would
    check to see if autocad was open and if open, "Alert user" and not open LDD.
    sounds like a place to start, but I don't know enough about VBA to tell if
    this will work or if it is possible.
     
    Laurie Comerford, Dec 27, 2004
    #2
  3. Rad_Cadder

    Rad_Cadder Guest

    So what you are saying is that it would not be possible to write a DOS script to check the registry for an entry that is only present while autocad is running and if this key is present, run a lisp to alert user???
     
    Rad_Cadder, Dec 27, 2004
    #3
  4. Rad_Cadder

    Ed Jobe Guest

    What's not possible, that I know of, is to stop LDD from loading. Once you
    click on the LDD icon, it's going to load. At best you can automatically
    close it after it opens. You might be able to make an exe that performs your
    checks and then if all is OK, it then starts LDD. But you would have to
    change the shortcut to run your app and not LDD. Also, it could be done with
    a VB script, not a DOS script and checking the registry only tells you if
    the prog is installed, not if its running. For that, you need to use the
    GetObject function.

    --
    ----
    Ed
    ----
    script to check the registry for an entry that is only present while autocad
    is running and if this key is present, run a lisp to alert user???
     
    Ed Jobe, Dec 28, 2004
    #4
  5. Hi,

    Until you sort out logically what you want to do, nothing is possible.

    Think about it:

    You have a user who double clicks on the LDD icon. You are now saying that
    you want to run a lisp program (which can only run inside AutoCAD) to tell
    the user AutoCAD is running.

    That may be possible (almost everything is in the programming world if you
    can only sort out how), but even if it is, the AutoCAD user who need this
    alert will probably not be able to see it if the AutoCAD is minimised so he
    can see the LDD icon.

    With the MS scripting language, you can certainly detect if an AutoCAD is
    running, and if it is display a message with wording along the lines "We
    hate training and believe you are incompetent, so have written this program
    to tell you that you have AutoCAD running and we don't want you to run Land
    Desktop"
    If no AutoCAD is running, you would start Land Desktop.

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au


    script to check the registry for an entry that is only present while autocad
    is running and if this key is present, run a lisp to alert user???
     
    Laurie Comerford, Dec 28, 2004
    #5
  6. Rad_Cadder

    Rad_Cadder Guest

    Laurie,
    I was just simply asking for help, or ideas, and wasn't sure if it was even possible.

    Maybe you are the only person who has input on this, but I would think that your way is not the only way.

    I guess my mistake was to ask for help and then offer any ideas that I might have.

    Seems to me that unless you are capable of doing anyting with VB you don't have any business posting here!

    Sorry to have wasted your valuable time!
     
    Rad_Cadder, Dec 28, 2004
    #6
  7. Rad_Cadder

    Rad_Cadder Guest

    My origonal post in LDD forum:

    Maybe someone can help!
    I need to know if it is possible and if so how would you go about checking to see if autocad was already open when a user double clicks LDD Icon?

    And is it possible to stop LDD from loading and overwriting autocad settings?

    Your response:

    It's far more likely that they are opening drawings by double clicking on
    them and this is the source of the problem.

    So if you already knew the problem, why didn't you post it
     
    Rad_Cadder, Dec 28, 2004
    #7
  8. Rad_Cadder

    Anne Brown Guest

    Rad -

    Laurie is a very experienced user. Please remember that all who
    post here are peer to peer and doing this on their own time. You
    have to sort through the answers and make them fit your own
    circumstances.
    ---
    Anne Brown
    Discussion Groups Administrator
    Autodesk, Inc.

    Rad_Cadder wrote:
    (snip)
     
    Anne Brown, Dec 28, 2004
    #8
  9. Is your problem users double clicking drawings or is it users opening another session from a shortcut or is it both.
    Regards - Nathan
     
    Nathan Taylor, Dec 28, 2004
    #9
  10. Rad_Cadder

    Rad_Cadder Guest

    The problem is that when our Tech's have autocad open and then open LDD their autocad settings are overwritten by the LDD profile.

    Thanx
     
    Rad_Cadder, Dec 28, 2004
    #10
  11. Possibly when LDD opens a VBA routine could run that uses the GetObject function to get the first instance of AutoCAD it finds and set the relevant settings. I haven't got LDD so can not verify anything. Possible problems are:
    The user might have more than one AutoCAD session open and I am not sure if there is a way to get all sessions.
    You need to know all the settings and whether they can be made in VBA.
    The VBA routine may be run before the AutoCAD settings have been changed.

    Regards - Nathan
     
    Nathan Taylor, Dec 28, 2004
    #11
  12. Rad_Cadder

    Rad_Cadder Guest

    Ed,
    I have checked the registry and compared with acad & LDD the following keys are present only while acad is open.

    "Validation Policy"=dword:00000003
    "Validation Strategy"=dword:00000001

    "I believe" This is the registration for our liscence server?
    My first thought was that you may be able to create a custom icon and as you say, run a script be it DOS or VB, and check for presence of keys and if not present load LDD.

    Like I mentioned before I am new to this aspect of programming, Lisp is as far as I have ventured so I am just searching for "possibilities"
     
    Rad_Cadder, Dec 28, 2004
    #12
  13. Rad_Cadder

    Rad_Cadder Guest

    Nathan,
    Thaks for the tip, I have seen previous posts that led me to believe this may be possible.

    Thanx
     
    Rad_Cadder, Dec 28, 2004
    #13
  14. Hi,

    The cure for this problem is training - and if necessary, managerial
    sanction.

    Programming requires that you are able to totally define your problem and
    logically create code to deal with the program.

    It has taken you several posts to totally clarify what your problem is, and
    you have not been able understand the advise already given.

    Your chances of creating a program to do what you want is almost zero unless
    you are prepared to devote considerable time and resources.

    --

    Regards,


    Laurie Comerford
    www.cadapps.com.au
     
    Laurie Comerford, Dec 28, 2004
    #14
  15. Rad_Cadder

    Rad_Cadder Guest

    Laurie,
    I would have to agree that training seems like the logical answer, the problem is "people make mistakes".
    The problem is our Tech's don't always use Autocad and spend the majority of their time utilizing LDD and yes they do forget to check if autocad is open prior to double clicking the LDD icon.
    As for the managerial sanction, I think given the circumstances that's a little over the top. How do you hold someone accountable for creating their own inconvenience?

    And although programming requires that you are able to define your problem and create code to deal with it, doesn't mean that everone is prepared or equipped with the knowledge on how to do so. Hence this forum and thousands of others just like it full of people asking for help and insight on what the best way to handle a given circumstance might be.

    And once again you may be right, because I have read several posts that implied that it very well may be possible and if I wasn't prepared to devote the time and resources to fix this problem, I would not have posted to begin with.

    Thanx - Rob
     
    Rad_Cadder, Dec 28, 2004
    #15
  16. Hi,

    OK. Given that, I have already provided the information you need to get
    started in my first two posts.


    --

    Regards,


    Laurie Comerford
    www.cadapps.com.au
     
    Laurie Comerford, Dec 29, 2004
    #16
  17. Rad_Cadder

    Ed Jobe Guest

    As I said before, its possible. Use the GetObject function. If it returns an
    AcadApplication object, pop a MsgBox: "A version of acad is already
    running.". If it doesn't then use shell to launch LDD. This can be done with
    either VB or VBScript.

    --
    ----
    Ed
    ----
    keys are present only while acad is open.
    you say, run a script be it DOS or VB, and check for presence of keys and if
    not present load LDD.
    far as I have ventured so I am just searching for "possibilities"
     
    Ed Jobe, Dec 29, 2004
    #17
  18. Rad_Cadder

    Ed Jobe Guest

    Before you go down that path, have you asked "Why does the acad profile get
    messed up?" I have Map and ADT on the same machine and don't have any
    problem having them both open at the same time. Perhaps its how you have
    your profiles set up. Do you start both using the same profile name?
     
    Ed Jobe, Dec 29, 2004
    #18
  19. Rad_Cadder

    Rad_Cadder Guest

    Ed,
    We run on a network with a laptop install and there are seperate profiles for autocad and LDD.

    This install method was supported by autodesk back with release 14 and the company has stuck with it for the simple fact that it is much easier to update 45+ pc's from one location.

    As to why the profile is overwriting, I'm all ears!
    If anyone knows I'm listening.

    Thanx - Rob
     
    Rad_Cadder, Dec 29, 2004
    #19
  20. Rob, maybe pointing the LDD shortcut to a VB app
    or VB scripting app that would check if ACAD is running
    could be a simple solution to your problem.
    This app would launch LDD if no ACAD is running.
     
    Jorge Jimenez, Jan 3, 2005
    #20
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.