Charpzy Posted March 31, 2023 Posted March 31, 2023 I'm getting a bit of an issue when copying an existing layout, my command auto border boxes from the model space, When I run the command the tab will be in the model space, it will then copy an existing layout ("Landscape" or "Portrait") but because it either of them table are selected it does put it on the page correctly is shows it as below: if all the border after this are portrait it borders them pine on the page, but if it then went from portrait to landscape it would do the same issue of not putting the layout coorect onto the page, the issue seems to be when the same orientation tab isnt selected to copy from I then have to go into each tab individually, do page setup, then click okay to fix it. is there anyway to make sure its defaulting straight to the page like below: Snippet of code: (command ".layout" "copy" orientation txt-value) (setq layname (vla-Item layouts (1- (vla-get-Count layouts)))) (vla-put-ActiveLayout doc layname) (vla-put-Mspace doc :vlax-true) (vla-ZoomWindow app LL- UR-) (vla-put-Mspace doc :vlax-false) "orientation" is the tab/ layout to copy from ("Landscape" or "Portrait") Quote
devitg Posted March 31, 2023 Posted March 31, 2023 2 hours ago, Charpzy said: I'm getting a bit of an issue when copying an existing layout, my command auto border boxes from the model space, When I run the command the tab will be in the model space, it will then copy an existing layout ("Landscape" or "Portrait") but because it either of them table are selected it does put it on the page correctly is shows it as below: if all the border after this are portrait it borders them pine on the page, but if it then went from portrait to landscape it would do the same issue of not putting the layout coorect onto the page, the issue seems to be when the same orientation tab isnt selected to copy from I then have to go into each tab individually, do page setup, then click okay to fix it. is there anyway to make sure its defaulting straight to the page like below: Snippet of code: (command ".layout" "copy" orientation txt-value) (setq layname (vla-Item layouts (1- (vla-get-Count layouts)))) (vla-put-ActiveLayout doc layname) (vla-put-Mspace doc :vlax-true) (vla-ZoomWindow app LL- UR-) (vla-put-Mspace doc :vlax-false) "orientation" is the tab/ layout to copy from ("Landscape" or "Portrait") @Charpzy Please upload sample.dwg , and LISP you are dealing for such task. Quote
Charpzy Posted March 31, 2023 Author Posted March 31, 2023 6 minutes ago, devitg said: @Charpzy Please upload sample.dwg , and LISP you are dealing for such task. see attached, LAYGEN and select any of the borders in the model space. should be good from there test.dwg border.lsp Quote
BIGAL Posted April 1, 2023 Posted April 1, 2023 (edited) I do something similar I would suggest make the rectang a block you need 2 land and portrait, so the block can have a scale that eventually reflects the mview scale. When placed over dwg objects. Has advantage of angle also. Edited April 1, 2023 by BIGAL 1 Quote
mhupp Posted April 1, 2023 Posted April 1, 2023 Simplified the code should run faster. I don't like how txt-value is getting assigned but look below. added "Landscape" or "Portrait so everything is being calculated at one time. updated how width and height was being calculated repleaced (nth # with the correct car cadr caddr or last) this will make it run faste Two things I suggest. 1. Make the boarders a block with an attribute. This will make it so the user doesn't have to select anything. and you could add features like moving the blocks to a new location and it would update the layout. 2. their isn't a limit check for what your clicking other then polyline. you could create 100 different layouts if you select something by accident. the simple fix would be to check the sslength of ss and if its over 10 or so ask if you want to continue. You have 37 objects selected do you want to continue (Yes/<No>): @BIGAL Beat me again! Border2.0.lsp Quote
BIGAL Posted April 1, 2023 Posted April 1, 2023 Two versions of the make layouts, follow a pline or copy based on X Axis. Both support move, rotate, delete, add before making layouts. Think as payment. Quote
Charpzy Posted April 1, 2023 Author Posted April 1, 2023 14 hours ago, mhupp said: Simplified the code should run faster. I don't like how txt-value is getting assigned but look below. added "Landscape" or "Portrait so everything is being calculated at one time. updated how width and height was being calculated repleaced (nth # with the correct car cadr caddr or last) this will make it run faste Two things I suggest. 1. Make the boarders a block with an attribute. This will make it so the user doesn't have to select anything. and you could add features like moving the blocks to a new location and it would update the layout. 2. their isn't a limit check for what your clicking other then polyline. you could create 100 different layouts if you select something by accident. the simple fix would be to check the sslength of ss and if its over 10 or so ask if you want to continue. You have 37 objects selected do you want to continue (Yes/<No>): @BIGAL Beat me again! Border2.0.lsp 2.47 kB · 3 downloads This works perfct thanks, still a bit of an issue when dealing with large files, for example below file has 70 ish plans (probably not the best way to draw in CAD regarding file sizes) the delays occur when its exiting the mspace inside the layout tab, creating a new tab and moving to next. im assuming this is just down to rendering/ computer performance also im still having the issue of the boarders not always defaulting onto the paper, i will look to create a block like you suggested thanks mhupp, regarding the selection of the polyline, i'm going to be moving it over to a specific layer something like "layout boarders" for example to prevent picking up anything by accident Quote
BIGAL Posted April 2, 2023 Posted April 2, 2023 (edited) Something like this its title block and scale chosen. Just select all and yes look for rectangs on a certain layer, then layouts created. Draw rectangs.mp4 Edited April 2, 2023 by BIGAL Quote
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.