robobobo Posted July 26, 2022 Share Posted July 26, 2022 Hi all, I am attempting to get a viewport from blocks in modelspace to paperspace with a layout template. I would like this automated by selecting all the blocks in numerical order and placing them on the correct numbered layout. I have found plenty of lisp out there, but nothing that seems to work 100%. I know there are programs out there, but I want to try to learn autolisp with this project. I think I was able to get close with these two: Draw bounding box on object-from Blackbox Create multiple viewport from multiple rectangle in model space-from hmsilva The main difference I want to change below is to select all of my objects, instead of being prompted to select a single object, (defun c:BNDBX (/ eName mn mx) (vl-load-com) (if (setq eName (car (entsel "\n >> Select Object >> "))) (progn (vla-getboundingbox (vlax-ename->vla-object eName) 'mn 'mx) (vl-cmdf "._rectang" (vlax-safearray->list mn) (vlax-safearray->list mx)))) (princ) ) ) I have tried inserting (if (setq eName (ssget "_x" '((0 . "INSERT") (2 . "PageView")))) on the 3rd line with no success. Eventually I would like to have the second code produce layouts in order. But I figured I would get this chunk sorted first. Quote Link to comment Share on other sites More sharing options...
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.