lastknownuser Posted November 11, 2022 Share Posted November 11, 2022 I'm trying to select viewport from layout of another drawing. I'm using functions atached below to get another drawing layouts list, and I'd like get viewport dimensions of a certain layout. What would be the best way to do this? Any way to use ssget in layout of another drawing to select viewport? (defun getdrawinglayouts ( dwg / doc idx rtn ) (if (setq doc (LM:getdocumentobject dwg)) (progn (vlax-for lyt (vla-get-layouts doc) (setq rtn (cons (vla-get-name lyt) rtn) idx (cons (vla-get-taborder lyt) idx) ) ) (vlax-release-object doc) (mapcar '(lambda ( n ) (nth n rtn)) (vl-sort-i idx '<)) ) ) ) (defun LM:getdocumentobject ( dwg / app dbx dwl err vrs ) (cond ( (not (setq dwg (findfile dwg))) nil) ( (cdr (assoc (strcase dwg) (vlax-for doc (vla-get-documents (setq app (vlax-get-acad-object))) (setq dwl (cons (cons (strcase (vla-get-fullname doc)) doc) dwl)) ) ) ) ) ( (progn (setq dbx (vl-catch-all-apply 'vla-getinterfaceobject (list app (if (< (setq vrs (atoi (getvar 'acadver))) 16) "objectdbx.axdbdocument" (strcat "objectdbx.axdbdocument." (itoa vrs)) ) ) ) ) (or (null dbx) (vl-catch-all-error-p dbx)) ) (prompt "\nUnable to interface with ObjectDBX.") ) ( (vl-catch-all-error-p (setq err (vl-catch-all-apply 'vla-open (list dbx dwg)))) (prompt (strcat "\n" (vl-catch-all-error-message err))) ) ( dbx ) ) ) Quote Link to comment Share on other sites More sharing options...
mhupp Posted November 12, 2022 Share Posted November 12, 2022 (edited) http://www.lee-mac.com/steal.html (Steal "C:\\My Folder\\MyDrawing.dwg" '(( "Layouts" ("Layout1" "Layout2"))) Edited November 12, 2022 by mhupp 1 1 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 13, 2022 Share Posted November 13, 2022 Ok do it in an entire different way, select client, then select sheet size and orientation. The client specific bits are added to the correct layout. If it's your company layouts only even easier. Just use layout command with "T" option to get from another dwg. This is part of make layouts along pline. Happy to discuss further not free but cheap. 1 Quote Link to comment Share on other sites More sharing options...
lastknownuser Posted November 17, 2022 Author Share Posted November 17, 2022 Thanks for replies, didn't get the answer to my question, maybe because it can't be done, but I managed to get other drawing VP dimensions by importing certain layout from that selected drawing to my drawing, ssget in that layout for viewport and get its dimensions, and then just delete that layout. Thought it will slow down my program but it works very fast. @BIGAL And that is the idea - to create automatic layouts along certain path, I did that, but not all layouts we use have the same VP dimensions so I wanted to add that option to choose what layouts to create Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 18, 2022 Share Posted November 18, 2022 The image above is 2 steps create the rectangs then make the layouts so I guess could do different sizes, even down to a rectang is at different scale, ie a detail, you can attach say size and scale to rectang using XDATA. I do something similar for plotting auto detect Landscape and Portrait but it uses block details. So think about step 2. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.