help with auto creation multi layouts in paperspace

help with auto creation multi layouts in paperspace

Anonymous
Not applicable
1,786 Views
10 Replies
Message 1 of 11

help with auto creation multi layouts in paperspace

Anonymous
Not applicable

Hello Everyone,

I have attached a sample DWG of my project that have more than 250 layouts, however I have searched and found there's only programs to do that and is not for free, however I was wondering if there's such a thing to create a multi layouts with same text or number that is showing in model space also to be scaled 1:50 or 1:4 depends on my DWG and the layouts in paper space to be fit in model space as well so I don't need to drag each view-ports to fit my model to it.

please help me with this it'll save lots of time to me, thanks in advance.

 

0 Likes
Accepted solutions (2)
1,787 Views
10 Replies
Replies (10)
Message 2 of 11

dbhunia
Advisor
Advisor

Create a sample layout (that name must not be present in your layout name list which you want to create) with all the attachments you want to keep in each layout and place a viewport (at the position you want) into the Layout (like i placed a vewport in your sample drawing and renamed the layout lab).

 

Place all the Layout boundaries (Rectangles) and the Text/Mtext (Layout Names) in a single Layer(do not keep anything in this layer and dont keep any extra Rectangle/Text). And try to keep the Layout Names near to the respective Layout boundaries (Rectangles)....... As the way in your attached sample drawing...

 

When you run the code it will ask you "Select Text/Rectangle for Layer", then select the layer containing the Layout boundaries (Rectangles) and the Text/Mtext (Layout Names).......It will create all the layouts in the sequence as you placed the Text/Mtext(Layout Names) in the model starting from Left to Right....(with the standard Viewport scale 1:50)


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 3 of 11

Anonymous
Not applicable

@dbhunia I did run the code, but when I select the mtext or the rectangle, it says "Assignment to protected symbol:T Enter break loop?" in a box with two options which is yes and no, please advise and if you could create a short video or photos to make it easier to me. thank you

0 Likes
Message 4 of 11

dbhunia
Advisor
Advisor

Can you post the drawing in Autocad 2007 format ...

 

Check once with the attached drawing. .... in my last post ....in that drawing only I had renamed your layout tab....which one you posted previously ....


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 5 of 11

Anonymous
Not applicable

I've attached the drawings in 2007 version, I've tried your code on you dwg but still got same issue.

0 Likes
Message 6 of 11

dbhunia
Advisor
Advisor
Accepted solution

First thing

In this drawing there has not any "viewport" in any one of the Layouts (Code do not creates any viewport).

 

Second Thing

There is a Layout already present by the name which you are going to create (Layout) again....

Capture.PNG

 

Either remove those duplicate Layout Tabs or the name from Layout Tab name list.....

 

Make a "viewport" in a Layout Tab and keep it active while run the code.....(I suggest to create a dummy tab because at last after creating (means after copying the active tab) the tabs code will remove that active tab).... Like I have created a "viewport" (with arbitrary Scale) in the Layout Tab "WWE-01 (6)" and placed some arbitrary  rectangles ........ and used the lisp (by keeping the Layout Tab "WWE-01 (6)" active), as a result all the Layout Tabs has created and the Layout Tab "WWE-01 (6)" has been removed......

 

Follow this as well as all the steps as described in my previous post....... you should get result.......(as it is tested in AutoCAD 2018, 2017 and 2007)......

 

see the attached drawings before and after running the code.......there is no more thing to say......

 

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 7 of 11

Anonymous
Not applicable

@dbhunia that's worked perfectly, thank you so much, just one last question, sometimes I need the scale to be 1:4 what should I do, does the same code work for that scale ?

0 Likes
Message 8 of 11

dbhunia
Advisor
Advisor

Check the code...... for this line....

 

.............................
(vla-put-customscale (vlax-ename->vla-object (ssname SS 0)) (/ 1 50.0));;for 1:4 scale change "50.0" into "4.0"
.............................

It can be done by user input selection (Now it is hard coded)..... for that 2-3 lines has to be added..... if you need that tomorrow i shall give you ...... 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 9 of 11

Anonymous
Not applicable

ok I will wait until tomorrow to get the code for the scale of 1:4 or if there's a code that I can easily change the scale of it, thank you so much I appreciate your help.

0 Likes
Message 10 of 11

dbhunia
Advisor
Advisor
Accepted solution

Try This.....

 

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 11 of 11

Anonymous
Not applicable

@dbhunia thank you so much, this code worked perfectly with two type of scale, you have saved me lots of time. thank you again 🙂

0 Likes