Create Layouts from each Polylines (Selected Rectangles in Model Space)

Create Layouts from each Polylines (Selected Rectangles in Model Space)

majdoviyed25
Participant Participant
583 Views
7 Replies
Message 1 of 8

Create Layouts from each Polylines (Selected Rectangles in Model Space)

majdoviyed25
Participant
Participant

Hello

 After several attempts to create a LISP routine with ChatGPT, I keep getting the following error every time: TLC: bad argument type: stringp nil."

 

An AutoLISP routine for AutoCAD that creates a new separate Layout for each selected polyline (rectangle) in Model Space, and places a Layout Viewport in each Layout, automatically adjusted to display the entire corresponding rectangle.

Dialog Box
1 Setting
Paper Size:

A3 / A4 / etc.

Orientation:
Landscape
Portrait

2 Scale:
(●) Fit to paper The viewport is automatically zoomed to fit the corresponding rectangle completely within the printable area.

( ) Custom [10] (Model Space unit 1m= 1 cm. Therefore, a scale of 1:100 corresponds correctly to a CustomScale = 10 in the viewport.)

3 Layout Name:
( ) Rectangle text / number
If a TEXT/MTEXT object is located inside the rectangle, its content can be used as the Layout name.
(●) Automatic
Otherwise, use automatic naming such as: TLC-01, TLC-02, TLC-03, etc.

4 Sort
( ) Normal ( ) Left-> Right ( ) top-> Bottom

5 Select Method
( ) Layer [ 0 ] (layers list)
( ) Pick ( select rectangles from model )     PICK

0 Likes
Accepted solutions (1)
584 Views
7 Replies
Replies (7)
Message 2 of 8

paullimapa
Mentor
Mentor

Go back to ChatGPT and have them correct this step:

Once done_dialog is executed, the get_tile function no longer applies

So run all the get_tile functions before done_dialog is executed

paullimapa_0-1788456557481.png

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 8

Sea-Haven
Mentor
Mentor

Happy to discuss this further with you, have 2 programs,

 

One allows you to walk along a line and make rectangs in model, the rectangs will twist to follow the line , you can move, delete or rotate the rectangs then make layouts. The second uses a pick point to locate the rectangs. Again delete, rotate and move. In both can repeat at any time.

 

You choose title block and scale.

 

layout 1.png

 

 

0 Likes
Message 4 of 8

majdoviyed25
Participant
Participant
Accepted solution

Here is the code after correction. If someone could develop it further (improve it, optimize it, or add more features), that would be great.

Thank you very much in advance for your help!

0 Likes
Message 5 of 8

pendean
Community Legend
Community Legend
0 Likes
Message 6 of 8

Sea-Haven
Mentor
Mentor

@majdoviyed25 you may have missed the step about I make the rectangs in model to correct scale, rotations and location, based on which title block you are proposeing to use. Yes part 2 is just "Make layouts" it reads the rectangs and makes the layouts. Just watch them being made. 

 

I took the select variables as a first step not a "After step" The end user just watches the rectangs being made as required. I have made like 60 rectangs in one go during testing. Then 60 layouts were made.

 

SeaHaven_0-1788586463055.png

 

 

Did you look at video ?

0 Likes
Message 7 of 8

lauri_barnhart
Autodesk
Autodesk

Welcome to the community, @majdoviyed25.

 

Checking in to see if you were able to resolve your question. If you did and any of the replies above helped, please consider clicking on the 'Accept Solution' button on the post(s) that helped.

 

Thanks,

Let us know how we did on Trustpilot.


Lauri | Community Manager

0 Likes
Message 8 of 8

DAVID20102012168
Contributor
Contributor

This updated version is based on ChatGPT.

0 Likes