muck Posted April 6, 2010 Posted April 6, 2010 Is there a way to put the drawing name in the first paper space layout tab using VBA? Thank you, Quote
Lee Mac Posted April 6, 2010 Posted April 6, 2010 I'm pretty bad at VBA but perhaps? Dim dwg As String Dim lay As ACADLayout dwg = ThisDrawing.GetVariable("DWGNAME") lay = ThisDrawing.Layouts.Item("Layout1") lay.name = dwg Quote
alanjt Posted April 12, 2010 Posted April 12, 2010 Lee, what about simple lisp for it? (defun c:test (/) (or *AcadDoc* (setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object)))) (vlax-for l (vla-get-layouts *AcadDoc*) (if (eq 1 (vla-get-taborder l)) (vl-catch-all-apply (function vla-put-name) (list l (vl-filename-base (getvar 'dwgname)))) ) ) ) Quote
mdbdesign Posted April 12, 2010 Posted April 12, 2010 Alan, I don't know what happen but it is not working. I just updated my Autocad version (2010), wonder if it is version related. Command: (LOAD "test.lsp") TEST Command: test Unknown command "TEST". Press F1 for help. Quote
alanjt Posted April 12, 2010 Posted April 12, 2010 Alan, I don't know what happen but it is not working.I just updated my Autocad version (2010), wonder if it is version related. Command: (LOAD "test.lsp") TEST Command: test Unknown command "TEST". Press F1 for help. I had it created as a subroutine, which you would call with (test). However, I've changed it above. Try it now. Quote
mdbdesign Posted April 12, 2010 Posted April 12, 2010 My mistake, I didn't look at it-just loaded. Sorry, it work now. Thank you. Quote
alanjt Posted April 12, 2010 Posted April 12, 2010 My mistake, I didn't look at it-just loaded. Sorry, it work now. Thank you. No problem. 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.