Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: civil design

  1. #1
    100 Club
    Join Date
    2005-09
    Posts
    112
    Login to Give a bone
    0

    Default civil design

    Right now in our office we are using civil design. However we only have a certain number of licenses. The problem that we are running into is that people are leaving civil design open and not using it. Is there a way with VBA to write a macro to prompt the user every hour or so to see if they are still using this license and also have a auto-timeout that closes the license if they do not respond in five minutes. Just checking to see if this is possible with VBA and if not are there any suggestions out there. thank you

  2. #2
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: civil design

    Unlike most other network licensed products, CD and ARD run inside of AutoCAD itself so there is no way for the TIMEOUT feature of the NLM to know if these products are inactive or not.

    For ARD, the user can manually release the license by running the IUNLOAD command

    For CD, the user can manually release the license by running the UNLOADCD command

    I don't see why you couldn't write a routine that prompts the user every so often to release the license. If the user is done, or if the routine does not get a response in a certain amount of time - your routine could run the UNLOADCD command.
    R.K. McSwain | CAD Panacea |

  3. #3
    100 Club
    Join Date
    2005-09
    Posts
    112
    Login to Give a bone
    0

    Default Re: civil design

    This seems like it might be easier to write in lisp though I do not have much knowledge with VBA. Does anyone know if it is easier to write in VBA or lisp and if so then I will move this to the lisp forum.

  4. #4
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: civil design

    I would say this would be easier in VBA

    Here is a start. Note that the variable sd is hardcoded. You will have to figure out how to store a date/time and keep it updated based on whatever criteria you desire.

    This example is tied to the ERASE command. You could change this.

    Obviously, there is no error checking included in this either, like I said - just a start.


    Code:
    Private Sub AcadDocument_EndCommand(ByVal CommandName As String)
    Dim tmp, ret, ct
    ct = Now
    sd = CDate("12/28/2005 16:00:00")
    If CommandName = "ERASE" Then
        If ct > sd Then
            ret = MsgBox("Can we unload Civil Design now?", vbYesNo, "Title")
            If ret = 6 Then ThisDrawing.SendCommand "UnloadCD" & vbCr
        End If
    End If
    End Sub
    R.K. McSwain | CAD Panacea |

  5. #5
    100 Club
    Join Date
    2005-09
    Posts
    112
    Login to Give a bone
    0

    Default Re: civil design

    Thanks I'll have to look through my vba books here to find out how to code but hopefully that is a good start for me.

  6. #6
    100 Club
    Join Date
    2005-09
    Posts
    112
    Login to Give a bone
    0

    Default Re: civil design

    If anyone has anymore input on code please feel free to add. Thank you

  7. #7
    100 Club
    Join Date
    2000-11
    Location
    Adelaide, South Australia
    Posts
    116
    Login to Give a bone
    0

    Default Re: civil design

    See the section here on using windows timers http://www.cpearson.com/excel/ontime.htm.
    I would set a timer in the EndCommand event (kill the prev timer) this way it should fire as soon as no commands have completed in the specified time.

    Regards - Nathan

  8. #8
    100 Club
    Join Date
    2005-09
    Posts
    112
    Login to Give a bone
    0

    Default Re: civil design

    I have figured out what I want to do. I want a macro that will load civil design when it is ran. Also every hour have a window pop up asking you if you are still using civil design with a yes or no button. There will be a 5 minute timer that starts when this window pops up and if there is no input of yes or no then it will unload civil design. How hard would this be for someone who hasn't really done much in VBA?

  9. #9
    100 Club
    Join Date
    2005-09
    Posts
    112
    Login to Give a bone
    0

    Default Re: civil design

    Does anyone have any examples or other input for this. thank you

  10. #10
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: civil design

    Quote Originally Posted by chrisw.94380
    Does anyone have any examples or other input for this. thank you
    What's wrong with the code I posted together with the suggestions from ntaylor ?

    Are you wanting someone to put together a complete solution for you?
    R.K. McSwain | CAD Panacea |

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 0
    Last Post: 2014-11-30, 07:15 PM
  2. Land+Civil Design x Civil 3D
    By hitumkus in forum AutoCAD Civil 3D - General
    Replies: 10
    Last Post: 2007-06-03, 10:16 PM
  3. civil design
    By chrisw.94380 in forum AutoLISP
    Replies: 11
    Last Post: 2006-01-05, 03:42 PM
  4. Civil Design
    By dlamb.38062 in forum Civil 3D - Civil Design Companion - General
    Replies: 1
    Last Post: 2004-06-10, 07:07 AM

Posting Permissions

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