See the top rated post in this thread. Click here

Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 31

Thread: Programmatically Assigning Support File Search Paths

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

    Default Re: Programmatically Assigning Support File Search Paths

    You just edit the paths.
    For example, "\\\\server\\cad\\......" might become "c:\\i-cad\\...."
    R.K. McSwain | CAD Panacea |

  2. #12
    I could stop if I wanted to CEHill's Avatar
    Join Date
    2006-05
    Location
    TN
    Posts
    327
    Login to Give a bone
    0

    Arrow Re: Programmatically Assigning Support File Search Paths

    Mr. McSwain...

    Before testing begins, I understand what most of the code does.
    Being one who has little experience in LISP to this point, there is one EXCEPTION!

    That is in the code line (setq sfsp.

    How does AutoCAD use the above line?

    I am including the code snippet given in addition to a code snippet given by another (with a reference to my hard drive-based, support file search path).
    The code resides in a custom ACADDOC.LSP file that is otherwise populated only with AUTOLOAD statements for LISP routines.
    I am trying to figure out if the code line (setq sfsp fits into the support file search path definition code in this ACADDOC.LSP file:

    Can you help?


    Code:
    				;
    					;     ********************* Define AutoCAD Support File Paths *********************
    					;
    ;;; This sets a reference to the install path of your product
    (setq acadloc (vl-registry-read
    		(strcat "HKEY_LOCAL_MACHINE\\" (vlax-product-key))
    		"AcadLocation"
    	      )
    )
    ;;; This sets the root folder for your own customizations
    (setq myCAD
           "C:\\CAD\\I-CAD\\"
    )
    ;;; This sets a reference to the files portion of the acad preferences
    (setq *files* (vla-get-files
    		(vla-get-preferences
    		  (vlax-get-acad-object)
    		)
    	      )
    )
    ;;; This builds the string of support file search paths
    (setq sfsp
           (strcat
    	 myCAD
    	 ";"
    	 myCAD
    	 "LISP;"
    	 acadloc
    	 "\\acadm;"
    	 acadloc
    	 "\\acadm\\g3v;"
    	 acadloc
    	 "\\acadm\\gen;"
    	 acadloc
    	 "\\acadm\\sys;"
    	 acadloc
    	 "\\help;"
    	 acadloc
    	 ";"
    	 "C:\\program files\\common files\\autodesk shared;"
    	 (getvar "RoamableRootPrefix")
    	 "Support;"
    	 acadloc
    	 "\\fonts;"
    	 acadloc
    	 "\\support;"
    	 acadloc
    	 "\\acadm\\migration;"
    	 acadloc
    	 "\\express;"
    	 acadloc
    	 "\\sample\\mechanical\\environments;"
    	 (getvar "RoamableRootPrefix")
    	 "acadm;"
           )
    )
    ;;; This actually applies the above string to the current session of AutoCAD.
    (vla-put-SupportPath *files* sfsp)
    (vla-put-TemplateDwgPath *files* (strcat myCAD "TEMPLATES"))
    (vla-put-AutoSavePath *files* (strcat myCAD "TEMP"))
    (vla-put-PrinterConfigPath *files* (strcat myCAD "PLOT"))
    (vla-put-PrinterDescPath *files* (strcat myCAD "PLOT"))
    (vla-put-PrinterStyleSheetPath *files* (strcat myCAD "PLOT"))
    (vla-put-CustomIconPath *files* (strcat myCAD "ICONS"))
    (vla-put-LogFilePath *files* (strcat myCAD "LOG"))
    (vla-put-TempFilePath *files* (strcat myCAD "TEMP"))
    (vla-put-TempXrefPath *files* (strcat myCAD "TEMP"))
    					;
    					;					;
    Last edited by chillme1; 2013-06-13 at 07:15 PM.
    Yours,

    Clint
    Hill

    ------------------
    CAD Systems Operation and Management
    Chemical Plant Process + Mechanical Design Focus Areas

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

    Default Re: Programmatically Assigning Support File Search Paths

    "(setq sfsp" --- is just setting the variable "sfsp" to the string we are going to pass to AutoCAD, later on, here > (vla-put-SupportPath *files* sfsp)
    Does that help?
    R.K. McSwain | CAD Panacea |

  4. #14
    I could stop if I wanted to CEHill's Avatar
    Join Date
    2006-05
    Location
    TN
    Posts
    327
    Login to Give a bone
    1

    Default Re: Programmatically Assigning Support File Search Paths

    It surely does. I will eventually learn LISP piece by piece - simpler with the good guidance from nice folks like you.
    With a little massaging and help in resolving a syntax error from my AutoCAD colleagues on the WAUN's LISP E-MAIL GROUP (Join the WAUN at www.waun.org . It's free!), the routine is running on all cylinders.

    Here is what works for me (feel free to make suggestions or comments for our LISP edification):

    Code:
    ;; ACADDOC.LSP
    ;; Purpose: Load LISP Routines and Support File Search Paths at Startup
    ;; Created on 6/28/2010 by Clint Hill
    ;; Modified on 10/20/2010 by Clint Hill - Added autoload statements (per Steven LaKose)
    ;; Modified on 01/08/2013 by Clint Hill - Added LISP Routine - RenAttr
    ;; Modified on 04/29/2013 by Clint Hill - Rem'd Commented Out Load Statements Replaced by AutoLoad Statements
    ;; Modified on 06/13/2013 by Clint Hill - Added Support File Search Path Code (per Multiple Sources)
    ;;
    ;;
    (vl-load-com)
    (autoload "addstr" '("addstr"))
    (autoload "alignit" '("ali"))
    (autoload "arrow" '("aaa"))
    (autoload "ats" '("ats"))
    (autoload "attdef2text" '("attd"))
    (load "attinc")
    (autoload "AttModSuiteV1-1" '("roatt"))
    (load "backgroundchanger")
    (autoload "BFindV2-0" '("BFind"))
    (autoload "BlockRename" '("BlockRename"))
    (autoload "BreakObjects21" '("MMB"))
    (autoload "BTC" '("BTC"))
    (autoload "CA" '("CA"))
    (autoload "CENDIM" '("CENDIM"))
    ;(load "ChBlkTxt")
    (autoload "ChBtextA" '("CBA"))
    (load "ctr")
    (autoload "CSViewport" '("CCVV"))
    (load "Ctxt")
    (autoload "CurveAlignedTextV1-1" '("CAT"))
    (autoload "DELPAGESETUPS" '("delpagesetups"))
    (autoload "dimse" '("dimse"))
    (autoload "dimlinechange" '("DLC"))
    (autoload "DSS" '("DSS"))
    (autoload "DynOff V2-1" '("DynOff"))
    (autoload "EASD" '("EASD"))
    (load "ecd")
    (autoload "ECD" '("ECD"))
    (autoload "fast" '("FAST"))
    (autoload "fx" '("FX"))
    (load "gauges")
    (autoload "hose" '("HOSE"))
    (autoload "howfar" '("HH"))
    (autoload "HSS" '("HSS"))
    (autoload "I-Arial_N" '("III"))
    (autoload "isodim" '("IOD"))
    (load "killdots")
    (autoload "layer_creator" '("LC"))
    (autoload "LCK" '("LCK"))
    (autoload "linklists" '("LLL"))
    (autoload "LST" '("LST"))
    (autoload "LZE" '("LZE"))
    (autoload "MacAtt" '("MacAtt"))
    (autoload "NumIncV3-1" '("NNN"))
    (autoload "on" '("on"))
    (autoload "quickgroup" '("QQ"))
    (autoload "quickungroup" '("QQW"))
    (autoload "patt" '("patt"))
    (autoload "psfixtxt" '("PSFIXTXT"))
    (load "RenAttrib")
    (load "rotate-text")
    (autoload "S-Deck" '("SDK"))
    (autoload "sent" '("SENT"))
    (autoload "snake" '("SNAKE"))
    (autoload "StealV1-8" '("StealV1-8"))
    (autoload "stl" '("STL"))
    (load "TextFunctions")
    (autoload "tchange" '("TCH"))
    (autoload "transfer" '("TX"))
    (load "txtmrg")
    (load "txtrot")
    (autoload "UPA" '("UPA"))
    (load "vpmove")
    (autoload "vp2ms" '("VP2MS"))
    (autoload "vp-outline" '("VV"))
    (autoload "wd" '("WD"))
    (autoload "ZZ" '("ZZ"))
    (princ "\n\"Acaddoc.lsp\" loaded.")
    (princ)
    ;
    ; This sets a reference to the install path of your product
    (setq acadloc
       (vl-registry-read
          (strcat "HKEY_LOCAL_MACHINE\\" (vlax-product-key))
       "ACADLOCATION")
    )
    ; This sets a reference to the files portion of the acad preferences
    (setq *files* (vla-get-files (vla-get-preferences (vlax-get-acad-object))
    ))
    ;;; This sets the root folder for your own customizations
    (setq myCAD
           "C:\\I-CAD\\")
    ; This builds the string of support file search paths
    (setq sfsp
           (strcat
      myCAD
      ";"
      myCAD
      "I-LISP;"
      "C:\\I-CADPGP;"
      (getvar "ROAMABLEROOTPREFIX") "SUPPORT;"
      acadloc "\\SUPPORT;"
      acadloc "\\HELP;"
      acadloc "\\EXPRESS;"
      (getvar "LOCALROOTPREFIX") "SUPPORT;"
      "C:\\Program Files (x86)\\ManuSoft\\SuperPurge\\;"
      "C:\\Program Files (x86)\\DotSoft\\ToolPac\\;"
      "C:\\Program Files (x86)\\DotSoft\\XL2CAD\\"
      ))
    ; This actually applies the above string to the current session of AutoCAD.
    (vla-put-SupportPath *files* sfsp)
    ; Here are some examples of setting other things
    ; Set the default template (QNEW) name
    ;(vla-put-QNewTemplateFile *files* "C:\\I-CAD\\I-TEMPLATES\\.dwt") 
    ; Set the printer (PC3) support file path
    (vla-put-PrinterConfigPath *files* (strcat myCAD "I-PLOT"))
    ; Set the printer plot style support file path
    (vla-put-PrinterStyleSheetPath *files* (strcat myCAD "I-PLOT"))
    ; Set the printer (PMP) support file path
    (vla-put-PrinterDescPath *files* (strcat myCAD "I-PLOT"))
    ; Set the template support file path
    (vla-put-TemplateDwgPath *files* (strcat myCAD "I-TEMPLATES"))
    ; Set the autosave support file path      
    (vla-put-AutoSavePath *files* (strcat myCAD "I-TEMP"))
    ; Set the custom icon support file path
    (vla-put-CustomIconPath *files* (strcat myCAD "I-ICONS"))
    ; Set the log support file path
    (vla-put-LogFilePath *files* (strcat myCAD "I-LOG"))
    ; Set the temporary file support file path
    (vla-put-TempFilePath *files* (strcat myCAD "I-TEMP"))
    ; Set the temporary XREF file support file path
    (vla-put-TempXrefPath *files* (strcat myCAD "I-TEMP"))
    ; Release the object
    (vlax-release-object *files*)
    Yours,

    Clint
    Hill

    ------------------
    CAD Systems Operation and Management
    Chemical Plant Process + Mechanical Design Focus Areas

  5. #15
    I could stop if I wanted to CEHill's Avatar
    Join Date
    2006-05
    Location
    TN
    Posts
    327
    Login to Give a bone
    0

    Default Re: Programmatically Assigning Support File Search Paths

    *** HELP ***
    The routine is working TOO WELL!!!!

    ITEM 1: The code does not include the support paths nor code that makes up the default - and AutoCAD Mechanical's (2012) own - ACADDOC.LSP
    AutoCAD Mechanical bombs while AutoCAD vanilla works well/as expected.
    Background: I have combined AUTOLOAD statements for load LISP routines and this Mecahnical ACADDOC.LSP file successfully in the past. although, I have not tried adding the file search support path code.

    ITEM 2: An aftermarket add-on software, CADWorx, includes four products that all have their own unique startup, AutoCAD Profile and Support File (especially their ARX files) to account for and now in a desktop icon. Each of their unique Support File Paths (including their ARX) are not included in the just posted code.

    QUESTION

    Must I have various ACADDOC.LSP files to account for both Item 1 & 2?
    Yours,

    Clint
    Hill

    ------------------
    CAD Systems Operation and Management
    Chemical Plant Process + Mechanical Design Focus Areas

  6. #16
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,100
    Login to Give a bone
    0

    Default Re: Programmatically Assigning Support File Search Paths

    You could have one with multiple test conditions depending on what you are loading. Or you could add a specific support folder to the top of the list containing your profile specific acad.lsp and acaddoc.lsp as well as the other specific files.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  7. #17
    I could stop if I wanted to CEHill's Avatar
    Join Date
    2006-05
    Location
    TN
    Posts
    327
    Login to Give a bone
    0

    Default Re: Programmatically Assigning Support File Search Paths

    Quote Originally Posted by Opie View Post
    You could have one with multiple test conditions depending on what you are loading. Or you could add a specific support folder to the top of the list containing your profile specific acad.lsp and acaddoc.lsp as well as the other specific files.
    Hello Opie,

    Could you provide a beginner level code snippet required for multiple test conditions?
    For example, I will use the following flavors of AutoCAD:

    1. AutoCAD Vanilla
    2. AutoCAD Mechanical
    3. CADWorx Plant
    4. CADWorx P&ID
    5. CADWorx Equipment
    6. CADWorx IP


    About the second option that you mentioned:
    The only variation in my ACADDOC.LSP and ACAD.LSP files is between the AutoCAD Vanilla (used with CADWorx flavors as well ) and the vertical; AutoCAD Mechanical, having its own code in an ACADDOC.LSP file.
    Could you explain how this folder structure defines what is and what is not loaded and an example?

    I do not want fries with that...
    Yours,

    Clint
    Hill

    ------------------
    CAD Systems Operation and Management
    Chemical Plant Process + Mechanical Design Focus Areas

  8. #18
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,100
    Login to Give a bone
    0

    Default Re: Programmatically Assigning Support File Search Paths

    I cannot provide workable code for you to test as I do not use the same software. You will need to determine what makes each program distinguishable from the others through code and make your own tests.
    Code:
    (cond ((if this is AutoCAD, then use this branch)
           (code for AutoCAD starts here)
           (another bit of AutoCAD code)
           ); End AutoCAD code
          ((if thie is AutoCAD Mechanical, then use this branch)
           (code for AutoCAD Mechanical starts here)
           (another bit of AutoCAD Mechanical code)
           ); End AutoCAD Mechanical code
          ((if thie is CADWorx Plant, then use this branch)
           (code for CADWorx Plant starts here)
           (another bit of CADWorx Plant code)
           ); End CADWorx Plant code
    )
    You could look through the custom code for each flavor to see what makes them unique.

    HTH
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  9. #19
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Programmatically Assigning Support File Search Paths

    Quote Originally Posted by chillme1 View Post
    Hello Opie,

    Could you provide a beginner level code snippet required for multiple test conditions?
    For example, I will use the following flavors of AutoCAD:

    1. AutoCAD Vanilla
    2. AutoCAD Mechanical
    3. CADWorx Plant
    4. CADWorx P&ID
    5. CADWorx Equipment
    6. CADWorx IP


    About the second option that you mentioned:
    The only variation in my ACADDOC.LSP and ACAD.LSP files is between the AutoCAD Vanilla (used with CADWorx flavors as well ) and the vertical; AutoCAD Mechanical, having its own code in an ACADDOC.LSP file.
    Could you explain how this folder structure defines what is and what is not loaded and an example?

    I do not want fries with that...
    I personally use a version dependent Acad.lsp, and AcadDoc.lsp for each version year, and vertical installed... I just find it so much easier to maintain, which in turn saves me time (and money).

    However, if you wanted to account for each in one CONDitional statement, you might try something like this:
    Code:
    (cond ((= (setq profileName (strcase (getvar 'cprofile)))
              "AUTOCAD VANILLA"
           )
           ;; setq sfsp for "AUTOCAD VANILLA"
          )
          ((= profileName "AUTOCAD MECHANICAL")
           ;; setq sfsp for "AUTOCAD MECHANICAL"
           )
          ((= profileName "CADWORX PLANT")
           ;; setq sfsp for "CADWORX PLANT"
           )
          ((= profileName "CADWORX P&ID")
           ;; setq sfsp for "CADWORX P&ID"
           )
          ((= profileName "CADWORX EQUIPMENT")
           ;; setq sfsp for "CADWORX EQUIPMENT"
           )
          ((= profileName "CADWORX IP")
           ;; setq sfsp for "CADWORX IP"
           )
    )
    [Edit] - Opie beat me to it. *kicks dirt*
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  10. #20
    I could stop if I wanted to CEHill's Avatar
    Join Date
    2006-05
    Location
    TN
    Posts
    327
    Login to Give a bone
    0

    Default Re: Programmatically Assigning Support File Search Paths

    I thank you for taking time and must determine the exact differences.
    Initially, they appear to be their unique AutoCAD Profiles.
    These profiles are called out in the desktop icon's field with a /P

    Also, I am going to test putting a second copy of my ACADDOC.LSP file in a separate directory and with any additional code required by that particular AutoCAD flavor.
    Yours,

    Clint
    Hill

    ------------------
    CAD Systems Operation and Management
    Chemical Plant Process + Mechanical Design Focus Areas

Page 2 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Trouble with Support File Search Paths
    By JGARZA0422 in forum AutoLISP
    Replies: 1
    Last Post: 2013-07-21, 03:45 PM
  2. 2012: Disappearing Support File Search Paths
    By Darren Allen in forum AutoCAD Customization
    Replies: 30
    Last Post: 2013-04-03, 04:11 PM
  3. 2011: Windows Env Vars in Support File Search Paths
    By mcnamac in forum ACA General
    Replies: 0
    Last Post: 2011-03-03, 05:54 PM
  4. Easy way to set-up Support File Search Paths
    By joeswantek in forum AutoCAD Customization
    Replies: 3
    Last Post: 2006-07-11, 08:21 PM

Posting Permissions

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