Create multiple layouts from polylines, and their viewports (not working :'( )

Create multiple layouts from polylines, and their viewports (not working :'( )

Anonymous
Not applicable
2,287 Views
11 Replies
Message 1 of 12

Create multiple layouts from polylines, and their viewports (not working :'( )

Anonymous
Not applicable

Hi people, im writing a lisp that takes all rectangles of certain layer in a drawing and creates a layout for each of them. Its working really slow (because of the regens every time i swap tabs, i think, drawing is large and notebook has 7-8 years old) but it only makes 5 layouts and then dies. Error message is "repeated key", so i think is a VisualLisp issue, but i dont master it and cant find a solution. Can any of you give me a hand? I also accept anything that makes it a better code (and/or me a better coder hehe)

0 Likes
2,288 Views
11 Replies
Replies (11)
Message 2 of 12

hencoop
Advisor
Advisor

In your lisp:

(VLA-REGEN acdoc ACACTIVEVIEWPORT)

This will regen your drawing every time it is called.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes
Message 3 of 12

Anonymous
Not applicable

Im already using that at the end of function Pres... How can it help me?

0 Likes
Message 4 of 12

hencoop
Advisor
Advisor

Removing it can help you NOT regen.

Setting REGENMODE = 0 and REGENAUTO OFF can help further.

I believe that some actions will cause a regen regardless of these settings but I do not know which.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes
Message 5 of 12

Anonymous
Not applicable

REGENAUTO wasnt removed from autocad?

0 Likes
Message 6 of 12

ВeekeeCZ
Consultant
Consultant

REGENAUTO... 2016 still there. It!s a command. See HERE

0 Likes
Message 7 of 12

Anonymous
Not applicable

ooooohh i was looking for it as a system variable... But, real problem is that "Automation error: repeated key" that appears at random instances of the loop after first use of Pres... Sometimes it creates only one layout, sometimes i can get 5 before it stops... 😞

0 Likes
Message 8 of 12

hencoop
Advisor
Advisor
So it is in documentation but that is followed by what it does... and it still does in AutoCAD C3D 2017
AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes
Message 9 of 12

hencoop
Advisor
Advisor

Open the VLIDE (command: VLIDE) and open your lisp routine in it.  Turn on "Break on error" under the Debug tab. Load the routine under the Tools tab and then run your routine.  When it fails you should see the VLIDE widow brought to the front of other windows.  Under the Debug tab, select "Last break source" (or press [Ctrl+F9]) to go to the offending statement in your code.  I hope this helps you find the problem.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes
Message 10 of 12

Anonymous
Not applicable

Did you manage to make the lisp work?

0 Likes
Message 11 of 12

maratovich
Advisor
Advisor

This will help you: AutoViewport

 

 

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 12 of 12

hencoop
Advisor
Advisor

I was not the one having the problem.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes