The Courage Dog Posted March 16, 2010 Posted March 16, 2010 HI, i'm trying to load simple routine to rename a layout to match the sheet drawing filename unfortunately it does not work properly, it says: error: no function definition: VLAX-GET-ACAD-OBJECT this is the lisp. (defun c:rname ( / lay layo dwgn) (setq layo (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))) (if (= (vla-get-name (setq lay (vla-item layo 0))) "Model") (setq lay (vla-item layo 1))) (vla-put-name lay (substr (setq dwgn (getvar "dwgname")) 1 (- (strlen dwgn) 4))) ) i used to use it in 2007 it works fine but not in 2008 & 2010 version of autocad. Quote
alanjt Posted March 16, 2010 Posted March 16, 2010 Add (vl-load-com) after (defun c:rname ( / lay layo dwgn) Quote
The Courage Dog Posted March 26, 2010 Author Posted March 26, 2010 it works fine, thankd allanjt Quote
alanjt Posted March 26, 2010 Posted March 26, 2010 it works fine, thankd allanjt Good deal. You're welcome. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.