Lisp Routine Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I am trying to write a lisp routine that will call up a certain .dws file for layer translation. I am not any good at lisp, and for a lot of the other ones, I have successfully used AI to generate my lisp, except for this one.
This is the first step in a conversion process that will start with the .dws file, then run some other lisp routines for specific blocks to specific layers (after the translate), then finish with a block replacement. Unfortunately, I cannot get 2024 Civil 3D to run the .dws file from the command line to load a predefined file. It does not seem that -laytrans, or acet-laytrans works when i try it manually. Here is the lisp routine I have.
Oh, and does anyone know if I replace my username (cdavis) with %username% will work for deployment across my company? Everyone will have the same path, except for the username.
LISP:
(defun c:CTA ( / standardsFile )
;; Path to your DWS file
(setq standardsFile "C:\\Users\\cdavis\\DC\\ACCDocs\\MarkThomas\\CAD-Support\\Project Files\\Survey\\Layer Converters\\Caltrans\\MT to CT Aerial Lidar.dws")
;; Make sure file exists before running
(if (findfile standardsFile)
(progn
(princ "\nRunning Layer Translator using standards file...")
;; Run Layer Translator in command-line mode
;; "L" = Load standards file
;; "T" = Translate
;; "Y" = Yes, apply translation
(command ".acet-laytrans"
"L" standardsFile
"" ;; Finish loading
"T"
"Y"
"" ;; Finish command
)
(princ "\nLayer translation complete.")
)
(princ (strcat "\nCould not find standards file: " standardsFile))
)
(princ)
)