AutoCAD 2010/2011/2012 DWG Format
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Lisp Routine fix for CTB files
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
We work with a large number of CTB files, or at least we used to. Trying to streamline the problem. But, as a result of the way things used to be done, we have CTB files for drawings located in the folder of the drawing. Until now, this lisp routine, added to the end of the acad.lsp file, worked just fine for repathing the location autocad looks for the ctb. On my new machine, Windows 7, 64 bit with 2012, it will not work. Any ideas?
here's the lisp routine we use:
(defun C:GC ()
(setq printerstylesheetdir (getvar "dwgprefix"))
acadLocation (vl-registry-read (strcat "HKEY_LOCAL_MACHINE\\"
(vlax-product-key)) "AcadLocation")
(setenv "PrinterStyleSheetDir" printerstylesheetdir)
(princ)
)
Here's the error i get now...
Command: GC
no function definition: VLAX-PRODUCT-KEY :error#2*Cancel*
Help!
Thanks!
Shaun
Re: Lisp Routine fix for CTB files
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
hi,
here is a correction to your lisp function
(defun C:GC ()
(setq printerstylesheetdir (getvar "dwgprefix")
acadLocation (vl-registry-read
(strcat "HKEY_LOCAL_MACHINE\\" (vlax-product-key)) "AcadLocation"))
(setenv "PrinterStyleSheetDir" printerstylesheetdir)
(princ)
)
cheers
Moshe
Re: Lisp Routine fix for CTB files
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Odds are, you are missing a call to (vl-load-com) in your new system. You should also verify that registry path - it might be different for 64 bit applications. Also, there is a LISP function (gc) which you might end up conflicting with if not careful with the C: prefix. Give it a long descriptive name and then use the PGP to shorten it up to GC or whatever works for you.
If you are going to fly by the seat of your pants, expect friction burns.
Adopt. Adapt. Overcome. Or be overcome.

Re: Lisp Routine fix for CTB files
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Moshe-A,
Thanks but no cigar. Same error.
Shaun
Re: Lisp Routine fix for CTB files
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
dgorsman,
thanks. I changed the "defun" to getctb and will change the quickkey stroke. Not too sure how to look into my registry on 64 bit.
