Jump to content

AutoLayout with TB


Mystogan

Recommended Posts

Hi to all, 

 

Would like to ask your assistant regarding my desire outcome. I found this one in same forum. " 

"

This is almost close to what I am. Can someone edit the code.

The intent is something like this. On the attached file is the standard title block.

My desire intent would like this.

1. Create a series of layout depending on the user input, let say he/she wanted 10 or 20 layout it will create etc.,

But the succeeding layout will create a MVIEW(layer 0) on each created layout except for the XX-00 as the cover page that show the trade

and project name.

2. The name of layout will depend on user input like for example EC-00, then EC-01 then so on., It will also aligned with the SHXX tag value. Meaning 

the layout name is the same as SHXX value

3. On the attached file lsp will ask ask the user to input the attributed block tag "ELECTRICAL", "What is your trade/discipline" then the value will change base on 

user input. The same with the PROJECT TAG Value to display the project name.

 

 

Thank you in advance, 

TitleB.dwg

Link to comment
Share on other sites

A couple of examples, the 1st is walk along a pline and make layouts at scale. The second attached  is grid based but note rectangs can be rotated.

 

To answer your original question, do 20 layouts just use the layout command in a repeat loop. I just added the Mview to SHXX before copy much easier to just erase from 0 layout. 

(defun cplay ( / x num str)
(setq x 0)
(setq num (getint "\nHow many lyouts ? "))
(setq str (getstring "\Enter layout prefix eg EC "))
(repeat num
(command "layout" "C" "SHXX" (strcat str "-" (rtos x 2 0)))
(setq x (1+ x))
)
(princ)
)
(cplay)

If you want layouts to have a mv at chosen scale with a picked from model centre point can be done also.

 

image.png

Link to comment
Share on other sites

Hi Bigal,

 

Thank you, this is almost close.

How can we insert(chosen picked layout/scale at the model tab)  in the code those program?

It is still possible from the standard table block that has attributed tag can be deleted and created a new layout with new mview(deleted attributed tag of "ELECTRICAL" and p"PROJECT"?

 

Link to comment
Share on other sites

I have a couple of versions, where I worked we used 1 sheet size, but the mview was always at different scales. So it would be a case of just entering scale and say which title block. You need the titles to be in a dwg as layouts with a mview, so can copy from that dwg. 

 

What size sheet do you normally plot as the SHXX layout is an odd sheet size, need more info, we did A1 but normally plotted A3.

 

Any reason why your title block does not have all the other inputs as attributes ? eg Owner, Project Title etc. some extra 12 atts. Can take advantage of this and do some other enhancements. Can do the revs as a separate block also.

 

Re plotting yes once layouts are sorted can just run a lisp and a range of layouts can be plotted.

 

image.png.1eb43e4531349dd239375c2b63efacc4.png

Link to comment
Share on other sites

Hi Bigal

 

Thank you for your reply,

 

What size sheet do you normally plot as the SHXX layout is an odd sheet size, need more info, we did A1 but normally plotted A3

--It would be size A3, but sometimes they varied and depend on architect requested.

 

Any reason why your title block does not have all the other inputs as attributes ? eg Owner, Project Title etc. some extra 12 atts. Can take advantage of this and do some other enhancements. Can do the revs as a separate block also.

--Pls see revise TB DWG.. It is possible for LSP to rewrite those succeeding pages specially for the sheet content?

 

 

TitleB.dwg

Link to comment
Share on other sites

So what size is your title block in a paper sheet size ? You are using metric units ? So A1 A2 A3 etc. Need to know as a A1 is 894x594. You have 762 x 550, again odd size.

 

Link to comment
Share on other sites

Odd paper sizes - I think you'd have to add them as paper sizes for everyone who uses this LISP, I can't remember if it is possible via LISP to create custom paper sizes, and that makes it trickier. Certainly though if the papersize is set up and assigned a name they can be used in the same way as A1, A2 etc...

 

If you post what you call these odd paper sizes they can be used

 

I am lucky though that the company standards specify using An sized sheets - might be that your architects should accept standard paper sizes?

Link to comment
Share on other sites

Can be done but I would contact Architect and ask why that size,  is it a conversion to inches size ? Can you not convert to say a closer A1 size say 10mm all round inside. Can be used if you must.

 

image.png.02dfca0eadf3691a367dbcfc030a0033.png

 

 

Link to comment
Share on other sites

  • 3 weeks later...

Hi sir BIGAL,

 

For this scenario,

 

(defun cplay ( / x num str)
(setq x 0)
(setq num (getint "\nHow many lyouts ? "))
(setq str (getstring "\Enter layout prefix eg EC "))
(repeat num
(command "layout" "C" "SHXX" (strcat str "-" (rtos x 2 0)))
(setq x (1+ x))
)
(princ)
)
(cplay)

 

let's just forget the size of title block, let just say we focus on the renaming the sheet no.

Initially the value of attribute tag for title block is SHXX.

Now we going to aim for the alignment of layout tab name to sheet no.

I'm thinking using the command ctab but it makes me think the looping of each layout tab.

 

 

 

Edited by Mystogan
Link to comment
Share on other sites

Ok making the layouts is not a problem, choices , along pline or at point. Scale for layout is needed. Ok working out the model rectangs uses this, 

 


((= ntitle "A1_Landscape") (setq  Ht 541.0  wid 831.0 xpt 542.0  xwid 62.0  yht 32.0))
((= ntitle "A3_Landscape") (setq  ht 247.0 wid 400.0 xpt 200.0 xwid 41.0  yht 23.0))

 

So can add SHXXX if required, but I still think you should always use correct sheet sizes, I think the architect is shrinking the sheet to suit the size of the project not using a true sheet size then plots A3 as a FIT. So fills the mview not a good drafting practice. To get this affect would do a true A3 sheet then say draw a rectang of desired area. It would say 99% fill the mview.

Edited by BIGAL
Link to comment
Share on other sites

Thank you sir BIGAL,

 

In the case of the sheet no renaming scenario.

 

If we going to aligned it with the layout tab name. How can we can change the of SHXX in attribute tag(As titble block)  or the SHXX is in the Mtext format?

 

thank you in advance

Edited by Mystogan
Link to comment
Share on other sites

Yup we need to enter those need name. the most common would be 1:100 or 1:50 sometime 1:75 and A3 size landscape

Link to comment
Share on other sites

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