+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 18 of 18
  1. #11
    Luminous Being
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    5,454

    Default

    Registered forum members do not see this ad.

    We use this when making a new box but you could easily add in if statements etc

    Code:
    ; This sets a reference to the install path of your product
    ; the gets are their for info maybe other use
    (vl-load-com)
    ; make temp directory
    ;(vl-mkdir "c:\\ACADTEMP")
    (setq *files*  (vla-get-files  (vla-get-preferences (vlax-get-acad-object))))
    ; savepath
    ;(vla-get-AutoSavepath *files*)
    (vla-put-AutoSavepath *files* "C:\\ACADTemp")
    ; custom icons
    ;(vla-get-CustomIconPath *files*))
    (vla-put-CustomIconPath *files* "S:\\Autodesk\\ICONS")
    ; printers config
    ;(vla-get-PrinterConfigPath *files*)
    (vla-put-PrinterConfigPath *files* "S:\\AutoDESK\\Plotting\\Plot Styles 2011")
    ; printers style sheet
    ;(vla-get-PrinterStyleSheetPath *files*)
    (vla-put-PrinterStyleSheetPath *files* "S:\\AutoDESK\\Plotting\\Plot Styles")
    ; printer drv's
    ;(vla-get-PrinterDescPath *files*)
    (vla-put-PrinterDescPath *files* "S:\\AutoDESK\\Plotting\\Drv")
    ; print spooler
    ;(vla-get-PrintSpoolerPath *files*)
    (vla-put-PrintSpoolerPath *files* "C:\\ACADTemp\\")
    ; template location
    ;(vla-get-QnewTemplateFile *files*)
    (vla-put-QnewTemplateFile *files* "S:\\Autodesk\\c3d Templates\\cogg.dwt")
    ;make new support paths exist + new
    (setq paths (vla-get-SupportPath *files*))
     
     (setq mygpaths 
      "S:\\autodesk\\supportfiles;
      S:\\autodesk\\lisp;
      S:\\autodesk\\fonts;
      S:\\autodesk\\hfs fonts;"
      )
    (setq newpath (strcat mygpaths paths))
    (vla-put-SupportPath *files* newpath)
    ; Tempdirectory 
    ;(vla-get-TempFilePath *files*))
    (vla-put-TempFilePath *files* "C:\\ACADTemp\\")
    ; template  path
    ;(vla-get-TemplateDwgPath *files*)
    (vla-put-TemplateDwgPath *files* "S:\\Autodesk\\c3d Templates")
    ; xref temp path
    ;(vla-get-TempXrefPath *files*))
    (vla-put-TempXrefPath *files* "C:\\ACADTemp\\")
    ; end use of *files*
    (vlax-release-object *files*)
    ; exit quitely
    (princ "All Done")
    A man who never made mistakes never made anything

  2. #12
    Senior Member
    Using
    AutoCAD 2011
    Join Date
    Jul 2009
    Location
    London, UK
    Posts
    159

    Default

    Looks good BIGAL. I think we achieve the same thing just with different ways of doing it I am mainly looking at remote administration and gaining feedback via the log file creator. Thanks.

  3. #13
    Luminous Being
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    5,454

    Default

    Not sure if you are aware but you can get login name from within Autocad (GETENV "username")you may be able to do 1 batch file that checks username and then copys correct profile as you start Autocad you would edit the command line in your Autocad desktop Icon.
    A man who never made mistakes never made anything

  4. #14
    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
    16,921

    Default

    Quote Originally Posted by BIGAL View Post
    Not sure if you are aware but you can get login name from within Autocad (GETENV "username")
    Also,
    Code:
    (getvar 'LOGINNAME)
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  5. #15
    Senior Member
    Using
    AutoCAD 2011
    Join Date
    Jul 2009
    Location
    London, UK
    Posts
    159

    Default

    I use this:
    Code:
    (getvar "LOGINNAME")
    What does the >> ' << mean? as per your example?
    Code:
    (getvar 'LOGINNAME)

  6. #16
    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
    16,921

    Default

    In LISP, the apostrophe means "do not evaluate this expression" and so any expression preceded with an apostrophe is taken at face-value.

    Now look at the documentation for the getvar function (equally for setvar):

    Quote Originally Posted by Visual LISP IDE Help Documentation
    getvar

    Retrieves the value of an AutoCAD system variable.

    (getvar varname)

    Arguments
    varname A string or symbol that names a system variable.

    Return Values
    The value of the system variable; otherwise nil, if varname is not a valid system variable.
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  7. #17
    Senior Member
    Using
    AutoCAD 2011
    Join Date
    Jul 2009
    Location
    London, UK
    Posts
    159

    Default

    Awesome I understand

  8. #18
    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
    16,921

    Default

    Registered forum members do not see this ad.

    Good stuff
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

Similar Threads

  1. Save to external text file
    By itaihor in forum The CUI, Hatches, Linetypes, Scripts & Macros
    Replies: 2
    Last Post: 28th Jun 2011, 03:56 am
  2. Get External Data From a File
    By The Buzzard in forum AutoLISP, Visual LISP & DCL
    Replies: 35
    Last Post: 17th May 2010, 01:27 pm
  3. write a list into text file and return back as list
    By muthu123 in forum AutoLISP, Visual LISP & DCL
    Replies: 14
    Last Post: 21st Dec 2009, 04:31 pm
  4. I need to send the output of the "LIST" command to a text file
    By evaristor in forum AutoCAD Beginners' Area
    Replies: 12
    Last Post: 1st Sep 2009, 06:57 pm
  5. Cannot insert any external file.
    By SMI in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 17th Aug 2005, 04:00 pm

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