Jump to content

about auto rename layout (By using attribute value)


Recommended Posts

Posted (edited)

hello everyone.

I found a lesson that automatically changes the name of layout through the attribute block value.
However, this lisp works only with the value written in paper space in layout.
Is it possible to make the drawing written in model space work in layout?

 

I attached the reference drawing that I want to fill out, and I will upload the link for the lesson.

Please reply.

Have a nice day.

 

lisp link

https://www.cadforum.cz/en/how-to-rename-layouts-by-a-specific-attribute-of-the-title-block-tip11780

 

reference dwg.

Layout.dwg

Edited by cadmaster1004
Posted (edited)

Damn must be getting old! that website is using like what font size 2 had to blow it up 180% just to read it.

 

Its possible just have to change the ssget in the vl-getattributevalue function. to use WP instead of X build coords off the viewport to select things in model space.

(setq ss (ssget "_X" (list (cons 0 "INSERT")(cons 2 _LOAblkname)(cons 410 lname))))
changes to
(setq ss (ssget "_WP" coords (list (cons 0 "INSERT")(cons 2 _LOAblkname))))

 

Example here

cen = center of view port

c40 = width of view port

c41 = height of view port

 

Edited by mhupp
  • Like 1
Posted

Thank you for your kindly help.

Actually, it's not going well, but I'll study it.

Posted (edited)

Sounds more like go into mspace pick attribute get Text string then rename layout. Use nentsel on attribute. A quick attempt.

 

(defun c:renlay ( / txt )
(command "mspace")
(setq txt (cdr (assoc 1 (entget (car (nentsel "\nPick attribute text"))))))
(command "layout" "R" (getvar 'ctab) txt)
(princ)
)
(c:renlay)

Did not bother to work out what is going on with test dwg.

Edited by BIGAL

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