& Construction

Integrated BIM tools, including Revit, AutoCAD, and Civil 3D
& Manufacturing

Professional CAD/CAM tools built on Inventor and AutoCAD
Integrated BIM tools, including Revit, AutoCAD, and Civil 3D
Professional CAD/CAM tools built on Inventor and AutoCAD
Hi Everyone,
Please help me to create automatic layouts for the attached drawing
Also request you to please provide me the LISP/FAS file.
The attache dwg is simple drawing. But i have 200 grids in some cases.
Please help on this.
Thank you in advance.
Solved! Go to Solution.
What these two refer to?
(setq ssvp1 (ssget "x" (list (cons 0 "VIEWPORT") (cons -4 "*,>,*") (list 10 0 TitleBlockHeight 0)))) (setq ssvp2 (ssget "x" (list (cons 0 "VIEWPORT") (cons -4 "*,<,*") (list 10 0 TitleBlockHeight 0))))
I understand that the first refers to the first viewport, and the second to the second viewport, but I don't understand the conditions.
I am trying to adapt the routine to my layout, but no matter what viewport I make it always ends just creating the layouts and not getting the viewports scaled to the object. But however it works with the layout that was used as a template. Trying to compare that layout and viewport with my layout and viewport I cannot seem to find the difference... I think it is tied to that specific viewport created that maybe is defined in the lisp routine somehow, but cannot see where to change to make it work. So yeah, it works only with the original layout and viewport.
So can anyone decodify the line for me? 🙂
I am trying to make the routine work for both cases with one viewport and one viewport and a keymap viewport...
Dear
sudhakar would you please explain me how you made "Test2.dwg"
Thanks
Dear sir,
would you please tell how to prepared a drawing before execute this lisp.
specially draw rectangle block and their numbering include attribute with in.
Thanks.
check out this Auto Layout for automatic sheet creation.
https://apps.autodesk.com/ACD/en/Detail/Index?id=8869324049075388295&appLang=en&os=Win32_64
When I create automatic layouts with drawing :LONG1.LISP works fine. But when I change VIEWPORT position with drawing :Long2 to match my commonly used name frame, lisp doesn't work properly. Please help me adjust the lisp so that with drawing:Long2 works
Hi, this code its very helpful for me, even nowadays, thanks!
Can you help me with some modifications?
I need to delete the 2nd viewport function and I need to change NO_OF_SHEETS for NEXT_SHEET
My blocks are aligned and separated a fixed distance on the X axis, so the order of the pages must be ascending on the X axis
I attach my drawing
Hope you can help me,
Regards!
Hi, to make it work with only one viewport refer to next link
regards
someone please guide steps to make it work newbie.
What commands to use and how to config according to our requirement?
Happy to discuss, the issue is everyone has different size title blocks and view ports so must customise the software to suit. This is mine.
The end result in this case follows a pline or it can be grids of reactangs.
Hello friends,
I would like to adapt the "GridsToLayouts.lsp" lisp from @lando7189 to my "CFA-F_A3_2014" block,
I don't need the additional window at the bottom right.
The only thing that interests me is to be able to select my rectangles in model space and to have the page number (Folio attribute of the model space rectangle) indicated in this rectangle (ex. 01a or 02b etc).
I attach a dwg so that you can understand me.
In the object space I drew rectangles in red which could correspond to any drawing.
Thanks in advance to those who will help me.
So a layout for every block. The layout has a title block appears to be a A3 size, custom scale I think should be 1.00 but make the mview match just inside the layout same as you have now. The way to go is work out centroid of block and use that in the mview property centre. I have make rectangs and then layouts, so will have a think about it based on your blocks.
Hi,
Thank you,
but i have problem, i have this message
"Automation error Problem loading VBA" when i launch the lisp
Its your lucky day, you owe me a beer. two things moved the block "E0-Cadre" so left corner is 0,0. The other is renamed the layout to Master and set the mview to unlocked. So if using a template edit these items. You can change the layout name in your dwg but must match in code.
Extra plot layouts by range. Can be provided more beer.
; Make new layout tabs based on block in model spce
; By AlanH July 2023
(defun mktabs ( / ss obj inspt atts layname cpt bl tr ss2)
(setvar 'ctab "Model")
(command "zoom" "E")
(setq ss (ssget "X" '((0 . "INSERT")(2 . "E0-Cadre")(410 . "Model"))))
(repeat (setq x (sslength ss))
(setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1)))))
(setq inspt (vlax-get obj 'insertionpoint))
(setq atts (vlax-invoke obj 'Getattributes))
(setq layname (vlax-get (nth 0 atts) 'textstring))
(setq cpt (mapcar '+ inspt (list 212.7405 137.0 0.0)))
(setq bl (mapcar '+ inspt (list 20 30 0.0)))
(setq tr (mapcar '+ inspt (list 395 244 0.0)))
(setq ss2 (ssget "WP" (list tr bl)))
(if (= ss2 nil)
(princ "Skip empty block")
(progn
(command "layout" "c" "Master" layname)
(setvar 'ctab layname)
(command "zoom" "E")
(command "mspace")
(command "zoom" "C" cpt "0.9XP")
(command "pspace")
(setq ent (ssname (ssget "x" (list (cons 0 "Viewport")(cons 410 (getvar 'ctab)))) 0))
(setq obj (vlax-ename->vla-object ent))
(vla-put-DisplayLocked obj -1)
(setvar 'ctab "Model")
)
)
)
(princ)
)
(mktabs)
Thank you, but I can't run the lisp, When I load the lisp I have "Commande: _appload MKtabs.lsp correctement chargé(s)
Commande: chaîne du mode ssget incorrecte
Entrez un facteur d'échelle (nX ou nXP):
Commande:
Entrez un facteur d'échelle (nX ou nXP): " which appears in the command line and as soon as I run the lisp using the "MKTABS" command, nothing happens, unknown command.
It works for me, did you make the 3 changes the default layout is named "Master" I also did a bedit on "E0-Cadre" and moved title block to match lower left at 0,0. Set the viewport to unlocked. Did you check it against your sample dwg ? Once you appload it will just run and make the layouts no user interaction required.
Modified test dwg.
Thank u , but i it's dont work, i've this message on command line
and when i enter the MKTABS command, i said me command doesn't exist
I am running in english version I have come across a different language CAD not workig and solution was to add the force english in Command so will look at that and see if it makes any difference. Did you set the Master layout Mview to unlocked ? I lock after making the layout.
Thank you, yes i setted the Master layout Mview to unlocked, but it's probably the fact that the commands are in English.
How to buy
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © 2025 Autodesk Inc. All rights reserved
Type a product name