Lisp Routine fix for CTB files

Moderator: Carlson Support

Lisp Routine fix for CTB files

Postby monksjm » Thu Jan 19, 2012 6:34 pm

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!

Currently running Carlson Civil Suite 2012 on top of Civil 3D 2012, Windows 7, 64 bit.

Thanks!



Shaun
Shaun Morrison
Civil Designer/Drafter
Sevee & Maher Engineers, Inc.
Cumberland, Maine
monksjm
 
Posts: 110
Joined: Wed Jan 09, 2008 2:47 pm
Location: Cumberland, Maine

Postby site admin » Thu Jan 19, 2012 8:42 pm

Other than moving these files to the default location that the Acad is looking for them, I am at a loss.

You may want to post this in an Acad forum as well since others may be seeing the same thing on the newer acad.
Technical Support

Carlson Software
support@carlsonsw.com
606-564-5028
site admin
Site Admin
 
Posts: 332
Joined: Wed Nov 21, 2007 4:40 pm
Location: Maysville KY

Postby monksjm » Thu Jan 19, 2012 8:49 pm

I did. Like I said, it works fine on a 32 bit system with Acad 2009 and earlier...I'm assuming it has to do with the registry setup in Windows 7 on a 64-bit
Shaun Morrison
Civil Designer/Drafter
Sevee & Maher Engineers, Inc.
Cumberland, Maine
monksjm
 
Posts: 110
Joined: Wed Jan 09, 2008 2:47 pm
Location: Cumberland, Maine

Postby R Stillwell » Thu Jan 19, 2012 9:28 pm

This might make it work.

(defun C:GC ()
(VL-LOAD-COM)
(setq printerstylesheetdir (getvar "dwgprefix"))
acadLocation (vl-registry-read (strcat "HKEY_LOCAL_MACHINE\\"
(vlax-product-key)) "AcadLocation")
(setenv "PrinterStyleSheetDir" printerstylesheetdir)
(princ)
)

Honestly though the code you posted could accomplish what it is doing with one line of code.

(defun C:GC ()
(setenv "PrinterStyleSheetDir" (getvar "dwgprefix"))
)

Or the code you pasted is incomplete because the following piece of the code does nothing but return a string to the command line.

acadLocation (vl-registry-read (strcat "HKEY_LOCAL_MACHINE\\"
(vlax-product-key)) "AcadLocation")
R Stillwell
 
Posts: 50
Joined: Mon Aug 23, 2010 9:36 pm

thanks!

Postby monksjm » Fri Jan 20, 2012 12:22 pm

RStillwell

each one of you fixes did the trick. BIG THANK YOU!

Shaun
Shaun Morrison
Civil Designer/Drafter
Sevee & Maher Engineers, Inc.
Cumberland, Maine
monksjm
 
Posts: 110
Joined: Wed Jan 09, 2008 2:47 pm
Location: Cumberland, Maine

Postby mathewines » Wed Feb 29, 2012 7:30 am

You are missing a call to 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.
mathewines
 
Posts: 6
Joined: Sat Feb 25, 2012 8:17 am


Return to General Carlson Discussion

Who is online

Users browsing this forum: No registered users