Jump to content

; error: no function definition: VLAX-GET-ACAD-OBJECT


Recommended Posts

Posted

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.

Posted

Add (vl-load-com) after (defun c:rname ( / lay layo dwgn)

  • 2 weeks later...
Posted

it works fine, thankd allanjt

Posted
it works fine, thankd allanjt

Good deal. :)

You're welcome.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...