Jump to content

link between layout tab, file name and text string by lisp


Recommended Posts

Posted

Hi folks

Is there any way to link between layout tab,file name and text string by lisp?

Posted

To rename layout tab to file name:

 

(defun c:ltdn (/)
 (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))))
   )
 )
)

 

Do you need to insert file name somewhere in drawing in text format?

Posted

Mostafa more info please. 3 different variables add all together and label layout ?

Posted

Hi, all

I want linked between all of them when I change file name automatically change

layout tab and text string

Posted

Use field for text but for layout you should use lisp for that see the link in post #4

Posted
mdbdesign

I am waiting for your reply

 

Good, wait...

 

My suggestion is:

-use rtext (Diesel) for text string, it is old but working like a horse

$(substr,$(getvar,dwgname),1,$(-,$(strlen,$(getvar,dwgname)),4))

 

For changing layout tab need to create button with lisp codes or just type lisp command call and update it manually whenever change file name.

Unless somebody will write reactor to do it.

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...